LoadAsAssociation
- class jwst.associations.load_as_asn.LoadAsAssociation[source]
Bases:
dictRead in or create an association.
Notes
This class is normally not instantiated. The
load()method should be used as the factory method to read an association or create one from a string orJwstDataModelobject, or a list of such objects.Methods Summary
load(obj[, meta, registry, rule, ...])Load object and return an association of it.
Methods Documentation
- classmethod load(obj, meta=None, registry=<class 'jwst.associations.registry.AssociationRegistry'>, rule=<class 'jwst.associations.association.Association'>, product_name_func=None)[source]
Load object and return an association of it.
- Parameters:
- obj
Association, str, dict,JwstDataModel, list of str, or list ofJwstDataModel The object to return as an association.
- metadict or None
Metadata to attach to the association. If not given, a built-in default is used.
- registry
AssociationRegistry The registry to use to load an association file with.
- rule
Association The rule to use if an association needs to be created.
- product_name_funcfunc
A function, when given the argument of
obj, or ifobjis a list, each item inobj, returns a string that will be used as the product name in the association.
- obj
- Returns:
- association
Association An association created using given object.
- association
Notes
Along with the attributes belonging to a Level 2 association, the filename is added here, if such a file was passed in. Otherwise a default value is given.