FAST_LAD_DRM $SSW/cgro/batse/idl/fast_lad_drm.pro
[Previous] [Next]
 Project     : SDAC
                   
 Name        : FAST_LAD_DRM
               
 Purpose     : This function returns an interpolated DRM from a coarse grid.
               
 Category    : BATSE
               
 Explanation : Suitable for evaluation of low energy response (<100 keV), a table
	of DRMS is interpolated in angle and energy.
               
 Use         : drm = fast_lad_drm( edges, theta, edges_in)
    
 Inputs      : Edges- PHA edges in keV, 2 X Numer_of_channels
		suitable for closely spaced values.  not accurate for 
		integrating over large channels.  For those, sum over
		smaller spacings.
               Theta- zenith angle in degrees.
 Opt. Inputs : None
               
 Outputs     : Edges_in - photon energies for matrix
		Function returns standard BATSE LAD response matrix 
		in units of cnts/cm2/keV per photon/cm2

 Opt. Outputs: None
               

 CALLS: ***
	AVG [1], AVG [2], CHKLOG [1], CHKLOG [2], CONCAT_DIR [1], CONCAT_DIR [2]
	CONCAT_DIR [3], EXIST, INTERPOL, concat_dir [4]
 CALLED BY:
	MAP_DISCLA2CONT
 Common      : None
               
 Restrictions: 
               
 Side effects: None.
               
 Prev. Hist  :

 Modified    : Version 1, RAS, 25-sep-1997 


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

 NAME: 
       FAST_RATIO

 PURPOSE:
	This function returns the ratio between the the DISCSP FAST1 and
	FAST2 ratios according to Jim Matteson's pre-flight measurements.

 CATEGORY:
	BATSE

 CALLING SEQUENCE:


 CALLS: ***
	CHECKVAR [1], FCHECK, INTERPOL, checkvar [2]
 INPUTS:
       SLLD: Spec LLD digital value (SLLD)

 KEYWORDS:
	OPTIONAL INPUTS:
	USE- If set, then continue to use Matteson fast ratio
	NOUSE- IF set, then continue to use fast ratio of 2

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 CALLED BY:
	CALIBRATE [1], TEST_CAL
 COMMON BLOCKS:
	fast_ratio_com

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	Interpolation on stored values for ratio and SLLD.

 MODIFICATION HISTORY:
	Version 1, ras, 5-June-1996
	Version 2, ras, 12-nov-1996, added use, nouse switches


FAST_SPEC_DRM $SSW/cgro/batse/idl/fast_spec_drm.pro
[Previous] [Next]
 Project     : SDAC
                   
 Name        : FAST_SPEC_DRM
               
 Purpose     : This function returns an interpolated DRM from a coarse grid.
               
 Category    : BATSE
               
 Explanation : Suitable for evaluation of low energy response (<100 keV), a table
	of DRMs for the BATSE SPECs is interpolated in angle and energy.
               
 Use         : drm = fast_spec_drm( edges, theta, edges_in)
    
 Inputs      : Edges- PHA edges in keV, 2 X Numer_of_channels
		suitable for closely spaced values.  not accurate for 
		integrating over large channels.  For those, sum over
		smaller spacings.
               Theta- zenith angle in degrees.
 Opt. Inputs : None
               
 Outputs     : Edges_in - photon energies for matrix
		Function returns standard BATSE SPEC response matrix 
		in units of cnts/cm2/keV per photon/cm2

 Opt. Outputs: None
               

 CALLS: ***
	AVG [1], AVG [2], CHKLOG [1], CHKLOG [2], CONCAT_DIR [1], CONCAT_DIR [2]
	CONCAT_DIR [3], EXIST, INTERPOL, concat_dir [4]
 Common      : None
               
 Restrictions: 
               
 Side effects: None.
               
 Prev. Hist  :

 Modified    : Version 1, RAS, 25-sep-1997 


FCRYSTAL $SSW/cgro/batse/idl/fcrystal.pro
[Previous] [Next]
  Name:
       FCRYSTAL
  Purpose:

       This function calculates the energy loss in the NaI crystal given
        the light observed.  The light is assumed to be
                       L  =  E * g_c(E)
       where g_c and its derivative are provided. A simple Newton-Raphson
       algorithm is used on the assumption that the relation is very well behaved. 

  Category:
       BATSE
  Calling Sequence:
       result = fcrystal( olight )
   Inputs:
       olight
   Outputs:
       The result is the derived energy loss in keV
 CALLED BY:
	CALIBRATE [1], FCRYSTAL1, HXT_CAL_DRM [1], HXT_CAL_DRM [2], TEST_CAL
   Restrictions:
   Adapted from measurements made by UCSD on BATSE SPEC detectors.

 CALLS: ***
	G_C
   Common Blocks:
    none

  History:
   Written for FORTRAN by DLB, 10/2/91, IDL2 6/3/92 RAS
  


FCRYSTAL1 $SSW/cgro/batse/idl/fcrystal1.pro
[Previous] [Next]
  Name:
       FCRYSTAL1
  Purpose:

 	This function calculates the energy loss in the NaI crystal given
	 the light observed.  The light is assumed to be
           		L  =  E * g_c(E)
 	where g_c and its derivative are provided.  A simple interpolation
	 algorithm is used on the assumption that the relation is very well behaved.

  Category:
	BATSE
  Calling Sequence:
	result = fcrystal1( olight )
   Inputs:
	olight
   Outputs:
	The result is the derived energy loss in keV  
 CALLED BY:
	CALIBRATE [1], TEST_CAL
   Restrictions:
   Adapted from measurements made by UCSD on BATSE SPEC detectors.

 CALLS: ***
	EXIST, FCRYSTAL, G_C, INTERPOL
   Common Blocks:
    fcrystal1_com

  History:
c Version 1, adapted from fcrystal by ras, 16-Mar-1996
c
c*****************************************************************************


