RegionsModel

class stdatamodels.jwst.datamodels.RegionsModel(init=None, regions=None, **kwargs)

Bases: ReferenceFileModel

A model for a reference file of type “regions”.

Initialize the model.

Parameters:
initstr, None, optional

File name for input file in ASDF format from which to initialize the model.

regionsnp.ndarray, optional

An array mapping pixels to slices

**kwargs

Additional keyword arguments to pass to ReferenceFileModel

Attributes Summary

reftype

schema_url

The schema URI to validate the model against.

Methods Summary

on_save([path])

Run a hook before writing a model to a file (FITS or ASDF).

populate_meta()

to_fits()

Write a data model to a FITS file.

validate()

Check that required reference file keywords are set.

Attributes Documentation

reftype = 'regions'
schema_url = 'http://stsci.edu/schemas/jwst_datamodel/regions.schema'

The schema URI to validate the model against. If None, only basic validation of required metadata properties (filename, model_type) will occur.

Methods Documentation

on_save(path=None)

Run a hook before writing a model to a file (FITS or ASDF).

Parameters:
initstr

The path to the file that we’re about to save to.

populate_meta()
to_fits()

Write a data model to a FITS file.

Parameters:
initfile path or file object

The file to write to.

*args

Additional positional arguments passed to astropy.io.fits.writeto.

**kwargs

Additional keyword arguments passed to astropy.io.fits.writeto.

validate()

Check that required reference file keywords are set.