Design of Flux Calibration Enhancements in GBTIDL

Jim Braatz


Spectral line flux calibration capabilities for GBTIDL version 2.1 are described in the Calibration document. The calibration scheme described in that document has known limitations. Here we describe several enhancements that address those limitations.

The existing calibration scheme needs to be enhanced by adding three new capabilities:

  1. Tcal and Tsys will be changed from scalar values to vector quantities, where both Tcal and Tsys are functions of frequency (Tcal[freq] and Tsys[freq])
  2. Aperture efficiency will be implemented as a 2-D vector, where ap_eff is a function of frequency and elevation (ap_eff[freq,elv])
  3. Zenith opacity will be implemented as a vector, where tau is a function of frequency and time (tau[freq, time]).

Default values for these vector calibration quantities must be generated by the sdfits program and stored in a database that is accessible to GBTIDL. Opacity values will be taken from weather conditions. Aperture efficiency and Tcal entries will be filled from lookup tables. The user should be able to inspect the database and replace the calibration values. Additionally, the user should be able to revert to the defaults.

Upon implementation of these enhancements, observers will get better default calibration using exactly the same syntax as is already familiar in GBTIDL, and observers who require high precision flux calibration will have better tools to attain it.

Current situation with GBTIDL calibration:

The sdfits program calculates and attaches a scalar Tcal value to each record's data header. The Tcal scalar is taken as an average of the Tcals over the frequency range observed. A scalar Tsys is then calculated from the central 80% of the observed band, and applied in the flux calibration. No information is stored in the SDFITS file to describe atmospheric opacity (tau) or aperture efficency (ap_eff). The user can supply scalar tau and ap_eff values to the calibration routines (getnod, getps, ...). When the user does not specify tau or ap_eff, GBTIDL applies default values, as described in the calibration document.

Proposed situation:

The sdfits program will write a database containing Tcal, ap_eff, and tau as vector quantities for all data contained in the sdfits file. The database can be stored either as an extension in the SDFITS file or as an external file associated with the SDFITS file. GBTIDL calibration procedures will access this database by default when generating spectra. Users will have tools to inspect and modify values in the calibration database.

Note the situation can get complicated if the observer changes receivers during a run. As an implementation issue, we might consider enforcing each receiver's data for a given project being written into its own SDFITS file.

New tools required

  • The sdfits program will be modified to determine appropriate Tcal, ap_eff and tau, and write these values to a database. The program will remain unchanged from the user's perspective. No new parameters are required in the sdfits program. All new functionality is "under the hood".

  • The following new GBTIDL procedures and functions will be developed:

  1. set_cal, tau=tau, ap_eff=ap_eff, tcal=tcal, /default

     This procedure writes new values into the calibration database.  The parameters tau, ap_eff, and tcal
     are used to enter new calibration information.  Each of these parameters is optional, but at least one 
     must be supplied unless the /default switch is set.  Each parameter can accept either a scalar 
     value, in which case the value is applied to all frequencies, times, and elevations, or it can accept
     a structure, defined as follows:

     tau    : tau.time, tau.freq[], tau.value[freq]

            tau.time is the starting time for which the specified tau values will be applied.
            tau.freq is an array of frequencies for which zenith opacity is specified in tau.value.
            tau.value is the array of opacity values, one for each frequency.  Opacity values used
                      in calibration will be interpolated from this curve by the calibration procedures.

     ap_eff : ap_eff.elv[], ap_eff.freq[], ap_eff.value[freq, elv]

            ap_eff.elv is an array of elevations for which the ap_eff is specified.
            ap_eff.freq is an array of frequencies for which the ap_eff is specified.
            ap_eff.value is the 2-d array of aperture efficiencies, one for each frequency
                       and elevation.

     tcal   : tcal.freq[], tcal.value[n_feed, n_pol, freq]

            tcal.freq is an array of frequencies for which the tcal is specified.
            tcal.value is the array of calibration temperatures, one for each frequency, feed, 
                       and polarization.

  2. get_cal(scan=scan, time=time, /tau, /ap_eff, /tcal)

     This function returns calibration values from the database.  Exactly one of the switches 
     (tau, ap_eff, or tcal) should be set.  If the user requests tau values and there are tau values
     in the database for more than one time, then the user must also specify either a time or a scan 
     number to the get_cal function.  The function returns a structure with the appropriate fields to 
     be fed directly back into set_cal.

  3. calc_tcal(scan, ap_eff=ap_eff, tau=tau)

     This procedure will reduce an observation of a flux calibrator in order to determine the Tcal 
     spectrum.  The observer should integrate on one of the accepted flux calibration sources 
     (3C48, 3C286, ...) using the same number of beams and polarizations as in the target observations.
     The frequency range of the calibration scans should at least cover the range of frequencies
     observed in the target sources.  Wide-bandwidth, low-resolution observing modes are fine for 
     the calibration observations.  The Tcal measurements are smoothed to about 1 MHz anyway, so 
     high resolution observations are unnecessary.  It should be acceptable to observe flux 
     calibrators using several scans and combine these measurements in the calibration database
     using several calls to calc_tcal, if necessary.

     A good starting place for the development of this procedure 
     is ~rmaddale/mypros/  We can drop the parts of the routine that determine the 
     non-linearity calibration factors.

     ap_eff and tau can be scalars or vector functions of frequency.  If they are vectors then
     they should be sent as structures, using the same field names as the tau and ap_eff parameters 
     defined above under the procedure set_cal.

     Ron notes: it may be necessary for the observer to specify the smoothing factor.  Also, for Ka band,
     a sampler name may be necessary.

  4. get_wx_tau(time, freq)

     Returns tau values from Ron's weather-based calculations.  The input for time is a scalar value in MJD
     and freq can be either a scalar or a vector.  If freq is a vector, the function returns tau for each
     element of the vector.

