DMSBaseMixin

class jwst.associations.lib.dms_base.DMSBaseMixin(*args, **kwargs)[source]

Bases: ACIDMixin

Association attributes common to DMS-based Rules

sequence

The sequence number of the current association

Type:

int

Attributes Summary

acid

Association ID

asn_name

The association name

current_product

from_items

The list of items that contributed to the association.

member_ids

Set of all member ids in all products of this association

validity

Keeper of the validity tests

Methods Summary

create(item[, version_id])

Create association if item belongs

get_exposure_type(item[, default])

Determine the exposure type of a pool item

is_item_ami(item)

Is the given item AMI (NIRISS Aperture Masking Interferometry)

is_item_coron(item)

Is the given item Coronagraphic

is_item_member(item)

Check if item is already a member of this association

is_item_tso(item[, other_exp_types])

Is the given item TSO

is_member(new_member)

Check if member is already a member

item_getattr(item, attributes)

Return value from any of a list of attributes

new_product([product_name])

Start a new product

reset_sequence()

update_asn([item, member])

Update association meta information

update_degraded_status()

Update association degraded status

update_validity(entry)

validate(asn)

Attributes Documentation

acid

Association ID

asn_name

The association name

The name that identifies this association. When dumped, will form the basis for the suggested file name.

Typically, it is generated based on the current state of the association, but can be overridden.

current_product
from_items

The list of items that contributed to the association.

member_ids

Set of all member ids in all products of this association

validity

Keeper of the validity tests

Methods Documentation

classmethod create(item, version_id=None)[source]

Create association if item belongs

Parameters:
  • item (dict) – The item to initialize the association with.

  • version_id (str or None) – Version_Id to use in the name of this association. If None, nothing is added.

Returns:

2-tuple consisting of:

  • association : The association or, if the item does not match this rule, None

  • [ProcessList[, …]]: List of items to process again.

Return type:

(association, reprocess_list)

get_exposure_type(item, default='science')[source]

Determine the exposure type of a pool item

Parameters:
  • item (dict) – The pool entry to determine the exposure type of

  • default (str or None) – The default exposure type. If None, routine will raise LookupError

Returns:

exposure_type

Exposure type. Can be one of

  • ’science’: Item contains science data

  • ’target_acquisition’: Item contains target acquisition data.

  • ’autoflat’: NIRSpec AUTOFLAT

  • ’autowave’: NIRSpec AUTOWAVE

  • ’psf’: PSF

  • ’imprint’: MSA/IFU Imprint/Leakcal

Return type:

str

Raises:

LookupError – When default is None and an exposure type cannot be determined

is_item_ami(item)[source]

Is the given item AMI (NIRISS Aperture Masking Interferometry)

Determine whether the specific item represents AMI data or not. This simply includes items with EXP_TYPE=’NIS_AMI’.

Parameters:

item (dict) – The item to check for.

Returns:

is_item_ami – Item represents an AMI exposure.

Return type:

bool

is_item_coron(item)[source]

Is the given item Coronagraphic

Determine whether the specific item represents true Coronagraphic data or not. This will include all items in CORON_EXP_TYPES (both NIRCam and MIRI), except for NIRCam short-wave detectors included in a coronagraphic exposure but do not have an occulter in their field-of-view.

Parameters:

item (dict) – The item to check for.

Returns:

is_item_coron – Item represents a true Coron exposure.

Return type:

bool

is_item_member(item)[source]

Check if item is already a member of this association

Parameters:

item (dict) – The item to check for.

Returns:

is_item_member – True if item is a member.

Return type:

bool

is_item_tso(item, other_exp_types=None)[source]

Is the given item TSO

Determine whether the specific item represents TSO data or not. This is used to determine the naming of files, i.e. “rate” vs “rateints” and “cal” vs “calints”.

Parameters:
  • item (dict) – The item to check for.

  • other_exp_types ([str[,...]] or None) – List of other exposure types to consider TSO-like.

Returns:

is_item_tso – Item represents a TSO exposure.

Return type:

bool

is_member(new_member)[source]

Check if member is already a member

Parameters:

new_member (Member) – The member to check for

item_getattr(item, attributes)[source]

Return value from any of a list of attributes

Parameters:
  • item (dict) – item to retrieve from

  • attributes (list) – List of attributes

Returns:

Returns the value and the attribute from which the value was taken.

Return type:

(attribute, value)

Raises:

KeyError – None of the attributes are found in the dict.

new_product(product_name='undefined')[source]

Start a new product

classmethod reset_sequence()[source]
update_asn(item=None, member=None)[source]

Update association meta information

Parameters:
  • item (dict or None) – Item to use as a source. If not given, item-specific information will be left unchanged.

  • member (Member or None) – An association member to use as source. If not given, member-specific information will be update from current association/product membership.

Notes

If both item and member are given, information in member will take precedence.

update_degraded_status()[source]

Update association degraded status

update_validity(entry)[source]
classmethod validate(asn)[source]