Extended IDL Help

This page was created by the IDL library routine mk_html_help2.

Last modified: Tue Feb 13 17:06:18 2001.


A , C , E , F , G , J , L , M , N , O , P , S , T , V

Directories Searched:


Alphabetical List of Routines


Routine Descriptions

ANGLE_TO_BIN

[Next Routine] [List of Routines]
FUNCTION:	angle_to_bin(dat,an)
INPUT:	
	dat:	structure,	2d data structure filled by get_fa_ees, get_fa_eeb, etc.
	an:	real,fltarr(i),	2D - real or float array of pitch angle values 
		fltarr(i,2),	3D - theta=fltarr(*,0), phi=fltarr(*,1)
KEYWORD:
	EBIN	int,intarr(i)	optional, energy bins corresponding to "an"
				used when angles depend upon energy bin
PURPOSE:
	Returns the angle bin numbers in "dat" nearest to "an"

CREATED BY:
	J.McFadden
LAST MODIFICATION:
	96-4-23		J.McFadden
	96-8-27		J.McFadden	Changed algorithm to include (mod 360.) and
					handle arbitrary order in dat.theta or dat.phi
	98-4-24		J.McFadden	Corrected typos in documentation

(See /disks/fast/software/integration/src/esa/angle_to_bin.pro)


ANGLE_TO_BINS

[Previous Routine] [Next Routine] [List of Routines]
FUNCTION:	angle_to_bins(dat,an,EBIN=ebin)
INPUT:	
	dat:	structure,	2d data structure filled by get_eesa_surv, get_eesa_burst, etc.
	an:	fltarr(2),	2D - min,max pitch angle limits (0-360 deg) 
		fltarr(2,2),	3D - array of (theta,phi) angle values 
				theta min,max (0,0),(1,0) -90

(See /disks/fast/software/integration/src/esa/angle_to_bins.pro)


CALC_FA_ESA_GEOM

