Glen Langston, 2009 August 21

rt_idl Spectral Line Data Reduction at Green Bank

The Interactive Data Language is a scientific data environment for data analysis and display. Here we describe IDL procedures for calibration, averaging and display of GBT spectrometer data, that provides an introduction to the capabilities being developed in IDL.

This web page is intended for observers at the NRAO Green Bank site, running IDL in the Linux computing environment. The following steps will present GBT data taken towards Orion A at 43 to 46 GHz. It is expected that the observer will modify their data configuration files and write their own IDL procedures for special processing of their observations.

Supported computers

rt_idl was written before the advent of 64 bit CPUs, and only 32 bit CPUs can run the programs which extract observations directly from the GBT Archive. The computers known to run rt_idl successfully are
  • titania
  • ariel
  • planck
  • euler
  • Any other 32 bit cpu

Demonstration

A good package produces quick results. This demo shows how public domain GBT observations may be averaged and displayed in IDL (in a mater of seconds). Any discoveries you make with this data are yours!

Within the GB computing environment type the following:
Step TypeNote
1mkdir ~/idl Create directory for your IDL work, later many files will be created
2cd ~/idl Go to the new directory
3/opt/local/bin/rt_idl Start up the IDL development environment, windows will appear
The latest GBT Spectra will appear!
4demoOrion At the IDL prompt, type demoOrion, to start the demo
5-ENTER- Hit Enter at the IDL prompt to step though the data

Step Details

Steps 1, 2 and 3

The rt_idl procedures assume the observer wants a command line interface to the data. Usually, the observer will perform calibration steps on a small test observation, then the observer will write IDL procedures to perform repetitive calibration steps.

