Mailfile $SSW/cgro/batse/idl/mailfile.pro
[Previous] [Next]
NAME:
	Mailfile

PURPOSE:
	Send e-mail of filename to user on vms or osf machine,
	ask their address if necessary

Category:
	GEN, BATSE/ARCHIVE
INPUTS
	filename (string)
	
KEYWORDS
	noquery, if set will not ask the user questions about their email
	address

Modification History

Modified 8/9/94 by Amy Skowronek to display the mail address as the user
 entered it when confirming that something was mailed, rather than displaying
 the fixed version our system needs (i.e., leave out quotes and smtp%)
 Modified 6/20/95 by AES - enabled mailing on OSF systems.
 __Documentation header added by EAC 5/8/96
 5/8/96 by EAC - added keyword automail for noninteractive operation,
  if set mailfile will not query the reader unless they forgot to
  specify and email address
 CALLS:
 CALLED BY
	ASCII_RATES, ASCII_RAW, BATSE_ONTIMES, FLDISPLAY, FLIST, FSPLOT, FS_PRINT, QLDISPLAY
	RAWDUMP, batse_menu, pro ratesdump


MAILPLOT $SSW/cgro/batse/idl/mailplot.pro
[Previous] [Next]

 NAME: 
       MAILPLOT

 PURPOSE:


 CATEGORY:
       BATSE

 CALLING SEQUENCE:


 CALLS: ***
	CHECKVAR [1], DEFAULTS, checkvar [2], fix_Mailaddr
 INPUTS:
       none explicit, only through commons;

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 CALLED BY:
	FLDISPLAY, FSPLOT, QLDISPLAY
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:


MAIN_HTML $SSW/cgro/batse/idl/main_html.pro
[Previous] [Next]
  Name:
       MAIN_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
 Mod. 10/2/95 by Amy Skowronek - changed address to nascom domain
 Mod 4/1/96 by AES - get hxrbs password elsewhere
 CALLS:


Make_occ_results_sav $SSW/cgro/batse/idl/occults/make_occ_results_sav.pro
[Previous] [Next]

 NAME: 
       Make_occ_results_sav

 PURPOSE:
	This is a main program to write the save file, occ_results.sav

 CATEGORY:
	BATSE, OCCULTS

 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:
	Version 1, ras 5-June-1996


MAP_DISCLA2CONT $SSW/cgro/batse/idl/map_discla2cont.pro
[Previous] [Next]
 Project     : SDAC
                   
 Name        : MAP_DISCLA2CONT
               
 Purpose     : This routines maps the DISCLA edges into energy space.
               
 Category    : BATSE
               
 Explanation : The counts for DISCLA and CONT are compared.  The edges
	are assigned energies based on the energy scale of the CONT PHA.
	The channel boundaries are assigned so that identical spectral
	slopes would be obtained from either data set.
               
 Use         : Map_discla2cont, Flare, Dedges, Sig0
    
 Inputs      : Flare - BATSE archive flare number
               
 Opt. Inputs : None
               
 Outputs     : Dedges - Discla Energy Edges in keV based on Non-Pendleton and
	Pendleton CONT edges.
		Sig0   - For each DISCLA0 edge, the standard deviation and number of
		data intervals used.
 Opt. Outputs: None
               
 Keywords    : F_MODEL - Name of model function to use, default is f_vth.
		APAR    - If model function has more than two parameters, then
		the APAR keyword must be given for SPECTRAL_RATIO,
       	"Input parameters.  2XN.  There may be an arbitrary number
       of parameters, but there is only 1 which will be interpolated on
       and the range of interpolation is given by the two values at the ith
       position.  Its normalization parameter must immediately precede it in
       the call.  All of the other parameters must have duplicated values and
       the normalization parameter will be set to 1.0."
	LINEAR_ONLY - Extract the linear channel edges for DISCLA1,2,3,4 by interpolation
	on CONT data.  Doesn't depend on energy calibration model for CONT.
	LDEDGES      - linear channel edges for DISCLA extracted, 4X8.
	LSIG        - same meaning as SIG0, 2X4X8.

 Calls	      : ***
	CHECKVAR [1], CONT_EDGES, CONT_READ, CUM_SUM, DELVARX [1], DELVARX [2], DELVARX [3]
	DELVARX [4], FAST_LAD_DRM, FDBREAD, FIND_IX, F_DIV, GETUTBASE [1], GETUTBASE [2]
	INTERPOL, READ_FLARE, RESISTANT_Mean [3], REVERSE, Resistant_Mean [1]
	Resistant_Mean [2], SET_PENDLETON, SPEX_BACKGROUND [1], SPEX_BACKGROUND [2]
	UNIQ [1], UNIQ [2], UNIQ [3], checkvar [2], delvarx [5], edge_products
	spectral_ratio [1], spectral_ratio [2]
 Common      : None
               
 Restrictions: 
               
 Side effects: None.
               
 Prev. Hist  :

 Modified    : Version 1, RAS, 
	Version 2, richard.schwartz@gsfc.nasa.gov, 23-feb-1998, added linear channel
	mapping.