Use Cases

  • Set tau to a single value which will be applied for all frequencies, for all data after time 53850.5 MJD

my_tau = {time = 53850.5, value = 0.022}
set_cal, tau=my_tau

  • Set tau to a single value which will be applied for all frequencies, for all data from scan 100 forward

gettp, 100
my_time = !g.s[0].mjd
my_tau = {time=my_time, value = 0.085}
set_cal, tau=my_tau

  • Set tau as a function of frequency, for all data starting at the given time

my_time = 53850.5
freq_vector = [22000.0, 22100.0, 22200.0, 22300.0, 22400.0]
tau_vector =  [0.05,    0.06,    0.075,   0.063,   0.055  ]
my_tau = {time=my_time, freq=freq_vector, value=tau_vector}
set_cal, tau=my_tau

  • Set tau for all scans between 150 and 170. Tau is a function of frequency in this example.

gettp, 150
time_150 = !g.s[0].mjd

gettp, 170
time_170 = !g.s[0].mjd

default_tau = get_cal(170, /tau)

; the following frequency range should cover all observations
freq_vector = [22000.0, 22100.0, 22200.0, 22300.0, 22400.0]

tau_vector =  [0.05,    0.06,    0.075,   0.063,   0.055  ]
my_tau_150 = {time=time_150, freq=freq_vector, value=tau_vector}

my_tau_170 = default_tau
my_tau_170.time = time_170

set_cal, tau=my_tau_150
set_cal, tau=my_tau_170

Note that in this example, it is unclear what get_cal should return in tau.time. Is it the time at the start of the scan, or the time that defines the start period over which the returned tau values are applied? To avoid the ambiguity, the user should explicitly set the time in the my_tau_170 structure before applying the second set_cal.

  • Measure Tcal values from an observation of a calibrator, and apply to all spectral scans in the SDFITS file.

my_tcal = calc_tcal(10,ap_eff=0.65,tau=0.05)
set_cal, tcal=my_tcal

Note in this example, scalar values are used for tau and ap_eff.

  • Measure Tcal values from an observation of a calibrator, and apply to all spectral scans in the SDFITS file. Vector values for tau and ap_eff are used this time.

my_tau = get_cal(10,/tau)     ; get the tau structure for scan 10
my_tau.freq =   [1400.0, 1410.0, 1420.0, 1430.0, 1440.0]
my_tau.value =  [0.015,  0.017,  0.019,  0.021,  0.024 ]

