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

Last modified: Tue Oct 28 18:16:50 2025.

# Directory Listing of Routines

# general/missions/fast/fa_esa/l2util

- FA_ESA_CMN_CONCAT
  concatenates two FAST ESA L2 data structures
- FA_ESA_CMN_L2GEN.PRO
  turn a FAST ESA common block into a L2 CDF.
- FA_ESA_CMN_L2READ
  Reads an L2 file and fills a common block structure.
- FA_ESA_CMN_L2VARARR
  Returns an array with common block variable names for the input
- FA_ESA_CMN_TCLIP
  applies a trange to a FAST ESA L2 structure
- FA_ESA_CURRENT_SW_VERSION
  Records the current FAST ESA SW version number
- FA_ESA_DOMEGA
  creates a pitch angle array for FAST ESA data;
- FA_ESA_ENERGY[1]
  creates an energy angle array for FAST ESA data;
- FA_ESA_ENERGY_ARRAY
  creates an energy angle array for FAST ESA data;
- FA_ESA_ENERGY[2]
- FA_ESA_L2_CRIB
  Crib for loading FAST ESA L2 data
- FA_ESA_L2_EDIST
  Create FAST ESA energy spectrum, from L2 input
- FA_ESA_L2_PAD
  Create FAST ESA pitch angle spectrum, from L2 input
- FA_ESA_L2_TPLOT
  Create FAST ESA tplot variables, from L2 input
- FA_ESA_L2CREATE
  Creates an L2 data structure from l1 data
- FA_ESA_L2GEN
  Generates FAST ESA L2 files
- FA_ESA_LOAD_L2
  Loads FAST ESA L2 data for a given file(s), or time_range, or orbit range
- FA_ESA_PA[1]
  creates a pitch angle array for FAST ESA data;
- FA_ESA_PA_ARRAY
  creates a pitch angle array for FAST ESA data;
- FA_ESA_PA[2]

# Routine Descriptions

## FA_ESA_CMN_CONCAT

[Next Routine] [List of Routines]

    NAME:
     fa_esa_cmn_concat
    PURPOSE:
     concatenates two FAST ESA L2 data structures
    CALLING SEQUENCE:
     dat = fa_esa_cmn_concat(dat1, dat2)
    INPUT:
     dat1, dat2 = two FAST ESA data structures: e.g.,
       PROJECT_NAME    STRING    'FAST'
       DATA_NAME       STRING    'Iesa Burst'
       DATA_LEVEL      STRING    'Level 1'
       UNITS_NAME      STRING    'Compressed'
       UNITS_PROCEDURE STRING    'fa_convert_esa_units'
       VALID           INT       Array[59832]
       DATA_QUALITY    BYTE      Array[59832]
       TIME            DOUBLE    Array[59832]
       END_TIME        DOUBLE    Array[59832]
       INTEG_T         DOUBLE    Array[59832]
       DELTA_T         DOUBLE    Array[59832]
       NBINS           BYTE      Array[59832]
       NENERGY         BYTE      Array[59832]
       GEOM_FACTOR     FLOAT     Array[59832]
       DATA_IND        LONG      Array[59832]
       GF_IND          INT       Array[59832]
       BINS_IND        INT       Array[59832]
       MODE_IND        BYTE      Array[59832]
       THETA_SHIFT     FLOAT     Array[59832]
       THETA_MAX       FLOAT     Array[59832]
       THETA_MIN       FLOAT     Array[59832]
       BKG             FLOAT     Array[59832]
       ENERGY          FLOAT     Array[96, 32, 2]
       BINS            BYTE      Array[96, 32]
       THETA           FLOAT     Array[96, 32, 2]
       GF              FLOAT     Array[96, 64]
       DENERGY         FLOAT     Array[96, 32, 2]
       DTHETA          FLOAT     Array[96, 32, 2]
       EFF             FLOAT     Array[96, 32, 2]
       DEAD            FLOAT       1.10000e-07
       MASS            FLOAT         0.0104389
       CHARGE          INT              1
       SC_POT          FLOAT     Array[59832]
       BKG_ARR         FLOAT     Array[96, 64]
       HEADER_BYTES    BYTE      Array[44, 59832]
       DATA            BYTE      Array[59832, 96, 64]
       EFLUX           FLOAT     Array[59832, 96, 64]
       ENERGY_FULL     FLOAT     Array[59832, 96, 64]
       DENERGY_FULL    FLOAT     Array[59832, 96, 64]
       PITCH_ANGLE     FLOAT     Array[59832, 96, 64]
       DOMEGA          FLOAT     Array[59832, 96, 64]
       ORBIT_START     LONG
       ORBIT_END       LONG
    ;OUTPUT:
     dat = a single structure concatenated
    HISTORY:
     19-may-2014, jmm, jimm@ssl.berkeley.edu
     $LastChangedBy: jimm $
     $LastChangedDate: 2016-09-09 11:43:35 -0700 (Fri, 09 Sep 2016) $
     $LastChangedRevision: 21811 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/general/missions/fast/fa_esa/l2util/fa_esa_cmn_concat.pro $