MELD_DISCSP [1] $SSW/cgro/batse/idl/meld_discsp.pro
[Previous] [Next]

 NAME:  
	MELD_DISCSP

 PURPOSE: 
	This procedures merges the first SPEC fast discriminator channel, discsp1, with the
	PHA data in SHER/SHERB.

 CATEGORY: 
	BATSE, SPEX

 CALLING SEQUENCE:
	MELD_DISCSP, Sec_in, Discsp_in, Evec_discsp, Discsp_live, $
		Ut, Data, Edges, Ltime, Lt_data, Chan_discp1

 CALLED BY:
	read_4_spex

 CALLS: ***
	F_DIV, INTERPOL, RESISTANT_Mean [3], Resistant_Mean [1], Resistant_Mean [2]
	UNIQ [1], UNIQ [2], UNIQ [3], printx [1], printx [2]
 INPUTS:
	DISCSP DATA
	Sec_in	    - time array for DISCSP, mid-point for each bin
	Discsp_in   - data in livetime corrected counts/sec, discsp1 & discsp2
	Evec_discsp - 2x4 energy edges (keV) for DISCSP
	Discsp_live - live time for DISCSP in seconds

	SHER DATA - nints intervals
	Ut	- 2 x nints, start and end time for each interval
	Data    - PHA and DISCSP data from SHER and SHERB, 
		The input data is in raw counts.  In this procedure, channel 0
		is returned corrected for overflow.
	Edges   - 2 x 256 energy edges for PHA in keV
	Ltime   - live time in seconds for PHA data, channel 0 is corrected
		to DISCSP livetime by this procedure.

 OPTIONAL INPUTS:
	none

 OUTPUTS:
	Data - see inputs
	Lt_data - see inputs
	Chan_discp1 - the channel (3-255) to be used for discsp1 in integrated data
	Error - if set, then discsp1 integration failed

 OPTIONAL OUTPUTS:
	none

 CALLED BY:
	Shers_load [1]
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	Not designed to be a standalone routine, but to be called by SHERS_LOAD which
	integrates SHER, SHERB, STTE, and DISCSP BATSE SPEC data.

 PROCEDURE:
	The DISCSP1 data in the SHER(B) time intervals usually suffers from overflow.  During the high
	rates of the event, there are usually many orders of overflow in the counter. The DISCSP is
	interpolated and integrated over the corresponding time intervals to determine the number of
	overflows and then the original DISCSP counts in the SHER(B) spectra are corrected.

 MODIFICATION HISTORY:
	ras, 22-sep-1995
	Version 2
	ras, 30-oct-1995, corrected error in elements passed to interpol
	richard.schwartz@gsfc.nasa.gov, 19-feb-1998, beefed up error checking.


