This page was created by the IDL library routine `mk_html_help2`.

Last modified: Thu Sep 25 18:17:32 2025.

# Directory Listing of Routines

# projects/themis/spacecraft/particles/ESA/packet/functions

- AGYRO_3D_NEW
  Returns the agyrotropy, 2.(Pxx-Pyy)/(Pxx+Pyy)
- BETA_3D_NEW
  Returns beta, P/B^2/8pi, corrects for spacecraft potential if dat.sc_pot exists
- DJ_3D_NEW
  Returns the flux error due to statistics, [dJx,dJy,dJz], 1/(cm^2-s)
- DJE_3D_NEW
  Returns the energy flux error due to statistics, [dJEx,dJEy,dJEz], eV/(cm^2-s)
- DM_3D_NEW
  Returns the momentum tensor, [Mxx,Myy,Mzz,Mxy,Mxz,Myz], eV/cm^3
- DN_3D_NEW
  Returns the density error due to statistics, dn, 1/cm^3, corrects for spacecraft potential if dat.sc_pot exists
- DP_3D_NEW
  Returns the pressure error due to statistics, dp, eV/cm^3, corrects for spacecraft potential if dat.sc_pot exists, diagonalizes
- DV_3D_NEW
  Returns the velocity error due to statistics, [dVx,dVy,dVz], km/s
- EC_3D_NEW
  Returns the characteristic energy, Ec, eV
- GET_PA_SPEC3D
  Generates pitch angle vs. time spectrogram data structures for tplot
- J_3D_NEW
  Returns the flux, [Jx,Jy,Jz], 1/(cm^2-s)
- JE_3D_NEW
  Returns the energy flux, [JEx,JEy,JEz], ergs/(cm^2-s)
- JE_PAR_3D_NEW
  Returns the energy flux, [JEx,JEy,JEz], 1/(cm^2-s)
- JEO_3D_NEW
  Returns the omin directional energy flux, eV/(cm^2-s)
- JO_3D_NEW
  Returns the omin directional flux, 1/(cm^2-s)
- LD_3D_NEW
  Returns the debye length, m, corrects for spacecraft potential if dat.sc_pot exists
- M_3D_NEW
  Returns the momentum tensor, [Mxx,Myy,Mzz,Mxy,Mxz,Myz], eV/cm^3
- N_3D_NEW
  Returns the density, n, 1/cm^3, corrects for spacecraft potential if dat.sc_pot exists
- P_3D_NEW
  Returns the pressure tensor, [Pxx,Pyy,Pzz,Pxy,Pxz,Pyz], eV/cm^3
- SST_ATTEN
  Returns the attenuator value of the structure
- T_3D_NEW
  Returns the temperature, [Tx,Ty,Tz,Tavg], eV
- THM_ENERGY_TO_EBIN
  Returns the energy bin numbers in "dat.energy" nearest to "en"
- THM_GET_2DT
  To generate time series data for "tplot.pro"
- THM_GET_EN_SPEC
  Generates energy-time spectrogram data structures for tplot
- V_3D_NEW
  Returns the velocity, [Vx,Vy,Vz], km/s
- VC_3D_NEW
  Returns the characteristic velocity, Vc, km/s
- VPAR_3D_NEW
  Returns Vpar, km/s, corrects for spacecraft potential if dat.sc_pot exists
- VPERP_3D_NEW
  Returns Vperp, km/s, corrects for spacecraft potential if dat.sc_pot exists
- VXB_3D_NEW
  Returns VxB, mV/m, corrects for spacecraft potential if dat.sc_pot exists

# Routine Descriptions

## AGYRO_3D_NEW

[Next Routine] [List of Routines]

    FUNCTION:	agyro_3d_new(dat,ENERGY=en,ERANGE=er,EBINS=ebins,ANGLE=an,ARANGE=ar,BINS=bins)
    INPUT:
    	dat:	structure,	3d data structure filled by, for example, get_th?_peef.pro
    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,2),	optional, angle range for integration
    				theta min,max (0,0),(1,0) -90<theta<90
    				phi   min,max (0,1),(1,1)   0<phi<360
    	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 agyrotropy, 2.(Pxx-Pyy)/(Pxx+Pyy)
    NOTES:
    	Function normally called by "get_3dt" or "get_2dt" to
    	generate time series data for "tplot.pro".

    CREATED BY:
    	J.McFadden	00-2-24
    LAST MODIFICATION:

