drpangloss.oifits_implaneia
Functions
OIFITS helper utilities for reading, plotting, 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 |
required |
filename
|
str
|
Output filename. If omitted, the name is derived from entries in
|
None
|
datadir
|
str
|
Destination directory for the output file. |
None
|
verbose
|
bool
|
If |
False
|
Returns:
| Type | Description |
|---|---|
None
|
Writes an OIFITS file to disk. |
load(filename, target=None, ins=None, mask=None, include_vis=True)
Load an OIFITS file into an internal dictionary representation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filename
|
str
|
Name of the OIFITS file. |
required |
target
|
str
|
Fallback target name if not present in headers. |
None
|
ins
|
str
|
Fallback instrument name if not present in headers. |
None
|
mask
|
str
|
Fallback mask name if not present in headers. |
None
|
include_vis
|
bool
|
If |
True
|
Returns:
| Type | Description |
|---|---|
dict
|
Dictionary containing parsed OIFITS tables and metadata. |
show(inputList, diffWl=False, vmin=0, vmax=1.05, cmax=180, setlog=False, unit='arcsec', unit_cp='deg')
Display visibility and closure-phase diagnostics for one or more datasets.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
inputList
|
list or str or dict
|
Single input or list of inputs, where each item is either an OIFITS
filename or a dictionary produced by |
required |
diffWl
|
bool
|
If |
False
|
vmin
|
float
|
Lower y-axis limit for visibility panel. |
0
|
vmax
|
float
|
Upper y-axis limit for visibility panel. |
1.05
|
cmax
|
float
|
Maximum absolute closure phase for plotting. |
180
|
setlog
|
bool
|
If |
False
|
unit
|
str
|
Unit for spatial frequencies. |
'arcsec'
|
unit_cp
|
str
|
Unit label for closure phases. |
'deg'
|
Returns:
| Type | Description |
|---|---|
Figure
|
Figure containing UV, visibility, and closure-phase panels. |
load_oifits(filename, directory)
Load a single OIFITS file and return flattened AMI-ready observables.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filename
|
str
|
OIFITS file name. |
required |
directory
|
str
|
Directory containing the file. |
required |
Returns:
| Type | Description |
|---|---|
tuple
|
|
cp_indices(vis_sta_index, cp_sta_index)
Extracts indices for calculating closure phase from visibility and closure phase station indices