MELD_DISCSP [2] $SSW/cgro/batse/idl/meld_discsp_test.pro
[Previous] [Next]

 NAME:  
	MELD_DISCSP

 PURPOSE: 
	This procedures merges the first SPEC fast discriminator channel, discsp1, with the
	PHA data in SHER/SHERB.

 CATEGORY: 
	BATSE, SPEX

 CALLING SEQUENCE:
	MELD_DISCSP, Sec_in, Discsp_in, Evec_discsp, Discsp_live, $
		Ut, Data, Edges, Ltime, Lt_data, Chan_discp1

 CALLED BY:
	read_4_spex

 CALLS:
	none
 INPUTS:
	DISCSP DATA
	Sec_in	    - time array for DISCSP, mid-point for each bin
	Discsp_in   - data in livetime corrected counts/sec, discsp1 & discsp2
	Evec_discsp - 2x4 energy edges (keV) for DISCSP
	Discsp_live - live time for DISCSP in seconds

	SHER DATA - nints intervals
	Ut	- 2 x nints, start and end time for each interval
	Data    - PHA and DISCSP data from SHER and SHERB, 
		The input data is in raw counts.  In this procedure, channel 0
		is returned corrected for overflow.
	Edges   - 2 x 256 energy edges for PHA in keV
	Ltime   - live time in seconds for PHA data, channel 0 is corrected
		to DISCSP livetime by this procedure.

 OPTIONAL INPUTS:
	none

 OUTPUTS:
	Data - see inputs
	Lt_data - see inputs
	Chan_discp1 - the channel (3-255) to be used for discsp1 in integrated data
	Error - if set, then discsp1 integration failed

 OPTIONAL OUTPUTS:
	none

 CALLED BY:
	Shers_load [1]
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	Not designed to be a standalone routine, but to be called by SHERS_LOAD which
	integrates SHER, SHERB, STTE, and DISCSP BATSE SPEC data.

 PROCEDURE:
	The DISCSP1 data in the SHER(B) time intervals usually suffers from overflow.  During the high
	rates of the event, there are usually many orders of overflow in the counter. The DISCSP is
	interpolated and integrated over the corresponding time intervals to determine the number of
	overflows and then the original DISCSP counts in the SHER(B) spectra are corrected.

 MODIFICATION HISTORY:
	ras, 22-sep-1995
	Version 2
	ras, 30-oct-1995, corrected error in elements passed to interpol


MEMORY_INTRVLS $SSW/cgro/batse/idl/memory_intrvls.pro
[Previous] [Next]
  Name:
       MEMORY_INTRVLS

	Compute the BATSE SHERB accumulation intervals based on the
	adjustable parameters in the on-board algorithm
	
	Inputs:
		flare  - BATSE archive flare number

	Optional inputs:
		ncount - end accum. interval after this many counts in LAD
		t1     - test time for 1/3 of accumulation intervals
		t2     - test time for 2/3 of accum intervals

	BATSE memory algorithm - 192 intervals - 96 for brightest detector
	Accumulation continues until brightest LAD counts NCOUNT from start
	of interval.  If there are 32 intervals accumulated before t1 then
	NCOUNT changes to NCOUNT*2, if there are 64 intervals accumulated
	before t2 then NCOUNT changes to NCOUNT*2.
 CALLS:


MERGE_BATSE $SSW/cgro/batse/idl/merge_batse.pro
[Previous] [Next]

 NAME:  MERGE_BATSE


 PURPOSE: integrate DISCSP with CONT (or DISCLA, tbd)


 CATEGORY: BATSE, SPEX


 CALLING SEQUENCE:
	MERGE_BATSE, FLARE=FLARE, FLUX=FLUX, EFLUX=EFLUX, UT=UT, UNITS=UNITS, AREA=AREA
	LTIME=LTIME, EDGES=EDGES, WCHAN=WCHAN, _EXTRA=_EXTRA

 CALLED BY:
	READ_4_SPEX, DRM_4_SPEX

 CALLS: ***
	CHECKVAR [1], CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], DATATYPE [1]
	DATATYPE [2], DATATYPE [3], DET_COSINES, SET_PENDLETON, checkvar [2]
	concat_dir [4], merge_batse_photons, read_4_spex [1], read_4_spex [2]
	where_arr [1], where_arr [2]
 INPUTS:
	FLARE_INFO - Either the BATSE flare number from the SDAC archive
	             e.g. flare 397 occurred on 7 June 1991, 13:45 UT
		or 
		     A structure with tags, UT, FILENAMES, COS_SPEC, and COS_LAD
		     where UT is the time in ANYTIM format;
		     FILENAMES are the complete file names including path;
		     COS_SPEC are the eight SPEC cosines to the source;
		     COS_LAD  are the eight LAD cosines to the source.
	FILE_INFO  -  It is a string, 'FINDFILE', then the FLARE_INFO structure is 
		     returned
		     
 OPTIONAL INPUTS:
	START_TIME
	END_TIME

 OUTPUTS:
	UT
	FLUX - Returns counts / bin
	EFLUX
	LTIME
	EDGES
	AREA
	DET_IDS
	DRM
	E_IN
	WCHAN
	ERROR
	TITLE
	COS_LAD
	COS_SPEC
	FILENAMES
 CALLED BY:
	MERGE_BATSE_DRM, read_batse_4_spex [1], read_batse_4_spex [2]
	spex_batse_preview [1], spex_batse_preview [2]
 COMMON BLOCKS:
	MERGE_BATSE

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	Only implemented for CONT and DISCSP with common length records.

 PROCEDURE:
	This procedure first identifies the datafiles, then reads them using read_4_spex, and
	then creates a merged drm using build_lad_drm or build_spec_drm.  The PHA on the
	DISCSP has its boundary adjusted to below the 2nd CONT channel.  The width of the
	Flux and DRM for this channel are appropriately adjusted although the true PHA
	width isn't changed, only its pseudo-range as expressed by the nominal PHA
	boundary.

 MODIFICATION HISTORY:
	RAS, 18-Oct-1996
	RAS, 6 nov 1996, fixed bug in theta specification for use_id option


MERGE_BATSE_DRM $SSW/cgro/batse/idl/merge_batse_drm.pro
[Previous] [Next]

 NAME:  MERGE_BATSE_DRM


 PURPOSE: Create integrated DRM for  DISCSP with CONT (or DISCLA, tbd)


 CATEGORY: BATSE, SPEX


 CALLING SEQUENCE:
	MERGE_BATSE_DRM, FLARE=FLARE, AREA=AREA, DRM=DRM, EDGES_OUT=EDGES_OUT,
	EDGES_IN=EDGES_IN, _EXTRA=_EXTRA

 CALLS: ***
	MERGE_BATSE
 INPUTS:
	FLARE - BATSE flare number, SDAC archive
 OPTIONAL INPUTS:

 OUTPUTS:
	EDGES_OUT- 2xn pha channel energy bins, keV
	AREA     - geometric area used for DRM normalization to /cm2
	DRM	 - detector response matrix, counts/cm2/keV per photon/cm2
	EDGES_IN - 2xm photon energy bins, keV

 COMMON BLOCKS:
	None

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	RAS, 18-Oct-1996


merge_batse_photons $SSW/cgro/batse/idl/merge_batse_photons.pro
[Previous] [Next]

 NAME:  merge_batse_photons


 PURPOSE: integrated photon energy vector for BATSE DRM's


 CATEGORY: BATSE, SPEX


 CALLING SEQUENCE:
	merge_batse_photons, ephotons 

 CALLED BY:
	merge_batse

 CALLS: ***
	UNIQ [1], UNIQ [2], UNIQ [3], edge_products
 INPUTS:
	Flare

 OPTIONAL INPUTS:
	none

 OUTPUTS:
	ephotons: 2xn energy edges in keV

 KEYWORDS

 CALLED BY:
	DISCSP_BANDS, MERGE_BATSE
 COMMON BLOCKS:
	

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	ras, 16-oct-1996


