Using idl to process AO spectral line data
May 2003 (this work is in progress...)
Idl basics: (top)
-
setting up,logging in
-
idlstartup, logging, attach arecibo code, exiting.
-
What idl can do:
-
entering cmds, editing cmd lines, input from files, batch, run.
-
constants, variables,arrays, structures, operators, procedures, functions.
-
programming in idl
-
control structures, for, while, if, do until, goto.
-
i/o: opening, closing files.
-
plotting, colors, imgdisplay, hardcopy
-
gotchas: commas, retall, assigning anonymous structures to each other,
passing, returning subarrays to procedures.
Generic cor routines.
(top)
-
I/O (inputting data). (top)
-
Display (spectra, total
power) (top)
-
plot spectra (single or and array): corplot
-
plot total power vs za: corplttpza
-
plot single spectra, flag recombination lines: corplotrl
-
plot every spectra in a file: cormon
-
plot spectra, rms, and images for an entire file: cormonall
-
strip chart recording of total power in a file: corstripch
-
plot every spectra usind pixwins for smoother plotting: corloopinit,corloop
-
image display routines: (top)
-
make and then display an image of a cor dataset: corimgdisp()
-
input and make an image of a position switch dataset: corimgonoff()
-
loop thru a file making images of all position switch datasets: pfcorimgonoff()
(cormonall probably does a better job)..
-
create an image for 1 sbc of a scan: corimg()
.. outdated use corimgdisp()
-
-
manipulating/computing
with cor data structures: (top)
-
doing math with cor records/scans (+,-,/,*, normalize, scalar ops): cormath()
-
accumulating cor recs/scans: coraccum()
-
averaging cor recs/scans/polarizations: coravg()
-
create a subset (by brd/sbc) of a cor dataset: corsubset()
-
hanning smooth data (in frequency) : corhan()
-
boxcar smooth data (in frequency): corsmo
-
median filter (by channel over time) a set of recs: cormedian()
-
compute rms (by channel over time): corrms()
-
compute the acf from the spectra: coracf()
-
scale spectra to kelvins using the cals: corsclcal()
-
compute mean,rms for cor dataset using a mask: corstat()
-
Informational routines: (top)
-
print summary info about a record: correcinfo()
-
see if two cor data sets have the same structure (so they can be in 1 array):
corchkstr()
-
get the freq/vel array for a cor record : corfrq()
-
see if a subband is flipped in frequency : corhflipped()
-
return topocentric freq of band center: corhcfrtop()
-
return rest freq of band center: corhcfrest()
-
return the polA,B cal values for a sbc: corhcalval()
-
check if a header is a calon or cal off: corhcalrec()
-
see if a sbc is taken in double nyquist mode:corhdnyquist()
-
return telescope gain value for a sbc: corhgainget()
-
see if sbc taken in stokes mode:
corhstokes()
-
check that header is a calonoff: chkcalonoff()
(use corhcalrec instead)
-
MISC (top)
-
create an array of corget structures: corallocstr()
-
store a correc into an array : corstostr.
-
interactively baseline a dataset: corbl()
-
automatically baseline a dataset: corblauto()
-
return the digital filter bandpass for correc: cordfbp()
-
compute distance from ra,dec to req position of rec: corcmpdist()
-
interactively create a freq mask for a rec: cormask()
-
compute recombination line frequencies: recombfreq()
-
search for recomblines in a freq range: recombsearch()
CALS: (top)
Processing
position switch data: (top)
-
process 1 onoff pair: corposonoff()
-
process 1 onoff pair with channel mask: corposonoffm()
.. needs to be updated.
-
process all onoff pairs in a file: pfposonoff()
-
take many pfposonoff() datasets and create arrays by src: corsavbysrc()
-
plot total power vs za. Shows repeatability of on,offs : corplttpza()
Processing
stokes data (non calibration runs) (top)
-
process scan taken in stokes mode (with no off source): corstokes()
Process ON scans
(no off) (top)
-
scale to kelvins, optionally flatten src only recs: corcalib()
-
run corcalib() on an entire file : pfcalib()
Using the data archive:
(top)
The data archive consists of tables containing header information
for each scan taken at the observatory as well as pointers to the location
of the header/spectral data on disc. This data is accessed via the idl
routines listed below. A user would call arch_gettbl() to input the table
(or a subset of it). corfindpat() can create subsets of the table. arch_getdata()
or arch_getonoff() can be used to read in the spectra. See arch_gettbl()
for a description of the table entries.
Using the calibration
archive: (top)
The calibration archive contains all of the calibration scan
(heiles calibration) done at the observatory. It is updated at the beginning
of each month. Each measurement is a structure containing the results
of the fitting for a single frequency. mmgetarchive() can be used to recall
the data. mmplotgtsb(),mmplotcsme, mmplotazza(), and mmplotpnterr()
can be used to generate various plots.
-
input a subset of the archive data into an array of structures: mmgetarchive()
-
plot the azimuth, zenith angles used in a set of measurements: mmplotazza()
-
plot the gain, Tsys, SEFD, and beamwidths: mmplotgtsb()
-
plot the coma, sidelobes, and beam efficiencies: mmplotcsme()
-
plot the pointing error: mmplotpnterr()
scanlist based
routines: (top)
-
find a set of patterns (onoffs, cals, x111,etc) in a scanlist: corfindpat()
home_~phil