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

 NAME: 
       DD_BURST_AUX_STR

 PURPOSE:


 CATEGORY:
       BATSE

 CALLING SEQUENCE:


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

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:


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

 NAME: 
       DD_CLOSE

 PURPOSE:
	Frees the open logical unit in the DD structure

 CATEGORY:
	BATSE

 CALLING SEQUENCE:
	dd_close, dd_open

 CALLS:
	none
 INPUTS:
       dd_open: a structure describing an open file.

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 CALLED BY:
	FSPLOT, FS_OPEN [1], RAWDUMP, read_dd
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
	Version 2, ras, 7 June 1996, added documentation


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

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


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

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


DD_INIT $SSW/cgro/batse/idl/dd_init.pro
[Previous] [Next]
 PROJECT:
	SDAC
 NAME:
	DD_INIT
 PURPOSE:
	Set up generic structures that will contain info about BATSE files
	when they are opened by FS_OPEN. Saves these generic structures 
	in common ddfiles_com.

	Each data type has a different structure because it contains
	a structure showing the form of the header and data records which 
	are different for different data types.

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

	The general form of the structure for each data type 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 
 CATEGORY:
       BATSEI/O
 CALLING SEQUENCE:
	dd_init
 CALLED BY:
	FS_OPEN [1]
 COMMON BLOCKS:
 ddfiles_com

 MODIFICATION HISTORY:
	Kim Tolbert   9/93
	RAS, changed intialization of data structure names to '' from ' ', 28-may-1996
	VERSION 3, richard.schwartz@gsfc.nasa.gov, 4-sep-1997, added msfc_hkg_str.


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

 NAME: 
       DD_SHER_COR

 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:


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

 NAME: 
       DDFILES_COM

 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:

	ras, 26-sep-1997, added mdiscla_open


