Main

class jwst.associations.Main(args=None, pool=None)[source]

Bases: object

Generate Associations from an Association Pool.

Parameters:
argslist of str or None

The command line arguments. Can be one of:

  • None: Command line arguments are then used.

  • List of str: A list of strings which create the command line with the similar structure as sys.argv

poolNone or AssociationPool

If None, a pool file must be specified in the args. Otherwise, an AssociationPool.

Attributes:
poolAssociationPool

The pool read in, or passed in through the parameter pool.

rulesAssociationRegistry

The rules used for association creation.

associationslist of Association

The list of generated associations.

Notes

Refer to the Association Generator documentation for a full description.

Attributes Summary

orphaned

The pool of exposures that do not belong to any association.

Methods Summary

cli([args, pool])

Run the full association generation process.

configure([args, pool])

Configure to prepare for generation.

generate()

Generate the associations.

parse_args([args, has_pool])

Set command line arguments.

save()

Save the associations to disk.

Attributes Documentation

orphaned

The pool of exposures that do not belong to any association.

Returns:
poolAssociationPool

The pool of orphaned exposures.

Methods Documentation

classmethod cli(args=None, pool=None)[source]

Run the full association generation process.

Parameters:
argslist of str or None

The command line arguments. Can be one of:

  • None: Command line arguments are then used.

  • List of str: A list of strings which create the command line with the similar structure as sys.argv

poolNone or AssociationPool

If None, a pool file must be specified in the args. Otherwise, an AssociationPool.

Returns:
generatorMain

A fully executed association generator.

configure(args=None, pool=None)[source]

Configure to prepare for generation.

Parameters:
argslist of str or None

The command line arguments. Can be one of:

  • None: Command line arguments are then used.

  • List of str: A list of strings which create the command line with the similar structure as sys.argv

poolNone or AssociationPool

If None, a pool file must be specified in the args. Otherwise, an AssociationPool.

generate()[source]

Generate the associations.

parse_args(args=None, has_pool=False)[source]

Set command line arguments.

Parameters:
argslist, str, or None

List of command-line arguments. If a string, spaces separate the arguments. If None, sys.argv is used.

has_poolbool-like

Do not require pool from the command line if a pool is already in hand.

save()[source]

Save the associations to disk.