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

crds_observatory

override_handle

override_handle identifies in-memory models where a filepath would normally be used.

schema_uri

shape

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_crds_parameters()

Get parameters used by CRDS to select references for this model.

get_primary_array_name()

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

check_type(asdf_file)[source]

Subclass is expected to check for proper type of node

static clone(target, source, deepcopy=False, memo=None)[source]
close()[source]
copy(deepcopy=True, memo=None)[source]
get_crds_parameters()[source]

Get parameters used by CRDS to select references for this model.

Return type:

dict

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”.

info(*args, **kwargs)[source]
items()[source]

Iterates over all of the model items in a flat way.

Each element is a pair (key, value). Each key is a dot-separated name. For example, the schema element meta.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.

open_asdf(init=None, **kwargs)[source]
save(path, dir_path=None, *args, **kwargs)[source]
schema_info(*args, **kwargs)[source]
search(*args, **kwargs)[source]
to_asdf(init, *args, **kwargs)[source]
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

validate()[source]

Re-validate the model instance against the tags