Main Page | Class List | Directories | File List | Class Members | File Members

ObitUV.c File Reference

ObitUV class function definitions. More...

#include "ObitUV.h"
#include "ObitIOUVFITS.h"
#include "ObitIOUVAIPS.h"
#include "ObitUVDesc.h"
#include "ObitUVSel.h"
#include "ObitTableFQ.h"
#include "ObitTableANUtil.h"
#include "ObitTableBP.h"
#include "ObitTableBL.h"
#include "ObitTableCL.h"
#include "ObitTableCQ.h"
#include "ObitTableSN.h"
#include "ObitTableFG.h"
#include "ObitTableNX.h"
#include "ObitTableSNUtil.h"
#include "ObitTableCLUtil.h"
#include "ObitTableFQUtil.h"
#include "ObitTableSUUtil.h"
#include "ObitSystem.h"
#include "ObitMem.h"
#include "ObitHistory.h"

Functions

void ObitUVInit (gpointer in)
 Private: Initialize newly instantiated object.
void ObitUVClear (gpointer in)
 Private: Deallocate members.
ObitUVnewObitUV (gchar *name)
 Public: Constructor.
ObitUVnewObitUVScratch (ObitUV *in, ObitErr *err)
 Public: Copy Constructor for scratch file.
gconstpointer ObitUVGetClass (void)
 Public: ClassInfo pointer.
gboolean ObitUVSame (ObitUV *in1, ObitUV *in2, ObitErr *err)
 Public: Do two UVs have the same underlying structures?.
void ObitUVRename (ObitUV *in, ObitErr *err)
 Public: Rename underlying structures.
ObitUVObitUVZap (ObitUV *in, ObitErr *err)
 Public: Delete underlying structures.
ObitUVObitUVCopy (ObitUV *in, ObitUV *out, ObitErr *err)
 Public: Copy (deep) constructor.
void ObitUVClone (ObitUV *in, ObitUV *out, ObitErr *err)
 Public: Copy structure.
ObitIOCode ObitUVOpen (ObitUV *in, ObitIOAccess access, ObitErr *err)
 Public: Create ObitIO structures and open file.
ObitIOCode ObitUVClose (ObitUV *in, ObitErr *err)
 Public: Close file and become inactive.
void ObitUVFullInstantiate (ObitUV *in, gboolean exist, ObitErr *err)
 Public: Fully instantiate.
ObitIOCode ObitUVRead (ObitUV *in, gfloat *data, ObitErr *err)
 Public: Read specified data.
ObitIOCode ObitUVReadSelect (ObitUV *in, gfloat *data, ObitErr *err)
 Public: Read select, edit, calibrate specified data.
ObitIOCode ObitUVWrite (ObitUV *in, gfloat *data, ObitErr *err)
 Public: Write specified data.
ObitIOCode ObitUVRewrite (ObitUV *in, gfloat *data, ObitErr *err)
 Public: Rewrite specified data.
ObitTablenewObitUVTable (ObitUV *in, ObitIOAccess access, gchar *tabType, glong *tabVer, ObitErr *err)
 Public: Return an associated Table.
ObitIOCode ObitUVZapTable (ObitUV *in, gchar *tabType, glong tabVer, ObitErr *err)
 Public: Destroy an associated Table.
ObitIOCode ObitUVCopyTables (ObitUV *in, ObitUV *out, gchar **exclude, gchar **include, ObitErr *err)
 Public: Copy associated Tables.
ObitIOCode ObitUVUpdateTables (ObitUV *in, ObitErr *err)
 Public: Update disk resident tables information.
void ObitUVGetFreq (ObitUV *in, ObitErr *err)
 Public: Get Frequency arrays.
ObitIOCode ObitUVGetSubA (ObitUV *in, ObitErr *err)
 Public: Obtains Subarray info for an ObitUV.
ObitIOCode ObitUVIOSet (ObitUV *in, ObitErr *err)
 Public: Reset IO to start of file.
void ObitUVGetRADec (ObitUV *uvdata, gdouble *ra, gdouble *dec, ObitErr *err)
 Public: Get source position.
