read

Functions to read Science Instrument Aperture Files (SIAF) and SIAF reference files.

For JWST SIAF, reading XML and CSV format are supported. For HST SIAF, only .dat files can be read.

Authors

Johannes Sahlmann

References

Parts of read_hst_siaf were adapted from Matt Lallo’s plotap.f. Parts of read_jwst_siaf were adapted from jwxml.

pysiaf.iando.read.get_jwst_siaf_instrument(tree)[source]

Return the instrument specified in the first aperture of a SIAF xml tree.

Returns:
instrumentstr

All Caps instrument name, e.g. NIRSPEC

pysiaf.iando.read.get_siaf(input_siaf, observatory='JWST')[source]

Return a Siaf object corresponding to input_siaf which can be a string path or a Siaf object.

Parameters:
input_siaf
observatory
Returns:
siaf_object: pysiaf.Siaf

Siaf object

pysiaf.iando.read.month_name_to_number(month)[source]

Convert month name to digit.

pysiaf.iando.read.read_hst_fgs_amudotrep(file=None, version=None)[source]

Read HST FGS amu.rep file which contain the TVS matrices.

Parameters:
filepathstr

Path to file.

Returns:
datadict

Dictionary that holds the file content ordered by FGS number

pysiaf.iando.read.read_hst_siaf(file=None, version=None)[source]

Read apertures from HST SIAF file and return a collection.

This was partially ported from Lallo’s plotap.f.

Parameters:
filestr
AperNamesstr list
Returns:
apertures: dict

Dictionary of apertures

pysiaf.iando.read.read_jwst_siaf(instrument=None, filename=None, basepath=None)[source]

Read the JWST SIAF and return a collection of apertures.

Parameters:
instrumentstr

instrument name (case-insensitive)

filenamestr

Absolute path to alternative SIAF xml file

basepathstr

Directory containing alternative SIAF xml file conforming with standard naming convention

Returns:
aperturesdict

dictionary of apertures

pysiaf.iando.read.read_roman_siaf(siaf_file=None)[source]
Returns:
apertures (collections.OrderedDict)

An ordered dictionary of pysiaf.aperture objects containing each aperture from the Roman SIAF file that was read.

pysiaf.iando.read.read_siaf_alignment_parameters(instrument)[source]

Return astropy table.

Parameters:
instrument
Returns:
: astropy table
pysiaf.iando.read.read_siaf_aperture_definitions(instrument, directory=None)[source]

Return astropy table.

Parameters:
instrumentstr

instrument name (case insensitive)

Returns:
: astropy table

content of SIAF reference file

pysiaf.iando.read.read_siaf_ddc_mapping_reference_file(instrument)[source]

Return dictionary with the DDC mapping.

Parameters:
instrumentstr

instrument name (case insensitive)

Returns:
: astropy table
pysiaf.iando.read.read_siaf_detector_layout()[source]

Return the SIAF detector layout read from the SIAF reference file.

Returns:
: astropy table
pysiaf.iando.read.read_siaf_detector_reference_file(instrument)[source]

Return astropy table.

Parameters:
instrumentstr

instrument name (case insensitive)

Returns:
: astropy table
pysiaf.iando.read.read_siaf_distortion_coefficients(instrument=None, aperture_name=None, file_name=None)[source]

Return astropy table.

Parameters:
instrumentstr

instrument name (case insensitive)

aperture_namestr

name of master aperture

file_namestr

file name to read from, ignoring the first two arguments

Returns:
: astropy table
pysiaf.iando.read.read_siaf_xml_field_format_reference_file(instrument=None)[source]

Return astropy table.

Parameters:
instrumentstr

instrument name (case insensitive)

Returns:
: astropy table