DECOMPOSE_BATSE_DRM $SSW/cgro/batse/idl/decompose_batse_drm.pro
[Previous] [Next]
  Name:
       DECOMPOSE_BATSE_DRM
	
 PURPOSE: 
	Decompose a BATSE SPEC response matrix into photopeak line strengths
	and K escape peak line strengths as well as the residual matrix.
	For BATSE LAD, there is no decomposition, just the basic responses
	
 CALLING SEQUENCE:
	decompose_batse_drm, theta=theta, det_id=det_id, $
		photo_eff=photo_eff, esc_eff=esc_eff, drm_resid=drm_resid, e_in, $
		out_frac=out_frac, sigma = sigma
	
 INPUTS:
	theta - source zenith angle
	det_id - use input response file name, bsas/bdas database files, for this id
		files installed on SSWDB_BATSE	
	det_type - 'spec' or 'lad'
 OPTIONAL INPUTS:
	only_resp - if set, then only generate the response for the angle
		don't extract any photo_efficiencies
		if only_resp set to -1 then even lad will have photoefficiencies extracted!
 OUTPUTS:
	e_in - photon energies, keV
	photo_eff- photoefficiency flux in counts/det/ (photon/cm2)
	esc_eff - escape efficiency
	drm_resid - residual drm after photo and esc peaks subtracted
	drm_resid is in units of counts/keV / (photon/cm2)
       out - energy grid of output energy loss in units of fraction of input photon energy
	      grid points are centered in each output interval	
	sigma - resolution sigma in keV, fwhm = 2.36 * sigma
 OPTIONAL OUTPUTS:
	gm_use - parameters of gaussians used to fit peaks and escape peaks
	resp - basic batse response matrix built from stored model coefficients, 
		polynomial in cosine

 CALLED BY:
	BATSE_LAD_DRM, BATSE_SPEC_DRM
 PROCEDURE:

 CALLS: ***
	CHKLOG [1], CHKLOG [2], CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], CURVEFIT
	FCHECK, FUNCT2, F_DIV, GAUSSFIT [1], GAUSSFIT [2], GAUSSFIT [3], GAUSSFIT [4]
	GAUSSFIT [5], GAUSSIAN, INTERPOL, POLY, POLY_FIT, concat_dir [4], edge_products
	f_pder [1], f_pder [2], low_e_spec_eff [1], low_e_spec_eff [2]
 COMMON BLOCKS:

 RESTRICTIONS:

 MODIFICATION HISTORY:
	ras, 5-apr-95, changed from jun93 to mar94 data files	
	ras, 10-apr-95, changed back to mar94 to jun93 data files
	ras, 21-apr-95, changed to support lad drm too	
	ras, 21-jul-95, start fitting at response row 3 skipping 0,1,2
	Version 5, ras, 15-jun-1997, Allow only_resp to force photo_efficiencies!
               RAS, 7-Jul-1997, changed PERM_DATA to SSWDB_BATSE


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

 NAME: 
       DEL_PLOTFILE

 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:
	FLDISPLAY, FSOC, QLDISPLAY
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:


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

 NAME: 
       DELTA_CONTROL

 PURPOSE:


 CATEGORY:
       BATSE

 CALLING SEQUENCE:


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

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

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

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:


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

  Name:
       DET_COSINES


 PURPOSE:  
	Compute direction cosines for BATSE LAD's, SPECS  for a source
	position given in detector coordinates.

 CATEGORY: BATSE, data base extraction, needed for spectroscopy routines


 CALLING SEQUENCE: det_cosines, ra, decl, cos_lad=cos_lad, cos_spec=cos_spec

 INPUTS:
	ra  - source azimuth in gro coordinates (degrees)
	decl- source declination in gro coordinates (degrees)
	These numbers are obtained from drm headers and batse_pointing.pro
	and the flare catalog.
	flare - Extract pointing from flare catalog (optional), can input fldata structure
	from flare_catalog.pro or numerical flare.
	/printem - print the detector cosines
       /sort  - apply the aspect sorting algorithm and return sorted lad and spec ids
                the spec algorithm also considers gain and lld such that in both cases
		 the ordering is from most to least sensitive (approximately)
 OUTPUTS:
       cos_det - direction cosines for LADs
	cos_spec- direction cosines for SPECs
	sun_in_gro - Position of the Sun in the GRO coordinate system, 
		Phi, Theta - (long and latitude) (degrees)
	earth_in_gro - Position of the Geocenter in the GRO coordinate system,
		 Phi, Theta (degrees)
       peaktime- returns peak time of flare in secs from 1-jan-79 if flare is passed

       if flare isn't passed, then /sort can still be used if peaktime is passed
	as an input   
	lad_sort- sensitivity order of lad ids
	spec_sort- sensitivity order of spec ids
 CALLS: ***
	DATATYPE [1], DATATYPE [2], DATATYPE [3], GET_SPEC_GAIN, READ_FLARE
	SPEC_SENSITIVITY, SPHCART
 CALLED BY:
	DISCSC_PL, DISCSP_BANDS, DISCSP_READ, EVAL_SHERB, FS_ACC_DISCSP, MERGE_BATSE
	RUN_BATSE, SETUP_DRM, read_batse_4_spex [1], read_batse_4_spex [2]
	spex_batse_preview [1], spex_batse_preview [2]
 RESTRICTIONS:
	Requires that the GRO position vector and GRO pointing directions
	be defined at the flare peak or the chosen time (ut).  It will fail
	on the 'Omni' data, (fdb.eng_telem=-1).

 MODIFICATION HISTORY: based on det_point and spec_point,
	written by RAS 3 Aug 1993
	mod, ras, 18-oct-94 to report peaktime
       mod, ras, 25-oct-94 to include sorting
	mod, ras, 17-oct-1996 fixed lad_sort error (used cos_spec before) and 
	use spec_sensitivity.pro if flare keyword used.
	Version 5, ras, 21-oct-1996, returns on invalid flare number wo crashing


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

  Name:
       DET_POINT


 PURPOSE:
  	Compute direction cosines for BATSE LAD's for Solar Viewing
	FIND POINTING CHANGES IN THE SPACECRAFT X-AXIS


 CATEGORY: cgro/batse, attitude analysis


 CALLING SEQUENCE:
	det_point, ut, x_ra, x_dec, pnt_ndx, cos_det,z_ra,z_dec,$
	  celestial_fov=batsefov, cos_spec=cos_spec, $
	  spacecraftfov=batse, x2fov=x2fov, ra=ra, dec=dec, dir_cos=dir_cos,$
         x_ra_rad=x_ra_rad ,x_dec_rad=x_dec_rad ,bad_data=bad_data

 CALLED BY:


 CALLS: ***
	ANY_CHANGE, AVG [1], AVG [2], F_CROSSP, GROUP_INTERVALS, SOLEPHUT, SPHCART, UTIME [1]
	UTIME [2]
 INPUTS:

	ut - time in seconds from 79/1/1 corresponding to vectors x_ra, x_dec
	x_ra - GRO X-axis pointing direction right ascension in .0001 RAD
	x_dec -GRO X-axis pointing direction declination in .0001 RAD
	z_ra - GRO Z-axis pointing direction right ascension in .0001 RAD
	z_dec -GRO Z-axis pointing direction declination in .0001 RAD
	pnt_ndx - pointing index to start of new pointing direction, ref. to ut

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	cos_det - direction cosines for each of BATSE LADs for each time sample
	   cos_det is dimensioned fltarr(8,n_elements(ut))
	cos_spec - direction cosines for each of BATSE SPECs for each time sample
	   cos_spec is dimensioned fltarr(8,n_elements(ut))
       bad_data - set to 1 if data quality is too poor
 CALLED BY:
	FDBREAD, FIX_CONT, FIX_CONT2, FS_ACC, QLARCHIVE, READ_DISCLA
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
 	written, ras, sometime 1994
	mod ras, 22-jun-1995, crossp=>f_crossp
	mod ras, 8-sep-1995, added cos_spec


