DMSBaseMixin
- class jwst.associations.lib.dms_base.DMSBaseMixin(*args, **kwargs)[source]
Bases:
ACIDMixin
Association attributes common to DMS-based Rules.
Attributes Summary
Association candidate ID.
The association name.
Return last entry in products list.
The list of items that contributed to the association.
Set of all member ids in all products of this association.
The sequence number of the current association.
Keeper of the validity tests.
Methods Summary
create
(item[, version_id])Create association if item belongs.
Get string representation of the exposure id.
get_exposure_type
(item[, default])Determine the exposure type of a pool item.
Get string representation of the grating in use.
Get string representation of the instrument.
Get string representation of the optical elements.
Get string representation of the slit name (NIRSpec fixed-slit only).
Get string representation of the subarray.
Get string representation of the target.
is_item_ami
(item)Determine whether the specific item represents AMI data or not.
is_item_coron
(item)Determine whether the specific item is coronagraphic data.
is_item_member
(item)Check if item is a member of this association.
is_item_tso
(item[, other_exp_types])Determine whether given item is TSO.
is_member
(new_member)Check if member is already a member of product members list.
item_getattr
(item, attributes)Return value from any of a list of attributes.
new_product
([product_name])Start a new product.
Reset sequence counter to one.
update_asn
([item, member])Update association meta information.
Update association degraded status.
update_validity
(entry)Update validity checks for validity tests that aren't validated.
validate
(asn)Validate candidate against all asn validity tests.
Attributes Documentation
- 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.
- Returns:
The association name in lowercase.
- Return type:
- current_product
Return last entry in products list.
- Returns:
Last entry in products list.
- Return type:
- from_items
The list of items that contributed to the association.
- Returns:
List of items contributing to association.
- Return type:
- member_ids
Set of all member ids in all products of this association.
- Returns:
Set of member ids.
- Return type:
- sequence = <jwst.associations.lib.counter.Counter object>
The sequence number of the current association.
Methods Documentation
- classmethod create(item, version_id=None)[source]
Create association if item belongs.
- Parameters:
- 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()[source]
Get string representation of the exposure id.
- Returns:
exposure – The Level3 Product name representation of the exposure & activity id.
- Return type:
- get_exposure_type(item, default='science')[source]
Determine the exposure type of a pool item.
- Parameters:
- 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:
- Raises:
LookupError – When
default
is None and an exposure type cannot be determined
- get_grating()[source]
Get string representation of the grating in use.
- Returns:
grating – The Level3 Product name representation of the grating in use.
- Return type:
- get_instrument()[source]
Get string representation of the instrument.
- Returns:
instrument – The Level3 Product name representation of the instrument
- Return type:
- get_opt_element()[source]
Get string representation of the optical elements.
This includes only elements contained in the filter/pupil wheels of the instrument.
- Returns:
opt_elem – The Level3 Product name representation of the optical elements.
- Return type:
- get_slit_name()[source]
Get string representation of the slit name (NIRSpec fixed-slit only).
- Returns:
slit_name – The Level3 Product name representation of the slit name.
- Return type:
- get_subarray()[source]
Get string representation of the subarray.
- Returns:
subarray – The Level3 Product name representation of the subarray.
- Return type:
- get_target()[source]
Get string representation of the target.
- Returns:
target – The Level3 Product name representation of the target or source ID.
- Return type:
- is_item_ami(item)[source]
Determine whether the specific item represents AMI data or not.
This simply includes items with EXP_TYPE=’NIS_AMI’.
- is_item_coron(item)[source]
Determine whether the specific item is coronagraphic data.
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.
- is_item_tso(item, other_exp_types=None)[source]
Determine whether given item is TSO.
This is used to determine the naming of files, i.e. “rate” vs “rateints” and “cal” vs “calints”.
- is_member(new_member)[source]
Check if member is already a member of product members list.
- Parameters:
new_member (Member) – The member to check for
- Returns:
True if member is already in current product members list.
- Return type:
- 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
andmember
are given, information inmember
will take precedence.