casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables
Functions
sdsave Namespace Reference

Functions

def sdsave

Function Documentation

def sdsave.sdsave (   infile = '',
  antenna = 0,
  getpt = True,
  rowlist = [],
  scanlist = [],
  field = '',
  iflist = [],
  pollist = [],
  scanaverage = False,
  timeaverage = False,
  tweight = 'none',
  polaverage = False,
  pweight = 'none',
  restfreq = '',
  outfile = '',
  outform = 'ASAP',
  overwrite = False 
)
ASAP SD task: save the sd spectra in various format
  Keyword arguments:
infile -- name of input SD dataset
antenna -- antenna name or id (only effective for MS input). 
getpt -- fill DIRECTION column properly, or reuse POINTING table 
         in original MS (only effective for MS input)
         default: True
         options: True (fill DIRECTION column properly)
                  False (reuse POINTING table in original MS)
rowlist -- list of row numbers to process
        default: [] (use all rows)
        example: [0,2,4,6]
        For expert users only!
        this selection is applied first, and then followed by
        the selection with scans, fields, ifs, and polarizations. 
scanlist -- list of to process
        default: [] (use all scans)
        example: [21,22,23,24]
        this selection is in addition to field, iflist, and pollist
field -- selection string for selecting scans by name
        default: '' (no name selection)
        example: 'FLS3a*'
        this selection is in addition to scanlist, iflist, and pollist
iflist -- list of IF id numbers to select
        default: [] (use all IFs)
        example: [15]
        this selection is in addition to scanlist, field, and pollist
pollist -- list of polarization id numbers to select
        default: [] (use all polarizations)
        example: [1]
        this selection is in addition to scanlist, field, and iflist
scanaverage --  average integrations within scans
        options: (bool) True,False
        default: False
        example: if True, average integrations before it is saved
timeaverage -- average times for multiple scan cycles
        options: (bool) True,False
        default: False
        >>>timeaverage expandable parameter
         tweight -- weighting for time average
                 options: 'none'
                          'var'   (1/var(spec) weighted)
                          'tsys'  (1/Tsys**2 weighted)
                          'tint'  (integration time weighted)
                          'tintsys'  (Tint/Tsys**2)
                          'median'  ( median averaging)
                 default: 'none'

polaverage -- average polarizations
        options: (bool) True,False
        default: False
        >>>polaverage expandable parameter
         pweight -- weighting for polarization average
                 options: 'none'
                          'var'  (1/var(spec) weighted)
                          'tsys' (1/Tsys**2 weighted)
restfreq -- rest frequencies of output data
        Available types are a number, string, a list of numbers or
        strings (see examples below), and list of dictionaries. 
        The default unit of restfreq is Hz, if not specified.
        A list can be used to set different rest frequencies to
        each IF. the length of list input must be nIF. Dictionary 
        input should be a pair of molecule name and frequency with 
        keys of 'name' and 'value', respectively. The 'value's in the 
        dictionary input follows the same manner as for single 
        float or string input. 
        default: '' (use current setting)
        example: 4.6e10 (float value in Hz),
                 '46GHz' (string with unit),
                 ['345.8GHz', '347.0GHz', 356.7e9] (for each IF)
                 [{'name':'CO','value':345e9}] (a value with name)
outfile -- name of output dataset
        default: '' 
outform -- output data format
        default: 'ASAP'
        Options: 'ASAP', 'MS2', 'SDFITS', 'ASCII'
overwrite -- overwrite the output file if already exists
        options: (bool) True,False
        default: False
        WARNING: if outform='ASCII', this parameter is ignored


DESCRIPTION:

Task sdsave writes the single dish data to a disk file in 
specified format (ASAP, MS2, SDFITS, ASCII). It is possible to 
save the subset of the data by selecting row numbers, scan numbers, 
IF ids, polarization ids and field names. The ASAP (scantable) format 
is recommended for further analysis using Sd tool. For further 
imaging using imager, save the data to the Measurement Set (MS2).

Note that setting getpt=False needs a lot of attention.
If you set getpt=False, the task retrieves pointing direction from 
MS's FIELD table, which might not be correct for single dish 
observation, instead to check MS's POINTING table, which is the 
default behavior of the task (getpt=True). To compensate this, 
absolute path to MS's POINTING table is stored, and it will be used 
for POINTING table when the data is converted back to MS format. 
In general, getpt=False is faster especially for large data. However, 
MS created from Scantable cannot have correct POINTING table if 
original MS's POINTING table doesn't exist. Such situation will 
happen when original MS is removed or renamed, or imported Scantable 
is moved to other computer alone.

WARNING for the GBT raw SDFITS format data as input:
SDtasks are able to handle GBT raw SDFITS format data since the 
data filler is available. However, the functionality is not well 
tested yet, so that there may be unknown bugs.  

Definition at line 13 of file sdsave.py.

References task_sdsave.sdsave(), and vla_uvfits_line_sf.verify.