DIFF_DRM $SSW/cgro/batse/idl/diff_drm.pro
[Previous] [Next]
 NAME:
	DIFF_DRM

 PURPOSE:
	Compute an average BATSE SPEC DRM to approximate the detector
	response to an isotropic flux from a zenith angle of 0-70 degrees to
	model the diffuse cosmic X-ray flux.  Only to be used at energies
	less than 100 keV.  This is to be used by instrument scientists
	exclusively.

 CATEGORY:
	BATSE, SPEX

 CALLING SEQUENCE:
	DRM = DIFF_DRM( Chan_edges, Det_id, E_in, Area, THETA_LIM=THETA_LIM)

 INPUTS:
	Chan_edges: 2xN array of output energy edges to use.  Energies are photon
	            pulse-height centrod energies in keV.
	Det_id: BATSE SPEC detector id, 0-7

 KEYWORD PARAMETERS:
	THETA_LIM: The default range for averaging over in angle is to 70 degrees.
		   THETA_LIM in degrees overrides the default.

 OUTPUTS:
	DRM is averaged over the cosines of the zenith angle in the same
	units as used for BUILD_DRM.PRO

 OPTIONAL OUTPUTS:
	E_in: 2 by m array of incident photon energies used in keV.
	Area: 127 cm^2 for the BATSE SPECs

 CALLS: ***
	BUILD_DRM, CHECKVAR [1], FCHECK, checkvar [2]
 RESTRICTIONS:
	THETA_LIM cannot exceed 70 degrees.  Chan_edges should be greater
	than 3.0 keV.

 PROCEDURE:
	Uses BUILD_DRM at a linear interpolation over the cosine of the range
	of the zenith angle to build an input averaged response.

 EXAMPLE:

 	DRM = DIFF_DRM( Chan_edges )

 MODIFICATION HISTORY:
 	Written by:	ras, 12-dec-1995


DISCLA_EDGES $SSW/cgro/batse/idl/discla_edges.pro
[Previous] [Next]
  Name:
 	DISCLA_EDGES

 PURPOSE:  
	Return a 2x6 arrays of the DISCLA energy edges

 Category:
	BATSE

 CALLING SEQUENCE:  
	edges = discla_edges()
	edges = discla_edges(/approx)
	edges = discla_edges(id)
 Input:
	Id - if used, the edges are returned specific to this 
	     detector, 2x6, for DISCLA0,1,2,3,4 and CPD.
	     DISCLA0 is the lowest energy band found as the 
	     residual in channel index 4 in the science packets.
	     This argument is implemented on 28-sep-1997 by ras.
	These are the channel edges returned based on the calibration in effect
	for CONT (Preece model) on 23-feb-1998.
      18.5839      30.4134      58.1452      113.399      344.531      10000.000
      24.5276      33.2393      57.0470      107.349      323.931      10000.000
      21.1757      28.3674      61.8187      114.057      346.708      10000.000
      21.0709      26.9114      59.0411      113.836      336.171      10000.000
      21.4447      28.2524      60.1751      117.354      343.128      10000.000
      20.2190      28.8767      54.4508      106.448      318.762      10000.000
      18.2555      23.1426      57.2215      108.770      312.034      10000.000
      16.1556      27.0612      60.6204      118.636      352.379      10000.000

 Keyword Input:
	APPROXIMATE keyword is no longer supported, ranges were 15-25-50-100-300-1000 and 1000-1e4 keV.
 	
	PLMODEL - Used with ID, if set, then Power-law extrapolations are used
	for lowest energy edge.
	PHA     - If set, use PHA channel numbers as edges, 0-128.

 CALLS: ***
	FCHECK, INTERPOL, LAD_PHA_EDGES, edge_products
 CALLED BY:
	BUILD_DRM, CONT_EDGES, DISCSC_PL, FS_SUBTITLE, LIVETIME [1], OCC_AVG
	read_batse_4_spex [1], read_batse_4_spex [2], spex_batse_preview [1]
	spex_batse_preview [2]
 HISTORY:
 	KT 1/94
 	ras, 25-apr-95 new edges based on bfits file calibrations
 	ras, 11-dec-95, change the meaning of DISCLA5 to DISCLA0
		  It is now a differential channel, not a total channel.
 	ras, 9-june-1996, expanded documentation
 	ras, changed low edge on chan 0 det 7 back to old_edge, 26-sep-1997
	9-feb-1998, edges above LLD from consistency with CONT count rates.
	The bottom LLD is determined by inspection and interpolation. 
	23-feb-1998, edges above LLD redone by interpolation on CONT using
	only linear channels.
	Version 8,
	26-feb-1998, richard.schwartz@gsfc.nasa.gov, interpolate DISCLA to HER.


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

 NAME: 
       DISCLA_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:
	ras, 26-sep-1997


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

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