(See general/missions/fast/fa_esa/l2util/fa_esa_cmn_concat.pro)

## FA_ESA_CMN_L2GEN.PRO

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

    NAME:
     fa_esa_cmn_l2gen.pro
    PURPOSE:
     turn a FAST ESA common block into a L2 CDF.
    CALLING SEQUENCE:
     fa_esa_cmn_l2gen, cmn_dat
    INPUT:
     cmn_dat = a structrue with the data:
       PROJECT_NAME    STRING    'FAST'
       DATA_NAME       STRING    'Iesa Burst'
       DATA_LEVEL      STRING    'Level 1'
       UNITS_NAME      STRING    'Compressed'
       UNITS_PROCEDURE STRING    'fa_convert_esa_units'
       VALID           INT       Array[59832]
       DATA_QUALITY    BYTE      Array[59832]
       TIME            DOUBLE    Array[59832]
       END_TIME        DOUBLE    Array[59832]
       INTEG_T         DOUBLE    Array[59832]
       DELTA_T         DOUBLE    Array[59832]
       NBINS           BYTE      Array[59832]
       NENERGY         BYTE      Array[59832]
       GEOM_FACTOR     FLOAT     Array[59832]
       DATA_IND        LONG      Array[59832]
       GF_IND          INT       Array[59832]
       BINS_IND        INT       Array[59832]
       MODE_IND        BYTE      Array[59832]
       THETA_SHIFT     FLOAT     Array[59832]
       THETA_MAX       FLOAT     Array[59832]
       THETA_MIN       FLOAT     Array[59832]
       BKG             FLOAT     Array[59832]
       DATA0           BYTE      Array[48, 32, 59832]
       DATA1           FLOAT     NaN (48, 64, ntimes) (here single NaN means no data)
       DATA2           FLOAT     NaN (96, 32, ntimes)
       ENERGY          FLOAT     Array[96, 32, 2]
       BINS            BYTE      Array[96, 32]
       THETA           FLOAT     Array[96, 32, 2]
       GF              FLOAT     Array[96, 64]
       DENERGY         FLOAT     Array[96, 32, 2]
       DTHETA          FLOAT     Array[96, 32, 2]
       EFF             FLOAT     Array[96, 32, 2]
       DEAD            FLOAT       1.10000e-07
       MASS            FLOAT         0.0104389
       CHARGE          INT              1
       SC_POT          FLOAT     Array[59832]
       BKG_ARR         FLOAT     Array[96, 64]
       HEADER_BYTES    BYTE      Array[44, 59832]
       DATA            BYTE      Array[59832, 96, 64]
       EFLUX           FLOAT     Array[59832, 96, 64]
       ENERGY_FULL     FLOAT     Array[59832, 96, 64]
       DENERGY_FULL    FLOAT     Array[59832, 96, 64]
       PITCH_ANGLE     FLOAT     Array[59832, 96, 64]
       DOMEGA          FLOAT     Array[59832, 96, 64]
    KEYWORDS:
     otp_struct = this is the structure that is passed into
                  cdf_save_vars to create the file
     directory = Set this keyword to direct the output into this
                 directory; the default is './'
     fullfile_out = the output filename
    HISTORY:
     Hacked from mvn_sta_cmn_l2gen.pro, 22-jul-2015
     SOme chages for version 2, jmm, 2021-09-28
     $LastChangedBy: jimm $
     $LastChangedDate: 2021-10-11 13:27:22 -0700 (Mon, 11 Oct 2021) $
     $LastChangedRevision: 30348 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/general/missions/fast/fa_esa/l2util/fa_esa_cmn_l2gen.pro $

