next up previous contents
Next: SPC header items Up: SPC (formerly S) A Previous: Using SPC   Contents

Commands

Commands in response to the command prompt are minimum-match. If nothing matches, or the command is ambiguous, the prompt is repeated. A list of commands currently implemented is given below, along with a brief functional description. These commands are also listed alphabetically with page reference, in the last part of this section.


		 		 INPUT 		 OUTPUT 		 ACTION 


Input/output
FITs
Load data file Reg list Loads data into SPC registers.
Write Reg list SDF file Write spectra to SDF file.

Utilities
CNvert Reg list same list Converts between $(\alpha,\delta)$ & (l,b).
Directory data file SPCDIR.LOG Directory listing of file contents.
EXit - SPC.LOG Exits SPC & prints log file.
GO COM file - Runs pre-defined sequence of commands.
Help help text - Writes VMS-style help to screen.
INformation Reg list log file Prints header & spectral information.
PRint Reg list SPC.LOG Prints & clears log file.

Editing
ALign Reg list same list Aligns spectra with a reference spectrum.
COpy Reg list any list Copies data from register to register.
CUll Reg list AVERAGE reg Removes bad spectra from an average.
EDit Reg list Reg list Edit or list data & header items.
FIXpol Reg list any list Used for dual-polarization data reduction.
SHift Reg list any list Shifts & blends data from register to register.
Vcor Reg list same list Corrects for various velocity errors.

Plots
MAp Reg list plot Draws contour plots.
PLot Reg list plot Plots spectra in various formats.
SPotmap POS file plot Spotmap of x,y positions & spectrum.
XYplot Reg list plot Plots any x vs any y where x & y may be
spectral points or header items.

Massaging
BAseline Reg list same list Removes a polynomial (up to 5th order) &
a 5.8MHz sine wave (if requested).
BIrdy Reg list same list Removes central-channel birdies automatically.
CAlibrate Reg list same list Corrects for atmosphere, focus & efficiency.
RVel Reg list same list Change frequency & velocity reference frame.
SCale Reg list same list Rescales spectra by quadrant.
SMooth Reg list same list Hanning or Boxcar smoothing of spectra.
Zero Reg list same list Zeros channels at band edges.

Analysis
GAuss Reg list same list Adds Gaussian features to spectra.
GFit Reg list output list Fits Gaussian components to spectral features.
Kinematics Reg list log,spectra Generates velocity moments.
Nh3fit Reg list output list Fits ammonia spectra (up to 3 J levels).
POsition Reg list POS file Finds positions & writes file for SPOTMAP.
SOlve Reg list 6 reg's Solves for linear polarization: I, Q & U.
STatistics Reg list log Calculates statistics over channel range.

Mathematics
ADd Reg list same list I = I + (A + B R).
AVerage Reg list Reference reg Averages a list of spectra.
GEnerate
MUltiply Reg list same list I = Ie1 (A R)e2.
Quotient Reg list same list Forms quotient from signal & reference.
XFm Reg list output list Fourier transform (complex).

A more complete description of the commands available in SPC follows. The command dialogue and a brief explanation of each question is given in a box following the description. Questions listed in the top part of the box are omitted in the brief version of the command. If there is no break in the dialogue box, the short version does not omit any questions.

ADD
Adds a constant, plus a scaled version of the reference register to a list of registers. There is no channel or quadrant selection in this routine.

The algorithm is: I = I + (A + B R) where I is the input list, A and B are real constants, and R is a reference register. The channel values in the input list are overwritten, and header values are not changed. A constant offset (A) may be added to the register list by entering zero for B or R.

   Enter A, B, Reference  adds A + B*Reference register to list
   Enter ADD list         registers to add the above to

ALIGN
Used to shift spectra by a non-integral number of channels (SHIFT does integral channel shifts only), or to automatically align spectra observed with different central velocities but the same correlator setup. This is useful if identical channel registration is required, e.g. in order to properly AVERAGE spectra observed with different velocities (also for SOLVE, ADD, MULTIPLY).

If a reference spectrum is given, all spectra in the list are aligned to it, and the headers are updated to reflect any changes in the velocity axes. After alignment the spectra should have identical velocity axes. If 0 (zero) is entered for the reference register, manual inputs are accepted for each quadrant. In this case the headers are not changed. Fractional channel shifts are implemented by linear interpolation.

It is not necessary to ALIGN in order to plot spectra on a common velocity axis - in PLOT answer yes to ``plot versus velocity?'' and ``register plots on same velocity axis?''

   REF register (0 for manual inputs):   give a valid register for auto
                                         alignment
      Channel shift for each quadrant: manual inputs (only if REF=0)
   ALIGN list:                           enter list of registers to align

AVERAGE
Averages a list of registers, weighted to give the best signal-to-noise ratio. Registers are weighted by Integ/ Tsys2.

There is also an option for weighting by the amplitude of a particular spectral feature, but editing is required to switch it on. Header values are also averaged: this may result in a non-integer value for the Sequence Number. Spectra made by AVERAGE are tagged type a.

      Enter register to hold average:  the average goes into this register
      Enter list to average:  averages this list of registers

