[Previous]
[Next]
NAME:
SAVECOMMON
PURPOSE:
CATEGORY:
BATSE
CALLING SEQUENCE:
CALLS:
none
INPUTS:
none explicit, only through commons;
OPTIONAL INPUTS:
none
OUTPUTS:
none explicit, only through commons;
OPTIONAL OUTPUTS:
none
KEYWORDS:
none
COMMON BLOCKS:
none
SIDE EFFECTS:
none
RESTRICTIONS:
none
PROCEDURE:
none
MODIFICATION HISTORY:
[Previous]
[Next]
NAME:
SC_SECONDS_ED
PURPOSE:
This function converts the BATSE experiment time format into our
SDAC standard, seconds from 1-Jan-1979 00:00:00.
CATEGORY:
BATSE
CALLING SEQUENCE:
Result = SC_SECONDS_ED( Sc_time )
CALLS:
none
INPUTS:
none explicit, only through commons;
OPTIONAL INPUTS:
Sc_time: BATSE time in spacecraft format intarr(3xN)
where N is the number of time bins.
OUTPUTS:
The Result of the function is the time in our standard format of
seconds from 1-jan-1979 (See ANYTIM.PRO)
OPTIONAL OUTPUTS:
none
KEYWORDS:
NO_OFFSET- If this is set, then the packet offset is
not subtracted from the time. Use this keyword for times
derived from auxiliary times for datatypes like SHER, MER, SHERB and STTE.
DO NOT SET THIS FOR DISCLA OR DISCSC.
CALLED BY:
ASCII_RAW, BATSE_POINTING, BAT_MERGE, EVAL_SHERB, FIND_PACKET, FS_READ_DD
MERGE_DISCSP_HKG_OCC, PROCESS_SLLD_DBASE, QLARCHIVE, QL_READBDB, READ_BATSE_DD
READ_CONT, READ_CONT_FITS, READ_DISCLA_FITS, READ_DISCSC, READ_DISCSP
READ_DISCSP_FITS, READ_MER, READ_OCC_DISCSP, READ_SHER, READ_SHERB, READ_STTE, T_TTS
WRITE_DD, WRITE_FDB, read_dd, xzchange
COMMON BLOCKS:
none
SIDE EFFECTS:
none
RESTRICTIONS:
none
PROCEDURE:
Uses the algorithm developed by Mark Finger at MSFC.
MODIFICATION HISTORY:
Modified to return seconds since 79/1/1 Shelby Kennard 10Jan1991
Modified by K. Tolbert 11/22/92 to subtract 2.048 s from times because
we misunderstood that the time in the packet was the time at the end
of the accumulation of the packet.
Modified by K. Tolbert 7/2/92 to subtract 2.042142 for times before
92/6/25,1055 to correct for error in s/c clock. At 1055 on 92/6/25,
the s/c clock was set earlier by this amount. We are handling this
change only in software. The BDB and FDB files before 92/6/25 are not
being changed. The flare catalog was changed (2.xx s subtracted from
all times, the .events files were remade, and the archive flare plot
files were remade.
Modified by K. Tolbert 9-mar-94. Added no_offset keyword
RAS, 22-apr-1996, cleaned documentation header
[Previous]
[Next]
NAME:
SCAL_FCTR
PURPOSE:
Calculate scaling factors for the 8 quicklook light curves. Scaling should
place each curve near the center of a separate decade of the logscale y-axis.
CATEGORY:
BATSE
CALLING SEQUENCE:
scal_fctr, array, ndx
CALLS:
none
INPUTS:
array- output y-values used in ql orbital plots
ndx- number of elements along x axis -1
OPTIONAL INPUTS:
none
OUTPUTS:
none explicit, only through commons;
OPTIONAL OUTPUTS:
none
KEYWORDS:
none
CALLED BY:
QL_ORBIT_PLOT
COMMON BLOCKS:
none
SIDE EFFECTS:
none
RESTRICTIONS:
none
PROCEDURE:
none
MODIFICATION HISTORY:
Shelby Kennard 1Feb1991
Changed scaling: Subtract 200 less than the minimum of each array from
the entire array, then scale so that the new minimum (which will always
equal 200) will be plotted at 2*10^n where n is 8 for top trace, 0 for
bottom trace (so power for top trace is 6, 200*10^6 = 2*10^8) AKT 4/25/91
Apply this to the array here, instead of just returning the scale factors.
Changed again, 4/28/91 by AKT. Top four traces done the way they were
done originally - median scaled to 2*10^(8-itrace)
Bottom four traces done in method implemented 4/25/91
Changed again, 4/28/91 by AKT. All traces done the way they were
done originally - median scaled to 2*10^(8-itrace)
Sum of sunward LADs now done by subtracting 4000 from non-zero elements
and scaling the minimum to 2*10^4.
[Previous]
[Next]
PROJECT:
SDAC
NAME:
SELECT_DEV
PURPOSE: Provides interface for operator to select screen and printer
devices. Only for use with programs that use the
set_graphics routine.
CATEGORY:
CGRO/BATSE, GEN, GRAPHICS
CALLS: ***
SET_GRAPHICS [1], SET_GRAPHICS [2], STR_SEP, XDEVICE
CALLED BY
FLDISPLAY, FSPLOT, QLDISPLAY, batse_menu
[Previous]
[Next]
Name:
SET_PENDLETON
PURPOSE:
use the Pendleton edges for BATSE CONT data channels
CATEGORY:
BATSE
CALLING SEQUENCE: set_pendleton or set_pendleton, 0 to reset
INPUTS:
x -
O means use Lestrade edges,
1 use Pendleton Edges.,
2 use Lestrade with Preece modification. New default 23-jul-1997.
OPTIONAL INPUTS:
OUTPUTS:
OPTIONAL OUTPUTS:
CALLED BY:
FS_SUBTITLE, GET_PENDLETON, MAP_DISCLA2CONT, MERGE_BATSE, MK_MER_CONT, OCC_AVG
read_batse_4_spex [1], read_batse_4_spex [2]
PROCEDURE:
CALLS: ***
FCHECK
COMMON BLOCKS:
cont_edges_com
RESTRICTIONS:
MODIFICATION HISTORY:
Version 1, ras, 14-mar-1995
Version 2, richard.schwartz@gsfc.nasa.gov, 23-jul-1997
[Previous]
[Next]
NAME:
SETUP_ARRAYS
PURPOSE:
CATEGORY:
BATSE
CALLING SEQUENCE:
CALLS: ***
CHECKVAR [1], checkvar [2]
INPUTS:
none explicit, only through commons;
OPTIONAL INPUTS:
none
OUTPUTS:
none explicit, only through commons;
OPTIONAL OUTPUTS:
none
KEYWORDS:
none
COMMON BLOCKS:
none
SIDE EFFECTS:
none
RESTRICTIONS:
none
PROCEDURE:
none
MODIFICATION HISTORY:
[Previous]
[Next]
NAME:
SETUP_BATSE
PURPOSE:
To initialize and extend accumulation arrays in batse_menu as needed by type.
CATEGORY:
CGRO/BATSE
CALLING SEQUENCE:
SETUP_BATSE, Dd_open, End_time
CALLED BY:
CALLS: ***
CHECKVAR [1], FCHECK, SETUP_BATSE_ARRAYS, checkvar [2]
INPUTS:
Dd_open - Structure with info on file to be read. See FS_OPEN.pro for details.
End_time- Explicit end time for data set to be read. ANYTIM formats.
OPTIONAL INPUTS:
none
OUTPUTS:
none explicit, only through commons;
OPTIONAL OUTPUTS:
none
CALLED BY:
FS_READ_DD
COMMON BLOCKS:
fs_saveaccum
SIDE EFFECTS:
none
RESTRICTIONS:
none
PROCEDURE:
Examines datafile to be read into accumulation arrays and extends them in
blocks for the needed type by making the needed calls to SETUP_ARRAYS.
MODIFICATION HISTORY: ras, 16-oct-94
Version 2, ras, 27-March-1996, explicit memory management
Version 3, eva, 17-August-1999, Extended default value of ntimes as this leads to
more memory in arrays (else crashes sometimes).
[Previous]
[Next]
NAME:
SETUP_BATSE_ARRAYS
PURPOSE:
To initialize and extend accumulation arrays in batse_menu as needed by type.
CATEGORY:
CGRO/BATSE
CALLING SEQUENCE:
SETUP_BATSE_ARRAYS, NTIMES_IN=NTIMES_IN, NADD=NADD, EXT_DISCLA=EXT_DISCLA,$
EXT_CONT=EXT_CONT, EXT_DISCSP=EXT_DISCSP
CALLED BY:
SETUP_BATSE
CALLS: ***
CHECKVAR [1], FCHECK, checkvar [2]
INPUTS:
KEYWORDS:
NTIMES_IN - minimum size to initialize arrays to. Units of number of seconds for DISCLA
1 every 1.024 seconds, or 2 per packet
NADD - size to extend accumulation arrays. Same units as NTIMES_IN
EXT_DISCLA- if set, extend DISCLA arrays
EXT_CONT - if set, extend CONT arrays
EXT_DISCSP- if set, extend DISCSP arrays
OPTIONAL INPUTS:
none
OUTPUTS:
none explicit, only through commons;
OPTIONAL OUTPUTS:
none
CALLED BY:
HKG_DBASE, PLOTBATSE_QL, READ_HKG_CAL, SETUP_BATSE
COMMON BLOCKS:
fs_saveaccum
SIDE EFFECTS:
none
RESTRICTIONS:
none
PROCEDURE:
Extends accumulation arrays by concatenation.
MODIFICATION HISTORY:
Derived from SETUP_ARRAYS written by AKT
Version 1, ras, 27-March-1996, explicit memory management
[Previous]
[Next]
Name:
SETUP_DRM
PURPOSE: Find a set of BATSE DRM's at various positive angles, suitable for interpolation.
Save the set of chosen drm's to a file on perm_data. To be used by
Build_drm.pro. Designed to create separate files for SPEC low energy matrices,
3 keV-10 MeV and high energy matrices, 3 keV-30 MeV, and LAD low and high energy
matrices.
CATEGORY: Spectral fitting
BATSE
CALLING SEQUENCE: pro setup_drm, det_type=det_type, ebound=ebound, below=below, $
tdrm=tdrm, cosines=cosines, e_in=e_in, e_out=e_out, area=area, $
filenames=filenames, savename=savename
INPUTS:
det_type - 'lad' or 'spec'
below - if set, then choose matrices with energy range below EBOUND else
choose drm's above EBOUND
ebound - an energy in keV compared with upper limit of drm input range
OPTIONAL outputs:
tdrm - matrices used for interpolation, corresponding to cosines
For a description of drm parameters see Read_bdas_drm.pro
cosines - cosine of Sun/detector angle for drm's in increasing order
filenames- drms files used for interpolation
e_in - input energies for drm
e_out - output energies for drm
area - normal detector area, cm2
savename - name of save file on perm_data
CALLS: ***
ARR2STR [1], Arr2Str [2], BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3]
CHECKVAR [1], CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], DET_COSINES
POINT [1], READ_BDAS_DRM, STR2ARR [1], STR2ARR [2], break_file [4], checkvar [2]
concat_dir [4], linecolors [1], linecolors [2], point [2]
SIDE EFFECTS: Causes save file to be written to SSWDB_BATSE
ROUTINE IS NO LONGER SUPPORTED, OBSOLETE. RAS, 25-JUL-1997
MODIFICATION HISTORY: ras, 2-feb-94
RAS, 25-Jul-1997, changed PERM_DATA to SSWDB_BATSE, ROUTINE IS NOT-SUPPORTED
[Previous]
[Next]
NAME:
SHER_COR_STR
PURPOSE:
CATEGORY:
BATSE
CALLING SEQUENCE:
CALLS:
none
INPUTS:
none explicit, only through commons;
OPTIONAL INPUTS:
none
OUTPUTS:
none explicit, only through commons;
OPTIONAL OUTPUTS:
none
KEYWORDS:
none
COMMON BLOCKS:
none
SIDE EFFECTS:
none
RESTRICTIONS:
none
PROCEDURE:
none
MODIFICATION HISTORY:
[Previous]
[Next]
NAME:
SHER_STR
PURPOSE:
CATEGORY:
BATSE
CALLING SEQUENCE:
CALLS:
none
INPUTS:
none explicit, only through commons;
OPTIONAL INPUTS:
none
OUTPUTS:
none explicit, only through commons;
OPTIONAL OUTPUTS:
none
KEYWORDS:
none
COMMON BLOCKS:
none
SIDE EFFECTS:
none
RESTRICTIONS:
none
PROCEDURE:
none
MODIFICATION HISTORY:
[Previous]
[Next]
PROJECT:
SDAC
NAME:
Shers_load
PURPOSE:
Read SHER (and SHERB files), or (HER, HERB) with calibrated
energy scale,
correct for overflow
CATEGORY:
BATSE,SPEX
CALLING SEQUENCE:
SHERS_LOAD, DET_ID=DET_ID, NSHER=NSHER, AREA=AREA, EVEC=EVEC,XVEC=XVEC,$
DELTA_LIGHT=DELTA_LIGHT, N511=N511, COS_SPEC=COS_SPEC, $
SHER_FILE=SHER_FILE, SHERB_FILE = SHERB_FILE, TIMERANGE=TIMERANGE,$
SECONDS=SECONDS, DSEL=DSEL, AUTO=AUTO, NOPLOT=NOPLOT
INPUTS:
det_id - BATSE SPEC detector id (0-7)
sher_file - sher filename
sherb_file - sherb filename
cos_spec - detector cosines for SPECs
timerange - optional, start and end over which to read sher
or if 1 element, take up to two hours before and after
NO CALIBRATION ACTION TAKEN ON LAD (ras 10-feb-94)
auto - if set, no interaction for calibration
noplot - if set and auto is set, no plotting during calibration
OUTPUTS:
nsher - counts (256xnbins), longwords (128 for HER)
area - 127. cm2 (2025 for HER)
evec - energy edges(keV) (2x256) (2X128 for HER)
xvec - linear channel edges (2x256) (2X128 for HER)
seconds - start and end time of each interval, utime format, (2xnbins)
dsel - if sherb read, returns the 4 ids of the burst selected SPECs
delta_light - channel widths in keV in pulse-height units- see cal_sher and calibrate
n511 - channel number of 511 line used in calibrate
ltime - interval livetimes in seconds (256xnbins)
COMMONS;
COMMON SHERS_LOAD, OLD
Old is a structure with NSHER, EVEC, DELTA_LIGHT w/o merging DISCSP
CALLS: ***
AVG [1], AVG [2], BATSE_DEADTM, BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3]
BURST_FLARE, CALIBRATE [1], CALIBRATE [2], CAL_SHER, CHANNEL, CHECKVAR [1]
CHKLOG [1], CHKLOG [2], CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], EXIST
FCHECK, FIX_DISCSP2, F_DIV, GET_DISCSP_FILE, GET_SLLD, INTERP2INTEG, JUMPER_SHER
LAD_PHA_EDGES, MELD_DISCSP [1], MELD_DISCSP [2], MINMAX [1], MINMAX [2]
READ_DISCSP, READ_SHER, READ_SHERB, READ_STTE, REVERSE, anytim [1], anytim [2]
anytim [3], anytim [4], anytim [5], break_file [4], checkvar [2], concat_dir [4]
edge_products, printx [1], printx [2]
CALLED BY:
Load_sher, read_batse_4_spex [1], read_batse_4_spex [2]
MODIFICATION HISTORY:
ras, 2-Dec-93
ras, 21-sep-95, if no sherb_file, load the whole sher_file, add n511
ras, 18-oct-95, clear away unused sherb intervals for sher_cor files.
ras, 28-mar-1996, integrated discsp and stte
ras, 8-nov-1996, added OLD structure in common block
Version 6, ras, 11-apr-1997, ensure that wvec enters jumper_sher
Version 7, ras, 31-may-1997, fixed bad bug in her,herb livetime calculation.
Version 8, ras, 30-sep-1997, use lad_pha_edges for HER edge calculation.
Makes these edges compliant with Preece modification of Lestrade calibration.
Version 9, richard.schwartz@gsfc.nasa.gov, 19-feb-1998, protect against
gaps in discsp causing errors.
[Previous]
[Next]
NAME:
Shers_load
PURPOSE:
Read SHER (and SHERB files), or (HER, HERB) with calibrated
energy scale,
correct for overflow
CATEGORY:
BATSE,SPEX
CALLING SEQUENCE:
SHERS_LOAD, DET_ID=DET_ID, NSHER=NSHER, AREA=AREA, EVEC=EVEC,XVEC=XVEC,$
DELTA_LIGHT=DELTA_LIGHT, N511=N511, COS_SPEC=COS_SPEC, $
SHER_FILE=SHER_FILE, SHERB_FILE = SHERB_FILE, TIMERANGE=TIMERANGE,$
SECONDS=SECONDS, DSEL=DSEL, AUTO=AUTO, NOPLOT=NOPLOT
INPUTS:
det_id - BATSE SPEC detector id (0-7)
sher_file - sher filename
sherb_file - sherb filename
cos_spec - detector cosines for SPECs
timerange - optional, start and end over which to read sher
or if 1 element, take up to two hours before and after
NO CALIBRATION ACTION TAKEN ON LAD (ras 10-feb-94)
discsp_file - If given, use this file for merging
auto - if set, no interaction for calibration
noplot - if set and auto is set, no plotting during calibration
OUTPUTS:
nsher - counts (256xnbins), longwords (128 for HER)
area - 127. cm2 (2025 for HER)
evec - energy edges(keV) (2x256) (2X128 for HER)
xvec - linear channel edges (2x256) (2X128 for HER)
seconds - start and end time of each interval, utime format, (2xnbins)
dsel - if sherb read, returns the 4 ids of the burst selected SPECs
delta_light - channel widths in keV in pulse-height units- see cal_sher and calibrate
n511 - channel number of 511 line used in calibrate
ltime - interval livetimes in seconds (256xnbins)
CALLED BY:
Load_sher, read_batse_4_spex [1], read_batse_4_spex [2]
MODIFICATION HISTORY:
ras, 2-Dec-93
ras, 21-sep-95, if no sherb_file, load the whole sher_file, add n511
ras, 18-oct-95, clear away unused sherb intervals for sher_cor files.
ras, 28-mar-1996, integrated discsp and stte
[Previous]
[Next]
NAME:
SHOW_FLARE
PURPOSE:
CATEGORY:
BATSE
CALLING SEQUENCE:
CALLS: ***
DRAW_FLARE, FLARE_SELECT, batse_read_cat
INPUTS:
none explicit, only through commons;
OPTIONAL INPUTS:
none
OUTPUTS:
none explicit, only through commons;
OPTIONAL OUTPUTS:
none
KEYWORDS:
none
CALLED BY:
FSPLOT, FS_GRAPH
COMMON BLOCKS:
none
SIDE EFFECTS:
none
RESTRICTIONS:
none
PROCEDURE:
none
MODIFICATION HISTORY:
97/10/09 AES added gif keyword
[Previous]
[Next]
NAME:
SLED
PURPOSE:
Subroutine to calculate the SLED correction.
CATEGORY:
BATSE
CALLING SEQUENCE:
sled,ndet,slope,xvec,olight
CALLS: ***
CHECKVAR [1], FCHECK, checkvar [2]
INPUTS:
c ndet--detector number
c slope--the linear term (b) in the calibration equation
c xvec--vector of uncompressed channel boundaries
c olight--vector of light output for each channel
OPTIONAL INPUTS:
none
OUTPUTS:
c Output:
c olight--vector of light output adjusted for the SLED
none explicit, only through commons;
OPTIONAL OUTPUTS:
none
KEYWORDS:
INHIBIT - if set then olight isn't modified on subsequent calls to SLED.
used alone, e.g. sled,INHIBIT=1 and sled, INHIBIT=0
CALLED BY:
CALIBRATE [1], TEST_CAL
COMMON BLOCKS:
common sled_com, sb,sc,sd,scut
common sled_test_com, test, sbt, sct, sdt, scutt, inhibit_hold
SIDE EFFECTS:
none
RESTRICTIONS:
none
PROCEDURE:
The correction is an adjustment to the light output in the linear term of the calibration
equation.
MODIFICATION HISTORY:
c written 11/8/91 last modified 12/6/91 LAF
c converted to IDL by RAS 92/6/3
modified, ras, 8-dec-95, inhibit keyword added
Version 4, ras, 7-jun-1996, documentation modified
[Previous]
[Next]
NAME:
SPEC_SENSITIVITY
PURPOSE:
Given the time and the direction cosines to the Sun, this procedure determines
which BATSE SPEC detector DISCSP1 is the most sensitive based on the zenith angle
and the discsp_edges. DISCSP1 is the lowest discriminator channel.
CATEGORY:
BATSE
CALLING SEQUENCE:
order = SPEC_SENSITIVITY( UT, SPEC_COSINES)
CALLS: ***
DISCSP_EDGES, FCHECK, INTERPOL, REVERSE
INPUTS:
UT - time in anytim format
SPEC_COSINES - 8 zenith angle cosines to Sun
OPTIONAL INPUTS:
none
OUTPUTS:
The result is the sensitivity order of the 8 detector ids.
OPTIONAL OUTPUTS:
none
KEYWORDS:
DEDGES- If this keyword is used to input the discsp_edges, then
ut is ignored although mandatory.
PL2 - if set use the table calculated for a power-law of 2 otherwise 5
ORDER2- Returns the sensitivity order of DISCSP2
CALLED BY:
DET_COSINES, read_batse_4_spex [1], read_batse_4_spex [2]
COMMON BLOCKS:
none
SIDE EFFECTS:
none
RESTRICTIONS:
none
PROCEDURE:
Using a table of energy edges and zenith angle the DISCSP1 response
is interpolated for a power-law of 5 for the sunward detectors. The
higher the response the higher the sensitivity. For the antisunward
detectors, the sensitivity is based solely on the lowest DISCSP1 low
edge which only marginally true.
MODIFICATION HISTORY:
ras, 17-oct-1996
ras, 30-oct-1996
[Previous]
[Next]
NAME:
SUN_EARTH_SC
PURPOSE:
This function computes the angle between the Sun-Earth and Earth-GRO
vectors.
CATEGORY:
CGRO/BATSE
CALLING SEQUENCE:
ANGLE_IN_DEGREES = SUN_EARTH_SC( Sc, Ut)
CALLS: ***
SOLEPHUT, SPHCART
INPUTS:
Sc- spacecraft vector in earth-centered inertial coordinates x,y,z .25 km units
fltarr(N x 3)
Ut- time vector anytim.pro format
OUTPUTS:
Returns the angle in degrees.
CALLED BY:
OCCTIME
PROCEDURE:
MODIFICATION HISTORY:
Written by: Version 2 ras 29-mar-1996, documented, changed to sunpos
Version 2, RAS, fixed inradec calculation