(See general/missions/fast/fa_esa/l2util/fa_esa_cmn_l2gen.pro)

## FA_ESA_CMN_L2READ

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

    NAME:
     fa_esa_cmn_l2read
    PURPOSE:
     Reads an L2 file and fills a common block structure.
    CALLING SEQUENCE:
     cmn_dat = fa_esa_cmn_l2read(filename, trange = trange)
    INPUT:
     filename = the input filename
    OUTPUT:
     cmn_dat = a structrue with the data:
     tags are:
       PROJECT_NAME    STRING    'FAST'
       DATA_NAME       STRING    'Iesa Burst'
       DATA_LEVEL      STRING    'Level 1'
       UNITS_NAME      STRING    'Compressed'
       UNITS_PROCEDURE STRING    'fa_convert_esa_units'
       VALID           INT       Array[59832]
       DATA_QUALITY    BYTE      Array[59832]
       TIME            DOUBLE    Array[59832]
       END_TIME        DOUBLE    Array[59832]
       INTEG_T         DOUBLE    Array[59832]
       DELTA_T         DOUBLE    Array[59832]
       NBINS           BYTE      Array[59832]
       NENERGY         BYTE      Array[59832]
       GEOM_FACTOR     FLOAT     Array[59832]
       DATA_IND        LONG      Array[59832]
       GF_IND          INT       Array[59832]
       BINS_IND        INT       Array[59832]
       MODE_IND        BYTE      Array[59832]
       THETA_SHIFT     FLOAT     Array[59832]
       THETA_MAX       FLOAT     Array[59832]
       THETA_MIN       FLOAT     Array[59832]
       BKG             FLOAT     Array[59832]
       ENERGY          FLOAT     Array[96, 32, 2]
       BINS            BYTE      Array[96, 32]
       THETA           FLOAT     Array[96, 32, 2]
       GF              FLOAT     Array[96, 64]
       DENERGY         FLOAT     Array[96, 32, 2]
       DTHETA          FLOAT     Array[96, 32, 2]
       EFF             FLOAT     Array[96, 32, 2]
       DEAD            FLOAT       1.10000e-07
       MASS            FLOAT         0.0104389
       CHARGE          INT              1
       SC_POT          FLOAT     Array[59832]
       BKG_ARR         FLOAT     Array[96, 64]
       HEADER_BYTES    BYTE      Array[44, 59832]
       DATA            BYTE      Array[59832, 96, 64]
       EFLUX           FLOAT     Array[59832, 96, 64]
       ENERGY_FULL     FLOAT     Array[59832, 96, 64]
       DENERGY_FULL    FLOAT     Array[59832, 96, 64]
       PITCH_ANGLE     FLOAT     Array[59832, 96, 64]
       DOMEGA          FLOAT     Array[59832, 96, 64]
       ORBIT_START     LONG
       ORBIT_END       LONG
    KEYWORDS:
     trange = if set, then only input data for that time range, the first
              step would be to input the record times and then obtain a
              record range to input.
     cdf_info = the full structure from CDF_LOAD_VARS, not everything in
                here ends up in the structure for the common blocks
    HISTORY:
     2014-05-12, jmm, jimm@ssl.berkeley.edu
     $LastChangedBy: jimm $
     $LastChangedDate: 2016-03-28 15:56:35 -0700 (Mon, 28 Mar 2016) $
     $LastChangedRevision: 20609 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/general/missions/fast/fa_esa/l2util/fa_esa_cmn_l2read.pro $