MERGE_BURSTS $SSW/cgro/batse/idl/merge_bursts.pro
[Previous] [Next]
  Name:
       MERGE_BURSTS

 CALLS: ***
	ATIME [1], ATIME [2], CHECKVAR [1], CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3]
	CONV_VAX_UNIX, EXTRACT_TRIGGERS, USE_VAX_FLOAT, batse_read_cat, checkvar [2]
	concat_dir [4]
  Procedure:
MERGE_BURSTS reads first three columns of information from a BATSE Burst 
Trigger List with a format like the following :

 Burst Trunc  Sec  Comments
  No.   JD  of day
   146  8380 65642 Single peak lasting 30 s, with some structure.  Channel 3.
                   GOES C flare.
   151  8382 58292 Single peak with structure lasting 15 seconds.  Channel 2.
                   GOES C flare.
   155  8382 84146 Multiple. Triggered on precursor lasting about 20 s.  Main
                   peak lasting 300 s, came 200 s later.  Channel 2.

 The file does not have to be manually edited to get rid of header and footer
 material, including the column labels.  The program simply finds the first 
 occurrence of day 146 and only uses that and the following lines.
 WARNING:  ASSUMES NO MORE THAN 5000 LINES IN INPUT FILE!!!!!!!!!!!!!!!!!!!
 MERGE_BURSTS also reads our BATSE flare catalog, and then decides which bursts
 correspond to which flares (the burst time falls within the flare start time
 minus 5 minutes and the flare end time), and adds the burst number, the 
 TJD, and the trigger seconds to our flare catalog.  It writes the new 
 catalog in a temporary file called new_batse.cat, and then copies this 
 file to the standard catalog files - BATSE_DATA:BATSE_FLARE.CAT and 
 BATSE_DATA:BATSE_LOG.CAT.  There are two files, the first is the general
 catalog that all users read from and the second, batse_data:batse_log.cat
 is the file that is written to when flares are logged from Anne's account.
 Inputs:
	None
 Keywords:
	QUIET:
	B_NUM_ARR
	B_TJD_ARR
	B_TRIG_SECS_ARR

 History:
 
 Written by Erika Lin, 8/92,  Modified by AKT.
 Mod. 8/30/93 by KT - After found the flare that a burst corresponds to,
 check if there are more bursts that might correspond to the same flare,
 and if so, only use the one that is closest to the start time of the
 flare.  Write a message for the ones not used.

 mod, 12-apr-95, ras, writes stream files
 Mod. 4/26/95 by AES - They corrected the spelling of "Unclassified" in the
	burst trigger list, so corrected it in our strpos statement which is
       looking for the end of the file.
 Mod 5/25/95 by AES - Marshall changed the summary again - now look for 
	"Unclassified Trigger" rather than "Unclassified Events"
 ras, 11-dec-95, uses extract_triggers.pro
 Mod 11/19/96 AES - use file_delete instead of delete_file.  delete_file
	migrated to another tree, which is not in our path at this time.
****************************************************************************


MERGE_DISCSP_HKG_OCC $SSW/cgro/batse/idl/occults/merge_discsp_hkg_occ.pro
[Previous] [Next]

 NAME: 
       MERGE_DISCSP_HKG_OCC

 PURPOSE:
	This procedure makes compressed discsp files for a single detector
	starting from full discsp and hkg files from msfc

 CATEGORY:
	BATSE, OCCULTS

 CALLING SEQUENCE:
	merge_discsp_hkg_occ, file_hkg, file_discsp, det_id, outdir=outdir

 CALLS: ***
	ARR2STR [1], ATIME [1], ATIME [2], AVG [1], AVG [2], Arr2Str [2], BREAK_FILE [1]
	BREAK_FILE [2], BREAK_FILE [3], CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3]
	FCHECK, READ_DISCSP_M, SC_SECONDS_ED, STR2ARR [1], STR2ARR [2], TJD2YMD, anytim [1]
	anytim [2], anytim [3], anytim [4], anytim [5], break_file [4], concat_dir [4]
 INPUTS:
	file_hkg - compressed housekeeping file
	file_discsp - msfc daily discsp file
	det_id - detector id

 OPTIONAL INPUTS:
	OUTDIR - directory for merged discsp hkg occ file
		The default is 'batse_disk1:[data.batse]' on sdac
 OUTPUTS:
       Output file containing differential DISCSP channels 1 & 2 [0:1] for det_id,
       spacecraft position vs time, and essential spacecraft attitude info.
       These files are readabel through READ_OCC_DISCSP

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	A new file is written to outdir with the format:
	occ_discsp_'+yymmdd+'.dat_'+sdet_id, e.g. OCC_DISCSP_950530.DAT_2
	It is a stream file to make it readable across platforms when exported from
	sdac to umbra or hxrbs (eg)
 RESTRICTIONS:
	none

 PROCEDURE:
	The outdir is checked to see if the requested output file already exists.  If not
	the discsp and hkg data are read and merged including 

 MODIFICATION HISTORY:
	Version 1, RAS, July 1995