BASELINE
Removes a polynomial (0th to 5th order) and a 5.8MHz sine wave (if requested) from a list of registers. The 5.8MHz sine wave is caused by standing waves between the dish and the feed.

You must provide a set of channel ranges which avoids any real signal in the spectrum (use PLOT). The algorithm uses a least-squares fit to a polynomial over the selected channel ranges. You may specify channel ranges for all observed quadrants simultaneously. The baseline curves are calculated and removed independently for each quadrant; if you do not include a channel range within a particular quadrant, nothing will be done to it.

A non-advertised option is available for reducing J = 1 and J = 2 transitions of ammonia observed in two 10MHz, 512-channel bands. The peak channel in the J = 1 quadrant (use STATISTICS or KINEMATICS) is used to automatically set channel ranges in both quadrants to avoid the hyperfine structure. In order to add this option to the dialogue, you must edit three lines in the module base.f, then rebuild SPC.

   Enter Baseline channel pairs:  give channel ranges to fit baseline to
   Enter polynomial order and sine (3, no):  0 to 5 and yes, for sine wave
   Enter BASE list:  enter registers to baseline.

BIRDY
Removes central channel birdies caused by LO breakthrough. The Parkes local oscillator signal generally breaks through the mixer and gets into the IF signal. A ``birdie'' may therefore appear in the quotient spectrum of each quadrant if there is a difference between the signal and reference spectrum.

The algorithm removes central channel birdies automatically by replacing the value of the centre channel in each quadrant with the average of the neighbouring channels. It does this for all quadrants observed; there is no quadrant selection provided.

   Enter BIRDY register list:  give the list to de-Birdy.

CALIBRATE
Makes several amplitude corrections appropriate to Parkes data (mainly at 22GHz) and stores the gain applied in the header (register location 5015). This correction can be removed (``undo'' option) in CALIBRATE. The corrections are: (1) atmospheric extinction; (2) antenna beam efficiency; (3) focus error; and (4) constant scale factor. Beam efficiency and focus correction curves are available only for K-band; most other frequencies do not need them anyway.

CALIBRATE contains curves giving the 22GHz dish efficiency and the optimum focus position as a function of zenith angle, along with the fractional signal loss as a function of focus error. If efficiency and focus corrections are requested, the zenith angle (5004) and focus position (register location 5046) are used to calculate the gain correction required. If atmospheric correction is requested, you will need to enter the zenith opacity.

CALIBRATE has a facility for determining the atmospheric attenuation by using the measured Tsys values as a function of zenith angle. To use it, load in a sequence of observations which cover a large range in zenith angle, and which do not contain sources strong enough to affect Tsys appreciably. The Tsys values are least-squares fit to the function: $T_\mathrm{sys} = T_\mathrm{rcv} +
T_\mathrm{sky}/\cos(Z)$ for the parameters Trcv (receiver temperature) and Tsky (radiation temperature of the atmosphere). Note that Tsys is measured in the units appropriate to the noise calibration source (use INFORMATION to check what Tcal is). The physical temperature of the atmosphere is $\sim 274$K; if your cal temperature is in Jy, then multiply 274 by the appropriate Jy/K and enter this number for the ``temperature'' (Jy) of the atmosphere. The optical depth at the zenith is calculated from: $\tau = -\log(1 - T_\mathrm{sky}/274)$, and the correction is: $exp[\tau/\cos(Z)]$.

The quality of the sky-dip measurements and the fit can be checked using XYPLOT and one of the curve overlay options. Write down the Trcv and Tsky values for each quadrant from the SKY results, and run XYPLOT to plot Tsys for all quadrants versus zenith angle. Overlay curve 3 and enter Trcv, Tsky in response to the prompt. Then enter 5004 5022 for the x,y axis list to plot Tsys of quadrant 1 versus zenith angle. Several quadrants may be plotted simultaneously if desired.

   Undo previous gain corrections (no)?  yes, to undo all earlier
                                         calibration
      Enter CAL list:    give the register list to UNDO.
   Solve for atmospheric attenuation (no)?  yes,
                                   to solve for atmospheric opacity
      Enter atmosphere temp. (K or Jy):  atmos. temp. in $T\sub{cal}$ units
      Enter SKY list:    register list for opacity msmt.
   Correct for: Atmosphere, Efficiency., Focus?  y y y,
                                   to do all corrections
      Enter atmospheric opacity:  enter Tau (default = SKY result)
   Enter constant scale factor:  scale all quadrants by this factor
   Enter CAL list:  list of registers to calibrate.

CNVERT
Converts between equatorial and galactic coordinates and vice versa. The conversion algorithm is only good to a few arcseconds.

   Register list:    enter list to convert.

COPY
Copies data from register to register. Names and headers alone may also be copied (useful for supplying headers to synthesized spectra made with GAUSS, SHIFT, ADD, etc.). You can copy channel ranges from one register to another, or within a single register. Only integral channel shifts are allowed (use ALIGN for fractional channel shifts).

COPY differs from SHIFT in that data in the destination channel range is overwritten, whereas the data are blended with SHIFT. COPY also writes headers to the destination registers, while SHIFT does not. Multiple ranges can be specified in the channel lists, but the ``from'' and ``to'' ranges must be the same length.