(See projects/themis/spacecraft/particles/ESA/packet/functions/agyro_3d_new.pro)

## BETA_3D_NEW

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

    FUNCTION:	beta_3d_new(dat,ENERGY=en,ERANGE=er,EBINS=ebins,ANGLE=an,ARANGE=ar,BINS=bins)
    INPUT:
    	dat:	structure,	3d data structure
    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,2),	optional, angle range for integration
    				theta min,max (0,0),(1,0) -90<theta<90
    				phi   min,max (0,1),(1,1)   0<phi<360
    	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 beta, P/B^2/8pi, corrects for spacecraft potential if dat.sc_pot exists
    NOTES:
    	Function normally called by "get_3dt" or "get_2dt" to
    	generate time series data for "tplot.pro".

    CREATED BY:
    	J.McFadden	07-4-29
    LAST MODIFICATION:

(See projects/themis/spacecraft/particles/ESA/packet/functions/beta_3d_new.pro)

## DJE_3D_NEW

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

    FUNCTION:	dje_3d_new(dat,ENERGY=en,ERANGE=er,EBINS=ebins,ANGLE=an,ARANGE=ar,BINS=bins)
    INPUT:
    	dat:	structure,	3d 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,2),	optional, angle range for integration
    				theta min,max (0,0),(1,0) -90<theta<90
    				phi   min,max (0,1),(1,1)   0<phi<360
    	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 energy flux error due to statistics, [dJEx,dJEy,dJEz], eV/(cm^2-s)
    NOTES:
    	Function normally called by "get_3dt" or "get_2dt" to
    	generate time series data for "tplot.pro".

    CREATED BY:
    	J.McFadden	10-03-14
    LAST MODIFICATION:

(See projects/themis/spacecraft/particles/ESA/packet/functions/dje_3d_new.pro)

## DJ_3D_NEW

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

    FUNCTION:	dj_3d_new(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,2),	optional, angle range for integration
    				theta min,max (0,0),(1,0) -90<theta<90
    				phi   min,max (0,1),(1,1)   0<phi<360
    	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 flux error due to statistics, [dJx,dJy,dJz], 1/(cm^2-s)
    NOTES:
    	Function normally called by "get_3dt" or "get_2dt" to
    	generate time series data for "tplot.pro".

    CREATED BY:
    	J.McFadden	10-03-13
    LAST MODIFICATION:

(See projects/themis/spacecraft/particles/ESA/packet/functions/dj_3d_new.pro)

## DM_3D_NEW

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

    FUNCTION:	dm_3d_new(dat,ENERGY=en,ERANGE=er,EBINS=ebins,ANGLE=an,ARANGE=ar,BINS=bins)
    INPUT:
    	dat:	structure,	3d data structure filled by themis routines get_th?_p???
    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,2),	optional, angle range for integration
    				theta min,max (0,0),(1,0) -90<theta<90
    				phi   min,max (0,1),(1,1)   0<phi<360
    	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 momentum tensor, [Mxx,Myy,Mzz,Mxy,Mxz,Myz], eV/cm^3
    NOTES:
    	Function normally called by "get_3dt" or "get_2dt" to
    	generate time series data for "tplot.pro".

    CREATED BY:
    	J.McFadden	10-03-13
    LAST MODIFICATION:

(See projects/themis/spacecraft/particles/ESA/packet/functions/dm_3d_new.pro)

## DN_3D_NEW

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

    FUNCTION:	dn_3d_new(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,2),	optional, angle range for integration
    				theta min,max (0,0),(1,0) -90<theta<90
    				phi   min,max (0,1),(1,1)   0<phi<360
    	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 density error due to statistics, dn, 1/cm^3, corrects for spacecraft potential if dat.sc_pot exists
    NOTES:
    	Function normally called by "get_3dt" or "get_2dt" to
    	generate time series data for "tplot.pro".

    CREATED BY:
    	J.McFadden	10-03-09
    LAST MODIFICATION:

