=========================================================================================== SUMMARY OF COMMANDS : The 3He GBT Data Reduction Package in IDL ------------------------------------------------------------------------------------------- v2.1 15 May 2004 T. M. Bania, Institute for Astrophysical Research v3.0 15 Jun 2004 Department of Astronomy v3.1 8 Jul 2004 Boston University v3.2 21 Jul 2004 ==> Commands not listed here are invoked internally by this package. <== They should not be needed by the general user. =========================================================================================== start_gbt START THIS DATA REDUCTION PACKAGE Syntax: START_GBT,'SDFITS_GBT_data_file_fully_qualified_file_name' ----------------------------------------------------------------- procs Print the names of all currently compiled procedures. These are the COMMANDS of this package. Could also use the IDL HELP command. Syntax: PROCS ------------- line Toggle to spectral LINE data reduction mode using spectral line graphics screen. Syntax: LINE ------------ cont Toggle to CONTinuum data reduction mode using continuum graphics screen. Syntax: CONT ------------ =========================================================================================== DATA LISTING COMMANDS =========================================================================================== * The following procedures control the listing of information about the data: rec_info Print information on record in either ONLINE or OFFLINE data file Syntax: REC_INFO,record_number_in_data_file ------------------------------------------- info Print information on contents of buffer 0 (!b[0]) FLAGON/FLAGOFF toggles annotation of column headings Syntax: INFO ------------ hdr Print header information for a spectrum in buffer 0 FLAGON/FLAGOFF toggles extra information Syntax: HDR ----------- date Print date of observation for spectrum in buffer 0 Syntax: DATE ------------ list Print contents of either ONLINE or OFFLINE data file in REC_INFO format ==> If no arguments given prints entire file! <== Syntax: LIST,start_record,stop_record ------------------------------------- cat List contents of STACK CATalog in REC_INFO format Syntax: CAT ----------- =========================================================================================== DATA DISPLAY COMMANDS: See FLAGS file for Boolean switches that modify command actions =========================================================================================== * The following procedures control the data graphics display: erase IDL command to erase the graphics window Syntax: ERASE ------------- gbt_win Opens a graphics plot window for spectral line data (invoked automatically at startup) Syntax: GBT_WIN --------------- cgbt_win Opens a graphics plot window for continuum data (invoked automatically at startup) Syntax: CGBT_WIN --------------- killwin Kills all open graphics windows Syntax: KILLWIN --------------- wreset Reset window from specialized window to either LINE or CONTinuum graphics window => Used to kill off PopUp windows from BSEARCH, RADIOM, QLOOK4 Syntax: WRESET -------------- def_xaxis Define x-axis units. Invoked automatically: do not use. Returns number of data points on axis, num_pts If !chan then x-axis is in channels line/continuum !freq frequency line only !velo lsr velocity line only !elxx elevation continuum only !azxx azimuth " " !raxx right ascension " " !decx declination " " Syntax: DEF_XAXIS ----------------- chan SHOW channels as x-axis toggle (LINE or CONTinuum mode) Syntax: CHAN (default at startup) ------------ velo SHOW velocity as x-axis toggle (LINE mode only) Syntax: VELO ------------ freq SHOW frequency as x-axis toggle (LINE mode only) Syntax: FREQ ------------ azxx SHOW azimuth position as x-axis toggle (CONTinuum mode only) Syntax: AZXX ------------ elxx SHOW elevation position as x-axis toggle (CONTinuum mode only) Syntax: ELXX ------------ raxx SHOW R.A. position as x-axis toggle (CONTinuum mode only) Syntax: RAXX ------------ decx SHOW elevation position as x-axis toggle (CONTinuum mode only) Syntax: DECX ------------ show Plots data and header of contents of buffer 0 !b[0] (Unipops SHOW with toggles) Syntax: SHOW ------------ reshow Overplot existing plot using identical plot parameters (Unipops RESHOW) Syntax: RESHOW -------------- xx Same as SHOW. A UniPoPs throwback Syntax: XX ---------- plthdr Plot spectral line header information during SHOW if toggled (default) Syntax: PLTHDR -------------- pltchdr Plot continuum header information during SHOW if toggled (default) Syntax: PLTCHDR --------------- pltg Annotate plot with gaussian fit values Assumes fits are in !a_gauss. Invoked by Gauss routines if FLAGON. Syntax: PLTG ------------- disp SHOW record_n RESHOW record_m (UniPops DISPlay) Syntax: DISP,rec_n,rec_m ------------------------ mk Scale (multiply) y-axis to milliKelvin from Kelvin Syntax: MK ---------- unmk Scale (multiply) y-axis to Kelvin from milliKelvin Syntax: UNMK ------------ curon Toggle cursor ON Syntax: CURON ------------- curoff Toggle cursor OFF Syntax: CUROFF -------------- ccc Invoke a full plot screen cursor and return its position (xpos,ypos) in PLOT units. FLAGON/FLAGOFF controls xpos,ypos print to std output. Syntax: CCC,xpos,ypos <== RETURNS xpos,ypos so do NOT input ----------- kursor Invoke cursor and read its position once. Return these values in xpos,ypos. Plot this position and its values on graphics screen via FLAG and HLINE. Invokes CCC so xpos,ypos in PLOT units. ==> CURSOR is an IDL command hence this name. Syntax: KURSOR,xpos,ypos <== RETURNS xpos,ypos do NOT input -------------- ksr Continuous version of KURSOR: Left-click mouse ==> KURSOR executes Right-click mouse ==> EXIT and return to IDL command line Syntax: KSR,xpos,ypos <== RETURNS xpos,ypos do NOT input ----------- setx Set x-axis scaling cmd or cursor Syntax: SETX,xmin,xmax or SETX ---------------------- ---- sety Set y-axis scaling cmd or cursor Syntax: SETY,ymin,ymax or SETY ---------------------- ---- setxy Use a box cursor to set the x-axis and y-axis scaling. CURON --> setxy CUROFF --> setxy,xmin,xmax,ymin,ymax Click Left button to set box bottom right corner. Drag Left button to move box. Drag Middle button near a corner to resize box. Click Right button when done. Syntax: SETXY ------------- lastx Restore x-axis range to previous value Syntax: LASTX ------------- lasty Restore y-axis range to previous value Syntax: LASTY ------------- lastxy Restore x-axis range to previous value Syntax: LASTXY -------------- freex Autoscale x-axis by data range Syntax: FREEX ------------- freey Autoscale y-axis by data range Syntax: FREEY ------------- freexy Autoscale both the x- and y-axes Syntax: FREEXY -------------- xroll Set x-range to inner 90% of channels Syntax: XROLL ------------- zline Draw a line through zero intensity ZLON/ZLOFF toggles ZLINE during SHOW Syntax: ZLINE ------------- bmark Draw nregion boxes +/- 1.5 sigma from displayed mean for a 3 sigma band NRON/NROFF toggles BMARK during SHOW Syntax: BMARK ------------- flag Draw and label vertical flag at specified x-axis position. Syntax: FLAG,x-axis_value_to_flag_in_current_x-axis_units ---------------------------------------------------------- flg_id Set vertical flag at specified channel for line ID ch=x-axis value for flag lab=string for flag label clr= sys_colour_variable_name Syntax: FLG_ID,channel_to_flag,'label',color -------------------------------------------- colors: !black !red !orange !green !forest !yellow !cyan !blue !magenta !purple !gray !white srcvl Flags the source velocity hline Draw and label horizontal line at y_axis value specified Syntax: HLINE,y-value --------------------- dcsub Subtract a DC offset defined by mean of the inner 90% of spectrum DCON/DCOFF toggles this for FETCH, PS and LOOK commands Syntax: DCSUB ------------- bias Displace spectrum in buffer0 (!b[0].data) by y_offset i.e. !b[0].data = !b[0].data + y_offset Syntax: BIAS,y_offset --------------------- get_scan For a specific scan find and plot both polarizations for a receiver specified by 'Rx_#_to_get' Valid choices: rxid =['rx1','rx2','rx3','rx4','rx5','rx6','rx7','rx8'] => Assumes <= that one has used CLEARSET and SETSCAN,scan_number to set the scan number Syntax: GET_SCAN,'Rx_#_to_get' ----------------------------- look Use STACK record locations to FETCH spectra and plot them all. Syntax: LOOK ------------- lookav SELECT and average all receivers. STACK must be filled. Invokes QAV Syntax: LOOKAV -------------- qav From the existing selection criteria, fill the STACK with all matching records, both polarizations, average, and flag. Specify which receiver number (1->8, integer) via 'rx_num' If rx_num not given, prompts for input. Syntax: QAV,rx_num ------------------- qlook Take a quick look at all the subcorrelators with appropriate flags. SELECTs records in STACK and executes the LOOK command. Can be used for a single scan via SETSCAN. Syntax: QLOOK ------------- qlook4 For STACK contents average and display all the correlator segments. Pop Up a new graphics window and plot four plots with two polarizations each. => rx1 rx2 rx3 rx4 integers can be in any order with 1 -> 'rx1' If not passed, defaults to 2x4 plots => Return window state via WRESET command Syntax: QLOOK4,rx1,rx2,rx3,rx4 ------------------------------ qqq Uses QLOOK4 to give a quick look at a single TP on/off pair addressed via scan_number. for data taken in the 3He configuration: 8 x 2 correlators Syntax: QQQ,scan_number FLAGON/FLAGOFF toggles overplotting (OFF) or individual plots (ON) flagon/ Toggle many commands' actions. In general, FLAGOFF minimizes output. flagoff Syntax: FLAGON or FLAGOFF -------------- ------- ****************************************************************************** Hardwired flagging procedures for Dec03 Correlator Setups for 3-Helium Project ****************************************************************************** These procedures assume x-axis is in channels. Flags from RTR's cmark.g file Syntax: PROC_NAME ----------------- proc_name= line_ID definition= he3 3He+ band this is !rxid = 1 'rx1' or 'rx1.1' or 'rx1.2' h91 H91 alpha band this is !rxid = 2 'rx2' or 'rx2.1' or 'rx2.2' h115 H115 beta band this is !rxid = 3 'rx3' or 'rx3.1' or 'rx3.2' h92 H92 alpha band this is !rxid = 4 'rx4' or 'rx4.1' or 'rx4.2' different transitions are color coded: 3He+ -> green H171eta -> yellow alpha -> cyan beta -> red gamma -> orange,wahoo delta -> blue epsilon -> purple higher order transitions are all gray. He,C lines for higher delta_n's are gray. ****************************************************************************** Hardwired flagging procedures for Jun04 Correlator Setups for 3-Helium Project ****************************************************************************** he3 ; 3He+ band rx1 Jun04 a91 ; H91 alpha band rx2 Jun04 b115 ; H115 beta band rx3 Jun04 a92 ; H92 alpha band rx4 Jun ; 3He+ band rx5 Jun04 hepp ; He++ band rx6 Jun04 g131 ; H131 gamma band rx7 Jun04 g132 ; H132 gamma band rx8 Jun04 ............................................................................... Glenn Langston's line ID routines: caveat emptor these routines are undocumented recombH recombHe recombC recombN recombO recombAll moleculeRead molecule =========================================================================================== FILE MANIPULATION AND TRANSLATION COMMANDS =========================================================================================== * The following commands deal with data I/O and file manipulation and translation: files Show what files are currently being used: Data file, NSAVE file, NSAVE logfile, PLOT file, Journal file, SAVE_state and SAVE_procs files Syntax: FILES ------------- attach Attach new files to this package, e.g. new data to ONLINE data file. File must already exist or procedure returns an error. Syntax: ATTACH,unit_number OR ATTACH,"file_name" -------------------------- ------------------ attach,1 Specify filetype by integer or string attach,'ONLINE' Both these commands do the same thing -------------- If no input filetype, a menu is printed: (0) SDFITS data file (1) ONLINE data file (2) OFFLINE data file (3) NSAVE data file (4) PLOT file (5) JOURNAL file (6) SAVE_state file (7) SAVE_procs file The following variants are useful for batch mode processing: ==> attach,filetype,filename ==> attach,filetype,filenam,nsave_log_file name <= construction for NSAVE make_ONLINE Create ONLINE spectral line data file with the {gbt_data} structure. Procedure scans the SDFITS file and creates the {gbt_data} structure Syntax: MAKE_ONLINE,recs_per_scan ---------------------------------------------------------- INPUT data is from SDFITS filled data file 'SDFITS_input_file_name' which is defined by INIT_DATA. recs_per_scan is number of records per scan, i.e. the number of subcorrelators in your configuration of the GBT spectrometer New data can be appended to this file via UPDATE_DATA. --> This procedure is invoked by START_GBT. --> Invokes SD_TO_GBT procedure to do translation for each record. => N.B. once {gbt_data} is defined it cannot be modified during an IDL session. if you need to analyze spectra with different numbers of channels you will need to exit the session and start again. Note, however, that this only refers to the channels per spectrum. If the number of channels is the same, then everything else, e.g. bandwidth can change and the package will still work. Caveat emptor. make_data Create spectral line data file using the {gbt_data} format. Syntax: MAKE_DATA,infile,outfile -------------------------------- If files not given, prompts for file names. INFILE data is from SDFITS filled data file. OUTFILE data is {gbt_data} format to specified file which must then be attached via ATTACH command. update Update ONLINE spectral line data file by appending new data to existing ONLINE data file. INPUT data is from SDFITS data file. Assumes SDFITS datafile is being updated. Translates and appends new data to ONLINE data file. SDFITS !datafile defined by INIT_DATA or MAKE_DATA Syntax: UPDATE -------------- make_cdata Create CONTINUUM data file using the {gbt_data} format. Syntax: MAKE_CDATA,infile,outfile -------------------------------- INFILE data is from SDFITS filled DCR data file OUTPUT data is {gbt_data} format to specified file OUTFILE OUTFILE must then be attached via ATTACH command online Choose ONLINE data file for SELECT searches. Use ATTACH to change ONLINE file. Syntax: ONLINE -------------- offline Choose OFFLINE data file for SELECT searches. Use ATTACH to change OFFLINE file. Syntax: OFFLINE --------------- close_datafile Close the ONLINE and OFFLINE data files. Useful for IO error recovery. Syntax: CLOSE_DATAFILE ---------------------- find_file Does this file_name exist? NO prints error and issues a 'retall'. Syntax: FIND_FILE,'fname' Does this file_name exist? ------------------------- gbtsave SAVES IDL variables + procedures to files. Use ATTACH to change files. Syntax: GBTSAVE --------------- gbtrestore RESTORES variables + procedures to files. Use ATTACH to change files. Syntax: GBTRESTORE ------------------ =========================================================================================== PRINTING COMMANDS --- See file PRINTING for details. =========================================================================================== The following commands are used to produce hardcopy. IDL is clunky in this regard. printon Open a PostScript printfile named FNAME. If FNAME omitted, default at GB is '/tbania/idl/figs/idl.ps' Syntax: PRINTON,'fname' ----------------------- printoff Close the PostScript plot file. 'prt' is optional: if prt=1 then prints file to a printer. Syntax: PRINTOFF,[prt] ---------------------- psplot Print a PostScript file. Use fully qualified 'fname'. Syntax: PSPLOT,'fname' --------------------- setprinter Select printer for hardcopy output. Sets Unix setenv PSPRINTER. Syntax: SETPRINTER,device If no device input a menu is printed. ------------------------- setprinter,0 <-- Can specify device by integer or string. setprinter,'lpr' Both these commands do the same thing. setprinter <-- Menu: (0) lp0 : Boston University department office: BW' (1) ops4050 : GBT Control Room: BW' (2) telops : GBT Control Room: color' (3) net : Jansky 234: BW' (4) lp : Reber 105: BW' (5) pslaser : Reber 105: color' (6) coltran : Reber 105: color transparency' (7) lpx : University of Virginia printer' setplot Select an output device for graphics. Directs subsequent plot commands to the specified plotting device. Use this command to switch between .ps files and X-terminal graphics. Syntax: SETPLOT,device,THICK=thick ---------------------------------- setplot Print menu of available graphics devices setplot,device_n_no Direct subsequent to device device_no setplot,device_name Set to device given by device_name THICK - controls thickness of lines and characters, by setting !P.CHARTHICK, !P.THICK, !X.THICK and !Y.THICK, default=1 For example, to make triple thickness lines on a QMS landscape plot: IDL>SETPLOT,'QMS',THICK=3 =========================================================================================== DATA ACCESS: Getting data from the ONLINE and OFFLINE data files. =========================================================================================== * At present this package only works for total power, position switched data. * As in CLASS, all data are accessed via their record number in a data file. * Use ONLINE/OFFLINE commands to switch data access. get Copy rec# from the ONLINE/OFFLINE data file into buffer 0 => !b[0] Syntax: GET,rec --------------- getonline Fills buffer 0 with data record from ONLINE data file Syntax: GETONLINE,rec --------------------- getoffline Fills buffer 0 with data record from ONLINE data file Syntax: GETOFFLINE,rec ---------------------- geton Copy ON TP rec# from the ONLINE/OFFLINE data file into buffers 0 and 5 Syntax: GETON,rec ----------------- getoff Copy OFF TP rec# from the ONLINE/OFFLINE data file into buffers 0 and 6 Syntax: GETOFF,rec ------------------ fetch Calculates the PS spectrum from TP ON/OFF records. on_rec is the ON data rec#; calculates the OFF rec# via !recs_per_scan ON=> buffer 5 OFF=> buffer 6 TP=> buffer 0 and buffer 7 Syntax: FETCH,on_rec -------------------- ps Calculate the PS spectrum from TP ON/OFF records passed explicitly. on_rec is the ON data rec#; off_rec is the OFF data rec# ON=> buffer 5 OFF=> buffer 6 TP=> buffer 0 and buffer 7 Syntax: PS,on_rec,off_rec -------------------------- =========================================================================================== DATA FILTERING: There is a UniPops-like STACK. See COOK_BOOK for details. =========================================================================================== * You can search the ONLINE/OFFLINE data files for records that meet specific criteria such as source name, scan type, etc. and load the STACK with these record numbers. ........................................................................................ SEARCH COMMANDS: ........................................................................................ **************************************************************************************** Selection procedures for SELECT filtering of ONLINE/OFFLINE {gbt_data} files **************************************************************************************** online/offline -> toggle to switch search data file between the ONLINE and OFFLINE {gbt_data} files select Searches ONLINE or OFFLINE for matches and fills STACK with those record numbers. Must explicitly choose either ONLINE or OFFLINE data. ALL searches are made on string variables. Matches exactly for input string. ==> Currently the possible choices are: <== Source Name 'W3' !src Scan type 'ON' !typ Line ID 'rx2.2' !id Scan '1234' !scan Record Range !recmin,!recmax Syntax: SELECT -------------- set Sets SELECT search parameters with walk through dialog. LOOK CAREFULLY AT THE IDL PROMPT WHICH CHANGES. Input strings must NOT be delimited by quotes. '' or ' ' or '*' (NO QUOTES!) return sets wildcard for search Syntax: SET ----------- clearset Sets all SELECT parameters to the wildcard '*' Syntax: CLEARSET ---------------- setrec Set record range for SELECT search of ONLINE/OFFLINE data If no input, prompts for recmin,recmax Syntax: SETREC,recmin,recmax ---------------------------- setrange set the scan range for a SELECT search of ONLINE/OFFLINE data file. If no input, prompts for !scanmin,!scanmax Syntax: SETRANGE,scanmin,scanmax --------------------------------- setsrc Set the source name for a SELECT search of ONLINE/OFFLINE data. If no input, prompts for source name. Syntax: SETSRC,'NGC3242' <--must be string; '*' is wildcard ----------------------- settype Set scan type for for a SELECT search of ONLINE/OFFLINE data. If no input, prompts for scan type: 'ON' or 'OFF' Syntax: SETTYPE,'ON' <--must be string; '*' is wildcard Syntax: SETID,'rx1' <--must be string; '*' is wildcard ------------------ setscan Set the scan number for a SELECT search of ONLINE/OFFLINE data If no input, prompts for scan #. Syntax: SETSCAN,'scn#' <--must be string; '*' is wildcard --------------------- setid Sets line identification for a SELECT search of ONLINE/OFFLINE data. If no argument, prompts for input. Syntax: SETID,'rx1' <-- must pass a string "*" is wildcard ------------------ setpol Sets polarization for a SELECT search of ONLINE/OFFLINE data. If no argument, prompts for input. Syntax: SETPOL, "LCP" or "RCP" <-- must pass a string "*" is wildcard -------------------- .......................................................................................... STACK COMMANDS: See COOK_BOOK for details. .......................................................................................... cat Displays information about the records currently in the STACK CATalog Syntax: CAT ----------- tellstk Print contents of STACK as list of record numbers (Think: TELLSTacK) Syntax: TELLSTK --------------- clrstk Empty the STACK (Think: CLeaRSTacK) Syntax: CLRSTK -------------- add Add a single record number to the STACK Syntax: ADD,rec# addem Add several record numbers to the STACK passed as an array: [...] MUST be delimited by [...] Syntax: ADDEM,[rec#1,rec#2, ... ,rec#last] ------------------------------------------ sub SUBtract rec# from the STACK Syntax: SUB,rec# ---------------- avgstk ACCUM and AVE the records in the STACK (see below) Syntax: AVGSTK look Use STACK record locations to FETCH spectra and plot them with a DC level subtracted via DCSUB. Assumes x,y-axes are set properly. FLAGOFF --> overplot these spectra FLAGON -> --> show them individually Pauses after each plot; issue to continue. Syntax: LOOK ------------ =========================================================================================== DATA MANIPULATION COMMANDS: BASELINES & GAUSSIAN FITS. See COOK_BOOK for details. =========================================================================================== * All procedures work on the data in buffer 0 --> !b[0].data * As in Unipops, these commands work in either interactive or batch mode, i.e. with and without a cursor. In the beginning, you should use the cursor. Issue a CURON command to activate the cursor. It only changes state when you toggle via CURON/CUROFF. * All these procedures work for any choice of x-axis definition. Be aware, however, that their robustness decreases as one goes from CHAN to VELO to FREQ modes. Baseline routines do not work in FREQ mode as one gets overflows. This is a feature. ........................................................................................... BASELINE FITS: Baseline fitting commands are NRSET, BBB, BB, and B. (Think: UniPops) ........................................................................................... nrset Set NREGION mask in x-axis units using either command line or cursor. ===> Baseline fits are made to the data WITHIN the NREGION zones <=== Syntax: NRSET,#_nregions[,nregion_array] ---------------------------------------- #_nregions is the number of NREGIONs to set nregion_array is array of (begin,end) x-axis pairs used to delimit n-NREGIONs: i.e. [b1,e1,b2,e2,b3,e3, ...] CURON/CUROFF toggles whether cursor is used for input: If !cursor=1 then set with the cursor: nrset,#_regions_to_set --> prompts for 2 x #_regions_to_set cursor points N.B. do this from left to right! else: nrset,3,[1510,1790,1965,2090,2300,2475] |=#_regions_to_set which requires 6 numbers N.B. this array must be delimited: [...] mrset Sets NREGION mask in x-axis units defaluting to plot margins. If !cursor=0 (CUROFF) then returns with error. Sets beginning and ending of NREGIONs to display xmin,xmax. Syntax: mrset,n,nreg -------------------- n is the number of nregions to set nreg is array of x-axis value pairs of (begin,end) EXCEPT the first begin and last end are by default the displayed xmin,xmax => First click is END of first NREGION <= => Last click is BEGINNING of last NREGION <= bb Fit polynomial baseline of order nfit to data in NREGION zones. Syntax: BB,nfit --------------- if nfit is not passed, previous value used. NREGIONs must be set with NRSET before this procedure is invoked original data copied to buffer 2 fitted baseline is overplotted on data with built in pause returns baseline subtracted spectrum in buffer 0 if ZLON was issued then zero intensity line is plotted if NRON was issued then NREGIONs plotted with Y-axis size +/- 3 sigma prints RMS of NREGIONs zones bbb Exactly like BB command except it is far more robust and can handle nfit up to 100. Written by John G. Lyon. Invokes ORTHOFIT. Syntax: BBB,nfit ---------------- b Fit polynomial baseline of order nfit to data in NREGION zones. Intended for batch processing. Does the fit automatically, thus all relevant parameters must already be set. Neither a baseline model nor the resulting baseline subtracted spectru is plot. Uses Lyon's fitter. Syntax: B --------- bsearch Fit baselines with polynomials of order 0 to 100 with Lyon fitter. Pop up graphics window and plot RMS of fit vs polynomial order. nfitmax is maximum order to plot -- nfitmax=100 is default (!) Use WRESET to delete this window and return to normal. Syntax: BSEARCH,nfitmax ----------------------- mask Use NREGION information to extract x/y-axis values for fitting routines. Syntax: MASK,dsig,index ----------------------- returns: dsig => rms of masked regions index => NREGION locations index is used to parse the x/y-axis arrays for curve fits rms Calculates and prints RMS in region between xmin and xmax. If CURON issued then set with the cursor, left to right else set via command line parameters xmin,xmax => returns: sigma = rms in current y-axis units <= Syntax: RMS,sigma,xmin,xmax --------------------------- radiom For STACK contents fit nfit order baseline to previously defined NREGIONs and calculate the rms vs integration time. Pop Up a new graphics window and plot the radiometer equation. => RUN THIS PROCEDURE WITH X-AXIS IN CHANNELS rms values with theoretical ones calculated via TH_RMS. => Return window state via WRESET command Syntax: RADIOM,nfit ------------------- th_rms Calculate theoretical rms expected from current configuration Pass arrays to RADIOM for comparison with empirical radiometer equation. This routine is automatically invoked by RADIOM. theoretical radiometer equation for GBT ACS rms := k1*tsys/sqrt(k2*teff*npol*df); where tsys - system temperature in milliKelvins k1 - backend sampling efficiency k1 = 1.032 for 9-level k1 = 1.235 for 3-level k2 - autocorrelator channel weighting function k2 = 1.21 for Uniform k2 = 2.00 for Hanning teff - ton*toff/(ton + toff) in seconds npol - number of polarizations (or independent signals) df - frequency resolution in Hz rfi Replaces spectral region contanimated with RFI with values gotten from a baseline fit. Prompts to define a *single* RFI zone via MRSET,2 Spectral values are replaced for *all* regions *outside* the NREGIONs which are *inside* the plotted display. By default nfit=9. Syntax: RFI ----------- nrfi Replaces spectral region contanimated with RFI with values gotten from a baseline fit. Must define RFI zone via either NRSET or MRSET. MRSET is recommended. Spectral values are replaced for *all* regions *outside* the NREGIONs which are *inside* the plotted display. Prompts if nfit, the order of the baseline fit, not given. Syntax: NRFI,nfit ----------------- ........................................................................................... GAUSSIAN FITS: Gaussian fitting commands are GAUSS, GG, and G. (Think: UniPops) ........................................................................................... gauss Multi-component Gaussian fit for novices. Fit multiple Gaussians: interactive walk-through-each-step procedure. ===> READ the prompts carefully and follow orders....! (ja?) <=== For best results subtract a baseline first Modified by t.m.bania from astrolib code Syntax: GAUSS ------------- gg Fit multiple Gaussians and overplots the fit on the data. Cursor must be enabled via CURON. If FLAGON issued then overplot again with the residual=data-fit ngauss = # gaussian components to fit => This works exactly like our UNIPOPS gg function. From LEFT to RIGHT Click: bgauss gauss_#(center,hw_right) egauss i.e. each Gaussian component specified by a center and half-width flagged to the right of the line center (bgauss,egauss) denote the range for the Gaussian fit buffer 2 holds copy of buffer 0 buffer 1 holds the GMODEL (gfit) buffer 8 holds the data-model difference Syntax: GG,ngauss <-- number of Gaussian components to fit ----------------- g Fit multiple Gaussians to data. Intended for batch mode processing. Assumes all relevant Gaussian parameters have already been PRESET, presumably done via 'GG,#gaussians_to_fit' gaussian h,c,w values for each component are in !a_gauss fitting region is delimited by !bgauss and !egauss buffer 2 contains copy of original data from buffer 0 buffer 1 contains the GMODEL, i.e. the fitted gaussians buffer 8 contains the data-model difference spectrum FLAGON/FLAGOFF toggles more complete output: e.g.annotate line parameters overplot of fit Syntax: G --------- ggg G procedure with explicit (forced) i/o MUST have baseline removed. Needs initial guesses for the fit. Returns the fits no matter what state !flag is in. Syntax: GGG ----------- idchan Take x-axis value and return channel number of !xx array element whose value is closest. i.e. finds channel number associated with an x-axis value in one of the following co-ordinate systems: ==> If !chan then x-axis is in channels !freq frequency !velo lsr velocity !elxx elevation !azxx azimuth !raxx right ascension !decx declination Syntax: IDCHAN,xval,xchan ------------------------- =========================================================================================== DATA AVERAGING: See COOK_BOOK for details. (Think: UniPops) =========================================================================================== * Data are averaged via the following commands: accum ACCUMumulate weighted record data from buffer 0 in buffer 3. As in Unipops. header of first call to ACCUM is stored in buffer 3. weight is tintg/(Tsys)**2 for data tintg for Tsys Syntax: ACCUM ------------- ave Compute the weighted AVErage of the data in ACCUM buffer 3. Store result in buffer 0 and buffer 4 and flush buffer 3. If !verbose=1 then print out the record numbers being averaged. If !deja_vu=1 then pring out detailed header information of these records. Syntax: AVE ----------- avgstk ACCUM and AVE the records in the STACK Syntax: AVGSTK -------------- =========================================================================================== DATA BUFFER COMMANDS -- math functions, copying, smoothing, etc. =========================================================================================== * The following commands operate on the 16 buffers: !b[0]->!b[15]: copy Copy buffer n to m Syntax: COPY,n,m ---------------- plus Add buffer n to m. Default: plus --> !b[0].data = !b[0].data + !b[1].data Syntax: PLUS,n,m <-- b0 = bn + bm ---------------- minus Subtract buffer m from buffer n Default: minus --> !b[0].data = !b[1].data - !b[0].data Syntax: MINUS,n,m <-- b0 = bn - bm ----------------- div Divide buffer n by buffer m Default: div --> !b[0].data = !b[1].data / !b[0].data Syntax: DIV,n,m <-- b0 = bn / bm --------------- mult Multiply buffer n by buffer m Default: mult --> !b[0].data = !b[1].data * !b[0].data Syntax: MULT,n,m <-- b0 = bn * bm ---------------- scale Scale (multiply) buffer 0 by fact Syntax: SCALE,fact ------------------ mk Scale (multiply) y-axis to milliKelvin from Kelvin Syntax: MK ---------- unmk Scale (multiply) y-axis to Kelvin from milliKelvin Syntax: UNMK ------------ boxcar Apply a boxcar smoothing function over nch cnannels. Original buffer 0 data copied to buffer 8. Overplots smoothed data and then pauses. RESHOWs the smoothed data Syntax: BOXCAR,#_smo_ch <-- must be odd number of channels ----------------------- smooth Smooth data with gaussian weighting: 5 channel fwhm gaussian FLAGON/FLAGOFF toggles extended information Channels within fwhm at both spectrum ends are left intact Syntax: SMOOTH -------------- smo Smooth data with Gaussian weighting with fwhm=n in channels If no input uses !smgwt[] => currently hardwired for 5 channel fwhm Channels within fwhm at both spectrum ends are left intact FLAGON/FLAGOFF toggles extended information => Returns smoothed data to buffer 0: RESHOW to display atop original or set FLAGON Syntax: SMO,n <-- Gaussian smooth with fwhm=n channels ------------- =========================================================================================== NSAVE FILE COMMANDS (Think: UniPops) =========================================================================================== * As in UniPops you can save (and recall) the !b[0] buffer (header and data) in an NSAVE file. Thus you can save and retrieve processed data. * Here also are commands that allow you to annotate the header information before you save the data. * START_GBT invokes INIT_NSAVE which gives you the opportunity to create the NSAVE files '../data/nsave.dat' and '../data/nsave.log'. It also gives you the ability to create these files with arbitray names. There are 256 data slots in NSAVE. * Another way to prevent your oh-so-laboriously created nsave.dat and nsave.log files from being overwritten is to rename the files. From within IDL this is done via: $cp ../data/nsave.dat ../data/new_name.dat $cp ~/data/nsave.log ~/data/new_name.log * Note that you can create many of these with different names (via MAKE_NSAVE) and ATTACH them at will. ............................................................................................... init_NSAVE Invoked by START_GBT at startup to initialize NSAVE files. Asks whether or not to use existing ~nsave.dat and ~nsave.log files or to make new ones with either the default, or new names. Invokes MAKE_NSAVE Syntax: INIT_NSAVE ------------------ make_NSAVE Create the NSAVE file using the input gbt data structure {gbt_data}. Also create a log file flagging whether a slot has been written to or not. => File names are '~/data/nsave.dat' and '~/data/nsave.log' => Size of NSAVE file (number of save slots) is 256. => N.B. This procedure should only be run sparingly. it will destroy previous versions of the same file name .... You can prevent this by renaming the files: $cp ~/data/nsave.dat ~/data/new_name.dat $cp ~/data/nsave.log ~/data/new_name.log You can always ATTACH these files later. Syntax: MAKE_NSAVE,gbt ---------------------- putns Save (write) buffer 0 to NSAVE region specified by 'ns' argument. If 'ns' not given then ns=!nsave, else !nsave=ns. Also updates !nsave_log in !nslogfile to indicate slot contains data. If slot contains data and if NSON has been issued then do NOT overwrite. ==> NSON/NSOFF toggle write protection ==> FLAGON/FLAGOFF toggle extra output ==> N.B. Beware! SAVE is an IDL command! Do not use it! Syntax: PUTNS,ns ---------------- getns Fill buffer 0 with NSAVE region specified by 'ns' If ns not supplied, !nsave is used, else !nsave=ns Syntax: GETNS,ns ---------------- nson Set NSAVE write protection flag ON Enable overwrites if data exist in selected !nsave Syntax: NSON ------------ nsoff Set NSAVE write protection flag OFF Disable overwrites if data exist in selected !nsave Syntax: NSOFF ------------- nslog Print information for NSAVE data records. Searches NSAVE to find slots with data. Invokes HDR. Syntax: NSLOG ------------- comment Write a comment string into !b[0].history for annotation. 552 character maximum in {gbt_data} at present time Routine truncates input string to fit If msg is passed explicitly, then must be a string 'msg' else system prompts for a message and no ' ' is needed => Overwrites !b[0].history Syntax: COMMENT,msg ------------------- tagtype Writes a byte(string) into !b[0].scan_type for annotation. 32 character maximum in {gbt_data} Routine truncates input string to fit If msg is passed explicitly, then must be a string 'msg' else system prompts for a message and no ' ' is needed => Overwrites !b[0].scan_type Syntax: TAGTYPE,msg ------------------- tagid Writes a byte(string) into !b[0].line_id for annotation 32 character maximum in {gbt_data} Routine truncates input string to fit If msg is passed explicitly, then must be a string 'msg' else system prompts for a message and no ' ' is needed. => Overwrites !b[0].line_id Syntax: TAGID,msg ----------------- tagpol Writes a byte(string) into !b[0].pol_id for annotation 4 character maximum in {gbt_data} Routine truncates input string to fit If msg is passed explicitly, then must be a string 'msg' else system prompts for a message and no ' ' is needed. => Overwrites !b[0].pol_id Syntax: TAGPOL,msg ------------------ =========================================================================================== CONTINUUM DATA ANALYSIS --- See CONTINUUM for details. =========================================================================================== * V3.1 adds continuum analysis capability; it only supports GBT DCR data written by SDFITS. * One to switch between spectral line and continuum data within an IDL session. The switching commands are: LINE Switch to spectral LINE mode. All graphics procedures write to LINE graphics screen. CONT Switch to CONTinuum mode. All graphics procedures write to CONT graphics screen. To define the continuum window use CGBT_WIN Currently this is done at startup via STARTUP.IDL.V3.1 * V3.1 at present handles only fixed length continuum data units. So one must choose at the outset what that is to be. * V3.1 has the following procedures to help discover the nature of the SDFITS data file: kondar A *script* that reads the SDFITS file into a *local* structure array, sdf[]. It also packs the first !data_points*16 DCR intensity data into buffers 0 to 15 so that you can look at it via a combination of SHOW and COPY,buffer#,0 commands. Syntax: @kondar --------------- continfo Scan SDFITS continuum data file and determine the number of continuum data points per record. Prompts for filename if none is input. Uses changes in scan number, polarization, scan type, and sequence number to flag new data records. Note that different continuum observing procedures, e.g. PEAK, FOCUS, etc. will have different number of data points. Syntax: continfo,sdfits_file_name --------------------------------- condar Reads SDFITS DCR continuum data file and uses changes in parameters to parse data into discrete continuum data records. Prompts for filename if none is input. Output slightly different from continfo, cf. CONTINUUM Syntax: condar,sdfits_file_name ------------------------------- * Now that we know the number of data points per continuum data unit we can choose which type of continuum data to process and set !c_pts. At present this is done manually and by hardwiring the procedure MAKE_CDATA with the data type. make_cdata Creates CONTINUUM data file using the {gbt_data} format INPUT data is from SDFITS filled data file !kon counts number of data records currently in file OUTPUT data is {gbt_data} format to specified file which must then be attached via ATTACH command Prompts for input if file names are not supplied. Syntax: make_cdata,sdfits_input_file,{gbt_data}_output file ----------------------------------------------------------- =========================================================================================== SDFITS DATA PROCESSING COMMANDS =========================================================================================== * The average user should not need to know anything about these commands. They all involve aspects of processing the SDFITS data file into the {gbt_data} structure format used in this package. sd_to_gbt Convert the SDFITS structure into the {gbt_data} GBT data structure. Does this on a record by record basis for SPECTRAL LINE data. 'in' is SDFITS data structure input (sdd[]) 'out' is {gbt_data} data structure output => Invoked by MAKE_DATA and MAKE_ONLINE Syntax: SD_TO_GBT,in,out ------------------------- sd2Cgbt Convert the SD_FITS structure into the {gbt_data} GBT data structure. ------- Does this on a record by record basis for CONTINUUM data. 'in' is SDFITS data structure input (sdd[]) 'out' is {gbt_data} data structure output => Invoked by MAKE_CDATA Syntax: SD2CGBT,in,out -------------- sd_hdr Print header variables for a single SDFITS record i.e. a single subcorrelator spectrum for a specific scan. 'rec' is an explicit reference to this single *SDFITS record*; it is NOT the record number of a spectrum in a {gbt_data} data file. For this procedure to work, MRDFITS must be used to generate a sdd[] structure array from the SDFITS data file: ; Read the SDFITS data file in array sdd[] get_lun,lun openr,lun,!datafile sdd = mrdfits(lun, 1, hdr, status=status) ; makes SDFITS data structure array free_lun,lun Syntax: rec=sdd[rec#] or SD_HDR,sdd[111] ------- SD_HDR,rec --------------- ---------- rxidrec Identify the spectral transition of a subcorrelator band using the GBT sampler keyword. Sets value of 'line_id' in {gbt_data}. Does this on a record by record basis in MAKE_ONLINE and MAKE_DATA. --> 'line_id' is both input and output string and takes values such as: 'rx1.1','rx1.2','rx2.1','rx2.2', etc where .1/.2 are polarizations: .1=LCP and .2=RCP Syntax: RXIDREC,line_id ----------------------- Currently hardwired to dec 03 3He run configuration: gbtsampler= ['A9 ', 'A10', 'A13', 'A14', 'B17', 'B18', 'B21', 'B22', $ 'C25', 'C26', 'C29', 'C30', 'D33', 'D34', 'D37', 'D38'] lid=['rx1.1','rx2.1','rx1.2','rx2.2','rx3.1','rx4.1','rx3.2','rx4.2', $ 'rx5.1','rx6.1','rx5.2','rx6.2','rx7.1','rx8.1','rx7.2','rx8.2'] init_data Reads input SDFITS filled data file Sets parameters of the IDL GBT data structure ==> Invoked by START_GBT Syntax: INIT_DATA,SDFITS_datafile ---------------------------------- =========================================================================================== ===========================================================================================