A typical use of COPY is to copy data to different places in the register stack. It can also be used to re-arrange the order of quadrants (e.g. channels 513-1024 go to channels 1-512), or to invert the channel direction (e.g. 1-1024 goes to channels 1024-1).

NOTE: Any header information present in a destination register is overwritten by the header from the origin register. Channel/velocity axis re-arrangements due to COPY are not accounted for in the headers.

   Copy NAMES and HEADERS only?  if yes, only headers are copied
   A channel list:  channel ranges to copy FROM
   B channel list:  channel ranges to copy  TO

   A register list: register list to copy FROM
   B register list: register list to copy  TO

CULL
Removes bad spectra from an average. CULL provides for easy removal of bad Check Point Blocks (CPBs) from an average spectrum, allowing the removal of only affected quadrants. It has the advantage over AVERAGE of requiring only the averaged and the bad spectrum to be present, and of being able to clean up individual quadrants. CULL adjusts the header integration times to account for the removal of data.

In order to remove corrupt CPBs, load the average spectrum into register 111, and load the individual CPBs elsewhere. Use PLOT, INFORMATION or STATISTICS to determine the corrupt CPB register numbers and quadrants. Then use CULL to remove the bad spectra, listing them by register/quadrant pairs.

CULL can be used to remove bad spectra from any average, for example one made by the AVERAGE command. Simply load the average and the corrupt spectra into registers, and use CULL in the same was as above. This is sometimes useful for averaging data which has some corrupt quadrants.

   Enter register to clean up:  register number containing the average
   Enter CPB, QUAD pairs:  register/quad\# pairs with corrupt data.

DIRECTORY
Lists the contents of SPC, SDF and RPFfiles. For SPC files only quotients are listed; if all zeros are printed there is probably no quotient spectrum for that sequence number. The directory listing is printed out if requested; it is also saved in the log file.

You can save a directory listing on disk by typing ^Y in response to the question ``Print directory?'', but this causes you to exit SPC. The disk file is called SPCDIR.LOG.

The file name used for DIRECTORY becomes the default for LOAD and vice versa.

   Data file name (.SPC)         enter file name (.SPC understood)
      starting sequence number:  start listing at: (SPC files only)
   Another file?                 yes, for more listings (default = last)
   Print directory?              yes, if hardcopy wanted (default = no).

EDIT
Provides for listing or editing of source and file names, header items and spectral data. EDIT also lists the locations of all header items if requested.

Edited data is either replaced by a new value, or the value is added to the current value. Header items are specified by their location in the channel list; they are treated like spectral data but have locations in the range 8197-8260.

As many items as desired may be listed or edited. When editing, a new value must be entered for each item. The old and the new value is displayed for each item edited.

   Change source NAMES?          yes, to change source or oldfile names
   Enter EDIT list:              list of registers to edit
   Enter new names:              give new source and file names
   Would you like a listing of header items?  yes, to list of the header
                                 locations
   List or Edit data?  type L or E for Listing or Editing
   Enter channels to list or edit:  give the channels or header locations
   Add (a) or Replace (r)  ``a'' to \emph{add} new values,
                           ``r'' to \emph{replace}
   Enter new values:  same number of values as channel list
   Enter EDIT list:  give the list of registers to edit

EXIT
Exits SPC and prints the log file if desired, otherwise deletes it. If you want to save the log file on disk, exit by ^Y. The disk file is called SPC.LOG.

   Print log?    yes, if printout of log file is wanted.

FIXPOL
Simplifies reduction of polarization data taken with two orthogonal linear polarizations simultaneously. By default, FIXPOL copies the second quadrant (channels 513-1024) of the input (A) register into the first quadrant (channels 1-512) of a new output (B) register and adds -90 degrees to the feed angle. This puts the data into the correct format for linear polarization analysis with SOLVE, which requires a contiguous stack of spectra with differing feed angles.

The channel range to copy and the feed angle offset may be specified manually. Note that the input list (A) remains unchanged unless a non-zero offset is added to the A-list feed angle.

   Channel range list:  channel range to shift from A
   Enter first channel to shift into:  first channel of range in B
   Enter feed angle shifts:  feed offsets for A and B lists

   Enter list A:    Input list to copy FROM
   Enter list B:    Output list to copy  TO.

GAUSS
Adds a Gaussian component to a register. The component is specified by centre channel, FWHM (in channels), and amplitude. It is useful for creating artificial spectra for testing or other purposes. GAUSS does not write any header information; use COPY (headers only) if header information is needed.

   Enter Gauss list:  register list to store Gaussians
   Enter centre, FWHM, amplitude:  specify Gaussian to add

   (GA. has no inputs: it just adds another identical Gaussian to the
   register list)

GFIT
Fits up to 7 Gaussian components simultaneously in each quadrant. If requested, GFIT will store the fitted Gaussian models in specified registers (overwriting anything already there), and write the fit parameters (ampl, vel, FWHM) and their formal errors in the data range for each quadrant (useful for contouring in MAP).

