Getting Started Documentation Glish Learn More Programming Contact Us
Version 1.9 Build 1488
News FAQ
Search Home


next up previous contents index
Next: ms.summary - Function Up: ms - Tool Previous: ms.command - Function


ms.tofits - Function



Package general
Module ms
Tool ms


Convert a measurement set to a UVFITS file


Synopsis
tofits(fitsfile, column, fieldid, spwid, start, nchan, width, writesyscal, multisource, combinespw, writestation)


Arguments

fitsfile in Name of the new UVFITS file
    Allowed: String
    Default: no default
column in Data column to write, see above for options
    Allowed: String
    Default: corrected
fieldid in selection of fields to write out
    Allowed: Vector of ints
    Default: []
spwid in selection of spectral windows to write out
    Allowed: Vector of ints
    Default: []
start in First channel at output
    Allowed: Int
    Default: -1
nchan in number of channel to output
    Allowed: Int
    Default: -1
width in number of input channels to average for output
    Allowed: Int
    Default: -1
writesyscal in Write GC and TY tables
    Allowed: Boolean
    Default: F
multisource in Write in multisource format
    Allowed: Boolean
    Default: F
combinespw in Handle spectral window as IF
    Allowed: Boolean
    Default: F
writestation in Write station name instead of antenna name
    Allowed: Boolean
    Default: F



Description
This functions writes a UVFITS file that contains the data in the measurement set associated with this tool. The FITS file is always written in floating point format and the data is always stored in the primary array of the FITS file.

If the measurement set has been processed by many of the imaging tools, including imager and calibrator, it may contain additional data columns. You need to select which of these data columns will be written to the FITS file. The possible options are:

observed
This is the raw data as collected by the telescope. All interferometric measurement sets must contain this column. A synonym for 'observed' is 'data'.
corrected
This is the calibrated data. A synonym for 'corrected' is 'corrected_data'.
model
This is the visibilites that would be measured using the current model of the sky. A synonym for 'model' is 'model_data'.
The parsing of these strings is case insensitive. If any other option is specified then the observed data will be written.

By default a single-source UVFITS file is written, but if the measurement set contains more than one field or if you set the multisource argument to T a multi-source UVFITS file will be written. Because of limitations in the UVFITS format you have to ensure that the data shape is fixed for all the data you intend to write to one FITS file. See the general description of this tool for how you can select data to meet this condition.

The combinespw argument is used to control whether data from different spectral windows will be written as different entries in the FITS FQ (frequency) table or combined as different IF's within one entry in the FQ table. You should set this to T only if you know that the data from different spectral windows was observed simultaneously, and the data in the measurement set can be equally divided between all the spectral windows. Use of this switch is recommended for data to be processed in classic AIPS (if possible, e.g., standard dual IF observations).

The FITS GC (gain curve) and TY (system temperature) tables can be optionally written by setting the writesyscal argument to T. This is a rather WSRT-specific operation at the moment and may not work correctly for measurement sets from other telescopes.

The three parameters 'start', 'nchan', 'width' are for channel averaging while outputing the data to the fits file. The default values of -1 will copy the channels of the input as is. 'start' is input channel number that will be the first channel of the output. 'nchan' is the number of channel wanted in the output data. 'width' is the number of channels of the input data to make 1 channel of the output data. Hence (nchan*width+start-1) should not be larger than the number of channels in the original data.



Example
      include 'ms.g'
      myms := ms('3C273XC1.ms')
      myms.tofits('3C273XC1.fits', column='DATA'); 
      myms.done()
This example writes the observed data of a measurement set to a UVFITS file.
      include 'ms.g'
      myms := ms('big.ms')
      myms.tofits('part.fits', column='CORRECTED', fieldid=[1,2], spwid=[3]); 
      myms.done()
This example writes part (the first 2 fields and for the third spectral window) of the corrected data to the fits file.





next up previous contents index
Next: ms.summary - Function Up: ms - Tool Previous: ms.command - Function   Contents   Index
Please send questions or comments about AIPS++ to aips2-request@nrao.edu.
Copyright © 1995-2000 Associated Universities Inc., Washington, D.C.

Return to AIPS++ Home Page
2006-08-01