void ObitUVGetSouInfo (ObitUV *uvdata, ObitErr *err)
 Public: Get single source info.
void ObitUVWriteKeyword (ObitUV *in, gchar *name, ObitInfoType type, gint32 *dim, gconstpointer data, ObitErr *err)
 Public: Write header keyword.
void ObitUVReadKeyword (ObitUV *in, gchar *name, ObitInfoType *type, gint32 *dim, gpointer data, ObitErr *err)
 Public: Read header keyword.
glong ObitUVChanSel (ObitUV *in, gint32 *dim, gint *IChanSel, ObitErr *err)
 Public: Channel selection in FG table.
void ObitUVClassInit (void)
 Public: Class initializer.


Detailed Description

ObitUV class function definitions.

This class is derived from the ObitData base class.


Function Documentation

ObitUV* newObitUV gchar *  name  ) 
 

Public: Constructor.

Initializes class if needed on first call.

Parameters:
name An optional name for the object.
Returns:
the new object.

ObitUV* newObitUVScratch ObitUV in,
ObitErr err
 

Public: Copy Constructor for scratch file.

A scratch UV is more or less the same as a normal UV except that it is automatically deleted on the final unreference. The output will have the underlying files of the same type as in already allocated. The object is defined but the underlying structures are not created.

Parameters:
in The object to copy
err Error stack, returns if not empty.
Returns:
pointer to the new object.

ObitTable* newObitUVTable ObitUV in,
ObitIOAccess  access,
gchar *  tabType,
glong *  tabVer,
ObitErr err
 

Public: Return an associated Table.

If such an object exists, a reference to it is returned, else a new object is created and entered in the ObitTableList.

Parameters:
in Pointer to object with associated tables. This MUST have been opened before this call.
access access (OBIT_IO_ReadOnly,OBIT_IO_ReadWrite, or OBIT_IO_WriteOnly). This is used to determine defaulted version number and a different value may be used for the actual Open.
tabType The table type (e.g. "AIPS CC").
tabVer Desired version number, may be zero in which case the highest extant version is returned for read and the highest+1 for write.
err ObitErr for reporting errors.
Returns:
pointer to created ObitTable, NULL on failure.

glong ObitUVChanSel ObitUV in,
gint32 *  dim,
gint *  IChanSel,
ObitErr err
 

Public: Channel selection in FG table.

If a flag table is currently selected it is copied to a new AIPS FG table on the uv data and channel selection added. If no flag table is selected then an new table is created. The new flagging entries includ all channels and IFs in the range specified in the UVSel values of BChan, EChan, BIF and EIF that are NOT specified in the IChanSel array

Parameters:
in UV with selection to which the new flag table is to be attached.
dim Dimensionality of IChanSel
IChanSel Channel selection in groups of 4 values: Sets of channels are selected by groups of 4 parameters: [0] 1-rel start channel number in block (def . 1) [1] 1-rel end channel number, (def. to end) [2] channel increment [3] 1-rel IF number (def all) [5,0,2,1] means every other channel from 5 to the highest in IF 1. All zeroes means all channels and all IFs selected by BChan, EChan, BIF, EIF. List terminated by group of 4 zeroes.
err ObitErr for reporting errors.
Returns:
the AIPS FG table version number, -1 on no selection or failure.

void ObitUVClassInit void   ) 
 

Public: Class initializer.

void ObitUVClear gpointer  inn  ) 
 

Private: Deallocate members.

Does (recursive) deallocation of parent class members. For some reason this wasn't build into the GType class.

Parameters:
inn Pointer to the object to deallocate. Actually it should be an ObitUV* cast to an Obit*.

void ObitUVClone ObitUV in,
ObitUV out,
ObitErr err
 

Public: Copy structure.

Parameters:
in The object to copy
out An existing object pointer for output or NULL if none exists.
err Error stack, returns if not empty.

ObitIOCode ObitUVClose ObitUV in,
ObitErr err
 

Public: Close file and become inactive.

