NRAO Home  >  Green Bank  |  Wiki Topic:    GB > Data > IDLDocumentation > IDLDocumentationV1pt2 > GBTIDLQuickReferenceV1pt2
   Changes | Index | Contents | Search | Statistics | Jump to Topic
GBTIDL: Quick Reference to GUIDE v1.2

  Main     Discussion Area     Documentation     Contents     Status  

A PDF version of this document is available here.

For help with a routine from the gbtidl command line, use the 'usage' command, for example: GBTIDL -> usage, "show"

or for more information : GBTIDL -> usage, "show", /verbose

or to view the IDL source: GBTIDL -> usage, "show", /source

GUIDE starts in spectral line mode. To switch to continuum mode, type "cont" at the GBTIDL prompt. To switch to line mode, type "line" at the GBTIDL prompt.

In the following tables, optional arguments are in [brackets]. IDL parameters are in normal font, keywords are in boldface. The parameters argument refers to the selection parameters listed in the "Parameters for Data Retrieval and Selection" table below.

Data Operations


>>> Retrieving and Saving Data <<<
dirin, [file_name, /new_index ] Input from the given directory
filein, [file_name, /new_index ] Input from the given SDFITS file
fileout, file_name Open an SDFITS file for writing
files, [ /full ] Lists the input and output files currently in use
get, [parameters] Retrieve a record from the input file
getchunk([ count, /keep , parameters]) Retrieve multiple data containers at a time
getdata([buffer,elements]) Returns the data into an IDL array
getrec, index Retrieve a record at the given index
getscan, scan Retrieve the first record with the given scan number
keep Store the PDC to the output SDFITS file
kget, [parameters] Retrieve a record from the output file
kgetrec, index Retrieve a record at the given index from the output file
kgetscan, scan Retrieve the first record with the given scan number from the output file
nget, nsave, [ buffer, /infile, ok ] Retrieve a record with a given nsave identifier
nsave , nsave, [ buffer, dc, ok ] Save to the output file, with an nsave identifier
offline, project, [ /acs, /sp ] A shortcut for filein, used only in Green Bank
online, [ /acs, /sp ] Connect to the online data file, used only in Green Bank
putchunk, chunk Save multiple data containers to the output file
setdata, value, [elements, buffer ] Replaces the data in a DC with the values in an IDL array
set_data_container, data, [ buffer, /ignore_line, /noshow ] Copy a data container into a global buffer
sprotect_off Turns off write protection for nsave entries
sprotect_on Turns on write protection for nsave entries

>>> Using the Stack <<<
addstack, first, [last, step] Add enumerated entries to the stack
appendstack, index Append array of entries to the stack
astack(elem) Returns the record index for a given entry in the stack
avgstack, [ /noclear, /keep ] Average spectra identified by entries in the stack
delete, index Remove individual entries from the stack
deselect, [ /keep, parameters ] Remove entries from the stack based on the given selection criteria
emptystack, [ /reset, /shrink ] Clear the stack
liststack, [start, finish, sortcol, columns, /user, /keep, parameters ] List records from the input data file that correspond to entries in the stack
select, [ /keep, parameters ] Add entries to the stack based on the given selection criteria
tellstack List the stack entries

Parameters for Data Retrieval and Selection
listcols Lists the available search parameters. In line mode, these are:
 
index            subscan              numchn           lst                 bandwidth
project          scan                 sig              centfreq            exposure
file             polarization         cal              restfreq            tsys
extension        plnum                sampler          velocity            nsave
row              ifnum                azimuth          freqint
source           feed                 elevation        freqres
procedure        fdnum                longitude        dateobs
e2escan          int                  latitude         timestamp
 
  In continuum mode, these are:
 
index            firstrow             procedure        polarization        nsave
project          numrows              e2escan          ifnum
file             stride               subscan          sig
extension        source               scan             cal

>>> Using Data Containers <<<
add, [in1, in2, out] Adds DC's based on buffer numbers. out = in1+in2
bias, factor Add a bias to the spectrum in the PDC
copy, in, out Copies a data container to another buffer
divide, [in1, in2, out] out=in1/in2
move, in, out Moves a data container to another buffer
multiply, [in1, in2, out] out=in1*in2
scale, factor, [ buffer ] Scale the spectrum in the PDC
subtract, [in1, in2, out] out=in1-in2

>>> Getting Information about Scans and Files <<<
get_scan_numbers([parameters, /keep, /unique ] ) Get a list of scan numbers from the input data file
header, [dc] Show the record header
list, [start, finish, sortcol, columns, /user, /keep, parameters ] List records from the input data file
ls, [pattern, options ] List FITS files (default) or any other files in the directory
nrecords( [ /keep ] ) Returns the number of records in the input or output file
scan_info(scan, [ /keep, /quiet ]) Returns some info such as num IFs, num integrations, etc.
summary Gives a summary of scans in the input file
table, [buffer, brange, erange ] List data in tabular form

SELECT Examples:

Integer Search

  select, index=10                 ; selects one index
  select, index=[10,14,17,18]      ; selects a list of indices
  select, index='10:15,20:23'      ; selects the given ranges
  select, index=':30'              ; selects indices less than 30