(See general/missions/fast/fa_esa/l2util/fa_esa_cmn_l2read.pro)

## FA_ESA_CMN_L2VARARR

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

    NAME:
     fa_esa_cmn_l2vararr
    PURPOSE:
     Returns an array with common block variable names for the input
     data_name.
    CALLING SEQUENCE:
     vars = fa_esa_cmn_l2vararr(data_name)
    INPUT:
     data_name = the data_name for the data type; It turns out that this
                 is unused since all of the L2 structures have the same
                 variables
    OUTPUT:
     vars = a 3, N array with common block variable names for the input
     data_name, with three columns, one is the common block name, the second is
     the name in the CDF file, the third is 'Y' or 'N' for record
     variance.
    HISTORY:
     1-sep-2015, jmm, Hacked from mvn_sta_cmn_l2vararr
     $LastChangedBy: jimm $
     $LastChangedDate: 2016-03-08 14:31:52 -0800 (Tue, 08 Mar 2016) $
     $LastChangedRevision: 20352 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/general/missions/fast/fa_esa/l2util/fa_esa_cmn_l2vararr.pro $

(See general/missions/fast/fa_esa/l2util/fa_esa_cmn_l2vararr.pro)

## FA_ESA_CMN_TCLIP

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

    NAME:
     fa_esa_cmn_tclip
    PURPOSE:
     applies a trange to a FAST ESA L2 structure
    CALLING SEQUENCE:
     dat = fa_esa_cmn_tclip(dat, trange)
    INPUT:
     dat1 = a FAST ESA data structure: e.g.,
    OUTPUT:
     dat = structure with data only in the input time range
    NOTES:
     Only will work if the record varying arrays are 5D or less
    HISTORY:
     19-may-2014, jmm, jimm@ssl.berkeley.edu
     $LastChangedBy: jimm $
     $LastChangedDate: 2015-09-01 16:30:31 -0700 (Tue, 01 Sep 2015) $
     $LastChangedRevision: 18687 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/general/missions/fast/fa_esa/l2util/fa_esa_cmn_tclip.pro $

(See general/missions/fast/fa_esa/l2util/fa_esa_cmn_tclip.pro)

## FA_ESA_CURRENT_SW_VERSION

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

    NAME:
     fa_esa_current_sw_version
    PURPOSE:
     Records the current FAST ESA SW version number
    CALLING SEQUENCE:
     version = fa_esa_current_sw_version()
    HISTORY:
     2015-07-23
     $LastChangedBy: jimm $
     $LastChangedDate: 2021-10-11 12:39:20 -0700 (Mon, 11 Oct 2021) $
     $LastChangedRevision: 30347 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/general/missions/fast/fa_esa/l2util/fa_esa_current_sw_version.pro $

(See general/missions/fast/fa_esa/l2util/fa_esa_current_sw_version.pro)

## FA_ESA_DOMEGA

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

    NAME:
     fa_esa_domega
    PURPOSE:
     creates a pitch angle array for FAST ESA data;
    CALLING SEQUENCE:
     pa = fa_esa_domega(theta, theta_shift, mode_ind)
    INPUT:
     theta = an array of (96, 64, 2 or 3) of angle values
     dtheta = an array of (96, 64, 2 or 3) of dtheta values
     mode = 0, 1 (or 2) the mode index used to get the correct value of
                   dtheta to apply for each time interval
    KEYWORDS:
     domega_modes = the solid angle, domega for the different modes, this
                    will have the same dimensions as the input dtheta.
    HISTORY:
     2015-02-09, hacked from fa_esa_pa, p_2d_new, jmm, jimm@ssl.berkeley.edu
     $LastChangedBy: jimm $
     $LastChangedDate: 2016-02-09 14:01:24 -0800 (Tue, 09 Feb 2016) $
     $LastChangedRevision: 19919 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/general/missions/fast/fa_esa/l2util/fa_esa_domega.pro $