my_ap_eff = get_cal(/ap_eff)  ; get the ap_eff structure
my_ap_eff.freq = [1400.0, 1440.0]
my_ap_eff.elv = [0.0, 30.0, 90.0]
my_ap_eff.value = [[0.61,0.60],[0.71,0.70],[0.73,0.73]]

my_tcal = calc_tcal(10,ap_eff=my_ap_eff,tau=my_tau)

set_cal, tcal=my_tcal

  • Tweak a few Tcal values from the default calibration database and apply the tweaked calibration values.

my_tcal = get_cal(/tcal)
my_tcal.value[0,0,10] = 4.55   ; feed 0, pol 0, freq 10
my_tcal.value[0,1,10] = 2.97   ; feed 0, pol 1, freq 10
set_cal, tcal=my_tcal

  • Erase all user-supplied calibration values and revert to the defaults.

set_cal, /default

  • Set a new gain curve.

Use two frequencies as boundaries for interpolation, and three elevations.

my_ap_eff = get_cal(/ap_eff)  ; get the ap_eff structure

my_ap_eff.freq = [22000.0, 23000.0]
my_ap_eff.elv = [0.0, 50.0, 90.0]
my_ap_eff.value = [[0.51,0.45],[0.62,0.58],[0.61,0.57]]

set_cal, ap_eff=my_ap_eff

  • Plot data from the calibration database using standard IDL plot tools.

; Retrieve tau and plot it
my_tau = get_cal(/tau)     ; this works only if the database has tau set once for all times
plot, my_tau.freq, my_tau.value, xstyle=1, xtitle='Freq (MHz)', ytitle='Tau (nepers)'

; Retrieve tau for a given scan and plot it
my_tau = get_cal(/tau, scan=50)
plot, my_tau.freq, my_tau.value, xstyle=1, xtitle='Freq (MHz)', ytitle='Tau (nepers)'

; Plot tcal for each of two feeds and two polarizations
my_tcal = get_cal(/tcal)
plot,  my_tcal.freq, my_tcal.value[0,0,*],xstyle=1, xtitle='Freq (MHz)', ytitle='Tcal (K)'
oplot, my_tcal.freq, my_tcal.value[0,1,*], color=!white
oplot, my_tcal.freq, my_tcal.value[1,0,*], color=!green
oplot, my_tcal.freq, my_tcal.value[1,1,*], color=!yellow

; Plot tcal over a range of frequencies for a given feed and polarization
my_tcal = get_cal(/tcal)
plot,  my_tcal.freq, my_tcal.value[0,0,*],xstyle=1, xtitle='Freq (MHz)', ytitle='Tcal (K)', $
       xrange=[22000.0, 23000.0]

; Plot aperture efficiency as a function of elevation for each frequency given in the calibration database

my_ap_eff = get_cal(/ap_eff)
n_freqs = n_elements(my_ap_eff.freq)
plot, my_ap_eff.elv, my_ap_eff.value[*,0]
for i=1,n_freqs-1 do $
    oplot, my_ap_eff.elv, my_ap_eff.value[*,i], color=!red+i

  • Retrieve hourly zenith opacity for a given day, and plot it.

opac = findgen(24)
for i=0,23 do $
    opac[i] = get_wx_tau(53510.0+float(i)/24.0, 22235.080)
plot, opac

Issues and Plans:

  • This document does not address the details of how vector calibration quantities will be implemented in the GBTIDL calibration routines.
  • Ron plans on adding a CLI to the cleo weather forecast application so that we can access it from GBTIDL.
  • We plan to add the capability to process tipping scans. Initially the capability will be re-implemented as part of GFM and eventually a GBTIDL procedure will be added.
  • For frequency-dependent calibration parameters Tcal, Tsys, ap_eff and tau, we need to decide whether the default frequency spacing will be a fixed or user-configurable value. If the latter, then the sdfits program will need a new parameter to allow setting the frequency spacing.

-- JimBraatz - 08 May 2007
Topic revision: r12 - 2007-11-06, JimBraatz
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding NRAO Public Wiki? Send feedback