DISCP_RESP $SSW/cgro/batse/idl/discsp_resp.pro
[Previous] [Next]
 NAME:
	DISCP_RESP

 PURPOSE:
	Return the count rate response of the DISCSP to a model spectrum
	based on angle and energy boundaries.

 CATEGORY:
	BATSE, SPEX

 CALLING SEQUENCE:
	DISCSP_RESP, Edges, Theta, Apar, Resp, SCALE=SCALE

 INPUTS:
	Edges: Lower and upper edge in keV for 1 channel.
		if more than 1 channel, should be an array [lo,hi] x Number_channels
	Theta: Angle between source and detector axis in degreees.
	Apar:  Parameters needed for spectral model function.
	
 KEYWORD PARAMETERS:
	MODEL: String name of spectral model, default, "F_BPOW"
	SCALE: Scale factor for resolution above PHA values, passed onto
	       BATSE_SPEC_DRM

 OUTPUTS:
   	Resp: Count rate in interval.

 CALLS: ***
	BATSE_SPEC_DRM, CHECKVAR [1], CHKLOG [1], CHKLOG [2], CONCAT_DIR [1]
	CONCAT_DIR [2], CONCAT_DIR [3], DISCSP_RESP, EXIST, FCHECK, INTERPOL, PARCHECK
	checkvar [2], concat_dir [4], edge_products
 COMMON BLOCKS:
	DISCSP_RESP:	edges_out, adrm, e_in, atheta, adrm, scale_save

 PROCEDURE:
	Builds a grid of response matrices, computes count rates, then interpolates.

 RESTRICTIONS:
	Edges should be between 3. and 1000. keV
 EXAMPLE:
	IDL> print,apar                           
   	0.00250560      2.12000     0.000000     0.000000
	IDL> discsp_resp, [5.,300],20.,apar, resp &print,resp
	      50.6533

 MODIFICATION HISTORY:
	ras, 22-dec-1995
	ras, 23-sep-1996 keyword inheritance to model function call
	ras, 10-oct-1996 added multi-channel capability
	ras, 17-oct-1996, added protection against narrow output edges
               RAS, 7-Jul-1997, changed PERM_DATA to SSWDB_BATSE


