/users/aharris/oct07that contains copies of the current versions of zpreduce.pro:
cd oct07
source ../wasp2/wasp_start
gbtidl
GBTIDL> .compile zpreduce
cd oct07If you want to fill only the data from the Zpectrometer backend, you can also include a "-backends=zpec" flag, but it may be useful to have filled versions of the DCR data (for pointing and focus) as well. The sdfits filler will continue to run automatically as long as you are taking data.
sdfits /home/gbtdata/PROJECTID
GBTIDL> zio = obj_new("io_sdfits_z")This command sequence only needs to be executed once at the start of a GBTIDL session; it is the equivalent of the "online" command for the other GBT backends. "rawdata" can be replaced by your choice of name for the output GBTIDL structure.
GBTIDL> spec = zio->get_online_files(acs,dcr,sp,zpec,status)
GBTIDL> zio->set_online, rawdata
cd oct07and wait for the filler to finish (see note above about filling from active data to pick backends, but the -backends=zpec selection seems to be necessary here). You may have to do a bit of hunting around to locate the particular tape (####) on which your project's data have been archived (note that they may also reside under /home/archive/test-data; Fall 2007 AGBT06C_33 data are on tape-025).
sdfits -backends=zpec /home/archive/science-data/tape-####/PROJECTID
GBTIDL> zpsdload, 'PROJECTID.raw.zpec.fits', rawdataand wait for the load to finish. "rawdata" can be replaced by your choice of name for the output GBTIDL structure.
GBTIDL> zpsdlist, 'PROJECTID.raw.zpec.fits'
GBTIDL> zplagplo, 'PROJECTID.raw.zpec.fits', NThis will direct the plot to the GBTIDL plotter, from which it is possible to save a copy to file gbtidl.print.file.ps and to print it (if you are in the control room at the GBT: the first time you do this in a given IDL session, use the "File" button so that printer output can be directed to "lp -Pops4050").
GBTIDL> zpmclist, rawdata, outfile='master.scans'Fields listed include M&C scan number, source, tracking beam, type of scan (TPWR or DOBS), and the first index number (of 4 or 8 total) corresponding to this M&C scan number. If outfile is specified, the listing will be directed to "master.scans" in your local directory. If outfile is not specified, the listing will by default be directed to the screen. Note: as of 2007.10.05, identification of scan type may not work correctly for subreflector-nodded data.
Suppose now that you want to select a set of M&C scans corresponding to observations of a particular source named "SMG" (exact name match) that were done in mode "T" (for TPWR; there is an analogous mode "D" for DOBS). You can create an array of scan numbers on disk by typing
GBTIDL> zpmclist, rawdata, outfile='smg-tp.scans', source='SMG', type='T'Note that for the current version of the software, the source name should not contain any spaces. If you want to add scan numbers to this list (e.g., because new data have just come in), you can type
GBTIDL> zpaddsca, 'smg-tp.scans', [86,88,90,96]where the final argument is an array of (integer) scan numbers. This file must exist first (perhaps by copying an existing list, adding one current number and then dropping the rest)! To drop scan numbers from this list (e.g., because some of the scans in the full set are known to be bad), you can type
GBTIDL> zpsubsca, 'smg-tp.scans', [3,15,120]where the last argument can again be adapted as necessary. The latter two commands will operate on any preexisting scan list.
GBTIDL> zpcwsinv, 0, '2006_11_17_23:14:31.fits'A choice of svdparam=0.02 is hard-coded into the zpcwsinv routine as of this writing. If you have correct scan lists for your source (say, "smg-tp.scans") and a calibrator (say, "3c84-tp.scans"), then you can derive a spectrum of your source normalized to the spectrum of the calibrator with these three statements:
GBTIDL> zpcwsinv, 1, '2006_11_17_23:14:31.fits'
GBTIDL> zpcwsinv, 2, '2006_11_17_23:14:31.fits'
GBTIDL> zpcwsinv, 3, '2006_11_17_23:14:31.fits'
GBTIDL> tpnods, rawdata, sigsfile='2006_11_17_23:14:31.fits', plotbe='0123', mcfile='smg-tp.scans', smg-on, all, totIf you wish to specify a list of input scans using an internal IDL array rather than the contents of an external file, then replace, e.g., "mcfile='smg-tp.scans'" with "mcscan=[10,12,14]". The "plotbe" parameter is an input string specifying which of the four Zpectrometer backends are to have their data reduced. The output variables "all" and "tot" contain an array of unaveraged difference spectra (one per number of scans in the input list) and the sum of the weights for the mean difference spectrum (to allow combination with other spectra), respectively. The final parameter taken by zpdivide is a threshold value: if the second spectrum falls below this in some channel, then the ratio spectrum will be set to 0 rather than something very large.
GBTIDL> tpnods, rawdata, sigsfile='2006_11_17_23:14:31.fits', plotbe='0123', mcfile='3c84-tp.scans', 3c84-on, all, tot
GBTIDL> zpdivide, smg-on, 3c84-on, smg-norm, 0.0012
The equivalent commands for reducing "DOBS" observations will be
GBTIDL> pro dinods, rawdata, sigsfile='2006_11_17_23:14:31.fits', plotbe='0123', plotsc='sc', mcfile='smg-di.scans', cal-on-di, smg-on-di, allspec, totwgt, totwgtcThe differences between this command and "tpnods" are that
GBTIDL> zpdivide, smg-on-di, 3c84-on, smg-norm, 0.0012
GBTIDL> zprebin4, smg-norm, temp, 3In the zprebin4 command, "3" is the factor by which to rebin, and the spectra for all four backends are rebinned in parallel; a single spectrum can be rebinned with the zprebin1 command. In the zpmakedc commands, "22" is the number of a M&C scan from which the header information (source name, velocity axis, etc.) can be copied in creating the new data container; the digit following the "sigsfile" argument indicates the backend whose velocity axis information should be copied over.
GBTIDL> zpmakedc, rawdata, 22, sigsfile='2006_11_17_23:14:31.fits', 0, temp[*,0], smg-dc0
GBTIDL> zpmakedc, rawdata, 22, sigsfile='2006_11_17_23:14:31.fits', 1, temp[*,1], smg-dc1
GBTIDL> zpmakedc, rawdata, 22, sigsfile='2006_11_17_23:14:31.fits', 2, temp[*,2], smg-dc2
GBTIDL> zpmakedc, rawdata, 22, sigsfile='2006_11_17_23:14:31.fits', 3, temp[*,3], smg-dc3
To store the spectra of all four backends to an ascii output file (some columns will be 0 unless "plotbe='0123'"), type
GBTIDL> zpprint4, smg-dc0, smg-dc1, smg-dc2, smg-dc3, outfile='smg-norm.data'while to direct output spectra to the GBTIDL plotter, type (for example)
set_data_container, smg-dc0
copy, 0, 11
show, 11, color=!white
set_data_container, smg-dc1
copy, 0, 12
oshow, 12, color=!red
set_data_container, smg-dc2
copy, 0, 13
oshow, 13, color=!green
set_data_container, smg-dc3
copy, 0, 14
oshow, 14, color=!blue
zpsdload,'T_08OCT2007.raw.zpec.fits',rawdataThe syntax of the tpsubr command is similar to that for tpnods, but the first argument is precisely the number of dumps per subreflector nod cycle. The last statements set the x axis units in the plotter to frequency and specify photogenic ranges for plotting in both coordinates; autoscaling of the two axes can be recovered with freex and freey, respectively.
tpsubr,14,rawdata,sigsfile='gbt_071005.fits.fits',plotbe='0123',mcscan=[19,20],jupavg,all,totwgt
tpsubr,14,rawdata,sigsfile='gbt_071005.fits.fits',plotbe='0123',mcscan=[32,33,34,35,36,37,38],w51avg,all2,totwgt2
zpdivide,w51avg,jupavg,w51norm,0.0001
zpmakedc,rawdata,32,sigsfile='gbt_071005.fits.fits',0,w51norm[*,0],dc0
zpmakedc,rawdata,32,sigsfile='gbt_071005.fits.fits',1,w51norm[*,1],dc1
zpmakedc,rawdata,32,sigsfile='gbt_071005.fits.fits',2,w51norm[*,2],dc2
zpmakedc,rawdata,32,sigsfile='gbt_071005.fits.fits',3,w51norm[*,3],dc3
clear
show,dc3,color=!blue
oshow,dc2,color=!green
oshow,dc1,color=!red
oshow,dc0,color=!white
freq
setx,25.3,38.5
sety,-0.1,0.5