(See projects/themis/spacecraft/particles/ESA/packet/functions/dn_3d_new.pro)

## DP_3D_NEW

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

    FUNCTION:	p_3d_new(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,2),	optional, angle range for integration
    				theta min,max (0,0),(1,0) -90<theta<90
    				phi   min,max (0,1),(1,1)   0<phi<360
    	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 pressure error due to statistics, dp, eV/cm^3, corrects for spacecraft potential if dat.sc_pot exists, diagonalizes
    NOTES:
    	Function normally called by "get_3dt" or "get_2dt" to
    	generate time series data for "tplot.pro".

    CREATED BY:
    	J.McFadden	00-2-24
    LAST MODIFICATION:
    	J.McFadden	05-2-8		Fixed diagonalization
    	J.McFadden	06-2-23		changed the s/c pot calculation to the same as n_2d_new.pro
    	J.McFadden	09-4-29		added a diagonalization to Pxx and Pyy to maximize difference

(See projects/themis/spacecraft/particles/ESA/packet/functions/dp_3d_new.pro)

## DV_3D_NEW

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

    FUNCTION:	dv_3d_new(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,2),	optional, angle range for integration
    				theta min,max (0,0),(1,0) -90<theta<90
    				phi   min,max (0,1),(1,1)   0<phi<360
    	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 velocity error due to statistics, [dVx,dVy,dVz], km/s
    NOTES:
    	Function normally called by "get_3dt" or "get_2dt" to
    	generate time series data for "tplot.pro".

    CREATED BY:
    	J.McFadden	10-03-13
    LAST MODIFICATION:

(See projects/themis/spacecraft/particles/ESA/packet/functions/dv_3d_new.pro)

## EC_3D_NEW

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

    FUNCTION:	ec_3d_new((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 jo_3d.pro and jeo_3d.pro
    	Function normally called by "get_2dt.pro" to generate
    	time series data for "tplot.pro".

    CREATED BY:
    	J.McFadden	09-06-11
    LAST MODIFICATION:

(See projects/themis/spacecraft/particles/ESA/packet/functions/ec_3d_new.pro)

## GET_PA_SPEC3D

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

    PROCEDURE:	get_pa_spec3d
    PURPOSE:
    	Generates pitch angle vs. time spectrogram data structures for tplot
    INPUT:
    	get_dat, 	a string that defines the 'routine' that returns a 2D or 3D data structure
    			if 'probe' keyword set, assumes routine = get_dat
    			if 'probe' keyword is not set, assumes routine = 'get_'+ get_dat
    				unless get_dat already includes 'get_', in which case routine = get_dat
    			for example, get_dat='thc_peir' then routine = 'get_thc_peir'
    			for example, get_dat='thm_sst_pser' then routine = 'thm_sst_pser'

    KEYWORDS:
    	T1:		start time, seconds since 1970
    	T2:		end time, seconds since 1970
    	ENERGY:		fltarr(2)		energy range to sum over
    	ERANGE:		intarr(2)		energy bin range to sum over
    	EBINS:		bytarr(dat.nenergy)	energy 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
    	EWEIGHT		Weights the energy bin average by bin energy width.
    	SHIFT90		If set true, pitch angle range is -90 to 270

    CREATED BY:	J.McFadden	  08-07-07
    VERSION:	1
    LAST MODIFICATION:  09-01-
    MOD HISTORY:
    		09-01-08	bkg keyword changed to work for Themis electron sst
    		09-01-08	probe keyword added for themis sst routines
    		09-01-08	changed loop to use index to allow for dat.valid=0 data in stored data
    		09-01-08	calib keyword no longer passed to routine

    NOTES:
    	Modified from get_pa_spec.pro used for 2-D data structures for FAST or Cluster/PEACE
    	get_pa_spec3d.pro converts 3-D data structures two 2D pitch angle data

(See projects/themis/spacecraft/particles/ESA/packet/functions/get_pa_spec3d.pro)

## JEO_3D_NEW

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

    FUNCTION:	jeo_3d_new(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,2),	optional, angle range for integration
    				theta min,max (0,0),(1,0) -90<theta<90
    				phi   min,max (0,1),(1,1)   0<phi<360
    	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 omin directional energy flux,  eV/(cm^2-s)
    NOTES:
    	Function normally called by "get_3dt" or "get_2dt" to
    	generate time series data for "tplot.pro".

    CREATED BY:
    	J.McFadden	09-06-11
    LAST MODIFICATION:
    	J.McFadden	09-06-18	calculates domega, no longer requires dat.domega to exist

(See projects/themis/spacecraft/particles/ESA/packet/functions/jeo_3d_new.pro)

## JE_3D_NEW

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

    FUNCTION:	je_3d_new(dat,ENERGY=en,ERANGE=er,EBINS=ebins,ANGLE=an,ARANGE=ar,BINS=bins)
    INPUT:
    	dat:	structure,	3d 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,2),	optional, angle range for integration
    				theta min,max (0,0),(1,0) -90<theta<90
    				phi   min,max (0,1),(1,1)   0<phi<360
    	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 energy flux, [JEx,JEy,JEz], ergs/(cm^2-s)
    NOTES:
    	Function normally called by "get_3dt" or "get_2dt" to
    	generate time series data for "tplot.pro".

    CREATED BY:
    	J.McFadden	02-9-13
    LAST MODIFICATION:
    	J.McFadden 	10-03-13	for e-, throws away bin contaminated by photo-e
    	J.McFadden 	10-03-13	for e-, extrapolates to fill in distribution at low energies, for i+ throws away low energy bins as s/c potential grows
    	J.McFadden 	10-03-13	for e-, allows choice of log or linear extrapolation

(See projects/themis/spacecraft/particles/ESA/packet/functions/je_3d_new.pro)

## JE_PAR_3D_NEW

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

    FUNCTION:	je_3d_new(dat,ENERGY=en,ERANGE=er,EBINS=ebins,ANGLE=an,ARANGE=ar,BINS=bins)
    INPUT:
    	dat:	structure,	3d 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,2),	optional, angle range for integration
    				theta min,max (0,0),(1,0) -90<theta<90
    				phi   min,max (0,1),(1,1)   0<phi<360
    	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 energy flux, [JEx,JEy,JEz], 1/(cm^2-s)
    NOTES:
    	Function normally called by "get_3dt" or "get_2dt" to
    	generate time series data for "tplot.pro".

    CREATED BY:
    	J.McFadden	02-9-13
    LAST MODIFICATION:

(See projects/themis/spacecraft/particles/ESA/packet/functions/je_par_3d_new.pro)

## JO_3D_NEW

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

    FUNCTION:	jo_3d_new(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,2),	optional, angle range for integration
    				theta min,max (0,0),(1,0) -90<theta<90
    				phi   min,max (0,1),(1,1)   0<phi<360
    	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 omin directional flux,  1/(cm^2-s)
    NOTES:
    	Function normally called by "get_3dt" or "get_2dt" to
    	generate time series data for "tplot.pro".

    CREATED BY:
    	J.McFadden	07-09-06
    LAST MODIFICATION:
    	J.McFadden	09-06-18	calculates domega, no longer requires dat.domega to exist

(See projects/themis/spacecraft/particles/ESA/packet/functions/jo_3d_new.pro)

## J_3D_NEW

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

    FUNCTION:	j_3d_new(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,2),	optional, angle range for integration
    				theta min,max (0,0),(1,0) -90<theta<90
    				phi   min,max (0,1),(1,1)   0<phi<360
    	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 flux, [Jx,Jy,Jz], 1/(cm^2-s)
    NOTES:
    	Function normally called by "get_3dt" or "get_2dt" to
    	generate time series data for "tplot.pro".

    CREATED BY:
    	J.McFadden	00-2-24
    LAST MODIFICATION:
    	J.McFadden 	10-03-13	for e-, throws away bin contaminated by photo-e
    	J.McFadden 	10-03-13	for e-, extrapolates to fill in distribution at low energies, for i+ throws away low energy bins as s/c potential grows
    	J.McFadden 	10-03-13	for e-, allows choice of log or linear extrapolation

(See projects/themis/spacecraft/particles/ESA/packet/functions/j_3d_new.pro)

