next up previous


A Crash Course in SPECX...
for Service Observers

by Jane Greaves

SPECX is the spectral line reduction package used at the JCMT. This short document should enable you to reduce data during service observing, even if you havent used the package before. For more complex problems, the on-board help in SPECX (type `help') is very useful, or consult the Cookbook at http://www.jach.hawaii.edu/stardocs/sc8.htx/sc8.html.

Note to the timid... SPECX has a lot of flexibility, but takes a while to learn. If you get totally lost... or the package hangs... do a couple of cntrl-C's to exit, then `rm specx.dmp' to remove the corrupted parameters file. Then re-start SPECX. (That's why this is called the `Crash Course'!)

1. Startup, at the Telescope

First set up a pointer to the data, for project M99AU01 for example, and then start the SPECX package:

> setenv DATADIR /jcmtarchive/m99au01

> specx

and hit the space bar to pass over the introductory messages, until you get the >> prompt.

2. Looking at spectra

First read in a spectrum, e.g. observation 99. This uses the command read-gsd-spectrum but like all SPECX commands this can be abbreviated. I'll use the abbreviated forms from now on.

>> r-g-d 99

For dual-polarization receivers, such as RxB3, you need to average the two spectra resulting from this observation:

>> av

To look at the header information, use the command print-spectrum-header,

>> p-s-h

and note is if the spectrum is in several sections (in which case there will be several lines of information with frequency, system temperature, etc. information at the end of the header).

Now, to plot the spectrum in a useful form,

>> d-m <ret> <ret> <ret> (to merge several sections)
or
>> trun 100 (to truncate noisy end-channels from a single-section spectrum)
>> n (short for `new-plot')

To remove a linear baseline-offset, pick two regions with no visible lines, and enter the velocities of the low and high ends, for example:

>> r-l-b <ret> -100 -50 <ret> 50 100 <ret>

>> n

3. Storing and plotting

To store spectra for later use, you can use up to 5 `registers', with commands such as

>> store 5

>> recall 5

>> s-s-r (shows the contents of the storage registers).

To get a plot of the spectrum which is currently displayed:

>> see-plot h (for hardcopy)

>> $ lp -d jcmt specx_pgplot.ps (at the telescope, or -d hp at Hale Pohaku)

This also clears the on-screen plot, but you can bring it back with another `n'.

4. Measuring the lines and the noise

To check if lines have a predicted brightness

>> f-max

will find the maximum intensity (on the TA* scale, which is corrected for atmospheric opacity). The velocity of the line peak is also given -- if there are several lines, you can isolate a particular one by using the `trun' command to chop bits off the end of the spectrum.

Service projects often have a requirement such as `stop when the rms noise is 50 mK with 5 km s-1 resolution'. To see if this target has been met, regrid the spectrum to the desired resolution and then find the spectrum statistics over a non-line region:

>> reg 5 <ret> <ret> <ret>

>> f-s-s <ret> -100 -50 <ret> cntr-D <ret>

5. Averaging spectra

Usually a bunch of spectra have to be co-added to reach the required noise level. This is easiest to do with a loop -- for example, if observations 10 to 20 are to be averaged

>> cle-sta (clears the previous spectra from the memory stack -- important!)
>> do <ret>
m <ret>
(supply a variable name, such as m)
10 20 <ret>
>> r-g-d$\backslash$m <ret>
>> d-m $\backslash\backslash\backslash$ <ret>
>> av <ret>
>> cntr-D
where the backslashes separate input parameters (or take the defaults), and cntrl-D sets the loop running.

Header info will whizz past, and then you will have the co-added spectrum which you can store, plot, do noise measurements on, etc. If you want to add some extra spectra, after intervening observations such as pointing, you can do another loop:

>> reca 5 (to recall a previously stored average)

>> do <ret>
m <ret>
22 32 <ret>
>> r-g-d$\backslash$m <ret>
(etc.)

6. Reducing raster maps

The most common method of getting map data is rastering (`on-the-fly' mapping), which is more complex to reduce than single spectra. However, simple checks on whether lines are visible and if the map is big enough to cover the source are quite easy.

First you need to read in the raster data to temporary storage, e.g putting observation 99 in a new file called `temp', using the command `read-gsd-raster'.

>> op-file temp <ret> y <ret> <ret> <ret>

>> r-g-r 99 <ret> ... (hit return until the command starts to run)

You will now have a file open numbered `1'; if you want to close it, use `clos-file 1' and to list what other files you may have open, use `l-o'.

Next, do some basic reduction on the spectra and put them into a map file, using a loop. You need to set up the map space, e.g. $5\times5''$ cells, 999 total spectra... check with the TSS for more details of how the map was done.

>> s-f-a 1 r (set file-access to `read' for the stored data in file 1)

>> rea-sp 1 1
>> p-s-h
(read any spectrum from the file and note the number of channels, #pts)

>> open-map sourcename <ret> y <ret>... (enter map parameters at prompts)

>> do <ret>
m <ret>
1 999 <ret>
>> rea-sp$\backslash$1$\backslash$m <ret>
>> a-t-m <ret>
(add spectra to the map)
>> cntr-D
You can add more things to the loop, such as baselining (>> r-l-b$\backslash$-100 -50$\backslash$50 100) or truncating the spectra to make the map-file smaller (>> trun$\backslash$500). Then to look at the map, useful commands include:

>> int-map <ret> ... (interpolates for missing spectra, e.g. with unusual cell set-ups)
>> grid <ret> -50 50 <ret> -2 10 <ret>... (draws a grid of the spectra)
>> grey <ret> .... (draws a greyscale map)
>> s-p-d h (switches between h(ardcopy) and t(erminal) plotting)
>> g-s-f-m <ret> <ret> 0,0 (gets a spectrum from the map file for inspection).

Co-adding raster maps is a bit more difficult -- if doing repeat rasters of one area, it's easiest just to assume the noise will integrate down as $\sqrt{t}$, and use `f-s-s' on a spectrum from a single map. If you wish to try co-adding the data, you need the command `merge-files', which can combine any two rasters with spectra in common. These input files should result from `r-g-r' (and have read access), and a third file should be opened to put the co-added data in (with write access). The commands `l-o' and `s-f-a' are very useful for checking the files are set up correctly. After the file merge, use `a-t-m' as normal to put the spectra into a map.

About this document ...

This document was generated using the LaTeX2HTML translator Version 98.2 beta6 (August 14th, 1998)

Copyright © 1993, 1994, 1995, 1996, Nikos Drakos, Computer Based Learning Unit, University of Leeds.
Copyright © 1997, 1998, Ross Moore, Mathematics Department, Macquarie University, Sydney.

The command line arguments were:
latex2html -split 0 specx_crash.tex

The translation was initiated by Tim Jenness on 2000-01-24


next up previous
Tim Jenness
2000-01-24