DISCSC_PL $SSW/cgro/batse/idl/discsc_pl.pro
[Previous] [Next]
  Name:
       DISCSC_PL
	
 PURPOSE: using the channel values of the discsc data, return the
	best power-law index, may also be used for DISCLA data
	by setting det_id switch
	
 CALLING SEQUENCE:
	pl = discsc_pl( flare, dselb, disc)
 CATEGORY:
	BATSE
 INPUTS:
	flare - SDAC BATSE archive flare number, referenced to BATSE_FLARE_CATALOG
	dselb - byte mask of selected detectors,
		or if det_id switch is set, then used as a detector id#
		for a single detector	
	disc  - a vector of two to four values, 1st DISCSC(LA) channel, 2nd,
		3rd, and 4th

 OPTIONAL INPUTS:
	new   - if set, new cdrm, chan_edges, and photon_edges are computed
	
 OUTPUTS:	
	returns the power-law spectral index(ices) for those channels at the 
	attitude to the Sun for that detector(s)

 OPTIONAL INPUTS/OUTPUTS:
	NB - IF you want to calculate the pl index for a succession of
	     discsc(la) values for a single flare, then cdrm, chan_edges, and
	     photon_edges must be passed back as arguments.  These are
	     not saved in a common block, the calling program is responsible for
	     returning these calculated values.
	cdrm - detector response matrix expressed as counts/chan per photon/cm2
       cosine - if you don't want to use flare reference for cosine, input this
		value
	chan_edges - nominal energy edges (keV) of last detector in dselb
	photon_edges -photon energy edges (keV) used as inputs for cdrm
 OPTIONAL OUTPUTS:
	a1_photon50 - what SMM/HXRBS used to call A1, the normalization
		of the photon spectrum at 50 keV in photon/cm2/sec/keV
	
 PROCEDURE:
	creates a grid of ratios for model spectra and interpolates

 CALLS: ***
	BATSE_LAD_DRM, DET_COSINES, DISCLA_EDGES, EXIST, F_DIV, INTERPOL, bits [1], bits [2]
	edge_products
 COMMON BLOCKS:
	common discsc_pl_com, plratios

 RESTRICTIONS:
	BATSE_FLARE_CATALOG must be defined
	INST_RESPONSE_LAD_... must exist on PERM_DATA

 MODIFICATION HISTORY:
	ras, 26-apr-95
	


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

 NAME: 
	DISCSP_BANDS

 PURPOSE:
	This procedure integrates the DISCSP channels from multiple
	detectors into a single data stream.

 CATEGORY:
	BATSE, SPEX

 CALLING SEQUENCE:
	DISCSP_BANDS, INPUT, UT, FLUX, EFLUX

 CALLS: ***
	ARR2STR [1], AVG [1], AVG [2], Arr2Str [2], BATSE_SPEC_DRM, CHECKVAR [1]
	DATATYPE [1], DATATYPE [2], DATATYPE [3], DET_COSINES, DISCSP_EDGES, F_DIV
	LOC_FILE [1], LOC_FILE [2], LOC_FILE [3], READ_FLARE, anytim [1], anytim [2]
	anytim [3], anytim [4], anytim [5], checkvar [2], edge_products
	merge_batse_photons, printx [1], printx [2], read_4_spex [1], read_4_spex [2]
 INPUTS:
       Input - Flare number from SDAC BATSE archive
		or a structure with tags:
		FILENAME - DISCSP data file
		START_TIME - Accumulation start time (readable by ANYTIM)
		END_TIME   - Accumulation end time
		COS_SPEC - 8 direction cosines, use if flare value is 0


 OUTPUTS:
	UT   -2xnbins, acc. time interval in seconds since 1 jan 1979
	FLUX - counts in differential band
	EFLUX- Poisson uncertainty on counts
	
 KEYWORDS:

 OPTIONAL INPUTS:
	
	These values can be entered by the tags in the structure Input or Directly.
	The values in the structure take precedence if found.
		FILENAME - DISCSP data file
		START_TIME - Accumulation start time (readable by ANYTIM)
		END_TIME   - Accumulation end time
		COS_SPEC - 8 direction cosines, use if flare value is 0
	MIN_BAND - optional, minimum energy (keV) difference used in creating differential bands
	OVERLAP  - Differential bands may overlap edges, useful with MIN_BAND constraint.
	GETDRM   - Just get the DRM info.
 OPTIONAL OUTPUTS:
	LTIME - Interval livetimes in seconds, nchan x nbins
	DELTA_LIGHT - Band width used to normalize DRM channels, fltarr(nchan)
	AREA - detector geometric area, 127. cm2
	EDGES- differential PHA energy edges
	DRM -  detector response matrix, cnts/cm2/keV per photons/cm2/bin
	ERROR- set if there is an unresolvable problem
	WCHAN- valid channel indices, nominally all of them
	DET_IDS-   array of detector ids meeting requirements
	SCALES- normalization constants used to create differential bands
	EORD-  band order used
	TITLE- 'BATSE DISCSP MULTI-BAND '+ARR2STR(STRTRIM(IDS,2),'')
 CALLED BY:
	read_batse_4_spex [1], read_batse_4_spex [2]
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	This procedure first identifies the datafiles, then reads them using read_4_spex, and
	then creates a merged drm using build_spec_drm.  The PHA channels are built using 
	adjacent DISCSP edges and taking the difference between integral channels where
	the high edge is always greater than 1 MeV.  Normally the adjacent edges lie in
	different detectors, but the rates and DRM's are scaled to ensure that the DRM column
	doesn't fall below zero for this new differential band.
	Flux and DRM for this channel are similarly built and finally the
	difference DRM channel is normalized into the pseudo-PHA width of the newly created
	differential band.

 MODIFICATION HISTORY:
	Version 1, RAS, 31-oct-1996


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

 NAME:  DISCSP_BANDS_DRM


 PURPOSE: Create integrated DRM for  DISCSP Multi Bands


 CATEGORY: BATSE, SPEX


 CALLING SEQUENCE:
	DISCSP_BANDS_DRM, AREA=AREA, DRM=DRM, EDGES_OUT=EDGES_OUT,
	EDGES_IN=EDGES_IN

 CALLS:
	KEYWORDS, None, OPTIONAL INPUTS:, none
 INPUTS:
	None, retrieves the last DRM created by DISCSP_BANDS in common discsp_bands
 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:
	DISCSP_BANDS

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	Extracts arrays calculated in DISCSP_BANDS from structure DRMSAVE in common block.

 MODIFICATION HISTORY:
	RAS, 1-Nov-1996