Parameters:
in Pointer to object to be closed.
err ObitErr for reporting errors.
Returns:
error code, OBIT_IO_OK=> OK

ObitUV* ObitUVCopy ObitUV in,
ObitUV out,
ObitErr err
 

Public: Copy (deep) constructor.

Copies are made of complex members including disk files; these will be copied applying whatever selection is associated with the input. Objects should be closed on input and will be closed on output. In order for the disk file structures to be copied, the output file must be sufficiently defined that it can be written; the copy does not apply any selection/calibration/translation. The copy will be attempted but no errors will be logged until both input and output have been successfully opened. If the contents of the uv data are copied, all associated tables are copied first. ObitInfoList and ObitThread members are only copied if the output object didn't previously exist. Parent class members are included but any derived class info is ignored. The file etc. info should have been stored in the ObitInfoList:

  • "doCalSelect" OBIT_boolean scalar if TRUE, calibrate/select/edit input data.
    Parameters:
    in The object to copy
    out An existing object pointer for output or NULL if none exists.
    err Error stack, returns if not empty.
    Returns:
    pointer to the new object.

ObitIOCode ObitUVCopyTables ObitUV in,
ObitUV out,
gchar **  exclude,
gchar **  include,
ObitErr err
 

Public: Copy associated Tables.

Parameters:
in The ObitUV with tables to copy.
out An ObitUV to copy the tables to, old ones replaced.
exclude a NULL termimated list of table types NOT to copy. If NULL, use include
include a NULL termimated list of table types to copy. ignored if exclude nonNULL.
err ObitErr for reporting errors.
Returns:
return code, OBIT_IO_OK=> OK

void ObitUVFullInstantiate ObitUV in,
gboolean  exist,
ObitErr err
 

Public: Fully instantiate.

If object has previously been opened, as demonstrated by the existance of its myIO member, this operation is a no-op. Virtual - calls actual class member

Parameters:
in Pointer to object
exist TRUE if object should previously exist, else FALSE
err ObitErr for reporting errors.
Returns:
error code, OBIT_IO_OK=> OK

gconstpointer ObitUVGetClass void   ) 
 

Public: ClassInfo pointer.

Returns:
pointer to the class structure.

void ObitUVGetFreq ObitUV in,
ObitErr err
 

Public: Get Frequency arrays.

These are the myDesc->freqArr and myDesc->fscale array members. Uses source dependent frequency info if available from in->info

  • "SouIFOff" OBIT_double (nif,1,1) Source frequency offset per IF
  • "SouBW" OBIT_double (1,1,1) Channel Bandwidth
Parameters:
in The ObitUV with descriptor to update.
err ObitErr for reporting errors.

void ObitUVGetRADec ObitUV uvdata,
gdouble *  ra,
gdouble *  dec,
ObitErr err
 

Public: Get source position.

If single source file get from uvDesc, if multisource read from SU table Checks that only one source selected. Also fill in position like information in the descriptor for multi-source datasets

Parameters:
uvdata Data object from which position sought
ra [out] RA at mean epoch (deg)
dec [out] Dec at mean epoch (deg)
err Error stack, returns if not empty.

void ObitUVGetSouInfo ObitUV uvdata,
ObitErr err
 

Public: Get single source info.

Also fill in position like information in the descriptor for multi-source datasets If source table is read, the source dependent IF offsets and bandwidth are written to the in->info object as

  • "SouIFOff" OBIT_double (nif,1,1) Source frequency offset per IF
  • "SouBW" OBIT_double (1,1,1) Bandwidth
Parameters:
uvdata Data object from which info sought
err Error stack, returns if not empty.

ObitIOCode ObitUVGetSubA ObitUV in,
ObitErr err
 

Public: Obtains Subarray info for an ObitUV.

Parameters:
in Object to obtain data from and with descriptors to update. Updated on in->myDesc and in->myIO->myDesc:
  • numSubA Number of subarrays, always >0
  • numAnt Array of maximum antenna numbers per subarray will be allocaded here and must be gfreeed when done NULL returned if no AN tables
  • maxAnt Maximum antenna number in numAnt. 0 if no AN tables.
