casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Static Public Member Functions | Static Private Member Functions
casa::MSFitsOutput Class Reference

Write a MeasurementSet to a random group uvfits file. More...

#include <MSFitsOutput.h>

List of all members.

Static Public Member Functions

static Bool writeFitsFile (const String &fitsfile, const MeasurementSet &ms, const String &column, Int startchan=0, Int nchan=1, Int stepchan=1, Bool writeSysCal=False, Bool asMultiSource=False, Bool combineSpw=False, Bool writeStation=False, Double sensitivity=1.0, const Bool padWithFlags=false, Int avgchan=1)
 Convert a MeasurementSet to random group UVFITS.

Static Private Member Functions

static FitsOutputwriteMain (Int &refPixelFreq, Double &refFreq, Double &chanbw, const String &outFITSFile, const MeasurementSet &rawms, const String &column, const Block< Int > &spwidMap, Int nrspw, Int startchan, Int nchan, Int stepchan, const Block< Int > &fieldidMap, Bool asMultiSource, const Bool combineSpw, const Bool padWithFlags=true, Int avgchan=1)
 Write the main table.
static Bool writeFQ (FitsOutput *output, const MeasurementSet &ms, const Block< Int > &spwidMap, Int nrspw, Double refFreq, Int refPixelFreq, Double chanbw, Bool combineSpw, Int chanstart=0, Int nchan=-1, Int chanstep=1, Int avgchan=1)
 Write the FQ table.
static Bool writeAN (FitsOutput *output, const MeasurementSet &ms, Double refFreq, Bool writeStation)
 Write the AN table.
static Bool writeSU (FitsOutput *output, const MeasurementSet &ms, const Block< Int > &fieldidMap, Int nrfield, const Block< Int > &spwidMap, Int nrspw)
 Write the SU table.
static Bool writeTY (FitsOutput *output, const MeasurementSet &ms, const Table &syscal, const Block< Int > &spwidMap, uInt nrif, Bool combineSpw)
 Write the TY table.
static Bool writeGC (FitsOutput *output, const MeasurementSet &ms, const Table &syscal, const Block< Int > &spwidMap, uInt nrif, Bool combineSpw, Double sensitivity, Int refPixelFreq, Double refFreq, Double chanbw)
 Write the GC table.
static Bool writeWX (FitsOutput *output, const MeasurementSet &ms)
 Write the WX table.
static void timeToDay (Int &day, Double &dayFraction, Double time)
 Convert time to day and fraction.
static void getStartHA (Double &startTime, Double &startHA, const MeasurementSet &ms, uInt rownr)
 Get the time and hourangle from the MS at the given row.
static void handleAntNumbers (const MeasurementSet &ms, Vector< Int > &antnumbers)
 Discern the antenna numbers that go into UVFITS.
static Table handleSysCal (const MeasurementSet &ms, const Vector< Int > &spwids, Bool isSubset)
 Handle the SYSCAL table.
static Int makeIdMap (Block< Int > &map, Vector< Int > &selids, const Vector< Int > &allids)
 Determine which ids are selected in the main table (used for fields and spectral-window).
static uInt get_tbf_end (const uInt rownr, const uInt nrow, const uInt nif, const ScalarColumn< Double > &timec, const ScalarColumn< Double > &ininterval, const ScalarColumn< Int > &ant1, const ScalarColumn< Int > &ant2, const Bool asMultiSource, const ScalarColumn< Int > &fieldid)
 Find the end of a group of rows with the same time(_centroid) (within 0.25 * ininterval(rownr)), baseline #, and, if asMultiSource, field ID.

Detailed Description

Write a MeasurementSet to a random group uvfits file.

Definition at line 50 of file MSFitsOutput.h.


Member Function Documentation

static uInt casa::MSFitsOutput::get_tbf_end ( const uInt  rownr,
const uInt  nrow,
const uInt  nif,
const ScalarColumn< Double > &  timec,
const ScalarColumn< Double > &  ininterval,
const ScalarColumn< Int > &  ant1,
const ScalarColumn< Int > &  ant2,
const Bool  asMultiSource,
const ScalarColumn< Int > &  fieldid 
) [static, private]

Find the end of a group of rows with the same time(_centroid) (within 0.25 * ininterval(rownr)), baseline #, and, if asMultiSource, field ID.

Parameters:
rownrRow # to start from.
nrow# of rows in the columns.
nif# of IFs
timectime(_centroid) col
inintervalused to set tolerance on changes in timec.
ant1ID of baseline's antenna 1.
ant2ID of baseline's antenna 2.
asMultiSourceIf false, treat fieldid as unattached + prone to segfault
fieldid
Returns:
Last row # with the same time, baseline, and apparent field as rownr.
Warning:
Assumes that the columns are sorted by time(_centroid), ant1, ant2 (, field, DDID).
static void casa::MSFitsOutput::getStartHA ( Double startTime,
Double startHA,
const MeasurementSet ms,
uInt  rownr 
) [static, private]

Get the time and hourangle from the MS at the given row.

It uses the field-id and observation-id to calculate the hourangle.