(See general/missions/fast/fa_esa/l2util/fa_esa_domega.pro)

## FA_ESA_ENERGY[1]

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

    NAME:
     fa_esa_energy
    PURPOSE:
     creates an energy angle array for FAST ESA data;
    CALLING SEQUENCE:
     pa = fa_esa_energy_array(energy, mode_ind)
    INPUT:
     energy = an array of (96, 64, 2 or 3) of energies
     mode = 0, 1 (or 2) the mode index used to get the correct value of
                   energy to apply for each time interval
    KEYWORDS:
    HISTORY:
     2015-08-28, jmm, jimm@ssl.berkeley.edu
     $LastChangedBy: jimm $
     $LastChangedDate: 2016-02-09 13:24:52 -0800 (Tue, 09 Feb 2016) $
     $LastChangedRevision: 19916 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/general/missions/fast/fa_esa/l2util/fa_esa_energy.pro $

(See general/missions/fast/fa_esa/l2util/fa_esa_energy.pro)

## FA_ESA_ENERGY[2]

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

    NAME:
     fa_esa_energy
    CALLING SEQUENCE:
     energy_full = fa_esa_energy(astruct, orig_names, index=index)
    INPUT:
     astruct - the structure, created by read_myCDF that should contain
               at least one Virtual variable.
     orig_names - the list of varibles that exist in the structure.
     index - the virtual variable (index number) for which this
             function is being called to compute.  If this isn't
             defined, then the function will find the 1st virtual variable.
    HISTORY:
     hacked from CDAWlib apply_esa_qflag.pro, jmm, 2015-08-28
     $LastChangedBy: jimm $
     $LastChangedDate: 2016-02-02 13:55:56 -0800 (Tue, 02 Feb 2016) $
     $LastChangedRevision: 19874 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/general/missions/fast/fa_esa/l2util/fa_esa_energy_v.pro $

(See general/missions/fast/fa_esa/l2util/fa_esa_energy_v.pro)

## FA_ESA_ENERGY_ARRAY

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

    NAME:
     fa_esa_energy_array
    PURPOSE:
     creates an energy angle array for FAST ESA data;
    CALLING SEQUENCE:
     pa = fa_esa_energy_array(energy, mode_ind)
    INPUT:
     energy = an array of (96, 64, 2 or 3) of energies
     mode = 0, 1 (or 2) the mode index used to get the correct value of
                   energy to apply for each time interval
    KEYWORDS:
     fillval = the fill value, the default is !values.f_nan
    HISTORY:
     2015-08-28, jmm, jimm@ssl.berkeley.edu

(See general/missions/fast/fa_esa/l2util/fa_esa_energy_v.pro)