## LD_3D_NEW

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

    FUNCTION:	ld_3d_new(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,2),	optional, angle range for integration
    				theta min,max (0,0),(1,0) -90<theta<90
    				phi   min,max (0,1),(1,1)   0<phi<360
    	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 debye length, m, corrects for spacecraft potential if dat.sc_pot exists
    NOTES:
    	Function normally called by "get_3dt" or "get_2dt" to
    	generate time series data for "tplot.pro".

    CREATED BY:
    	J.McFadden	07-11-28
    LAST MODIFICATION:

(See projects/themis/spacecraft/particles/ESA/packet/functions/ld_3d_new.pro)

## M_3D_NEW

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

    FUNCTION:	m_3d_new(dat,ENERGY=en,ERANGE=er,EBINS=ebins,ANGLE=an,ARANGE=ar,BINS=bins)
    INPUT:
    	dat:	structure,	3d data structure filled by themis routines get_th?_p???
    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,2),	optional, angle range for integration
    				theta min,max (0,0),(1,0) -90<theta<90
    				phi   min,max (0,1),(1,1)   0<phi<360
    	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 momentum tensor, [Mxx,Myy,Mzz,Mxy,Mxz,Myz], eV/cm^3
    NOTES:
    	Function normally called by "get_3dt" or "get_2dt" to
    	generate time series data for "tplot.pro".

    CREATED BY:
    	J.McFadden	08-7-21
    LAST MODIFICATION:
    	J.McFadden 	10-03-13	for e-, throws away bin contaminated by photo-e
    	J.McFadden 	10-03-13	for e-, extrapolates to fill in distribution at low energies, for i+ throws away low energy bins as s/c potential grows
    	J.McFadden 	10-03-13	for e-, allows choice of log or linear extrapolation

(See projects/themis/spacecraft/particles/ESA/packet/functions/m_3d_new.pro)

## N_3D_NEW

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

    FUNCTION:	n_3d_new(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,2),	optional, angle range for integration
    				theta min,max (0,0),(1,0) -90<theta<90
    				phi   min,max (0,1),(1,1)   0<phi<360
    	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 density, n, 1/cm^3, corrects for spacecraft potential if dat.sc_pot exists
    NOTES:
    	Function normally called by "get_3dt" or "get_2dt" to
    	generate time series data for "tplot.pro".

    CREATED BY:
    	J.McFadden	00-2-24
    LAST MODIFICATION:
    	J.McFadden 	09-06-12	for e-, throws away bin contaminated by photo-e
    	J.McFadden 	09-06-13	for e-, extrapolates to fill in distribution at low energies, for i+ throws away low energy bins as s/c potential grows
    	J.McFadden 	10-02-26	for e-, allows choice of log or linear extrapolation

(See projects/themis/spacecraft/particles/ESA/packet/functions/n_3d_new.pro)

## P_3D_NEW

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

    FUNCTION:	p_3d_new(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,2),	optional, angle range for integration
    				theta min,max (0,0),(1,0) -90<theta<90
    				phi   min,max (0,1),(1,1)   0<phi<360
    	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 pressure tensor, [Pxx,Pyy,Pzz,Pxy,Pxz,Pyz], eV/cm^3
    NOTES:
    	Function normally called by "get_3dt" or "get_2dt" to
    	generate time series data for "tplot.pro".

    CREATED BY:
    	J.McFadden	00-2-24
    LAST MODIFICATION:
    	J.McFadden	05-2-8		Fixed diagonalization
    	J.McFadden	06-2-23		changed the s/c pot calculation to the same as n_2d_new.pro
    	J.McFadden	09-4-29		added a diagonalization to Pxx and Pyy to maximize difference

(See projects/themis/spacecraft/particles/ESA/packet/functions/p_3d_new.pro)

## SST_ATTEN

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

    FUNCTION:	sst_atten(dat)
    INPUT:
    	dat:	structure,	data structure filled by thm_sst_ps**
    KEYWORDS
    					0,1=exclude,include
    PURPOSE:
    	Returns the attenuator value of the structure
    NOTES:

    CREATED BY:
    	J.McFadden	09-01-06
    LAST MODIFICATION:

(See projects/themis/spacecraft/particles/ESA/packet/functions/sst_atten.pro)