Float Search

  select, tsys=33.26                ; selects values between 33.255 and 33.265
  select, tsys='33.0:38.0'          ; selects the range 33-38 K
  select, tsys=':45.0'              ; selects based on Tsys < 45.0K

String Search

  select, source='NGC1068'                 ; select based on single string value
  select, source=['NGC1068', 'NGC1069']    ; select from a list of strings
  select, source='NGC*'                    ; wildcards permitted at beginning and end of string

Plotter Operations

annotate, x, y, text, [ color, charsize, /normal, /noshow ] Add text annotation to a plot
bdrop, nchan Drop initial channels from spectrum display
chan Set X-axis units to channels
chantox(chans, [ type, dc ]) Returns X-values for given list of channels
clear Erase the plotter
clearannotations, [ /noshow ] Clear annotations
clearmarks, [ /noshow ] Clear marks (the "+" markers)
clearoplots, [ index ] Clear overplots
clearoshows Clear oshows
clearovers Clear oshows and oplots
clearvlines, [ /noshow ] Clear vlines
click([ frame, veldef, /nocrosshair, /noshow, label ]) Returns position of a mouse click
crosshair Toggle crosshair cursor
edrop, nchan Drop end channels from spectrum display
freex Sets the X-axis range to autoscale
freexy Sets X- and Y-axis to autoscale (equivalent to unzoom)
freey Sets the Y-axis range to autoscale
freeze Freeze the plotter, i.e. set auto update off
freq Set the X-axis units to frequency
gbtoplot, [x], y, [ color, /chan, index ] Overplot a set of X,Y points
getplotterdc([ /copy ]) Get the currently displayed data container
getxarray([ count ]) Get the xarray values for the currently displayed data
getxframe() Get the current reference frame (LSR, TOPO, etc)
getxoffset() Get the current X-offset (0.0 unless relative x-axis has been toggled)
getxrange([ *empty *]) Get the current X-range
getxunits() Get the current X-axis unts (counts, km/s, GHz, etc)
getxveldef() Get the current velocity definition (RADIO, OPTICAL, TRUE)
getxvoffset() Get the current velocity offset in m/s
getyarray([ count ]) Get the data values for the currently displayed data
getyrange([ *empty *]) Get the current Y-range
histogram Toggles between histogram-style and connected-points style plots
oshow, [dc, color ] Overlay spectrum on the displayed plot
print_ps, [ filename, device, /portrait ] Send the plot to the printer
reshow Re-draw everything known to the plotter.
setabsrel, absrel Sets X-axis in Absolute (absrel='Abs') or Relative (absrel='Rel') units
setframe, frame Sets reference frame for X-axis
setmarker, x, y, [ text ] Places a marker on the plot at the desired location
setveldef, veldef Sets velocity definition for X-axis
setvoffset, voffset, [ veldef ] Sets the offset velocity
setx, [x1, x2] Sets the range on the X-axis
setxunit, unit Sets the units for the X-axis
setxy, [xmin, xmax, ymin, ymax] Sets the range on the X- and Y-axes.
sety, [y1, y2] Sets the range on the Y-axis
show, [dc, color, /defaultx ] Displays a data container on the plotter
toggleovers Toggles overlays
unfreeze Unfreeze the plotter, i.e. set auto update on
unzoom, [ /onestep ] Unzoom the plot
velo Set the X-axis units to velocity
vline, x, [ ylabel, label, /noshow, /ynorm ] Draw a vertical line on the plot
write_ascii, [ filename, /prompt, brange, erange ] Writes the data in PDC to an ASCII file
write_ps, [ filename, /portrait, /prompt ] Writes the displayed plot to a postscript file
xtochan(xvalues, [ dc ]) Returns channel number that corresponds to the given X-values
zline Toggles the zero line

Analysis Procedures


>>> Averaging <<<
accum, [ accumnum, weight, dc ] Add a spectrum to the accumulator
ave, [ accumnum, wtarray, count, /noclear, /quiet ] Average data in the accumulator
avgstack, [ /noclear, /keep ] Average entries in the stack
fshift( [accumnum, buffer, frame ] ) Determine a shift to align in frequency
gshift, offset, [ buffer, /wrap, ftol, /nowelsh, /nopad, /linear, /quadratic, /lsquadratic, /spline, /cubic ] Apply a shift to align spectra
sclear, [ accumnum ] Clear the accumulator buffer
vshift( [accumnum, buffer, frame, veldef, voffset ] ) Determine a shift to align in velocity
xshift( [accumnum, buffer ] ) Determine a shift to align in current X-axis units

>>> Baselines <<<
baseline, [ nfit, modelbuffer, ok ] Fits and subtracts a baseline from the PDC spectrum
bmodel, [ modelbuffer, nfit, ok ] Writes a baseline model into a DC using coeffs from a previous fit
bshape, [ nfit, /noshow, modelbuffer, ok, color ] Fit and display a baseline as an overplot without subtracting it
bshow, [ nfit, ok, color ] Overplot the most recently fit baseline
bsubtract, [ nfit, ok ] Subtracts a baseline determined from the stored coeffs
getbasemodel( [ nfit, ok ] ) Return a baseline polynomial evaluated at all channels in the PDC
nfit, order Sets the order of the (orthogonal) polynomial to be fit
nregion, regions Defines the regions to be used for a baseline fit
setregion Interactive use of the cursor to define the baseline region