## FA_ESA_L2CREATE

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

    NAME:
     fa_esa_l2create
    PURPOSE:
     Creates an L2 data structure from l1 data
    INPUT:
     none explicit, all via keyword
    OUTPUT:
     none explicit, all via keyword
    KEYWORDS:
     input keywords:
           type = the data type, one of ['ees','ies','eeb','ieb']
           orbit = orbit range
     output keywords:
           data_struct = the L2 data structure
       PROJECT_NAME    STRING    'FAST'
       DATA_NAME       STRING    'Iesa Burst'
       DATA_LEVEL      STRING    'Level 1'
       UNITS_NAME      STRING    'Compressed'
       UNITS_PROCEDURE STRING    'fa_convert_esa_units'
       VALID           INT       Array[59832]
       DATA_QUALITY    BYTE      Array[59832]
       TIME            DOUBLE    Array[59832]
       END_TIME        DOUBLE    Array[59832]
       INTEG_T         DOUBLE    Array[59832]
       DELTA_T         DOUBLE    Array[59832]
       NBINS           BYTE      Array[59832]
       NENERGY         BYTE      Array[59832]
       GEOM_FACTOR     FLOAT     Array[59832]
       DATA_IND        LONG      Array[59832]
       GF_IND          INT       Array[59832]
       BINS_IND        INT       Array[59832]
       MODE_IND        BYTE      Array[59832]
       THETA_SHIFT     FLOAT     Array[59832]
       THETA_MAX       FLOAT     Array[59832]
       THETA_MIN       FLOAT     Array[59832]
       BKG             FLOAT     Array[59832]
       DATA0           BYTE      Array[48, 32, 59832]
       DATA1           FLOAT     NaN (48, 64, ntimes1) (here single NaN
    means there is no data for this mode)
       DATA2           FLOAT     NaN (96, 32, ntimes2)
       ENERGY          FLOAT     Array[96, 32, 2]
       BINS            BYTE      Array[96, 32]
       THETA           FLOAT     Array[96, 32, 2]
       GF              FLOAT     Array[96, 64]
       DENERGY         FLOAT     Array[96, 32, 2]
       DTHETA          FLOAT     Array[96, 32, 2]
       EFF             FLOAT     Array[96, 32, 2]
       DEAD            FLOAT       1.10000e-07
       MASS            FLOAT         0.0104389
       CHARGE          INT              1
       SC_POT          FLOAT     Array[59832]
       BKG_ARR         FLOAT     Array[96, 64]
       HEADER_BYTES    BYTE      Array[44, 59832]
    THe following outputs are added here
       DATA            BYTE      Array[59832, 96, 64]
       EFLUX           FLOAT     Array[59832, 96, 64]
       ENERGY_FULL     FLOAT     Array[59832, 96, 64]
       DENERGY_FULL    FLOAT     Array[59832, 96, 64]
       PITCH_ANGLE     FLOAT     Array[59832, 96, 64]
       DOMEGA          FLOAT     Array[59832, 96, 64]
       ORBIT_START     LONG
       ORBIT_END       LONG
    ;
    HISTORY:
     Dillon Wong, 2009
     added eflux variable, 2015-08-21, jmm
     added orbit stat and end tags, 2015-08-24, jmm
     added energy_full, denergy_full, pitch_angle arrays 2016-02-02, jmm
     $LastChangedBy: jimm $
     $LastChangedDate: 2016-11-02 13:57:47 -0700 (Wed, 02 Nov 2016) $
     $LastChangedRevision: 22261 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/general/missions/fast/fa_esa/l2util/fa_esa_l2create.pro $

(See general/missions/fast/fa_esa/l2util/fa_esa_l2create.pro)

## FA_ESA_L2GEN

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

    NAME:
     fa_esa_l2gen
    PURPOSE:
     Generates FAST ESA L2 files
    CALLING SEQUENCE:
     fa_esa_l2gen, orbit
    KEYWORDS:
     local_data_dir = if set, then write files in orbit directories under
                      local_data_dir/fast/l2 , the default is to
                      use ROOT_DATA_DIR, /disks/data
    INPUT:
     Either the date or input L0 file, via keyword:
    HISTORY:
     2015-09-02, jmm, jimm@ssl.berkeley.edu
     $LastChangedBy: jimm $
     $LastChangedDate: 2017-05-26 12:02:12 -0700 (Fri, 26 May 2017) $
     $LastChangedRevision: 23357 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/general/missions/fast/fa_esa/l2util/fa_esa_l2gen.pro $

(See general/missions/fast/fa_esa/l2util/fa_esa_l2gen.pro)

## FA_ESA_L2_CRIB

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

    NAME:
    fa_esa_l2_crib
    PURPOSE:
    Crib for loading FAST ESA L2 data

(See general/missions/fast/fa_esa/l2util/fa_esa_l2_crib.pro)

