[Previous]
[Next]
NAME:
BACKG_MARK
PURPOSE:
Prompt operator to mark first background interval. Next, prompt to mark
second background interval or to type 'Q' to finish with only one interval
specified.
CATEGORY:
BATSE
CALLING SEQUENCE:
backg_mark,b_start,b_end,bnum,abort
CALLS: ***
DATATYPE [1], DATATYPE [2], DATATYPE [3], POINT [1], VERT_LINE, point [2]
INPUTS:
none explicit, only through commons;
OPTIONAL INPUTS:
none
OUTPUTS:
b_start: start times of 1 or 2 background intervals
b_end: end times of 1 or 2 background intervals
bnum: 1 or 2, number of background intervals selected
abort: if set, then no background is selected
OPTIONAL OUTPUTS:
none
KEYWORDS:
none
CALLED BY:
FS_AUTO_LOG
COMMON BLOCKS:
none
SIDE EFFECTS:
none
RESTRICTIONS:
none
PROCEDURE:
none
MODIFICATION HISTORY:
Shelby Kennard 1Mar1991
Version 2, RAS, 8 Aug 1996 to work with X windows cursors!
[Previous]
[Next]
PROJECT:
SDAC
NAME:
BAT_MERGE
PURPOSE:
Merge the file DISCLA_DATA.DAT with the file HKG_DATA.DAT to create the
file YYMMDD.BDB (YYMMDD being the date in the first record of the file
DISCLA_DATA.DAT).
CATEGORY:
BATSE, I/0
CALLING SEQUENCE:
CALLS: ***
CHECKVAR [1], CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], COPY_STRUCT [1]
COPY_STRUCT [2], COPY_STRUCT [3], FCHECK, FIND_PACKET, FS_OPEN [1], FS_OPEN [2]
LOC_FILE [1], LOC_FILE [2], LOC_FILE [3], PARSE_ATIME [1], SC_SECONDS_ED
SIZE_STRUCT, USE_VAX_FLOAT, checkvar [2], concat_dir [4], parse_atime [2]
INPUTS:
OPTIONAL INPUTS:
OUTPUTS:
BDBFILE - name of output BDB file merged DISCLA and HKG data, YYMMDD.BDB
OPTIONAL OUTPUTS:
none
KEYWORD INPUTS:
TJD: If given, it is used to construct the names of the discla_data.dat
file, i.e. for tjd 10729 discla_file is given by discla_10729.dat
DISCLA_FILE: Input MSFC DISCLA_DATA.DAT
HKG_FILE: Input MSFC HKG_DATA.DAT file
HKGDIR: Data directory for HKG file, default is BATSE_MSFC_HKG.
DISCLADIR: Data directory for DISCLA file, default is BATSE_MSFC_DISCLA.
BDBDIR: Data directory in which to write BDB file, default is BATSE_BDB.
COMMON BLOCKS:
none
SIDE EFFECTS:
none
RESTRICTIONS:
Written for use on VMS.
PROCEDURE:
The two input data files are opened and read record by record and written
into an output structure with the desired tags from both records. Each
structure is written into the output file as it is filled.
MODIFICATION HISTORY:
Modified by AKT to handle 1 kbps data from the omni-directional antennas.
Added eng_telem word to input discla structure and ouput mrgbdb structure.
Since parity errors in the s/c position data could cause a hskpng record
to be skipped (but not the discla record), put in a check for unequal packet
counters, and if unequal, keep reading data from the file with the low
counter until reach the other counter.
Mod. AKT 10/20/93. Included the short version of the structures rather
than @ing a file. Unit numbers were 1,2,3, changed to use get_lun.
Modified by Amy Skowronek 94/08/17. Uses concat_dir to translate
directory names format of user's file system (VMS or UNIX)
Mod. AES 12/19/94 Added a check against the housekeeping file ending
before the discla data file. If hkg file ends early, use previous
value of discla.sctime for ending time of file.
Mod. AES 12/19/94 Added a check against the housekeeping file ending
Shelby Kennard 31Dec1990
Modified by AKT to handle 1 kbps data from the omni-directional antennas.
Mod. AKT 10/20/93. Included the short version of the structures rather
Modified by Amy Skowronek 94/08/17. Uses concat_dir to translate
Mod. AES 12/19/94 Added a check against the housekeeping file ending
Version 10, richard.schwartz@gsfc.nasa.gov-
used fs_open to find number of input data records, compare
number of data records with running sum to find end of input streams.
write output as stream files.
Version 11, richard.schwartz@gsfc.nasa.gov, convert floating point quantities to VAX
format in written file definition record by using <use_vax_float( arg, /new2old).
24-jun-1998.
[Previous]
[Next]
Project : SDAC
Name : BATSE_CRAB_RESP
Purpose : This provides a rapid tool for calculating the count rate due
to the Crab in the BATSE SPEC and LAD detectors. Useful for
reconciling occultation analyses of the Crab.
Category : BATSE, OCCULTATIONS
Explanation : The count rates are obtained by bi-grid interpolation on
tables produced used DISCSP_RESP and LAD_RESP. They can't be
any more accurate than the response matrices used in those procedures.
The model of the Crab flux is obtained from HEAO A-4 measurements published
by Jung et al.
Use : Result = BATSE_CRAB_RESP( Edges, Theta )
Inputs :
Edges - a 2xN set of energies in keV > 3 keV for SPEC > 10 keV for LAD
Theta - a scalar angle or vector (N elements) in degrees beteen Crab and detector normal
Opt. Inputs : None
Outputs : Returns the result as a vector, N elements, in Counts/second.
Opt. Outputs: None
Keywords :
DET_TYPE - Default is 'SPEC' but may be changed by setting to 'LAD'
Calls : ***
FCHECK, LOC_FILE [1], LOC_FILE [2], LOC_FILE [3]
CALLED BY:
OCC_AVG
Common : None
Restrictions:
File crab_table.sav must exist on SSWDB_BATSE
Side effects: None.
Prev. Hist :
Modified :
Version 1, RAS, 10-Dec-1996
RAS, 7-Jul-1997, changed PERM_DATA to SSWDB_BATSE
[Previous]
[Next]
Name:
batse_create_html
Procedure to create a hypertext file which can be displayed by Mosaic (shows
flare #, start/end time, and peak rate). User can click on a flare to
see a PostScript time profile.
Kim Tolbert 2/94
Modified 12/13/94 Amy Skowronek - replaced Kim Tolbert's name as
listed contact.
10/2/95 AES - changed addresses to nascom domain
3/1/96 AES - get hxrbs password elsewhere
9/17/97 AES - reflect y2k changes, changes to anytim, changed
my address
1/12/98 AES - added links to pages for the year before and
the year after the one being created.
3/18/99 AES - removed aged reference to Mosaic from html.
CALLS:
[Previous]
[Next]
Name:
BATSE_DEADTM
PURPOSE: compute the livetime fraction as a function of count rate for
the BATSE PHA and discriminator data for a single detector.
CATEGORY: Data Reduction
BATSE
CALLING SEQUENCE: live_fraction = $
batse_deadtm(counts, channel_edges=channel_edges, delta_t=delta_t, $
pha_dead=pha_dead, amp_dead=amp_dead, $
high_rate=high_rate, gate=gate)
INPUTS:
Counts - Counts in each of N energy channels, (n x m), m samples
OPTIONAL INPUTS:
If the data type is not LAD CONT 16 channel or if the linear
edges are not the standard ones after 31-May-1991 then the
detector/type must be characterized by the optional inputs:
Channel_edges - Linear channel edges for k channels, (2 x k)
Delta_t - Accumulation interval in seconds
Pha_dead - Dead time in seconds for each linear PHA channel
Amp_dead - Dead time in seconds for each event.
high_rate - indices where high_rate branch is used in
relationship of observed counts vs true rate
gate - gate recovery time, nominally .68e-6 sec
Output:
Function returns the live-time fraction, between 0 and 1.
CALLS: ***
CHECKVAR [1], F_DIV, PARA_LIVETIME, checkvar [2]
CALLED BY:
FIX_CONT, FIX_CONT2, FIX_DISCSP, FIX_DISCSP2, LIVETIME [1], Shers_load [1]
read_batse_4_spex [1], read_batse_4_spex [2]
PROCEDURE: Assumes COUNTS vector is from CONT data type from LAD. Dead time
is computed by adding number of counts_channel* dead_time/linear_channel
+ dead_time/event. Other data types can be used if the linear
channel edges, integration duration, and pha_deadtime units are
provided.
*******************************************************************************
The deadtime equation is composed of two terms, one paralyzable and
one not. The paralyzable term comes from the analog gate relaxation time
of about .68 microseconds, and the non-paralyzable term comes from the
signal level processing time:
N = R *(1.- N* DPT) * exp(-R tau)
N is the measure rate in counts/s
R is the true rate in counts/s
DPT is the average event signal processing time
tau is the gate relaxation time
The livetime fraction is defined as N/R.
*******************************************************************************
MODIFICATION HISTORY:
4 Dec 1993 - Improved deadtime calculation, two terms
[Previous]
[Next]
NAME:
BATSE_FILE2TIME
PURPOSE:
This function constructs a time from the SDAC standard format file names.
i.e. yymmdd_hhmm.whatever for fdb, cont, discsp, yymmdd.bdb for bdb files.
CATEGORY:
BATSE
CALLING SEQUENCE:
CALLS: ***
BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], UTIME [1], UTIME [2]
break_file [4]
INPUTS:
BATSE archive database filename, e.g. 960513_2329.FDB_4574
OPTIONAL INPUTS:
none
OUTPUTS:
none explicit, only through commons;
OPTIONAL OUTPUTS:
none
KEYWORDS:
none
CALLED BY:
ASCII_RAW, READQUAL, goesdata
COMMON BLOCKS:
none
SIDE EFFECTS:
none
RESTRICTIONS:
none
PROCEDURE:
none
MODIFICATION HISTORY:
K Tolbert 13 Apr 1994
A Skowronek 3 June 1996 Made time a dblarr - utime puts out double
Version 3, RAS, changed from file2time re SSW conflict
RCJ 29 Sep. 1997 - 'underscore' -> 'underscore+1' to read time correctly.
[Previous]
[Next]
PROJECT:
SDAC
NAME: BATSE_FLARES_WEEK
PURPOSE: This procedure produces an updated graphic of flare activity.
CATEGORY: BATSE
CALLING SEQUENCE:
batse_flares_week, outfile [ NDAYS=NDAYS, KEYWORDS FOR UTPLOT]
CALLS: ***
BATSE_ON, BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], CHECKVAR [1], FCHECK
F_DIV, MINMAX [1], MINMAX [2], REVERSE, SPS, SYS2UT, UTPLOT [1], UTPLOT [2], UTPLOT [3]
UTPLOT [4], UTPLOT [5], UTPLOT [6], WRITE_GIF, XDEVICE, anytim [1], anytim [2]
anytim [3], anytim [4], anytim [5], batse_read_cat, break_file [4], checkvar [2]
linecolors [1], linecolors [2], strsplit
INPUTS:
none explicit, only through commons;
OPTIONAL KEYWORD INPUTS:
NDAYS - number of days (>1) for histogram bins.
TIMERANGE - Usual utplot meaning of time range.
OUTPUTS:
Outfile - file to write plot to. Default is gif. If postscript desired use ps
as the file extension. If no argument is given, plots to the xdevice.
OPTIONAL OUTPUTS:
none
COMMON BLOCKS:
none
SIDE EFFECTS:
RESTRICTIONS:
none
PROCEDURE:
An event histogram is created from the BATSE catalog and normalized by the ontime catalog.
The missing segment of the ontime catalog is filled from the end of the ontime catalog.
MODIFICATION HISTORY:
Version 1, richard.schwartz@gsfc.nasa.gov, formally integrated into the tree, 17-mar-1998
[Previous]
[Next]
Name:
BATSE_LAD_DRM
PURPOSE: build batse lad detector response matrix
CALLING SEQUENCE:
INPUTS:
edges_out - drm output channel edges (2xn) in keV
theta - zenith angle of source, theta is 0 degrees for a source on-axis
det_id- detector id, 0-7 for BATSE lad
OPTIONAL INPUTS:
high- if set include a higher density above an MeV on the input side
phtn_e- use this set of incident photon energies, 2xn, in keV
lld - lower-level discriminator (see DISCLA_EDGES) cutoff in keV.
OUTPUTS:
edges_in - photon intervals used for drm input
drm - detector response matrix
e_in - original database photon energies
OPTIONAL OUTPUTS:
CALLED BY:
BUILD_DRM, DISCSC_PL, GE_WINDOW [1], LAD_RESP
PROCEDURE:
CALLS: ***
DECOMPOSE_BATSE_DRM, FCHECK, F_DIV, F_RESP, INTERPOL, INT_TABULATED, MINMAX [1]
MINMAX [2], UNIQ [1], UNIQ [2], UNIQ [3], edge_products, printx [1], printx [2]
COMMON BLOCKS:
f_resp_com; RESTRICTIONS:
MODIFICATION HISTORY:
ras, 23-apr-95
version 2, ras 17 oct 1996, added phtn_e
Version 3, ras, 11-apr-1997, only integrate response over finite channel widths
Version 4, richard.schwartz@gsfc.nasa.gov, 8-feb-1998,
added lld cutoff keyword from build_drm.
richard.schwartz@gsfc.nasa.gov, 18-feb-1998, protect against NAN universally using
idl's finite function, not the woeful ssw routine.
[Previous]
[Next]
NAME:
BATSE_LOG_STRUCT
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:
BATSE_MATCH_SEQUENCE
PURPOSE:
This procedure recovers true time from integer scaled times by
matching consecutive sequences with the best from a complete
time sequence. Used for recreating time arrays in BATSE quicklook
daily files. These arrays were scaled from 1-20,000 into 2 byte
integers resulting in digitization errors up to a few seconds.
This procedure should eliminate almost all of these errors.
CATEGORY:
BATSE
CALLING SEQUENCE:
Batse_match_sequence, xrange, sec [, midnights, SCALE=SCALE]
CALLS: ***
AVG [1], AVG [2], CHECKVAR [1], INTERPOL, checkvar [2], edge_products
INPUTS:
Xrange - range on which times are scaled.
Sec - Scaled integer values of time on Xrange. This is returned
as a corrected array in double precision seconds. Sec is a fix array
which ranges from 0 to SCALE.
Midnights - for multiple orbit data written with qlarchive, the Midnights
vector must be supplied from the save file. The data were accumulated
in groups from (orbital) midnight to midnight.
OPTIONAL INPUTS:
none
OUTPUTS:
none explicit, only through commons;
OPTIONAL OUTPUTS:
none
KEYWORDS:
SCALE -Integer scaling factor. Default is 20,000. See quicklook procs.
ql_archive and compress_qlook.
ERROR - Time array restored has elements out of order. Using former
technique to recover,
COMMON BLOCKS:
none
SIDE EFFECTS:
none
RESTRICTIONS:
none
PROCEDURE:
A full time array is created using the start time found in Xrange. It is
converted to the compressed format and compared piecewise to the compressed
vector in the save file. Each continuous segment of the save file is
matched to one in the full time array and thus assigned a time at
full resolution.
MODIFICATION HISTORY:
Written by richard.schwartz@gsfc.nasa.gov, 29-aug-1997
[Previous]
[Next]
PROJECT:
SDAC
NAME:
batse_menu
PURPOSE:
batse_menu provides a menu for getting at the batse flare catalog and
fdb and bdb data files. On entry, it automatically enters the flist program
and lists any flares identified in the most recent 24 hours. This it
displays a menu of the options available.
INPUT:
opt - menu option you wish to reach without going through the menu
for or 0- select screen and printer formats
cat or 1- display flare catalog entries
qlo or 2- display archived quicklook orbital plots
fla or 3- display archived flare plots
plo or 4- run interactive plot
vie or 5- display solar viewing times
asc or 6- create ascii files
lis or 7- list menu
gen or 8- access general help
hql or 9- access quicklook help
hfl or 10- access flare plot help
hca or 11- access catalog help
ann or 12- access old announcements
qui or 13- quit batse_menu
CATEGORY:
BATSE
KEYWORDS:
nosave - if nosave is set, system variables are not restored to
their values from before when batse_menu is run.
COMMON BLOCKS
TEK_COMMON, FLISTCOM2
CALLS: ***
ALPHA_PAGE [1], ALPHA_PAGE [2], ANNOUNCEMENTS, BATSE_ONTIMES, FLDISPLAY, FLIST
FSPLOT, LOC_FILE [1], LOC_FILE [2], LOC_FILE [3], MORE [1], MORE [2], Mailfile
PATH_DIR, QLDISPLAY, RATESDUMP, RAWDUMP, READ_SEQFILE, SELECT_DEV, SET_GRAPHICS [1]
SET_GRAPHICS [2], YOHKOH_FORMAT [1], YOHKOH_FORMAT [2], curdir [1], curdir [2]
hxrbs_format, yohkoh_format [3]
HISTORY:
Kim Tolbert 3/26/91
Mod. 8/9/94 by Amy Skowronek to accept a variable when starting up. This
enables the user to skip the menu and go directly to the option of choice.
When done with original option, user is directed to main menu.
Mod. 8/9/94 by AES to include concat_dir in calls to files with directory
designations, so as not to confuse UNIX.
Mod. 8/10/94 by AES to accept number instead of abbreviation for menu
option variable.
Mod. 8/15/94 by AES to record user's name, date of use, and host
Mod. 8/22/94 by AES to accept keyword nosave. nosave stops batse_menu
from reassigning to system variables the values they had before batse_menu
was run. to be used when, for instance, one wishes to overplot a BATSE plot
with a non-BATSE plot.
Mod. 8/23/94 by AES to use execute on the spawn to check the user's
node. If not enough virtual memory is available to complete the spawn,
error messages are printed and the routine proceeds.
Mod, 12/18/95, ras, checks system before attempting to write to userlog file
VERSION 9, richard.schwartz@gsfc.nasa.gov, 26-aug-1997,
used loc_file with path_dir('batse') to locate help files.
Version 10, eva@kano.nascom.nasa.gov, 13-May-1999.
Added keyword EXTEND in fsplot -- when set, will expand the time interval
that software searches through to find pointing info when event is omni
flare. Search changes from original 3x15 min intervals to 4x60min intervals.
[Previous]
[Next]
NAME:
BATSE_ON
PURPOSE:
This procedures reads the gap file, the day/night file, and the high voltage off
file and determines the percentage of observing time in user-specified
bins.
CATEGORY:
BATSE
CALLING SEQUENCE:
BATSE_ON, START=START, ENDT=ENDT, BINMIN=BINMIN, TIMES, $
ONFRACTION=ONFRACTION, /VERBOSE, OUTPRINT=OUTPRINT
CALLS: ***
AVG [1], AVG [2], CHECKVAR [1], FCHECK, PAGE_PRINT, READ_DNFILE, READ_GAPFILE
READ_HVFILE, UTIME [1], UTIME [2], anytim [1], anytim [2], anytim [3], anytim [4]
anytim [5], checkvar [2], uniqo [1], uniqo [2]
INPUTS:
Through keywords.
OUTPUTS:
Through keywords.
KEYWORD INPUTS:
START: (input) start time of first bin in ASCII format
yy/mm/dd,hhmm:ss.xxx
ENDT: (input) start time of first bin in ASCII format
yy/mm/dd,hhmm:ss.xxx
BINMIN: (input) number of minutes in each bin
VERBOSE: If set, then when the gap, high voltage, and day/night
files are read, a message will be printed giving the latest
time in those files.
OUTPRINT: 0/1/2 for info to be sent to terminal/printer/file
(only applies to viewing times mode (not onfraction mode))
KEYWORD OUTPUTS:
ONFRACTION: (output) fraction of binmin that BATSE was viewing Sun with power and telemetry
TIMES : Start Time in sec from 1-jan-1979 of bins for onfraction.
CALLED BY:
BATSE_FLARES_WEEK, BATSE_ONTIMES
COMMON BLOCKS:
Ontimes
PROCEDURE:
Example:
to get on-fraction for each day in March 1992, type
batse_on, astart='92/3/1,0', aend='92/4/1,0', binmin=1440,
times=times, onfraction=onfraction
MODIFICATION HISTORY:
Kim Tolbert 5/92
Modified 94/07/11 by Amy Skowronek - calls to pprint were changed to
calls to page_print ( which is what pprint has been renamed to.)
Mod. 12/13/96 by RCJ. Clean up documentation.
Version 4, richard.schwartz@gsfc.nasa.gov, 13-mar-1998, take advantage
of header reads in read_XXfile (using /noread) to get combined latest.
Version 5, richard.schwartz@gsfc.nasa.gov, 17-mar-1998, gutted old method.
Version 6, eva@kano.nascom.nasa.gov, 10-May-1999.
Software was missing out the last HV offtime interval -- have
corrected error. Added some comments.
[Previous]
[Next]
Project:
SDAC
Name:
BATSE_ONTIMES
PURPOSE:
Batse_ontimes displays periods during which CGRO/BATSE was
observing the sun. Provides user the menu to select start/end times,
output to terminal/printer/file, and possibly mail the information to
himself.
CATEGORY:
BATSE
INPUTS:
None direct, prompts for inputs
CALLS: ***
ATIME [1], ATIME [2], BATSE_ON, BATSE_TIME_INPUT, GETUT [1], GETUT [2], LOC_FILE [1]
LOC_FILE [2], LOC_FILE [3], MORE [1], MORE [2], Mailfile, PATH_DIR, READ_SEQFILE
SETUT [1], SETUT [2], UTIME [1], UTIME [2], YOHKOH_FORMAT [1], YOHKOH_FORMAT [2]
curdir [1], curdir [2], hxrbs_format, yohkoh_format [3]
CALLED BY:
batse_menu
HISTORY:
Kim Tolbert 7/20/92
VERSION 2, richard.schwartz@gsfc.nasa.gov, 26-aug-1997,
used loc_file with path_dir('batse') to locate help files.
---------------------------------------------------------------------------
[Previous]
[Next]
PROJECT:
SDAC
NAME:
BATSE_OUT_ARR
PURPOSE:
This procedure extracts data from the bdb structure into
output arrays that fit the quicklook plot requirements.
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
CALLED BY:
QLARCHIVE
COMMON BLOCKS:
none
SIDE EFFECTS:
none
RESTRICTIONS:
none
PROCEDURE:
none
MODIFICATION HISTORY:
Shelby Kennard 17January1991
Re-written to not use temporary arrays (takes too much space) - just use
bdb.disk directly. Kim
Version 3, richard.schwartz@gsfc.nasa.gov, rename to batse_out_arr, 22-aug-1997
[Previous]
[Next]
PROJECT:
SDAC
Name:
BATSE_POINTING
PURPOSE:
Compute direction cosines for BATSE LAD's, SPECS for Solar Viewing
Also find the position of the Sun and the Earth in the GRO coordinate
system and report the respective azimuth and elevation angles in degrees
CATEGORY: BATSE, data base extraction, needed for spectroscopy routines
CALLING SEQUENCE: batse_pointing, fdb=fdb, flare=flare, ut=ut, $
xyz_pos=xyz_pos, zx_radec=zx_radec, $
cos_det=cos_det, cos_spec=cos_spec, $
sun_in_gro = sun_in_gro, earth_in_gro=earth_in_gro,$
quiet=quiet, erroro=error
INPUTS:
Supply either fdb, flare, or (xyz_pos & zx_radec & ut)
fdb - A single packet of the BATSE data base structure
containing housekeeping info with standard tag names
x_pos, y_pos, z_pos, z_ra, z_dec, x_ra, x_dec
flare - Extract single packet at peak of this flare.
ut - If passed with flare number, will extract pointing info at
this time instead of at peak of flare. Must be passed
if calling with xyz_pos and zx_radec keywords.
xyz_pos - x, y, z GRO position in 1/4 km units
zx_radec - 4 element array with zra,zdec,xra,xdec of GRO pointing
in .0001 rad units
/quiet Inhibit print messages
OUTPUTS:
cos_det - direction cosines for LADs
cos_spec- direction cosines for SPECs
sun_in_gro - Position of the Sun in the GRO coordinate system,
Phi, Theta - (long and latitude) (degrees)
earth_in_gro - Position of the Geocenter in the GRO coordinate system,
Phi, Theta (degrees)
error - 0/1 means no error/error
CALLS: ***
CHECKVAR [1], FIND_PACKET, FS_OPEN [1], FS_OPEN [2], F_CROSSP, READ_FLARE
SC_SECONDS_ED, SOLEPHUT, SPHCART, XYRADEC, checkvar [2]
CALLED BY:
FS_ACC_DISCSP, MERGE_POINTING, WRITE_LOG, batse_write_log
RESTRICTIONS:
Requires that the GRO position vector and GRO pointing directions
be defined at the flare peak or the chosen time (ut). It will fail
on the 'Omni' data, (fdb.eng_telem=-1).
MODIFICATION HISTORY: based on det_point and spec_point,
written by RAS 3 Aug 1993
Mod. 7 Feb 94 by AKT. Added xyz_pos and zx_radec keywords. If user
already has a data packet, can call batse_pointing with xyz_pos,
zx_radec, and ut keywords to get pointing info. Also added
error keyword.
ras, 22-jun-1995, replaced crossp() with f_crossp()
[Previous]
[Next]
Project:
SDAC
Name:
batse_read_cat
PURPOSE:
Procedure to read the BATSE flare catalog into common flare_catalog.
If it has already been read (num_flares is already defined), it doesn't read
it unless force_read equals one.
Previously read catalog directory into an array of structures. It was
reading each record singly and taking a long time. If read this way (into
an associated variable byte array that's big enough to hold the whole thing,
only does one read - much faster. But then need to extract the fields into
the array of structures to use them later. This is relatively fast.
CATEGORY:
batse archive i/o
CALLING SEQUENCE:
batse_read_cat, [last_flare,] [/force]
CALLED BY:
CALLS: ***
CHKLOG [1], CHKLOG [2], CONV_VAX_UNIX, USE_VAX_FLOAT, printx [1], printx [2]
INPUTS:
force - if set then (re)read the catalog
OPTIONAL INPUTS:
none
OUTPUTS:
none explicit, only through commons;
OPTIONAL OUTPUTS:
Last_flare - Total flares in catalog same as last flare number.
CALLED BY:
BATSE_FLARES_WEEK, BURST_FLARE, CALIB_HIST, CREATE_GIF_HTML, CREATE_HTML
DISCSP_READ, DO_ALANSLIST, DO_ARCHIVEPLOTS, DO_EVENTLISTS, DO_PSPLOTS, EDIT_LOG
FLARE_FDB, FLDISPLAY, FLIST, GETFLARE, GET_TRIG, Load_sher, MAIN_HTML, MEMORY_INTRVLS
MERGE_BURSTS, MERGE_POINTING, PLOTBATSE, PLOTBATSE_QL, Pointing_Change, QL_PLOTTER
READ_FLARE, SHOW_FLARE, TIME_ARC_NAME, UPDATE_HTML, WRITE_LOG, WRITE_MONTH_CAT
batse_create_html, batse_sea_html, batse_write_log, spex_evnt [1], spex_evnt [2]
COMMON BLOCKS:
flare_catalog
SIDE EFFECTS:
none
RESTRICTIONS:
none
PROCEDURE:
none
MODIFICATION HISTORY:
Kim Tolbert 7/91
Mod 2/2/94 to be Unix compatible.
Mod 2/7/94 to extract two new fields - sun_position and earth_position
Mod 22-March-94, ras, to support installation on Unix machines, elim assoc read
ras, 12 apr 95, switched to reading and writing byte arrays
Version 6, richard.schwartz@gsfc.nasa.gov, 24-jun-1998, forced old VAX float format on write.
Version 7, richard.schwartz@gsfc.nasa.gov, 22-mar-1999, return last_flare, too.
Version 8, richard.schwartz@gsfc.nasa.gov, 13-jun-2000. Generate error if
batse_flare_catalog not readable(available).
[Previous]
[Next]
NAME
BATSE_SEA_HTML
This routine writes batse_search.html and batse_search_adv.html
updating some fields according to results from 'batse_read_cat'.
The html's are then ftp'ed to umbra. A cron job copies them
to their final dir.
RCJ - 03/25/97
CALLS:
[Previous]
[Next]
Name:
BATSE_SPEC_DRM
PURPOSE: build batse spec detector response matrix
including proper treatment of detector energyloss/light-output
relationship
CATEGORY: BATSE, SPEX
CALLING SEQUENCE:
INPUTS:
edges_out - drm output channel edges (2xn) in keV
theta - zenith angle of source, theta is 0 degrees for a source on-axis
det_id- detector id, 0-7 for BATSE spec
high- if set include a higher density above an MeV on the input side
OPTIONAL INPUTS:
OUTPUTS:
edges_in - photon intervals used for drm input
drm - detector response matrix
pairfit - coefficients of fits to energies above pair-threshold energy
sigma - resolution in standard deviations (sigma) from fits to response
database
e_in - energies corresponding to sigma in keV, original database photon energies
phtn_e- use this set of incident photon energies, 2xn, in keV
OPTIONAL OUTPUTS:
CALLED BY:
BUILD_DRM, DISCP_RESP, DISCSP_BANDS, GE_WINDOW [1]
PROCEDURE:
CALLS: ***
AVG [1], AVG [2], DECOMPOSE_BATSE_DRM, EXIST, FCHECK, FUNCT_FIT, F_DIV
F_GAUSS_INTG [1], F_GAUSS_INTG [2], GET_BE_ADD, G_C, INTERPOL, MGAUSS, MINMAX [1]
MINMAX [2], UNIQ [1], UNIQ [2], UNIQ [3], edge_products, low_e_spec_eff [1]
low_e_spec_eff [2], printx [1], printx [2]
COMMON BLOCKS:
RESTRICTIONS:
MODIFICATION HISTORY:
ras, 10-mar-1995
ras, 18-mar-1995, replaced spline interpolation with linear interpolation
for photoefficiency
added normalization needed when changing from energy-loss to light-output gaussians
increased output bin sampling internally, then summed over to final resolution, ras, 27jul95
fixed final rebinning to ignore output channels where the width is 0.0, ras, 25-sep-1995
ras, 1-nov-95
because pair fits can be bad at high energy, had to check pairfit quality range,
version 4, ras 17 oct 1996, added phtn_e
Version 5, richard.schwartz@gsfc.nasa.gov, 18-feb-1998, protect against NAN universally using
idl's finite function, not the woeful ssw routine.
[Previous]
[Next]
Project : SDAC
Name : BATSE_SPEC_GAIN_FDB
Purpose : This procedure extracts the SPEC High Voltage levels and the SLLD values
from the flare fdb file and combines it with the extracted DISCSP edges
and SPEC gain level from the databases. The values are written to
a structure, SPEC_GAIN.
Category :
Explanation :
Use :
Inputs : Flare - BATSE flare archive number
Opt. Inputs : None
Outputs : SPEC_GAIN - a structure with these tags
HV - intarr(8), hv-pmt values from housekeeping.
SLLD - bytarr(8), spec lld values
EDGES - fltarr(3,8), edges on DISCSP1 and DISCSP2
GAIN - fltarr(8), nominal gain levels
N511 - fltarr(8), position of 511 line in channel space
Opt. Outputs: None
Keywords :
Calls : ***
DISCSP_EDGES, GET_DISCSP511, GET_SPEC_GAIN, READ_FLARE, anytim [1], anytim [2]
anytim [3], anytim [4], anytim [5], read_dd
Common : None
Restrictions:
Side effects: None.
Prev. Hist :
Modified :
[Previous]
[Next]
Name:
BATSE_SPEC_MODEL
PURPOSE:
calculate the low energy cross section for
BATSE spec detectors from materials and geometry
Only considers the front surface. Validity limited
to energies less than 14.0 keV. The detector is
a right cylinder with a depth of 7.195 cm and 6.515 cm radius
CATEGORY:
BATSE
CALLING SEQUENCE:
batse_spec_model, theta, edges, drm
INPUTS:
theta - angle in degrees le 90 degrees
OPTIONAL INPUTS:
OUTPUTS:
drm
edges - energy in keV for input and output edges for drm
OPTIONAL OUTPUTS:
PROCEDURE:
Sets up to run analytic model in RESP_CALC.
CALLS: ***
COEFDATA, RESP_CALC, edge_products, other_filters [1], other_filters [2]
COMMON BLOCKS:
RESTRICTIONS:
MODIFICATION HISTORY:
ras, 2-mar-95
[Previous]
[Next]
PROJECT:
SDAC
NAME:
BATSE_TIME_INPUT
PURPOSE:
This function converts BATSE menu input line time values into HXRBS format for consistency
with expected values by all BATSE menu procedures.
CATEGORY:
BATSE
CALLING SEQUENCE:
new_command_line = BATSE_TIME_INPUT( command_line, time_params )
CALLS: ***
ARR2STR [1], Arr2Str [2], STR_SEP, anytim [1], anytim [2], anytim [3], anytim [4]
anytim [5]
INPUTS:
Command_line - user input command line,i.e. "inp,t,26-jun-92 17:00:00"
Time_params - Menu parameters which accept full time strings, i.e. 'INP,T','STA','END','TIM'
For 'INP' only, the time value follows a T in the second position. For the others,
the time value immediately follows the parameter string. N.B. that not all menus accept
the same time parameters, nor do they always have the same meaning. For some menus,
Time means the full date, while for others it references only time of day. START
and END parameters are passed back as only the time of day components if that is what is
passed. The only time parameters with the BATSE MENU programs are 'INP,T','STA','END','TIM'
OPTIONAL INPUTS:
none
OUTPUTS:
The result returned is the command using a HXRBS style time string with 2 yy digits, interpreted
from 1950-2049.
OPTIONAL OUTPUTS:
none
KEYWORDS:
none
CALLED BY:
BATSE_ONTIMES, FLDISPLAY, FLISTOC, FSOC, QLDISPLAY, RATESDUMPOC, RAWDUMPOC
COMMON BLOCKS:
none
SIDE EFFECTS:
none
RESTRICTIONS:
none
PROCEDURE:
The command line is parsed and recast.
MODIFICATION HISTORY:
Version 1, richard.schwartz@gsfc.nasa.gov, 7-may-1998.
[Previous]
[Next]
PROJECT:
SDAC
Name:
batse_write_log
PURPOSE:
In normal mode, displays the flare parameters for the current flare
(whether a new flare or one that was just modified) and lists the
peak rate and total counts for each detector separately. Then prompts
operator for whether or not to save these flare parameters. If this is a
new flare, figures out how many records are already in the file using FSTAT,
new flare number will be new record number. Also updates the header record
to contain the total number of flares. If this flare already existed,
just rewrites the record containing this flare.
In auto mode, don't talk to operator, just rewrite record containing
modified flare. Don't close file.
CATEGORY:
batse
CALLING SEQUENCE:
batse_write_log, auto, peakrates, totcounts, batlog, flarenum, recordn, saveflare
CALLED BY:
fs_auto_log
CALLS: ***
ATIME [1], ATIME [2], BATSE_POINTING, CHKLOG [1], CHKLOG [2], CONV_VAX_UNIX
SIZE_STRUCT, USE_VAX_FLOAT, batse_read_cat
INPUTS:
Calling arguments:
auto - (input) if =1, then we're in auto mode.
peakrates - (input) peak rate for each detector
totcounts - (input) total counts for each detector
batlog - (input/output) structure containing parameters for current flare
flarenum - (input/output) if this is a new flare, on entry to fs_auto_log
will equal 0, on exit will be new flare number. If flare
already exists, this is the flare number.
recordn - (input/output) if new flare, this will be the record number
the flare parameters are written into. If flare already exists,
this is the record number containing the flare (returned by
readflare procedure).
saveflare - (output) 'Y' or 'N', yes/no to whether flare was saved
none explicit, only through commons;
OPTIONAL INPUTS:
none
OUTPUTS:
none explicit, only through commons;
OPTIONAL OUTPUTS:
none
CALLED BY:
FS_AUTO_LOG
COMMON BLOCKS:
flare_catalog, fs_saveplot, fs_saveaccum, CATALOG_FILE
SIDE EFFECTS:
none
RESTRICTIONS:
BATSE database files must exist. For use at SDAC only.
PROCEDURE:
none
MODIFICATION HISTORY:
Mod. 2 Feb 94 by AKT. Added fs_saveaccum common and just before
writing flare, call batse_pointing with peak time and position at
peak, and insert earth and sun position in flare structure that gets
written in the catalog.
Mod. 6/28/94 by AES to display detector id's to user as 0-7 rather
than 1-8.
mod, 12-apr-95, ras, convert structures to byte arrays before writing
Version 5, 24-jun-1998, continue writing in old VAX float format using USE_VAX_FLOAT().
richard.schwartz@gsfc.nasa.gov.
[Previous]
[Next]
Name:
BUILD_DRM
PURPOSE: generate a BATSE LAD or SPEC response matrix for direct interactions
for any direction cosine between 0.0 and 1.0,
CATEGORY: Spectral analysis, fitting.
BATSE
CALLING SEQUENCE: drm = build_drm( cosine=cosine, chan_edges=chan_edges, $
det_type=det_type, high=high,e_in = e_in, area=area )
CALLS TO:
batse_spec_drm, x_eout_drm, batse_lad_drm, printx
INPUTS:
keywords:
cosine - direction cosine to source with respect to LAD front
surface normal, default is cosine=0.0
chan_edges - 2 by n array of low and high energy edges, keV
default is the edges of the data file, 100x100
det_type - 'lad' or 'spec'
/high - if set, use the high energy response tables up to 30 MeV
test_drm - 0 => default batse spec drm, 1 => 1st test drms, 2 => 2nd test
OUTPUTS:
keywords:
e_in - 2 by m array of low and high energy edges for input
energy bins of incident photons, keV
area - detector normal area, 2025 cm^2 for LAD, 127 cm2 for SPEC
CALLS: ***
BATSE_LAD_DRM, BATSE_SPEC_DRM, CHECKVAR [1], CONCAT_DIR [1], CONCAT_DIR [2]
CONCAT_DIR [3], DISCLA_EDGES, X_EOUT_DRM [1], X_EOUT_DRM [2], checkvar [2]
concat_dir [4], printx [1], printx [2]
CALLED BY:
DIFF_DRM, RESOLVE_NEW_OBS
RESTRICTIONS: 0.0 < cosine < 1.0
Note:
Edges_out - lower and upper limits are forced to be within the low and upper limits
of the output edge of the drm read from the file!
BATSE response database must be installed!
PROCEDURE: values are interpolated from a stored table of 100x100x12
output energies x input energies x cosines
MODIFICATION HISTORY: ras, 2 Feb. 1994
ras, 27-mar-1994, uses linear interpolation over output energy bins
ras, 11-nov-1994, enable testing new spec drms by looking for environment
variable, DRM_NEW
ras, 3-mar-1995, enable testing newest spec drms
RAS, 7-Jul-1997, changed PERM_DATA to SSWDB_BATSE
Version 5, richard.schwartz@gsfc.nasa.gov, 8-feb-1998,
corrected print statement for LAD build, energy/light conversion is all
mixed up with pha energy calibration. Not considered adequate by ras.
added lld cutoff keyword for batse_lad_drm.
[Previous]
[Next]
Project : SDAC
Name : BUILD_DRM_MER_CONT
Purpose : This procedure builds a DRM
Category : BATSE, SPEX
Explanation : The P0 input is a header
structure for the merged mer_cont data containing the detector id's,
and the edges used. Together with the pointing info available in the
BATSE database (det_cosines.pro or gro_point.pro), the detector response
matrix is built within spex. The spex_proc protocol is used to be sure
to pick up the correct values of any other variables.
Syntax : build_drm_mer_cont, p0
Examples : build_drm_mer_cont, p0
Inputs :
Opt. Inputs :
Opt. Outputs: Drm - second argument. Returns the computed drm
Keywords : FILE - first argument returned from mer_cont genx file or
the filename of the mer_cont genx file.
SFILE - dummy arg.
EDGES - PHA output edges in keV.
E_in - Photon input edges in keV.
Area - DRM normalization area.
DRM - detector response matrix in cnts/cm2/keV per photon/cm2
CALLS: ***
ARR2STR [1], Arr2Str [2], BURST_FLARE, DATATYPE [1], DATATYPE [2], DATATYPE [3]
SPEX_PROC [1], SPEX_PROC [2], restgen [1], restgen [2], spex_current [1]
spex_current [2]
Common :
Restrictions:
Side effects: The values of DRM, DRM_H, and need are changed in SPEX
History : Version 1, RAS, 11-Jul-1997
Contact : Richard.Schwartz@gsfc.nasa.gov
[Previous]
[Next]
NAME:
BURST_AUX_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:
BURST_FLARE
PURPOSE: Function to find BATSE bursts corresponding to a
BATSE flare number, or vice versa.
CALLING SEQUENCE: result = burst_flare(event, [/flare, /burst)]
INPUTS:
EVENT - Either the burst number or the flare number
depending on whether /burst or /flare is set. Default
if neither /burst or /flare is set is flare number.
OUTPUTS:
RESULT - Corresponding burst or flare numbers
OPTIONAL KEYWORD INPUTS:
FLARE - If set, then input is flare number. Find
corresponding bursts.
BURST - If set, then input is burst number. Find
corresponding flares.
SAMPLE CALL: bursts = burst_flare (761)
flares = burst_flare (525, /burst)
CALLS: ***
CHECKVAR [1], LOC_FILE [1], LOC_FILE [2], LOC_FILE [3], READ_SEQFILE
batse_read_cat, checkvar [2]
CALLED BY:
BUILD_DRM_MER_CONT, EVAL_SHERB, MK_MER_CONT, Shers_load [1]
batse_file_search [1], batse_file_search [2]
MODIFICATION HISTORY:
Written Kim Tolbert 93/11/23
mod, ras, 27-apr-95, truncate at end of real list
mod, ras, 27-feb-96, make consistent with merge bursts
by expanding time window to cover later starting flares
due to telemetry coverage
Version 3 ras, 27 mar 1996, expand coverage in both directions
Version 4 ras, 7-apr-1997 fixed up parsing
Version 5, ras, 22-mar-2001, use loc_file and SSWDB_BATSE
to find burst_trigger.lst
[Previous]
[Next]
NAME:
BURST_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: