NAME
    oifits - A module for reading/writing OIFITS (v1, v2) files

DESCRIPTION
    To open an existing OIFITS file, use the oifits.open(filename) function, where
    'filename' can be either a filename or HDUList object.  This will return an
    oifits object with the following members (any of which can be empty
    dictionaries or numpy arrays):
    
       array: a dictionary of interferometric arrays, as defined by the OI_ARRAY
       tables.  The dictionary key is the name of the array (ARRNAME).
    
       header: the header from the primary HDU of the file.
    
       target: a numpy array of targets, as defined by the rows of the OI_TARGET
       table.
    
       wavelength: a dictionary of wavelength tables (OI_WAVELENGTH).  The
       dictionary key is the name of the instrument/settings (INSNAME).
    
       vis, vis2, t3 and flux: numpy arrays of objects containing all the
       measurement information.  Each list member corresponds to a row in an
       OI_VIS/OI_VIS2/OI_T3/OI_FLUX table.
    
    A summary of the information in the oifits object can be obtained by
    using the info() method:
    
       > import oifits
       > oifitsobj = oifits.open('foo.fits')
       > oifitsobj.info()
    
    This module makes an ad-hoc, backwards-compatible change to the OIFITS revision
    1 standard originally described by Pauls et al., 2005, PASP, 117, 1255.  The
    OI_VIS and OI_VIS2 tables in OIFITS files produced by this file contain two
    additional columns for the correlated flux, CFLUX and CFLUXERR , which are
    arrays with a length corresponding to the number of wavelength elements (just
    as VISAMP/VIS2DATA).
    
    As of version 0.4, revision 2 of the OIFITS standard (Duvert, Young & Hummel,
    2017, A&A 597, A8) is supported, with the exception of correlations and
    polarization.
    
    The main purpose of this module is to allow easy access to your OIFITS data
    within Python, where you can then analyze it in any way you want.  As of
    version 0.3, the module can now be used to create OIFITS files from scratch
    without serious pain.  Be warned, creating an array table from scratch is
    probably like nailing jelly to a tree.  In a future verison this may become
    easier. Note that array tables are a requirement only for OIFITS2.
    
    The module also provides a simple mechanism for combining multiple oifits
    objects, achieved by using the '+' operator on two oifits objects: result = a +
    b.  The result can then be written to a file using result.save(filename).
    
    Many of the parameters and their meanings are not specifically documented here.
    However, the nomenclature mirrors that of the OIFITS standard, so it is
    recommended to use this module with the OIFITS1/OIFITS2 references above in
    hand.
    
    Beginning with version 0.3, the OI_VIS/OI_VIS2/OI_T3 classes now use masked
    arrays for convenience, where the mask is defined via the 'flag' member of
    these classes.  This also concerns the OI_FLUX tables from OIFITS2. Beware of
    the following subtlety: as before, the array data are accessed via (for
    example) OI_VIS.visamp; however, OI_VIS.visamp is just a method which
    constructs (on the fly) a masked array from OI_VIS._visamp, which is where the
    data are actually stored.  This is done transparently, and the data can be
    accessed and modified transparently via the "visamp" hidden attribute.  The
    same goes for correlated fluxes, differential/closure phases, triple products,
    total flux measurements, etc.  See the notes on the individual classes for a
    list of all the "hidden" attributes.
    
    For further information, contact Paul Boley (pboley@gmail.com) or open an issue
    on Github (https://github.com/pboley/oifits/).

CLASSES
    builtins.object
        OI_ARRAY
        OI_FLUX
        OI_STATION
        OI_T3
        OI_TARGET
        OI_VIS
        OI_VIS2
        OI_WAVELENGTH
        oifits
    
    class OI_ARRAY(builtins.object)
     |  OI_ARRAY(frame, arrxyz, stations=(), revision=1)
     |  
     |  Contains all the data for a single OI_ARRAY table.  Note the
     |  hidden convenience attributes latitude, longitude, and altitude.
     |  
     |  Methods defined here:
     |  
     |  __eq__(self, other)
     |      Return self==value.
     |  
     |  __getattr__(self, attrname)
     |  
     |  __init__(self, frame, arrxyz, stations=(), revision=1)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |  
     |  __ne__(self, other)
     |      Return self!=value.
     |  
     |  __repr__(self)
     |      Return repr(self).
     |  
     |  get_station_by_name(self, name)
     |  
     |  info(self, verbose=0)
     |      Print the array's center coordinates.  If verbosity >= 1,
     |      print information about each station.
    
    class OI_FLUX(builtins.object)
     |  OI_FLUX(timeobs, int_time, fluxdata, fluxerr, flag, wavelength, target, calibrated, array=None, station=None, fov=None, fovtype=None, revision=1)
     |  
     |  Class for storing raw or calibrated flux measurements.
     |  To access the data, use the following hidden attributes:
     |  
     |  fluxdata, fluxerr
     |  
     |  Methods defined here:
     |  
     |  __eq__(self, other)
     |      Return self==value.
     |  
     |  __getattr__(self, attrname)
     |  
     |  __init__(self, timeobs, int_time, fluxdata, fluxerr, flag, wavelength, target, calibrated, array=None, station=None, fov=None, fovtype=None, revision=1)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |  
     |  __ne__(self, other)
     |      Return self!=value.
     |  
     |  __repr__(self)
     |      Return repr(self).
     |  
     |  __setattr__(self, attrname, value)
     |      Implement setattr(self, name, value).
     |  
     |  info(self)
    
    class OI_STATION(builtins.object)
     |  OI_STATION(tel_name=None, sta_name=None, diameter=None, staxyz=[None, None, None], fov=None, fovtype=None, revision=1)
     |  
     |  This class corresponds to a single row (i.e. single
     |  station/telescope) of an OI_ARRAY table.
     |  
     |  Methods defined here:
     |  
     |  __eq__(self, other)
     |      Return self==value.
     |  
     |  __init__(self, tel_name=None, sta_name=None, diameter=None, staxyz=[None, None, None], fov=None, fovtype=None, revision=1)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |  
     |  __ne__(self, other)
     |      Return self!=value.
     |  
     |  __repr__(self)
     |      Return repr(self).
    
    class OI_T3(builtins.object)
     |  OI_T3(timeobs, int_time, t3amp, t3amperr, t3phi, t3phierr, flag, u1coord, v1coord, u2coord, v2coord, wavelength, target, array=None, station=(None, None, None), revision=1)
     |  
     |  Class for storing triple product and closure phase data.
     |  To access the data, use the following hidden attributes:
     |  
     |  t3amp, t3amperr, t3phi, t3phierr
     |  
     |  Methods defined here:
     |  
     |  __eq__(self, other)
     |      Return self==value.
     |  
     |  __getattr__(self, attrname)
     |  
     |  __init__(self, timeobs, int_time, t3amp, t3amperr, t3phi, t3phierr, flag, u1coord, v1coord, u2coord, v2coord, wavelength, target, array=None, station=(None, None, None), revision=1)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |  
     |  __ne__(self, other)
     |      Return self!=value.
     |  
     |  __repr__(self)
     |      Return repr(self).
     |  
     |  __setattr__(self, attrname, value)
     |      Implement setattr(self, name, value).
     |  
     |  info(self)
     |  
    
    class OI_TARGET(builtins.object)
     |  OI_TARGET(target, raep0, decep0, equinox=2000.0, ra_err=0.0, dec_err=0.0, sysvel=0.0, veltyp='TOPCENT', veldef='OPTICAL', pmra=0.0, pmdec=0.0, pmra_err=0.0, pmdec_err=0.0, parallax=0.0, para_err=0.0, spectyp='UNKNOWN', category=None, revision=1)
     |  
     |  Methods defined here:
     |  
     |  __eq__(self, other)
     |      Return self==value.
     |  
     |  __init__(self, target, raep0, decep0, equinox=2000.0, ra_err=0.0, dec_err=0.0, sysvel=0.0, veltyp='TOPCENT', veldef='OPTICAL', pmra=0.0, pmdec=0.0, pmra_err=0.0, pmdec_err=0.0, parallax=0.0, para_err=0.0, spectyp='UNKNOWN', category=None, revision=1)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |  
     |  __ne__(self, other)
     |      Return self!=value.
     |  
     |  __str__(self)
     |      Return str(self).
     |  
     |  info(self)
    
    class OI_VIS(builtins.object)
     |  OI_VIS(timeobs, int_time, visamp, visamperr, visphi, visphierr, flag, ucoord, vcoord, wavelength, target, array=None, station=(None, None), cflux=None, cfluxerr=None, revision=1, amptyp=None, phityp=None, amporder=None, phiorder=None, visrefmap=None, rvis=None, rviserr=None, ivis=None, iviserr=None)
     |  
     |  Class for storing visibility amplitude and differential phase data.
     |  To access the data, use the following hidden attributes:
     |  
     |  visamp, visamperr, visphi, visphierr, flag;
     |  and possibly cflux, cfluxerr.
     |  
     |  Methods defined here:
     |  
     |  __eq__(self, other)
     |      Return self==value.
     |  
     |  __getattr__(self, attrname)
     |  
     |  __init__(self, timeobs, int_time, visamp, visamperr, visphi, visphierr, flag, ucoord, vcoord, wavelength, target, array=None, station=(None, None), cflux=None, cfluxerr=None, revision=1, amptyp=None, phityp=None, amporder=None, phiorder=None, visrefmap=None, rvis=None, rviserr=None, ivis=None, iviserr=None)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |  
     |  __ne__(self, other)
     |      Return self!=value.
     |  
     |  __repr__(self)
     |      Return repr(self).
     |  
     |  __setattr__(self, attrname, value)
     |      Implement setattr(self, name, value).
     |  
     |  info(self)
    
    class OI_VIS2(builtins.object)
     |  OI_VIS2(timeobs, int_time, vis2data, vis2err, flag, ucoord, vcoord, wavelength, target, array=None, station=(None, None), revision=1)
     |  
     |  Class for storing squared visibility amplitude data.
     |  To access the data, use the following hidden attributes:
     |  
     |  vis2data, vis2err
     |  
     |  Methods defined here:
     |  
     |  __eq__(self, other)
     |      Return self==value.
     |  
     |  __getattr__(self, attrname)
     |  
     |  __init__(self, timeobs, int_time, vis2data, vis2err, flag, ucoord, vcoord, wavelength, target, array=None, station=(None, None), revision=1)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |  
     |  __ne__(self, other)
     |      Return self!=value.
     |  
     |  __repr__(self)
     |      Return repr(self).
     |  
     |  __setattr__(self, attrname, value)
     |      Implement setattr(self, name, value).
     |  
     |  info(self)
    
    class OI_WAVELENGTH(builtins.object)
     |  OI_WAVELENGTH(eff_wave, eff_band=None, revision=1)
     |  
     |  Methods defined here:
     |  
     |  __eq__(self, other)
     |      Return self==value.
     |  
     |  __init__(self, eff_wave, eff_band=None, revision=1)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |  
     |  __ne__(self, other)
     |      Return self!=value.
     |  
     |  __repr__(self)
     |      Return repr(self).
     |  
     |  info(self)
    
    class oifits(builtins.object)
     |  Methods defined here:
     |  
     |  __add__(self, other)
     |      Consistently combine two separate oifits objects.  Note
     |      that targets can be matched by name only (e.g. if coordinates
     |      differ) by setting oifits.matchtargetbyname to True.  The same
     |      goes for stations of the array (controlled by
     |      oifits.matchstationbyname)
     |  
     |  __eq__(self, other)
     |      Return self==value.
     |  
     |  __init__(self)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |  
     |  __ne__(self, other)
     |      Return self!=value.
     |  
     |  info(self, recursive=True, verbose=0)
     |      Print out a summary of the contents of the oifits object.
     |      Set recursive=True to obtain more specific information about
     |      each of the individual components, and verbose to an integer
     |      to increase the verbosity level.
     |  
     |  isconsistent(self)
     |      Returns True if the object is entirely self-contained,
     |      i.e. all cross-references to wavelength tables, arrays,
     |      stations etc. in the measurements refer to elements which are
     |      stored in the oifits object.  Note that an oifits object can
     |      be 'consistent' in this sense without being 'valid' as checked
     |      by isvalid().
     |  
     |  isvalid(self)
     |      Returns True of the oifits object is both consistent (as
     |      determined by isconsistent()) and conforms to the OIFITS
     |      standard (according to Pauls et al., 2005, PASP, 117, 1255).
     |  
     |  save(self, filename)
     |      Write the contents of the oifits object to a file in OIFITS
     |      format.

FUNCTIONS
    open(filename, quiet=False)
        Open an OIFITS file.

DATA
    __email__ = 'pboley@gmail.com'
    matchstationbyname = False
    matchtargetbyname = False
    refdate = datetime.datetime(2000, 1, 1, 0, 0)

VERSION
    0.4-dev

DATE
    13 January 2021

AUTHOR
    Paul Boley