MERGE_POINTING $SSW/cgro/batse/idl/merge_pointing.pro
[Previous] [Next]

 NAME: 
       MERGE_POINTING

 PURPOSE:


 CATEGORY:
       BATSE

 CALLING SEQUENCE:


 CALLS: ***
	BATSE_POINTING, batse_read_cat
 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:


MK_DISCSP_CAL $SSW/cgro/batse/idl/mk_discsp_cal.pro
[Previous] [Next]
 NAME:
       MK_DISCSP_CAL

 PURPOSE:
       Modify Caliblns.lis file into the format of perm_data:discsp_cal.dat

 CATEGORY:
       BATSE,SPEX

 CALLING SEQUENCE:
       MK_DISCSP_CAL, Timeout, Chanout

 INPUTS:


 OPTIONAL INPUTS:

 KEYWORD PARAMETERS:
	file - input file, caliblns.lis, produced from the BSAS database,
		 otherwise default caliblns.lis renamed to [soft.batse]discsp_cal.dat
 OUTPUTS:
	writes discsp_cal.dat on the current directory       

 CALLS: ***
	ATIME [1], ATIME [2], FCHECK, READ_SEQFILE, UTIME [1], UTIME [2]
 COMMON BLOCKS:

 SIDE EFFECTS:

 RESTRICTIONS:

 PROCEDURE:


 MODIFICATION HISTORY:
       Written by:     ras, 18-oct-1995


MK_MER_CONT $SSW/cgro/batse/idl/mk_mer_cont.pro
[Previous] [Next]
 Project     : SDAC

 Name        : MK_MER_CONT

 Purpose     : This procedure reads in the BATSE MER data, concatenates
	it with the corresponding CONT data, makes a deadtime correction,
	and saves the detector information

 Category    : BATSE, DATA I/O

 Explanation : The CONT and MER data are read.  CONT and MER are
	pasted together, i.e. the CONT is merged to the selected MER
	detectors and the MER is pasted over the common times.  The
	CONT count/livetime relationship is used for MER.  Finally,
	a combined detector response matrix is built.

 Syntax      : IDL> mk_mer_cont, burst_no, ut, mer, lmer 
		[,start_time=start_time, end_time=end_time,  $
		  edges_out = edges_out, edges_in = edges_in]

 Examples    : IDL> result = Batse_mer_read( 2240, ut, mer, lmer)
		     drm    = batse_mer_read( 2240, /drm, edges_out = edges_out, edges_in = edges_in)

 Inputs      : Burst_no - Valid BATSE trigger number.  See burst_flare.pro

 Outputs     :
		New - A data-packetized structure with these tags
			Flux - count rate in 16 channels, float, counts/sec/kev/cm2
			Ltime - live time in seconds for each packet
			Ut   - accum time of each packet in seconds from 1-jan-1979, anytim readable
		
 Opt. Inputs :

 Opt. Outputs:

 Keywords    : START_TIME  - Time to start accumulation. Readable with anytim().
		END_TIME    - Time to end accumulation.   Readable with anytim().
		STRUCT      - Structure written to genx file.
		The DRM reported is the last one created if flare is not given.
		

 CALLS: ***
	ARR2STR [1], AVG [1], AVG [2], Arr2Str [2], BURST_FLARE, CONCAT_DIR [1]
	CONCAT_DIR [2], CONCAT_DIR [3], CONT_EDGES, CONT_READ, F_DIV, INTERP2INTEG, INTERPOL
	LOC_FILE [1], LOC_FILE [2], LOC_FILE [3], READ_MER, SET_PENDLETON, anytim [1]
	anytim [2], anytim [3], anytim [4], anytim [5], bits [1], bits [2], concat_dir [4]
	curdir [1], curdir [2], edge_products, savegen [1], savegen [2]
 Common      : MK_MER_CONT - save the ID's of the triggered detectors.

 Restrictions: BATSE event database of CONT and MER must be in place.
		BATSE_DATABASE, BATSE_CONT, SSWDB_BATSE, BATSE_FLARE_CATALOG must be
		defined. CONT data file must exist.
 Side effects:

 History     : Version 1, RAS, 11-Jul-1997

 Contact     : Richard.Schwartz@gsfc.nasa.gov