*err ObitErr error stack.
Returns:
I/O Code OBIT_IO_OK = OK.

void ObitUVInit gpointer  inn  ) 
 

Private: Initialize newly instantiated object.

Parent classes portions are (recursively) initialized first

Parameters:
inn Pointer to the object to initialize.

ObitIOCode ObitUVIOSet ObitUV in,
ObitErr err
 

Public: Reset IO to start of file.

Parameters:
in Pointer to object to be rewound.
err ObitErr for reporting errors.
Returns:
return code, OBIT_IO_OK=> OK

ObitIOCode ObitUVOpen ObitUV in,
ObitIOAccess  access,
ObitErr err
 

Public: Create ObitIO structures and open file.

The image descriptor is read if OBIT_IO_ReadOnly, OBIT_IO_ReadCal or OBIT_IO_ReadWrite and written to disk if opened OBIT_IO_WriteOnly. If access is OBIT_IO_ReadCal then the calibration/selection/editing needed is initialized. See the ObitUVSel class for a description of the selection and calibration parameters. After the file has been opened the member, buffer is initialized for reading/storing the data unless member bufferSize is <0. The file etc. info should have been stored in the ObitInfoList:

  • "FileType" OBIT_int scalar = OBIT_IO_FITS or OBIT_IO_AIPS for file type.
  • "nVisPIO" OBIT_int scalar = Maximum number of visibilities per transfer, this is the target size for Reads (may be fewer) and is used to create buffers.
  • "Compress" Obit_bool scalar = TRUE indicates output is to be in compressed format. (access=OBIT_IO_WriteOnly only).
  • "SubScanTime" Obit_float scalar [Optional] if given, this is the desired time (day) of a sub scan. This is used by the selector to suggest a value close to this which will evenly divided the current scan. See ObitUVSelSubScan
    Parameters:
    in Pointer to object to be opened.
    access access (OBIT_IO_ReadOnly,OBIT_IO_ReadWrite, OBIT_IO_ReadCal or OBIT_IO_WriteOnly). If OBIT_IO_WriteOnly any existing data in the output file will be lost.
    err ObitErr for reporting errors.
    Returns:
    return code, OBIT_IO_OK=> OK

ObitIOCode ObitUVRead ObitUV in,
gfloat *  data,
ObitErr err
 

Public: Read specified data.

The ObitUVDesc maintains the current location in the file. The number read will be mySel->nVisPIO (until the end of the selected range of visibilities in which case it will be smaller). The first visibility number after a read is myDesc->firstVis and the number of visibilities is myDesc->numVisBuff.

Parameters:
in Pointer to object to be read.
data pointer to buffer to write results. if NULL, use the buffer member of in.
err ObitErr for reporting errors.
Returns:
return code, OBIT_IO_OK => OK

void ObitUVReadKeyword ObitUV in,
gchar *  name,
ObitInfoType *  type,
gint32 *  dim,
gpointer  data,
ObitErr err
 

Public: Read header keyword.

Parameters:
in object to update, must be fully instantiated
name [out] The label (keyword) of the information. Max 8 char
type [out] Data type of data element (enum defined in ObitInfoList class).
dim [out] Dimensionality of datum. Only scalars and strings up to 8 char are supported Note: for strings, the first element is the length in char.
data [out] Pointer to the data.
err ObitErr for reporting errors.

ObitIOCode ObitUVReadSelect ObitUV in,
gfloat *  data,
ObitErr err
 

Public: Read select, edit, calibrate specified data.

The number read will be mySel->nVisPIO (until the end of the selected range of visibilities in which case it will be smaller). The first visibility number after a read is myDesc->firstVis and the number of visibilities is myDesc->numVisBuff.

Parameters:
in Pointer to object to be read.
data pointer to buffer to write results. if NULL, use the buffer member of in.
err ObitErr for reporting errors.
Returns:
return code, OBIT_IO_OK => OK