The IDL package written by Tom Bania provides the basic functionality of common packages (ie GET,# ; SHOW). This functionality is implemented in IDL procedures and the first steps define the location of the version of these procedures the observer will use. A unix script will search for the latests spectra in the default GBT output data directory.

Step 4

The demo data from an Orion observation is organized as four bands 800 MHz bandwidth, dual polarization spectra. The demo script demoOrion.pro averages the data, then calibrates using Tsys*(Sig-Ref)/Ref for each polarization. An IDL script demoOrionSum.pro performs the summation for a single 800 MHz band. The LCP(white) and RCP (red) polarizations are shown after median filtering the spectral band pass by 20 channels, to remove the continuum contribution and residual band pass ripples. The plot output looks like:

Step 5

The observer is prompted to hit -ENTER- to step through the 4 spectral bands. The development environment windows show messages concerning the data reduction, to allow the observer to assess the performance.

Notes on the rt_idl

The rt_idl environment expects three sub-directories:
  • data - Directory containing the observer pre-selected data
  • figs - Directory output postscript figures (from PRINTON and PRINTOFF)
  • saves - Directory containing saved versions of the IDL environment.
The demo generates 4 postscript plots, idl43300MHz.ps, idl44100MHz.ps, idl44900MHz.ps and idl45700MHz.ps.

Exploring Archive Data

The standard GBT reduction system is GB_IDL, which has essentially all the functionality of rt_idl except one important feature, the ability to directly examine all data in the GBT archive. This rt_idl capability is implemented via a C program that is called directly from IDL to import GBT archive data into the internal IDL format.

The observer should think of the GBT archive as a very large data base, and the observer sets keys which access the database. At the rt_idl command prompt the database keys can be listed: GB-RT\>keys

!gbtDirectory : "/home/gbtdata" !gbtProject : "TRFI_082109_L1" !gbtFile : "LATEST" !gbtISampler : 0 (Range 0 to 1) !gbtStates : " " (Range 0 to 1) !gbtBank : "A" (Range A to D) !gbtIntegrations: "" (Range 0 to 11) !gbtCalibrate : " " There observer sets the values of these keys, then can directly access the raw data via the command:

selectspec - which finds the data and imports the data into the internal format.

For a quick complete processing of position switched data, using the observer specified signal and reference scan numbers use the sigRefRef command.

rt_idl Command Summary

All of the existing IDL functionality is maintained in the rt_idl environment, and special functions are implemented to perform standard astronomical spectral line calibrations.

The GBT observations are organized in scans, and "sdfits" puts the scan data in FITS records The rt_idl environment works with data records (rec below) that are loaded into one of 10 special buffers. In addition, the special buffers may be copied to a storage area NSAVE for later use. The special 10 buffers have defined functions:

  • !b[0] -- working buffer: everything invokes what is in here
  • !b[1] -- BMODEL and GMODEL buffer
  • !b[2] -- copy of !b[0] during BASE and GAUSS
  • !b[3] -- ACCUM buffer
  • !b[4] -- AVE buffer: copy of last AVE
  • !b[5] -- ON buffer: copy of ON scan
  • !b[6] -- OFF buffer: copy of OFF scan
  • !b[7] -- PSW buffer: copy of (ON-OFF)/OFF
  • !b[8] -- SMOOTH buffer: copy before any smoothing operation.
  • !b[9] -- SHOW buffer: copy of latest SHOW
  • !b[10] -- SHOW buffer: copy of latest RESHOW; used by REFRESH
  • !b[11] -- SHOW buffer: copy of previous RESHOW
  • !b[12] -- SHOW buffer: copy of previous RESHOW
  • !b[13] -- SHOW buffer: copy of previous RESHOW
  • !b[14] -- SHOW buffer: copy of previous RESHOW
  • !b[15] -- SHOW buffer: copy of previous RESHOW
  • !b[16] -- SHOW buffer: copy of previous RESHOW

Each IDL procedure is contained in a file in directory /home/astro-util/idl/gb_macros. A list of commands is provided below:
CommandFunction
accumAdd buffer 0 to accumulation
addem,rec_arrayAdd array of records to Stack
add,recAdd record to Stack
aveCompute weighte averages of accumulation
avgstkAccumulate and average stack records
bbb,nfitFit Polynomial Baseline of order nfit
bb,nfitFit Polynomial Baseline of order nfit
bmarkMark baseline region on the plot
boxcar,nchBox car smooth by nch
bFit polynomial baseline, used previous nfit,regions
bsearch,nmaxBaseline fit up to order nmax
catList the contents of the stack
ccc,xpos,yposReturn xpos,ypos cursor positions
chanFlag plotting channels on X axis
clearsetInitials Select Variables to default
clrstkEmpty the record stack
comment,msgWrite 44 character messag to history
copy,bin,boutCopy buffer bin to buffer bout
curoffTurn off cursor input for scaling
curonTurn on cursor input for scaling
curxSet Plot X region using cursor (forces Cursor on)
curxySet Plot X-Y region using cursor (forces Cursor on)
curySet Plot Y region using cursor (forces Cursor on)
dcoffFlag NO subtract mean baseline for display
dconFlag automatic subtrack mean baseline
dcsubSubtract mean baseline from buffer 0
demoOrionSteps Observer through a demo of Orion A data
demoHe3Steps Observer through a demo of Helioum 3 data
display,arrayDisplay 2-d array
disp,n,mShow buffer n and overplot buffer m
div,n,mDivid buffer n by m, output to buffer 0
fetch,reconGet recon, compute recoff andsubtract
filesPrint files currently used by rt_idl
fixx,xmin,xmaxSet Plot X range with input values
fixxy,xmin,xmax,ymin,ymaxSet Plot X-Y ranges with input values
fixy,ymin,ymaxSet Plot Y range with input values
flagoffTurn Flag off for plot display option
flagonTurn Flag on for plot display option
flag,chSet channel for vertical line at x-ch
flg_id,ch,lab,clrDraw vertical flag at x=ch, label=lab, clr=color
freexFlag full X range on next SHOW
freexyFlag full X and Y ranges on next SHOW
freeyFlag full Y range on next SHOW
freqSet x axis labeling to frequency
gaussPrompt observer for gaussian fitting parameters
gbtrestoreRestore all rt_idl values from previous gbtsave
gbtsaveSave all rt_idl values from a session
gbt_winCreate plot window taylored to GBT Data reduction
gbt_xwinCreate IDL window for data reduction
getns,nsRestore save region ns
getoff,recCopy rec into buffers 0 and 6
geton,recCopy rec into buffers 0 and 5
get,recCopy rec into buffer 0
gg,ngaussFit ngauus Gaussians to the data
gTuned gaussian fitting program
hdr,recPrints data header for rec
hline,valDraw horizontal line at y=val
infoPrint information about data in buffer 0
keysDisplay the current GBT realtime data selection Keywords
killwinKill the rt_idl Plot window
list,start,stopPrint summary of records loaded int rt_idl
lookFetch data from records on stack, plot with DC offset subtracted
make_gbtCreate and Fill the gbt data structure with records
make_nsaveCreate NSAVE file for storing the GBT data structures
mask,dsig,indexDisplay regions
mediansub,halfWidthSubtrack median of halfWidth wide from buffer 0
minus,m,nSubtract buffer m from n and put in buffer 0
mkConvert Y axis scale from Kelvins to milli-Kelvins
moleculeShow all known molecular lines on current plot
mult,m,nMultiply buffer m by and put in buffer 0
nroffTurn off Flag for baseline fit marks
nronTurn on Flag for baseline fit marks
nrset,nSet n baseline regions with values nreg=[.,.]
nslogSummarize NSAVE data records
nsoffTurn NSAVE write protection off
nsonTurn NSAVE write protection on
ortho_fit,xx,yy,nfit,cfit,rmsOrthogonal polynomial fit
plthdrAnotate the plot with header values
plus,n,mAdd buffer n and m, put output in buffer 0
printoff,prtTurn off postscript command logging, send to printer prt
printon,fnameWrite postscript print commands to file fname
procsPrint list of all compiled procedures
psplot,fnamePrints postscript file fname to default printer
ps,sig_rec,ref_recPower Spectrum TSys*(Sig-Rec)/Rec
putns,nsSave spectrum in buffer 0 to NSAVE area ns
realTimeSetupInitiates real-time data display
rec_info,recPrints summary of GBT data rec
recombAllShow H, He and C recombination lines on current plot
recombCShow C recombination lines on current plot
recombHShow H recombination lines on current plot
recombHeShow Helium recombination lines on current plot
recombNShow Nitrogen recombination lines on current plot
recombOShow Oxygen recombination lines on current plot
refresh,nRe-plot previous n plots, useful with printon/off
reshowoverplots the contents of buffer 0 on plot
rms_maskCalculates the RMS of data in baseline REGIONS
rms,sigma,xmin,xmaxCalculates RMS sigma in between xmin,xmax
sampler,iSamplerGBT Scan sampler (polarization/frequency) band to RT select
scale,factScale buffer 0 by fact
scan,numberGBT Scan number in current project to select
sd_hdr,recPrint single dish record header for rec
sd_to_gbt,in,outConvert single dish record to gbt_data record
selectLoad record number stack with record numbers matching request
setPrompt for scan selection critera
setBandWidthSet maximum bandwidth for all Banks/Samplers
setlinePrompt observer for line ID for SELECT search
setplot,deviceSet plot device/file name
setrec,recmin,recmaxSet record range for a SELECT search
setscan,scanSet scan Number for SELECT search
setsource,srcSet soruce name for a SELECT search
setsrc,srcSet source name for a SELECT search
settypePrompt for scan type of a SELECT search
settyp,typSets scan type for SELECT search on data
setx,xmin,xmaxSet X min and max for plot
setxy,xmin,ymin,xmax,ymaxSet X, Y plot ranges
sety,ymin,ymaxSet Y min and max for plot
showShow buffer 0 contents; result of last calculation
showAllIntsShow all integrations for the current scan
showLatestShow latest spectra for most recent scan
smoothGaussian smooth by fixed width
smo,nSmooth buffer 0 with FWHM=n channels
srcvloffTurn off display of source velocity line
srcvlonFlag display of source velocity line
srcvl,chDraw vertical line at x=ch on plot
state,iStatesGBT Scan state numbers to select
syms,no,scale,iflCreate IDL symbol on the plot
tagidWrite 32 character line ID to buffer 0
tagpolWrite 4 character polarization ID to buffer 0
tagtypeWrite 32 character anotation string to buffer 0
tellstkPrint list of stack recond numbers
track,scansReduce Track observations of a scanlist
unmkConvert MilliKelvin Y scale to Kevlin scal
veloSet flag for X axis velocity plots
xrollSet X-range to inner 90 % of the data
zlineDraw line at Y=0 on the plot
zloffTurn off the zero line
zlonTurn on the zero line

Future Developments

This version of rt_idl has minimum capabilites for observers to test IDLs capabilites for data reduction. Future versions will impliment more calibration and editing functions.

One primary development direction for rt_idl is implimentation of a data browser, for selecting of data to be reduced in IDL. Keep tuned to this web page for new developments!

Modified on Friday, 21-Aug-2009 12:45:26 EDT