MOD_PLOT $SSW/cgro/batse/idl/mod_plot.pro
[Previous] [Next]

 NAME: 
       MOD_PLOT

 PURPOSE:


 CATEGORY:
       BATSE

 CALLING SEQUENCE:


 CALLS: ***
	CHKLOG [1], CHKLOG [2], CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3]
	TEK_END [1], TEK_END [2], TEK_INIT [1], TEK_INIT [2], concat_dir [4]
 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:


modify_sled [1] $SSW/cgro/batse/idl/modify_sled.pro
[Previous] [Next]
c****************************************************************************
c	      pro read_coef, spec_lld

c     This subroutine reads in some of the necessary coefficients stored in 
c     external data files. The coefficients are passed in common blocks 
c     to the main routine.  In addition, the subroutine calculates the
c     SLED correction appropriate to the detector's LLD setting.
c
c     The SLED correction is d* (1.-tanh(b*(x-c)) up to 'cut'.
c     I assume that 1./b and c increase linearly with the LLD, while
c     d should remain constant.
c
      The relevant data files are found on PERM_DATA in ASCII
      and XDR format save sets
      
c     Input:
c        spec_lld--LLD setting of spectrum to be calibrated
c     Output:
c        sled_com--common block with sled correction coefficients
c        fiducial_com--common block with calibration equation parameters
c****************************************************************************
     pro sled,ndet,slope,xvec,olight
c
c     Subroutine to calculate the SLED correction. The correction is an 
c     adjustment to the light output in the linear term of the calibration 
c     equation. 
c     Input:
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
c     Output:
c        olight--vector of light output adjusted for the SLED
;c    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
			  
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
c*****************************************************************************
 CALLS:
 CALLED BY
	CALIBRATE [2]


Modify_sled [2] $SSW/cgro/batse/idl/modify_sled.pro
[Previous] [Next]
	calibrate, det_id, width64, spec_lld, 1, n511, 511., evec, $
		pre=plite, olight=lite
	edge_products, evec, edges_2=evec, mean=evecm, width= wevec
	edge_products, plite, edges_2=plite, mean=plitem, width= wplite
	edge_products, lite, edges_2=lite, mean=litem, width= wlite
Name:
	Modify_sled

Usage: modify_sled, det_id, amp=amp, width=width, centroid=centroid, edges, delta_light

Inputs:
	Det_id - detector to use
	Amp - multiply amplitude of Sled distortion by this factor, coefficient sd
	Width - multiply width of Sled distortion by this factor, coefficient sb
	Centroid - multiply center of sled correction in linear channel space by this factor, coefficient sc
	
Outputs:
	Edges - PHA edges in energy space
	Delta-light - PHA channel widths in light units.	

 CALLS: ***
	CALIBRATE [1], CALIBRATE [2], CHECKVAR [1], EXIST, checkvar [2], edge_products
 CALLED BY:
	CALIBRATE [2]
History:
	Test version, ras, 15-mar-1996


MORE_OCCULTS $SSW/cgro/batse/idl/occults/more_occults.pro
[Previous] [Next]

 NAME: 
       MORE_OCCULTS

 PURPOSE:
        This procedure processes any unprocessed occ*discsp files through
        get_occ_onday to find occultations and plot_occs to extract the 
        occultation step count rates.

 CATEGORY:
        BATSE, OCCULTS

 CALLING SEQUENCE:
        more_occults, max_days, inradec=inradec, in_dir=in_dir,out_dir=out_dir

 CALLS:
	CHECKVAR [1], GET_OCC_ONDAY, PLOT_OCCS, checkvar [2]
 INPUTS:
       Max_days - maximum number of unprocessed days to process.

 OPTIONAL INPUTS:
 KEYWORDS:
	INRADEC: ra and dec of occultation source, J2000,
	default is for Crab, [83.516, 22.0197] 
	IN_DIR: occ*discsp data files are found on this directory. 
	default is '/service/batse/batse1/batse'
	OUT_DIR: occultation results files are written in this directory.
	default is '/usr/users/schwartz/occults/data/'
	FILPATH  - A directory path as an array for finding input and output files
	TDUR: 3 times in seconds.  1/2 occultation interval, default is [60.,90.,120.]
 OUTPUTS:
       The results of the occultations are written to files on OUT_DIR

 OPTIONAL OUTPUTS:
	none
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
       The results of the occultations are written to files on OUT_DIR
       They are of the form, occ_discsp_940728_2.rslts
 RESTRICTIONS:
	Only SDAC can write to BATSE_DISK1 the extracted file directory.	

 PROCEDURE:
	see purpose

 MODIFICATION HISTORY:
	Version 1, RAS, August 1995
	ras, 30 Sep 1996
	Version 3, ras, 6-dec 1996, added more tag info for DISCSP and changed
	count scaling (i.e. compressing float to 2-byte integer) constants to
	values from tag.
	Version 4, ras, 1-jan-1997, added tdur keyword


mrdfits_spectra $SSW/cgro/batse/idl/mrdfits_spectra.pro
[Previous] [Next]
 NAME: 
	
 PURPOSE:
	
 CALLING SEQUENCE:  
	mrdfits_spectra, file, start_time=start_time, end_time=end_time, counts=counts, $
		ut=ut, spec_str=spec_str, calib_str=calib_str
	
 INPUTS:
	
 OPTIONAL INPUTS:
	
 OUTPUTS:

 OPTIONAL OUTPUTS:

 CALLED BY:
	READ_CONT_FITS
 PROCEDURE:

 CALLS: ***
	CHECKVAR [1], FINDREC_4TIME, FXBCLOSE [1], FXBCLOSE [2], FXBOPEN [1], FXBOPEN [2]
	FXBOPEN [3], FXBREAD [1], FXBREAD [2], FXBREAD [3], FXPAR [1], FXPAR [2]
	MRDFITS [1], MRDFITS [2], TJD2YMD, UTIME [1], UTIME [2], YMD2TJD, anytim [1]
	anytim [2], anytim [3], anytim [4], anytim [5], checkvar [2]
 COMMON BLOCKS:

 RESTRICTIONS: designed to read continuous data files placed into spectral tables from BATSE, further mods to come

 MODIFICATION HISTORY: ras, 15-jul-1995
	


MSFC_HKG_STR $SSW/cgro/batse/idl/msfc_hkg_str.pro
[Previous] [Next]
 PROJECT:
	SDAC
 NAME:
       MSFC_HKG_STR

 PURPOSE: 
	This code defines the MSFC BATSE Housekeeping Structure and compact housekeeping structure

 CATEGORY: BATSE


 CALLING SEQUENCE: Not a procedure.


 CALLED BY:


 CALLS:
	none
 INPUTS:
       none explicit, only through commons;

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	This is not a procedure, but an included block.

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	ras, 28-jun-95
	VERSION 2, richard.schwartz@gsfc.nasa.gov, 6-sep-1997, reduced spares
	in msfc_hkg_str to 4 from 26, this agrees with the files.