; ; define variables which must be global in scope ; only system variables have this attribute in IDL ; (COMMON variables need to be invoked in each procedure via a named COMMON statement) ; ; Here we define variables and initialize default values ; defsysv,'!b',replicate({gbt_data}, 16) ; define 16 system buffers ; each is the gbt_data structure format ; each holds a header and a spectrum ; defsysv,'!rec',replicate({gbt_data}, 1) ; a global for a single version !rec=gbt ; fill !rec with initialiazed data ; ; !b[0] -- working buffer: everything invokes what is in here ; !b[1] -- BMODEL and GMODEL buffer ; !b[2] -- copy of !b[0] during BASE and GAUSS ; !b[3] -- ACCUM buffer ; !b[4] -- AVE buffer: copy of last AVE ; !b[5] -- ON buffer: copy of ON scan ; !b[6] -- OFF buffer: copy of OFF scan ; !b[7] -- PSW buffer: copy of (ON-OFF)/OFF ; !b[8] -- SMOOTH buffer: copy of data before any smoothing operation ; GAUSS: difference between DATA - GMODEL ; !b[9] -- SHOW buffer: copy of latest SHOW ; !b[10] -- ; ... Unused at present for procedures. Scratch buffers. ; !b[15] ; ; defsysv, '!gbt', replicate({gbt_data},kount) -- eventually will probably want ; to define the database here ; but recall that neither size nor type of sysvar can be changed... ; so may have to make this REALLY big and fill as data arrive... ; ; initialize boolean switches -- CAPITAL letters are procedure names that ; toggle the state of these switches ; defsysv, '!LINE', 1 ; spectral LINE mode on LINE=1 CONT=0 ; defsysv, '!chan', 1 ; default x-axis CHAN <== these 5 choices are defsysv, '!freq', 0 ; x-axis FREQ <== mutually exclusive defsysv, '!velo', 0 ; x-axis VELOcity <== choose via: defsysv, '!azxx', 0 ; x-axis AZimuth <== VELO, CHAN, FREQ, defsysv, '!elxx', 0 ; x-axis ELevation <== AZXX, ELXX, defsysv, '!raxx', 0 ; x-axis RA <== RAXX, DECX defsysv, '!decx', 0 ; x-axis DEC <== ; defsysv, '!cursor', 1 ; default cursor on CURON/CUROFF defsysv, '!zline', 0 ; default zero line off ZLON/ZLOFF defsysv, '!dcsub', 0 ; default DC level subtract off DCON/DCOFF defsysv, '!srcvl', 0 ; default source velocity flag off SRCVLON/SRCVLOFF defsysv, '!plthdr', 1 ; default plot header defsysv, '!bmark', 1 ; default plot nregions NRON/NROFF defsysv, '!flag', 0 ; default flag off; used in ccc.pro + else FLAGON/FLAGOFF defsysv, '!verbose', 0 ; default flag off; toggles procedure debug prints defsysv, '!protectns', 1 ; default flag on; protects NSAVE overwrites NSON/NSOFF defsysv, '!deja_vu', 1 ; default flag on; toggles writes in various procedures defsysv, '!ONLINE', 1 ; default ONLINE flag; toggles ON/OFFLINE data search ; vis ONLINE=1 or OFFLINE=0 commands ; ; initialize source search variables ; defsysv, '!src', '*' & defsysv, '!id', '*' & defsysv, '!typ', '*' & defsysv, '!scan', '*' & defsysv, '!pol', '*' & defsysv, '!recmin', 0L & defsysv, '!recmax', 0L & ; rec search range defsysv, '!scanmin', 0L & defsysv, '!scanmax', 0L & ; scan search range defsysv, '!last_scan', 0L ; last scan number in datafile defsysv, '!recs_per_scan', 16L ; number of subcorrelators per scan# ; initialized for 3He correlator configuration ; ; averaging and calibration variables ; defsysv, '!this_epoch', bytarr(4) ; observing epoch format mmyy defsysv, '!epoch', bytarr(4) ; epoch of data defsysv, '!data_type', bytarr(4) ; data type Dnn, EPAV, GAV, etc defsysv, '!begin_day_scan', 0 ; first scan of the day defsysv, '!end_day_scan', 99999 ; last scan of the day defsysv, '!lastns', 0 ; last nsave used defsysv, '!obs_config',bytarr(32) ; observing config ;===================================================================== !this_epoch=byte('JN04') & !epoch=byte(' ') & !data_type=byte(' ') & !obs_config[0:6]=byte('linepn2') ; ; initialize variables ; defsysv, '!tsys', 0.0d & defsysv, '!time', 0.0d & defsysv, '!aaccum', 0L & defsysv, '!accum', dblarr(2000) & ; vars for averaging defsysv, '!wtd', 0.0d & defsysv, '!sumwtd', 0.00d & ; weight for data defsysv, '!wts', 0.0d & defsysv, '!sumwts', 0.00d & ; weight for Tsys defsysv, '!nrset', 0L & defsysv, '!nregion', lonarr(100) & ; nregions for masking defsysv, '!acount', 1L & defsysv, '!astack', lonarr(2000) & ; stack for filtering defsysv, '!nfit', 1 ; order of polynomial to fit to baseline defsysv, '!ngauss_max', 10 ; total number of gaussians allowed for one fit defsysv, '!a_gauss', fltarr(!ngauss_max*3) ; parameters of these gaussians defsysv, '!ngauss', 1 ; number of Gaussians to fit to spectrum; defsysv, '!bgauss', 0L defsysv, '!egauss', !data_points-1 ; begin/end X-axis for Gaussfit defsysv, '!fact', 1.000 ; scaling factor for spectral intensities defsysv, '!y_offset', 0.000 ; y_offset for spectra defsysv, '!max_no_smooth_chans', 500L ; maximum number of smoothing channels defsysv, '!smgwt', fltarr(!max_no_smooth_chans) ; weights of smoothing channels ; defsysv, '!gauss_x', dblarr(5000) ; gaussian fit array defsysv, '!gauss_y', dblarr(5000) defsysv, '!xval_per_chan', 0.d ; x-axis value range per channel defsysv, '!last_x', dblarr(2) ; last x-axis range set defsysv, '!last_y', dblarr(2) ; last y-axis range set ; ; continuum variables ; ;defsysv, '!azim', 1 ; x-axis is AZIMUTH in degrees ;defsysv, '!elev', 0 ; x-axis is ELEVATION in degrees defsysv, '!c_pts', 599 ; number of data points in continuum scan defsysv, '!x_az', fltarr(!c_pts) ; azimuth values array defsysv, '!x_el', fltarr(!c_pts) ; elevation values array defsysv, '!x_ra', fltarr(!c_pts) ; R.A. values array defsysv, '!x_dec', fltarr(!c_pts) ; Dec. values array ; ; Hardwire PLOT stuff ; using normalized units ;set_viewport,.1,.9,.15,.75 ; define plot region within the window ; ; set_viewpoint is obsolete ; !p.position=[xmin,ymin,xmax,ymax] !p.position=[0.13,0.15,0.93,0.80] !x.title='CHANNELS' & !y.title='Antenna Temperature (K)' & !x.charsize=2.0 & !y.charsize=2.0 & !x.thick=2.0 & !y.thick=2.0 & !x.range=[200,3800] defsysv, '!xchan', indgen(!data_points) ; global x channel axis defsysv, '!xx', fltarr(!data_points) ; global x data array in current x-axis units ; print print,'GBT_IDL loaded from directory= '+getenv('PWD') print $'pwd' print