FDBREAD $SSW/cgro/batse/idl/fdbread.pro
[Previous] [Next]
 PROJECT:
	SDAC
 NAME:
	FDBREAD
 PURPOSE:
 	Procedure to read BATSE FDB files and return time, DISCLA, and angle
 	information.  The DISCLA data has been corrected for overflow and 
	divided by livetime.

 	You must supply the file name explicitly, the time you want, or the 
	flare number in order for fdbread to find the correct input file.  
	If you specify a file name or flare number, you may also specify 
	time start and end to restrict the amount of data returned.  If 
	you don't specify any times, fdbread will return all data in the 
 	fdb file. 
 	UTPLOT package times are set as follows:  base time is set to start 
	of day of the current data, start and end times are set to 0 for 
	autoscaling.
 CALLING SEQUENCE:
	fdbread, t, y, cosines	
 CATEGORY:
	BATSE
 OUTPUTS:
   t - (output)   array of times at middle of accumulation interval in 
                  seconds since start of day.  
                  Base time for UTPLOT routines will be set to 0h 0m
                  on day of data. (Function GETUTBASE(0) will return base 
                  time in seconds since 79/1/1.) 
   y - (output)   (i,j,n) floating point array of discla data where
                  i=6 - channels 1-4 (energy bins 25-50, 50-100, 100-300, and
                        >300 keV), $
			 NaI-(channels 1-4 +CPD, effectively 15-25 keV), and CPD
                  j=8 - LADs 1 through 8
                  n - number of data intervals 
   cosines - (output) floating point array of cosine of angles between 8 LADs
                  and Sun (cosines(j) corresponds to y(*,j,*)

 OPTIONAL KEYWORD INPUTS:
   filename -  string FDB file name
   starttime - start time of data to accumulate in r*8 seconds 
               since 79/1/1,0 or as ASCII string 'YY/MM//DD,HHMM:SS'.
   endtime -   end time of data to accumulate. See starttime above for format.
   flare -     BATSE flare number to accumulate data for
   verbose -   0/1 means don't/do print accumulation times message

 OPTIONAL KEYWORD OUTPUTS:
   livetime -  (8,n) floating point array of live time in seconds for 
               each LAD for each data interval 
   error -     (keyword output) =0/1 means no error / error
   cos_spec -  (output) floating point array of cosine of angles between 8 SPECs
                  and Sun (cos_spec(j) corresponds to y(*,j,*)
		The cosines are selected from the start of the time interval
		which could be in error if there is a pointing change
		which comes about once every two weeks.
   USEBDB   -  If set, will use .bdb file if user has privilege
 CALLS: ***
	CHECKVAR [1], CHECK_OVERFLOW, DET_POINT, DN_TRANS, FCHECK, FS_OPEN [1], FS_OPEN [2]
	FS_READ_DD, GETUTBASE [1], GETUTBASE [2], JUMPER, LIVETIME [1], Livetime [2]
	RADEC_FILL, RESTORE_OVERFLOW, SETUTBASE [1], SETUTBASE [2], SETUTEND [1]
	SETUTEND [2], SETUTSTART [1], SETUTSTART [2], anytim [1], anytim [2], anytim [3]
	anytim [4], anytim [5], checkvar [2]
 CALLED BY:
	ASCII_RATES, Load_sher, MAP_DISCLA2CONT, MEMORY_INTRVLS, PLOTBATSE, PLOTBATSE_QL
 MODIFICATION HISTORY:

 Kim Tolbert  8/15/91
 Modified 9/6/91 by KT to add filename and livetime keyword parameters and
 to change time array to seconds since start of day; day is stored
 as base time in UTPLOT software (retrieved by utbase=getutbase(0)).
 Modified 3/24/93 by KT to handle omni mode data.
 Modified 10/93 by KT. New calling arguements to fs_open.  Call 
 fs_read_dd instead of fs_readbdb.  Add verbose keyword argument.
 ras, 8-sep-95, passes out the cosines for the SPECs, too.
 ras, allow bdb file, use anytim on starttime and endtime
 ras, made channel 4 (DISCLA5) differential, 11-dec-1995
 ras, moved zero-checking to RESTORE_OVERFLOW, 15-dec-1995
 ras, 27-mar-1996, removed setup_arrays (setup_batse_arrays)
 Version 10, fixed overflow time selection, richard.schwartz@gsfc.nasa.gov, 24-feb-1998.
 Version 11, Added informational text for the user, eva@kano.nascom.nasa.gov, 28-jan-2000.


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

 NAME: 
       FDR_MSFC_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:


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

 NAME: 
       FDR_SDAC

 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:


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

 NAME: 
       FDR_SDAC_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:


FILE2FLARE $SSW/cgro/batse/idl/file2flare.pro
[Previous] [Next]
  Name:
       FILE2FLARE
 function to get the flare number from the SDAC standard format file names.
 i.e. whatever.xxx_flare for fdb, cont, discsp.  Returns flare number of
 0 if it can't figure it out.
 K Tolbert 
 CALLS:
 CALLED BY
	ASCII_RAW, DISCSP_READ, FSPLOT, FS_ACC_CONT, FS_ACC_DISCSP, FS_GRAPH, GRABDATA


FILELIST $SSW/cgro/batse/idl/filelist.pro
[Previous] [Next]
  Name:
       FILELIST
 filelist routine lists all FDB or BDB files on BATSE_DATA.
 calling arguments:
   dd_type = 0/1 means BDB or FDB files

 Kim Tolbert 4/18/91

 Modified 
 AES 94/8/17 when looking for files, findfile uses the filetype
 	in the directory logical (e.g. BATSE_ + filetype = BATSE_CONT).  also 
	uses concat_dir to enable UNIX usage.

 AES 96/3/26 fixed error in chklog call (under findfile) 
 CALLS:
 CALLED BY
	FSPLOT, RAWDUMP, pro ratesdump


FIND_DBFILE $SSW/cgro/batse/idl/find_dbfile.pro
[Previous] [Next]
  Project:
	SDAC
  Name:
       FIND_DBFILE


 PURPOSE:       This procedure returns the full BATSE archive filename from a variety of
	input formats.


 CATEGORY:    BATSE, database


 CALLING SEQUENCE:
	find_dbfile, instring, start, dd_open, dd_type, sec_st, sec_to, sec_en, $
    error = error

 CALLED BY:


 CALLS: ***
	ATIME [1], ATIME [2], LOC_FILE [1], LOC_FILE [2], LOC_FILE [3], PARSE_COMLINE
	READ_FLARE, SETUT [1], SETUT [2], TJD2YMD, UTIME [1], UTIME [2], anytim [1]
	anytim [2], anytim [3], anytim [4], anytim [5], curdir [1], curdir [2]
 INPUTS:
       instring - input string from fsplot of form
		inp,filename
		inp,f, 0123
		inp,t, 91/06/4, 3:30:00
	dd_open - structure containing file info
	start   - position after first comma in INSTRING
	dd_type - type of data requested 'BDB', 'FDB', 'CONT', 'DISCSP'  or 0,1,2,3

 OPTIONAL INPUTS:
	none

 OUTPUTS:
	sec_st - file start time - in seconds from 1-jan-1979
	sec_to - file total time in seconds
	sec_en - file end time - in seconds from 1-jan-1979

 OPTIONAL OUTPUTS:
	error -

 CALLED BY:
	FSOC, FSPLOT, NEXTBDB, PLOT_FLARE, RATESDUMPOC, RAWDUMP, RAWDUMPOC, WRITE_DD, WRITE_FDB
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
 User can pass filename, time, flare #, tjd, or yy/mm/dd,seconds of day,
 and this opens the file and returns the file name and start/end/total times of
 the file in calling arguments.

 MODIFICATION HISTORY:
 Shelby Kennard                                26Mar1991
 Mod. by akt 6/26/91 to call flare_f_name if user has requested a particular
 	flare and the database type is FDB. (FDB files were renamed according
 	to their flare number, yymmdd_hhmm.fdb_xxx, 6/25/91)
 VERSION 3, richard.schwartz@gsfc.nasa.gov, 4-sep-1997,
	used parse_comline to parse instring, used loc_file to incorporate
	default paths using environmentals and the current directory.
	using tjd2ymd for tjd time converstion.


FIND_GOOD_OCCS $SSW/cgro/batse/idl/occults/find_good_occs.pro
[Previous] [Next]

 NAME: 
	FIND_GOOD_OCCS

 PURPOSE:
	Find the occultations for the source during the input time interval.

 CATEGORY:
	BATSE, OCCULTS 

 CALLING SEQUENCE:
	find_good_occs, start_time, end_time, ut_occs, occ_type, inradec=inradec, $
	det_id=det_id
   

 CALLED BY:


 CALLS: ***
	CHECKVAR [1], GET_OCCS, INTERPOL, OCC_PROFILE, ORBIT_FILL, READ_OCC_DISCSP, SPHCART
	anytim [1], anytim [2], anytim [3], anytim [4], anytim [5], checkvar [2]
 INPUTS:
       none explicit, only through commons;

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       ut_occs	- time of occultation
	occ_type- type of occult, 1 going into day, 0 into night

 KEYWORDS:
	INRADEC - Source location J2000, ra and dec in degreees
	DET_ID  - Specify det_id for occ_discsp file
	ERROR   - problem if set on return
	SC_OCC  - Spacecraft coordinates at time of occultations
	XRADECS -
	ZRADECS -
	UTCHANGE-
 OPTIONAL OUTPUTS:
	none

 CALLED BY:
	GET_OCCS, GET_OCC_ONDAY
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Version 2, ras, 29-mar-1996, changed o_angle to vector
	Version 3, ras, 19-sep-1996, call read_occ_discsp with /hkg
	keyword inheritance into read_occ_discsp


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

 PURPOSE:


 	This procedure returns the record number in a BATSE Daily Dataset (DD) stream
	which contains the given time or the following record number if the time
	occurs in a gap.



 CATEGORY:
       BATSE

 CALLING SEQUENCE:


 CALLS: ***
	CONV_VAX_UNIX, SC_SECONDS_ED, SIZE_STRUCT, TAG_EXIST [1], TAG_EXIST [2]
	anytim [1], anytim [2], anytim [3], anytim [4], anytim [5]
 INPUTS:
 	Sec_find - time to search for. Format readable by ANYTIM.
 	Dd_open -  structure containing info about open file including number 
            of data records in file

 OPTIONAL INPUTS:
	none

 OUTPUTS:
 rec_found  -  returns record number containing start time (or first after)

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
 	error -    0/1 means no error/error
	none
 CALLED BY:
	ASCII_RAW, BATSE_POINTING, BAT_MERGE, FS_READ_DD, QL_READBDB, READ_OCC_DISCSP
	WRITE_DD, WRITE_FDB, read_dd, xzchange
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	After an initial guess, a binary search is performed to find the record.

 MODIFICATION HISTORY:

 Kim Tolbert 4/28/91

 ras, 17-apr-95, make it compatible with stream files for vms/unix
 reconcile with read_dd, using conv_vax_unix identically
	Version 3, richard.schwartz@gsfc.nasa.gov, 12-aug-1997, use conv_vax_unix
	Version 4, richard.schwartz@gsfc.nasa.gov, 4-sep-1997, reconcile new conv_vax_unix
	add check for pad_byte
 ras, 4-dec-1997, protect against dd_open without filename tag.


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

 NAME: 
       FIND_TANGENT

 PURPOSE:


 CATEGORY:
       BATSE

 CALLING SEQUENCE:


 CALLS: ***
	POLYZ, POLY_FIT, ZBRENT [1], ZBRENT [2]
 INPUTS:
       none explicit, only through commons;

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 CALLED BY:
	OCCTIME
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:


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

 NAME: 
       FIX_CONT

 PURPOSE:


 CATEGORY:
       BATSE

 CALLING SEQUENCE:


 CALLS: ***
	BATSE_DEADTM, DET_POINT, F_DIV, RESTORE_OVERFLOW
 INPUTS:
       none explicit, only through commons;

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 CALLED BY:
	CONT_READ, FS_ACC_CONT
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:


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

  Name:
       FIX_CONT2


 PURPOSE:  perform corrections on cont data
	    works on cont data not in BATSE common blocks.

 CATEGORY: BATSE,SPEX


 CALLING SEQUENCE:
	 FIX_CONT2, cont, cos_arr, splive,count_bad=count_bad, error=error


 CALLED BY:


 CALLS: ***
	BATSE_DEADTM, DET_POINT, F_DIV, RESTORE_OVERFLOW
 INPUTS:
       cont - raw cont data, fltarr(16,8,nbins)
	cos_arr- 8 detector cosines for LADs

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       cont - returns corrected values
       clivet - live time array
 OPTIONAL OUTPUTS:
	error - if set then there was a problem

 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
    	ras, 21-sep-95, based on fix_cont


FIX_CONT_CODE $SSW/cgro/batse/idl/fix_cont_code.pro
[Previous] [Next]
  Name:
       FIX_CONT_CODE
FIX_CONT_CODE.PRO
This is the common code area for fix_cont2.pro and fix_cont.pro
They are different because one has passed variables (fix_cont2) and
the other takes its variables from common.

 ras, 29-sep-1995
 ras, 15-dec-1995, restore_overflow modifications


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

 NAME: 
       FIX_DISCSP

 PURPOSE:


 CATEGORY:
       BATSE

 CALLING SEQUENCE:


 CALLS: ***
	BATSE_DEADTM, F_DIV, RESTORE_OVERFLOW
 INPUTS:
       none explicit, only through commons;

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 CALLED BY:
	DISCSP_READ, FS_ACC_DISCSP
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:


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

  Name:
       FIX_DISCSP2


 PURPOSE:  perform corrections on discsp data
	    works on discsp data not in BATSE common blocks.

 CATEGORY: BATSE,SPEX


 CALLING SEQUENCE: fix_discsp2, discsp, sp_cos8, splivet,count_bad=count_bad, error=error


 CALLED BY:


 CALLS: ***
	BATSE_DEADTM, F_DIV, RESTORE_OVERFLOW
 INPUTS:
       discsp - raw discsp data, fltarr(4,8,nbins)
	sp_cos8- 8 detector cosines for SPECs

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       discsp - returns corrected values
       splivet - live time array
 OPTIONAL OUTPUTS:
	error - if set then there was a problem

 CALLED BY:
	PLOTBATSE_QL, Shers_load [1]
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
    	ras, 21-sep-95, based on fix_discsp


FIX_DISCSP_CODE $SSW/cgro/batse/idl/fix_discsp_code.pro
[Previous] [Next]
  Name:
       FIX_DISCSP_CODE
FIX_DISCSP_CODE.PRO
This is the common code area for fix_discsp2.pro and fix_discsp.pro
They are different because one has passed variables (fix_discsp2) and
the other takes its variables from common.

 ras, 29-sep-1995
 ras, 15-dec-1995 restore_overflow mod


fix_Mailaddr $SSW/cgro/batse/idl/fix_mailaddr.pro
[Previous] [Next]
NAME:
	fix_Mailaddr

PURPOSE:
	Fixes e-mail addresses for vms on alpha
	also defaults to asking user if they want to enter a new mail address

KEYWORD INPUTS
	mailaddr, contains the email address to fix
	prompt, if set means that email value is empty prompt user for one
	automail, if set will not prompt user unless they forgot to include
	 an email in their script
	
KEYWORD OUTPUT
	fixedaddr, contains the fixed address

Modification History

 Mod. 8/9/94 by Amy Skowronek to add three quotes to IP addresses.  User
 only needs to put in their regular address, e.g. joe@net.com
 Mod 8/9/94 by AES to check for new address before trying to send mail.
 Mod 5/6/96 by EAC to add keyword automail for noninteractive operation,
  user will still be prompted if no mailaddr is present
 CALLED BY
	MAILPLOT, Mailfile, QLDISPLAY


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

 NAME: 
       FLARE_CATALOG

 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:


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

 PURPOSE:
 	This procedure finds the data file (fdb, cont, or discsp) for a requested flare.

 CATEGORY:
       BATSE

 CALLING SEQUENCE:
	flare_f_name, flare, dd_open, filename, error=error

 CALLS: ***
	BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], CHKLOG [1], CHKLOG [2]
	LOC_FILE [1], LOC_FILE [2], LOC_FILE [3], PARSE_ATIME [1], READ_FLARE
	break_file [4], parse_atime [2], wc_where [1], wc_where [2]
 INPUTS:
   flare_n    - (input)  flare number for which to find file
   dd_open    - (input)  dd_open.type contains type of file to find: 1/2/3 = fdb/cont/discsp

 OPTIONAL INPUTS:
	none

 OUTPUTS:
   filename   - (output) string containing file name found for flare

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
   error      - (output) =1 if error finding file for flare, 0 otherwise
 CALLED BY:
	FS_OPEN [1]
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
 Can't use this for bdb files because they don't have the flare number
 in the file name.  For bdb files, FIND_DBFILE gets the time for the
 flare and then calls TIME_F_NAME.


 PROCEDURE:
	none

 MODIFICATION HISTORY:
 Kim Tolbert
  Mod 4/27/95 by AES - added ending check to accommodate different
	file endings (i.e ';','.',' ') across platforms and avoid
	getting wrong flare through flarenum* scenario
  ras, 19-jun-95, used break_file to parse out filename
	richard.schwartz@gsfc.nasa.gov, 9-oct-1997, cleaned bug in
	file selection and default to highest version number on multiple versions.
	2-aug-2001 ras, modified search strings,


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

 NAME: 
       FLARE_FDB

 PURPOSE:


 CATEGORY:
       BATSE

 CALLING SEQUENCE:


 CALLS: ***
	ATIME [1], ATIME [2], CHKLOG [1], CHKLOG [2], CONCAT_DIR [1], CONCAT_DIR [2]
	CONCAT_DIR [3], batse_read_cat, 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:


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

 NAME: 
       FLARE_LATEST

 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
 CALLED BY:
	FLIST
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:


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

 NAME:
	FLARE_LIST

 PURPOSE:
	This procedures prints a formatted list of catalog values for the
	input flare list.  Prints to screen or file.

 CATEGORY:
	BATSE

 CALLING SEQUENCE:
	flare_list, good, latest=latest, htmlout=htmlout

 CALLS: ***
	ATIME [1], ATIME [2], CHKLOG [1], CHKLOG [2], CONCAT_DIR [1], CONCAT_DIR [2]
	CONCAT_DIR [3], PAGE_PRINT, SETLOG, SYS2UT, concat_dir [4], curdir [1], curdir [2]
 INPUTS:
       Good: Vector of flare catalog indices found in FLARE_CATALOG common
       writebatse:  Name of the output file to print to

 OPTIONAL INPUTS:
	LATEST: (input) = 1 means we're just printing the 10 latest flares
               (format of output is slightly different from normal).

 OUTPUTS:
       Creates a file BATSE_FLARES.out to the directory specified by BATSE_OUT
		environment Variable.

 OPTIONAL OUTPUTS:
	HTMLOUT = If set, creates BATSE_FLARES.html to BATSE_OUT
       0: no link, 1: GIF and PS links

 CALLED BY:
	DO_ALANSLIST, DO_EVENTLISTS, FLIST
 COMMON BLOCKS:
	FLISTCOM, FLARE_CATALOG

 SIDE EFFECTS:
	BATSE_OUT will be set to sys$login for vms and $PWD for unix if not
	preset. If BATSE_OUT is set to be other than your local directory,
		you won't see it unless you know where to look;

 RESTRICTIONS:
	Better be able to open a file in BATSE_OUT.

 PROCEDURE:
	none

 MODIFICATION HISTORY:
 Kim Tolbert  6/91
 Mod. by S Kennard to print UNKNOWN for peak rate or total counts if = 1.
 Mod by KT 3/25/93 to print unknown for peak and/or totalcounts if = 1.e13.
 Mod by KT 1/94 to print burst trigger number instead of total counts.
 Mod by Amy Skowronek 94/7/11 - replaced call to pprint with call to
 	pageprint (pprint has been renamed to pageprint)
 Mod by EC 5/6/96 to send output to BATSE_OUT to allow redirection of
 	output to web directories
 Mod by EC 5/14/96 to create and html file with links to GIF and PS files
 	on demand
 Mod by EC 5/15/96 add variable writebatse which holds output file name
  	and add variables 2 and 3 to htmlout
 	[variable is redundantly set in flist.pro to allow joint or seperate
  	operation of these programs]
	FORMAL DOCUMENTATION, RAS, 31-MAR-1996
 Mod by RCJ 19/03/97 due to html remodeling, htmlout options are now only 0
	and 1. Made room for variable totcounts.


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

 NAME: 
       FLARE_MARK

 PURPOSE:


 CATEGORY:
       BATSE

 CALLING SEQUENCE:


 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3], POINT [1], VERT_LINE, point [2]
 INPUTS:
       none explicit, only through commons;

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       F_start: start time  of flare interval in seconds from utbase
	F_end: end time of flare interval in seconds from utbase
	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!


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

 NAME: 
       FLARE_SAVE_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:


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

 NAME: 
	FLARE_SELECT

 PURPOSE:
 flare_select finds the flares with the user-specified selection criteria.
 Includes finding the flares within the time interval requested by the user
 as in flare_select for which sec_st and sec_en in common flistcom are start 
 and end seconds (relative to 79/1/1,0) of requested time interval.
 calling arguments:


 CATEGORY:
	BATSE

 CALLING SEQUENCE:
	FLARE_SELECT, Good, INP_GOOD=INP_GOOD, SORT_ITEM=SORT_ITEM, $
	   USE_CRITERIA=USE_CRITERIA

 CALLS:
	none
 INPUTS:
   Good - output array of indices into data array where peak of flares are 
          within requested times and also meet other user-specified criteria

 OPTIONAL INPUTS:
 KEYWORDS:
   INP_GOOD - input array of indices to do selection on.
   SORT_ITEM - string of parameter item to sort by
   USE_CRITERIA - 1/0 means use /don't use selection criteria other than
      time when selecting flares.  Some programs (like do_eventlists) don't
      have those limits defined.
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 CALLED BY:
	DO_ALANSLIST, DO_EVENTLISTS, FLIST, SHOW_FLARE
 COMMON BLOCKS:
	FLISTCOM, FLARE_CATALOG
	

 SIDE EFFECTS:
	sets !quiet

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
 Kim Tolbert  3/91
 Modified by Erika Lin 9/92 to select flares from user-specified indices of 
 catalog based on user-specified criteria other than just start and end times
 and to sort by any parameter item, not just by time.
 Mod. by K.T. 9/25/92 to add use_criteria keyword so that programs outside
 of flist can still call flare_select without having to define the selection
 limits for criteria other than time.
 Formalized documentation, ras, 31-apr-1996


