Loading...
Searching...
No Matches
casacore::MSFitsOutput Class Reference
msfits package (libcasa_msfits) » MSFits_module

More...

`#include <MSFitsOutput.h>`

## Public Member Functions

| MSFitsOutput (const String &fitsfile, const MeasurementSet &ms, const String &column)
void | setChannelInfo (Int startChan, Int nchan, Int stepChan, Int avgChan)
void | setWriteSysCal (Bool writeSysCal)
void | setAsMultiSource (Bool asMultiSource)
void | setCombineSpw (Bool combineSpw)
void | setWriteStation (Bool writeStation)
void | setSensitivity (Double sensitivity)
void | setPadWitFlags (Bool padWithFlags)
void | setFieldNumber (uInt fieldNumber)
void | setOverwrite (Bool overwrite)
void | write () const
| write the uvfits file.

## 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, uInt fieldNumber=0, Bool overwrite=False)
| Convert a MeasurementSet to random group UVFITS.

## Private Member Functions

std::shared_ptr< FitsOutput > | _writeMain (Int &refPixelFreq, Double &refFreq, Double &chanbw, const String &outFITSFile, const Block< Int > &spwidMap, Int nrspw, const Block< Int > &fieldidMap, Bool asMultiSource) const
| Write the main table.

## Static Private Member Functions