static void casa::MSFitsOutput::handleAntNumbers ( const MeasurementSet ms,
Vector< Int > &  antnumbers 
) [static, private]

Discern the antenna numbers that go into UVFITS.

static Table casa::MSFitsOutput::handleSysCal ( const MeasurementSet ms,
const Vector< Int > &  spwids,
Bool  isSubset 
) [static, private]

Handle the SYSCAL table.

It skips the entries not needed and sorts it in the correct order.

static Int casa::MSFitsOutput::makeIdMap ( Block< Int > &  map,
Vector< Int > &  selids,
const Vector< Int > &  allids 
) [static, private]

Determine which ids are selected in the main table (used for fields and spectral-window).

Parameters:
map(Really an output here, not an input.) spwidMap[inp_id] = output_id, if inp_id is selected -1 otherwise.
selids(Really an output here, not an input.) A list of the selected input IDs.
allids(Really is an input, not an output!) IDs to consider.
Returns:
number of selected IDs in allids
static void casa::MSFitsOutput::timeToDay ( Int day,
Double dayFraction,
Double  time 
) [static, private]

Convert time to day and fraction.

static Bool casa::MSFitsOutput::writeAN ( FitsOutput output,
const MeasurementSet ms,
Double  refFreq,
Bool  writeStation 
) [static, private]

Write the AN table.

static Bool casa::MSFitsOutput::writeFitsFile ( const String fitsfile,
const MeasurementSet ms,
const String column,
Int  startchan = 0,
Int  nchan = 1,
Int  stepchan = 1,
Bool  writeSysCal = False,
Bool  asMultiSource = False,
Bool  combineSpw = False,
Bool  writeStation = False,
Double  sensitivity = 1.0,
const Bool  padWithFlags = false,
Int  avgchan = 1 
) [static]

Convert a MeasurementSet to random group UVFITS.

Parameters:
fitsfileOutput filename
msinput
columnspecifies which "data" column to write ("observed", "calibrated", "model")
startchan1st channel
nchan# of channels
stepchan# of channels to stride by
writeSysCalwhether to write the system calibration table
asMultiSourceIf true a multi-source UVFits file is written.
combineSpwIf true it attempts to write the spectral windows as IFs. This is necessary for many aips tasks, and difmap.
writeStationIf true uses pad instead of antenna names.
sensitivity
padWithFlagsIf true and combineSpw==true, fill spws with flags as needed to fit the IF structure. Does not yet support spws with different shapes.
static Bool casa::MSFitsOutput::writeFQ ( FitsOutput output,
const MeasurementSet ms,
const Block< Int > &  spwidMap,
Int  nrspw,
Double  refFreq,
Int  refPixelFreq,
Double  chanbw,
Bool  combineSpw,
Int  chanstart = 0,
Int  nchan = -1,
Int  chanstep = 1,
Int  avgchan = 1 
) [static, private]

Write the FQ table.

If combineSpw is True, all spectral-windows are written in one row of the FITS table.

static Bool casa::MSFitsOutput::writeGC ( FitsOutput output,
const MeasurementSet ms,
const Table syscal,
const Block< Int > &  spwidMap,
uInt  nrif,
Bool  combineSpw,
Double  sensitivity,
Int  refPixelFreq,
Double  refFreq,
Double  chanbw 
) [static, private]

Write the GC table.

static FitsOutput* casa::MSFitsOutput::writeMain ( Int refPixelFreq,
Double refFreq,
Double chanbw,
const String outFITSFile,
const MeasurementSet rawms,
const String column,
const Block< Int > &  spwidMap,
Int  nrspw,
Int  startchan,
Int  nchan,
Int  stepchan,
const Block< Int > &  fieldidMap,
Bool  asMultiSource,
const Bool  combineSpw,
const Bool  padWithFlags = true,
Int  avgchan = 1 
) [static, private]

Write the main table.

Parameters:
refPixelFreq
refFreq
chanbw
outFITSFile
rawms
columndata column to write
spwidMapspwidMap[inp_spw] = output_spw, if inp_spw is selected -1 otherwise.
nrspw# of selected spws.
startchanFirst channel
nchan# of channels
stepchanchannel stride
fieldidMapfieldidMap[inp_fld] = output_fld, if inp_fld is selected -1 otherwise.
asMultiSourceIf true, write a multisource UVFITS file.
combineSpwIf true, export the spectral window(s) as IF(s).
padWithFlagsIf true && combineSpw==true, pad the spws with flags as necessary to fit the IF structure.
static Bool casa::MSFitsOutput::writeSU ( FitsOutput output,
const MeasurementSet ms,
const Block< Int > &  fieldidMap,
Int  nrfield,
const Block< Int > &  spwidMap,
Int  nrspw 
) [static, private]

Write the SU table.

static Bool casa::MSFitsOutput::writeTY ( FitsOutput output,
const MeasurementSet ms,
const Table syscal,
const Block< Int > &  spwidMap,
uInt  nrif,
Bool  combineSpw 
) [static, private]

Write the TY table.

static Bool casa::MSFitsOutput::writeWX ( FitsOutput output,
const MeasurementSet ms 
) [static, private]

Write the WX table.


The documentation for this class was generated from the following file: