API

Public API

jwst.associations.asn_from_list Module

Create an association from a list.

Functions

asn_from_list(items[, rule])

Create an association from a list.

jwst.associations.asn_gather Module

Copy data that is listed in an association.

Functions

asn_gather(association[, destination, ...])

Copy members of an association from one location to another.

jwst.associations.association Module

Classes

Association([version_id])

Association base class.

Class Inheritance Diagram

Inheritance diagram of jwst.associations.association.Association

jwst.associations.generator.generate Module

Functions

generate(pool, rules[, version_id, finalize])

Generate associations in the pool according to the rules.

jwst.associations.load_asn Module

Load an Association from a file or object.

Functions

load_asn(serialized[, fmt, first, validate, ...])

Load an Association from a file or object.

jwst.associations.main Module

Main entry for the association generator.

Classes

Main([args, pool])

Generate Associations from an Association Pool.

jwst.associations.mkpool Module

Tools for pool creation.

Functions

mkpool(data[, asn_candidate, dms_note, ...])

Create an association pool from a list of FITS files.

jwst.associations.pool Module

Module to handle association pools.

Classes

AssociationPool(*args, **kwargs)

Association pool that is built off an astropy table.

jwst.associations.registry Module

Module to handle association registry and markers.

Classes

AssociationRegistry([definition_files, ...])

The available association rules to match against.

Complete Developer API

jwst.associations.asn_edit Module

Association edit operations.

Functions

add(asn, filenames, exptype)

Add new filenames to association.

reader(association_file)

Read the association file.

remove(asn, filenames, ignore)

Remove the named files from the association.

writer(asn, output_file)

Write the association out to disk.

Classes

AsnFileWarning

Generic association file warning.

jwst.associations.association_io Module

Define the I/O methods for Level 3 associations.

Particularly, load and store associations as JSON.

Functions

json_asn_load(serialized)

Unserialize an association from JSON.

json_asn_dump(asn)

Create JSON representation.

Classes

AssociationEncoder(*[, skipkeys, ...])

JSON encoder to handle Associations and convert Member to dict.

jwst.associations.config Module

Global configuration parameters.

jwst.associations.exceptions Module

Classes

AssociationError

Basic errors related to Associations.

AssociationNotAConstraintError

No matching constraint found.

AssociationNotValidError

Given data structure is not a valid association.

Class Inheritance Diagram

Inheritance diagram of jwst.associations.exceptions.AssociationError, jwst.associations.exceptions.AssociationNotAConstraintError, jwst.associations.exceptions.AssociationNotValidError

jwst.associations.format_template Module

Format template string allowing partial formatting.

Classes

FormatTemplate([separator, key_formats, ...])

Format a template.

jwst.associations.generator.generate_per_candidate Module

Functions

generate_per_candidate(pool, rule_defs[, ...])

Generate associations in the pool according to the rules.

generate_on_candidate(cid_ctype, pool, rule_defs)

Generate associations based on a candidate ID.

ids_by_ctype(pool)

Group candidate IDs by the candidate type.

pool_from_candidate(pool, candidate)

Create a pool containing only the candidate.

jwst.associations.generator.generate_per_pool Module

Functions

generate_per_pool(pool[, rule_defs, ...])

Generate associations on a specified pool.

jwst.associations.lib.acid Module

Association Candidate IDentifier (ACID).

Classes

ACID(inits)

Association Candidate IDentifier.

ACIDMixin(*args, **kwargs)

Enable ACID for rules.

jwst.associations.lib.association_rules Module

Association Definitions: DMS-specific.

Note

This module exposes associations objects defined elsewhere for use in DMS only.

jwst.associations.lib.callback_registry Module

Module to handle association callback registry.

Classes

CallbackRegistry()

Callback registry.

jwst.associations.lib.constraint Module

Constraints in this module are used to define the rules governing association candidate types.

Classes

AttrConstraint(*args, **kwargs)

Test attribute of an item.

Constraint([init, reduce, name, ...])

Constraint that is made up of multiple SimpleConstraint.

ConstraintTrue(*args, **kwargs)

Always return True.

SimpleConstraint(*args, **kwargs)

A basic constraint.

SimpleConstraintABC(*args, **kwargs)

Simple constraint abstract base class.

Class Inheritance Diagram

Inheritance diagram of jwst.associations.lib.constraint.AttrConstraint, jwst.associations.lib.constraint.Constraint, jwst.associations.lib.constraint.ConstraintTrue, jwst.associations.lib.constraint.SimpleConstraint, jwst.associations.lib.constraint.SimpleConstraintABC

