6.2 Retrieving Individual Records

For most users, the data retrieval and calibration procedures discussed in the previous section will be sufficient. Others may need to access data in its raw, uncalibrated form. There are two commands for accessing uncalibrated data, get and getrec. The getrec command is also useful for retrieving calibrated data from a keep file (a file which contains data already calibrated in GBTIDL and stored using the keep command).

get: The get procedure can be used to retrieve individual data records from the input data file based on the scan number, feed, IF, integration, polarization, cal state, and sig/ref state of the data. If these parameters are not sufficient to uniquely identify a single row in the SDFITS file, only the first matching row is returned and a warning message is printed. The get procedure might be used as follows to calculate a system temperature from an uncalibrated data file:

get, scan=10, pol='LL', ifnum=1, fdnum=1, int=1, sig='T', cal='T'  
calon = getdata()
get, scan=10, pol='LL', ifnum=1, fdnum=1, int=1, sig='T', cal='F'  
caloff = getdata()                                          
tcal = !g.s[0].mean_tcal                                   
tsys = caloff/(calon-caloff)*tcal                           
print,'Mean Tsys = ',mean(tsys)

A complete list of parameters for the get procedure is given below:


Parameter Description
index index number as shown in bold
project project ID
file SDFITS file names (only relevant if the input data set is specified with dirin rather than filein)
timestamp scan timestamp as YYYY_MM_DD_HH:MM_SS
extension SDFITS extension number
row SDFITS row number
source source name
procedure procedure name
procseqn procedure sequence number
scan M&C scan number
polarization polarization, e.g. 'LL', 'RR', 'XX' or 'YY'
plnum polarization index, zero-based
ifnum IF (i.e. spectral window) index number, zero-based
feed feed name (e.g. B1)
fdnum feed index number, zero-based
int Integration number
numchn number of channels in the spectrum
sig 'T' or 'F' to identify SIG state
cal 'T' or 'F' to identify cal-on or cal-off
sampler backend sampler name
azimuth antenna azimuth
elevation antenna elevation
longitude longitude-like axis, e.g. RA
latitude latitude-like axis, e.g. DEC
lst LST
centfreq center frequency in Hz
restfreq rest frequency in Hz
velocity source velocity in km/s
freqres frequency resolution in Hz
freqint frequency interval (channel spacing) in Hz
dateobs date-time value
bandwidth bandwidth in Hz
exposure exposure time
tsys system temperature
nsave nsave index
trgtlat latitude coordinate of source
trgtlon longitude coordinate of source
obsid observation ID
subref subreflector state (subref_state); 0=moving, 1=first position, -1=second position

getrec: To retrieve an individual record, use the getrec procedure. This procedure takes one parameter, the record number. The record number is equivalent to the row number in the SDFITS file. Like all indices in IDL, the record number is a zero-based index. So, for example, the fifth record can be retrieved and displayed as follows:
getrec,4