## THM_ENERGY_TO_EBIN

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

    FUNCTION:	thm_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
     2014-06-30: Adding thm prefix to differentiate from identically named FAST routines

    $LastChangedBy: aaflores $
    $LastChangedDate: 2014-06-30 18:58:14 -0700 (Mon, 30 Jun 2014) $
    $LastChangedRevision: 15492 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/projects/themis/spacecraft/particles/ESA/packet/functions/thm_energy_to_ebin.pro $

(See projects/themis/spacecraft/particles/ESA/packet/functions/thm_energy_to_ebin.pro)

## THM_GET_2DT

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

    PROGRAM:	thm_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, 	a string that defines the 'routine' that returns a 2D or 3D data structure
    			if 'probe' keyword set, assumes routine = get_dat
    			if 'probe' keyword is not set, assumes routine = 'get_'+ get_dat
    				unless get_dat already includes 'get_', in which case routine = get_dat
    			for example, get_dat='thc_peir' then routine = 'get_thc_peir'
    			for example, get_dat='thm_sst_pser' then routine = 'thm_sst_pser'

    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 -- no longer used
    	PROBE:		probe keyword passed on to get_dat -- used by themis sst routines

    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
    		08/07/10	bkg keyword changed to work for Themis ion ESA
    		08/12/31	bkg keyword changed to work for Themis electron sst
    		08/12/31	added probe keyword for themis sst calls
    		09/01/05	changed loop to use index to allow for dat.valid=0 data in stored data
    		09/01/05	calib keyword no longer passed to routine
    		09/04/16	bkg keyword removed for Themis electron sst, assume bkg removal is part of get_th?_pse?
     2014/06/30  Adding thm prefix to differentiate from identically named FAST routines
     2016/06/30  minor changes for spedas compatibility

    NOTES:

    $LastChangedBy: aaflores $
    $LastChangedDate: 2016-06-30 16:57:15 -0700 (Thu, 30 Jun 2016) $
    $LastChangedRevision: 21412 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/projects/themis/spacecraft/particles/ESA/packet/functions/thm_get_2dt.pro $

(See projects/themis/spacecraft/particles/ESA/packet/functions/thm_get_2dt.pro)

## THM_GET_EN_SPEC

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

    PROCEDURE:	thm_get_en_spec
    PURPOSE:
    	Generates energy-time spectrogram data structures for tplot
    INPUT:
    	get_dat, 	a string that defines the 'routine' that returns a 2D or 3D data structure
    			if 'probe' keyword set, assumes routine = get_dat
    			if 'probe' keyword is not set, assumes routine = 'get_'+ get_dat
    				unless get_dat already includes 'get_', in which case routine = get_dat
    			for example, get_dat='thc_peir' then routine = 'get_thc_peir'
    			for example, get_dat='thm_sst_pser' then routine = 'thm_sst_pser'

    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, default = get_dat + '_en_spec'
    	BKG:  		A 3d data structure containing the background counts
    			If bkg=1, it will run themis background subtraction routine
    	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_dat -- no longer used
    	PROBE:		probe keyword passed on to get_dat -- used by themis sst routines

    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
    		08/07/10	bkg keyword changed to work for Themis ion ESA
    		08/07/10	averaging routine changed to weight different angle bins by dat.gf
    		08/12/31	bkg keyword changed to work for Themis electron sst
    		08/12/31	probe keyword added for themis sst routines
    		09/01/05	changed loop to use index to allow for dat.valid=0 data in stored data
    		09/01/05	calib keyword no longer passed to routine
    		09/04/16	bkg keyword removed for Themis electron sst, assume bkg removal is part of get_th?_pse?
     2014/06/30  Adding thm prefix to differentiate from identically named FAST routines
     2016/06/30  re-enabling time range constraints, minor changes for spedas compatibility

    NOTES:
    	Current version only works for FAST and THEMIS

(See projects/themis/spacecraft/particles/ESA/packet/functions/thm_get_en_spec.pro)