FLDISPLAY $SSW/cgro/batse/idl/fldisplay.pro
[Previous] [Next]
 Project     : SDAC
                   
 Name        : FLDISPLAY
               
 Purpose     : This procedure finds and displays the archived BATSE flare plots.
		Option 3 on the batse_menu, displays archived flare plots.
               
 Category    : BATSE
               
 Explanation : The user is given a menu of options and commands.  The command
		is selected and an action is taken.
               
 Use         : FLDISPLAY
    
 Inputs      : 
               
 Opt. Inputs : None
               
 Outputs     : None

 Opt. Outputs: None
               
 Keywords    : FLARE - plot this flare number.
		COMBINED - sum both traces together in plot.
		PMULTI - set !p.multi to this.
		FIDUCIAL_MARK - if set display mark at trigger time.
		TRIGGERX- if set indicate BATSE/MSFC burst trigger number.
		CREATE_PLOTFILE- if set do this.
		NOEXIT	- if set remain in program.

 Calls       : ***
	ALPHA_PAGE [1], ALPHA_PAGE [2], BATSE_TIME_INPUT, CHECKVAR [1], CHKLOG [1]
	CHKLOG [2], CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], DEL_PLOTFILE
	FLSTRING_TYPE, FSELECT, FS_ARCHIVE_DRAW, FS_ARCHIVE_RW, LOC_FILE [1], LOC_FILE [2]
	LOC_FILE [3], MAILPLOT, MORE [1], MORE [2], Mailfile, PARSE_COMLINE, PATH_DIR
	READ_SEQFILE, SELECT_DEV, SET_GRAPHICS [1], SET_GRAPHICS [2], TEK_PRINT [1]
	TEK_PRINT [2], TIME_ARC_NAME, YOHKOH_FORMAT [1], YOHKOH_FORMAT [2]
	batse_read_cat, checkvar [2], concat_dir [4], curdir [1], curdir [2], hxrbs_format
	yohkoh_format [3]
 CALLED BY:
	batse_menu
 Common      : Flare_catalog, Fscom, Remotecom
               
 Restrictions: 
               
 Side effects: None.
               
 Prev. Hist  :

 Modified    : 
   Modified 10/13/94 by AES  If a long window exists when fldisplay starts,
    replaces it with a standard size window.  This compensates for fsplot,
    which creates a long window for its multiple plot option. 
   Modified 6/28/95 by AES check OS before printing filename
   Modified 8/29/95 by AES goto start after mailing file
	Version 4, RAS, 17-March-1997, documentation header added
 VERSION 5, richard.schwartz@gsfc.nasa.gov, 26-aug-1997,
 used loc_file with path_dir('batse') to locate help files.
 Version 6, richard.schwartz@gsfc.nasa.gov, 18-mar-1998, specify window number from current. 
 Version 7, richard.schwartz@gsfc.nasa.gov, 7-may-1998, use batse_time_input() to allow for
	various time input formats to be translated in HXRBS format. 


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

 PURPOSE:
	Flist allows users to display BATSE flares with user-specified 
	parameters.	

 CATEGORY:
	BATSE

 CALLING SEQUENCE:
	Flist

 CALLS: ***
	CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], FLARE_LATEST, FLARE_LIST
	FLARE_SELECT, FLISTOC, FSELECT, LOC_FILE [1], LOC_FILE [2], LOC_FILE [3], MORE [1]
	MORE [2], Mailfile, PATH_DIR, READ_SEQFILE, SYS2UT, TYPE_FLARE, YOHKOH_FORMAT [1]
	YOHKOH_FORMAT [2], anytim [1], anytim [2], anytim [3], anytim [4], anytim [5]
	batse_read_cat, concat_dir [4], curdir [1], curdir [2], hxrbs_format
	yohkoh_format [3]
 INPUTS:
       none, only through keywords.

 OUTPUTS:
       Writebatse: Name of output file. It will be batse_flares.out if 
		htmlout=0 and batse_flares.html if htmlout=1

 KEYWORDS:
       INCOMMANDS: Same as RAS in fplot/fsoc program, allows user to enter 
		commands w/out interaction.
       	Syntax is:
         	incommands=['commands','param,value']
	   	specify 'exit' if you don't want to get dumped back to the 
		interface. DO NOT set the first element of incommands to ''. 

       HTMLOUT: If set, will write output to BATSE_FLARES.html, with 
		hypertext links to appropriate gif and ps archive plots
        	Values of HTMLOUT:     0: no link, 1: GIF and PS links

	LATEST: If set, will list 10 latest flares.

 CALLED BY:
	FSPLOT, batse_menu
 SIDE EFFECTS:
	Output will be sent to BATSE_OUT, if not defined it will be
 		sys$login for vms and $PWD for Unix (see flare_list.pro)
		In flistoc.pro , incommands is always set, but if it is '', 
		then it will run in interactive mode.

 PROCEDURE:
       none

 MODIFICATION HISTORY:
	Written by Kim Tolbert 3/91
 	Mod. by Erika Lin 9/92 to select flares from catalog based on user-
   		specified criteria in addition to start and end times.
 	Mod. 1/10/94 by AKT to call hxrbs_format (for ASCII time format) and
   		then restore original time format on exit. 
  	Mod. by Eric Carzon 5/6/96 setup to take commands directly from a 
		Web interface 
   	Mod. EAC - Copy RAS's Incommands=incommands methodology to allow for
         	a noninteractive operation, new keyword automail
   		See also modifications to flistoc, flare_list, and mailit 
   	Mod. EAC - 5/14/96 Add keyword htmlout for producing hypertext output
   	Mod. EAC -5/15/96 New variable writebatse to toggle between .html 
		and .out file extensions for the output, add vals to 
		htmlout,see mod. to flare_list
   		[Note that writebatse is redundantly set in both progs. 
		to allow the seperate operation of each program]
	Mod. by RCJ 03/97 We decided against automail for html.
		Rearranged documentation.
	VERSION 9, richard.schwartz@gsfc.nasa.gov, 26-aug-1997,
	used loc_file with path_dir('batse') to locate help files.


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

 NAME: 
       FLISTCOM

 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:


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

 PURPOSE:
 	Flistoc is operator communications for flist routine which lets users
 		display BATSE flares with user-specified parameters.

 CATEGORY:
	BATSE

 CALLING SEQUENCE:
	Flistoc, cmnd, listoc

 CALLS: ***
	ATIME [1], ATIME [2], BATSE_TIME_INPUT, CHECKVAR [1], GETUT [1], GETUT [2]
	PARSE_COMLINE, SETUT [1], SETUT [2], SYS2UT, anytim [1], anytim [2], anytim [3]
	anytim [4], anytim [5], checkvar [2]
 INPUTS:
       Listoc: 0/1 means don't/do print entire menu.

 OUTPUTS:
       Listoc: 0/1 means don't/do print entire menu.
	Cmnd: 3-character command entered by operator.

 KEYWORDS:
  	INCOMMANDS: RAS method of allowing noninteractive access to program
  		The syntax is: incommands=['command','param,var']
  		If incommands(0) is '', then flist will behave interactively!

 CALLED BY:
	FLIST
 PROCEDURE:
       none

 MODIFICATION HISTORY:
 	Kim Tolbert  3/91
 	Mod. by Erika Lin 9/92 to select flares from catalog based on user-
   		specified criteria in addition to start and end times.
 	Mod. by EAC 4/96 to use RAS's incommands keyword for noninteractive 
		operation
	Mod. by RCJ 03/97. Rearrange documentation.
       Version 5, richard.schwartz@gsfc.nasa.gov, now accepts all ANYTIM compatible time strings for
       time parameters  START, and END.


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

 NAME: 
       FLSTRING_TYPE

 PURPOSE:


 CATEGORY:
       BATSE

 CALLING SEQUENCE:


 CALLS: ***
	PARSE_COMLINE, UTIME [1], UTIME [2]
 INPUTS:
       none explicit, only through commons;

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 CALLED BY:
	FLDISPLAY
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:


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

 PURPOSE:
	Reads and corrects BATSE DISCLA data
	Try to use the active, present tense.

 CATEGORY:
	BATSE

 CALLING SEQUENCE:
	FS_ACC


 INPUTS:
	None explicit, Control parameters are in common in FSCOM
	
 KEYWORD PARAMETERS:
	ERROR

 OUTPUTS:
	Data values are placed in common in fs_saveccum

 CALLS: ***
	CHECK_OVERFLOW, DET_POINT, DN_TRANS, FS_READ_DD, JUMPER, LIVETIME [1], Livetime [2]
	RADEC_FILL, RESTORE_OVERFLOW
 CALLED BY:
	FSPLOT, PLOT_FLARE
 COMMON BLOCKS:
	fscom
	fs_saveaccum

 RESTRICTIONS:
	Maximum size of data array to be read is initiated by SETUP_ARRAYS

 PROCEDURE:
	fs_acc accumulates BATSE data in the fsplot program. The accumulated
	data is in common fs_saveaccum.  The discla array is corrected for
	overflow and livetime. 


 MODIFICATION HISTORY:
 Written by Shelby Kennard & Kim Tolbert

 Mod. 11/18/91 by K.T.  The SECONDS array contains the midpoint
 of the 1.024 second data accumulation, and has twice as many elements
 as the position arrays (XPOS, YPOS, XRA, etc.) which are available only
 every 2.048 seconds.  When SECONDS is used for the position arrays, need
 to add .512 seconds to each time so that the time will be at the center
 of the 2.048 second interval corresponding to the position data.

 Mod. 10/4/93 by K.T. Call fs_read_dd instead of fs_readbdb.

 Mod. 07/1/94 by A.E.S. Refer to channels starting from 0 rather than 1.
 Affects only comments, not code.
 ras, 15-dec-95, new call to restore_overflow
 aes, 29-jul-96, checked to make sure wnzero isn't -1 before multiplying


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

 NAME: 
       FS_ACC_CONT

 PURPOSE:
	fs_acc_cont accumulates BATSE CONT data in the fsplot program. 

 CATEGORY:
       BATSE

 CALLING SEQUENCE:
	FS_ACC_CONT

 CALLS: ***
	CHECK_OVERFLOW, DN_TRANS, FILE2FLARE, FIX_CONT, FS_OPEN [1], FS_OPEN [2], FS_READ_DD
	SETUTBASE [1], SETUTBASE [2], anytim [1], anytim [2], anytim [3], anytim [4]
	anytim [5]
 INPUTS:
       none explicit, only through commons;

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	ERROR - set if there is a problem.
 CALLED BY:
	FSPLOT
 COMMON BLOCKS:
	FSCOM, FS_SAVEACCUM, FS_SAVEPLOT

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
 The accumulated data is saved in common fs_saveaccum.  The CONT array is 
 corrected for overflow and livetime. 

 MODIFICATION HISTORY:
 Written by Kim Tolbert   11/93
 Modified 7/7/94 by Amy Skowronek so that detectors are referred to as 0-7
 when not aspect ordered and channels are always referred to as 0-(n-1)

 mod. amplifier dead time ras, 9-jul-94
 mod. 8/24/94 by AES  to call fix_cont to perform livetime and overflow
 calculations
 ras, 17-apr-95, changed to stream files for vms/unix compatibility
 Mod. 02/23/95 by RCJ to call 'fix_cont, cont_livet' instead of
                      'fix_cont, clivet'

	Version 7, richard.schwartz@gsfc.nasa.gov, revise documentation, 26-sep-1997.


