OIFITS (Data Exchange Standard for Optical Interferometry, A&A 597, A8, 2017)
Project description
Brief intro
Purpose
Read and manipulate Optical Interferometry FITS files version 1 and 2.
For a definition of the standards
- version 2: Duvert at al. (2017), A&A 597, A8 (abstract) (pre-print)
- version 1: Pauls et al. (2005), PASP 117, 1255 (abstract) (pre-print)
Installation
It is packaged as pyoifits.
Site-wide installation will be performed with sudo -H pip3 install pyoifits on unix-like systems. At a user level, within a virtual environment, pip3 install pyoifits.
Short example
Read and merge to OIFITS datasets and tranform to a standard astropy table.
import pyoifits as oifits
data = oifits.openlist(['file1.fits', 'file2.fits'])
tab, corr = data.to_table(correlations='numpy')
obs = tab['observable']
x = tab['value']
dx = tab['error']
cov = corr * np.outer(dx, dx)
There is also a short demo.
Classes and functions
Classes
Classes are in astropy.io.fits tree, they derive either from HDUList (FITS file) or BinTableHDU (FITS table). The end user shouldn't need to manipulate them explicitly as helper functions are provided.
An OIFITS1 object (OIFITS standard version 1, < _OIFITS < astropy.io.fits.HDUList) contains
- one
PrimaryHDU1object (<astropy.io.fits.PrimaryHDU) - several
_OITableHDU1objects (abstract OI table class, <_OITableHDU<astropy.io.fits.BinTableHDU) which can be of the derived typesTargetHDU1(OI_TARGETextrension)ArrayHDU1(OI_ARRAYextension)WavelengthHDU1(OI_WAVELENGTHextension, <astropy.io.fits.BinTableHDU)_DataHDU1(abstract data class, <astropy.io.fits.BinTableHDU)VisHDU1(OI_VISextension)Vis2HDU1(OI_VIS2extension)T3HDU1(OI_T3extension)
- any other FITS extension
An OIFITS2 object (OIFITS standard version 2, < _OIFITS < astropy.io.fits.HDUList) contains
- one
PrimaryHDU2object (<astropy.io.fits.PrimaryHDU) - several
_OITableHDU2(abstract OI table class, <_OITableHDU<astropy.io.fits.BinTableHDU) which can be of the derived typesTargetHDU2(OI_TARGETextension)ArrayHDU2(OI_ARRAYextension)WavelengthHDU2(OI_WAVELENGTHextension)_DataHDU2(abstract data class)VisHDU2(OI_VISextension)Vis2HDU2(OI_VIS2extension)T3HDU2(OI_T3extension)FluxHDU1(OI_FLUXextension)
CorrHDU1(OI_CORRextension)InspolHDU1(OI_INSPOLextension)
- any other FITS extension
Functions
- Reading and manipulating OIFITS
open(open an OIFITS file)openlist(open a list of files and merge them)merge(merge several OIFITS)set_merge_settings(determine how duplicate targets/stations are merged)
- Creating OI tables from scratch
new_target_hdu(create anOI_TARGETextension)new_target_hdu_from_simbadnew_array_hdu(create anOI_ARRAYextension)new_wavelength_hdu(create anOI_WAVELENGTHextension)new_vis_hdu(create anOI_VISextension)new_vis2_hdu(create anOI_VIS2extension)new_t3_hdu(create anOI_T3extension)new_flux_hdu(create anOI_FLUXextension)
Methods
_OIFITS(OIFITS1andOIFITS2)- manipulation
bin_spectral_channels(downgrade spectral resolution)trim(keep only wavelengths, targets, instruments, ... of interest)to_table(transform to a table with one scalar observable per line)to_version(transform between versions of the OIFITS standard)
- visualisation
visualize(quick plot)
- data updating
verify(check standard compliance and mend if possible)update_primary_header(update primary header using the info in other tables)update_uv(compute spatial frequencies using array data)
- contents listing
get_OITableHDUsget_targetHDUget_arrayHDUs&get_arrayHDUget_wavelengthHDUs&get_wavelengthHDUget_dataHDUsget_visHDUsget_vis2HDUsget_t3HDUs- (
OIFITS2only)get_corrHDUs&get_corrHDU - (
OIFITS2only)get_fluxHDUs - (
OIFITS2only)get_inspolHDUs&get_inspolHDU
- manipulation
_DataHDU(all classes containing OI data)- target information
get_targetget_decget_raget_equinoxget_parallaxget_pmraget_pmdecget_rvget_skycoordget_spectype
- wavelength and spatial frequency information
get_waveget_bandget_uvget_uvw
- array information
get_locationget_sta_nameget_staenuget_stauvwget_staxyzget_sta_configget_tel_nameget_tel_config
- polarisation information
- (
_DataHDU2only)get_jones_matrix
- (
- target information
Direct data access
Each column of the OI FITS standard can be directly accessed via its standard
name, for instance, h.UCOORD or h.VIS2DATA are synonyms to h.data['UCOORD'] and h.data['VIS2DATA'], respectively.
Related projects
- oifits reads an OIFITS file into a table, geared towards the Event Horizon Telescope
- oifits reads and write OIFITS v. 1, mostly geared towards VLTI/MATISSE
- pyhdust has a read/write module for OIFITS version 1
Release notes
0.4
New features:
- Method
to_table()optionally returns a correlation matrix GG
0.4.1
Bug fixes:
WAVELMIN&WAVELMAXFITS keywords have a correct number of significant digitsEQUINOXFITS keyword now passes verification- No runtime error when a duplicate
INSNAMEhas to be renamed - OI data (
OI_VIS,OI_VIS2,OI_T3,OI_FLUX) tables merge correctly OI_VIStables with differentPHITYP,AMPTYP,AMPORDER, orPHIORDERcan no longer be mergedOI_FLUXtables with differentFOVorFOVTYPEcan not longer be merged
New features:
OIFITS1&OIFITS2classes haveget_visHDUs,get_vis2HDUs,get_T3HDUsmethods
0.4.2
New features:
- Method
to_table()allows the user to restrict to a subset of target names, instrument setup names, arrays, wavelength range, and/or date range - OIFITS classes have new method
visualize()to plot an interferometric observable as a function of time, baseline length, or spatial frequency.
0.4.3
Bug fixes:
- Successive column renamings no longer lead to
KeyError - fix
get_uv - Typos in this doc
New features:
- Method
bin_spectral_channels(R)allows the user to rebin to a given spectral resolution.
0.4.4
- Documentation
- Fixed numerous bugs in
get_jones_matrixandInspolHDU1
0.4.5
Bug fixes
- Fixed error in creation of
FluxHDUandT3HDUusingfrom_data - Fixed error in creation of OI tables with non-standard columns using
from_data - Typos in documentation
New features
- New function
trim()to keep only wavelengths, instruments, instrumental setups, arrays, targets of interest
0.4.6.
Bug fixes
- Fixed
TDIM=1 keyword error whentrim()yields N×1 data - Fixed an issue with
astroqueryreturningstrinstead ofbytes
0.4.7
Bug fixes
- Fixed float format for
STAXYZcolumn inArrayHDUextension verify()can now fix strictly negative errors- duplicate fits warnings in
verify()are now printed
Testing
- A quick test of
verify()on a set of JMMC/aspro-generated OIFITS
0.4.8
Bug fixes
to_version()now runsverify()to produce valid OIFITS if possible- A quick test of
to_version()
0.4.9
Bug fixes
- OIFITS version 2 verification
**
verify()now replaces zero and negativeTARGET_IDinstead of throwing an error **verify()now masks values and errors (with NULL=NaN) when errors are strictly negative or NULL ** primary header of single-target observations deduces more keywords from data HDUs (BASE_MIN,VIS2ERR,NUM_CHAN, etc.)
0.4.10
- New functions
**
new_primary_headerto create a primary header - Bug fixes
**
verify()now replaces zero and negativeSTA_INDEXfor OITITS2.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyoifits-0.4.10.tar.gz.
File metadata
- Download URL: pyoifits-0.4.10.tar.gz
- Upload date:
- Size: 57.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c5682756e1994b63f21f2591bfd36a5be21ee4803d3f0e0eacb4b418994e25ff
|
|
| MD5 |
941edc658ec8b94b343bfa84af8c7c2c
|
|
| BLAKE2b-256 |
2ae19c98ae79b2a6ed6ace02996e3f6d216bc3d8a479e811b73d6d84686d23d9
|
File details
Details for the file pyoifits-0.4.10-py3-none-any.whl.
File metadata
- Download URL: pyoifits-0.4.10-py3-none-any.whl
- Upload date:
- Size: 65.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
072793741eca2b62e82013eb90cb86d50e590da070d54a45c377c5b790fdeb64
|
|
| MD5 |
ebd366fe8bb266f48f5eddf58941e426
|
|
| BLAKE2b-256 |
c285c4edfcc4812b0a608d4e536c03adee8b944534cf234967ce9416a0142f59
|