DISCSP_EDGES $SSW/cgro/batse/idl/discsp_edges.pro
[Previous] [Next]
 Project:
	SDAC
 Name:
       DISCSP_EDGES
 PURPOSE:  
	This functions Returns a 5x8 element array of the DISCSP energy edges for a given 
   	time for the four channels, for 8 detectors.  If DET keyword is passed,
   	returns 2x4 array (see DET keyword below).
 CATEGORY:
	BATSE
 CALLING SEQUENCE:  edges = discsp_edges(intime, det=det)

 INPUTS:
	INTIME - time to get edges for

 OPTIONAL INPUT KEYWORD:
	DET -	Detector number to get edges for (counting from 0).  If 
		present, edges are returned as 2x4 array - lo/hi edges 
		for each of 4 channels. 
	HVSPEC- a structure with tags (N511) for the 511 line positions and SPEC LLD (SLLD)
	values for all 8 detectors
	from an alternate source.  Probably from EDGES_HVSPEC. 

 SAMPLE CALLS:
	edges = discsp_edges('91/6/30')
	edges = discsp_edges(seconds, det=1)

 CALLS: ***
	CALIBRATE [1], CALIBRATE [2], DATATYPE [1], DATATYPE [2], DATATYPE [3]
	EDGES_HVSPEC, GET_DISCSP511, GET_SLLD, SYS2UT, anytim [1], anytim [2], anytim [3]
	anytim [4], anytim [5]
 CALLED BY:
	BATSE_SPEC_GAIN_FDB, DISCSP_BANDS, EDGES_HVSPEC, EVAL_SHERB, FS_SUBTITLE
	PLOTBATSE, PLOTBATSE_QL, RESOLVE_NEW_OBS, SPEC_SENSITIVITY
	read_batse_4_spex [1], read_batse_4_spex [2], spex_batse_preview [1]
	spex_batse_preview [2]
 HISTORY:
 AKT 1/25/94
 ras, 29-dec-1995, pass on single detector to 511 line database to
	speed up by factor of 8
 RAS 9-JUNE-1996, UPGRADED DOCUMENTATION
 RAS 27-jun-1996, passed date to calibrate procedure
 Version 5, 27-march-1998, richard.schwartz@gsfc.nasa.gov, added n511
 Version 6, 30-mar-1998, richard.schwartz@gsfc.nasa.gov,added error to support
	calls to edges_hvspec, removed n511, added hvspec structure input for
	511 lines and SLLD values. 


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

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


DISCSP_READ $SSW/cgro/batse/idl/discsp_read.pro
[Previous] [Next]
 PROJECT:
	SDAC
 NAME:
	DISCSP_READ
 PURPOSE:
 	Procedure to read BATSE DISCSP files and return time, DISCSP, and angle
 	information.  The DISCSP 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 discsp_read 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, discsp_read 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.
 CATEGORY
	BATSE
 CALLING SEQUENCE:
	discsp_read, t, y, cosines	

 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 discsp data where
                  i=4 - channels 0-3 
                  j=8 - LADs 0 through 7
                  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 DISCSP 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
   msfc   -    if set then it is a msfc discsp file w/o housekeeping
		and the cosines will be set those during the closest
		flare to the middle of the time interval.
 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
 
 Common Blocks
	flare_catalog,  fscom, fs_saveaccum 
 CALLS: ***
	CHECKVAR [1], CHECK_OVERFLOW, DET_COSINES, DN_TRANS, FILE2FLARE, FIX_DISCSP
	FS_OPEN [1], FS_OPEN [2], FS_READ_DD, GETUTBASE [1], GETUTBASE [2], RADEC_FILL
	SETUTBASE [1], SETUTBASE [2], SETUTEND [1], SETUTEND [2], SETUTSTART [1]
	SETUTSTART [2], UTIME [1], UTIME [2], anytim [1], anytim [2], anytim [3], anytim [4]
	anytim [5], batse_read_cat, checkvar [2]
 CALLED BY:
	EVAL_SHERB, PLOTBATSE
 MODIFICATION HISTORY:
 Amy Skowronek 94/8/24  (adapted from fdbread)
 Richard Schwartz, 95/09/08, added msfc keyword and cosines option 
	for msfc
 ras, 27-mar-1996 removed setup_arrays, fs_read_dd does it.
 Version 4, fixed overflow time selection, richard.schwartz@gsfc.nasa.gov, 24-feb-1998.


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

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


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

 Purpose:
 DN_FILE creates and updates a file containing all times when BATSE
 was in spacecraft day. The dn file has the following format:
    header record - bytes 0-7:   latest time in seconds since 79/1/1,0
                    bytes 8-11:  spare
                    bytes 12-15: number of data records following header
    data records  - bytes 0-7:   start time of spacecraft day 
                    bytes 8-15:  end time of spacecraft day 

 CALLS: ***
	ATIME [1], ATIME [2], BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], CHKLOG [1]
	CHKLOG [2], CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], CONV_VAX_UNIX
	LOC_FILE [1], LOC_FILE [2], LOC_FILE [3], READ_EPHEM, STR_SEP, USE_VAX_FLOAT
	UTIME [1], UTIME [2], break_file [4], concat_dir [4]
 Procedure:
 DN_FILE first gets an array of all the files available on BATSE_EPHEM
 for the requested year.  It then orders these by the day-of-year given in 
 the extension of the file names.  The files overlap, so in order to be sure
 we get the data from the latest file, we always have two files read, and
 for time intervals that overlap, only use the latest version.  We write
 any intervals greater than the latest end time written in the file, and
 update the header to reflect the current latest time and total number of
 data records in the file.

 This day/night file must be updated in time order.
 Can be killed anytime, and the good intervals from the last ephem file
 it finished will be recorded (after each input file, it writes the good
 intervals, and rewrites the header record).

 Kim Tolbert  5/18/92

 Modified 94/8/17 by Amy Skowronek - uses concat dir with disknames to
 accomodate UNIX.
 Mod. 95/2/2 by AES to search on "*-year" in stead of "*year" so we'll
 be less likely to get bogus files in the findfile - like 1994.dir
 Mod. 97/1/22 by RCJ to order files correctly. Problem when year changed.
		Also made open files as stream.
 Version 5, richard.schwartz@gsfc.nasa.gov, 24-jun-1998, forced old VAX float format on write.
 Version 6, eva@kano.nascom.nasa.gov, 23-oct-1998, added old VAX conversion onto procedure that
						    writes day/night intervals.
						    (had been omitted in Version 5)
 Version 7, 21-mar-2001, ras, use loc_file and SSWDB_BATSE to find dn_file.dat