## FA_ESA_L2_EDIST

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

    NAME:
    fa_esa_l2_edist
    CALLING SEQUENCE:
    eflux = fa_esa_l2_edist(type)
    PURPOSE:
    Create FAST ESA energy spectrum, from L2 input
    INPUT:
    type = one of ['ies', 'ees', 'ieb', 'eeb']
    OUTPUT:
    eflux = tplot variable name for energy spectrum in the given pitch
            angle range
    KEYWORDS: (all from get_pa_spec.pro, but the interpretation may be
               different because there are no 'counts')
           trange: A time range, if set takes precedence over t1 and t2
                   below, defaults to timerange()
    	T1:		start time, seconds since 1970, defaults to timerange()[0]
    	T2:		end time, seconds since 1970, defaults to timerange()[1]
    	PARANGE:		fltarr(2)		pitch angle range 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
    	NAME:  		New name of the Data Quantity
           SUFFIX:         Append this suffix to the tplot variable name,
                           only used if the NAME keyword is not set.

    HISTORY:
     2016-04-12, jmm, jimm@ssl.berkeley.edu
     $LastChangedBy: jimm $
     $LastChangedDate: 2022-08-15 13:07:54 -0700 (Mon, 15 Aug 2022) $
     $LastChangedRevision: 31017 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/general/missions/fast/fa_esa/l2util/fa_esa_l2_edist.pro $

(See general/missions/fast/fa_esa/l2util/fa_esa_l2_edist.pro)

## FA_ESA_L2_PAD

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

    NAME:
    fa_esa_l2_pad
    CALLING SEQUENCE:
    pdist = fa_esa_l2_pad(type)
    PURPOSE:
    Create FAST ESA pitch angle spectrum, from L2 input
    INPUT:
    type = one of ['ies', 'ees', 'ieb', 'eeb']
    OUTPUT:
    pdist = tplot variable name for pitch angle spectra in the given energy range
    KEYWORDS: (all from get_pa_spec.pro, but the interpretation may be
               different because there are no 'counts')
           trange: A time range, if set takes precedence over t1 and t2
                   below, defaults to timerange()
    	T1:		start time, seconds since 1970, defaults to timerange()[0]
    	T2:		end time, seconds since 1970, defaults to timerange()[1]
    	ENERGY:		fltarr(2)		energy range to sum over, eV
    	EBINRANGE:	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
    	NAME:  		New name of the Data Quantity
           SUFFIX:         Append this suffix to the tplot variable name,
                           only used if the NAME keyword is not set.

    HISTORY:
     2016-03-21, jmm, jimm@ssl.berkeley.edu
     $LastChangedBy: jimm $
     $LastChangedDate: 2022-08-15 13:07:54 -0700 (Mon, 15 Aug 2022) $
     $LastChangedRevision: 31017 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/general/missions/fast/fa_esa/l2util/fa_esa_l2_pad.pro $

(See general/missions/fast/fa_esa/l2util/fa_esa_l2_pad.pro)

## FA_ESA_L2_TPLOT

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

    NAME:
    fa_esa_l2_tplot
    CALLING SEQUENCE:
    fa_esa_l2_tplot
    PURPOSE:
    Create FAST ESA tplot variables, from L2 input
    INPUT:
    OUTPUT:
    KEYWORDS:

    all = 0/1, if not set, deletes all currently stored ESA tplot
    variables fa_esa* before generating new ones.

    type = ['ies', 'ees', 'ieb', 'eeb'] or some subset.

    counts = 0/1, if set, then use counts data rather than eflux to
    create tplot variables, good for comparison with L1 data

    HISTORY:
    2015-09-14, jmm, jimm@ssl.berkeley.edu, hacked from fa_load_esa_l1
    and mvn_sta_l2_tplot.
     $LastChangedBy: jimm $
     $LastChangedDate: 2022-08-01 13:04:46 -0700 (Mon, 01 Aug 2022) $
     $LastChangedRevision: 30985 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/general/missions/fast/fa_esa/l2util/fa_esa_l2_tplot.pro $

(See general/missions/fast/fa_esa/l2util/fa_esa_l2_tplot.pro)