jwst.associations.lib.counter Module

Classes

Counter([start, step, end])

Like itertools.count but access to the current value.

jwst.associations.lib.diff Module

Tools to diff and compare associations.

Functions

compare_asn_files(left_paths, right_paths[, ...])

Compare association files.

compare_asn_lists(left_asns, right_asns[, ...])

Compare to lists of associations.

compare_asns(left, right[, ...])

Compare two associations.

compare_membership(left, right[, strict_expname])

Compare two associations' membership.

compare_product_membership(left, right[, ...])

Compare membership between products.

check_duplicate_members(product)

Check for duplicate members in an association product.

check_duplicate_products(asns[, ...])

Check for duplicate products in a list of associations.

components(s)

Split string into its components.

exposure_name(path)

Extract the exposure name from a Stage 2 file name.

get_product_names(asns)

Return product names from associations and flag duplicates.

separate_products(asn)

Separate products into individual associations.

Classes

DiffError(*args[, asns])

Base class for difference errors.

CandidateLevelError(*args[, asns])

Candidate level mismatch.

DuplicateMembersError(*args[, asns])

Duplicate members within a product.

DuplicateProductError(*args[, asns])

Duplicate products found.

DifferentProductSetsError(*args[, asns])

Different product sets between groups of associations.

MemberLengthDifferenceError(*args[, asns])

Difference in number of members between associations.

MemberMismatchError(*args[, asns])

Membership does not match.

SubsetError(*args[, asns])

One product is a subset of another.

TypeMismatchError(*args[, asns])

Association type mismatch.

UnaccountedMembersError(*args[, asns])

Members not present in other.

MultiDiffError(*args, **kwargs)

List of diff errors.

jwst.associations.lib.dms_base Module

Association attributes common to DMS-based rules.

Classes

Constraint_NotBkgd(*args, **kwargs)

Match on non-background-target observations.

Constraint_NotBkgdOrTSO(*args, **kwargs)

Match on non-background, non-TSO observations.

Constraint_NotTSO(*args, **kwargs)

Match on non-TSO observations.

Constraint_TargetAcq(*args, **kwargs)

Select on target acquisition exposures.

Constraint_TSO(*args, **kwargs)

Match on Time-Series Observations (TSO).

Constraint_WFSC(*args, **kwargs)

Match on Wave Front Sensing and Control (WFSC) Observations.

DMSAttrConstraint(*args, **kwargs)

DMS-focused attribute constraint.

DMSBaseMixin(*args, **kwargs)

Association attributes common to DMS-based rules.

Class Inheritance Diagram

Inheritance diagram of jwst.associations.lib.dms_base.Constraint_NotBkgd, jwst.associations.lib.dms_base.Constraint_NotBkgdOrTSO, jwst.associations.lib.dms_base.Constraint_NotTSO, jwst.associations.lib.dms_base.Constraint_TargetAcq, jwst.associations.lib.dms_base.Constraint_TSO, jwst.associations.lib.dms_base.Constraint_WFSC, jwst.associations.lib.dms_base.DMSAttrConstraint, jwst.associations.lib.dms_base.DMSBaseMixin

jwst.associations.lib.keyvalue_registry Module

Key/value registry.

Classes

KeyValueRegistry([items, default])

Provide a dict-like registry.

KeyValueRegistryError(*args)

Exception class for key value in registry.

KeyValueRegistryNoKeyFoundError(*args)

No key in registry.

KeyValueRegistryNotSingleItemError(*args)

Passed item is a list and not a single item.

jwst.associations.lib.log_config Module

Configure association logging.

Functions

log_config([name, user_name, logger_config, ...])

Set up logging with defaults.

jwst.associations.lib.member Module

Association member for storing exposure metadata as dict-like objects.

Classes

Member([initialdata, item])

Member of an association.

jwst.associations.lib.process_list Module

Reprocessing lists and queues for associations.

A process list, ProcessList, is a list of (items, rules) and meta information, most notably work_over, which is one of the values in ListCategory, which defines which stage (order or priority, starting with zero) of association processing the list is relevant to.

Process lists are primarily put into queues for processing. There are two queues for handling ProcessList:

  • ProcessListQueue is a basic First-In-First-Out (FIFO) queue that can be used as a generator.

  • ProcessQueueSorted returns process lists according to their priority as defined by each list’s work_over. An important aspect of this queue is that it is mutable, i.e., new process lists can be added to the queue during iteration.

Classes

ListCategory(*values)

The work_over categories for association process lists.

ProcessList([items, rules, work_over, ...])

An association process list.

ProcessListQueue([init])