DN_TRANS $SSW/cgro/batse/idl/dn_trans.pro
[Previous] [Next]
 NAME:
	DN_TRANS

 PURPOSE:
	Finds the xray day/night transitions in BATSE housekeeping data
 	Fills for bad data if needed.
 CATEGORY:
	BATSE

 CALLING SEQUENCE:
	dn_trans, ut, x_pos,y_pos,z_pos, daymarks, nightmarks

 INPUTS:
	Ut - is in seconds from 79/1/1
	X_pos, Y_pos, Z_pos - spacecraft position in 0.25 km units, celestial
	J2000.
	

 OPTIONAL INPUTS:
	
 KEYWORD PARAMETERS:
	o_angle - sun_earth_sc angle of day or night transitions, about 110 deg
	s_angle - vector of angles formed by dotting earth-sun and earth-sc vectors, 
	sc_new  - array of x(yz)_pos vectors, including estimated fill positions
	bad_data - set to 1 if there are too few valid positions to calculate the fill
	    positions
	d_period - orbital period in seconds calculated from reported x,y,z_pos
	ntrans - number of transitions through day/night or night/day bound. in ut

	days & nights - times of day/night crossings for 31 orbits centered around
                ut(0)
	inradec - optional
	   2 element vector, ra and dec in degrees of a point source instead of the sun

 OUTPUTS:
	Daymarks:	times of transitions from night to day relative to 79/1/1
	Nightmarks:	times of transitions from day to night relative to 79/1/1
	daymarks set to 0 if there are no crossings into day, ras, 91/05/10
	nightmarks set to 0  if there are no crossings into night
 CALLS: ***
	OCCTIME, ORBIT_FILL
 CALLED BY:
	CONT_READ, DISCSP_READ, FDBREAD, FS_ACC, FS_ACC_CONT, FS_ACC_DISCSP, HXRBS_OCC, ORBIT
	PLOT_OCC_ONDAY, QLARCHIVE
 PROCEDURE:
	Looks for positions of the spacecraft with the Sun just at the horizon.
	Missing position data is filled.

 EXAMPLE:
	dn_trans, ut, x_pos,y_pos,z_pos, daymarks, nightmarks,$
	sc_new=sc,s_angle=s_angle,o_angle=o_angle,bad_data=bad_data,$
        ntrans=ntrans,d_period=d_period

 MODIFICATION HISTORY:
	Modified by RAS, 92/9/15:


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

 NAME: 
       DO_ALANSLIST

 PURPOSE:


 CATEGORY:
       BATSE

 CALLING SEQUENCE:


 CALLS: ***
	FLARE_LIST, FLARE_SELECT, PARSE_ATIME [1], UTIME [1], UTIME [2], batse_read_cat
	parse_atime [2]
 INPUTS:
       none explicit, only through commons;

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:


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

 NAME: 
       DO_ARCHIVEPLOTS

 PURPOSE:


 CATEGORY:
       BATSE

 CALLING SEQUENCE:


 CALLS: ***
	CHKLOG [1], CHKLOG [2], CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], FSDEF
	FS_AUTO_LOG, FTP_BATSEPLOTS, GET_HXP, PLOT_FLARE, RECORD_LATEST_NUMBER
	SET_GRAPHICS [1], SET_GRAPHICS [2], YOHKOH_FORMAT [1], YOHKOH_FORMAT [2]
	batse_read_cat, concat_dir [4], hxrbs_format, yohkoh_format [3]
 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:


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

 PURPOSE:  
	DO_EVENTLISTS creates the YYMMDD.EVENTS files on BATSE_EVENTS containing
           all events catalogued on the given day.  

 CATEGORY:
       BATSE

 CALLING SEQUENCE:
	DO_EVENTLISTS, Firstday, Lastday

 CALLS: ***
	CHKLOG [1], CHKLOG [2], CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], FLARE_LIST
	FLARE_SELECT, PARSE_ATIME [1], YOHKOH_FORMAT [1], YOHKOH_FORMAT [2], anytim [1]
	anytim [2], anytim [3], anytim [4], anytim [5], batse_read_cat, concat_dir [4]
	hxrbs_format, parse_atime [2], yohkoh_format [3]
 INPUTS:
   firstday - (input) string containing first day to create file for in
              the format '91/4/19'
   lastday - (input) string containing the last day to create file for in
             the fornat '91/4/25'
       none explicit, only through commons;

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	A file, BATSE_FLARES.out, is renamed to yymmdd.events to BATSE_EVENTS

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:

 Kim Tolbert 8/15/91
	Version 2, RAS, 3-apr-1997


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

 NAME: 
       DO_FDBFILES

 PURPOSE:


 CATEGORY:
       BATSE

 CALLING SEQUENCE:


 CALLS: ***
	FSDEF, READ_FLARE, WRITE_FDB, YOHKOH_FORMAT [1], YOHKOH_FORMAT [2], hxrbs_format
	yohkoh_format [3]
 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:


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

 NAME: 
       DO_PSPLOTS

 PURPOSE:


 CATEGORY:
       BATSE

 CALLING SEQUENCE:


 CALLS: ***
	CHKLOG [1], CHKLOG [2], CONCAT_DIR [1], CONCAT_DIR [2], CONCAT_DIR [3], FSDEF
	FTP_BATSEPLOTS, GET_HXP, PLOT_FLARE, RECORD_LATEST_NUMBER, SET_GRAPHICS [1]
	SET_GRAPHICS [2], YOHKOH_FORMAT [1], YOHKOH_FORMAT [2], batse_read_cat
	concat_dir [4], hxrbs_format, yohkoh_format [3]
 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:


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

 PURPOSE:             
	This procedure processes the daily data files throught the quicklook archive
	production program.

 CATEGORY:
       BATSE

 CALLING SEQUENCE:
	QL_ARCHIVE

 CALLS: ***
	ATIME [1], ATIME [2], LOC_FILE [1], LOC_FILE [2], LOC_FILE [3], PARSE_ATIME [1]
	QLARCHIVE, anytim [1], anytim [2], anytim [3], anytim [4], anytim [5]
	parse_atime [2]
 INPUTS:
       none explicit, only through commons;

 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	The bdb files to process are found in the symbols "p1" and "p2" set by other procedures
	or command files.

 MODIFICATION HISTORY:
 	Shelby Kennard, 1991
	Version 2, richard.schwartz@gsfc.nasa.gov, 8-aug-1997, use parse_atime to 
	parse the year.