FS_ACC_DISCSP $SSW/cgro/batse/idl/fs_acc_discsp.pro
[Previous] [Next]
 PROJECT:
	SDAC
  Name:
       FS_ACC_DISCSP


 PURPOSE:
	accumulates BATSE DISCSP data in the fsplot program. The 
 	accumulated data is saved in common fs_saveaccum.  The DISCSP array is 
 	corrected for overflow, differences are taken, and livetime is corrected.
               

 CATEGORY: batse


 CALLING SEQUENCE: 
	fs_acc_discsp, error=error

 CALLED BY:


 CALLS: ***
	BATSE_POINTING, CHECK_OVERFLOW, DET_COSINES, DN_TRANS, FILE2FLARE, FIX_DISCSP
	FS_OPEN [1], FS_OPEN [2], FS_READ_DD, GET_SPEC_GAIN, SETUTBASE [1], SETUTBASE [2]
	anytim [1], anytim [2], anytim [3], anytim [4], anytim [5]
 INPUTS:
       none explicit, only through commons;

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 CALLED BY:
	FSPLOT
 COMMON BLOCKS:
	fscom, fs_saveaccum, fs_saveplot

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
 Written by Kim Tolbert   11/93

 Mod. by AES 6/28/94 to make det_sav=dsp_det_arr because detector id's are 
 referred to as 0-7 rather than 1-8 when passed in (for sensitivity dis-
 abled ordering)
 Mod by AES 8/24/94 to call fix_discsp to perform livetime and overflow
 calculations
 ras, 17-jul-1995, made mods to allow use for non-fdb times
 ras, 28-may-1996, fixed bug in conditions test prior to opening file
 richard.schwartz@gsfc.nasa.gov, relaxed angular restrictions on sensitivity
 	from 70 to 74 degrees.  15-mar-1998


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

 NAME: 
       FS_ACC_GOES

 PURPOSE:


 CATEGORY:
       BATSE

 CALLING SEQUENCE:


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

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 CALLED BY:
	FSPLOT
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:


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

 NAME: 
       FS_ARCHIVE_DRAW

 PURPOSE:
 Plot of BATSE archive data using the operator selected channels, detectors,
 and sample average over the operator selected time range.


 CATEGORY:
       BATSE

 CALLING SEQUENCE:
	FS_ARCHIVE_DRAW

 CALLS: ***
	ALPHA_PAGE [1], ALPHA_PAGE [2], ATIME [1], ATIME [2], CH_SCALE, DRAW_FLARE
	FCOLOR [1], GETUTBASE [1], GETUTBASE [2], GET_TRIG, PL_SCALE, SET_GRAPHICS [1]
	SET_GRAPHICS [2], TEK_END [1], TEK_END [2], TEK_INIT [1], TEK_INIT [2], VERT_LINE
	XDEVICE, fcolor [2], linecolors [1], linecolors [2]
 INPUTS:
       none explicit, only through commons;

 OPTIONAL KEYWORD INPUTS:
	CHANNELS - if set, plot two channels separately.
	FLARE    - archive flare number.

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

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

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
 Plot of BATSE archive data using the operator selected channels, detectors,
 and sample average over the operator selected time range.
 Data is entered through the common block savecommon
 to enable quick plotting of archived files in a device independent 
 manner.

	

 MODIFICATION HISTORY:
 Modified 7/11/94 by Amy Skowronek - Channels are now referred to starting 
 from 0 - so old channel 1 is now channel 0.
 Modified 8/18/94 by AES - Uses getenv instead of trnlog.
 Modified 25-aug-94 by ras - temporary xstyle=0 patch for bug in v3.6.1
 Modified 16-sep-94 by AES - removed xstyle=0 patch for bug in v3.6.1
 Modified 28-jun-95 by AES - make filenames lowercase
 Version 8, 2-feb-1998, richard.schwartz@gsfc.nasa.gov, added xdevice protection
	on set_plot call.


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

 PURPOSE:
	This procedure compresses and decompresses the BATSE archive flare quicklook
	data files.

 CATEGORY:
	BATSE

 CALLING SEQUENCE:
     fs_archive_rw, file=files(0), /read
     fs_archive_rw, filename=savefile, /write


 CALLS: ***
	ATIME [1], ATIME [2], CHECKVAR [1], FIND_IX, FORM_FILENAME [1], FORM_FILENAME [2]
	GETUT [1], GETUT [2], GETUTBASE [1], GETUTBASE [2], LOC_FILE [1], LOC_FILE [2]
	LOC_FILE [3], SETUT [1], SETUT [2], checkvar [2], curdir [1], curdir [2]
 INPUTS:
       none explicit, only through commons;

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 CALLED BY:
	FLDISPLAY, FSPLOT, PLOT_FLARE
 COMMON BLOCKS:
 fscom
 fs_saveaccum
 fs_saveplot            
 savecommon
 store_plotvar_common

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
 Modified by K. Tolbert 7/2/92.  When reading an archive plot file, subtract 
 2.xxx seconds if data is before 92/6/25 to correct for error in 
 spacecraft clock.  S/c clock was corrected on 92/6/25 at 1055.

 Modified by K. Tolbert 5/14/93.  Write save files as XDR files.  The data
 and time arrays are scaled to 2-byte integers between 1 and 20000 since we
 don't need that much accuracy here, and can save some space.  However,
 XDR files save 2-byte integers in 4 bytes so it takes twice as much space.
 After scaling the 8-byte times and the 4-byte data to 2-byte integers, 
 convert the 2-byte integer arrays to byte arrays (by location, not by value)
 After restoring the file, we convert back to 2-byte integers and then 
 scale back to the true range.

 Mod. by K.T. 4 aug 94.  Were saving the flare information (number,start
 time, etc.) in the .sav file by saving the structure.  This caused
 structure definition problems if we then changed the structure (like
 if we added new tags to the flare catalog).  Now move the items
 we want to save from the structure to variables (sv_...) and then
 explicitly save them in the save command.  On a read, move those variables
 into the flare_datacom structure (which is defined to be the structure in
 log_struct.

 Mod. by AES 11 Oct 94.  Shortenedd sv_ variables to accomodate a bug in 
 IDL.
 Version 5, richard.schwartz@gsfc.nasa.gov, 28-aug-1997, fixed a bug
	in the creation of the time array.  Added documentation.
	Cleaned up the file naming using SSW routines.
	Made the time array exact, with 1.024 sec differences on reading.


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

 NAME: 
       FS_AUTO_LOG

 PURPOSE:

 This procedure prompts the 
 operator to mark the start and end of the event and at least 1 background
 intervals; event start and end times, background interval start and end times,
 and total counts of the event above background will be calculated and stored 
 in the auto_log buffer. Prompt the operator for an event number and whether 
 to write the buffer to the BATSE flare catalog.


 CATEGORY:
       BATSE

 CALLING SEQUENCE:
	fs_auto_log, flare = iflare

 CALLS: ***
	ALPHA_PAGE [1], ALPHA_PAGE [2], BACKG_MARK, FLARE_MARK, FTP_BATSEPLOTS
	GETUTBASE [1], GETUTBASE [2], GET_HXP, GET_PRAT_TCOUN, GRAPHICS_PAGE, LOG_MENU
	PLOT_FLARE, READ_FLARE, SET_GRAPHICS [1], SET_GRAPHICS [2], SPS, WRITE_FDB, XDEVICE
	batse_write_log
 INPUTS:
       none explicit, only through commons;

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	FLARE - selected flare number
	EXTEND - Added to expand the time interval software searches for pointing data
		 while looking at omni events if 3x15min intervals is not long enough.
		 Expanded to 4x60 min intervals.
 CALLED BY:
	DO_ARCHIVEPLOTS, FSPLOT
 COMMON BLOCKS:
	fscom, fs_saveaccum, fs_saveplot

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	Implemented only on sdac

 PROCEDURE:
	none

 MODIFICATION HISTORY:
 Shelby Kennard                                          26Feb1991
 Version 2, Separate Archive plot draw from writing fdb file!, RAS 8 aug 1996
 Version 3, richard.schwartz@gsfc.nasa.gov, 2-feb-1998, use xdevice and sps --
           (for better fonts).
  Version 4, eva@kano.nascom.nasa.gov, 13-May-1999.
	Added flag EXTEND -- 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.


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

 PURPOSE:
	This procedure takes the data accumulated into the fs_saveaccum buffers
	and massages it (sample average, background subtracts, aluminum correction,
	detector summing, channel summing) for display.

 CATEGORY:
	BATSE

 CALLING SEQUENCE:
	FS_GEN_ARR, ERROR=ERROR, F_START = F_START, F_END = F_END, $
                B_START = B_START, B_END = B_END, B_NUM = B_NUM

 CALLS: ***
	ATIME [1], ATIME [2], Aluminum, GETUTBASE [1], GETUTBASE [2], POLY, POLY_FIT
	SETUTBASE [1], SETUTBASE [2], anytim [1], anytim [2], anytim [3], anytim [4]
	anytim [5]
 INPUTS:
       none explicit, only through commons;

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;
	Out_arr in FS_SAVEPLOT is the principal output
 OPTIONAL OUTPUTS:
	none

 KEYWORD INPUTS:
	ERROR: set on error
	F_START: plot start time in seconds
	F_END: plot end time in seconds
	B_START: background intervals start times
	B_END: background intervals' end times
	B_NUM: number of background intervals

 CALLED BY:
	FSPLOT, PLOT_FLARE
 COMMON BLOCKS:
	FSCOM, FS_SAVEACCUM, FS_SAVEPLOT

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:

 Mod by AES 6/28/94 to display number ordered detectors to user as 0-7
 rather than 1-8.
 Mod by AES 7/7/94 to display channels starting from 0 instead of 1.
 Version 3, Documented RAS, April 1, 1996
 Version 4, richard.schwartz@gsfc.nasa.gov, 8-apr-1998, added flexibility to background
	subtraction.


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

 PURPOSE:
 
       This procdedure generates a plot of BATSE data using the operator
	selected channels, detectors,and sample average over the operator 
	selected time range.


 CATEGORY:
       BATSE

 CALLING SEQUENCE:
       FS_GRAPH, FLARE = FLARE_ARG, ERROR = ERROR, GIF = GIF

 CALLS: ***
	ALPHA_PAGE [1], ALPHA_PAGE [2], ATIME [1], ATIME [2], CHECKVAR [1], CH_SCALE
	FILE2FLARE, FS_SUBTITLE, GETUTBASE [1], GETUTBASE [2], GET_TRIG, PL_SCALE, SETUT [1]
	SETUT [2], SETUTBASE [1], SETUTBASE [2], SET_GRAPHICS [1], SET_GRAPHICS [2]
	SHOW_FLARE, TEK_END [1], TEK_END [2], TEK_INIT [1], TEK_INIT [2], UTPLOT [1]
	UTPLOT [2], UTPLOT [3], UTPLOT [4], UTPLOT [5], UTPLOT [6], VERT_LINE, anytim [1]
	anytim [2], anytim [3], anytim [4], anytim [5], checkvar [2]
 INPUTS:
       none explicit, only through commons;

 OPTIONAL INPUTS:
       none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
       none

 KEYWORDS:
       none
 CALLED BY:
	FSPLOT, PLOT_FLARE
 COMMON BLOCKS:
       FSCOM, FS_SAVEACCUM, FS_SAVEPLOT, SAVECOMMON

 SIDE EFFECTS:
       none

 RESTRICTIONS:
       none

 PROCEDURE:
       none

 MODIFICATION HISTORY:
 
 Shelby Kennard                                     8Feb1991
 Revised for device independent hardcopy, multiplot, and archive, 91/11/12
 Richard Schwartz
 Device independence comes from the loop over the plot commands and
 the calls to PL_SCALE and CH_SCALE
 Mod. AKT 1/27/94. Don't call set_utplot.  Call utplot with necessary keywords
 Mod. AES 8/18/94. Use getenv instead of trnlog.
 Version 6, Mod. AES 6/28/95. Use lowercase filenames.
 Version 7, RAS, 7-jul-1997, updated documentation
 Version 8, AES, 9-oct-1997, added gif keyword


FS_OPEN [1] $SSW/cgro/batse/idl/fs_open.pro
[Previous] [Next]
 PROJECT:
	SDAC
 NAME:
 	FS_OPEN
 PURPOSE:
       This procedure opens a BATSE data file.
	User passes in a file name, flare number, or time, and a data
	type, and fs_open finds the correct file, opens it, reads the
	header, and fills in the dd_open structure containing info
	about this file.  The dd_open structure looks like:
		discla_open = {discla_open, $ 
		type:1, $             ; data type: 0/1/2/3=bdb/fdb/cont/discsp
               filename:' ',  $      ; string file name
               numrec: 0L, $         ; number of data records (total-1)
               num_audit_rec: 0L, $  ; number of audit records after header
               startsec: 0.d0, $     ; start time in seconds since 79/1/1
               endsec: 0.d0, $       ; end time in seconds since 79/1/1
               header:fdr_sdac, $    ; structure containing header record
               data: discla_str, $   ; structure showing form of data record
               lun:-1}               ; logical unit
	A generic structure for each allowed data type is saved in ddfiles_com.
	If dd_init hasn't already been called to set up the generic
	structures, fs_open calls it.  

	Current data types allowed are:DISCLA (BDB or FDB), CONT (MSFC or
	SDAC), and DISCSP (MSFC or SDAC).

 CATEGORY:
       BATSE, I/O
 CALLING SEQUENCE:
	fs_open, [file=infile, flare=flare, time=time, dd_type=dd_type, $
	   dd_open=dd_open, verbose=verbose, error=error, msfc=msfc]
 CALLS: ***
	ATIME [1], ATIME [2], BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], CHECKVAR [1]
	CHKLOG [1], CHKLOG [2], CONV_VAX_UNIX, DD_CLOSE, DD_INIT, FLARE_F_NAME, LOC_FILE [1]
	LOC_FILE [2], LOC_FILE [3], OS_FAMILY, SIZE_STRUCT, TIME_F_NAME, TJD2YMD
	USE_VAX_FLOAT, anytim [1], anytim [2], anytim [3], anytim [4], anytim [5]
	break_file [4], checkvar [2], curdir [1], curdir [2], set_logenv [1]
	set_logenv [2]
 CALLED BY:
	ASCII_RAW, BATSE_POINTING, BAT_MERGE, CONT_READ, DISCSP_READ, EDGES_HVSPEC, FDBREAD
	FS_ACC_CONT, FS_ACC_DISCSP, FS_READ_DD, QLARCHIVE, READ_DISCLA, REWRITE_FDB
	TIME_F_NAME, WRITE_DD, read_dd
 RESTRICTIONS:
	User must pass one of the file, flare, or time keywords.

 OPTIONAL KEYWORD INPUTS:
	FILE -	string name of file. If no disk or directory is specified, 
		the file is looked for in the current directory and if
		still not found then BATSE_DATA is the default.
	FLARE -	BATSE flare number.  FS_OPEN will find file containing FLARE.
	TIME -	Time as ASCII string ('yy/mm/dd,hhmm:ss.xxx') or seconds
		since 79/1/1.  FS_OPEN will find file containing this time.
	DD_TYPE - Type of data as string or number:
		'BDB', 'FDB', CONT', or 'DISCSP'  or 
		0/1/2/3 = discla bdb, discla fdb, cont, discsp
		Unless the FILE keyword is passed, FS_OPEN will find this 
		type of file for the flare or time requested.  Default is FDB.
	DD_OPEN - Returned structure containing info about open file.  An
		example of this structure is:
		discla_open = {discla_open, $ 
		type:1, $             ; data type: 0/1/2/3=bdb/fdb/cont/discsp
               filename:' ',  $      ; string file name
               numrec: 0L, $         ; number of data records (total-1)
               num_audit_rec: 0L, $  ; number of audit records after header
               startsec: 0.d0, $     ; start time in seconds since 79/1/1
               endsec: 0.d0, $       ; end time in seconds since 79/1/1
               header:fdr_sdac, $    ; structure containing header record
               data: discla_str, $   ; structure showing form of data record
               lun:-1}               ; logical unit
	VERBOSE - If set, FS_OPEN prints a message when opening a file.
	MSFC    - If set the data structure is MSFC, "native" format
	ERROR -	0/1 means no error/error.

 SAMPLE CALL:
	fs_open,flare=300,dd_type='CONT',error=error
	fs_open,file='930902.bdb'

 MODIFICATION HISTORY:
	Kim Tolbert   9/93
       ras, 23-mar-94, fixed uppercase test bug
	Mod KT 1-APR-1994 to use the individual directories (BATSE_CONT,
		BATSE_FDB, etc) rather than BATSE_DATA (which points
		to all those directories.  A multi-defined logical won't
		work in unix.  Did it now because moving bdb files to
		BATSE_BDB rather than having them on BATSE_DATA.
	Mod Kt 13-apr-1994. Restrict access to cont or discsp files less than 
		one year old if user is logged in via the BATSE account.
	Mod ras 18-apr-1994 - added MSFC keyword to force MSFC structure
       Mod AES 7-sep-1994.  enabled MSFC keyword by adding ten to type
               if MSFC is set.
       Mod AES 2-oct-1995 - changed addresses to nascom domain
	mod ras 11-oct-1995 - changed default to current directory, then batse_bdb
	Version 9, ras, 31-dec-1996, maintain version numbers in filename
	VERSION 10, richard.schwartz@gsfc.nasa.gov, 4-sep-1997,
	used loc_file with path_dir('batse') to locate help files.
	Test for pad bytes and set environmental if true. add msfc hkg files, 14.
	VERSION 11, richard.schwartz@gsfc.nasa.gov, 7-oct-1997,
	made input filename first default, use dd_type for bdb, too.
	VERSION 12, richard.schwartz@gsfc.nasa.gov, 20-nov-1997,
	made dd_type more robust, fixed bug in using numbers for msfc types.
	VERSION 13, richard.schwartz@gsfc.nasa.gov, 3-dec-1997,
	fixed type_passed default.
 	Version 14, richard.schwartz@gsfc.nasa.gov, 24-jun-1998, forced old VAX float format on write.
	Version 15, amy@aloha.nascom.nasa.gov, 16-jun-1999, changed reference
	     to def_dir after dominic changed the output of chklog


FS_OPEN [2] $SSW/cgro/batse/idl/fs_open_hold.pro
[Previous] [Next]
 NAME:
 	FS_OPEN
 PURPOSE:
       Open a BATSE data file.
	User passes in a file name, flare number, or time, and a data
	type, and fs_open finds the correct file, opens it, reads the
	header, and fills in the dd_open structure containing info
	about this file.  The dd_open structure looks like:
		discla_open = {discla_open, $ 
		type:1, $             ; data type: 0/1/2/3=bdb/fdb/cont/discsp
               filename:' ',  $      ; string file name
               numrec: 0L, $         ; number of data records (total-1)
               num_audit_rec: 0L, $  ; number of audit records after header
               startsec: 0.d0, $     ; start time in seconds since 79/1/1
               endsec: 0.d0, $       ; end time in seconds since 79/1/1
               header:fdr_sdac, $    ; structure containing header record
               data: discla_str, $   ; structure showing form of data record
               lun:-1}               ; logical unit
	A generic structure for each allowed data type is saved in ddfiles_com.
	If dd_init hasn't already been called to set up the generic
	structures, fs_open calls it.  

	Current data types allowed are:DISCLA (BDB or FDB), CONT (MSFC or
	SDAC), and DISCSP (MSFC or SDAC).

 CATEGORY:
       BATSEI/O
 CALLING SEQUENCE:
	fs_open, [file=infile, flare=flare, time=time, dd_type=dd_type, $
	   dd_open=dd_open, verbose=verbose, error=error, msfc=msfc]
 CALLED BY:
	ASCII_RAW, BATSE_POINTING, BAT_MERGE, CONT_READ, DISCSP_READ, EDGES_HVSPEC, FDBREAD
	FS_ACC_CONT, FS_ACC_DISCSP, FS_READ_DD, QLARCHIVE, READ_DISCLA, REWRITE_FDB
	TIME_F_NAME, WRITE_DD, read_dd
 RESTRICTIONS:
	User must pass one of the file, flare, or time keywords.

 OPTIONAL KEYWORD INPUTS:
	FILE -	string name of file. If no disk or directory is specified, 
		the file is looked for in the current directory and if
		still not found then BATSE_DATA is the default.
	FLARE -	BATSE flare number.  FS_OPEN will find file containing FLARE.
	TIME -	Time as ASCII string ('yy/mm/dd,hhmm:ss.xxx') or seconds
		since 79/1/1.  FS_OPEN will find file containing this time.
	DD_TYPE - Type of data as string or number:
		'BDB', 'FDB', CONT', or 'DISCSP'  or 
		0/1/2/3 = discla bdb, discla fdb, cont, discsp
		Unless the FILE keyword is passed, FS_OPEN will find this 
		type of file for the flare or time requested.  Default is FDB.
	DD_OPEN - Returned structure containing info about open file.  An
		example of this structure is:
		discla_open = {discla_open, $ 
		type:1, $             ; data type: 0/1/2/3=bdb/fdb/cont/discsp
               filename:' ',  $      ; string file name
               numrec: 0L, $         ; number of data records (total-1)
               num_audit_rec: 0L, $  ; number of audit records after header
               startsec: 0.d0, $     ; start time in seconds since 79/1/1
               endsec: 0.d0, $       ; end time in seconds since 79/1/1
               header:fdr_sdac, $    ; structure containing header record
               data: discla_str, $   ; structure showing form of data record
               lun:-1}               ; logical unit
	VERBOSE - If set, FS_OPEN prints a message when opening a file.
	MSFC    - If set the data structure is MSFC, "native" format
	ERROR -	0/1 means no error/error.

 SAMPLE CALL:
	fs_open,flare=300,dd_type='CONT',error=error
	fs_open,file='930902.bdb'

 MODIFICATION HISTORY:
	Kim Tolbert   9/93
       ras, 23-mar-94, fixed uppercase test bug
	Mod KT 1-APR-1994 to use the individual directories (BATSE_CONT,
		BATSE_FDB, etc) rather than BATSE_DATA (which points
		to all those directories.  A multi-defined logical won't
		work in unix.  Did it now because moving bdb files to
		BATSE_BDB rather than having them on BATSE_DATA.
	Mod Kt 13-apr-1994. Restrict access to cont or discsp files less than 
		one year old if user is logged in via the BATSE account.
	Mod ras 18-apr-1994 - added MSFC keyword to force MSFC structure
       Mod AES 7-sep-1994.  enabled MSFC keyword by adding ten to type
               if MSFC is set.
       Mod AES 2-oct-1995 - changed addresses to nascom domain
	mod ras 11-oct-1995 - changed default to current directory, then batse_bdb
	Version 9, ras, 31-dec-1996, maintain version numbers in filename
	Mod RCJ 29-jul-1997, open file as stream


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

 NAME: 
       FS_OVERLAY

 PURPOSE:


 CATEGORY:
       BATSE

 CALLING SEQUENCE:


 CALLS: ***
	GETUTBASE [1], GETUTBASE [2], SET_GRAPHICS [1], SET_GRAPHICS [2], TEK_END [1]
	TEK_END [2], TEK_INIT [1], TEK_INIT [2], linecolors [1], linecolors [2]
 INPUTS:
       none explicit, only through commons;

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 CALLED BY:
	FSPLOT, PLOT_FLARE
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:


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

 NAME: 
       FS_PRINT

 PURPOSE:


 CATEGORY:
       BATSE

 CALLING SEQUENCE:


 CALLS: ***
	ATIME [1], ATIME [2], Mailfile, PAGE_PRINT, SYS2UT
 INPUTS:
       none explicit, only through commons;

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 CALLED BY:
	FSPLOT
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:


FS_READ_DD $SSW/cgro/batse/idl/fs_read_dd.pro
[Previous] [Next]
 PROJECT:
	SDAC
 NAME: 
	FS_READ_DD
 CATEGORY:
	BATSE

 PURPOSE:

 	FS_READ_DD reads records from the input file in blocks of 1000 records at 
 	a time and saves fluxes, times, and position and pointing data.

       read_dd and fs_read_dd are similar.  The main difference is that
       fs_read_dd saves data into pre-defined arrays in common fs_saveaccum,
       while read_dd constructs the arrays and returns them in output args.

       Select input file either by calling fs_open before calling fs_read_dd
       and passing the dd_open structure that fs_open sets up to fs_read_dd
       or
       pass a filename, or dd_type and flare or startt keywords to fs_read_dd.
               e.g.:
		fs_open,flare=12,dd_open=dd_open
		fs_read_dd,dd_open=dd_open
			or
		fs_read_dd,flare=12	(type defaults to fdb)

	The data is saved in pre-defined arrays (set up by 
 	setup_arrays) in common fs_saveaccum so that we will use the same 
 	space over and over instead of creating new arrays every time we read 
 	in a new set of data.  

 	Depending on the type of data file opened by fs_open, fs_read_dd saves
 	discla (fdb or bdb), cont, or discsp data at the highest time resolution
 	available.
	
 	maxindex, maxcindex, maxspindex, maxposindex (in common fs_saveaccum)
 	indicate the highest element number filled in those arrays.  

 	If the times requested are not in the file, maxindex is returned as 0.

 	If the time extends beyond the end of the input file (and the input is
 	bdb), the next day's bdb file is read up to the end time requested. 

 	Output arrays are filled by computing the index into the array from the
 	time of the data.  Arrays are first initialized to an appropriate value 
 	indicating a gap, and this way, gaps will be left as gaps.  In FSPLOT,
 	the time array will be filled in later in the gap intervals to contain 
 	continuously increasing times.

 CALLING SEQUENCE:
	fs_read_dd, [file=infile, flare=flare, dd_open=dd_open, $
	  dd_type=dd_type, startt=startt, endt=endt, $
	  verbose=verbose, error=error]

 OPTIONAL KEYWORD INPUTS:
       file -  string name of file. If no disk or directory is specified,
               BATSE_DATA is the default.
       flare - BATSE flare number.  FS_OPEN will find file containing FLARE.
 	dd_open - structure set by fs_open containing information about input 
           file (see dd_init for contents of structure)
       dd_type - Type of data as string or number:
               'BDB', 'FDB', CONT', or 'DISCSP'  or
               0/1/2/3 = discla bdb, discla fdb, cont, discsp
               Unless the FILE or DD_OPEN keywords are passed, will find this
               type of file for the flare or time requested.  Default is FDB.
 	startt - start time to read in r*8 seconds relative to 79/1/1,0 or ASCII
          string in format yy/mm/dd,hhmm:ss.xxx.  If dd_open, flare, and
	   file keywords are NOT specified, then finds file containing
	   this time.
 	endt - end time of interval to read.  See startt description.
	verbose - 0/1 means don't/do print start/end times of accumulation

 OPTIONAL KEYWORD OUTPUTS:
 	error - 0/1 indicates no error/error reading file

 SAMPLE CALL:  
	fs_read_dd, dd_open, err=err
	fs_read_dd, dd_open, startt='93/10/18,1230',endt='93/10/18,1235',$
	  error=error         
	fs_read_dd, dd_open, err=err
 
 CALLS: ***
	ATIME [1], ATIME [2], CHECKVAR [1], CONV_VAX_UNIX, FIND_PACKET, FS_OPEN [1]
	FS_OPEN [2], NEXTBDB, SC_SECONDS_ED, SETUP_BATSE, SIZE_STRUCT, SYS2UT, anytim [1]
	anytim [2], anytim [3], anytim [4], anytim [5], checkvar [2]
 CALLED BY:
	CONT_READ, DISCSP_READ, FDBREAD, FS_ACC, FS_ACC_CONT, FS_ACC_DISCSP, WRITE_FDB
 MODIFICATION HISTORY:
	Written by Kim Tolbert  10/93
	ras, 26-mar-1996, allow variable buffer size in common, cleaned up max*index
	Version 3, richard.schwartz@gsfc.nasa.gov, 4-sep-1997,  check for pad_byte


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

 NAME: 
       FS_SAVEACCUM

 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:


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

 NAME: 
       FS_SAVECONT

 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:


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

 NAME: 
       FS_SAVEPLOT

 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:


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

 PURPOSE:

        This procedure generates subtitle string for fs_graph.

 CATEGORY:
       BATSE

 CALLING SEQUENCE:
	fs_subtitle, subtitle1, subtitle2

 CALLS: ***
	ATIME [1], ATIME [2], CONT_EDGES, DISCLA_EDGES, DISCSP_EDGES, GETUT [1], GETUT [2]
	SET_PENDLETON, SYS2UT
 INPUTS:
       none explicit, only through commons;

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       subtitle1
       subtitle2

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 CALLED BY:
	FS_GRAPH
 COMMON BLOCKS:
	fscom, fs_saveaccum, fs_saveplot

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
 Mod. 7/8/94 by Amy Skowronek to show physical detector id's (0-7) and
 channel id's (starting at 0)
	Version 3, richard.schwartz@gsfc.nasa.gov, bring energy labels in
	line with current software.  26-sep-1997
	Version 4, richard.schwartz@gsfc.nasa.gov, revise energy labels in
	line with current software for discla.  8-mar-1998.


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

 NAME: 
       FS_TESTGEN

 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:


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

 NAME: 
       FSCOM

 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:


FSDEF $SSW/cgro/batse/idl/fsdef.pro
[Previous] [Next]
 Name:
	FSDEF

 Purpose:
 Set defaults for Fsplot operator communications.

 Input: 
	none

 CALLS: ***
	CHECKVAR [1], XDEVICE, checkvar [2], set_hard
 CALLED BY:
	DO_ARCHIVEPLOTS, DO_FDBFILES, DO_PSPLOTS, FSPLOT, PLOT_FLARE
 History:
 Shelby Kennard                          7Feb1991
 mod. 7/20/92 by akt to increase number of times we can accumulate to 
 15000 points, Also, to save time when entering fsplot, don't define those
 big arrays in common fs_saveaccum if they've already been defined.  Also
 changed default for bdb/fdb files to fdb except if user is ANNE. (Before
 default was BDB unless user was BATSE.)

 mod. 7/7/94 by Amy Skowronek to start channel arrays at 0 to reflect
 new numbering scheme, 0-(n-1) instead of 1-n. 
 mod. 8/18/94 by AES to use getenv instead of trnlog
 Version 3, RAS, 27-Mar-1996, change call to SETUP_BATSE_ARRAYS
 Mod 9/8/97 by AES, added /gif keyword to work with gif writer
 Version 5, richard.schwartz@gsfc.nasa.gov, 2-feb-1998. Use xdevice().
************************************************************


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

 PURPOSE:
 	This procedure provides operator communications for the Flare search plotting task, fsplot.

 CATEGORY:
 BATSE

 CALLING SEQUENCE:
	FSOC, Cmnd, Listoc, INCOMMANDS=INCOMMANDS

 CALLS: ***
	ALPHA_PAGE [1], ALPHA_PAGE [2], ATIME [1], ATIME [2], BATSE_TIME_INPUT
	CHECKVAR [1], CHKARG, CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], DEL_PLOTFILE
	EXIST, FCHECK, FIND_DBFILE, FSOC_AUX, GETUT [1], GETUT [2], GETUTBASE [1]
	GETUTBASE [2], RD_TEXT, SETUT [1], SETUT [2], anytim [1], anytim [2], anytim [3]
	anytim [4], anytim [5], checkvar [2], concat_dir [4]
 INPUTS:
       none explicit, only through commons;

 OPTIONAL INPUTS:
	Listoc: If set, Menu and Options are listed

 OUTPUTS:
	Cmnd: Returned interpreted command action for FSPLOT

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	INCOMMANDS: An array of command strings for command input in lieu of input
	from terminal (sys$input).  Command strings are in the same format as
	for keyboard input.

 CALLED BY:
	FSPLOT
 COMMON BLOCKS:
	fscom,fs_saveaccum,scalecom,remotecom

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
 History:
 Shelby Kennard                               1Feb1991
 Modified by AES 94/08/30  Added new menu option, autosize.  Starts
 enabled.  Causes program to resize the plot window larger if the user
 picks the "all4" data option.  Window returns to normal size for other
 options.
 Modified by AES 94/09/01 If two or fewer graphs in either direction,
 set global sizing variable to 1.  Otherwise set to 2.
 Mod. by AES 95/05/23 Added extra command - MakeGif
 Mod. by AES 95/06/28 to check for OS before printing filename
 Mod ras 29-mar-1996, change maxseconds algorithm
 Version 6, ras, 16-april-1996, added INCOMMANDS
 Version 7, ras, 4-dec-1996, RD_TEXT not RD_ASCII
 Version 8, richard.schwartz@gsfc.nasa.gov, pass original command line to
	find_dbfile, 4-sep-1997
 Version 9, richard.schwartz@gsfc.nasa.gov, now accepts all ANYTIM compatible time strings for
	time parameters INPUT, START, and END.


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

 NAME: 
       FSOC_AUX

 PURPOSE:


 CATEGORY:
       BATSE

 CALLING SEQUENCE:


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

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 CALLED BY:
	FSOC
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:


FSPLOT $SSW/cgro/batse/idl/fsplot.pro
[Previous] [Next]
 NAME:	FSPLOT

 PURPOSE:
   	Plots light curves of BATSE data using the detectors, channels, 
	and sample averages specified by the operator.

 CATEGORY:   BATSE

 CALLING SEQUENCE:
   	Fsplot

 CALLS: ***
	ATIME [1], ATIME [2], CHKLOG [1], CHKLOG [2], CONCAT_DIR [1], CONCAT_DIR [2]
	CONCAT_DIR [3], DD_CLOSE, EXIST, FILE2FLARE, FILELIST, FIND_DBFILE, FLIST, FSDEF
	FSELECT, FSOC, FS_ACC, FS_ACC_CONT, FS_ACC_DISCSP, FS_ACC_GOES, FS_ARCHIVE_DRAW
	FS_ARCHIVE_RW, FS_AUTO_LOG, FS_GEN_ARR, FS_GRAPH, FS_OVERLAY, FS_PRINT
	GETUTBASE [1], GETUTBASE [2], LOC_FILE [1], LOC_FILE [2], LOC_FILE [3], MAILPLOT
	MORE [1], MORE [2], Mailfile, PATH_DIR, PLOT_FLARE, POINT [1], READ_SEQFILE
	SELECT_DEV, SETUT [1], SETUT [2], SHOW_FLARE, SPECTRA2FITS, TEK_PRINT [1]
	TEK_PRINT [2], TYPE_FLARE, USER_CHOOSE, WRITE_GIF, YOHKOH_FORMAT [1]
	YOHKOH_FORMAT [2], ZOOM_COOR [1], anytim [1], anytim [2], anytim [3], anytim [4]
	anytim [5], concat_dir [4], curdir [1], curdir [2], hxrbs_format, point [2]
	yohkoh_format [3], zoom_coor [2]
 INPUTS:
	None

 OUTPUTS:
	Information saved in file *.out

 OPTIONAL OUTPUTS:
	Save fits file, ascii file or plot mailed to given address. 

 KEYWORDS:
	WPLOT: If WPLOT is set and IFLARE is a flare number, then the 4 panel
		figure is plotted and the program returns
	IFLARE: A flare number used with WPLOT
	INCOMMANDS: A buffer of command strings to be executed sequentially
	EXTEND - Added to expand the time interval software searches for pointing data
		 while looking at omni events if 3x15min intervals is not long enough.
		 Expanded to 4x60 min intervals.
		
 CALLED BY:
	batse_menu
 COMMON BLOCKS:
    FSCOM, FS_SAVEPLOT, FS_SAVEACCUM, SCALECOM
	
 MODIFICATION HISTORY:
    Written by:  Shelby Kennard            30Jan1991
    Mod. by Amy Skowronek 8/18/94 to use getenv instead of trnlog
    Mod. by AES 8/24/94 to save cont_cos8 for cont data and sp_cos8
         for discsp data rather than trying to save cos8.
    Mod. by AES 8/29/94 to change variable global in scalecom
         for multiple plots so characters remain readable.
    Mod. by AES 8/30/94 to make a large screen if the user chooses "all4"
         as a data option, so the words on the plot remain legible.  The
         user has the option of disabling this automatic resizing of the
         plot window, using a menu command, autosize.
    Mod. by AES 10/13/94 to *not* replace long size window with standard
         size window when leaving fsplot.
    Mod. by AES 10/24/94 to allow fsplot to be called with a flare
         parameter.  If called with iflare=number and /wplot, it
         will display all four data types for that flare number, without
         asking questions, and then exit fsplot.
    Mod. by AES 11/1/94 to call window with retain=2 so windows don't get
         lost.
    Mod. by AES 1/17/95 to reset variable global to 1 before exiting to
         main menu, so type size is reset after using the dat,all4 
         option.
    Mod. by AES 4/6/95 to allow for FITS save - however as software is not
	  completely ready, asking for fits save reroutes to XDR.
    Mod. by AES 4/11/95 to save livetime in SAVE option
    Mod. by AES 4/27/95 to save BATSE user's files to anonymous.input.batse,
         and only the required segment of the livetime array.  Also save
         files with flare number in name, e.g. discla_299.sav
    Mod. by AES 5/23/95 to save plot in .gif format using command MakeGif
    Mod. by AES 6/28/95 to check for architecture before printing filename.
    Mod. by RCJ 12/04/95 to make global=1 when entering ARC command.
    Mod. by RCJ 02/23/95 to save correct livetimes for cont and discsp data.
    Mod. by RAS 16-apr-1996 to add input buffer command processing, also
	defaults are no longer reset.
    Mod. by RCJ 05/06/97 to save arrays in binary fits table using 
	spectra2fits. Also update documentation.
    Version 21, RAS, 7-jun-1997, minor changes using loc_file to replace concat_dir
    VERSION 22, richard.schwartz@gsfc.nasa.gov, 26-aug-1997,
    used loc_file with path_dir('batse') to locate help files.
    VERSION 23, eva@kano.nascom.nasa.gov, 13-May-1999.
	Added flag EXTEND -- 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.
    Version 24, 	richard.schwartz@gsfc.nasa.gov, 6-jun-2000.
	replaced incorrect block terminators (ENDIF) with correct END statements.	


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

 NAME: 
       FTP_BATSEPLOTS

 PURPOSE:


 CATEGORY:
       BATSE

 CALLING SEQUENCE:


 CALLS: ***
	BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], break_file [4]
 INPUTS:
       none explicit, only through commons;

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 CALLED BY:
	DO_ARCHIVEPLOTS, DO_PSPLOTS, FS_AUTO_LOG
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
 99/3/10 modified ftp syntax AES