## FA_ESA_LOAD_L2

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

    NAME:
     fa_esa_load_l2
    PURPOSE:
     Loads FAST ESA L2 data for a given file(s), or time_range, or orbit range
    CALLING SEQUENCE:
     fa_esa_load_l2, trange=trange, type=type, datatype=datatype, orbit=orbit
    INPUT:
     All via keyword, if none are set, then the output of timerange() is
     used for the time range, which may prompt for a time interval
    KEYWORDS:
     datatype, type = ['ies','ieb', 'ees', 'eeb' ] is the default
     trange = read in the data from this time range, note that if both
              files and time range are set, files, and orbits take precedence in
              finding files.
     orbit = if set, load the given orbit(s)
     no_time_clip = if set do not clip the data to the time range. The
                    trange is only used for file selection. Note that
                    setting no_time_clip will always generate a reload of data
    OUTPUT:
     No variables, data are loaded into common blocks
    HISTORY:
     1-sep-2015, jmm, jimm@ssl.berkeley.edu
     18-oct-2016, jmm, Checks to see if the time range is different than
                       the saved time range before loading data
     $LastChangedBy: jimm $
     $LastChangedDate: 2025-08-27 10:20:33 -0700 (Wed, 27 Aug 2025) $
     $LastChangedRevision: 33579 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/general/missions/fast/fa_esa/l2util/fa_esa_load_l2.pro $

(See general/missions/fast/fa_esa/l2util/fa_esa_load_l2.pro)

## FA_ESA_PA[1]

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

    NAME:
     fa_esa_pa
    PURPOSE:
     creates a pitch angle array for FAST ESA data;
    CALLING SEQUENCE:
     pa = fa_esa_pa(theta, theta_shift, mode_ind)
    INPUT:
     theta = an array of (96, 64, 2 or 3) of angle values
     theta_shift = an array of (ntimes) values for the offset to get
                   pitch angle from theta, PA = theta+theta_shift
     mode = 0, 1 (or 2) the mode index used to get the correct value of
                   theta_shift to apply for each time interval
    KEYWORDS:
    HISTORY:
     2015-08-28, jmm, jimm@ssl.berkeley.edu
     $LastChangedBy: jimm $
     $LastChangedDate: 2016-04-12 10:54:43 -0700 (Tue, 12 Apr 2016) $
     $LastChangedRevision: 20786 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/general/missions/fast/fa_esa/l2util/fa_esa_pa.pro $

(See general/missions/fast/fa_esa/l2util/fa_esa_pa.pro)

## FA_ESA_PA[2]

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

    NAME:
     fa_esa_pa
    CALLING SEQUENCE:
     pitch_angle = fa_esa_pa(astruct, orig_names, index=index)
    INPUT:
     astruct - the structure, created by read_myCDF that should contain
               at least one Virtual variable.
     orig_names - the list of varibles that exist in the structure.
     index - the virtual variable (index number) for which this
             function is being called to compute.  If this isn't
             defined, then the function will find the 1st virtual variable.
    HISTORY:
     hacked from CDAWlib apply_esa_qflag.pro, jmm, 2015-08-28
     $LastChangedBy: jimm $
     $LastChangedDate: 2016-02-02 13:55:56 -0800 (Tue, 02 Feb 2016) $
     $LastChangedRevision: 19874 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/general/missions/fast/fa_esa/l2util/fa_esa_pa_v.pro $

(See general/missions/fast/fa_esa/l2util/fa_esa_pa_v.pro)

## FA_ESA_PA_ARRAY

[Previous Routine] [List of Routines]

    NAME:
     fa_esa_pa_array
    PURPOSE:
     creates a pitch angle array for FAST ESA data;
    CALLING SEQUENCE:
     pa = fa_esa_pa_array(theta, theta_shift, mode_ind)
    INPUT:
     theta = an array of (96, 64, 2 or 3) of angle values
     theta_shift = an array of (ntimes) values for the offset to get
                   pitch angle from theta, PA = theta+theta_shift
     mode = 0, 1 (or 2) the mode index used to get the correct value of
                   theta_shift to apply for each time interval
    KEYWORDS:
     fillval = the fill value, the default is !values.f_nan
    HISTORY:
     2015-08-28, jmm, jimm@ssl.berkeley.edu

(See general/missions/fast/fa_esa/l2util/fa_esa_pa_v.pro)