void ObitUVRename ObitUV in,
ObitErr err
 

Public: Rename underlying structures.

For FITS files:

  • "newFileName" OBIT_string (?,1,1) New Name of disk file.
For AIPS:
  • "newName" OBIT_string (12,1,1) New AIPS Name Blank = don't change
  • "newClass" OBIT_string (6,1,1) New AIPS Class Blank = don't changeO
  • "newSeq" OBIT_int (1,1,1) New AIPS Sequence 0 => unique value
    Parameters:
    in Pointer to object to be renamed.
    err ObitErr for reporting errors.

ObitIOCode ObitUVRewrite ObitUV in,
gfloat *  data,
ObitErr err
 

Public: Rewrite specified data.

This routines assumes that the input UV is also being read and so the firstVis values in the UV descriptors on both in and its IO member are left unchanged. Otherwise a call to this routine is equivalent to ObitUVWrite The data in the buffer will be written starting at visibility myDesc->firstVis and the number written will be myDesc->numVisBuff which should not exceed mySel->nVisPIO if the internal buffer is used.

Parameters:
in Pointer to object to be written.
data pointer to buffer containing input data. if NULL, use the buffer member of in.
err ObitErr for reporting errors.
Returns:
return code, OBIT_IO_OK=> OK

gboolean ObitUVSame ObitUV in1,
ObitUV in2,
ObitErr err
 

Public: Do two UVs have the same underlying structures?.

This test is done using values entered into the ObitInfoList in case the object has not yet been opened.

Parameters:
in1 First object to compare
in2 Second object to compare
err ObitErr for reporting errors.
Returns:
TRUE if to objects have the same underlying structures else FALSE

ObitIOCode ObitUVUpdateTables ObitUV in,
ObitErr err
 

Public: Update disk resident tables information.

Parameters:
in Pointer to object to be updated.
err ObitErr for reporting errors.
Returns:
return code, OBIT_IO_OK=> OK

ObitIOCode ObitUVWrite ObitUV in,
gfloat *  data,
ObitErr err
 

Public: Write specified data.

The data in the buffer will be written starting at visibility myDesc->firstVis and the number written will be myDesc->numVisBuff which should not exceed mySel->nVisPIO if the internal buffer is used. myDesc->firstVis will be maintained and need not be changed for sequential writing. NB: If the same UV data is being both read and rewritten, use ObitUVRewrite instead of ObitUVWrite.

Parameters:
in Pointer to object to be written.
data pointer to buffer containing input data. if NULL, use the buffer member of in.
err ObitErr for reporting errors.
Returns:
return code, OBIT_IO_OK=> OK

void ObitUVWriteKeyword ObitUV in,
gchar *  name,
ObitInfoType  type,
gint32 *  dim,
gconstpointer  data,
ObitErr err
 

Public: Write header keyword.

Parameters:
in object to update, must be open during call with Write access
name The label (keyword) of the information. Max 8 char
type Data type of data element (enum defined in ObitInfoList class).
dim Dimensionality of datum. Only scalars and strings up to 8 char are allowed Note: for strings, the first element is the length in char.
data Pointer to the data.
err ObitErr for reporting errors.

ObitUV* ObitUVZap ObitUV in,
ObitErr err
 

Public: Delete underlying structures.

Parameters:
in Pointer to object to be zapped.
err ObitErr for reporting errors.
Returns:
pointer for input object, NULL if deletion successful

ObitIOCode ObitUVZapTable ObitUV in,
gchar *  tabType,
glong  tabVer,
ObitErr err
 

Public: Destroy an associated Table.

The table is removed from the ObitTableList but the external form may not be updated.

Parameters:
in Pointer to object with associated tables.
tabType The table type (e.g. "AIPS CC").
tabVer Desired version number, may be zero in which case the highest extant version is returned for read and the highest+1 for write. -1 => all versions of tabType
err ObitErr for reporting errors.
Returns:
return code, OBIT_IO_OK=> OK


Generated on Fri Aug 31 22:13:09 2007 for Obit by  doxygen 1.3.9.1