Combining Bandpasses: Difference between revisions

From CASA Guides
Jump to navigationJump to search
No edit summary
No edit summary
Line 111: Line 111:
spw                =        '0'        #  Select spectral window/channels
spw                =        '0'        #  Select spectral window/channels
selectdata          =      False        #  Other data selection parameters
selectdata          =      False        #  Other data selection parameters
gaintable          = '34on0.bpcal'    #  Gain calibration table(s) to apply on the fly
gaintable          = 'corr.gcal,bp12.bpcal'    #  Gain calibration table(s) to apply on the fly
gainfield          =      ['']        #  Select a subset of calibrators from gaintable(s)
gainfield          =      ['']        #  Select a subset of calibrators from gaintable(s)
interp              = ['linear']        #  Temporal Interpolation type.  default=linear
interp              = ['linear']        #  Temporal Interpolation type.  default=linear
spwmap              = [0, 0, 0, 0, 0, 0, 0, 0, 0] #  Spectral windows combinations to form for
spwmap              = [1]               #  Spectral windows combinations to form for
                                         #  gaintables(s)
                                         #  gaintables(s)
gaincurve          =      False        #  Apply internal VLA antenna gain curve correction
gaincurve          =      False        #  Apply internal VLA antenna gain curve correction
Line 126: Line 126:




The spw mapping is done by


#  bandpass :: Calculates a bandpass calibration solution
<pre>
vis                = '9_4_sb1190721_1_000.55268.03407332176.ms' # Name of input visibility
spwmap              = [1]  
                                        #  file
</pre>
caltable            = 'gainbp34on0.cal' #  Name of output gain calibration table
parameter. It maps the spw 1 (see above, in this case the combined spw 1 and 2) solution to 0th spw, as the number is at the 0th position of a possible list (see the help par.spwmap for more info in more complex cases.
field              =        ''        #  Select field using field id(s) or field name(s)
spw                 =        '0'        #  Select spectral window/channels
selectdata          =      False        #  Other data selection parameters
solint              =      'inf'        #  Solution interval
combine            =        ''        #  Data axes which to combine for solve (scan, spw,
                                        #  and/or field)
refant              =        ''        # Reference antenna name
minblperant        =          4        #  Minimum baselines _per antenna_ required for solve
solnorm            =      True        #  Normalize average solution amplitudes to 1.0 (G, T
                                        #  only)
bandtype            =        'B'        #  Type of bandpass solution (B or BPOLY)
    fillgaps      =          0        #  Fill flagged solution channels by interpolation


append              =      False        #  Append solutions to the (existing) table
And don't forget to apply *both* the gain and the bandpass calibration table to the science data.
gaintable          = ['gainbp34.cal']  #  Gain calibration table(s) to apply on the fly
 
gainfield          =      ['']        #  Select a subset of calibrators from gaintable(s)
 
interp              = ['linear']        #  Interpolation mode (in time) to use for each
Now you should have applied the average bandpass from the two offset frequencies in spws 1 and 2 to the central spw 0.  
                                        #  gaintable
spwmap              = [3, 3, 3, 3, 3, 3] #  Spectral windows combinations to form for
                                        #  gaintables(s)
gaincurve          =      False        #  Apply internal VLA antenna gain curve correction
opacity            =        0.0       #  Opacity correction to apply (nepers)
parang              =      False        #  Apply parallactic angle correction
async              =      False        #  If true the taskname must be started using
                                        #  bandpass(...)




--[[User:jott|Juergen Ott]] 19 March 2010
--[[User:jott|Juergen Ott]] 22 March 2010

Revision as of 19:13, 22 March 2010

Under construction

Sometimes the bandpass calibrator at the required frequency is contaminated with line absorption or emission. In particular, this is nuisance for observations close to the rest frequency of HI where Galactic HI is observed along almost any sightline.

A technique to still obtain a usable bandpass solution is to observe frequencies offset to the main frequency. These offset frequencies should be chosen clean from any line contamination. Ideally it is advisable to observe two offset frequencies, symmetric to the main observing frequency.

In the following we explain how to combine these offset frequencies for a common bandpass and how to apply it to the central frequency.

As an example, we describe a Galactic HI observation ('data.ms'). At the HI frequency, all calibrators will have emission and/or absorption. Thus any bandpass at the HI frequency will be contaminated. A solution is to observe 3 frequencies: The central, HI frequency, a frequency +4MHz offset and on -4MHz offset. In this example, the spectral windows (spw), are 0, 1, and 2, respectively. Bandpass calibrator in the example below is 3c286 and the source 'galaxy'.


Three steps are needed:

1) gaincal: the offset frequencies typically also have different phases. Since the bandpass is obtained by 'vector averaging' the data, one needs to correct for the phase offsets. The best way to do this is to derive and apply a complex gain solution for all spw.


#  gaincal :: Determine temporal gains from calibrator observations
vis                 = 'data.ms'         #  Name of input visibility
                                        #   file
caltable            = 'corr.gcal'       #  Name of output gain calibration table
field               =     '3c286'       #  Select field using field id(s) or field name(s)
spw                 =         ''        #  Select spectral window/channels
selectdata          =      False        #  Other data selection parameters
solint              =      'inf'        #  Solution interval: egs. 'inf', '60s' (see help)
combine             =         ''        #  Data axes which to combine for solve (scan, spw,
                                        #   and/or field)