[Previous Routine] [Next Routine] [List of Routines]
 FUNCTION:
 	 CALC_ESA_GEOM

 DESCRIPTION:

	function to get esa geometry factors

 CALLING SEQUENCE:

 	data =  calc_esa_geom(esa_data_struct)

 ARGUMENTS:

	esa_data_struct	This is a struct return by a get_?esa_* ()
			routine.  This must contain the header_bytes
			and time structure tag.

 RETURN VALUE:

	Upon success, an array of floats containing the geometry
	factor for each energy bin.  else a scaler -1 is returned.

 REVISION HISTORY:

	@(#)calc_fa_esa_geom.pro	1.2 03/03/97
 	Originally written by Jonathan M. Loran,  University of 
 	California at Berkeley, Space Sciences Lab.   June '96

(See /disks/fast/software/integration/src/esa/calc_fa_esa_geom.pro)


CONTOUR2D

[Previous Routine] [Next Routine] [List of Routines]
PROCEDURE: contour2d,data
PURPOSE:
	Produces contour plots of pitch angle dist.s from 2D data structures.
INPUTS:
   data   - structure containing 2d data  (obtained from get_fa_???() routine)
		e.g. "get_fa_ees, get_fa_ies, etc."
KEYWORDS:
	LIMITS - A structure containing limits and display options.
             see: "options", "xlim" and "ylim", to change limits
	UNITS  - convert to given data units before plotting
	MSEC - Subtitle will include milliseconds
	TITLE - Title to be plotted, 
		- set title=' ' for NO Title!
		- set title='1' for just the time in the title
	XTITLE - xtitle to be plotted, 
		- set xtitle=' ' for NO xtitle!, default determined by VEL keyword
	YTITLE - ytitle to be plotted, 
		- set ytitle=' ' for NO ytitle!, default=data.units_name
	RETRACE - set to number of retrace steps removed, 
		- typically set to 1 for FAST esas
		- minus number will remove -(retrace) steps from end of sweep
	VEL - If set, x-axis is velocity km/s  -- Default is Energy (eV) 

	NCONT - Number of contours to be plotted, default = 8
	LEVELS - Explicit contour levels, default levels spaced down
	         from max by 10^.5 
	FILL - If set, contours are filled with solid color or gray scale
	BW - If set, contours are white, no affect on fill plots
	PURE - If set, 6 pure colors are cycled through for levels
	POLAR - Makes a polar plot
	ROTATE - Exchanges x and y axes for non-polar plots
	LABEL - Labels the contour levels
       LAB_0 - Puts 0 in center of plot (default is 90). Labels pitch angles with 90 degree increments.
       LAB_90 - Puts 90 in center of plot (default is 90). Labels pitch angles with 90 degree increments.
       LAB_180 - Puts 180 in center of plot (default is 90). Labels pitch angles with 90 degree increments.
       XMARGIN - Change xmargin from default
	YMARGIN - Change ymargin from default

See "pitch2d" for another means of plotting data.
See "conv_units" to change units.


CREATED BY:	J. McFadden  96-8-31
FILE:  contour2d.pro
VERSION 1.
MODIFICATIONS: 
		McFadden 	96-9-3		More keywords added
		Delory				Polar keyword
		McFadden	97-11-20	Lab_0,LAB_180 keywords
		McFadden	98-3-3		xmargin, ymargin keywords
		

(See /disks/fast/software/integration/src/esa/contour2d.pro)


CONVERT_ESA_UNITS

[Previous Routine] [Next Routine] [List of Routines]
PROCEDURE:	convert_esa_units
PURPOSE:	to convert units of data from any of the eesa or pesa
		instruments.
INPUT:		
	data:	A 3d structure such as those generated by get_el,get_pl,etc.
	units:	A string telling the procedure which units to convert to, such
		as ncounts,rate,nrate,eflux,flux,df

KEYWORDS:
	scale:	A named variable that will return the scale used to convert

CREATED BY:	Davin Larson
LAST MODIFICATION:	@(#)convert_esa_units.pro	1.6 95/11/07

(See /disks/fast/software/integration/src/esa/convert_esa_units.pro)


CONVERT_ESA_UNITS2

[Previous Routine] [Next Routine] [List of Routines]
PROCEDURE:	convert_esa_units2
PURPOSE:	
	To convert FAST ESA data units to counts,eflux,flux,df,rate, or crate

	'COUNTS' :  #						
	'RATE'   :  #/sec
	'CRATE'  :  #/sec		(dead time corrected)
	'EFLUX'  :  eV/(cm^2-s-sr-eV)	(dead time corrected)
	'FLUX'   :  #/(cm^2-s-sr-eV)	(dead time corrected)
	'DF'     :  #/(km^3-(cm/s)^3)	(dead time corrected)
INPUT:		
	data:	A 3d structure such as those generated by get_el,get_pl,etc.
	units:	A string telling the procedure which units to convert to, such
		as ncounts,rate,nrate,eflux,flux,df

KEYWORDS:
	scale:	A named variable that will return the scale used to convert

CREATED BY:	J. McFadden (modified from convert_esa_units - D.Larson)
LAST MODIFICATION:	97/03/03
MOD HISTORY:
		97/03/03	Changed to accept 1-D or 2-D GEOM structure element

(See /disks/fast/software/integration/src/esa/convert_esa_units2.pro)


C_2D

[Previous Routine] [Next Routine] [List of Routines]
FUNCTION:	c_2d(dat,ENERGY=en,ERANGE=er,EBINS=ebins,ANGLE=an,ARANGE=ar,BINS=bins)
INPUT:	
	dat:	structure,	2d data structure filled by get_fa_ees, get_fa_eeb, etc.
KEYWORDS
	ENERGY:	fltarr(2),	optional, min,max energy range for integration
	ERANGE:	fltarr(2),	optional, min,max energy bin numbers for integration
	EBINS:	bytarr(na),	optional, energy bins array for integration
					0,1=exclude,include,  
					na = dat.nenergy
	ANGLE:	fltarr(2),	optional, min,max pitch angle range for integration
	ARANGE:	fltarr(2),	optional, min,max angle bin numbers for integration
	BINS:	bytarr(nb),	optional, angle bins array for integration
					0,1=exclude,include,  
					nb = dat.ntheta
	BINS:	bytarr(na,nb),	optional, energy/angle bins array for integration
					0,1=exclude,include
PURPOSE:
	Returns the sum of the counts in dat.data
NOTES:	
	Function normally called by "get_2dt" to generate 
	time series data for "tplot".

CREATED BY:
	J.McFadden	96-12-13	
LAST MODIFICATION:
	

(See /disks/fast/software/integration/src/esa/c_2d.pro)


EC_2D

[Previous Routine] [Next Routine] [List of Routines]
FUNCTION:	ec_2d((dat,ENERGY=en,ERANGE=er,EBINS=ebins,ANGLE=an,ARANGE=ar,BINS=bins)
INPUT:	
	dat:	structure,	2d data structure filled by get_eesa_surv, get_eesa_burst, etc.
KEYWORDS
	ENERGY:	fltarr(2),	optional, min,max energy range for integration
	ERANGE:	fltarr(2),	optional, min,max energy bin numbers for integration
	EBINS:	bytarr(na),	optional, energy bins array for integration
					0,1=exclude,include,  
					na = dat.nenergy
	ANGLE:	fltarr(2),	optional, min,max pitch angle range for integration
	ARANGE:	fltarr(2),	optional, min,max angle bin numbers for integration
	BINS:	bytarr(nb),	optional, angle bins array for integration
					0,1=exclude,include,  
					nb = dat.ntheta
	BINS:	bytarr(na,nb),	optional, energy/angle bins array for integration
					0,1=exclude,include
PURPOSE:
	Returns the characteristic energy, Ec, eV
NOTES:	
	Function calls j_2d.pro and je_2d.pro
	Function normally called by "get_2dt.pro" to generate 
	time series data for "tplot.pro".

CREATED BY:
	J.McFadden
LAST MODIFICATION:
	96-7-5		J.McFadden

(See /disks/fast/software/integration/src/esa/ec_2d.pro)


EIESA_UNPACK_SURV_HDR

[Previous Routine] [Next Routine] [List of Routines]
 FUNCTION:
 	 EIESA_UNPACK_SURV_HDR

 DESCRIPTION:

	function to unpack the Eesa and Iesa packet headers

	A structure of the following format is returned:

	   DATA_NAME     			STRING  'E[I]esa Survey Header'
	   VALID         			INT       1
 	   PROJECT_NAME  			STRING    'FAST'
 	   UNITS_NAME    			STRING    'Raw'
	   TIME          			DOUBLE    8.0118726e+08
	   SPIN_NUMBER				INT       0
	   SPIN_PHASE				INT       0
	   MAG_PHASE				INT       0
	   SWEEP_MODE    			INT       0 
	   RETRACE       			INT       0 
	   TOP_ENERGY    			INT       0
	   DIRECTION     			INT       0               
	   AMPLITUDE     			INT       0
	   CALIBRATE_MODE  			INT       0     
	   LOW_ENERGY    			INT       0
	   DWELL         			INT       0
	   ACCUM         			INT       0
	   MODE          			INT       0
	   NENERGY_MODE  			INT       0
	   DESPUN        			INT       0
	   SWEEPS_PER_AVERAGE 			INT       0
	   BLOCKS_PER_PACKET 			INT       0
	   NENERGY       			INT       0
	   NANGLE        			INT       0
	   NBINS         			INT       0
	   TYPE         			INT       0
	   SC       	  			INT       0
	   MARRAY_HDR_IDX 	  		INT       0
	   MARRAY_HDR_SUBCNT 	  		INT       0
	   BLKS_FROM_OLD_SWP 	  		INT       0
	   BLKS_REM_IN_PNDING_SWP 		INT       0
	   NON_TTAGED_DATA_IDX 	  		INT       0
	   DATA_INDICES 	  		INTARR(32)
	   SECS_PER_BLOCK 	  		DOUBLE    0
	   SPIN_RATE 	  			DOUBLE    0
	
 CALLING SEQUENCE:

 	data = eiesa_unpack_surv_hdr (eiesa_surv_data_struct)

 ARGUMENTS:

	eiesa_surv_data_struct	This is a struct return by get_eesa_surv ()
				for Eesa data, or get_iesa_surv () for
 				Iesa data.

 RETURN VALUE:

	Upon success, the above structure is returned, with the valid tag
	set to 1.  Upon failure, the valid tag will be 0.

 REVISION HISTORY:

	@(#)eiesa_unpack_surv_hdr.pro	1.3 03/03/97
 	Originally written by Jonathan M. Loran,  University of 
 	California at Berkeley, Space Sciences Lab.   June '95

(See /disks/fast/software/integration/src/esa/eiesa_unpack_surv_hdr.pro)


ENERGY_TO_EBIN

[Previous Routine] [Next Routine] [List of Routines]
FUNCTION:	energy_to_ebin(dat,en)
INPUT:	
	dat:	structure,	2d data structure filled by get_eesa_surv, get_eesa_burst, etc.
	en:	real,fltarr,	real or float array of energy values
KEYWORD:
	BIN	int,intarr	optional, angle bins corresponding to "en"
				used when energies depend upon angle bin
PURPOSE:
	Returns the energy bin numbers in "dat.energy" nearest to "en"

CREATED BY:
	J.McFadden
LAST MODIFICATION:
	96-4-22		J.McFadden

(See /disks/fast/software/integration/src/esa/energy_to_ebin.pro)


ESA_ANODE_CALIB

[Previous Routine] [Next Routine] [List of Routines]
 PROCEDURE: esa_anode_calib,orbit

 reads in data from individual angle bins from esa burst data,
 asks user to click on boundaries of loss cone, and averages
 remaining points

 INPUT:
  orbit  the orbit number (used in the filename) which you are calibrating

 OUTPUT:
  prints calibration values (nomalized to 1.0) for 32 angle bins

 KEYWORDS:

 ENERGY  passed onto get_2dt.  If not set, default is [1000,20000]
 DIR     set this keyword to the directory in which tplot files
         are stored.  Default is current directory.
 DATASRC set this keyword to the string passed by get_2dt (i.e. 'fa_eeb',
         'fa_ieb', 'fa_seb1','fa_seb2', etc) If this keyword is
         not set it defaults to 'fa_eeb'
 SHOW4   set this keyword to show plots of 4 bins and the losscones
 SHOW8   set this keyword to show plots of 8 bins and the losscones
 SHOWALL set this keyword to show plots of all bins and the losscones
 SDT     set this keyword to get esa data directly from SDT 
     (default is to read in tplot files)  Note that SDT needs to
     be running anyways, because of the fa_fields_phase

 Need to have phase (1032) in SDT.  If SDT keyword set, need also to
 have EesaBurstAggregate in SDT.

 Written 97-4-15   by Y-K Tung
 Modified 98-2-11  by Y-K Tung  added keyword DIR
 Modified 98-2-20  by Y-K Tung  added keyword ENERGY

(See /disks/fast/software/integration/src/esa/esa_anode_calib.pro)


FAST_ESA_BATCH

[Previous Routine] [Next Routine] [List of Routines]
 PROCEDURE:
 	 FAST_I_BATCH

 DESCRIPTION:

	This is the fast idl batch processing file for ion and electron summary
	plots. 
	It is meant to be called from sdt.
	Sdt would wait till this batch script is complete and then exit.
	   
	
 CALLING SEQUENCE:

 	idl fast_i_batch

 REVISION HISTORY:

	@(#)fast_batch.pro	1.3 24 Jul 1996
 	Originally written by Jonathan M. Loran,  University of 
 	California at Berkeley, Space Sciences Lab.   July '96

(See /disks/fast/software/integration/src/esa/fast_esa_batch.pro)


FUNCT_FIT2D

[Previous Routine] [Next Routine] [List of Routines]
PROCEDURE: funct_fit2d,dat

   Select energy/angle range and perform functional fit to data
   (default Maxwellian) 
INPUTS:
   	dat   	- data structure containing 2d data 
		- e.g. "get_fa_ees, get_fa_ies, etc."
KEYWORDS:
	NFITF	integer		optional number of functions for the
	                        fit, default = 1 
	FITF	string		optional function for the fit, default
	                        = maxwellian 
	AUTO	0/1		if set, defaults are used and peak
	                        energy determined from the data
	ENERGY:	fltarr(2),	optional, min,max energy range for fit
	ERANGE:	fltarr(2),	optional, min,max energy bin numbers
	                        for fit 
	EBINS:	bytarr(na),	optional, energy bins array for fit
					0,1=exclude,include,  
					na = dat.nenergy
	ANGLE:	fltarr(2),	optional, min,max pitch angle range
	                        for fit 
	ARANGE:	fltarr(2),	optional, min,max angle bin numbers
	                        for fit 
	BINS:	bytarr(nb),	optional, angle bins array for fit
					0,1=exclude,include,  
					nb = dat.ntheta
	BINS:	bytarr(na,nb),	optional, energy/angle bins array for
	                        fit 0,1=exclude,include
	LIMITS 	- A structure containing limits and display options.
             	see: "options", "xlim" and "ylim", to change limits
	UNITS  	- convert to given data units before plotting
	F_UNITS - convert dat.data to given data units before 
			passing to function "FITF"
	COLOR  	- array of colors to be used for each bin
	LABEL  	- Puts bin labels on the plot if set.
	SUMPLT - redraws the summed data and the fit after
	         completion. 
	MSEC - Subtitle will include milliseconds

NOTES:
	This program still has bugs and may not weight the points
	properly !!!!! 

	See "spec2d" for another means of plotting data.
	See "conv_units" to change units.
	See "time_stamp" to turn time stamping on and off.
	 Future changes: fitfunct.pro, tempfit.pro, tempfit2.pro


CREATED BY:	J. McFadden  96-11-14
FILE:  funct_fit3d.pro
VERSION 1.
LAST MODIFICATION: Ver 1.1 GTDelory 97-07-30

(See /disks/fast/software/integration/src/esa/funct_fit2d.pro)


FU_SPEC2D

[Previous Routine] [Next Routine] [List of Routines]
PROGRAM:	fu_spec2d(funct,dat)
INPUT:	
	funct:	string,		function that operates on structures generated 
					by get_eesa_surv, get_eesa_burst, etc.
				funct   = 'n_2d','j_2d','v_2d','p_2d','t_2d',
					  'vth_2d','ec_2d', or 'je_2d'
	dat:	structure,	2d data structures
				example: dat = get_fa_ees(t)
KEYWORDS
	LIMITS - structure,	A structure containing limits and display options.
				see: "options", "xlim" and "ylim", to change limits
	ANGLE:	fltarr(2),	optional, min,max pitch angle range for integration
	ARANGE:	fltarr(2),	optional, min,max angle bin numbers for integration
	BINS:	bytarr(nb),	optional, angle bins array for integration
					0,1=exclude,include,  
					nb = dat.ntheta
	INTEG_F:	0,1	if set, plot forward integral
	INTEG_R:	0,1	if set, plot reverse integral

PURPOSE:
	Plots the differential funct(dat) versus energy, funct(dat) is integrated over angle only

CREATED BY:
	J.McFadden	97/03/13
LAST MODIFICATION:  97/03/13
MOD HISTORY:	

NOTES:	  
	Current version only works for FAST

(See /disks/fast/software/integration/src/esa/fu_spec2d.pro)


GET_2DT

[Previous Routine] [Next Routine] [List of Routines]
PROGRAM:	get_2dt,funct,get_dat
INPUT:	
	funct:	function,	function that operates on structures generated 
					by get_eesa_surv, get_eesa_burst, etc.
				funct   = 'n_2d','j_2d','v_2d','p_2d','t_2d',
					  'vth_2d','ec_2d', or 'je_2d'
	get_dat:function,	function that returns 2d data structures
				function name must be "get_"+"get_dat"  
				get_dat = 'eesa_surv' for get_eesa_surv, 
				get_dat = 'eesa_burst' for get_eesa_burst, etc.
KEYWORDS
	T1:	real or dbl	start time, seconds since 1970
	T2:	real or dbl	end time, seconds since 1970		
	ENERGY:	fltarr(2),	optional, min,max energy range for integration
	ERANGE:	fltarr(2),	optional, min,max energy bin numbers for integration
	EBINS:	bytarr(na),	optional, energy bins array for integration
					0,1=exclude,include,  
					na = dat.nenergy
	ANGLE:	fltarr(2),	optional, min,max pitch angle range for integration
	ARANGE:	fltarr(2),	optional, min,max angle bin numbers for integration
	BINS:	bytarr(nb),	optional, angle bins array for integration
					0,1=exclude,include,  
					nb = dat.ntheta
	BINS:	bytarr(na,nb),	optional, energy/angle bins array for integration
	GAP_TIME: 		time gap big enough to signify a data gap 
				(def 200 sec, 8 sec for FAST)
	NO_DATA: 	returns 1 if no_data else returns 0
	NAME:  		New name of the Data Quantity
				Default: funct+'_'+get_dat
	BKG:  		A 3d data structure containing the background counts.
	FLOOR:  	Sets the minimum value of any data point to sqrt(bkg).
	MISSING: 	value for bad data.
					0,1=exclude,include
	CALIB:		Calib keyword passed on to get_dat

PURPOSE:
	To generate time series data for "tplot.pro" 
NOTES:	
	Program names time series data to funct+"_"+get_dat if NAME keyword not set
		See 'tplot_names.pro'.

CREATED BY:
	J.McFadden
LAST MODIFICATION:  97/03/04
MOD HISTORY:	
		97/03/04	T1,T2 keywords added

NOTES:	  
	Current version only works for FAST

(See /disks/fast/software/integration/src/esa/get_2dt.pro)


GET_2DT_TS

[Previous Routine] [Next Routine] [List of Routines]
PROGRAM:	get_2dt_ts,funct,get_dat
INPUT:	
	funct:	function,	function that operates on structures generated 
					by get_eesa_surv, get_eesa_burst, etc.
				funct   = 'n_2d','j_2d','v_2d','p_2d','t_2d',
					  'vth_2d','ec_2d', or 'je_2d'
	get_dat:function,	function that returns 2d data structures
				function name must be "get_"+"get_dat"+"_ts"  
				get_dat = 'fa_ees' for get_fa_ees_ts, 
				get_dat = 'fa_eeb' for get_fa_eeb_ts, etc.
KEYWORDS
	T1:	real or dbl	start time, seconds since 1970
	T2:	real or dbl	end time, seconds since 1970		
	ENERGY:	fltarr(2),	optional, min,max energy range for integration
	ERANGE:	fltarr(2),	optional, min,max energy bin numbers for integration
	EBINS:	bytarr(na),	optional, energy bins array for integration
					0,1=exclude,include,  
					na = dat.nenergy
	ANGLE:	fltarr(2),	optional, min,max pitch angle range for integration
	ARANGE:	fltarr(2),	optional, min,max angle bin numbers for integration
	BINS:	bytarr(nb),	optional, angle bins array for integration
					0,1=exclude,include,  
					nb = dat.ntheta
	BINS:	bytarr(na,nb),	optional, energy/angle bins array for integration
	GAP_TIME: 		time gap big enough to signify a data gap 
				(def 200 sec, 8 sec for FAST)
	NO_DATA: 	returns 1 if no_data else returns 0
	NAME:  		New name of the Data Quantity
				Default: funct+'_'+get_dat
	BKG:  		A 3d data structure containing the background counts.
	FLOOR:  	Sets the minimum value of any data point to sqrt(bkg).
	MISSING: 	value for bad data.
					0,1=exclude,include
	CALIB:		Calib keyword passed on to get_dat
	n_get_pts: 	Number of points in the array of structures formed by get_"data_str"_ts, default=200.

PURPOSE:
	To generate time series data for "tplot.pro" 
NOTES:	
	Program names time series data to funct+"_"+get_dat if NAME keyword not set
		See 'tplot_names.pro'.

CREATED BY:
	J.McFadden
LAST MODIFICATION:  97/05/16
MOD HISTORY:	
		97/05/16	Variation on get_2dt.pro that uses get_*_ts.pro routines

NOTES:	  
	Current version only works for FAST

(See /disks/fast/software/integration/src/esa/get_2dt_ts.pro)


GET_EN_SPEC

[Previous Routine] [Next Routine] [List of Routines]
PROCEDURE:	get_en_spec
PURPOSE:	
	Generates energy-time spectrogram data structures for tplot
INPUT:		
	data_str, 	a string (either 'eh','pl','eesa_surv','ess', ...)
			where get_'string' returns a 2D or 3D 
			data structure
KEYWORDS:
	T1:		start time, seconds since 1970
	T2:		end time, seconds since 1970		
	ANGLE:		fltarr(2),fltarr(4)	angle range to sum over
	ARANGE:		intarr(2)		bin range to sum over
	BINS:		bytarr(dat.nbins)	bins to sum over
	gap_time: 	time gap big enough to signify a data gap 
			(default 200 sec, 8 sec for FAST)
	NO_DATA: 	returns 1 if no_data else returns 0
	UNITS:		convert to these units if included
	NAME:  		New name of the Data Quantity
	BKG:  		A 3d data structure containing the background counts.
	FLOOR:  	Sets the minimum value of any data point to sqrt(bkg).
	MISSING: 	value for bad data.
	RETRACE: 	Set to number of retrace energy steps to be eliminated starting at energy step 0
	CALIB:		Calib keyword passed on to get_"get_dat"_ts



CREATED BY:	J.McFadden
VERSION:	1
LAST MODIFICATION:  97/03/04
MOD HISTORY:
		97/03/04	T1,T2 keywords added
		97/05/22	CALIB keyword added


NOTES:	  
	Current version only works for FAST

(See /disks/fast/software/integration/src/esa/get_en_spec.pro)


GET_EN_SPEC_TS

[Previous Routine] [Next Routine] [List of Routines]
PROCEDURE:	get_en_spec_ts
PURPOSE:	
	Generates energy-time spectrogram data structures for tplot
INPUT:		
	get_dat, 	a string (either 'fa_ees','fa_eeb', ...)
			where get_'string'_ts returns a 2D or 3D 
			array of data structures
KEYWORDS:
	T1:		start time, seconds since 1970
	T2:		end time, seconds since 1970		
	ANGLE:		fltarr(2),fltarr(4)	angle range to sum over
	ARANGE:		intarr(2)		bin range to sum over
	BINS:		bytarr(dat.nbins)	bins to sum over
	gap_time: 	time gap big enough to signify a data gap 
			(default 200 sec, 8 sec for FAST)
	NO_DATA: 	returns 1 if no_data else returns 0
	UNITS:		convert to these units if included
	NAME:  		New name of the Data Quantity
	BKG:  		A 3d data structure containing the background counts.
	FLOOR:  	Sets the minimum value of any data point to sqrt(bkg).
	MISSING: 	value for bad data.
	RETRACE: 	Set to number of retrace energy steps to be eliminated starting at energy step 0
	CALIB:		Calib keyword passed on to get_"get_dat"_ts
	n_get_pts: 	Number of points in the array of structures formed by get_"get_dat"_ts, default=200.

CREATED BY:	J.McFadden
VERSION:	1
LAST MODIFICATION:  97/05/15
MOD HISTORY:
		97/05/15	Variation on get_en_spec.pro with help from J.Loran

NOTES:	  
	Current version only works for FAST

(See /disks/fast/software/integration/src/esa/get_en_spec_ts.pro)


GET_FA_2D_FIELDS

[Previous Routine] [Next Routine] [List of Routines]

 Please look at documentation for get_fa_fields...you shouldn't call
 GET_FA_2D_FIELDS directly...

(See /disks/fast/software/integration/src/esa/get_fa_2d_fields.pro)


GET_FA_BDC

[Previous Routine] [Next Routine] [List of Routines]
 NAME: get_fa_bdc

 DESCRIPTION: returns a structure containing DC
 magnetic field survey data from the FAST magnetometer (UCLA). It
 must be the case that SDT is running, with Mag1dc, Mag2dc_S, and Mag3dc_S
 plotted on screen already. 

    The returned structure looks like this:


  DATA_NAME           STRING    ' '                 ; which mag quantities
  VALID               INT       1                   ; Data valid flag
  PROJECT_NAME        STRING    'FAST'              ; project name
  UNITS_NAME          STRING    'nT'                ; Units of this data    
  UNITS_PROCEDURE     STRING    'fa_fields_units'   ; Units conversion proc 
  START_TIME          DOUBLE                        ; Start Time of sample  
  END_TIME            DOUBLE                        ; End time of sample    
  NPTS                INT                           ; Number of time samples
  NCOMP               INT                           ; Number of components  
  TIME                DOUBLE    Array(npts)         ; timetags              
  COMP1               DOUBLE    Array(npts)         ;
  COMP2               DOUBLE    Array(npts)         ; 
  COMP3               DOUBLE    Array(npts)         ;
      
 |ALL |NPTS |START| EN  |PANF |PANB |selection                  |use time1|use time2|
 |----|-----|-----|-----|-----|-----|---------------------------|---------|---------|
 | NZ |  0  |  0  |  0  |  0  |  0  | start -> end              |  X      |  X      |
 | 0  |  0  |  0  |  0  |  0  |  0  | time1 -> time2            |  X      |  X      |
 | 0  |  0  |  NZ |  0  |  0  |  0  | start -> time1 secs       |  X      |         |
 | 0  |  0  |  0  |  NZ |  0  |  0  | end-time1 secs -> end     |  X      |         |
 | 0  |  0  |  0  |  0  |  NZ |  0  | pan fwd from time1->time2 |  X      |  X      |
 | 0  |  0  |  0  |  0  |  0  |  NZ | pan back from time1->time2|  X      |  X      |
 | 0  |  NZ |  0  |  0  |  0  |  0  | time1 -> time1+npts       |  X      |         |
 | 0  |  NZ |  NZ |  0  |  0  |  0  | start -> start+npts       |         |         |
 | 0  |  NZ |  0  |  NZ |  0  |  0  | end-npts -> end           |         |         |

	Any other combination of keywords is not allowed.


 CALLING SEQUENCE: mag  = get_fa_bdc(time1, time2, [NPTS=npts],
                             [START=st | EN=en | PANF=panf | PANB =
                             panb | ALL = all])



 RETURN VALUE:

	Upon success, the above structure is returned, with the valid tag
	set to a number between 1 and 7. The number is determined by
	interpreting the valid tags from each of the three long booms
	as binary digits; mag1.valid is weighted 1, mag2.valid 2,
	mag3.valid 4. Upon failure, the valid tag will be 0.

 REVISION HISTORY:

	@(#)get_fa_bdc.pro	1.17 18 Jul 1996
 	Originally written by	 Bill Peria,  University of 
 	California at Berkeley, Space Sciences Lab.   July 22, 1996

(See /disks/fast/software/integration/src/esa/get_fa_bdc.pro)


GET_FA_EDC_LONG

[Previous Routine] [Next Routine] [List of Routines]
 NAME: get_fa_edc_long

 DESCRIPTION: returns, as best it can, a structure containing DC
 electric field survey data from the FAST booms (1-4, 5-8, 9-10). It
 must be the case that SDT is running, with V1-4, 5-8, and 9-10
 plotted on screen already. In the case where, for example, sphere 9
 is in voltage mode, then an array containing IEEE NaN, plus a
 leading zero, will be returned in place of V9-10. 

    The returned structure looks like this:


  DATA_NAME           STRING    ' E1-4 E5-8 E9-10'  ; which 'E' quantities
  VALID               INT       1                   ; Data valid flag
  PROJECT_NAME        STRING    'FAST'              ; project name
  UNITS_NAME          STRING    'mV/m'              ; Units of this data    
  UNITS_PROCEDURE     STRING    'fa_fields_units'   ; Units conversion proc 
  START_TIME          DOUBLE                        ; Start Time of sample  
  END_TIME            DOUBLE                        ; End time of sample    
  NPTS                INT                           ; Number of time samples
  NCOMP               INT                           ; Number of components  
  TIME                DOUBLE    Array(npts)         ; timetags              
  E14                 DOUBLE    Array(npts)         ;
  E58                 DOUBLE    Array(npts)         ; 
  E910                DOUBLE    Array(npts)         ;
      
 |ALL |NPTS |START| EN  |PANF |PANB |selection                  |use time1|use time2|
 |----|-----|-----|-----|-----|-----|---------------------------|---------|---------|
 | NZ |  0  |  0  |  0  |  0  |  0  | start -> end              |  X      |  X      |
 | 0  |  0  |  0  |  0  |  0  |  0  | time1 -> time2            |  X      |  X      |
 | 0  |  0  |  NZ |  0  |  0  |  0  | start -> time1 secs       |  X      |         |
 | 0  |  0  |  0  |  NZ |  0  |  0  | end-time1 secs -> end     |  X      |         |
 | 0  |  0  |  0  |  0  |  NZ |  0  | pan fwd from time1->time2 |  X      |  X      |
 | 0  |  0  |  0  |  0  |  0  |  NZ | pan back from time1->time2|  X      |  X      |
 | 0  |  NZ |  0  |  0  |  0  |  0  | time1 -> time1+npts       |  X      |         |
 | 0  |  NZ |  NZ |  0  |  0  |  0  | start -> start+npts       |         |         |
 | 0  |  NZ |  0  |  NZ |  0  |  0  | end-npts -> end           |         |         |

	Any other combination of keywords is not allowed.


 CALLING SEQUENCE: e_long = get_fa_edc_long(time1, time2, [NPTS=npts],
                             [START=st | EN=en | PANF=panf | PANB =
                             panb | ALL = all])



 CURRENT PROBLEMS: It's not clear what to do if the time bases for
 the different data quantities are not the same. Right now, the times
 returned are those of the first available DQD, in order [V1-V4,
 V5-V8, V9-V10].  Yikes! Also, no indication of mode is returned...

 RETURN VALUE:

	Upon success, the above structure is returned, with the valid tag
	set to a number between 1 and 7. The number is determined by
	interpreting the valid tags from each of the three long booms
	as binary digits; v14.valid is weighted 1, v58.valid 2,
	v910.valid 4. Upon failure, the valid tag will be 0.

 REVISION HISTORY:

	@(#)get_fa_edc_long.pro	1.18 07/23/96
 	Originally written by	 Bill Peria,  University of 
 	California at Berkeley, Space Sciences Lab.   June '96

(See /disks/fast/software/integration/src/esa/get_fa_edc_long.pro)


GET_FA_EEB

[Previous Routine] [Next Routine] [List of Routines]
 FUNCTION:
 	 GET_FA_EEB

 DESCRIPTION:

	function to load FAST E-esa burst data from the SDT program shared
	memory buffers.

	A structure of the following format is returned:

	   DATA_NAME     STRING    'Eesa Burst'        ; Data Quantity name
	   VALID         INT       1                   ; Data valid flag
 	   PROJECT_NAME  STRING    'FAST'              ; project name
 	   UNITS_NAME    STRING    'Counts'            ; Units of this data
 	   UNITS_PROCEDURE  STRING 'proc'              ; Units conversion proc
	   TIME          DOUBLE    8.0118726e+08       ; Start Time of sample
	   END_TIME      DOUBLE    7.9850884e+08       ; End time of sample
	   INTEG_T       DOUBLE    3.0000000           ; Integration time
	   NBINS         INT       nbins               ; Number of angle bins
	   NENERGY       INT       nnrgs               ; Number of energy bins
	   DATA          FLOAT     Array(nnrgs, nbins) ; Data qauantities
	   ENERGY        FLOAT     Array(nnrgs, nbins) ; Energy steps
	   THETA         FLOAT     Array(nnrgs, nbins) ; Angle for bins
	   GEOM          FLOAT     Array(nbins)        ; Geometry factor
	   DENERGY       FLOAT     Array(nnrgs, nbins) ; Energies for bins
	   DTHETA        FLOAT     Array(nbins)        ; Delta Theta
	   EFF           FLOAT     Array(nnrgs)        ; Efficiency (GF)
	   MASS          DOUBLE    5.68566e-6          ; Particle Mass
	   GEOMFACTOR    DOUBLE    0.000147            ; Bin GF
	   HEADER_BYTES  BYTE      Array(25)	       ; Header bytes
	   INDEX         LONG      idx		       ; Index into sdt data
	
 CALLING SEQUENCE:

 	data = get_fa_eeb (time, [START=start | EN=en | ADVANCE=advance |
				RETREAT=retreat])

 ARGUMENTS:

	time 			This argument gives a time handle from which
				to take data from.  It may be either a string
				with the following possible formats:
					'YY-MM-DD/HH:MM:SS.MSC'  or
					'HH:MM:SS'     (use reference date)
				or a number, which will represent seconds
				since 1970 (must be a double > 94608000.D), or
				a hours from a reference time, if set.

				time will always be returned as a double
				representing the actual data time found in
				seconds since 1970.

 KEYWORDS:

	START			If non-zero, get data from the start time
				of the data instance in the SDT buffers

	EN			If non-zero, get data at the end time
				of the data instance in the SDT buffers

	ADVANCE			If non-zero, advance to the next data point
				following the time input

	RETREAT			If non-zero, retreat (reverse) to the previous
				data point before the time input

	CALIB			If non-zero, caclulate geometry
				factors for each bin instead of using 1.'s

       INDEX                   Index into sdt data

 RETURN VALUE:

	Upon success, the above structure is returned, with the valid tag
	set to 1.  Upon failure, the valid tag will be 0.

 REVISION HISTORY:

	@(#)get_fa_eeb.pro	1.20 07/23/97
 	Originally written by Jonathan M. Loran,  University of 
 	California at Berkeley, Space Sciences Lab.   June '95

(See /disks/fast/software/integration/src/esa/get_fa_eeb.pro)


GET_FA_EEB_C

[Previous Routine] [Next Routine] [List of Routines]
 FUNCTION:
 	 GET_FA_EEB_C

 DESCRIPTION:


	function to load FAST E-esa burst data from the SDT program shared
	memory buffers.  This is the caching version

	A structure of the following format is returned:

	   DATA_NAME     STRING    'Eesa Burst'       ; Data Quantity name
	   VALID         INT       1                   ; Data valid flag
 	   PROJECT_NAME  STRING    'FAST'              ; project name
 	   UNITS_NAME    STRING    'Counts'            ; Units of this data
 	   UNITS_PROCEDURE  STRING 'proc'              ; Units conversion proc
	   TIME          DOUBLE    8.0118726e+08       ; Start Time of sample
	   END_TIME      DOUBLE    7.9850884e+08       ; End time of sample
	   INTEG_T       DOUBLE    3.0000000           ; Integration time
	   NBINS         INT       nbins               ; Number of angle bins
	   NENERGY       INT       nnrgs               ; Number of energy bins
	   DATA          FLOAT     Array(nnrgs, nbins) ; Data qauantities
	   ENERGY        FLOAT     Array(nnrgs, nbins) ; Energy steps
	   THETA         FLOAT     Array(nnrgs, nbins) ; Angle for bins
	   GEOM          FLOAT     Array(nnrgs, nbins) ; Geometry factor
	   DENERGY       FLOAT     Array(nnrgs, nbins) ; Energies for bins
	   DTHETA        FLOAT     Array(nnrgs, nbins) ; Delta Theta
	   EFF           FLOAT     Array(nnrgs)        ; Efficiency (GF)
	   MASS          DOUBLE    5.68566e-6          ; Particle Mass
	   GEOMFACTOR    DOUBLE    0.000147            ; Bin GF
	   HEADER_BYTES  BYTE      Array(44)	       ; Header bytes
	   INDEX         LONG      idx                 ; Index in sdt buffers
	
 CALLING SEQUENCE:

 	data = get_fa_eeb (time, [START=start | EN=en | ADVANCE=advance |
				RETREAT=retreat], CALIB=calib,
				INDEX=idx, FLUSH=flush, CACHE_SIZE=cache_size)

 ARGUMENTS:

	time 			This argument gives a time handle from which
				to take data from.  It may be either a string
				with the following possible formats:
					'YY-MM-DD/HH:MM:SS.MSC'  or
					'HH:MM:SS'     (use reference date)
				or a number, which will represent seconds
				since 1970 (must be a double > 94608000.D), or
				a hours from a reference time, if set.

				time will always be returned as a double
				representing the actual data time found in
				seconds since 1970.

 KEYWORDS:

	START			If non-zero, get data from the start time
				of the data instance in the SDT buffers

	EN			If non-zero, get data at the end time
				of the data instance in the SDT buffers

	ADVANCE			If non-zero, advance to the next data point
				following the time or index input

	RETREAT			If non-zero, retreat (reverse) to the previous
				data point before the time or index input

	CALIB			If non-zero, caclulate geometry
				factors for each bin instead of using 1.'s

	INDEX			If index is set, it is used for selecting
				the index to get data.

	FLUSH			If non-zero, will flush the data cache
				This is useful to force a re-read of sdt
				buffers in case the data has changed.

	CACHE_SIZE		If gt 0, will reset the length in points
				of data to cache.

 RETURN VALUE:

	Upon success, the above structure is returned, with the valid tag
	set to 1.  Upon failure, the valid tag will be 0.

 REVISION HISTORY:

	@(#)get_fa_eeb_c.pro	1.1 05/30/97
 	Originally written by Jonathan M. Loran,  University of 
 	California at Berkeley, Space Sciences Lab.   June '95

	Major upgrade, using get_cache_md_from_sdt to load a time range
	at once to cache data in idl for speedup.   J.M. Loran Apr. 97

(See /disks/fast/software/integration/src/esa/get_fa_eeb_c.pro)


GET_FA_EEB_HDR

[Previous Routine] [Next Routine] [List of Routines]
 FUNCTION:
 	 GET_FA_EEB_HDR

 DESCRIPTION:

	function to load FAST E-esa burst header data from the SDT program
 	shared memory buffers.

	At structure of the following format is returned:

	   DATA_NAME     STRING 'Eesa_Burst_Packet_Hdr'; Data Quantity name
	   VALID         INT       1                   ; Data valid flag
 	   PROJECT_NAME  STRING    'FAST'              ; Project name
 	   UNITS_NAME    STRING    'Raw'               ; Units of this data
 	   VALUES_PROCEDURE  STRING 'eiesa_unpack_hdr' ; Name of proc to
                                                      ; get values from hdr
	   TIME          DOUBLE    8.0118726e+08       ; Start Time of sample
	   BYTES         BYTE      Array(44)	       ; Header bytes
	   INDEX         LONG	   idx		       ; index into data
	   
	
 CALLING SEQUENCE:

 	data = get_fa_eeb_hdr (time)

 ARGUMENTS:

	time 			This argument gives a time handle from which
				to take data from.  It may be either a string
				with the following possible formats:
					'YY-MM-DD/HH:MM:SS.MSC'  or
					'HH:MM:SS'     (use reference date)
				or a number, which will represent seconds
				since 1970 (must be a double > 94608000.D), or
				a hours from a reference time, if set.

				time will always be returned as a double
				representing the actual data time found in
				seconds since 1970.

 KEYWORDS:
	INDEX:			get data at this index.

 RETURN VALUE:

	Upon success, the above structure is returned, with the valid tag
	set to 1.  Upon failure, the valid tag will be 0.

 REVISION HISTORY:

	@(#)get_fa_eeb_hdr.pro	1.9 07/23/97
 	Originally written by Jonathan M. Loran,  University of 
 	California at Berkeley, Space Sciences Lab.   June '95

(See /disks/fast/software/integration/src/esa/get_fa_eeb_hdr.pro)


GET_FA_EEB_TS

[Previous Routine] [Next Routine] [List of Routines]
 FUNCTION:
 	 GET_FA_EEB_TS

 DESCRIPTION:


	function to load FAST E-esa Burst data from the SDT program shared
	memory buffers.  This is the time series version.  

	An array of npts structures of the following format are returned:

	   DATA_NAME     STRING    'Eesa Burst'       ; Data Quantity name
	   VALID         INT       1                   ; Data valid flag
 	   PROJECT_NAME  STRING    'FAST'              ; project name
 	   UNITS_NAME    STRING    'Counts'            ; Units of this data
 	   UNITS_PROCEDURE  STRING 'proc'              ; Units conversion proc
	   TIME          DOUBLE    8.0118726e+08       ; Start Time of sample
	   END_TIME      DOUBLE    7.9850884e+08       ; End time of sample
	   INTEG_T       DOUBLE    3.0000000           ; Integration time
	   NBINS         INT       nbins               ; Number of angle bins
	   NENERGY       INT       nnrgs               ; Number of energy bins
	   DATA          FLOAT     Array(nnrgs, nbins) ; Data qauantities
	   ENERGY        FLOAT     Array(nnrgs, nbins) ; Energy steps
	   THETA         FLOAT     Array(nnrgs, nbins) ; Angle for bins
	   GEOM          FLOAT     Array(nbins)        ; Geometry factor
	   DENERGY       FLOAT     Array(nnrgs, nbins) ; Energies for bins
	   DTHETA        FLOAT     Array(nbins)        ; Delta Theta
	   EFF           FLOAT     Array(nnrgs)        ; Efficiency (GF)
	   MASS          DOUBLE    5.68566e-6          ; Particle Mass
	   GEOMFACTOR    DOUBLE    0.000147            ; Bin GF
	   HEADER_BYTES  BYTE      Array(25)	       ; Header bytes
	   INDEX         LONG      index               ; Data index, this pt. 
	   ST_INDEX      LONG      st_idx              ; start index of arr
	   EN_INDEX      LONG      en_idx              ; end index of arr
	   NPTS          LONG      npts                ; array size
	
 CALLING SEQUENCE:
	data = get_fa_eeb_ts (t1, t2, [NPTS=npts], [START=st | EN=en | 
				PANF=panf | PANB=panb | IDXST=startidx], 
				CALIB=calib)
 ARGUMENTS:

	t1 			This argument gives the start time from
				which to take data, or, if START or EN keywords
				are non-zero, the length of time to take data.
				It may be either a string with the following
				possible formats:
					'YY-MM-DD/HH:MM:SS.MSC'  or
					'HH:MM:SS'     (use reference date)
				or a number, which will represent seconds
				since 1970 (must be a double > 94608000.D), or
				a hours from a reference time, if set.

				Time will always be returned as a double
				representing the actual data start time found 
				in seconds since 1970.

	t2			The same as time1, except it represents the
				end time.

				If the NPTS, START, EN, PANF or PANB keywords 
				are non-zero, THEN time2 will be ignored as an
				input paramter.

 KEYWORDS:

	CALIB			If non-zero, caclulate geometry
				factors for each bin instead of using 1.'s

	Data time selection is determined from the keywords as given in the 
	following truth table (NZ == non-zero):

 |ALL |NPTS |START| EN  |IDXST|PANF |PANB |selection            |use time1|use time2|
 |----|-----|-----|-----|-----|-----|-----|---------------------|---------|---------|
 | NZ |  0  |  0  |  0  |  0  |  0  |  0  | start -> end        |  X      |  X      |
 | 0  |  0  |  0  |  0  |  0  |  0  |  0  | time1 -> time2      |  X      |  X      |
 | 0  |  0  |  NZ |  0  |  0  |  0  |  0  | start -> time1 secs |  X      |         |
 | 0  |  0  |  0  |  NZ |  0  |  0  |  0  | end-time1 secs ->end|  X      |         |
 | 0  |  0  |  0  |  0  |  0  |  NZ |  0  | pan fwd from        |  X      |  X      |
 |    |     |     |     |     |     |     |   time1->time2      |         |         |
 | 0  |  0  |  0  |  0  |  0  |  0  |  NZ | pan back from       |  X      |  X      |
 |    |     |     |     |     |     |     |   time1->time2      |         |         |
 | 0  |  NZ |  0  |  0  |  0  |  0  |  0  | time1 -> time1+npts |  X      |         |
 | 0  |  NZ |  NZ |  0  |  0  |  0  |  0  | start -> start+npts |         |         |
 | 0  |  NZ |  0  |  NZ |  0  |  0  |  0  | end-npts -> end     |         |         |
 | 0  |  NZ |  0  |  0  |  NZ |  0  |  0  | st-index ->         |         |         |
 |    |     |     |     |     |     |     |   st_index + npts   |         |         |
	Any other combination of keywords is not allowed.

 RETURN VALUE:

	Upon success, the above structure is returned, with the valid tag
	set to 1.  Upon failure, the valid tag will be 0.

 REVISION HISTORY:

	@(#)get_fa_eeb_ts.pro	1.3 05/23/97
 	Originally written by Jonathan M. Loran,  University of 
 	California at Berkeley, Space Sciences Lab.   Apr '97

(See /disks/fast/software/integration/src/esa/get_fa_eeb_ts.pro)


GET_FA_EES

[Previous Routine] [Next Routine] [List of Routines]
 FUNCTION:
 	 GET_FA_EES

 DESCRIPTION:


	function to load FAST E-esa survey data from the SDT program shared
	memory buffers.

	A structure of the following format is returned:

	   DATA_NAME     STRING    'Eesa Survey'       ; Data Quantity name
	   VALID         INT       1                   ; Data valid flag
 	   PROJECT_NAME  STRING    'FAST'              ; project name
 	   UNITS_NAME    STRING    'Counts'            ; Units of this data
 	   UNITS_PROCEDURE  STRING 'proc'              ; Units conversion proc
	   TIME          DOUBLE    8.0118726e+08       ; Start Time of sample
	   END_TIME      DOUBLE    7.9850884e+08       ; End time of sample
	   INTEG_T       DOUBLE    3.0000000           ; Integration time
	   NBINS         INT       nbins               ; Number of angle bins
	   NENERGY       INT       nnrgs               ; Number of energy bins
	   DATA          FLOAT     Array(nnrgs, nbins) ; Data qauantities
	   ENERGY        FLOAT     Array(nnrgs, nbins) ; Energy steps
	   THETA         FLOAT     Array(nnrgs, nbins) ; Angle for bins
	   GEOM          FLOAT     Array(nbins)        ; Geometry factor
	   DENERGY       FLOAT     Array(nnrgs, nbins) ; Energies for bins
	   DTHETA        FLOAT     Array(nbins)        ; Delta Theta
	   EFF           FLOAT     Array(nnrgs)        ; Efficiency (GF)
	   MASS          DOUBLE    5.68566e-6          ; Particle Mass
	   GEOMFACTOR    DOUBLE    0.000147            ; Bin GF
	   HEADER_BYTES  BYTE      Array(25)	       ; Header bytes
	   INDEX         LONG      idx		       ; Index into sdt data
	
 CALLING SEQUENCE:

 	data = get_fa_ees (time, [START=start | EN=en | ADVANCE=advance |
				RETREAT=retreat])

 ARGUMENTS:

	time 			This argument gives a time handle from which
				to take data from.  It may be either a string
				with the following possible formats:
					'YY-MM-DD/HH:MM:SS.MSC'  or
					'HH:MM:SS'     (use reference date)
				or a number, which will represent seconds
				since 1970 (must be a double > 94608000.D), or
				a hours from a reference time, if set.

				time will always be returned as a double
				representing the actual data time found in
				seconds since 1970.

 KEYWORDS:

	START			If non-zero, get data from the start time
				of the data instance in the SDT buffers

	EN			If non-zero, get data at the end time
				of the data instance in the SDT buffers

	ADVANCE			If non-zero, advance to the next data point
				following the time input

	RETREAT			If non-zero, retreat (reverse) to the previous
				data point before the time input

	CALIB			If non-zero, caclulate geometry
				factors for each bin instead of using 1.'s

       INDEX                   Index into sdt data

 RETURN VALUE:

	Upon success, the above structure is returned, with the valid tag
	set to 1.  Upon failure, the valid tag will be 0.

 REVISION HISTORY:

	@(#)get_fa_ees.pro	1.27 10/08/99
 	Originally written by Jonathan M. Loran,  University of 
 	California at Berkeley, Space Sciences Lab.   June '95

(See /disks/fast/software/integration/src/esa/get_fa_ees.pro)


GET_FA_EES_C

[Previous Routine] [Next Routine] [List of Routines]
 FUNCTION:
 	 GET_FA_EES_C

 DESCRIPTION:


	function to load FAST E-esa survey data from the SDT program shared
	memory buffers.  This is the caching version

	A structure of the following format is returned:

	   DATA_NAME     STRING    'Eesa Survey'       ; Data Quantity name
	   VALID         INT       1                   ; Data valid flag
 	   PROJECT_NAME  STRING    'FAST'              ; project name
 	   UNITS_NAME    STRING    'Counts'            ; Units of this data
 	   UNITS_PROCEDURE  STRING 'proc'              ; Units conversion proc
	   TIME          DOUBLE    8.0118726e+08       ; Start Time of sample
	   END_TIME      DOUBLE    7.9850884e+08       ; End time of sample
	   INTEG_T       DOUBLE    3.0000000           ; Integration time
	   NBINS         INT       nbins               ; Number of angle bins
	   NENERGY       INT       nnrgs               ; Number of energy bins
	   DATA          FLOAT     Array(nnrgs, nbins) ; Data qauantities
	   ENERGY        FLOAT     Array(nnrgs, nbins) ; Energy steps
	   THETA         FLOAT     Array(nnrgs, nbins) ; Angle for bins
	   GEOM          FLOAT     Array(nnrgs, nbins) ; Geometry factor
	   DENERGY       FLOAT     Array(nnrgs, nbins) ; Energies for bins
	   DTHETA        FLOAT     Array(nnrgs, nbins) ; Delta Theta
	   EFF           FLOAT     Array(nnrgs)        ; Efficiency (GF)
	   MASS          DOUBLE    5.68566e-6          ; Particle Mass
	   GEOMFACTOR    DOUBLE    0.000147            ; Bin GF
	   HEADER_BYTES  BYTE      Array(44)	       ; Header bytes
	   INDEX         LONG      idx                 ; Index in sdt buffers
	
 CALLING SEQUENCE:

 	data = get_fa_ees (time, [START=start | EN=en | ADVANCE=advance |
				RETREAT=retreat], CALIB=calib,
				INDEX=idx, FLUSH=flush, CACHE_SIZE=cache_size)

 ARGUMENTS:

	time 			This argument gives a time handle from which
				to take data from.  It may be either a string
				with the following possible formats:
					'YY-MM-DD/HH:MM:SS.MSC'  or
					'HH:MM:SS'     (use reference date)
				or a number, which will represent seconds
				since 1970 (must be a double > 94608000.D), or
				a hours from a reference time, if set.

				time will always be returned as a double
				representing the actual data time found in
				seconds since 1970.

 KEYWORDS:

	START			If non-zero, get data from the start time
				of the data instance in the SDT buffers

	EN			If non-zero, get data at the end time
				of the data instance in the SDT buffers

	ADVANCE			If non-zero, advance to the next data point
				following the time or index input

	RETREAT			If non-zero, retreat (reverse) to the previous
				data point before the time or index input

	CALIB			If non-zero, caclulate geometry
				factors for each bin instead of using 1.'s

	INDEX			If index is set, it is used for selecting
				the index to get data.

	FLUSH			If non-zero, will flush the data cache
				This is useful to force a re-read of sdt
				buffers in case the data has changed.

	CACHE_SIZE		If gt 0, will reset the length in points
				of data to cache.

 RETURN VALUE:

	Upon success, the above structure is returned, with the valid tag
	set to 1.  Upon failure, the valid tag will be 0.

 REVISION HISTORY:

	@(#)get_fa_ees_c.pro	1.2 10/08/99
 	Originally written by Jonathan M. Loran,  University of 
 	California at Berkeley, Space Sciences Lab.   June '95

	Major upgrade, using get_cache_md_from_sdt to load a time range
	at once to cache data in idl for speedup.   J.M. Loran Apr. 97

(See /disks/fast/software/integration/src/esa/get_fa_ees_c.pro)


GET_FA_EES_HDR

[Previous Routine] [Next Routine] [List of Routines]
 FUNCTION:
 	 GET_FA_EES_HDR

 DESCRIPTION:

	function to load FAST E-esa survey header data from the SDT program
 	shared memory buffers.

	At structure of the following format is returned:

	   DATA_NAME     STRING 'Eesa_Survey_Packet_Hdr'; Data Quantity name
	   VALID         INT       1                   ; Data valid flag
 	   PROJECT_NAME  STRING    'FAST'              ; Project name
 	   UNITS_NAME    STRING    'Raw'               ; Units of this data
 	   VALUES_PROCEDURE  STRING 'eiesa_unpack_hdr' ; Name of proc to
                                                      ; get values from hdr
	   TIME          DOUBLE    8.0118726e+08       ; Start Time of sample
	   BYTES         BYTE      Array(44)	       ; Header bytes
	   INDEX         LONG	   idx		       ; index into data
	   
	
 CALLING SEQUENCE:

 	data = get_fa_ees_hdr (time)

 ARGUMENTS:

	time 			This argument gives a time handle from which
				to take data from.  It may be either a string
				with the following possible formats:
					'YY-MM-DD/HH:MM:SS.MSC'  or
					'HH:MM:SS'     (use reference date)
				or a number, which will represent seconds
				since 1970 (must be a double > 94608000.D), or
				a hours from a reference time, if set.

				time will always be returned as a double
				representing the actual data time found in
				seconds since 1970.

 KEYWORDS:
	INDEX:			get data at this index.

 RETURN VALUE:

	Upon success, the above structure is returned, with the valid tag
	set to 1.  Upon failure, the valid tag will be 0.

 REVISION HISTORY:

	@(#)get_fa_ees_hdr.pro	1.9 07/23/97
 	Originally written by Jonathan M. Loran,  University of 
 	California at Berkeley, Space Sciences Lab.   June '95

(See /disks/fast/software/integration/src/esa/get_fa_ees_hdr.pro)


GET_FA_EES_TS

[Previous Routine] [Next Routine] [List of Routines]
 FUNCTION:
 	 GET_FA_EES_TS

 DESCRIPTION:


	function to load FAST E-esa survey data from the SDT program shared
	memory buffers.  This is the time series version.  

	An array of npts structures of the following format are returned:

	   DATA_NAME     STRING    'Eesa Survey'       ; Data Quantity name
	   VALID         INT       1                   ; Data valid flag
 	   PROJECT_NAME  STRING    'FAST'              ; project name
 	   UNITS_NAME    STRING    'Counts'            ; Units of this data
 	   UNITS_PROCEDURE  STRING 'proc'              ; Units conversion proc
	   TIME          DOUBLE    8.0118726e+08       ; Start Time of sample
	   END_TIME      DOUBLE    7.9850884e+08       ; End time of sample
	   INTEG_T       DOUBLE    3.0000000           ; Integration time
	   NBINS         INT       nbins               ; Number of angle bins
	   NENERGY       INT       nnrgs               ; Number of energy bins
	   DATA          FLOAT     Array(nnrgs, nbins) ; Data qauantities
	   ENERGY        FLOAT     Array(nnrgs, nbins) ; Energy steps
	   THETA         FLOAT     Array(nnrgs, nbins) ; Angle for bins
	   GEOM          FLOAT     Array(nbins)        ; Geometry factor
	   DENERGY       FLOAT     Array(nnrgs, nbins) ; Energies for bins
	   DTHETA        FLOAT     Array(nbins)        ; Delta Theta
	   EFF           FLOAT     Array(nnrgs)        ; Efficiency (GF)
	   MASS          DOUBLE    5.68566e-6          ; Particle Mass
	   GEOMFACTOR    DOUBLE    0.000147            ; Bin GF
	   HEADER_BYTES  BYTE      Array(25)	       ; Header bytes
	   INDEX         LONG      index               ; Data index, this pt. 
	   ST_INDEX      LONG      st_idx              ; start index of arr
	   EN_INDEX      LONG      en_idx              ; end index of arr
	   NPTS          LONG      npts                ; array size
	
 CALLING SEQUENCE:
	data = get_fa_ees_ts (t1, t2, [NPTS=npts], [START=st | EN=en | 
				PANF=panf | PANB=panb | IDXST=startidx], 
				CALIB=calib)
 ARGUMENTS:

	t1 			This argument gives the start time from
				which to take data, or, if START or EN keywords
				are non-zero, the length of time to take data.
				It may be either a string with the following
				possible formats:
					'YY-MM-DD/HH:MM:SS.MSC'  or
					'HH:MM:SS'     (use reference date)
				or a number, which will represent seconds
				since 1970 (must be a double > 94608000.D), or
				a hours from a reference time, if set.

				Time will always be returned as a double
				representing the actual data start time found 
				in seconds since 1970.

	t2			The same as time1, except it represents the
				end time.

				If the NPTS, START, EN, PANF or PANB keywords 
				are non-zero, THEN time2 will be ignored as an
				input paramter.

 KEYWORDS:

	CALIB			If non-zero, caclulate geometry
				factors for each bin instead of using 1.'s

	Data time selection is determined from the keywords as given in the 
	following truth table (NZ == non-zero):

 |ALL |NPTS |START| EN  |IDXST|PANF |PANB |selection            |use time1|use time2|
 |----|-----|-----|-----|-----|-----|-----|---------------------|---------|---------|
 | NZ |  0  |  0  |  0  |  0  |  0  |  0  | start -> end        |  X      |  X      |
 | 0  |  0  |  0  |  0  |  0  |  0  |  0  | time1 -> time2      |  X      |  X      |
 | 0  |  0  |  NZ |  0  |  0  |  0  |  0  | start -> time1 secs |  X      |         |
 | 0  |  0  |  0  |  NZ |  0  |  0  |  0  | end-time1 secs ->end|  X      |         |
 | 0  |  0  |  0  |  0  |  0  |  NZ |  0  | pan fwd from        |  X      |  X      |
 |    |     |     |     |     |     |     |   time1->time2      |         |         |
 | 0  |  0  |  0  |  0  |  0  |  0  |  NZ | pan back from       |  X      |  X      |
 |    |     |     |     |     |     |     |   time1->time2      |         |         |
 | 0  |  NZ |  0  |  0  |  0  |  0  |  0  | time1 -> time1+npts |  X      |         |
 | 0  |  NZ |  NZ |  0  |  0  |  0  |  0  | start -> start+npts |         |         |
 | 0  |  NZ |  0  |  NZ |  0  |  0  |  0  | end-npts -> end     |         |         |
 | 0  |  NZ |  0  |  0  |  NZ |  0  |  0  | st-index ->         |         |         |
 |    |     |     |     |     |     |     |   st_index + npts   |         |         |
	Any other combination of keywords is not allowed.

 RETURN VALUE:

	Upon success, the above structure is returned, with the valid tag
	set to 1.  Upon failure, the valid tag will be 0.

 REVISION HISTORY:

	@(#)get_fa_ees_ts.pro	1.2 05/23/97
 	Originally written by Jonathan M. Loran,  University of 
 	California at Berkeley, Space Sciences Lab.   Apr '97

(See /disks/fast/software/integration/src/esa/get_fa_ees_ts.pro)


GET_FA_FIELDS

[Previous Routine] [Next Routine] [List of Routines]
 NAME: GET_FA_FIELDS 

 PURPOSE: to get data from the FAST fields instrument

 CALLING SEQUENCE: mydata = get_fa_fields(dqd,[ time1, time2,
                   NPTS=npts, START=st, EN=en, PANF=pf, PANB=pb,
                   ALL = all, CALIBRATE = calibrate, STORE = store])

 INPUTS: 
        DQD: a string containing a valid Data Quantity Descriptor to
             pass on to SDT. If SDT doesn't recognize the DQD, an
             error message is sent to the screen, and an invalid
             status is returned to IDL. Use the routine HELPFAST to
             access a list of valid DQD's through Netscape.

 NOTE: If GET_FA_FIELDS is called with nothing but a DQD, then the
       keywords ALL, CALIBRATE, and REPAIR will be automatically
       set. Furthermore, if GET_FA_FIELDS is called with no
       *time-selection* keywords or time limits, then the ALL keyword
       will be set.

 OUTPUTS: A structure of the following format is returned to the
          caller, *UNLESS* the keyword STORE is set, in which case
          the data are stored tplot-style, and the TPLOT string
          handle is returned to the caller. The STREAK_* tags are
          arrays of indices into the COMP* tags. If the REPAIRED tag
          contains a 1 on return, then the STREAK_* tags mark the
          starts, lengths, and ends of streaks of contiguous,
          evenly-sampled data. 

 DATA_NAME              STRING                     'V1-V4_S'
 VALID                  INTEGER                           1
 PROJECT_NAME           STRING                        'FAST'
 UNITS_NAME             STRING                        'mV/m'
 CALIBRATED             LONG                              1
 UNITS_PROCEDURE        STRING           'fast_fields_units'
 START_TIME             DOUBLE                8.5194794e+08
 END_TIME               DOUBLE                8.5195604e+08
 NPTS                   LONG                           5000
 NCOMP                  LONG                              1
 DEPTH                  LONARR(NCOMP)                     1
 TIME                   DBLARR(NPTS)   START_TIME->END_TIME
 COMP*                  FLTARR(NPTS,DEPTHS(*))     SCIENCE!
 STREAK_STARTS          LONARR(??)
 STREAK_LENGTHS         LONARR(??)
 STREAK_ENDS            LONARR(??)
 REPAIRED               LONG                              1
                         
 OPTIONAL INPUTS:

       time1 : This argument gives the start time from which to take
               data, or, if START or EN keywords are non-zero, the
               length of time to take data.  It may be either a
               string with the following possible formats:
               'YY-MM-DD/HH:MM:SS.MSC' or 'HH:MM:SS' (use reference
               date) or a number, which will represent seconds since
               1970 (must be a double > 94608000.D), or hours from a
               reference time, if set. 

       time2 : The same as time1, except it represents the end
               time. If the NPTS, START, EN, PANF or PANB keywords
               are non-zero, then time2 will be ignored as an input
               parameter.
       
 KEYWORD PARAMETERS:

       CALIBRATE: If set, causes calibrated data to be returned, if
                  possible. Otherwise, raw data are returned,
                  *unless* the environment variable FAST_CALIBRATE is
                  set to 1, i.e. setenv FAST_CALIBRATE 1 .  Setting
                  the CALIBRATE keyword causes the procedure name in
                  DAT.UNITS_PROCEDURE to be called.

       DEFAULT: If set, causes CALIBRATE, ALL, and REPAIR to be set. 

       MIN_BUF_LENGTH: If defined, sets the minimum number of
                       time-contiguous points in a "good streak" or
                       "buffer" of data. Default is 10.

       REPAIR: If set, causes a time column patcher to be
               called. Otherwise, you get what SDT is giving. 

       SPIN: If defined, causes the data to be returned at once per
             spin resolution, at a phase equal to the value of SPIN
             in degrees. 

       STORE: If set, the tplot routine STORE_DATA is called, and a
              rudimentary tplot quantity is stored, to be accessed
              through GET_DATA. In this case, GET_FA_FIELDS returns
              the TPLOT string handle to the caller. 

       STRUCTURE: A named variable in which the data structure
                  described above can be returned, if desired (for
                  example, if STORE is set). 

       YBINS: If nonzero, two dimensional fields quantities are
              returned with this many frequency bins. 

       BACKGROUND: If set, causes a background to be removed from 2D
              fields quantities. The background is that returned
              from the function NOISE. Note that this all makes sense
              only for 2D, CALIBRATE'd quantities. 
  
       Other keywords determine data time selection as given in the 
       following truth table (NZ == non-zero):

|ALL|NPTS|START|EN|PANF|PANB|selection             |use time1|use time2|
|---|----|-----|--|----|----|----------------------|---------|---------|
| NZ|  0 |  0  | 0|  0 |  0 |start -> end          |  X      |  X      |
| 0 |  0 |  0  | 0|  0 |  0 |time1 -> time2        |  X      |  X      |
| 0 |  0 |  NZ | 0|  0 |  0 |start -> time1 secs   |  X      |         |
| 0 |  0 |  0  |NZ|  0 |  0 |end-time1 secs -> end |  X      |         |
| 0 |  0 |  0  | 0|  NZ|  0 |pan fwd, time1->time2 |  X      |  X      |
| 0 |  0 |  0  | 0|  0 |  NZ|pan back,time1->time2 |  X      |  X      |
| 0 |  NZ|  0  | 0|  0 |  0 |time1 -> time1+npts   |  X      |         |
| 0 |  NZ|  NZ | 0|  0 |  0 |start -> start+npts   |         |         |
| 0 |  NZ|  0  |NZ|  0 |  0 |end-npts -> end       |         |         |

       No other combination of keywords is allowed.

 RESTRICTIONS: The data corresponding to DQD must already be on
               screen, having been plotted by SDT.

 EXAMPLE: my_data = get_fa_fields('V1-V4_S',/all) *OR*
          tplot,get_fa_fields('Mag3dc_S',/all,/calibrate,/store,struc=my_data)

 MODIFICATION HISTORY: written June 1996 by Bill Peria, UCBerkeley
                       Space Sciences Laboratory
       @(#)get_fa_fields.pro	1.64     

(See /disks/fast/software/integration/src/esa/get_fa_fields.pro)


GET_FA_FLDS

[Previous Routine] [Next Routine] [List of Routines]
 NAME: GET_FA_FLDS

 PURPOSE: To store raw FAST fields quantities for TPLOT

 CALLING SEQUENCE:   get_fa_fields,dqd,[ time1, time2,
                   NPTS=npts, START=st, EN=en, PANF=pf, PANB=pb,
                   ALL = all, CALIBRATE = calibrate, STORE = store]
 
 INPUTS:  DQD - a string containing a valid Data Quantity Descriptor
                 to pass on to SDT. If SDT doesn't recognize the DQD,
                 an error message is sent to the screen, and an
                 invalid status is returned to IDL. The file
                 FastDQD.doc, in the directory
                 /disks/fast/software/integration/docs, contains all
                 the current DQD information for FAST. The Unix
                 command:  

                     grep DataQuantity $FASTHOME/FastDQD.doc,

                 will produce a (long!) list of valid DQD's, which you
                 could redirect into a file for future reference. 



 OPTIONAL INPUTS:


	time1 			This argument gives the start time from
	        		which to take data, or, if START or EN keywords
				are non-zero, the length of time to take data.
				It may be either a string with the following
				possible formats:
					'YY-MM-DD/HH:MM:SS.MSC'  or
					'HH:MM:SS'     (use reference date)
				or a number, which will represent seconds
				since 1970 (must be a double > 94608000.D), or
				a hours from a reference time, if set.

				Time will always be returned as a double
				representing the actual data start time found 
				in seconds since 1970.

	time2			The same as time1, except it represents the
				end time.

				If the NPTS, START, EN, PANF or PANB keywords 
				are non-zero, then time2 will be ignored as an
				input parameter.


 KEYWORD PARAMETERS:

       CALIBRATE: If set, causes calibrated data to be returned, if
                  possible. Otherwise, raw data are returned,
                  *unless* the environment variable FAST_CALIBRATE is
                  set to 1, i.e. setenv FAST_CALIBRATE 1 . 

       STORE: Meaningless, always set.

       STRUCTURE: A named variable in which the data structure
                  described above can be returned, if desired (for
                  example, if STORE is set). 

       SPIN: If defined, causes the data to be returned at once per
             spin resolution, at a phase equal to the value of SPIN
             in degrees. 

       YBINS: If nonzero, two dimensional fields quantities are
              returned with this many frequency bins. 

       Setting the CALIBRATE keyword causes the procedure name in
       DAT.UNITS_PROCEDURE to be called. 

  
	Other keywords determine data time selection as given in the 
	following truth table (NZ == non-zero):

 |ALL |NPTS |START| EN  |PANF |PANB |selection                  |use time1|use time2|
 |----|-----|-----|-----|-----|-----|---------------------------|---------|---------|
 | NZ |  0  |  0  |  0  |  0  |  0  | start -> end              |  X      |  X      |
 | 0  |  0  |  0  |  0  |  0  |  0  | time1 -> time2            |  X      |  X      |
 | 0  |  0  |  NZ |  0  |  0  |  0  | start -> time1 secs       |  X      |         |
 | 0  |  0  |  0  |  NZ |  0  |  0  | end-time1 secs -> end     |  X      |         |
 | 0  |  0  |  0  |  0  |  NZ |  0  | pan fwd from time1->time2 |  X      |  X      |
 | 0  |  0  |  0  |  0  |  0  |  NZ | pan back from time1->time2|  X      |  X      |
 | 0  |  NZ |  0  |  0  |  0  |  0  | time1 -> time1+npts       |  X      |         |
 | 0  |  NZ |  NZ |  0  |  0  |  0  | start -> start+npts       |         |         |
 | 0  |  NZ |  0  |  NZ |  0  |  0  | end-npts -> end           |         |         |

	No other combination of keywords is allowed.

 RESTRICTIONS:    The data corresponding to DQD must already be on
 screen, having been plotted by SDT.  


 OUTPUTS: A TPLOT quantitiy, with the name DQD, is stored. 


 EXAMPLE: get_fa_flds,'Mag1dc_S',/all



 MODIFICATION HISTORY: written 3-October-1996 by Bill Peria UCB/SSL

(See /disks/fast/software/integration/src/esa/get_fa_flds.pro)


GET_FA_IEB

[Previous Routine] [Next Routine] [List of Routines]
 FUNCTION:
 	 GET_FA_IEB

 DESCRIPTION:

	function to load FAST I-esa burst data from the SDT program shared
	memory buffers.

	A structure of the following format is returned:

	   DATA_NAME     STRING    'Iesa Burst'        ; Data Quantity name
	   VALID         INT       1                   ; Data valid flag
 	   PROJECT_NAME  STRING    'FAST'              ; project name
 	   UNITS_NAME    STRING    'Counts'            ; Units of this data
 	   UNITS_PROCEDURE  STRING 'proc'              ; Units conversion proc
	   TIME          DOUBLE    8.0118726e+08       ; Start Time of sample
	   END_TIME      DOUBLE    7.9850884e+08       ; End time of sample
	   INTEG_T       DOUBLE    3.0000000           ; Integration time
	   NBINS         INT       nbins               ; Number of angle bins
	   NENERGY       INT       nnrgs               ; Number of energy bins
	   DATA          FLOAT     Array(nnrgs, nbins) ; Data qauantities
	   ENERGY        FLOAT     Array(nnrgs, nbins) ; Energy steps
	   THETA         FLOAT     Array(nnrgs, nbins) ; Angle for bins
	   GEOM          FLOAT     Array(nbins)        ; Geometry factor
	   DENERGY       FLOAT     Array(nnrgs, nbins) ; Energies for bins
	   DTHETA        FLOAT     Array(nbins)        ; Delta Theta
	   EFF           FLOAT     Array(nnrgs)        ; Efficiency (GF)
	   MASS          DOUBLE    0.0104389           ; Particle Mass
	   GEOMFACTOR    DOUBLE    0.0002720           ; Bin GF
	   HEADER_BYTES  BYTE      Array(25)	       ; Header bytes
	   INDEX         LONG      idx		       ; Index into sdt data
	
 CALLING SEQUENCE:

 	data = get_fa_ieb (time, [START=start | EN=en | ADVANCE=advance |
				RETREAT=retreat])

 ARGUMENTS:

	time 			This argument gives a time handle from which
				to take data from.  It may be either a string
				with the following possible formats:
					'YY-MM-DD/HH:MM:SS.MSC'  or
					'HH:MM:SS'     (use reference date)
				or a number, which will represent seconds
				since 1970 (must be a double > 94608000.D), or
				a hours from a reference time, if set.

				time will always be returned as a double
				representing the actual data time found in
				seconds since 1970.

 KEYWORDS:

	START			If non-zero, get data from the start time
				of the data instance in the SDT buffers

	EN			If non-zero, get data at the end time
				of the data instance in the SDT buffers

	ADVANCE			If non-zero, advance to the next data point
				following the time input

	RETREAT			If non-zero, retreat (reverse) to the previous
				data point before the time input

	CALIB			If non-zero, caclulate geometry
				factors for each bin instead of using 1.'s

       INDEX                   Index into sdt data

 RETURN VALUE:

	Upon success, the above structure is returned, with the valid tag
	set to 1.  Upon failure, the valid tag will be 0.

 REVISION HISTORY:

	@(#)get_fa_ieb.pro	1.19 12/03/97
 	Originally written by Jonathan M. Loran,  University of 
 	California at Berkeley, Space Sciences Lab.   June '95

(See /disks/fast/software/integration/src/esa/get_fa_ieb.pro)


GET_FA_IEB_C

[Previous Routine] [Next Routine] [List of Routines]
 FUNCTION:
 	 GET_FA_IEB_C

 DESCRIPTION:


	function to load FAST I-esa burst data from the SDT program shared
	memory buffers.  This is the caching version

	A structure of the following format is returned:

	   DATA_NAME     STRING    'Iesa Burst'        ; Data Quantity name
	   VALID         INT       1                   ; Data valid flag
 	   PROJECT_NAME  STRING    'FAST'              ; project name
 	   UNITS_NAME    STRING    'Counts'            ; Units of this data
 	   UNITS_PROCEDURE  STRING 'proc'              ; Units conversion proc
	   TIME          DOUBLE    8.0118726e+08       ; Start Time of sample
	   END_TIME      DOUBLE    7.9850884e+08       ; End time of sample
	   INTEG_T       DOUBLE    3.0000000           ; Integration time
	   NBINS         INT       nbins               ; Number of angle bins
	   NENERGY       INT       nnrgs               ; Number of energy bins
	   DATA          FLOAT     Array(nnrgs, nbins) ; Data qauantities
	   ENERGY        FLOAT     Array(nnrgs, nbins) ; Energy steps
	   THETA         FLOAT     Array(nnrgs, nbins) ; Angle for bins
	   GEOM          FLOAT     Array(nnrgs, nbins) ; Geometry factor
	   DENERGY       FLOAT     Array(nnrgs, nbins) ; Energies for bins
	   DTHETA        FLOAT     Array(nnrgs, nbins) ; Delta Theta
	   EFF           FLOAT     Array(nnrgs)        ; Efficiency (GF)
	   MASS          DOUBLE    0.0104389           ; Particle Mass
	   GEOMFACTOR    DOUBLE    0.0002720           ; Bin GF
	   HEADER_BYTES  BYTE      Array(44)	       ; Header bytes
	   INDEX         LONG      idx                 ; Index in sdt buffers
	
 CALLING SEQUENCE:

 	data = get_fa_ieb (time, [START=start | EN=en | ADVANCE=advance |
				RETREAT=retreat], CALIB=calib,
				INDEX=idx, FLUSH=flush, CACHE_SIZE=cache_size)

 ARGUMENTS:

	time 			This argument gives a time handle from which
				to take data from.  It may be either a string
				with the following possible formats:
					'YY-MM-DD/HH:MM:SS.MSC'  or
					'HH:MM:SS'     (use reference date)
				or a number, which will represent seconds
				since 1970 (must be a double > 94608000.D), or
				a hours from a reference time, if set.

				time will always be returned as a double
				representing the actual data time found in
				seconds since 1970.

 KEYWORDS:

	START			If non-zero, get data from the start time
				of the data instance in the SDT buffers

	EN			If non-zero, get data at the end time
				of the data instance in the SDT buffers

	ADVANCE			If non-zero, advance to the next data point
				following the time or index input

	RETREAT			If non-zero, retreat (reverse) to the previous
				data point before the time or index input

	CALIB			If non-zero, caclulate geometry
				factors for each bin instead of using 1.'s

	INDEX			If index is set, it is used for selecting
				the index to get data.

	FLUSH			If non-zero, will flush the data cache
				This is useful to force a re-read of sdt
				buffers in case the data has changed.

	CACHE_SIZE		If gt 0, will reset the length in points
				of data to cache.

 RETURN VALUE:

	Upon success, the above structure is returned, with the valid tag
	set to 1.  Upon failure, the valid tag will be 0.

 REVISION HISTORY:

	@(#)get_fa_ieb_c.pro	1.2 12/03/97
 	Originally written by Jonathan M. Loran,  University of 
 	California at Berkeley, Space Sciences Lab.   June '95

	Major upgrade, using get_cache_md_from_sdt to load a time range
	at once to cache data in idl for speedup.   J.M. Loran Apr. 97

(See /disks/fast/software/integration/src/esa/get_fa_ieb_c.pro)


GET_FA_IEB_HDR

[Previous Routine] [Next Routine] [List of Routines]
 FUNCTION:
 	 GET_FA_IEB_HDR

 DESCRIPTION:

	function to load FAST I-esa burst header data from the SDT program
 	shared memory buffers.

	At structure of the following format is returned:

	   DATA_NAME     STRING 'Iesa_Burst_Packet_Hdr'; Data Quantity name
	   VALID         INT       1                   ; Data valid flag
 	   PROJECT_NAME  STRING    'FAST'              ; Project name
 	   UNITS_NAME    STRING    'Raw'               ; Units of this data
 	   VALUES_PROCEDURE  STRING 'eiesa_unpack_hdr' ; Name of proc to
                                                      ; get values from hdr
	   TIME          DOUBLE    8.0118726e+08       ; Start Time of sample
	   BYTES         BYTE      Array(44)	       ; Header bytes
	   INDEX         LONG	   idx		       ; index into data
	   
	
 CALLING SEQUENCE:

 	data = get_fa_ieb_hdr (time)

 ARGUMENTS:

	time 			This argument gives a time handle from which
				to take data from.  It may be either a string
				with the following possible formats:
					'YY-MM-DD/HH:MM:SS.MSC'  or
					'HH:MM:SS'     (use reference date)
				or a number, which will represent seconds
				since 1970 (must be a double > 94608000.D), or
				a hours from a reference time, if set.

				time will always be returned as a double
				representing the actual data time found in
				seconds since 1970.

 KEYWORDS:
	INDEX:			get data at this index.

 RETURN VALUE:

	Upon success, the above structure is returned, with the valid tag
	set to 1.  Upon failure, the valid tag will be 0.

 REVISION HISTORY:

	@(#)get_fa_ieb_hdr.pro	1.9 07/23/97
 	Originally written by Jonathan M. Loran,  University of 
 	California at Berkeley, Space Sciences Lab.   June '95

(See /disks/fast/software/integration/src/esa/get_fa_ieb_hdr.pro)


GET_FA_IEB_TS

[Previous Routine] [Next Routine] [List of Routines]
 FUNCTION:
 	 GET_FA_IEB_TS

 DESCRIPTION:


	function to load FAST I-esa burst data from the SDT program shared
	memory buffers.  This is the time series version.  

	An array of npts structures of the following format are returned:

	   DATA_NAME     STRING    'Iesa Burst'        ; Data Quantity name
	   VALID         INT       1                   ; Data valid flag
 	   PROJECT_NAME  STRING    'FAST'              ; project name
 	   UNITS_NAME    STRING    'Counts'            ; Units of this data
 	   UNITS_PROCEDURE  STRING 'proc'              ; Units conversion proc
	   TIME          DOUBLE    8.0118726e+08       ; Start Time of sample
	   END_TIME      DOUBLE    7.9850884e+08       ; End time of sample
	   INTEG_T       DOUBLE    3.0000000           ; Integration time
	   NBINS         INT       nbins               ; Number of angle bins
	   NENERGY       INT       nnrgs               ; Number of energy bins
	   DATA          FLOAT     Array(nnrgs, nbins) ; Data qauantities
	   ENERGY        FLOAT     Array(nnrgs, nbins) ; Energy steps
	   THETA         FLOAT     Array(nnrgs, nbins) ; Angle for bins
	   GEOM          FLOAT     Array(nbins)        ; Geometry factor
	   DENERGY       FLOAT     Array(nnrgs, nbins) ; Energies for bins
	   DTHETA        FLOAT     Array(nbins)        ; Delta Theta
	   EFF           FLOAT     Array(nnrgs)        ; Efficiency (GF)
	   MASS          DOUBLE    0.0104389           ; Particle Mass
	   GEOMFACTOR    DOUBLE    0.000272            ; Bin GF
	   HEADER_BYTES  BYTE      Array(25)	       ; Header bytes
	   INDEX         LONG      index               ; Data index, this pt. 
	   ST_INDEX      LONG      st_idx              ; start index of arr
	   EN_INDEX      LONG      en_idx              ; end index of arr
	   NPTS          LONG      npts                ; array size
	
 CALLING SEQUENCE:
	data = get_fa_ieb_ts (t1, t2, [NPTS=npts], [START=st | EN=en | 
				PANF=panf | PANB=panb | IDXST=startidx], 
				CALIB=calib)
 ARGUMENTS:

	t1 			This argument gives the start time from
				which to take data, or, if START or EN keywords
				are non-zero, the length of time to take data.
				It may be either a string with the following
				possible formats:
					'YY-MM-DD/HH:MM:SS.MSC'  or
					'HH:MM:SS'     (use reference date)
				or a number, which will represent seconds
				since 1970 (must be a double > 94608000.D), or
				a hours from a reference time, if set.

				Time will always be returned as a double
				representing the actual data start time found 
				in seconds since 1970.

	t2			The same as time1, except it represents the
				end time.

				If the NPTS, START, EN, PANF or PANB keywords 
				are non-zero, THEN time2 will be ignored as an
				input paramter.

 KEYWORDS:

	CALIB			If non-zero, caclulate geometry
				factors for each bin instead of using 1.'s

	Data time selection is determined from the keywords as given in the 
	following truth table (NZ == non-zero):

 |ALL |NPTS |START| EN  |IDXST|PANF |PANB |selection            |use time1|use time2|
 |----|-----|-----|-----|-----|-----|-----|---------------------|---------|---------|
 | NZ |  0  |  0  |  0  |  0  |  0  |  0  | start -> end        |  X      |  X      |
 | 0  |  0  |  0  |  0  |  0  |  0  |  0  | time1 -> time2      |  X      |  X      |
 | 0  |  0  |  NZ |  0  |  0  |  0  |  0  | start -> time1 secs |  X      |         |
 | 0  |  0  |  0  |  NZ |  0  |  0  |  0  | end-time1 secs ->end|  X      |         |
 | 0  |  0  |  0  |  0  |  0  |  NZ |  0  | pan fwd from        |  X      |  X      |
 |    |     |     |     |     |     |     |   time1->time2      |         |         |
 | 0  |  0  |  0  |  0  |  0  |  0  |  NZ | pan back from       |  X      |  X      |
 |    |     |     |     |     |     |     |   time1->time2      |         |         |
 | 0  |  NZ |  0  |  0  |  0  |  0  |  0  | time1 -> time1+npts |  X      |         |
 | 0  |  NZ |  NZ |  0  |  0  |  0  |  0  | start -> start+npts |         |         |
 | 0  |  NZ |  0  |  NZ |  0  |  0  |  0  | end-npts -> end     |         |         |
 | 0  |  NZ |  0  |  0  |  NZ |  0  |  0  | st-index ->         |         |         |
 |    |     |     |     |     |     |     |   st_index + npts   |         |         |
	Any other combination of keywords is not allowed.

 RETURN VALUE:

	Upon success, the above structure is returned, with the valid tag
	set to 1.  Upon failure, the valid tag will be 0.

 REVISION HISTORY:

	@(#)get_fa_ieb_ts.pro	1.4 12/03/97
 	Originally written by Jonathan M. Loran,  University of 
 	California at Berkeley, Space Sciences Lab.   Apr '97

(See /disks/fast/software/integration/src/esa/get_fa_ieb_ts.pro)


GET_FA_IES

[Previous Routine] [Next Routine] [List of Routines]
 FUNCTION:
 	 GET_FA_IES

 DESCRIPTION:

	function to load FAST E-esa survey data from the SDT program shared
	memory buffers.

	A structure of the following format is returned:

	   DATA_NAME     STRING    'Eesa Survey'       ; Data Quantity name
	   VALID         INT       1                   ; Data valid flag
 	   PROJECT_NAME  STRING    'FAST'              ; project name
 	   UNITS_NAME    STRING    'Counts'            ; Units of this data
 	   UNITS_PROCEDURE  STRING 'proc'              ; Units conversion proc
	   TIME          DOUBLE    8.0118726e+08       ; Start Time of sample
	   END_TIME      DOUBLE    7.9850884e+08       ; End time of sample
	   INTEG_T       DOUBLE    3.0000000           ; Integration time
	   NBINS         INT       nbins               ; Number of angle bins
	   NENERGY       INT       nnrgs               ; Number of energy bins
	   DATA          FLOAT     Array(nnrgs, nbins) ; Data qauantities
	   ENERGY        FLOAT     Array(nnrgs, nbins) ; Energy steps
	   THETA         FLOAT     Array(nnrgs, nbins) ; Angle for bins
	   GEOM          FLOAT     Array(nbins)        ; Geometry factor
	   DENERGY       FLOAT     Array(nnrgs, nbins) ; Energies for bins
	   DTHETA        FLOAT     Array(nbins)        ; Delta Theta
	   EFF           FLOAT     Array(nnrgs)        ; Efficiency (GF)
	   MASS          DOUBLE    0.0104389           ; Particle Mass
	   GEOMFACTOR    DOUBLE    0.000272            ; Bin GF
	   HEADER_BYTES  BYTE      Array(25)	       ; Header bytes
	   INDEX         LONG      idx		       ; Index into sdt data
	
 CALLING SEQUENCE:

 	data = get_fa_ies (time, [START=start | EN=en | ADVANCE=advance |
				RETREAT=retreat])

 ARGUMENTS:

	time 			This argument gives a time handle from which
				to take data from.  It may be either a string
				with the following possible formats:
					'YY-MM-DD/HH:MM:SS.MSC'  or
					'HH:MM:SS'     (use reference date)
				or a number, which will represent seconds
				since 1970 (must be a double > 94608000.D), or
				a hours from a reference time, if set.

				time will always be returned as a double
				representing the actual data time found in
				seconds since 1970.

 KEYWORDS:

	START			If non-zero, get data from the start time
				of the data instance in the SDT buffers

	EN			If non-zero, get data at the end time
				of the data instance in the SDT buffers

	ADVANCE			If non-zero, advance to the next data point
				following the time input

	RETREAT			If non-zero, retreat (reverse) to the previous
				data point before the time input

	CALIB			If non-zero, caclulate geometry
				factors for each bin instead of using 1.'s

       INDEX                   Index into sdt data

 RETURN VALUE:

	Upon success, the above structure is returned, with the valid tag
	set to 1.  Upon failure, the valid tag will be 0.

 REVISION HISTORY:

	@(#)get_fa_ies.pro	1.24 10/08/99
 	Originally written by Jonathan M. Loran,  University of 
 	California at Berkeley, Space Sciences Lab.   June '95

(See /disks/fast/software/integration/src/esa/get_fa_ies.pro)


GET_FA_IES_C

[Previous Routine] [Next Routine] [List of Routines]
 FUNCTION:
 	 GET_FA_IES_C

 DESCRIPTION:


	function to load FAST I-esa survey data from the SDT program shared
	memory buffers.  This is the caching version

	A structure of the following format is returned:

	   DATA_NAME     STRING    'Iesa Survey'       ; Data Quantity name
	   VALID         INT       1                   ; Data valid flag
 	   PROJECT_NAME  STRING    'FAST'              ; project name
 	   UNITS_NAME    STRING    'Counts'            ; Units of this data
 	   UNITS_PROCEDURE  STRING 'proc'              ; Units conversion proc
	   TIME          DOUBLE    8.0118726e+08       ; Start Time of sample
	   END_TIME      DOUBLE    7.9850884e+08       ; End time of sample
	   INTEG_T       DOUBLE    3.0000000           ; Integration time
	   NBINS         INT       nbins               ; Number of angle bins
	   NENERGY       INT       nnrgs               ; Number of energy bins
	   DATA          FLOAT     Array(nnrgs, nbins) ; Data qauantities
	   ENERGY        FLOAT     Array(nnrgs, nbins) ; Energy steps
	   THETA         FLOAT     Array(nnrgs, nbins) ; Angle for bins
	   GEOM          FLOAT     Array(nnrgs, nbins) ; Geometry factor
	   DENERGY       FLOAT     Array(nnrgs, nbins) ; Energies for bins
	   DTHETA        FLOAT     Array(nnrgs, nbins) ; Delta Theta
	   EFF           FLOAT     Array(nnrgs)        ; Efficiency (GF)
	   MASS          DOUBLE    0.0104389           ; Particle Mass
	   GEOMFACTOR    DOUBLE    0.000272            ; Bin GF
	   HEADER_BYTES  BYTE      Array(44)	       ; Header bytes
	   INDEX         LONG      idx                 ; Index in sdt buffers
	
 CALLING SEQUENCE:

 	data = get_fa_ies (time, [START=start | EN=en | ADVANCE=advance |
				RETREAT=retreat], CALIB=calib,
				INDEX=idx, FLUSH=flush, CACHE_SIZE=cache_size)

 ARGUMENTS:

	time 			This argument gives a time handle from which
				to take data from.  It may be either a string
				with the following possible formats:
					'YY-MM-DD/HH:MM:SS.MSC'  or
					'HH:MM:SS'     (use reference date)
				or a number, which will represent seconds
				since 1970 (must be a double > 94608000.D), or
				a hours from a reference time, if set.

				time will always be returned as a double
				representing the actual data time found in
				seconds since 1970.

 KEYWORDS:

	START			If non-zero, get data from the start time
				of the data instance in the SDT buffers

	EN			If non-zero, get data at the end time
				of the data instance in the SDT buffers

	ADVANCE			If non-zero, advance to the next data point
				following the time or index input

	RETREAT			If non-zero, retreat (reverse) to the previous
				data point before the time or index input

	CALIB			If non-zero, caclulate geometry
				factors for each bin instead of using 1.'s

	INDEX			If index is set, it is used for selecting
				the index to get data.

	FLUSH			If non-zero, will flush the data cache
				This is useful to force a re-read of sdt
				buffers in case the data has changed.

	CACHE_SIZE		If gt 0, will reset the length in points
				of data to cache.

 RETURN VALUE:

	Upon success, the above structure is returned, with the valid tag
	set to 1.  Upon failure, the valid tag will be 0.

 REVISION HISTORY:

	@(#)get_fa_ies_c.pro	1.3 10/08/99
 	Originally written by Jonathan M. Loran,  University of 
 	California at Berkeley, Space Sciences Lab.   June '95

	Major upgrade, using get_cache_md_from_sdt to load a time range
	at once to cache data in idl for speedup.   J.M. Loran Apr. 97

(See /disks/fast/software/integration/src/esa/get_fa_ies_c.pro)


GET_FA_IES_HDR

[Previous Routine] [Next Routine] [List of Routines]
 FUNCTION:
 	 GET_FA_IES_HDR

 DESCRIPTION:

	function to load FAST I-esa survey header data from the SDT program
 	shared memory buffers.

	At structure of the following format is returned:

	   DATA_NAME     STRING 'Iesa_Survey_Packet_Hdr'; Data Quantity name
	   VALID         INT       1                   ; Data valid flag
 	   PROJECT_NAME  STRING    'FAST'              ; Project name
 	   UNITS_NAME    STRING    'Raw'               ; Units of this data
 	   VALUES_PROCEDURE  STRING 'eiesa_unpack_hdr' ; Name of proc to
                                                      ; get values from hdr
	   TIME          DOUBLE    8.0118726e+08       ; Start Time of sample
	   BYTES         BYTE      Array(44)	       ; Header bytes
	   INDEX         LONG	   idx		       ; index into data
	   
	
 CALLING SEQUENCE:

 	data = get_fa_ies_hdr (time)

 ARGUMENTS:

	time 			This argument gives a time handle from which
				to take data from.  It may be either a string
				with the following possible formats:
					'YY-MM-DD/HH:MM:SS.MSC'  or
					'HH:MM:SS'     (use reference date)
				or a number, which will represent seconds
				since 1970 (must be a double > 94608000.D), or
				a hours from a reference time, if set.

				time will always be returned as a double
				representing the actual data time found in
				seconds since 1970.

 KEYWORDS:
	INDEX:			get data at this index.

 RETURN VALUE:

	Upon success, the above structure is returned, with the valid tag
	set to 1.  Upon failure, the valid tag will be 0.

 REVISION HISTORY:

	@(#)get_fa_ies_hdr.pro	1.9 07/23/97
 	Originally written by Jonathan M. Loran,  University of 
 	California at Berkeley, Space Sciences Lab.   June '95

(See /disks/fast/software/integration/src/esa/get_fa_ies_hdr.pro)


GET_FA_IES_TS

[Previous Routine] [Next Routine] [List of Routines]
 FUNCTION:
 	 GET_FA_IES_TS

 DESCRIPTION:


	function to load FAST I-esa survey data from the SDT program shared
	memory buffers.  This is the time series version.  

	An array of npts structures of the following format are returned:

	   DATA_NAME     STRING    'Iesa Survey'       ; Data Quantity name
	   VALID         INT       1                   ; Data valid flag
 	   PROJECT_NAME  STRING    'FAST'              ; project name
 	   UNITS_NAME    STRING    'Counts'            ; Units of this data
 	   UNITS_PROCEDURE  STRING 'proc'              ; Units conversion proc
	   TIME          DOUBLE    8.0118726e+08       ; Start Time of sample
	   END_TIME      DOUBLE    7.9850884e+08       ; End time of sample
	   INTEG_T       DOUBLE    3.0000000           ; Integration time
	   NBINS         INT       nbins               ; Number of angle bins
	   NENERGY       INT       nnrgs               ; Number of energy bins
	   DATA          FLOAT     Array(nnrgs, nbins) ; Data qauantities
	   ENERGY        FLOAT     Array(nnrgs, nbins) ; Energy steps
	   THETA         FLOAT     Array(nnrgs, nbins) ; Angle for bins
	   GEOM          FLOAT     Array(nbins)        ; Geometry factor
	   DENERGY       FLOAT     Array(nnrgs, nbins) ; Energies for bins
	   DTHETA        FLOAT     Array(nbins)        ; Delta Theta
	   EFF           FLOAT     Array(nnrgs)        ; Efficiency (GF)
	   MASS          DOUBLE    0.0104389           ; Particle Mass
	   GEOMFACTOR    DOUBLE    0.000272            ; Bin GF
	   HEADER_BYTES  BYTE      Array(25)	       ; Header bytes
	   INDEX         LONG      index               ; Data index, this pt. 
	   ST_INDEX      LONG      st_idx              ; start index of arr
	   EN_INDEX      LONG      en_idx              ; end index of arr
	   NPTS          LONG      npts                ; array size
	
 CALLING SEQUENCE:
	data = get_fa_ies_ts (t1, t2, [NPTS=npts], [START=st | EN=en | 
				PANF=panf | PANB=panb | IDXST=startidx], 
				CALIB=calib)
 ARGUMENTS:

	t1 			This argument gives the start time from
				which to take data, or, if START or EN keywords
				are non-zero, the length of time to take data.
				It may be either a string with the following
				possible formats:
					'YY-MM-DD/HH:MM:SS.MSC'  or
					'HH:MM:SS'     (use reference date)
				or a number, which will represent seconds
				since 1970 (must be a double > 94608000.D), or
				a hours from a reference time, if set.

				Time will always be returned as a double
				representing the actual data start time found 
				in seconds since 1970.

	t2			The same as time1, except it represents the
				end time.

				If the NPTS, START, EN, PANF or PANB keywords 
				are non-zero, THEN time2 will be ignored as an
				input paramter.

 KEYWORDS:

	CALIB			If non-zero, caclulate geometry
				factors for each bin instead of using 1.'s

	Data time selection is determined from the keywords as given in the 
	following truth table (NZ == non-zero):

 |ALL |NPTS |START| EN  |IDXST|PANF |PANB |selection            |use time1|use time2|
 |----|-----|-----|-----|-----|-----|-----|---------------------|---------|---------|
 | NZ |  0  |  0  |  0  |  0  |  0  |  0  | start -> end        |  X      |  X      |
 | 0  |  0  |  0  |  0  |  0  |  0  |  0  | time1 -> time2      |  X      |  X      |
 | 0  |  0  |  NZ |  0  |  0  |  0  |  0  | start -> time1 secs |  X      |         |
 | 0  |  0  |  0  |  NZ |  0  |  0  |  0  | end-time1 secs ->end|  X      |         |
 | 0  |  0  |  0  |  0  |  0  |  NZ |  0  | pan fwd from        |  X      |  X      |
 |    |     |     |     |     |     |     |   time1->time2      |         |         |
 | 0  |  0  |  0  |  0  |  0  |  0  |  NZ | pan back from       |  X      |  X      |
 |    |     |     |     |     |     |     |   time1->time2      |         |         |
 | 0  |  NZ |  0  |  0  |  0  |  0  |  0  | time1 -> time1+npts |  X      |         |
 | 0  |  NZ |  NZ |  0  |  0  |  0  |  0  | start -> start+npts |         |         |
 | 0  |  NZ |  0  |  NZ |  0  |  0  |  0  | end-npts -> end     |         |         |
 | 0  |  NZ |  0  |  0  |  NZ |  0  |  0  | st-index ->         |         |         |
 |    |     |     |     |     |     |     |   st_index + npts   |         |         |
	Any other combination of keywords is not allowed.

 RETURN VALUE:

	Upon success, the above structure is returned, with the valid tag
	set to 1.  Upon failure, the valid tag will be 0.

 REVISION HISTORY:

	@(#)get_fa_ies_ts.pro	1.3 12/03/97
 	Originally written by Jonathan M. Loran,  University of 
 	California at Berkeley, Space Sciences Lab.   Apr '97

(See /disks/fast/software/integration/src/esa/get_fa_ies_ts.pro)


GET_FA_POTENTIAL

[Previous Routine] [Next Routine] [List of Routines]
 NAME: GET_FA_POTENTIAL

 PURPOSE:
    To obtain the spacecraft potential for FAST in fa_fields
 format. Calls FF_POTENTIAL to do the bulk of the work. 

 CALLING SEQUENCE: pot = get_fa_potential(time1c, time2c, NPTS=npts,
                         START=st, EN=en, PANF=pf, PANB=pb, ALL = all,
                         STORE = store, STRUCTURE = struct, SPIN = spin,
                         REPAIR = repair)  
 
 INPUTS: T1, T2: start and stop times, in seconds since 1970 or
         YYYY-MM-DD/HH:MM:SS. 
       
 KEYWORD PARAMETERS: All applicable keywords from GET_FA_FIELDS.

 OUTPUTS: If /STORE is not set set, a standard fields structure
          containing the potential in volts in COMP1 is returned. If
          STORE is set, a tplot string handle is returned.

 RESTRICTIONS: The environment variable FAST_CALIBRATE must be 1.
               Why not do the following:

                  alias fastsdt   'setenv FAST_CALIBRATE 1; sdt' 

                        in your .cshrc file? 


 EXAMPLE: pot = get_fa_potential(t1,t2)
          pdqplot,pot
          OR...
          tplot,get_fa_potential(t1,t2,/store)


 MODIFICATION HISTORY: written April '97 by Bill Peria 

(See /disks/fast/software/integration/src/esa/get_fa_potential.pro)


GET_FA_SEB

[Previous Routine] [Next Routine] [List of Routines]
 FUNCTION:
 	 GET_FA_SEB

 DESCRIPTION:

	function to load FAST Sesa burst combined data from the SDT program shared
	memory buffers.

	A structure of the following format is returned:

	   DATA_NAME     STRING    'Sesa Burst'        ; Data Quantity name
	   VALID         INT       1                   ; Data valid flag
 	   PROJECT_NAME  STRING    'FAST'              ; project name
 	   UNITS_NAME    STRING    'Counts'            ; Units of this data
 	   UNITS_PROCEDURE  STRING 'proc'              ; Units conversion proc
	   TIME          DOUBLE    8.0118726e+08       ; Start Time of sample
	   END_TIME      DOUBLE    7.9850884e+08       ; End time of sample
	   INTEG_T       DOUBLE    3.0000000           ; Integration time
	   NBINS         INT       nbins               ; Number of angle bins
	   NENERGY       INT       nnrgs               ; Number of energy bins
	   DATA          FLOAT     Array(nnrgs, nbins) ; Data qauantities
	   ENERGY        FLOAT     Array(nnrgs, nbins) ; Energy steps
	   THETA         FLOAT     Array(nnrgs, nbins) ; Angle for bins
	   GEOM          FLOAT     Array(nbins)        ; Geometry factor
	   DENERGY       FLOAT     Array(nnrgs, nbins) ; Energies for bins
	   DTHETA        FLOAT     Array(nbins)        ; Delta Theta
	   EFF           FLOAT     Array(nnrgs)        ; Efficiency (GF)
	   MASS          DOUBLE    5.68566e-6          ; Particle Mass
	   GEOMFACTOR    DOUBLE    0.000625            ; Bin GF
	   HEADER_BYTES  BYTE      Array(25)	       ; Header bytes
	   INDEX         LONG      idx		       ; Index into sdt data
	
 CALLING SEQUENCE:

 	data = get_fa_seb (time, [START=start | EN=en | ADVANCE=advance |
				RETREAT=retreat])

 ARGUMENTS:

	time 			This argument gives a time handle from which
				to take data from.  It may be either a string
				with the following possible formats:
					'YY-MM-DD/HH:MM:SS.MSC'  or
					'HH:MM:SS'     (use reference date)
				or a number, which will represent seconds
				since 1970 (must be a double > 94608000.D), or
				a hours from a reference time, if set.

				time will always be returned as a double
				representing the actual data time found in
				seconds since 1970.

 KEYWORDS:

	START			If non-zero, get data from the start time
				of the data instance in the SDT buffers

	EN			If non-zero, get data at the end time
				of the data instance in the SDT buffers

	ADVANCE			If non-zero, advance to the next data point
				following the time input

	RETREAT			If non-zero, retreat (reverse) to the previous
				data point before the time input

	CALIB			If non-zero, caclulate geometry
				factors for each bin instead of using 1.'s

       INDEX                   Index into sdt data

 RETURN VALUE:

	Upon success, the above structure is returned, with the valid tag
	set to 1.  Upon failure, the valid tag will be 0.

 REVISION HISTORY:

	@(#)get_fa_seb.pro	1.3 08/08/00
 	Originally written by Jonathan M. Loran,  University of 
 	California at Berkeley, Space Sciences Lab.   Aug '99

(See /disks/fast/software/integration/src/esa/get_fa_seb.pro)


GET_FA_SEB1

[Previous Routine] [Next Routine] [List of Routines]
 FUNCTION:
 	 GET_FA_SEB1

 DESCRIPTION:

	function to load FAST S-esa1 burst data from the SDT program shared
	memory buffers.

	A structure of the following format is returned:

	   DATA_NAME     STRING    'Sesa1 Burst'        ; Data Quantity name
	   VALID         INT       1                   ; Data valid flag
 	   PROJECT_NAME  STRING    'FAST'              ; project name
 	   UNITS_NAME    STRING    'Counts'            ; Units of this data
 	   UNITS_PROCEDURE  STRING 'proc'              ; Units conversion proc
	   TIME          DOUBLE    8.0118726e+08       ; Start Time of sample
	   END_TIME      DOUBLE    7.9850884e+08       ; End time of sample
	   INTEG_T       DOUBLE    3.0000000           ; Integration time
	   NBINS         INT       nbins               ; Number of angle bins
	   NENERGY       INT       nnrgs               ; Number of energy bins
	   DATA          FLOAT     Array(nnrgs, nbins) ; Data qauantities
	   ENERGY        FLOAT     Array(nnrgs, nbins) ; Energy steps
	   THETA         FLOAT     Array(nnrgs, nbins) ; Angle for bins
	   GEOM          FLOAT     Array(nbins)        ; Geometry factor
	   DENERGY       FLOAT     Array(nnrgs, nbins) ; Energies for bins
	   DTHETA        FLOAT     Array(nbins)        ; Delta Theta
	   EFF           FLOAT     Array(nnrgs)        ; Efficiency (GF)
	   MASS          DOUBLE    5.68566e-6          ; Particle Mass
	   GEOMFACTOR    DOUBLE    0.000625            ; Bin GF
	   HEADER_BYTES  BYTE      Array(25)	       ; Header bytes
	   INDEX         LONG      idx		       ; Index into sdt data
	
 CALLING SEQUENCE:

 	data = get_fa_seb1 (time, [START=start | EN=en | ADVANCE=advance |
				RETREAT=retreat])

 ARGUMENTS:

	time 			This argument gives a time handle from which
				to take data from.  It may be either a string
				with the following possible formats:
					'YY-MM-DD/HH:MM:SS.MSC'  or
					'HH:MM:SS'     (use reference date)
				or a number, which will represent seconds
				since 1970 (must be a double > 94608000.D), or
				a hours from a reference time, if set.

				time will always be returned as a double
				representing the actual data time found in
				seconds since 1970.

 KEYWORDS:

	START			If non-zero, get data from the start time
				of the data instance in the SDT buffers

	EN			If non-zero, get data at the end time
				of the data instance in the SDT buffers

	ADVANCE			If non-zero, advance to the next data point
				following the time input

	RETREAT			If non-zero, retreat (reverse) to the previous
				data point before the time input

	CALIB			If non-zero, caclulate geometry
				factors for each bin instead of using 1.'s

       INDEX                   Index into sdt data

 RETURN VALUE:

	Upon success, the above structure is returned, with the valid tag
	set to 1.  Upon failure, the valid tag will be 0.

 REVISION HISTORY:

	@(#)get_fa_seb1.pro	1.17 07/23/97
 	Originally written by Jonathan M. Loran,  University of 
 	California at Berkeley, Space Sciences Lab.   June '95

(See /disks/fast/software/integration/src/esa/get_fa_seb1.pro)


GET_FA_SEB1_C

[Previous Routine] [Next Routine] [List of Routines]
 FUNCTION:
 	 GET_FA_SEB1_C

 DESCRIPTION:


	function to load FAST S-esa1 burst data from the SDT program shared
	memory buffers.  This is the caching version

	A structure of the following format is returned:

	   DATA_NAME     STRING    'Sesa 1 Burst'      ; Data Quantity name
	   VALID         INT       1                   ; Data valid flag
 	   PROJECT_NAME  STRING    'FAST'              ; project name
 	   UNITS_NAME    STRING    'Counts'            ; Units of this data
 	   UNITS_PROCEDURE  STRING 'proc'              ; Units conversion proc
	   TIME          DOUBLE    8.0118726e+08       ; Start Time of sample
	   END_TIME      DOUBLE    7.9850884e+08       ; End time of sample
	   INTEG_T       DOUBLE    3.0000000           ; Integration time
	   NBINS         INT       nbins               ; Number of angle bins
	   NENERGY       INT       nnrgs               ; Number of energy bins
	   DATA          FLOAT     Array(nnrgs, nbins) ; Data qauantities
	   ENERGY        FLOAT     Array(nnrgs, nbins) ; Energy steps
	   THETA         FLOAT     Array(nnrgs, nbins) ; Angle for bins
	   GEOM          FLOAT     Array(nnrgs, nbins) ; Geometry factor
	   DENERGY       FLOAT     Array(nnrgs, nbins) ; Energies for bins
	   DTHETA        FLOAT     Array(nnrgs, nbins) ; Delta Theta
	   EFF           FLOAT     Array(nnrgs)        ; Efficiency (GF)
	   MASS          DOUBLE    5.68566e-6          ; Particle Mass
	   GEOMFACTOR    DOUBLE    0.000625            ; Bin GF
	   HEADER_BYTES  BYTE      Array(44)	       ; Header bytes
	   INDEX         LONG      idx                 ; Index in sdt buffers
	
 CALLING SEQUENCE:

 	data = get_fa_seb1 (time, [START=start | EN=en | ADVANCE=advance |
				RETREAT=retreat], CALIB=calib,
				INDEX=idx, FLUSH=flush, CACHE_SIZE=cache_size)

 ARGUMENTS:

	time 			This argument gives a time handle from which
				to take data from.  It may be either a string
				with the following possible formats:
					'YY-MM-DD/HH:MM:SS.MSC'  or
					'HH:MM:SS'     (use reference date)
				or a number, which will represent seconds
				since 1970 (must be a double > 94608000.D), or
				a hours from a reference time, if set.

				time will always be returned as a double
				representing the actual data time found in
				seconds since 1970.

 KEYWORDS:

	START			If non-zero, get data from the start time
				of the data instance in the SDT buffers

	EN			If non-zero, get data at the end time
				of the data instance in the SDT buffers

	ADVANCE			If non-zero, advance to the next data point
				following the time or index input

	RETREAT			If non-zero, retreat (reverse) to the previous
				data point before the time or index input

	CALIB			If non-zero, caclulate geometry
				factors for each bin instead of using 1.'s

	INDEX			If index is set, it is used for selecting
				the index to get data.

	FLUSH			If non-zero, will flush the data cache
				This is useful to force a re-read of sdt
				buffers in case the data has changed.

	CACHE_SIZE		If gt 0, will reset the length in points
				of data to cache.

 RETURN VALUE:

	Upon success, the above structure is returned, with the valid tag
	set to 1.  Upon failure, the valid tag will be 0.

 REVISION HISTORY:

	@(#)get_fa_seb1_c.pro	1.1 05/30/97
 	Originally written by Jonathan M. Loran,  University of 
 	California at Berkeley, Space Sciences Lab.   June '95

	Major upgrade, using get_cache_md_from_sdt to load a time range
	at once to cache data in idl for speedup.   J.M. Loran Apr. 97

(See /disks/fast/software/integration/src/esa/get_fa_seb1_c.pro)


GET_FA_SEB1_HDR

[Previous Routine] [Next Routine] [List of Routines]
 FUNCTION:
 	 GET_FA_SEB1_HDR

 DESCRIPTION:

	function to load FAST S-esa1 burst header data from the SDT program
 	shared memory buffers.

	At structure of the following format is returned:

	   DATA_NAME     STRING 'Sesa1_Burst_Packet_Hdr'; Data Quantity name
	   VALID         INT       1                   ; Data valid flag
 	   PROJECT_NAME  STRING    'FAST'              ; Project name
 	   UNITS_NAME    STRING    'Raw'               ; Units of this data
 	   VALUES_PROCEDURE  STRING 'sesa_unpack_hdr'  ; Name of proc to
                                                      ; get values from hdr
	   TIME          DOUBLE    8.0118726e+08       ; Start Time of sample
	   BYTES         BYTE      Array(44)	       ; Header bytes
	   INDEX         LONG	   idx		       ; index into data
	   
	
 CALLING SEQUENCE:

 	data = get_fa_seb1_hdr (time)

 ARGUMENTS:

	time 			This argument gives a time handle from which
				to take data from.  It may be either a string
				with the following possible formats:
					'YY-MM-DD/HH:MM:SS.MSC'  or
					'HH:MM:SS'     (use reference date)
				or a number, which will represent seconds
				since 1970 (must be a double > 94608000.D), or
				a hours from a reference time, if set.

				time will always be returned as a double
				representing the actual data time found in
				seconds since 1970.

 KEYWORDS:
	INDEX:			get data at this index.

 RETURN VALUE:

	Upon success, the above structure is returned, with the valid tag
	set to 1.  Upon failure, the valid tag will be 0.

 REVISION HISTORY:

	@(#)get_fa_seb1_hdr.pro	1.9 07/23/97
 	Originally written by Jonathan M. Loran,  University of 
 	California at Berkeley, Space Sciences Lab.   June '95

(See /disks/fast/software/integration/src/esa/get_fa_seb1_hdr.pro)


GET_FA_SEB1_TS

[Previous Routine] [Next Routine] [List of Routines]
 FUNCTION:
 	 GET_FA_SEB1_TS

 DESCRIPTION:


	function to load FAST S-esa 1 burst data from the SDT program shared
	memory buffers.  This is the time series version.  

	An array of npts structures of the following format are returned:

	   DATA_NAME     STRING    'Sesa1 Burst'       ; Data Quantity name
	   VALID         INT       1                   ; Data valid flag
 	   PROJECT_NAME  STRING    'FAST'              ; project name
 	   UNITS_NAME    STRING    'Counts'            ; Units of this data
 	   UNITS_PROCEDURE  STRING 'proc'              ; Units conversion proc
	   TIME          DOUBLE    8.0118726e+08       ; Start Time of sample
	   END_TIME      DOUBLE    7.9850884e+08       ; End time of sample
	   INTEG_T       DOUBLE    3.0000000           ; Integration time
	   NBINS         INT       nbins               ; Number of angle bins
	   NENERGY       INT       nnrgs               ; Number of energy bins
	   DATA          FLOAT     Array(nnrgs, nbins) ; Data qauantities
	   ENERGY        FLOAT     Array(nnrgs, nbins) ; Energy steps
	   THETA         FLOAT     Array(nnrgs, nbins) ; Angle for bins
	   GEOM          FLOAT     Array(nbins)        ; Geometry factor
	   DENERGY       FLOAT     Array(nnrgs, nbins) ; Energies for bins
	   DTHETA        FLOAT     Array(nbins)        ; Delta Theta
	   EFF           FLOAT     Array(nnrgs)        ; Efficiency (GF)
	   MASS          DOUBLE    5.68566e-6          ; Particle Mass
	   GEOMFACTOR    DOUBLE    0.000625            ; Bin GF
	   HEADER_BYTES  BYTE      Array(25)	       ; Header bytes
	   INDEX         LONG      index               ; Data index, this pt. 
	   ST_INDEX      LONG      st_idx              ; start index of arr
	   EN_INDEX      LONG      en_idx              ; end index of arr
	   NPTS          LONG      npts                ; array size
	
 CALLING SEQUENCE:
	data = get_fa_seb1_ts (t1, t2, [NPTS=npts], [START=st | EN=en | 
				PANF=panf | PANB=panb | IDXST=startidx], 
				CALIB=calib)
 ARGUMENTS:

	t1 			This argument gives the start time from
				which to take data, or, if START or EN keywords
				are non-zero, the length of time to take data.
				It may be either a string with the following
				possible formats:
					'YY-MM-DD/HH:MM:SS.MSC'  or
					'HH:MM:SS'     (use reference date)
				or a number, which will represent seconds
				since 1970 (must be a double > 94608000.D), or
				a hours from a reference time, if set.

				Time will always be returned as a double
				representing the actual data start time found 
				in seconds since 1970.

	t2			The same as time1, except it represents the
				end time.

				If the NPTS, START, EN, PANF or PANB keywords 
				are non-zero, THEN time2 will be ignored as an
				input paramter.

 KEYWORDS:

	CALIB			If non-zero, caclulate geometry
				factors for each bin instead of using 1.'s

	Data time selection is determined from the keywords as given in the 
	following truth table (NZ == non-zero):

 |ALL |NPTS |START| EN  |IDXST|PANF |PANB |selection            |use time1|use time2|
 |----|-----|-----|-----|-----|-----|-----|---------------------|---------|---------|
 | NZ |  0  |  0  |  0  |  0  |  0  |  0  | start -> end        |  X      |  X      |
 | 0  |  0  |  0  |  0  |  0  |  0  |  0  | time1 -> time2      |  X      |  X      |
 | 0  |  0  |  NZ |  0  |  0  |  0  |  0  | start -> time1 secs |  X      |         |
 | 0  |  0  |  0  |  NZ |  0  |  0  |  0  | end-time1 secs ->end|  X      |         |
 | 0  |  0  |  0  |  0  |  0  |  NZ |  0  | pan fwd from        |  X      |  X      |
 |    |     |     |     |     |     |     |   time1->time2      |         |         |
 | 0  |  0  |  0  |  0  |  0  |  0  |  NZ | pan back from       |  X      |  X      |
 |    |     |     |     |     |     |     |   time1->time2      |         |         |
 | 0  |  NZ |  0  |  0  |  0  |  0  |  0  | time1 -> time1+npts |  X      |         |
 | 0  |  NZ |  NZ |  0  |  0  |  0  |  0  | start -> start+npts |         |         |
 | 0  |  NZ |  0  |  NZ |  0  |  0  |  0  | end-npts -> end     |         |         |
 | 0  |  NZ |  0  |  0  |  NZ |  0  |  0  | st-index ->         |         |         |
 |    |     |     |     |     |     |     |   st_index + npts   |         |         |
	Any other combination of keywords is not allowed.

 RETURN VALUE:

	Upon success, the above structure is returned, with the valid tag
	set to 1.  Upon failure, the valid tag will be 0.

 REVISION HISTORY:

	@(#)get_fa_seb1_ts.pro	1.3 05/23/97
 	Originally written by Jonathan M. Loran,  University of 
 	California at Berkeley, Space Sciences Lab.   Apr '97

(See /disks/fast/software/integration/src/esa/get_fa_seb1_ts.pro)


GET_FA_SEB2

[Previous Routine] [Next Routine] [List of Routines]
 FUNCTION:
 	 GET_FA_SEB2

 DESCRIPTION:

	function to load FAST S-esa2 burst data from the SDT program shared
	memory buffers.

	A structure of the following format is returned:

	   DATA_NAME     STRING    'Sesa2 Burst'        ; Data Quantity name
	   VALID         INT       1                   ; Data valid flag
 	   PROJECT_NAME  STRING    'FAST'              ; project name
 	   UNITS_NAME    STRING    'Counts'            ; Units of this data
 	   UNITS_PROCEDURE  STRING 'proc'              ; Units conversion proc
	   TIME          DOUBLE    8.0118726e+08       ; Start Time of sample
	   END_TIME      DOUBLE    7.9850884e+08       ; End time of sample
	   INTEG_T       DOUBLE    3.0000000           ; Integration time
	   NBINS         INT       nbins               ; Number of angle bins
	   NENERGY       INT       nnrgs               ; Number of energy bins
	   DATA          FLOAT     Array(nnrgs, nbins) ; Data qauantities
	   ENERGY        FLOAT     Array(nnrgs, nbins) ; Energy steps
	   THETA         FLOAT     Array(nnrgs, nbins) ; Angle for bins
	   GEOM          FLOAT     Array(nbins)        ; Geometry factor
	   DENERGY       FLOAT     Array(nnrgs, nbins) ; Energies for bins
	   DTHETA        FLOAT     Array(nbins)        ; Delta Theta
	   EFF           FLOAT     Array(nnrgs)        ; Efficiency (GF)
	   MASS          DOUBLE    5.68566e-6          ; Particle Mass
	   GEOMFACTOR    DOUBLE    0.000625            ; Bin GF
	   HEADER_BYTES  BYTE      Array(25)	       ; Header bytes
	   INDEX         LONG      idx		       ; Index into sdt data
	
 CALLING SEQUENCE:

 	data = get_fa_seb2 (time, [START=start | EN=en | ADVANCE=advance |
				RETREAT=retreat])

 ARGUMENTS:

	time 			This argument gives a time handle from which
				to take data from.  It may be either a string
				with the following possible formats:
					'YY-MM-DD/HH:MM:SS.MSC'  or
					'HH:MM:SS'     (use reference date)
				or a number, which will represent seconds
				since 1970 (must be a double > 94608000.D), or
				a hours from a reference time, if set.

				time will always