First-In-First-Out queue of association process lists.

ProcessItem(obj)

Items to be processed.

ProcessQueue

Make a deque iterable and mutable.

ProcessQueueSorted([init])

Sort ProcessItem based on work_over.

jwst.associations.lib.product_utils Module

Utilities for product manipulation.

Functions

sort_by_candidate(asns)

Sort associations by candidate.

get_product_names(asns)

Return product names from associations and flag duplicates.

jwst.associations.lib.prune Module

Utilities to prune JWST DMS associations.

Functions

prune(asns)

Remove duplicates and subset associations.

prune_duplicate_associations(asns)

Remove duplicate associations in favor of lower level versions.

prune_duplicate_products(asns)

Remove duplicate products in favor of higher level versions.

prune_remove(remove_from, to_remove, known_dups)

Remove or rename associations to be pruned.

identify_dups(asns)

Separate associations based on whether they have already been identified as duplicates.

jwst.associations.lib.rules_level2_base Module

Base classes which define the Level2 Associations.

Classes

AsnMixin_Lv2Image()

Level 2 image association base.

AsnMixin_Lv2Nod()

Associations that need to create nodding associations.

AsnMixin_Lv2Imprint()

Level 2 association handling for matching imprint images.

AsnMixin_Lv2Special()

Process special and non-science exposures as science.

AsnMixin_Lv2Spectral(*args, **kwargs)

Level 2 spectral association base.

AsnMixin_Lv2WFSS()

Utility and overrides for WFSS associations.

Constraint_Background(*args, **kwargs)

Select backgrounds.

Constraint_Base()

Select on program and instrument.

Constraint_ExtCal()

Remove any nis_extcals from the associations.

Constraint_Image_Nonscience()

Select on non-science images.

Constraint_Image_Science(*args, **kwargs)

Select on science images.

Constraint_Imprint()

Select on imprint exposures.

Constraint_Imprint_Special([association])

Select on imprint exposures with mosaic tile number.

Constraint_Mode()

Select on instrument and optical path.

Constraint_Single_Science(has_science_fn, ...)

Allow only single science exposure.

Constraint_Special(*args, **kwargs)

Select on backgrounds and other auxiliary images.

Constraint_Spectral_Science([exclude_exp_types])

Select on spectral science.

Constraint_Target()

Select on target ID.

DMSLevel2bBase(*args, **kwargs)

Basic class for DMS Level2 associations.

Utility()

Utility functions that understand DMS Level 2 associations.

jwst.associations.lib.rules_level2b Module

Association Definitions: DMS Level2b product associations.

Classes

Asn_Lv2CoronAsRate(*args, **kwargs)

Create normal rate products for some coronographic data.

Asn_Lv2FGS(*args, **kwargs)

Level2b FGS Association.

Asn_Lv2Image(*args, **kwargs)

Level2b Non-TSO Science Image Association.

Asn_Lv2ImageNonScience(*args, **kwargs)

Level2b Non-Science Image Association.

Asn_Lv2ImageSpecial(*args, **kwargs)

Level2b Auxiliary Science Image Association.

Asn_Lv2ImageTSO(*args, **kwargs)

Level2b Time Series Science Image Association.

Asn_MIRLRSTAConfirm(*args, **kwargs)

Level2b MIRI LRS slit/slitless association with TA image.

Asn_Lv2MIRLRSFixedSlitNod(*args, **kwargs)

Level2b MIRI LRS Fixed Slit background nods Association.

Asn_Lv2NRSFSS(*args, **kwargs)

Level2b NIRSpec Fixed-slit Association.

Asn_Lv2NRSIFUNod(*args, **kwargs)

Level2b NIRSpec IFU Association.

Asn_Lv2NRSLAMPImage(*args, **kwargs)

Level2b NIRSpec image Lamp Calibrations Association.

Asn_Lv2NRSLAMPSpectral(*args, **kwargs)

Level2b NIRSpec spectral Lamp Calibrations Association.

Asn_Lv2NRSMSA(*args, **kwargs)

Level2b NIRSpec MSA Association.

Asn_Lv2Spec(*args, **kwargs)

Level2b Science Spectral Association.

Asn_Lv2SpecImprint(*args, **kwargs)

Level2b Treat Imprint/Leakcal as science.

Asn_Lv2SpecSpecial(*args, **kwargs)

Level2b Auxiliary Science Spectral Association.

Asn_Lv2SpecTSO(*args, **kwargs)

Level2b Time Series Science Spectral Association.

Asn_Lv2WFSSNIS(*args, **kwargs)

Level2b WFSS/GRISM Association.