static Bool | _writeFQ (std::shared_ptr< 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 (std::shared_ptr< FitsOutput > output, const MeasurementSet &ms, Double refFreq, Bool writeStation)
| Write the AN table.
static Bool | _writeSU (std::shared_ptr< FitsOutput > output, const MeasurementSet &ms, const Block< Int > &fieldidMap, Int nrfield, const Block< Int > &spwidMap, Int nrspw)
| Write the SU table.
static Bool | _writeTY (std::shared_ptr< FitsOutput > output, const MeasurementSet &ms, const Table &syscal, const Block< Int > &spwidMap, uInt nrif, Bool combineSpw)
| Write the TY table.
static Bool | _writeGC (std::shared_ptr< 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 (std::shared_ptr< FitsOutput > output, const MeasurementSet &ms)
| Write the WX table.
static Bool | _writeSY (std::shared_ptr< FitsOutput > output, const MeasurementSet &ms, Table &syspower, Int nspw, const Block< Int > &spwIDMap, Bool combineSpw)
| Write the SY 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.
static void | _checkReceptorAngles (const Vector< Quantity > &ra0, Vector< Quantity > &ra1, Int antnum)

## Private Attributes

const String | _fitsfile
const String | _column
const MeasurementSet | _ms
Int | _startChan
Int | _nchan
Int | _stepChan
Int | _avgChan
Bool | _writeSysCal
Bool | _asMultiSource
Bool | _combineSpw
Bool | _writeStation
Bool | _padWithFlags
Bool | _overwrite
Double | _sensitivity
uInt | _fieldNumber

## Detailed Description

Write a MeasurementSet to a random group uvfits file.

Definition at line 48 of file MSFitsOutput.h.

## Constructor & Destructor Documentation

## MSFitsOutput()

casacore::MSFitsOutput::MSFitsOutput | ( | const String & | fitsfile,
|  | const MeasurementSet & | ms,
|  | const String & | column )

Parameters

  fitsfile | Output filename
  ms | input
  column | specifies which "data" column to write ("observed", "calibrated", "model")

## Member Function Documentation

## _checkReceptorAngles()

void casacore::MSFitsOutput::_checkReceptorAngles | ( | const Vector< Quantity > & | ra0,
|  | Vector< Quantity > & | ra1,
|  | Int | antnum )

static private

## _handleAntNumbers()

void casacore::MSFitsOutput::_handleAntNumbers | ( | const MeasurementSet & | ms,
|  | Vector< Int > & | antnumbers )

static private

Discern the antenna numbers that go into UVFITS.

## _makeIdMap()

Int casacore::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

## _writeAN()

Bool casacore::MSFitsOutput::_writeAN | ( | std::shared_ptr< FitsOutput > | output,
|  | const MeasurementSet & | ms,
|  | Double | refFreq,
|  | Bool | writeStation )

static private

Write the AN table.

## _writeFQ()

Bool casacore::MSFitsOutput::_writeFQ | ( | std::shared_ptr< 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.

## _writeGC()

Bool casacore::MSFitsOutput::_writeGC | ( | std::shared_ptr< 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.

## _writeMain()

std::shared_ptr< FitsOutput > casacore::MSFitsOutput::_writeMain | ( | Int & | refPixelFreq,
|  | Double & | refFreq,
|  | Double & | chanbw,
|  | const String & | outFITSFile,
|  | const Block< Int > & | spwidMap,
|  | Int | nrspw,
|  | const Block< Int > & | fieldidMap,
|  | Bool | asMultiSource ) const

private

Write the main table.

Parameters

  refPixelFreq |
  refFreq |
  chanbw |
  outFITSFile |
  spwidMap | spwidMap[inp_spw] = output_spw, if inp_spw is selected -1 otherwise.
  nrspw | # of selected spws.
  fieldidMap | fieldidMap[inp_fld] = output_fld, if inp_fld is selected -1 otherwise.
  asMultiSource | If true, write a multisource UVFITS file.

## _writeSU()

Bool casacore::MSFitsOutput::_writeSU | ( | std::shared_ptr< FitsOutput > | output,
|  | const MeasurementSet & | ms,
|  | const Block< Int > & | fieldidMap,
|  | Int | nrfield,
|  | const Block< Int > & | spwidMap,
|  | Int | nrspw )

static private

Write the SU table.

## _writeSY()

Bool casacore::MSFitsOutput::_writeSY | ( | std::shared_ptr< FitsOutput > | output,
|  | const MeasurementSet & | ms,
|  | Table & | syspower,
|  | Int | nspw,
|  | const Block< Int > & | spwIDMap,
|  | Bool | combineSpw )

static private

Write the SY table.

## _writeTY()

Bool casacore::MSFitsOutput::_writeTY | ( | std::shared_ptr< FitsOutput > | output,
|  | const MeasurementSet & | ms,
|  | const Table & | syscal,
|  | const Block< Int > & | spwidMap,
|  | uInt | nrif,
|  | Bool | combineSpw )

static private

Write the TY table.

## _writeWX()

Bool casacore::MSFitsOutput::_writeWX | ( | std::shared_ptr< FitsOutput > | output,
|  | const MeasurementSet & | ms )

static private

Write the WX table.

## get_tbf_end()

uInt casacore::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

  rownr | Row # to start from.
  nrow | # of rows in the columns.
  nif | # of IFs
  timec | time(_centroid) col
  ininterval | used to set tolerance on changes in timec.
  ant1 | ID of baseline's antenna 1.
  ant2 | ID of baseline's antenna 2.
  asMultiSource | If 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).

## getStartHA()

void casacore::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.

## handleSysCal()

Table casacore::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.

## setAsMultiSource()

void casacore::MSFitsOutput::setAsMultiSource | ( | Bool | asMultiSource | ) |

Parameters

  asMultiSource | If true a multi-source UVFits file is written.

## setChannelInfo()

void casacore::MSFitsOutput::setChannelInfo | ( | Int | startChan,
|  | Int | nchan,
|  | Int | stepChan,
|  | Int | avgChan )

Parameters

  startChan | 1st channel
  nchan | # of channels
  stepChan | # of channels to stride by
  avgChan | average every N channels

## setCombineSpw()

void casacore::MSFitsOutput::setCombineSpw | ( | Bool | combineSpw | ) |

Parameters

  combineSpw | If true it attempts to write the spectral windows as IFs. This is necessary for many aips tasks, and for difmap.

## setFieldNumber()

void casacore::MSFitsOutput::setFieldNumber | ( | uInt | fieldNumber | ) |

References casacore::fieldNumber().

## setOverwrite()

void casacore::MSFitsOutput::setOverwrite | ( | Bool | overwrite | ) |

Parameters

  overwrite | overwrite existing file?

## setPadWitFlags()

void casacore::MSFitsOutput::setPadWitFlags | ( | Bool | padWithFlags | ) |

Parameters

  padWithFlags | If true and combineSpw==true, fill spws with flags as needed to fit the IF structure. Does not yet support spws with different shapes.

## setSensitivity()

void casacore::MSFitsOutput::setSensitivity | ( | Double | sensitivity | ) |

## setWriteStation()

void casacore::MSFitsOutput::setWriteStation | ( | Bool | writeStation | ) |

Parameters

  writeStation | If true uses pad instead of antenna names.

## setWriteSysCal()

void casacore::MSFitsOutput::setWriteSysCal | ( | Bool | writeSysCal | ) |

Parameters

  writeSysCal | whether to write the system calibration table

## timeToDay()

void casacore::MSFitsOutput::timeToDay | ( | Int & | day,
|  | Double & | dayFraction,
|  | Double | time )

static private

Convert time to day and fraction.

References casacore::day(), and casacore::time().

## write()

void casacore::MSFitsOutput::write | ( |  | ) | const

write the uvfits file.

## writeFitsFile()

Bool casacore::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,
|  | uInt | fieldNumber = 0,
|  | Bool | overwrite = False )

static

Convert a MeasurementSet to random group UVFITS.

Parameters

  fitsfile | Output filename
  ms | input
  column | specifies which "data" column to write ("observed", "calibrated", "model")
  startchan | 1st channel
  nchan | # of channels
  stepchan | # of channels to stride by
  writeSysCal | whether to write the system calibration table
  asMultiSource | If true a multi-source UVFits file is written.
  combineSpw | If true it attempts to write the spectral windows as IFs. This is necessary for many aips tasks, and for difmap.
  writeStation | If true uses pad instead of antenna names.
  sensitivity |
  padWithFlags | If true and combineSpw==true, fill spws with flags as needed to fit the IF structure. Does not yet support spws with different shapes.
  avgchan | average every N channels
  fieldNumber | field number
  overwrite | overwrite existing file?

References casacore::False, and casacore::fieldNumber().

## Member Data Documentation

## _asMultiSource

Bool casacore::MSFitsOutput::_asMultiSource

private

Definition at line 132 of file MSFitsOutput.h.

## _avgChan

Int casacore::MSFitsOutput::_avgChan

private

Definition at line 131 of file MSFitsOutput.h.

## _column

const String casacore::MSFitsOutput::_column

private

Definition at line 129 of file MSFitsOutput.h.

## _combineSpw

Bool casacore::MSFitsOutput::_combineSpw

private

Definition at line 132 of file MSFitsOutput.h.

## _fieldNumber

uInt casacore::MSFitsOutput::_fieldNumber

private

Definition at line 135 of file MSFitsOutput.h.

## _fitsfile

const String casacore::MSFitsOutput::_fitsfile

private

Definition at line 129 of file MSFitsOutput.h.

## _ms

const MeasurementSet casacore::MSFitsOutput::_ms

private

Definition at line 130 of file MSFitsOutput.h.

## _nchan

Int casacore::MSFitsOutput::_nchan

private

Definition at line 131 of file MSFitsOutput.h.

## _overwrite

Bool casacore::MSFitsOutput::_overwrite

private

Definition at line 133 of file MSFitsOutput.h.

## _padWithFlags

Bool casacore::MSFitsOutput::_padWithFlags

private

Definition at line 133 of file MSFitsOutput.h.

## _sensitivity

Double casacore::MSFitsOutput::_sensitivity

private

Definition at line 134 of file MSFitsOutput.h.

## _startChan

Int casacore::MSFitsOutput::_startChan

private

Definition at line 131 of file MSFitsOutput.h.

## _stepChan

Int casacore::MSFitsOutput::_stepChan

private

Definition at line 131 of file MSFitsOutput.h.

## _writeStation

Bool casacore::MSFitsOutput::_writeStation

private

Definition at line 133 of file MSFitsOutput.h.

## _writeSysCal

Bool casacore::MSFitsOutput::_writeSysCal

private

Definition at line 132 of file MSFitsOutput.h.

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

- msfits/MSFits/MSFitsOutput.h