>>> Calibration <<<
fold, [ sig, ref, ftol ] Fold a frequency-switched scan (also done in getfs)
getbs, scan, [ ifnum, intnum, plnum, fdnum, bswitch, tau, tsys, ap_eff, smthoff, units, /eqweight, /quiet, /keepints, status ] Retrieves and calibrates a total power nod beamswitched scan pair
getfs, scan, [ ifnum, intnum, plnum, fdnum, tau, ap_eff, units, /nofold, /eqweight, /quiet, /keepints, status ] Retrieves and calibrates a frequency switched scan
getnod, scan, [ ifnum, intnum, plnum, fdnum, tau, tsys, ap_eff, smthoff, units, /eqweight, /quiet, /keepints, status ] Retrieves and calibrates a total power nod scan pair
getps, scan, [ ifnum, intnum, plnum, fdnum, tau, tsys, ap_eff, smthoff, units, /eqweight, /quiet, /keepints, status ] Retrieves and calibrates a total power position switched scan pair
getsigref, sigscan, refscan, [ ifnum, intnum, plnum, fdnum, tau, tsys, ap_eff, smthoff, units, /eqweight, /quiet, /keepints, status ] Retrieves and calibrates a total power position switched pair, with the user identifying the sig scan and ref scan separately
gettp, scan, [ ifnum, intnum, plnum, fdnum, /eqweight, /quiet, /keepints, status ] Retrieves and calibrates a single total power scan

>>> Gaussians <<<
fitgauss, [ fit, fitrms, modelbuffer, highlightcolor ] Interactive procedure to fit Gaussians to the spectrum
gauss, [fit, fitrms, buffer, modelbuffer, ok, /quiet ] Fits Gaussians to the spectrum, based on initial values set by procedures gregion, ngauss, gmaxiter, and gparamvalues
gmaxiter, maxiter Sets max number of iterations for Gauss fitter
gparamvalues, gauss_index, values Sets initial guesses for Gauss fitter
gregion, regions Sets the regions used for Gauss fitter
gshow, [ modelbuffer, /parts, color ] Displays the Gaussian fits on the plotter
ngauss, ng Sets the number of Gaussians to be fit
report_gauss, [ /fits, /params ] Prints the results of a Gaussian fit on terminal

>>> Other <<<
boxcar, width, [ buffer, /decimate ] Boxcar smoothing
clip, datamin, datamax, [ buffer ] Truncate spectrum to a min and max data value
decimate, [nchan, startat, buffer, ok ] Decimate the spectrum by paring channels
gconvol, kernel, [scale_factor, buffer, ok, /normalize, /center, /edge_wrap, /edge_truncate, missing, /nan, /normalize ] Convolve the spectrum in the PDC with an array
gfft, [real_buffer, imag_buffer, /inverse, bdrop, edrop ] FFT or inverse FFT the spectrum
gsmooth, newres, [ buffer, /decimate ] Gaussian smooth the spectrum in the PDC to the newres resolution (channels)
hanning, [ buffer, /decimate, ok ] Hanning smooth the spectrum in the PDC
invert, [ buffer ] Flip the data end-to-end
molecule, [ /doprint ] Show molecular transition frequencies on the plotter
powspec, [buffer] Compute power spectrum of the specified DC
recomball, [ /doprint ] Plot the H alpha, beta, gamma; He alpha, beta and C alpha recombination lines
recombc, [dn, /doprint ] Compute and plot frequencies of Carbon recombination lines
recombhe, [dn, /doprint ] Compute and plot frequencies of Helium recombination lines
recombh, [dn, /doprint ] Compute and plot frequencies of Hydrogen recombination lines
recombn, [dn, /doprint ] Compute and plot frequencies of Nitrogen recombination lines
recombo, [dn, /doprint ] Compute and plot frequencies of Oxygen recombination lines
resample, newinterval, [ keychan, buffer, /nearest, /linear, /lsquadratic, /quadratic, /spline ] Resample the spectrum in the PDC at the new interval (channels).
replace, [bchan, echan, /zero, /blank ] Replace bad data values with interpolated, zero or blanked values
stats, [brange, erange, /full, ret ] Provide statistics
usage, proname, [ /verbose, /source ] Print out usage information on the named procedure or function

Topic GBTIDLQuickReferenceV1pt2 . { Edit | Attach | Ref-By | Printable | Diffs | r1.9 | > | r1.8 | > | r1.7 | More }
Revision r1.9 - 13 Dec 2005 - 19:31 GMT - BobGarwood
Parents: IDLDocumentation > IDLDocumentationV1pt2
Content copyright © 1999-2007 by the contributing authors.
All material on this collaboration platform is the property of the contributing authors.