preavg              =       -1.0        #  Pre-averaging interval (sec) (rarely needed)
refant              =         ''        #  Reference antenna name.  ' '= '0'
minblperant         =          4        #  Minimum baselines _per antenna_ required for solve
minsnr              =        0.0        #  Reject solutions below this SNR
solnorm             =      False        #  Normalize average solution amplitudes to 1.0 (G, T
                                        #   only)
gaintype            =        'G'        #  Type of gain solution (G, T, or GSPLINE)
calmode             =       'ap'        #  Type of solution" ('ap', 'p', 'a')
append              =      False        #  Append solutions to the (existing) table
gaintable           =       ['']        #  Gain calibration table(s) to apply on the fly
gainfield           =       ['']        #  Select a subset of calibrators from gaintable(s)
interp              =       ['']        #  Temporal interpolation for each gaintable (=linear)
spwmap              =         []        #  Spectral windows combinations to form for
                                        #   gaintables(s)
gaincurve           =      False        #  Apply internal VLA antenna gain curve correction
opacity             =        0.0        #  Opacity correction to apply on the fly (nepers)
parang              =      False        #  Apply parallactic angle correction on the fly
async               =      False        #  If true the taskname must be started using
                                        #   gaincal(...)

This will create a calibration table 'corr.gcal' solving for the gains and phase offests of all frequencies. After this step, the data can be vector averaged.

2) bandpass: now we combine the two offset frequency observations into a single bandpass solution by averaging.

#  bandpass :: Calculates a bandpass calibration solution
vis                 = 'data.ms'         #  Name of input visibility
                                        #   file
caltable            = 'bp12.bcal'       #  Name of output gain calibration table
field               =     '3c286'       #  Select field using field id(s) or field name(s)
spw                 =       '1,2'       #  Select spectral window/channels
selectdata          =      False        #  Other data selection parameters
solint              =      'inf'        #  Solution interval
combine             = 'spw,scan'        #  Data axes which to combine for solve (scan, spw,
                                        #   and/or field)
refant              =         ''        #  Reference antenna name
minblperant         =          4        #  Minimum baselines _per antenna_ required for solve
solnorm             =       True        #  Normalize average solution amplitudes to 1.0 (G, T
                                        #   only)
bandtype            =        'B'        #  Type of bandpass solution (B or BPOLY)
     fillgaps       =          0        #  Fill flagged solution channels by interpolation

append              =      False        #  Append solutions to the (existing) table
gaintable           = ['corr.gcal']     #  Gain calibration table(s) to apply on the fly
gainfield           =       ['']        #  Select a subset of calibrators from gaintable(s)
interp              = ['linear']        #  Interpolation mode (in time) to use for each
                                        #   gaintable
spwmap              = []                #  Spectral windows combinations to form for
                                        #   gaintables(s)
gaincurve           =      False        #  Apply internal VLA antenna gain curve correction
opacity             =        0.0        #  Opacity correction to apply (nepers)
parang              =      False        #  Apply parallactic angle correction
async               =      False        #  If true the taskname must be started using
                                        #   bandpass(...)

The combination of frequencies is done in the

combine             = 'spw,scans'

keyword. And note that the gain calibration table 'corr.gcal' from step 1 is applied in the

gaintable           = ['corr.gcal']

parameter. The resulting bandpass is in the 'bp12.bcal', which, however refers to the 'corr.gcal' table. So both of the tables need to be carried further in the process, step 3.

Note that the combined bandpass of spw 1 and 2 will be labeled to the first spw. This will be shown in the logger as

2010-03-18 01:48:56     INFO    bandpass::::    Combining spws: [1, 2] -> 1

3) applycal: The third step is to apply the bandpass to the source. In the same step, the combined bandpass is mapped to the spw 0.

#  applycal :: Apply calibrations solutions(s) to data
vis                 =   'data.ms'       #  Name of input visibility
                                        #   file
field               =   'galaxy'        #  Select field using field id(s) or field name(s)
spw                 =        '0'        #  Select spectral window/channels
selectdata          =      False        #  Other data selection parameters
gaintable           = 'corr.gcal,bp12.bpcal'     #  Gain calibration table(s) to apply on the fly
gainfield           =       ['']        #  Select a subset of calibrators from gaintable(s)
interp              = ['linear']        #  Temporal Interpolation type.  default=linear
spwmap              = [1]               #  Spectral windows combinations to form for
                                        #   gaintables(s)
gaincurve           =      False        #  Apply internal VLA antenna gain curve correction
opacity             =        0.0        #  Opacity correction to apply (nepers)
parang              =      False        #  Apply parallactic angle correction
calwt               =       True        #  Calibrate data weights from all relevant
                                        #   calibrations
async               =      False        #  If true the taskname must be started using
                                        #   applycal(...)


The spw mapping is done by

spwmap              = [1]  

parameter. It maps the spw 1 (see above, in this case the combined spw 1 and 2) solution to 0th spw, as the number is at the 0th position of a possible list (see the help par.spwmap for more info in more complex cases.

And don't forget to apply *both* the gain and the bandpass calibration table to the science data.


Now you should have applied the average bandpass from the two offset frequencies in spws 1 and 2 to the central spw 0.


--Juergen Ott 22 March 2010