The parameters (and errors, if kept) are written in the following sequence, beginning in the first channel of the associated quadrant: Amplitude, velocity, FWHM, Amplitude error, Velocity error, FWHM error (for component #1), ditto (#2), etc. If the errors are not kept, only 3 entries per component are written. These parameters are written to the original data registers, and also to the model fit registers if saved. Model fit registers are given type designation MG for Model Gaussian (PLOT, STATISTICS).

A fit to the peak spectral feature in each quadrant can be automatically obtained by entering zero for ``Guesses''. Otherwise, up to 7 fits in each quadrant can be obtained by specifying guesses for the centre channel and halfwidth of each spectral component. Note that if fit parameters are written to the data, automatic fitting to the largest feature might try to fit data in this range. Use ZERO to keep this from happening.

   Save the fitted Gaussians? yes, to store fitted Gaussians in Regs
      Enter Model output list:    register list to hold Gaussians
   Save the fit parameters and errors?  y y, to save fit and errors in
                                        the spectra
   Enter GFIT list:  register list to fit
   Guesses (centre, width) for components:  up to 7 pairs per
                                               quadrant (0 = auto)

GO
This routine guides the user through a pre-defined sequence of SPC commands stored in a disk file. GO is useful when doing interactive data reduction involving many essential steps. It differs from a VMS .COM file in that the SPC commands are automatically invoked, but the response to each command remains interactive.

Before using GO you should set up all defaults using the long version of each command, and use short versions in the GO file. The list of commands should be written in the file exactly as they would be typed in response to the command prompt, with one command per line. A GO file which loads, baselines, zeros, birdies, smooths, calibrates and writes would be:

   l.
   ba.
   z.
   bi.
   sm.
   ca.
   wr

To escape from a GO sequence before completion use ^C. You may have to respond to a final question or two before you are returned to the command prompt.

   Enter GO filename:  Name of GO file (.COM understood)
   (questions appropriate to command sequence follow)

INFORMATION
Provides a summary of the data contained in individual SPC registers, including frequency, obs. date, position, correlator setup, peak intensity per quadrant, etc. Information is displayed for each register in the input list sequentially, type a <CR> to go to the next one.

Type ^Y to cancel an INFORMATION list before completion.

   Register list:    List of registers for INFO

KINEMATICS
Calculates velocity moments over a given channel range. You must give a channel range, and an amplitude cutoff for determining the minimum and maximum ``signal'' velocity. The calculated parameters are written into channels 1-10 if requested. There is no quadrant distinction in this routine. The 10 parameters are:

where Ai = amplitude of channel i; $\Sigma$ denotes the sum over channel range for Ai > cutoff; Vi = velocity of channel i; dV = velocity increment.

   Enter channel range:  calculations restricted to this range
   Enter amplitude cutoff:  minimum amplitude for real signal
   Save results?    yes, to write results into channels 1-10

   Enter KINEMATICS register list:
                          list of registers for moment calculation

LOAD
Loads data from SPECTRA, Single-dish FITS RPFITS or old .SAV files into SPC-registers. SPC files made with SPECTRA may be accessed during the observations; LOAD opens SPC files for read only. The following file suffixes are recognized (case-insensitive):

.SPC
...SPECTRA output format
.SDF*
...SDFITS binary table
.RPF*, .HPF or .MBF
...RPFITS
.SEST
...SEST FITS
.SAV or .DAT
...SPC dump format

The .HPF and .MBF suffixes are recognized specifically for Parkes multibeam RPFITS to save having to rename the files produced by MULTI.

A listing of the contents of a data file can be obtained with the command DIRECTORY. Reduced spectra are saved with WRITE.

Signal, Reference and Quotient, and ``Check Point Blocks'' (CPBs) apply only to SPC files; other files do not have this data structure. If you have forgotten how many CPBs are present, you can load two (loading only one gives the average spectrum) and compare their integration times with the integration time of the average. Each CPB requires a register - the total required is the number in the sequence list times the number of CPBs. Unless you want to load individual CPBs, or you require signal or reference spectra, you should use the short version of LOAD (L.).

If your data was taken during a period when a recognized velocity error was present in SPECTRA, a warning is given to use the command VCOR. This warning persists for old SAV files even if VCOR has already been applied, and in those cases it should be ignored.

   Enter Signal, Reference or Quotient:  S, R, or Q can be loaded, if
                                         available
   Read individual Check Point Blocks?   yes, if individual CPB's are
                                         desired
      Number of CPB's:                   Enter \# of CPB's in average
   Data file name (.SPC)                 file name (SPC extension assumed)

   SEQUENCE list:                        list of sequence \#s to load
   REGISTER list:                        list of registers to load data
                                         into.

MAP
Draws a contour plot of spectral data taken on a grid of sky positions. The observed positions need not be on a uniform grid; MAP interpolates the data onto a grid before contouring. You must provide a grid spacing and the FWHM beamwidth for interpolating onto the grid. A reasonable grid spacing is about FWHM/2, but this can be varied to suit the data. The maximum and minimum amplitude of the raw data is printed, along with the range in x and y. The amplitude range after gridding is also given (with the prompt for contour level type). A comparison of these values gives an indication of the smoothing caused by gridding.

There are four choices for entering contour levels: default gives 10 contour levels evenly spaced over the maximum and minimum amplitude range; absolute plots absolute levels entered manually (minimum and maximum values are listed with the prompt); relative plots levels relative to the maximum (e.g. 0.2 0.4 0.6 0.8 0.95); range plots levels defined by a minimum, maximum and interval (e.g. 0 1.5 0.3).

A single channel or the average over a range of channels may be plotted. Contour plots of Gaussian fit components (amp, width, vel, errors) may be obtained by first running GFIT and storing the results in the spectrum. NH3FIT and KINEMATICS results may also be mapped.

   Enter grid spacing (arcmin):  grid spacing for interpolation
   Plot data, grid points?  y  y,  to see data and grid locations
   Enter register list to contour:  enter list of registers to map
   Channel range:    maps the average over channel range
   Enter FWHM (arcmin):  beamwidth for interpolation
   Enter contour type (d,a,re,ra):  choose type for contour levels
   Graphics device/type (? to see list, default /xdisp):
                                     choose plot device for map
   Replot contours (no)?  yes, to replot gridded data.

MULTIPLY
Multiplies a register by a constant times a reference register. MULTIPLY also provides for division, square roots and other exponents in both the input and reference registers.

The algorithm is I = Ie1 (A R)e2 where I is the input register list, e1 and e2 are exponents on the input and reference registers, and A is a constant. In order to multiply the input registers by a constant (A), enter zero for the reference register and ones for e1 and e2. There is no channel or quadrant selection, the input spectra are overwritten with the new values, and headers are left unchanged.

   Enter e1, A, REF, e2  I = I**e1 *(A*REF)**e2      (I = channel ampl.)

   Enter list to multiply:  Register list to multiply by the above

NH3FIT
Fits (J = 1, 2 and 3) lines of ammonia for peak intensity, velocity, halfwidth and optical depth. The best-fit model spectra may be written to output registers, and the fit results may be stored in the associated data arrays for mapping or storage. NH3FIT will also generate model NH3 lines, using headers taken from the observed spectra.

To generate model spectra (yes to ``make a model profile?''), enter a list of registers for header information, and a list of registers to hold the model spectra. You will be prompted for the model parameters.

NH3FIT assumes that each input register contains up to three J-levels of the ammonia lines in ascending order (ie. J = 1 line of 1024 channels; two 512-channel spectra containing J = 1 and J = 2 lines; or three spectra consisting J = 1, 2 and 3 of 512, 256 and 256 channels respectively.

NH3FIT will automatically fit all quadrants individually, using the peak channel in each quadrant as its starting point. The data should be baselined and zeroed before fitting, although provision is made for avoiding endpoints, and for subtracting a linear baseline.

The routine does an initial fit assuming zero optical depth (low-tau), then fits for the optical depth. Initial guesses for amplitude and velocity may be automatically generated (based on the peak signal), or entered manually (yes to ``inject your own guesses''). Guesses are solicited at each fitting stage.

The best-fit model NH3 lines are written to an output register if a non-zero output list is given, using the input data for headers. The low-tau model may also be saved (yes to ``save the low-tau profiles''). To plot, use the ``A'' option in PLOT, and list a data and a fit register to plot. If results were saved, these are printed below the plot.

When the option to save fit parameters is used, the results are written to the data and model spectrum (if saved), overwriting data in the first eight channels of each quadrant. Be sure to zero these channels for subsequent automatic fits if this option is turned on. The following results are stored in the first eight channels of each quadrant:

   Make a model profile?  yes, to synthesize NH3 lines
   Save fit parameters in spectra?  yes, to write fit results to data area
   Save the low-tau profiles?  yes, to save the low-tau models
     Enter low-tau output list:    registers for low-tau models
   Inject your own initial guesses?  yes, to provide manual guesses
     Enter new estimates:    ampl, vel, fwhm (0 = automatic)
   Endpoints to skip, baseline channels:  N,B;  skips N end
             channels each quad. uses adjacent B chans for b.line

   Enter NH3 input list:  register list to fit
   Enter fit output list (0 for no save):  registers for model spectra (if
                                           saved)

PLOT
Plots spectra over a given channel range in various ways. Spectra may be plotted versus channel number or versus velocity, and may be either overlaid (several plots on the same xy-axis) or stacked. Overlaying an empty register is a convenient way of plotting a zero line.

If the velocity axis is chosen, all spectra in the plot list may be aligned in velocity by answering yes to ``Register plots on same velocity axis?''. Supply a minimum and maximum velocity to set the scale (or 0,0 to default to the full range of the first plot in the list). If you answer no to the registration option, the velocity axis of the first plot is assumed for all other plots in the list, and you are not prompted for a minimum and maximum velocity.

Data contained in two or more quadrants having the same velocity axis will appear overlaid if plotted versus velocity over all channels. To avoid traceback problems in crossing quadrant boundaries, be sure to zero the endpoints (ZERO). The traceback then results in a line through zero (sometimes desirable).

For autoscaled plots the selected channel range is used to determine the minimum and maximum amplitudes for scaling. In velocity plots with registration, reducing the the velocity range does not affect autoscaling.

Use plot type ``Normal'' for most plots. ``Ammonia'' plots assume that up to 3 J-levels of the ammonia line are contained in one register, and model-fit spectra in another (see NH3FIT). ``Database'' format provides for two overlaid spectra with the second one manually scaled (gives a blowup of the autoscaled plot to improve dynamic range).

The D format can be useful for switching easily between velocity and channel plots, and between auto and manual scaling. If only one register is plotted, D always gives an autoscaled velocity plot; switching to N will revert to your default selection.

To exit a plot before it is finished type ^Y. The current part of the plot will finish before returning to the command prompt.

   Plot versus velocity?  yes for x-axis in velocity; else channels
     Register on same velocity axis?  yes, to align all in velocity
       Enter min,max velocity:      0,0 means plot full range.
   Overlay or stack plots? o to overlay plots; s to plot in a stack
   Automatic scaling?  no, to enter your own min, max
     Enter Ymin, Ymax:    enter min, max for Y-axis
   Plot Vertical line?(n):  plot a vertical line on the x-axis
   Interactive marking of xcoord?(n):  mark with mouse,
                                       or cursor and key
   Enter plot type (n,a,d):  ``n'' should generally be used
   Enter Plot channel range:  channel range for plotting and autoscale
   Graphics device/type (? to see list, default /xdisp):
                              output device (/null to exit)
   Enter plot list:    give the register list to plot

POSITION
Finds the sky positions of spectral features from data observed at three or more telescope pointings. A single position may be determined (no, to ``Fit EACH channel in list?''), in which case the average intensity over a channel range is used for the fit, or each channel in a range may be fit individually and the results stored in a file for plotting with SPOTMAP.

The algorithm uses a least-squares fit to a two-dimensional Gaussian model of the beam; the assumption is that each feature is a point source. A minimum of three different sky positions is required to determine the amplitude, and the x and y positions, of the spectral features.

When a single position is requested, the amplitude and centre position of the best-fit Gaussian is printed, along with the sigma value for the beamsize in x and y. These parameters may be used to compare the fit to the data using XYPLOT (plot channel intensity versus RA or DEC) and overlaying curve 2. This works best for data taken on RA and DEC lines, and fit to a single channel.

When fitting to each channel in a range, an amplitude cutoff is required to avoid positioning noisy data; the uncertainty in the derived sky position is mainly a function of the signal to noise ratio. A rough rule of thumb on the positional accuracy is: the rms error is about the FWHM beamsize divided by the signal/noise ratio (e.g. $\sim 1$% FWHM for S/N = 100). The uncertainty also depends on how well the observations cover the source position. Although POSITION will attempt to find a position even if the observations are nowhere near the source, the results will not be very accurate. Four or five measurements at $\sim 1/2$ beam separation surrounding the source gives the best result.

A comparison between the observed locations and the sky position can be made quickly by plotting the input data registers versus RA and DEC in XYPLOT, and overlaying the fit sky position (curve 4).

   Fit EACH channel in list?  yes, to make a SPOTMAP file
      Amplitude cutoff    don't fit data below cutoff
      List of channels to fit:    fit all channels in list
      File name for positions:    File for spotmap (.POS)
   Channel range to average:  single position for this channel range
   Enter POS register list:  list of registers to use in fit
   Enter FWHM beamwidth:  enter beamwidth in arcmin

PRINT
Prints out and/or clears the log file any time.

   Do you want to start log afresh?  Yes, to clear the log (if your answer
                                     is ``no'', the log file is spooled to
                                     the printer)

QUOTIENT
Forms quotients from signal and reference spectra. In the general case one reference is used for a list of signal spectra. Provision is also made for forming quotients from a list of signals and a list of references of the same length.

Two algorithms are provided:

where Tsig and Tref are the system temperatures measured for the signal and reference spectra, and Q, S and R are quotient, signal and reference spectra.

The first method subtracts the continuum component from the spectra.

The second method, where Tref is subtracted, preserves the continuum. It was used by SPECTRA (loaded as type Q).

The dialogue requests a list of quotients; this is actually the list of signal spectra, which are then overwritten by the quotients. The headers are unchanged except for the spectrum type, which becomes q.

   Enter QUOTIENT list:  actually SIGNAL list; it becomes QUOTs
   Enter REFERENCE (single, or list):  REF register, or list same size as
                                       above.
   Method to use:
     T(ref)*S/R - T(sig)   ...removes continuum
     T(ref)*S/R - T(ref)   ...preserves continuum
   Remove continuum (y/n) [y]? n

RVEL
Switches between topocentric, geocentric, barycentric, LSR (kinematic) and LSR (dynamic) reference frames (the LSR-K frame being the one commonly used). The reference frame and the Doppler shift computed and used by SPC to rescale the frequency axis is recorded for each register and is reported by the INFO command. The velocity scales are computed using the radio convention, $v_\mathrm{radio} = c (1 - \nu / \nu_0)$, where $\nu_0$ is the rest frequency of the spectral line of interest.

   Enter reference frame, TOPO, GEO, BARY, LSRK, or LSRD [LSRK]: 
                                     Enter the required frame.
   Enter RVEL list:  list of registers to frequency shift.

The reference frame and Doppler shift are recorded in output SDF files and recovered again when they are read.

SCALE
Applies a scaling factor to each quadrant separately. This differs from the constant factor applied in CALIBRATE in that different factors can be applied to different quadrants, and the factors applied are not stored in the header. It is useful to adjust for errors in the Tcal used, and to apply general amplitude corrections.

   Enter scale factors for each quadrant:
                                 give one number for each quadrant.
   Enter SCALE list:  register list to scale.

SHIFT
Shifts channels from an input register (B) onto channels in the output list (A), and adds them together according to: Ai = |bf| Ai + bf Bs where bf (blend factor) is a constant, |bf| is its absolute value, i is the channel number, and s is the shifted channel number. Shifting can be done from one register to another or within the same register.

SHIFT is useful for adding, subtracting or averaging quadrants together. For example, dual-polarization data can be combined by shifting channels 513-1024 into 1-512 with bf = 1 (adding) or bf = 0.5 (averaging) within the same register. SHIFT can also be used to zero portions of a spectrum by setting bf = -1 and shifting a channel range onto itself within the same register.

SHIFT does not automatically write headers when shifting data to a new register, in contrast to COPY. However, header data can also be shifted (except for names) by shifting data in the channel range 8197-8260. Remember that shifted data is blended with existing data, so a true copy only results when shifting into an empty register with bf = 1.

   Enter blend factor:  factor for blending channels together
   Channel ranges to shift:  give ranges of channels to be shifted
   Start channels:  new start channels for each shift range

   Enter list B:    Register list to shift FROM
   Enter list A:    Register list to shift    TO

SMOOTH
Smooths spectra by Hanning, Boxcar or Binning algorithms. Quadrants can be smoothed differently by answering no to ``smooth all quads?''. Smoothed spectra cannot be un-smoothed.

The Boxcar algorithm replaces each channel with the average of the original channels over the box size, beginning with the start channel. The Binning algorithm replaces all channels in the bin with the average of the original channels over the bin size, beginning with the start channel and incrementing by the bin size. The velocity centroid of Binned data may vary with the start channel.

   Smooth all quadrants?  no, to select particular quadrants
      Enter quadrants to smooth:    give list of quadrants
   Enter smooth type: (H, BO, BI):  type, (size and start channel for BO,
                                    BI)
   Enter smooth list:  list of registers to smooth

SOLVE
Solves for linear polarization and Stokes parameters from a set of observations made at different feed angles. SOLVE includes options to self-calibrate and to remove an instrumental term.

At least three different position angles (posn = feed + parallactic) are required as input. The data must be organized as a stack of registers with identical properties except for changing position angles. If two linear polarizations were observed in two quadrants, the second quad must be shifted so that it occupies the same channel range as the first (use FIXPOL).

The available options are: SOLVE (yes, to do the Stokes solution), ``Selfcal'', which scales all spectra in the list to give the same integrated flux over a selected channel range (use an unpolarized feature), and ``Correct'' which removes an instrumental term. The ``cutoff'' value is used to determine which channels should be shown in the printout and appear in the plots.

The algorithm uses a least squares solution to the function: $A = I_\mathrm{u}/2 + I_\mathrm{p} \cos^2 (p_\mathrm{ao} - p_\mathrm{a})$ where A is the measured channel amplitude, Iu is the unpolarized intensity, Ip is the linearly polarized intensity, pao is the position angle of the observation, and pa is the polarization position angle. The following quantities are written to six output registers as spectra, in this order (tagged by type for STATISTICS and PLOT):

The quality of the data and the fit can be checked using XYPLOT with curve 1 overlaid. To do this, write down Iu, Ip and pa for a polarized channel from the printout, and plot the amplitude of the channel against position angle (register location 5014) using the fit results as input parameters for the curve.

   Solve, Selfcal, Correct options:  y y y, for all three options
      channel range of unpolarized feature:  unpolarized feature to
      selfcal on channel range to self-calibrate only this range is
      self-calibrated
 %Pol, position angle, feed:     instrument polarization (correct
opt.)
   Enter cutoff:    amplitude cutoff for polarization solution
   Print Stokes spectra?:  yes, to print polarization results on screen
      All channels above cutoff ok?    yes, otherwise choose a range
         Enter channel range      channel range to print
         More printout?      yes, for more printout
   Quadrants to search:  quadrants to search for points with values
   more than ``cutoff''

   Enter STOKES input list:  list the registers to use in solution
   Enter output list:  need 6 registers to hold output spectra

SPOTMAP
Plots the x,y positions and spectrum derived using the multiple-channel fit option in POSITION. It requires a .POS file as input.

SPOTMAP was adapted from another program, and it has a slightly different interactive format from other modules in SPC. In order to ascend from various levels in SPOTMAP (e.g. from plotting to source selection) you type a dash ``-''.

By default, SPOTMAP chooses an x,y box size which is square on the sky and contains all spots. By entering your own minimum and maximum for x and y in (arcseconds) you can zoom in on specific regions of interest.

   Enter file name (.POS):  give a filename (.POS understood)
   List sources in file?  yes, gives listing of names and numbers
   Enter source name or number: select by number or name (dash to exit)
   Graphics device/type (? to see list, default /xdisp): device type
                                (/null to exit)
   Distinguish points?  yes, plots a different character each vel.
   Enter box to plot:  X,Y min.and max. (<CR> accepts default)

STATISTICS
Calculates the maximum, minimum, mean and rms amplitude over a range of channels. STATISTICS also gives the type of spectrum plotted, the channel number with the maximum amplitude, Tsys and integration time for quadrant 1.

STATISTICS provides statistical quantities for analysis, and also a quick way to check the spectrum type and to find the peak channel number. The spectrum types shown in STATISTICS (and PLOT) are:

   Enter STAT list:  register list for statistics
   Enter channel range:  channel range for calculations

VCOR
Corrects for several velocity errors due to early bugs in SPECTRA's Doppler tracking routine. The three recognized errors are:

VCOR calculates the error present and corrects the spectra, either by performing a channel shift or by changing the velocity in the header. VCOR checks the observing date to determine which velocity correction (if any) is required, and applies it to the data. VCOR does not flag spectra that have been corrected, so be careful not to apply the correction more than once. LOAD warns of a velocity error for data with observation dates within the ranges listed above; this warning should be ignored for SAV files which were corrected before being written.

   Correct Header (h) or Shift spectra (s)?  type ``h'' to fix header
                                             velocity type ``s'' to shift
   Enter VCOR list:  register list to apply corrections to.

WRITE
Writes the contents of SPC registers to a disk file (name.SDF) for storage and retrieval of reduced data. Each WRITE to an existing file appends to that file. To load spectra back into SPC from a SDF file, use the record number in which the spectrum was written - not the sequence number of the original SPC file. A listing of the available record numbers can be obtained with DIRECTORY.

The SDF files are FITS binary tables files which conform to the single-dish FITS (SDFITS) convention.

   Enter WRITE list:                The list of registers to save
   Enter filename (.SDF):           output filename (.SDF understood)

(W. allows NO input; the same register number is appended to the same file!)

XFM
Does a Fourier transform (FFT) on the input register list. If the transform involves real data, an amplitude and a positive lag register are required. For complex data, both amplitude and phase registers, and positive and negative lag spectra are required (4 registers).

XFM may be used to transform spectra back into the lag domain for editing simple correlator problems (reverse transform). It can also be used to generate spectra by transforming synthesized lag spectra (forward transform) for experiments, testing or convolution purposes. For a complex forward transform, the output may be either in the form of amplitude and phase or sin and cos.

XFM takes its header information from the input register list and transforms each quadrant separately; you may choose which quadrants to transform. Note that the input registers may be either amplitudes or lags depending on which transform direction is chosen. Be careful here; the dialogue requests AMP and LAG lists in the same order regardless of which direction was chosen. Transformed spectra are tagged type AM, PH, L+ or L- depending on the kind of transform done.

The length of a transformed spectrum is equal to the number of channels in the quadrant transformed. It is possible to double the number of channels in a spectrum by extending the lag range with zeros, doubling the number of channels for that spectrum (edit the appropriate header items) and transforming back. This is sometimes useful for comparison of data taken with different channel resolutions. A spectrum extended in this way only provides finer sampling of the original spectrum - not improved frequency resolution.

   Enter Reverse or Forward:  R (amp to lags) or F (lag to amp)
   Enter Complex or Real:  C, for both amplitude and phase
      Amp/Pha to Sin/Cos?    yes, to get Sin and Cos (forward)
   Enter list of quadrants to transform:  can select specific quadrants
   Enter AMPLITUDE list:  registers containing channel amplitude
      PHASE list:    regs containing phase (complex)
   Enter POSITIVE lag list  registers for positive lags
      NEGATIVE lag list    regs for negative lags (complex)

   (X. does nothing.)

XYPLOT
Plots up to 10 y-axes against any x-axis chosen from the data and header array for a list of registers. For example: Tsys of all quadrants versus zenith angle; RA versus DEC; LST versus Register number; amplitude of channels 256 and 768 versus register number, etc. might be useful to plot.

In addition, up to 10 curves may be overlaid on the plots for comparison with the data. There are currently four types available:

If more than one y-axis is requested, the various quantities plotted are distinguished by a different plot character. If only one y-axis is requested, points plotted may be distinguished on the basis of register number (i.e. all plotted characters are different); sequence number, source name or sky position.

   Overlay curve?  yes, to plot a curve
      How many?    number curves to plot (10 max)
      Curve type (1,2,3 or 4):    enter type of curve
      Enter curve parameters:    prompts for each curve

   Enter X axis and Y axes: give X axis, and list of Y axes (10 max)
   Distinguish sources?  yes, to distinguish points
      Distinguish by (r,se,so,p):    key to distinguish on
   Enter XY list:    give the register list to plot
   Graphics device/type (? to see list, default /xdisp):
                                  select plot device(/null to exit)
   Automatic scaling ok?  no, to manually set scales on X and Y
      Enter new min,max:    enter X and Y min, max.

ZERO
Zeros the edges of spectra for each quadrant. High values often result due to division by small numbers at the edges when forming quotients. The number of channels to zero is specified for each quadrant, and this number is zeroed at both ends of the spectrum.

   Enter number of edge channels to zero:  give a number for each quadrant
   Enter ZERO list;  list of registers to zero.


next up previous contents
Next: SPC header items Up: SPC (formerly S) A Previous: Using SPC   Contents
Mark Calabretta
2002-09-05