DataModel
- class roman_datamodels.datamodels.DataModel(init=None, **kwargs)[source]
Bases:
ABC
Base class for all top level datamodels
Handle the case where one passes in an already instantiated version of the model. In this case the constructor should just directly return the model.
Attributes Summary
override_handle identifies in-memory models where a filepath would normally be used.
Methods Summary
check_type
(asdf_file)Subclass is expected to check for proper type of node
clone
(target, source[, deepcopy, memo])close
()copy
([deepcopy, memo])Get parameters used by CRDS to select references for this model.
Returns the name "primary" array for this model, which controls the size of other arrays that are implicitly created.
info
(*args, **kwargs)items
()Iterates over all of the model items in a flat way.
open_asdf
([init])save
(path[, dir_path])schema_info
(*args, **kwargs)search
(*args, **kwargs)to_asdf
(init, *args, **kwargs)to_flat_dict
([include_arrays])Returns a dictionary of all of the model items as a flat dictionary.
validate
()Re-validate the model instance against the tags
Attributes Documentation
- crds_observatory = 'roman'
- override_handle
override_handle identifies in-memory models where a filepath would normally be used.
- schema_uri
- shape
Methods Documentation
- get_crds_parameters()[source]
Get parameters used by CRDS to select references for this model.
- Return type:
- get_primary_array_name()[source]
Returns the name “primary” array for this model, which controls the size of other arrays that are implicitly created. This is intended to be overridden in the subclasses if the primary array’s name is not “data”.
- items()[source]
Iterates over all of the model items in a flat way.
Each element is a pair (
key
,value
). Eachkey
is a dot-separated name. For example, the schema elementmeta.observation.date
will end up in the result as:("meta.observation.date": "2012-04-22T03:22:05.432")
Unlike the JWST DataModel implementation, this does not use schemas directly.
- to_flat_dict(include_arrays=True)[source]
Returns a dictionary of all of the model items as a flat dictionary.
Each dictionary key is a dot-separated name. For example, the model element
meta.observation.date
will end up in the dictionary as:{ "meta.observation.date": "2012-04-22T03:22:05.432" }
This differs from the JWST data model in that the schema is not directly used