Asn_Lv2WFSSNRC(*args, **kwargs)

Level2b WFSS/GRISM Association.

Asn_Lv2WFSSMIR(*args, **kwargs)

Level2b MIR WFSS Association.

Asn_Lv2WFSSParallel(*args, **kwargs)

Level 2b WFSS/GRISM associations for WFSS taken in pure-parallel mode.

Asn_Lv2WFSC(*args, **kwargs)

Level2b Wavefront Sensing & Control Association.

Class Inheritance Diagram

Inheritance diagram of jwst.associations.lib.rules_level2b.Asn_Lv2CoronAsRate, jwst.associations.lib.rules_level2b.Asn_Lv2FGS, jwst.associations.lib.rules_level2b.Asn_Lv2Image, jwst.associations.lib.rules_level2b.Asn_Lv2ImageNonScience, jwst.associations.lib.rules_level2b.Asn_Lv2ImageSpecial, jwst.associations.lib.rules_level2b.Asn_Lv2ImageTSO, jwst.associations.lib.rules_level2b.Asn_MIRLRSTAConfirm, jwst.associations.lib.rules_level2b.Asn_Lv2MIRLRSFixedSlitNod, jwst.associations.lib.rules_level2b.Asn_Lv2NRSFSS, jwst.associations.lib.rules_level2b.Asn_Lv2NRSIFUNod, jwst.associations.lib.rules_level2b.Asn_Lv2NRSLAMPImage, jwst.associations.lib.rules_level2b.Asn_Lv2NRSLAMPSpectral, jwst.associations.lib.rules_level2b.Asn_Lv2NRSMSA, jwst.associations.lib.rules_level2b.Asn_Lv2Spec, jwst.associations.lib.rules_level2b.Asn_Lv2SpecImprint, jwst.associations.lib.rules_level2b.Asn_Lv2SpecSpecial, jwst.associations.lib.rules_level2b.Asn_Lv2SpecTSO, jwst.associations.lib.rules_level2b.Asn_Lv2WFSSNIS, jwst.associations.lib.rules_level2b.Asn_Lv2WFSSNRC, jwst.associations.lib.rules_level2b.Asn_Lv2WFSSMIR, jwst.associations.lib.rules_level2b.Asn_Lv2WFSSParallel, jwst.associations.lib.rules_level2b.Asn_Lv2WFSC

jwst.associations.lib.rules_level3_base Module

Base classes which define the Level3 Associations.

Classes

AsnMixin_AuxData()

Process special and non-science exposures as science.

AsnMixin_Coronagraphy(*args, **kwargs)

Basic overrides for Coronagraphy associations.

AsnMixin_Science(*args, **kwargs)

Basic science constraints.

AsnMixin_Spectrum(*args, **kwargs)

All things that are spectrum.

Constraint_Base()

Select on program and instrument.

Constraint_IFU(*args, **kwargs)

Constrain on IFU exposures.

Constraint_Image(*args, **kwargs)

Select on exposure type.

Constraint_MSA()

Constrain on NIRSpec MSA exposures that are spectral.

Constraint_Obsnum(*args, **kwargs)

Select on OBSNUM.

Constraint_Optical_Path()

Select on optical path.

Constraint_Spectral(*args, **kwargs)

Constrain on spectral exposure types.

Constraint_Target([association])

Select on target.

DMS_Level3_Base(*args, **kwargs)

Base class for DMS Level 3 associations.

Utility()

Utility functions that understand DMS Level 3 associations.

jwst.associations.lib.rules_level3 Module

Association Definitions: DMS Level3 product associations.

Classes

Asn_Lv3ACQ_Reprocess(*args, **kwargs)

Level 3 Gather Target Acquisitions.

Asn_Lv3AMI(*args, **kwargs)

Level 3 Aperture Mask Interferometry Association.

Asn_Lv3Image(*args, **kwargs)

Level 3 Science Image Association.

Asn_Lv3ImageMosaic(*args, **kwargs)

Level 3 Science Image Mosaic Association.

Asn_Lv3ImageBackground(*args, **kwargs)

Level 3 Background Image Association.

Asn_Lv3MIRCoron(*args, **kwargs)

Level 3 Coronagraphy Association.

Asn_Lv3MIRMRS(*args, **kwargs)

Level 3 MIRI MRS Association.

Asn_Lv3MIRMRSBackground(*args, **kwargs)

Level 3 MIRI MRS Association Auxiliary data.

Asn_Lv3NRCCoron(*args, **kwargs)

Level 3 Coronagraphy Association.