DO_WRITE_DD $SSW/cgro/batse/idl/do_write_dd.pro
[Previous] [Next]
  Modified by AES 9/22/94 to check for existing files here before running
  write_dd on flare files from msfc.  
  
+

 NAME: 
       DO_WRITE_DD

 PURPOSE:


 CATEGORY:
       BATSE

 CALLING SEQUENCE:


 CALLS: ***
	BREAK_FILE [1], BREAK_FILE [2], BREAK_FILE [3], CHECKVAR [1], YYMMDD
	break_file [4], checkvar [2]
 INPUTS:
       none

 OPTIONAL INPUTS:
       flare1, number of first flare to create cont and discsp files for
	flare2, number of last flare to create cont and discsp files for
       inflares, array of flares to check
 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 COMMON BLOCKS:
	none

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:
       97/09/22 AES modified to check for files in new cont
	         and discsp archives - now takes an array
                of flares instead of a starting and ending flare
       97/09/24 AES retrofitted to take array as a keyword instead
                of the default


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

 NAME: 
       DRAW_FLARE

 PURPOSE:
 draw_flare draws vertical marks showing the start, peak, and end of a flare
 and start and end of any background intervals defined for the flare.


 CATEGORY:
       BATSE

 CALLING SEQUENCE:


 CALLS: ***
	CH_SCALE, COPY_STRUCT [1], COPY_STRUCT [2], COPY_STRUCT [3], GETUTBASE [1]
	GETUTBASE [2], PL_SCALE, SET_GRAPHICS [1], SET_GRAPHICS [2], TEK_END [1]
	TEK_END [2], TEK_INIT [1], TEK_INIT [2], VERT_MARK
 INPUTS:
       sec_arr- time axis for light curve to be overplotted
       flare_data
 OPTIONAL INPUTS:
	none

 OUTPUTS:
       none explicit, only through commons;

 OPTIONAL OUTPUTS:
	none

 KEYWORDS:
	none
 CALLED BY:
	FS_ARCHIVE_DRAW, SHOW_FLARE
 COMMON BLOCKS:
	FSCOM, SAVECOMMON

 SIDE EFFECTS:
	none

 RESTRICTIONS:
	none

 PROCEDURE:
	none

 MODIFICATION HISTORY:

 Mod. 7 Feb 94 by AKT. Include flare_save_str, and use copy_struct
 to copy tag values into it from flare_data structure.  This is needed
 so that if flare_data structure changes (e.g. we add new tags), the structure
 saved in the archive flare plot files won't change.
 Mod. 28 Jun 95 by AES. Use lowercase filenames
 Version 4 AES 9-oct-97 Added gif keyword


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

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