## T_3D_NEW

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

    FUNCTION:	t_3d_new(dat,ENERGY=en,ERANGE=er,EBINS=ebins,ANGLE=an,ARANGE=ar,BINS=bins)
    INPUT:
    	dat:	structure,	3d 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,2),	optional, angle range for integration
    				theta min,max (0,0),(1,0) -90<theta<90
    				phi   min,max (0,1),(1,1)   0<phi<360
    	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 temperature, [Tx,Ty,Tz,Tavg], eV
    NOTES:
    	Function normally called by "get_3dt" or "get_2dt" to
    	generate time series data for "tplot.pro".

    CREATED BY:
    	J.McFadden	00-2-24
    LAST MODIFICATION:

(See projects/themis/spacecraft/particles/ESA/packet/functions/t_3d_new.pro)

## VC_3D_NEW

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

    FUNCTION:	vc_3d_new((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 velocity, Vc, km/s
    NOTES:
    	Function calls jo_3d_new.pro and n_3d_new.pro
    	Function normally called by "get_2dt.pro" to generate
    	time series data for "tplot.pro".

    CREATED BY:
    	J.McFadden	09-06-18
    LAST MODIFICATION:

(See projects/themis/spacecraft/particles/ESA/packet/functions/vc_3d_new.pro)

## VPAR_3D_NEW

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

    FUNCTION:	vpar_3d_new(dat,ENERGY=en,ERANGE=er,EBINS=ebins,ANGLE=an,ARANGE=ar,BINS=bins)
    INPUT:
    	dat:	structure,	3d data structure
    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,2),	optional, angle range for integration
    				theta min,max (0,0),(1,0) -90<theta<90
    				phi   min,max (0,1),(1,1)   0<phi<360
    	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 Vpar, km/s, corrects for spacecraft potential if dat.sc_pot exists
    NOTES:
    	Function normally called by "get_3dt" or "get_2dt" to
    	generate time series data for "tplot.pro".

    CREATED BY:
    	J.McFadden	07-6-05
    LAST MODIFICATION:

(See projects/themis/spacecraft/particles/ESA/packet/functions/vpar_3d_new.pro)

## VPERP_3D_NEW

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

    FUNCTION:	vperp_3d_new(dat,ENERGY=en,ERANGE=er,EBINS=ebins,ANGLE=an,ARANGE=ar,BINS=bins)
    INPUT:
    	dat:	structure,	3d data structure
    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,2),	optional, angle range for integration
    				theta min,max (0,0),(1,0) -90<theta<90
    				phi   min,max (0,1),(1,1)   0<phi<360
    	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 Vperp, km/s, corrects for spacecraft potential if dat.sc_pot exists
    NOTES:
    	Function normally called by "get_3dt" or "get_2dt" to
    	generate time series data for "tplot.pro".

    CREATED BY:
    	J.McFadden	07-6-05
    LAST MODIFICATION:

(See projects/themis/spacecraft/particles/ESA/packet/functions/vperp_3d_new.pro)

## VXB_3D_NEW

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

    FUNCTION:	vxb_3d_new(dat,ENERGY=en,ERANGE=er,EBINS=ebins,ANGLE=an,ARANGE=ar,BINS=bins)
    INPUT:
    	dat:	structure,	3d data structure
    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,2),	optional, angle range for integration
    				theta min,max (0,0),(1,0) -90<theta<90
    				phi   min,max (0,1),(1,1)   0<phi<360
    	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 VxB, mV/m, corrects for spacecraft potential if dat.sc_pot exists
    NOTES:
    	Function normally called by "get_3dt" or "get_2dt" to
    	generate time series data for "tplot.pro".

    CREATED BY:
    	J.McFadden	07-4-29
    LAST MODIFICATION:

(See projects/themis/spacecraft/particles/ESA/packet/functions/vxb_3d_new.pro)

## V_3D_NEW

[Previous Routine] [List of Routines]

    FUNCTION:	v_3d_new(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,2),	optional, angle range for integration
    				theta min,max (0,0),(1,0) -90<theta<90
    				phi   min,max (0,1),(1,1)   0<phi<360
    	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 velocity, [Vx,Vy,Vz], km/s
    NOTES:
    	Function normally called by "get_3dt" or "get_2dt" to
    	generate time series data for "tplot.pro".

    CREATED BY:
    	J.McFadden	02-8-28
    LAST MODIFICATION:

(See projects/themis/spacecraft/particles/ESA/packet/functions/v_3d_new.pro)