Asn_Lv3NRCCoronImage(*args, **kwargs)

Level 3 Coronagraphy Association handled as regular imaging.

Asn_Lv3NRSFSS(*args, **kwargs)

Level 3 NIRSpec Fixed-Slit Science.

Asn_Lv3NRSIFU(*args, **kwargs)

Level 3 IFU Gratings Association.

Asn_Lv3NRSIFUBackground(*args, **kwargs)

Level 3 Spectral Association.

Asn_Lv3SlitlessSpectral(*args, **kwargs)

Level 3 slitless, target-based, or single-object spectrographic Association.

Asn_Lv3SpecAux(*args, **kwargs)

Level 3 Spectral Association.

Asn_Lv3SpectralSource(*args, **kwargs)

Level 3 slit-like, multi-object spectrographic Association.

Asn_Lv3SpectralTarget(*args, **kwargs)

Level 3 slit-like, target-based or single-object spectrographic Association.

Asn_Lv3TSO(*args, **kwargs)

Level 3 Time-Series Association.

Asn_Lv3WFSCMB(*args, **kwargs)

Level 3 Wavefront Control & Sensing Association.

Asn_Lv3WFSSNIS(*args, **kwargs)

Level 3 NIRISS WFSS/Grism Association.

Asn_Lv3WFSSNRC(*args, **kwargs)

Level 3 NIRCam WFSS/Grism Association.

Asn_Lv3WFSSMIR(*args, **kwargs)

Level 3 MIRI WFSS/PRISM Association.

Class Inheritance Diagram

Inheritance diagram of jwst.associations.lib.rules_level3.Asn_Lv3ACQ_Reprocess, jwst.associations.lib.rules_level3.Asn_Lv3AMI, jwst.associations.lib.rules_level3.Asn_Lv3Image, jwst.associations.lib.rules_level3.Asn_Lv3ImageMosaic, jwst.associations.lib.rules_level3.Asn_Lv3ImageBackground, jwst.associations.lib.rules_level3.Asn_Lv3MIRCoron, jwst.associations.lib.rules_level3.Asn_Lv3MIRMRS, jwst.associations.lib.rules_level3.Asn_Lv3MIRMRSBackground, jwst.associations.lib.rules_level3.Asn_Lv3NRCCoron, jwst.associations.lib.rules_level3.Asn_Lv3NRCCoronImage, jwst.associations.lib.rules_level3.Asn_Lv3NRSFSS, jwst.associations.lib.rules_level3.Asn_Lv3NRSIFU, jwst.associations.lib.rules_level3.Asn_Lv3NRSIFUBackground, jwst.associations.lib.rules_level3.Asn_Lv3SlitlessSpectral, jwst.associations.lib.rules_level3.Asn_Lv3SpecAux, jwst.associations.lib.rules_level3.Asn_Lv3SpectralSource, jwst.associations.lib.rules_level3.Asn_Lv3SpectralTarget, jwst.associations.lib.rules_level3.Asn_Lv3TSO, jwst.associations.lib.rules_level3.Asn_Lv3WFSCMB, jwst.associations.lib.rules_level3.Asn_Lv3WFSSNIS, jwst.associations.lib.rules_level3.Asn_Lv3WFSSNRC, jwst.associations.lib.rules_level3.Asn_Lv3WFSSMIR

jwst.associations.lib.update_path Module

Update path of members in an association.

Functions

update_path(asn, file_path[, target])

Update path of members in an association.

update_key_value(obj, target, func_args[, ...])

Update all instances of a key using a modifier.

replace_path(old_path, new_path)

Replace the path prefix of the basename.

jwst.associations.lib.utilities Module

General utilities for associations.

Functions

constrain_on_candidates(candidates)

Create a constraint based on a list of candidates.

evaluate(value)

Evaluate a value.

filter_discovered_only(associations, ...[, ...])

Return only those associations that have multiple candidates.

getattr_from_list(adict, attributes[, ...])

Retrieve value from dict using a list of attributes.

return_on_exception([exceptions, default])

Force functions raising exceptions to return a value.

getattr_from_list_nofail(*args, **kwargs)

Call getattr_from_list without allowing exceptions.

is_iterable(obj)

General iterator check.

jwst.associations.load_as_asn Module

Treat various objects as Association.

Classes

LoadAsAssociation

Read in or create an association.

LoadAsLevel2Asn

Read in or create a Level 2 association.

jwst.associations.pool Module

Classes

PoolRow([init])

A row from an association pool.

jwst.associations.registry Module

Classes

RegistryMarker()

Mark rules, callbacks, and modules for inclusion into a registry.