Combining Bandpasses

From CASA Guides
Revision as of 23:04, 22 March 2010 by Jott (talk | contribs)
Jump to navigationJump to search

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.


3) applycal: The combined bandpass will, by definition, be based on the frequency of the first input spw. The third step is map this solution to the central spw.

#  applycal :: Apply calibrations solutions(s) to data
vis                 = '9_4_sb1190721_1_000.55268.03407332176.ms' #  Name of input visibility
                                        #   file
field               =         ''        #  Select field using field id(s) or field name(s)
spw                 =        '0'        #  Select spectral window/channels
selectdata          =      False        #  Other data selection parameters
gaintable           = '34on0.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              = [0, 0, 0, 0, 0, 0, 0, 0, 0] #  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(...)


  1. bandpass :: Calculates a bandpass calibration solution

vis = '9_4_sb1190721_1_000.55268.03407332176.ms' # Name of input visibility

                                       #   file

caltable = 'gainbp34on0.cal' # Name of output gain calibration table 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 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

                                       #   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(...)


--Juergen Ott 19 March 2010