Skip to content

drpangloss.savefits

Functions

OIFITS helper utilities for reading and writing AMI products.

rad2mas(rad)

Convert radians to milliarcseconds.

GetWavelength(ins, filt)

Get wavelengths information from using instrument and filter informations.

Format_STAINDEX_V2(tab)

Converts sta_index to save oifits in the appropriate format.

Format_STAINDEX_T3(tab)

Converts sta_index to save oifits in the appropriate format.

ApplyFlag(data, unit='arcsec')

Apply flag and convert to the appropriate units.

save(dic, filename=None, datadir=None, verbose=False)

Save dictionary formatted data into a proper OIFITS (version 2) format file.

Parameters:

Name Type Description Default
dic dict

Dictionary containing extracted OIFITS-compatible tables with keys such as OI_VIS2, OI_VIS, OI_T3, OI_WAVELENGTH, and info.

required
filename str

Output filename. If omitted, the name is derived from entries in dic["info"].

None
datadir str

Destination directory for the output file.

None
verbose bool

If True, print progress while writing tables.

False

Returns:

Type Description
None

Writes an OIFITS file to disk.

cp_indices(vis_sta_index, cp_sta_index)

Map closure-triangle station indices to visibility baseline indices.

Parameters:

Name Type Description Default
vis_sta_index array - like

Visibility station index pairs.

required
cp_sta_index array - like

Closure-phase station index triplets.

required

Returns:

Type Description
tuple[ndarray, ndarray, ndarray]

Arrays (i_cps1, i_cps2, i_cps3) identifying triangle baselines.