/users/aharris/oct07that contains copies of the current versions of zpreduce.pro:
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.
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)
copy, 0, 11
show, 11, color=!white
copy, 0, 12
oshow, 12, color=!red
copy, 0, 13
oshow, 13, color=!green
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.