NRAO Home  >  Green Bank  |  Wiki Topic:    GB > Main > TWikiUsers > JimBraatz > GBTIDLCalibrationDesign
   Users | Groups | Offices | Changes | Index | Contents | Notify | Search | Jump to Topic:

Design of Flux Calibration Enhancements in GBTIDL

Jim Braatz


Overview

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

  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/getscalquad.pro.  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

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

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

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

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.

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.

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

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

set_cal, /default

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


; 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

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:

-- JimBraatz - 08 May 2007

Topic GBTIDLCalibrationDesign . { Edit | Attach | Ref-By | Printable | Diffs | r1.12 | > | r1.11 | > | r1.10 | More }
Revision r1.12 - 06 Nov 2007 - 19:15 GMT - JimBraatz
Parents: TWikiUsers > JimBraatz
Content copyright © 1999-2007 by the contributing authors.
All material on this collaboration platform is the property of the contributing authors.