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

Last modified: Fri Aug 1 18:18:06 2025.

# Directory Listing of Routines

# projects/elfin/load_data

- ELF_CDF2TPLOT
- ELF_CREATE_L2_EPD_CDF
  This routine creates level 2 epd data and writes the data to a CDF
- ELF_EPD_L1_POSTPROC
  Routine calibrates data and sets dlimits and limits
- ELF_EPD_L2_POSTPROC
  This routines sets the limits and data limits
- ELF_FGM_FSP_GEI2NDW
  This routine converts full spin resolved fgm data from GEI coordinates to NDW
- ELF_FGM_FSP_GEI2OBW
  This routine converts full spin resolved fgm data from GEI coordinates to OBW
- ELF_FILES_IN_INTERVAL
  filters file list returned by the server to the trange. This filter is purposefully
- ELF_FIND_PHASE_DELAY
  This routine will retrieve all the phase delay values. The routine
- ELF_GET_ATT
  This routine will get the latest elfin attitude information. tplot variables created include
- ELF_GET_AUTHORIZATION
- ELF_GET_DATA_AVAILABILITY
  Get start and stop science zone collection data for a
- ELF_GET_LOCAL_FILES
- ELF_GET_OVERVIEW_PLOTS
- ELF_GET_PHASE_DELAYS
  This routine will download and retrieve the phase delay values for a given
- ELF_GET_SPIN_ANGLES
  This routine will download elfin attitude and state data along with sun position.
- ELF_LOAD_ATT
  Load data from a csv file on the elfin server.
- ELF_LOAD_DATA
- ELF_LOAD_DST
  Load data from a csv file downloaded from a csv file stored on the
- ELF_LOAD_ENG
  Load the ELFIN engineering data
- ELF_LOAD_EPD
  Load the ELFIN EPD
- ELF_LOAD_FGM
  Load the ELFIN FGM
- ELF_LOAD_KP
  Load data from a csv file downloaded from a csv file stored on the
- ELF_LOAD_MRMA
  Load the ELFIN mrm data from the ACB board
- ELF_LOAD_MRMI
  Load the ELFIN mrm data from the IDPU board
- ELF_LOAD_OPTIONS[1]
- ELF_LOAD_OPTIONS[2]
- ELF_LOAD_OPTIONS[2]
- ELF_LOAD_OPTIONS[3]
- ELF_LOAD_OPTIONS[4]
- ELF_LOAD_OPTIONS[5]
- ELF_LOAD_OPTIONS[6]
- ELF_LOAD_OPTIONS[7]
- ELF_LOAD_PROXY_AE
- ELF_LOAD_STATE
  Load the ELFIN ephemeris and attitude data
- ELF_STATE_FIX_METADATA
  Helper routine for setting metadata of ELFIN state variables
- ELF_UPDATE_DATA_AVAILABILITY_TABLE
  Update the data availability page
- ELF_WRITE_DATA_AVAILABILITY_TABLE
  Write to and update the data availability
- RUN_EPD_L2_PROCESSING
  This is a wrapper routine for processing epd l2 cdf

# Routine Descriptions

## ELF_CDF2TPLOT

[Next Routine] [List of Routines]

    elf_cdf2tplot ,files,varformat=varformat

    Keywords:

     VARFORMAT = PATTERN  ; PATTERN should be a string (wildcards accepted) that will match the CDF variable that should be made into tplot variables
     PREFIX = STRING      ; String that will be pre-pended to all tplot variable names.
     SUFFIX = STRING      ; String appended to end of each tplot variable created.
     VARNAMES = named variable ; CDF variable names are returned in this variable
     /GET_SUPPORT_DATA    ; Often required to get support data if the CDF file does not have all the needed depend attributes
     /TT2000              ; Keep TT200 time in unsigned long format

     record=record if only one record and not full cdf-file is requested

    load_labels=load_labels ;copy labels from labl_ptr_1 in attributes into dlimits
             resolve labels implemented as keyword to preserve backwards compatibility

     NOTE:;
       The used function spd_cdf_info_to_tplot rely on the order of the variables
       in the cdf file. According to ISTP/IACG guidelines "Epoch" should be the
       first variable in each CDF data set.
       https://spdf.gsfc.nasa.gov/istp_guide/variables.html#Epoch

     Author: Davin Larson -  20th century
       Forked from MMS, 04/09/2018, adrozdov

     $LastChangedBy: nikos $
     $LastChangedDate: 2021-06-10 14:39:13 -0700 (Thu, 10 Jun 2021) $
     $LastChangedRevision: 30039 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/general/CDF/spd_cdf2tplot.pro $

(See projects/elfin/load_data/elf_cdf2tplot.pro)

## ELF_CREATE_L2_EPD_CDF

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

     PROCEDURE:
             elf_create_l2_epd_cdf

     PURPOSE:
             This routine creates level 2 epd data and writes the data to a CDF

     KEYWORDS:
             trange:       time range of interest [starttime, endtime] with the format
                           ['YYYY-MM-DD','YYYY-MM-DD'] or to specify more or less than a day
                           ['YYYY-MM-DD/hh:mm:ss','YYYY-MM-DD/hh:mm:ss']
             probe:        letter of the elfin spacecraft - 'a' or 'b'
             species:      letter of the type of data - e: electron or i: ion

    $LastChangedBy: clrussell $
    $LastChangedDate: 2018-12-06 11:58:25 -0700 (Mon, 06 Aug 2018) $
    $LastChangedRevision: 25588 $

(See projects/elfin/load_data/elf_create_l2_epd_cdf.pro)

## ELF_EPD_L1_POSTPROC

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

     PROCEDURE:
             elf_epd_l1_postproc

     PURPOSE:
             Routine calibrates data and sets dlimits and limits

     KEYWORDS:
             trange:       time range of interest [starttime, endtime] with the format
                           ['YYYY-MM-DD','YYYY-MM-DD'] or to specify more or less than a day
                           ['YYYY-MM-DD/hh:mm:ss','YYYY-MM-DD/hh:mm:ss']
             tplotnames:   list of tplot names
             unit:         units of the data
             no_spec:      flag to set tplot options to linear rather than the default of spec
             suffix:       appends a suffix to the end of the tplot variable name. this is useful for
                           preserving original tplot variable.
             no_download:  specify this keyword to load only data available on the local disk
             mynspinsinsum: number of spins in sum which is needed by the calibration routine

     NOTES:  This routine is called when loading epd level 1 data

    $LastChangedBy: clrussell $
    $LastChangedDate: 2018-12-06 11:58:25 -0700 (Mon, 06 Aug 2018) $
    $LastChangedRevision: 25588 $

(See projects/elfin/load_data/elf_epd_l1_postproc.pro)

## ELF_EPD_L2_POSTPROC

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

     PROCEDURE:
             elf_epd_l2_postproc

     PURPOSE:
             This routines sets the limits and data limits

     KEYWORDS:
             probes:       probe name 'a' or 'b', default is 'a'
             tplotnames:   list of tplot names

     NOTES:  This routine is called when loading epd level 2 data

    $LastChangedBy: clrussell $
    $LastChangedDate: 2018-12-06 11:58:25 -0700 (Mon, 06 Aug 2018) $
    $LastChangedRevision: 25588 $

(See projects/elfin/load_data/elf_epd_l2_postproc.pro)

## ELF_FGM_FSP_GEI2NDW

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

     PROCEDURE:
             elf_fgm_fsp_gei2ndw

     PURPOSE:
             This routine converts full spin resolved fgm data from GEI coordinates to NDW
             spherical coordinates (NDW: N=north (spherical -theta, positive North), D=radial down (spherical -r)
             W=west (spherical -phi)

     KEYWORDS:
             trange:       time range of interest [starttime, endtime] with the format
                           ['YYYY-MM-DD','YYYY-MM-DD'] or to specify more or less than a day
                           ['YYYY-MM-DD/hh:mm:ss','YYYY-MM-DD/hh:mm:ss']
             probe:        probe name, valid probes for elfin are ['a','b'].
                           if no probe is specified the default is probe 'a'
             sz_starttimes: array of science zone collection start times for the specified range.
                            format is time_double.
             sz_endtimes:  array of science zone collection end times for the specified range.
                            format is time_double.
             no_download:  set this flag so data is not downloaded from server but rather picked
                           up from the local disk (uses !elf.local_data_dir)

     NOTES:
           This routine expects elfin elx_fgs_fsp_res_gei and elx_pos_gei data to be loaded in tplot
           variables along with state data.
           Position data is interpolated To sz_start/end times are needed so data is not interploated
           over gaps.
           Sz_start/end times are passed in from elf_load_fgm rather than determined in this routine.
           This is because elf_fgm_fsp_gei2obw requires sz times also. This way the zone times are not
           calculated twice.

(See projects/elfin/load_data/elf_fgm_fsp_gei2ndw.pro)

## ELF_FGM_FSP_GEI2OBW

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

     PROCEDURE:
             elf_fgm_fsp_gei2obw

     PURPOSE:
             This routine converts full spin resolved fgm data from GEI coordinates to OBW
             coordinates system, where b is along model field,
                                       o is normal to b but outwards from Earth
                                       w is normal to b but westward: w = (rxb)/|rxb|, where r is satellite position
     KEYWORDS:
             trange:       time range of interest [starttime, endtime] with the format
                           ['YYYY-MM-DD','YYYY-MM-DD'] or to specify more or less than a day
                           ['YYYY-MM-DD/hh:mm:ss','YYYY-MM-DD/hh:mm:ss']
             probe:        probe name, valid probes for elfin are ['a','b'].
                           if no probe is specified the default is probe 'a'
             sz_starttimes: array of science zone collection start times for the specified range.
                            format is time_double.
             sz_endtimes:  array of science zone collection end times for the specified range.
                            format is time_double.
             no_download:  set this flag so data is not downloaded from server but rather picked
                           up from the local disk (uses !elf.local_data_dir)

     NOTES:
           This routine expects elfin elx_fgs_fsp_res_gei and elx_pos_gei data to be loaded in tplot
           variables along with state data.
           Position data is interpolated so sz_start/end times are needed so data is not interploated
           over gaps.
           Sz_start/end times are passed in from elf_load_fgm rather than determined in this routine.
           This is because elf_fgm_fsp_gei2ndw requires sz times also. This way the zone times are not
           calculated twice.

(See projects/elfin/load_data/elf_fgm_fsp_gei2obw.pro)

## ELF_FILES_IN_INTERVAL

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

       FUNCTION:
           elf_files_in_interval

       PURPOSE:
           filters file list returned by the server to the trange. This filter is purposefully
             liberal, it regularly grabs an extra file due to special cases

     $LastChangedBy: egrimes $
     $LastChangedDate: 2016-08-11 11:36:41 -0700 (Thu, 11 Aug 2016) $
     $LastChangedRevision: 21630 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/projects/elf/load_data/mms_files_in_interval.pro $

(See projects/elfin/load_data/elf_files_in_interval.pro)

## ELF_FIND_PHASE_DELAY

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

     PROCEDURE:
             elf_find_phase_delay

     PURPOSE:
             This routine will retrieve all the phase delay values. The routine
             searches through the time stamped phase delay values to find the closest
             science zone. A structure is returned
               phase_delay={dsect2add:dsect2add, dphang2add:dphang2add, minpa:minpa, $
                            badflag:badflag, medianflag:medianflag}

     KEYWORDS:
             trange:       time range of interest [starttime, endtime] with the format
                           ['YYYY-MM-DD','YYYY-MM-DD'] or to specify more or less than a day
                           ['YYYY-MM-DD/hh:mm:ss','YYYY-MM-DD/hh:mm:ss']
             probe:        'a' or 'b'
             no_download:  set this flag to search for the file on your local disk
             hourly:       set this flag to find the nearest science zone within an hour of the
                           trange

(See projects/elfin/load_data/elf_find_phase_delay.pro)

## ELF_GET_ATT

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

    PROCEDURE: elf_get_att

    PURPOSE:
         This routine will get the latest elfin attitude information. tplot variables created include
         ela_att_gei, ela_att_last_solution, ela_spin_norm_ang, and ela_spin_sun_ang, ela_pos_gei
         and ela_vel_gei
         NOTE: This routine can also be called from the elf_load_state routine by using the keyword
               /get_att

    KEYWORDS
        trange: time range of interest [starttime, endtime] with the format
                    ['YYYY-MM-DD','YYYY-MM-DD'] or to specify more or less than a day
                    ['YYYY-MM-DD/hh:mm:ss','YYYY-MM-DD/hh:mm:ss']
        probe:  elf probes include 'a' or 'b'

    EXAMPLE:
        ela_get_att, trange=['2019-07-15','2019-07-16'], probe='a'

(See projects/elfin/load_data/elf_get_att.pro)

## ELF_GET_AUTHORIZATION

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

      Function: elf_get_authorization

      This function returns a structure that contains the user_name and password
      for accessing elfin data.
          authorization = { user_name: user_name, password: password }

      Note this function is only necessary for ELFIN data that is not yet public.
      This procedure will define the location of data files and the data server.
      This procedure is intended to be called from within the "ELF_INIT" procedure.

      The authorization file is found !elf.local_data_dir  (~\data\elfin)

      KEYWORDS
         none

(See projects/elfin/load_data/elf_get_authorization.pro)

## ELF_GET_DATA_AVAILABILITY

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

     FUNCTION:
             elf_get_data_availability

     PURPOSE:
             Get start and stop science zone collection data for a
             given instrument, probe and date

     KEYWORDS:
             tdate: time to be used for calculation
                    (format can be time string '2020-03-20'
                    or time double)
             probe: probe name, probes include 'a' and 'b'
             instrument: instrument name, insturments include 'epd', 'fgm', 'mrm'

     OUTPUT:
             data_availability: structure with start times, stop times and science
             zone names. Note: mrm data does not have a science zone associated
             with it.

     EXAMPLE:
             data_struct=elf_get_data_availability('2020-03-20', probe='a', instrument='epd'

    VERSION LAST EDITED: lauraiglesias4@gmail.com 05/18/2021

(See projects/elfin/load_data/elf_get_data_availability.pro)

## ELF_GET_LOCAL_FILES

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

    Procedure:
      elf_get_local_files

    Purpose:
      Search for local ELFIN files in case a list cannot be retrieved from the
      remote server. Returns a sorted list of file paths.

    Calling Sequence:

      files = elf_get_local_file_info( probe=probe, instrument=instrument, $
                data_rate=data_rate, level=level, datatype=datatype, trange=trange)

    Input:
      probe:  (string) Full spacecraft designation, e.g. 'ela'
      instrument:  (string) Instrument designation, e.g. 'fgm'
      data_rate:  (string) Data collection mode?  e.g. 'srvy'
      level:  (string) Data processing level, e.g. 'l1'
      trange:  (string/double) Two element time range, e.g. ['2015-06-22','2015-06-23']
      datatype:  (string) Optional datatype specification, e.g. 'pos'
      cdf_version: not yet implemented
      latest_version: not yet implemented
      min_version: not yet implemented
      mirror: not yet implemented
      pred: set this keyword if you want predicted state data. the default for state data is
            definitive

    Output:
      return value:  Sorted string array of file paths, if successful; 0 otherwise

    Notes:
      -Input strings should not contain wildcards (datatype may be '*')

    $LastChangedBy: egrimes $
    $LastChangedDate: 2018-04-09 12:14:36 -0700 (Mon, 09 Apr 2018) $
    $LastChangedRevision: 25023 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/projects/elf/common/elf_get_local_files.pro $

(See projects/elfin/load_data/elf_get_local_files.pro)

## ELF_GET_OVERVIEW_PLOTS

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

    NAME:
      elf_get_overview_plots
              This routine will download the overview plots for ELFIN. The downloaded files will
              be copied to your local_data_dir.

    KEYWORDS (commonly used by other load routines):
             trange:       time range of interest [starttime, endtime] with the format
                           ['YYYY-MM-DD','YYYY-MM-DD'] or to specify more or less than a day
                           ['YYYY-MM-DD/hh:mm:ss','YYYY-MM-DD/hh:mm:ss']
             probe:        'a' or 'b' (if no probe is specified the default is probe 'a')
             local_data_dir: Use this keyword to specify the local data directory where you want
                             the plots downloaded.

    NOTE: This routine handles only 1 date and 1 probe at a time. It's on the TO DO list.
          If you want to reset the local_data_dir system variable for !elf simply call elf_init

    EXAMPLE:
       idl> elf_get_overview_plots, trange=['2019-09-28','2019-09-29'], probe='a'
       idl> elf_get_overview_plots, trange=['2019-09-28','2019-09-29'], probe='a', local_data_dir='C:\Users\clrussell\data\elfin\ela\overplots'

(See projects/elfin/load_data/elf_get_overview_plots.pro)

## ELF_GET_PHASE_DELAYS

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

     PROCEDURE:
             elf_get_phase_delay

     PURPOSE:
             This routine will download and retrieve the phase delay values for a given
             time range. All values in the file are returned in a structure of arrays.
             phase_delay = { $
                starttimes:starttimes, $
                  endtimes:endtimes, $
                  sect2add:dsect2add, $
                  phang2add:dphang2add, $
                  lastestmediansectr:latestmediansectr, $
                  latestmedianphang:latestmedianphang, $
                  badflag:badflag }

     KEYWORDS:
             trange:       time range of interest [starttime, endtime] with the format
                           ['YYYY-MM-DD','YYYY-MM-DD'] or to specify more or less than a day
                           ['YYYY-MM-DD/hh:mm:ss','YYYY-MM-DD/hh:mm:ss']
             probe:        'a' or 'b'
             no_download:  set this flag to search for the file on your local disk
             hourly:       set this flag to find the nearest science zone within an hour of the
                           trange

(See projects/elfin/load_data/elf_get_phase_delays.pro)

## ELF_GET_SPIN_ANGLES

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

     PROCEDURE:
             elf_get_spin_angles

     PURPOSE:
             This routine will download elfin attitude and state data along with sun position.
             The routine will interpolate the attitude data to match the state and sun position
             cadence.
             The spin_sun_ang and the spin_norm_ang are returned

     KEYWORDS:
             trange:       time range of interest [starttime, endtime] with the format
                           ['YYYY-MM-DD','YYYY-MM-DD'] or to specify more or less than a day
                           ['YYYY-MM-DD/hh:mm:ss','YYYY-MM-DD/hh:mm:ss']
             probes:       'a' or 'b'
             att:          attitude data in gei coordinates (if no attitude tplot variable
                           is present the routine will download the data)
             start_time:   start time of interest with the format
                           ['YYYY-MM-DD','YYYY-MM-DD'] or to specify more or less than a day
                           ['YYYY-MM-DD/hh:mm:ss','YYYY-MM-DD/hh:mm:ss']
             stop_time:    stop time of interest with the format
                           ['YYYY-MM-DD','YYYY-MM-DD'] or to specify more or less than a day
                           ['YYYY-MM-DD/hh:mm:ss','YYYY-MM-DD/hh:mm:ss']

(See projects/elfin/load_data/elf_get_spin_angles.pro)

## ELF_LOAD_ATT

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

     FUNCTION:
             elf_load_att

     PURPOSE:
             Load data from a csv file on the elfin server.
             The attitude data is a by-product of the attitude
             determination software.

     KEYWORDS:
             probe:        specify which ELFIN probe to load 'a' or 'b'
             tdate:        time and date of interest with the format
                           'YYYY-MM-DD/hh:mm:ss'
             no_download:  set this flag to search for the file on your local disk

(See projects/elfin/load_data/elf_load_att.pro)

## ELF_LOAD_DATA

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

    NAME:
      elf_load_data
              This routine loads local ELFIN data.
              There is no server available yet so all files must
               be local. The default value is currently set to
              'C:/data/elfin/el[ab]/l[0,1,2]/instrument/yyyy/mm/dd/*.cdf'
              If you do not want to place your cdf files there you
              must change the elfin system variable !elf.local_data_dir = 'yourdirectorypath'
    KEYWORDS (commonly used by other load routines):
             trange:       time range of interest [starttime, endtime] with the format
                           ['YYYY-MM-DD','YYYY-MM-DD'] or to specify more or less than a day
                           ['YYYY-MM-DD/hh:mm:ss','YYYY-MM-DD/hh:mm:ss']
             probes:       list of probes, valid values for ELFIN probes are ['a','b'].
                           if no probe is specified the default is probe 'a'
             level:        indicates level of data processing. levels include 'l1' and 'l2'
                           The default if no level is specified is 'l1' (l1 default needs to be confirmed)
             datatype:     depends on the instrument, see header for the instruments load routine
             data_rate:    instrument data rates
             tplotnames:   returns a list of the names of the tplot variables loaded by the load routine
             get_support_data: load support data (defined by VAR_TYPE="support_data" in the CDF)
             no_color_setup: don't setup graphics configuration; use this keyword when you're
                           using this load routine from a terminal without an X server running
             no_time_clip: don't clip the data to the requested time range; note that if you do use
                           this keyword you may load a longer time range than requested.
             no_update:    (NOT YET IMPLEMENTED) set this flag to preserve the original data. if not set and newer
                           data is found the existing data will be overwritten
             suffix:       appends a suffix to the end of the tplot variable name. this is useful for
                           preserving original tplot variable.
             varformat:    should be a string (wildcards accepted) that will match the CDF variables
                           that should be loaded into tplot variables
             cdf_filenames:  this keyword returns the names of the CDF files used when loading the data
             cdf_version:  specify a specific CDF version # to load (e.g., cdf_version='4.3.0')
             cdf_records: specify the # of records to load from the CDF files; this is useful
                 for grabbing one record from a CDF file
             spdf:         grab the data from the SPDF instead of ELFIN server - ***NOTE: only state and epdef data are
                           at SPDF available
             available:    (NOT YET IMPLEMENTED) returns a list of files available at the SDC for the requested parameters
                           this is useful for finding which files would be downloaded (along with their sizes) if
                           you didn't specify this keyword (also outputs total download size)
             versions:     this keyword returns the version #s of the CDF files used when loading the data
             no_time_sort:    set this flag to not order by time and remove duplicates
             tt2000: flag for preserving TT2000 timestamps found in CDF files (note that many routines in
                           SPEDAS (e.g., tplot.pro) do not currently support these timestamps)
             pred: set this flag for 'predicted' state data. default state data is 'definitive'.
             public_data: set this flag to retrieve data from the public area (default is private dir)
    ;
    EXAMPLE:
       elf_load_data,probe='a'

    NOTES:
       Since there is no data server - yet - files must reside locally.
       Current file naming convention is el[a/b]_ll_instr_yyyymmdd_v0*.cdf.
       Temporary fix for state CDF - state CDFs are the only CDFs that have version v02

(See projects/elfin/load_data/elf_load_data.pro)

## ELF_LOAD_DST

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

     PROCEDURE:
             elf_load_dst

     PURPOSE:
             Load data from a csv file downloaded from a csv file stored on the
             elfin server.
             The original data was downloaded from the ftp site:

     KEYWORDS:
             trange:       time range of interest [starttime, endtime] with the format
                           ['YYYY-MM-DD','YYYY-MM-DD'] or to specify more or less than a day
                           ['YYYY-MM-DD/hh:mm:ss','YYYY-MM-DD/hh:mm:ss']
             no_download:  set this flag to search for the file on your local disk

(See projects/elfin/load_data/elf_load_dst.pro)

## ELF_LOAD_ENG

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

     PROCEDURE:
             elf_load_eng

     PURPOSE:
             Load the ELFIN engineering data

     KEYWORDS:
             trange:       time range of interest [starttime, endtime] with the format
                           ['YYYY-MM-DD','YYYY-MM-DD'] or to specify more or less than a day
                           ['YYYY-MM-DD/hh:mm:ss','YYYY-MM-DD/hh:mm:ss']
                           Default: ['2022-08-19', '2022-08-20']
             probes:       list of probes, valid values for elf probes are ['a','b'].
                           if no probe is specified the default is probe 'a'
             datatypes:    see list below
             data_rate:    instrument data rates are not applicable
             level:        indicates level of data processing. levels include 'l1' and 'l2'
                           The default if no level is specified is 'l1' (l1 default needs to be confirmed)
             local_data_dir: local directory to store the CDF files; should be set if
                           you're on *nix or OSX, the default currently assumes Windows (c:\data\elfin\)
             source:       specifies a different system variable. By default the elf mission system
                           variable is !elf
             get_support_data: load support data (defined by support_data attribute in the CDF)
             tplotnames:   names for tplot variables
             no_color_setup: don't setup graphics configuration; use this keyword when you're
                           using this load routine from a terminal without an X server running
             no_time_clip: don't clip the data to the requested time range; note that if you do use
                           this keyword you may load a longer time range than requested
             no_update:    set this flag to preserve the original data. if not set and newer data is
                           found the existing data will be overwritten
             suffix:       appends a suffix to the end of the tplot variable name. this is useful for
                           preserving original tplot variable.
             varformat:    should be a string (wildcards accepted) that will match the CDF variables
                           that should be loaded into tplot variables
             cdf_filenames:  this keyword returns the names of the CDF files used when loading the data
             cdf_version:  specify a specific CDF version # to load (e.g., cdf_version='4.3.0')
             latest_version: only grab the latest CDF version in the requested time interval
                           (e.g., /latest_version)
             major_version: only open the latest major CDF version (e.g., X in vX.Y.Z) in the requested time interval
             min_version:  specify a minimum CDF version # to load
             cdf_records:  specify a number of records to load from the CDF files.
                           e.g., cdf_records=1 only loads in the first data point in the file
                           This is especially useful for loading S/C position for a single time
             spdf:         grab the data from the SPDF instead of the LASP SDC (only works for public access)
             available:    returns a list of files available at the SDC for the requested parameters
                           this is useful for finding which files would be downloaded (along with their sizes) if
                           you didn't specify this keyword (also outputs total download size)
             versions:     this keyword returns the version #s of the CDF files used when loading the data
             always_prompt: set this keyword to always prompt for the user's username and password;
                           useful if you accidently save an incorrect password, or if your SDC password has changed
             no_time_sort: set this flag if you don't want to order time and remove duplicates
             tt2000: flag for preserving TT2000 timestamps found in CDF files (note that many routines in
                           SPEDAS (e.g., tplot.pro) do not currently support these timestamps)

     EXAMPLES:
             to load/plot the eng  data for probe a on 2/20/2019:
             elf> elf_load_eng, probe='a', trange=['2016-02-20', '2016-02-21'], level='l1'
             elf> tplot, 'ela_sips_5v0_voltage'

     NOTES:

    $LastChangedBy: clrussell $
    $LastChangedDate: 2018-12-06 11:58:25 -0700 (Mon, 06 Aug 2018) $
    $LastChangedRevision: 25588 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/projects/elfin/elf_load_eng.pro $

(See projects/elfin/load_data/elf_load_eng.pro)

## ELF_LOAD_EPD

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

     PROCEDURE:
             elf_load_epd

     PURPOSE:
             Load the ELFIN EPD

     KEYWORDS:
             trange:       time range of interest [starttime, endtime] with the format
                           ['YYYY-MM-DD','YYYY-MM-DD'] or to specify more or less than a day
                           ['YYYY-MM-DD/hh:mm:ss','YYYY-MM-DD/hh:mm:ss']
                           Default: ['2022-08-19', '2022-08-20']
             probes:       list of probes, valid values for elf probes are ['a','b'].
                           if no probe is specified the default is probe 'a'
             datatype:     valid datatypes include level 1 - ['pif', 'pef']  (there may be
                           survey data for epd but it has not yet been downloaded ['pis', 'pes']
             data_rate:    instrument data rates include ['fast']. There may be srvy (survey data
                           is not yet available).
             level:        indicates level of data processing. levels include 'l1' and 'l2'
                           The default if no level is specified is 'l1'
             type:         ['raw','cps', 'nflux', 'eflux']  (eflux not fully tested)
             full_spin:    data defaults to half_spin resolution, set this flag to return full_spin resolution
             local_data_dir: local directory to store the CDF files; should be set if
                           you're on *nix or OSX, the default currently assumes Windows (c:\data\elfin\)
             source:       specifies a different system variable. By default the elf mission system
                           variable is !elf
             get_support_data: load support data (defined by support_data attribute in the CDF)
             tplotnames:   names for tplot variables
             no_color_setup: don't setup graphics configuration; use this keyword when you're
                           using this load routine from a terminal without an X server running
             no_time_clip: don't clip the data to the requested time range; note that if you do use
                           this keyword you may load a longer time range than requested
             no_update:    set this flag to preserve the original data. if not set and newer data is
                           found the existing data will be overwritten
             suffix:       appends a suffix to the end of the tplot variable name. this is useful for
                           preserving original tplot variable.
             no_suffix:    keyword to turn off automatic suffix of data type (e.g. '_raw' or '_nflux)
                           note that no_suffix will override whatever value of suffix may have been passed in
             varformat:    should be a string (wildcards accepted) that will match the CDF variables
                           that should be loaded into tplot variables
             cdf_filenames:  this keyword returns the names of the CDF files used when loading the data
             cdf_version:  specify a specific CDF version # to load (e.g., cdf_version='4.3.0')
             cdf_records:  specify a number of records to load from the CDF files.
                           e.g., cdf_records=1 only loads in the first data point in the file
                           This is especially useful for loading S/C position for a single time
             no_download:  specify this keyword to load only data available on the local disk
             spdf:         grab the data from the SPDF instead of the LASP SDC (only works for public access)
             versions:     this keyword returns the version #s of the CDF files used when loading the data
             no_time_sort:  set this flag to not order time and remove duplicates
             tt2000: flag for preserving TT2000 timestamps found in CDF files (note that many routines in
                           SPEDAS (e.g., tplot.pro) do not currently support these timestamps)
             no_spec:      flag to set tplot options to linear rather than the default of spec

     EXAMPLES:
             to load/plot the EPD data for probe a on 2/20/2019:
             elf> elf_load_epd, probe='a', trange=['2019-07-26', '2019-07-27'], level='l1', data_type='pif_counts'
             elf> tplot, 'ela_pif'

     NOTES:

    $LastChangedBy: clrussell $
    $LastChangedDate: 2018-12-06 11:58:25 -0700 (Mon, 06 Aug 2018) $
    $LastChangedRevision: 25588 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/projects/elfin/elf_load_fgm.pro $

(See projects/elfin/load_data/elf_load_epd.pro)

## ELF_LOAD_FGM

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

     PROCEDURE:
             elf_load_FGM

     PURPOSE:
             Load the ELFIN FGM

     KEYWORDS:
             trange:       time range of interest [starttime, endtime] with the format
                           ['YYYY-MM-DD','YYYY-MM-DD'] or to specify more or less than a day
                           ['YYYY-MM-DD/hh:mm:ss','YYYY-MM-DD/hh:mm:ss']
                           Default: ['2022-08-19', '2022-08-20']
             probes:       list of probes, valid values for elf probes are ['a','b'].
                           if no probe is specified the default is probe 'a'
             datatype:     valid datatypes include level 1 - ['fgf', 'fgs'] and
                           level 2 -['fgf_dsl','fgf_gei','fgf_mag','fgs_dsl','fgs_gei','fgs_mag']
             data_rate:    instrument data rates include ['srvy', 'fast']. The default is 'srvy'.
             units:        units include ['ACD', 'nT'], the default is 'nT'
             level:        indicates level of data processing. levels include 'l1' and 'l2'
                           The default if no level is specified is 'l1' (l1 default needs to be confirmed)
             local_data_dir: local directory to store the CDF files; should be set if
                           you're on *nix or OSX, the default currently assumes Windows (c:\data\elfin\)
             source:       specifies a different system variable. By default the elf mission system
                           variable is !elf
             get_support_data: load support data, state and IGRF data (defined by support_data attribute in the CDF)
             tplotnames:   names for tplot variables
             no_color_setup: don't setup graphics configuration; use this keyword when you're
                           using this load routine from a terminal without an X server running
             no_time_clip: set this keyword to not clip the data to the requested time range;
             no_update:    set this flag to preserve the original data. if not set and newer data is
                           found the existing data will be overwritten
             suffix:       appends a suffix to the end of the tplot variable name. this is useful for
                           preserving original tplot variable.
             varformat:    should be a string (wildcards accepted) that will match the CDF variables
                           that should be loaded into tplot variables
             cdf_filenames:  this keyword returns the names of the CDF files used when loading the data
             cdf_version:  specify a specific CDF version # to load (e.g., cdf_version='4.3.0')
             latest_version: only grab the latest CDF version in the requested time interval
                           (e.g., /latest_version)
             major_version: only open the latest major CDF version (e.g., X in vX.Y.Z) in the requested time interval
             min_version:  specify a minimum CDF version # to load
             cdf_records:  specify a number of records to load from the CDF files.
                           e.g., cdf_records=1 only loads in the first data point in the file
                           This is especially useful for loading S/C position for a single time
             spdf:         grab the data from the SPDF instead of the LASP SDC (only works for public access)
             available:    returns a list of files available at the SDC for the requested parameters
                           this is useful for finding which files would be downloaded (along with their sizes) if
                           you didn't specify this keyword (also outputs total download size)
             versions:     this keyword returns the version #s of the CDF files used when loading the data
             no_download:  this keyword will turn downloading off and look for the file locally
             always_prompt: set this keyword to always prompt for the user's username and password;
                           useful if you accidently save an incorrect password, or if your SDC password has changed
             no_time_sort: set this flag if you don't want the time ordered
             tt2000: flag for preserving TT2000 timestamps found in CDF files (note that many routines in
                           SPEDAS (e.g., tplot.pro) do not currently support these timestamps)

     EXAMPLES:
             to load/plot the FGM magnetometer data for probe a on 2/20/2019:
             elf> elf_load_fgm, probe='a', trange=['2016-02-20', '2016-02-21'], level='l1'
             elf> tplot, 'ela_fgs'

     NOTES:

     HISTORY:
             egrimes, replaced new_tvars code with tplotnames and enabled calibration by default, 14 March 2019

    $LastChangedBy: clrussell $
    $LastChangedDate: 2018-12-06 11:58:25 -0700 (Mon, 06 Aug 2018) $
    $LastChangedRevision: 25588 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/projects/elfin/elf_load_fgm.pro $

(See projects/elfin/load_data/elf_load_fgm.pro)

## ELF_LOAD_KP

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

     PROCEDURE:
             elf_load_kp

     PURPOSE:
             Load data from a csv file downloaded from a csv file stored on the
             elfin server and return all values in the time range
             The original data was downloaded from the ftp site:
                ftp://ftp.gfz-potsdam.de/pub/home/obs/kp-nowcast-archive/wdc/

     KEYWORDS:
             trange:       time range of interest [starttime, endtime] with the format
                           ['YYYY-MM-DD','YYYY-MM-DD'] or to specify more or less than a day
                           ['YYYY-MM-DD/hh:mm:ss','YYYY-MM-DD/hh:mm:ss']
             no_download:  set this flag to search for the file on your local disk
             extend_time:  set this flag to return the two adjacent values - this is useful for very
                           small time frames

     NOTES:
             The kp values downloaded from potsdam are at 3 hour intervals. 01:30, 04:30, 07:30, ... 22:30.
             If you time range is less than 3 hours it's possible no values will be found. Use the extend_time
             keyword to return the prevoius and next values.

(See projects/elfin/load_data/elf_load_kp.pro)

## ELF_LOAD_MRMA

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

     PROCEDURE:
             elf_load_mrma

     PURPOSE:
             Load the ELFIN mrm data from the ACB board

     KEYWORDS:
             trange:       time range of interest [starttime, endtime] with the format
                           ['YYYY-MM-DD','YYYY-MM-DD'] or to specify more or less than a day
                           ['YYYY-MM-DD/hh:mm:ss','YYYY-MM-DD/hh:mm:ss']
                           Default: ['2022-08-19', '2022-08-20']
             probes:       list of probes, valid values for elf probes are ['a','b'].
                           if no probe is specified the default is probe 'a'
             datatypes:    only one valid datatype -'mrma'
             data_rate:    instrument data rates are not applicable
             level:        indicates level of data processing. levels include 'l1' and 'l2'
                           The default if no level is specified is 'l1' (l1 default needs to be confirmed)
             local_data_dir: local directory to store the CDF files; should be set if
                           you're on *nix or OSX, the default currently assumes Windows (c:\data\elfin\)
             source:       specifies a different system variable. By default the elf mission system
                           variable is !elf
             get_support_data: load support data (defined by support_data attribute in the CDF)
             tplotnames:   names for tplot variables
             no_color_setup: don't setup graphics configuration; use this keyword when you're
                           using this load routine from a terminal without an X server running
             no_time_clip: don't clip the data to the requested time range; note that if you do use
                           this keyword you may load a longer time range than requested
             no_update:    set this flag to preserve the original data. if not set and newer data is
                           found the existing data will be overwritten
             suffix:       appends a suffix to the end of the tplot variable name. this is useful for
                           preserving original tplot variable.
             varformat:    should be a string (wildcards accepted) that will match the CDF variables
                           that should be loaded into tplot variables
             cdf_filenames:  this keyword returns the names of the CDF files used when loading the data
             cdf_version:  specify a specific CDF version # to load (e.g., cdf_version='4.3.0')
             latest_version: only grab the latest CDF version in the requested time interval
                           (e.g., /latest_version)
             major_version: only open the latest major CDF version (e.g., X in vX.Y.Z) in the requested time interval
             min_version:  specify a minimum CDF version # to load
             cdf_records:  specify a number of records to load from the CDF files.
                           e.g., cdf_records=1 only loads in the first data point in the file
                           This is especially useful for loading S/C position for a single time
             spdf:         grab the data from the SPDF instead of the LASP SDC (only works for public access)
             available:    returns a list of files available at the SDC for the requested parameters
                           this is useful for finding which files would be downloaded (along with their sizes) if
                           you didn't specify this keyword (also outputs total download size)
             versions:     this keyword returns the version #s of the CDF files used when loading the data
             no_download:  this keyword will turn downloading off and look for the file locally
             always_prompt: set this keyword to always prompt for the user's username and password;
                           useful if you accidently save an incorrect password, or if your SDC password has changed
             no_time_sort: set this flag if you don't want to order time and remove duplicates
             tt2000: flag for preserving TT2000 timestamps found in CDF files (note that many routines in
                           SPEDAS (e.g., tplot.pro) do not currently support these timestamps)

     EXAMPLES:
             to load/plot the mrm attitude data for probe a on 2/20/2019:
             elf> elf_load_mrma, probe='a', trange=['2016-02-20', '2016-02-21'], level='l1'
             elf> tplot, 'ela_mrma'

     NOTES:

    $LastChangedBy: clrussell $
    $LastChangedDate: 2018-12-06 11:58:25 -0700 (Mon, 06 Aug 2018) $
    $LastChangedRevision: 25588 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/projects/elfin/elf_load_mrma.pro $

(See projects/elfin/load_data/elf_load_mrma.pro)

## ELF_LOAD_MRMI

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

     PROCEDURE:
             elf_load_mrmi

     PURPOSE:
             Load the ELFIN mrm data from the IDPU board

     KEYWORDS:
             trange:       time range of interest [starttime, endtime] with the format
                           ['YYYY-MM-DD','YYYY-MM-DD'] or to specify more or less than a day
                           ['YYYY-MM-DD/hh:mm:ss','YYYY-MM-DD/hh:mm:ss']
                           Default: ['2022-08-19', '2022-08-20']
             probes:       list of probes, valid values for elf probes are ['a','b'].
                           if no probe is specified the default is probe 'a'
             datatypes:    only valid datatype is 'mrmi'
             data_rate:    instrument data rates are not applicable
             level:        indicates level of data processing. levels include 'l1' and 'l2'
                           The default if no level is specified is 'l1' (l1 default needs to be confirmed)
             local_data_dir: local directory to store the CDF files; should be set if
                           you're on *nix or OSX, the default currently assumes Windows (c:\data\elfin\)
             source:       specifies a different system variable. By default the elf mission system
                           variable is !elf
             get_support_data: load support data (defined by support_data attribute in the CDF)
             tplotnames:   names for tplot variables
             no_color_setup: don't setup graphics configuration; use this keyword when you're
                           using this load routine from a terminal without an X server running
             no_time_clip: don't clip the data to the requested time range; note that if you do use
                           this keyword you may load a longer time range than requested
             no_update:    set this flag to preserve the original data. if not set and newer data is
                           found the existing data will be overwritten
             suffix:       appends a suffix to the end of the tplot variable name. this is useful for
                           preserving original tplot variable.
             varformat:    should be a string (wildcards accepted) that will match the CDF variables
                           that should be loaded into tplot variables
             cdf_filenames:  this keyword returns the names of the CDF files used when loading the data
             cdf_version:  specify a specific CDF version # to load (e.g., cdf_version='4.3.0')
             latest_version: only grab the latest CDF version in the requested time interval
                           (e.g., /latest_version)
             major_version: only open the latest major CDF version (e.g., X in vX.Y.Z) in the requested time interval
             min_version:  specify a minimum CDF version # to load
             cdf_records:  specify a number of records to load from the CDF files.
                           e.g., cdf_records=1 only loads in the first data point in the file
                           This is especially useful for loading S/C position for a single time
             spdf:         grab the data from the SPDF instead of the LASP SDC (only works for public access)
             available:    returns a list of files available at the SDC for the requested parameters
                           this is useful for finding which files would be downloaded (along with their sizes) if
                           you didn't specify this keyword (also outputs total download size)
             versions:     this keyword returns the version #s of the CDF files used when loading the data
             no_download:  this keyword will turn downloading off and look for the file locally
             no_time_sort:    set this flag to order time and remove duplicates
             always_prompt: set this keyword to always prompt for the user's username and password;
                           useful if you accidently save an incorrect password, or if your SDC password has changed
             tt2000: flag for preserving TT2000 timestamps found in CDF files (note that many routines in
                           SPEDAS (e.g., tplot.pro) do not currently support these timestamps)

     EXAMPLES:
             to load/plot the mrm attitude data for probe a on 2/20/2019:
             elf> elf_load_mrmi, probe='a', trange=['2016-02-20', '2016-02-21'], level='l1'
             elf> tplot, 'ela_mrmi'

     NOTES:

    $LastChangedBy: clrussell $
    $LastChangedDate: 2018-12-06 11:58:25 -0700 (Mon, 06 Aug 2018) $
    $LastChangedRevision: 25588 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/projects/elfin/elf_load_mrma.pro $

(See projects/elfin/load_data/elf_load_mrmi.pro)

## ELF_LOAD_OPTIONS[1]

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

    Procedure:
      elf_load_options

    Purpose:
      Provides information on valid data rates, levels, and datatypes
      for ELFIN science instruments.

      Valid load options for a specified instrument will be returned
      via a corresponding keyword.

      Each output keyword may be used as an input to narrow the results
      the the contingent options.

    Calling Sequence:
      elf_load_options, instrument=instrument
                        [,rate=rate] [,level=level], [,datatype=datatype]
                        [valid=valid]

    Example Usage:

    Input:
      instrument:  (string) Instrument designation, e.g. 'afg'
      rate:  (string)(array) Data rate e.g. 'fast', 'srvy'
      level:  (string)(array) Data processing level e.g. 'l1b', 'ql'
      datatype:  (string)(array) Data type, e.g. 'moments'

    Output:
      rate:  If not used as an input this will contain all valid
             rates for the instrument.
      level:  If not used as an input this will contain all valid
              levels, given any specified rate.
      datatype:  If not used as an input this will contain all valid
                 datatypes, given any specified rate and level.
      valid:  1 if valid outputs were found, 0 otherwise

    Notes:

    $LastChangedBy: egrimes $
    $LastChangedDate: 2016-09-22 12:22:45 -0700 (Thu, 22 Sep 2016) $
    $LastChangedRevision: 21901 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/projects/elfin/elf_load_options.pro $

(See projects/elfin/load_data/elf_load_options.pro)

## ELF_LOAD_OPTIONS[2]

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

    Purpose:
      Helper function to return structure describing
      the available data types for State files

(See projects/elfin/load_data/elf_load_options.pro)

## ELF_LOAD_OPTIONS[2]

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

    Purpose:
      Helper function to return structure describing
      the available data types for MRM ACB

(See projects/elfin/load_data/elf_load_options.pro)

## ELF_LOAD_OPTIONS[3]

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

    Purpose:
      Helper function to return structure describing
      the available data types for MRM IDPU

(See projects/elfin/load_data/elf_load_options.pro)

## ELF_LOAD_OPTIONS[4]

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

    Purpose:
      Helper function to return structure describing
      the available data types for engineering data

(See projects/elfin/load_data/elf_load_options.pro)

## ELF_LOAD_OPTIONS[5]

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

    Purpose:
      Helper function to return structure describing
      the available data types for FGM

(See projects/elfin/load_data/elf_load_options.pro)

## ELF_LOAD_OPTIONS[6]

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

    Purpose:
      Helper function to return structure describing
      the available data types for EPD

(See projects/elfin/load_data/elf_load_options.pro)

## ELF_LOAD_OPTIONS[7]

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

    Purpose:
      Extracts valid rate/level/datatype based on input.
      If an input is specified then only subsets of that input are checked.
      If an input is not specified then all possible matches are used.

        e.g.  -If rate is specified then only levels and datatypes for
               that rate are retuned.
              -If nothing is specified then all rates/levels/datatypes
               are returned.
              -If all three are specified then then the output will
               be identical to the input (if the input is valid).

(See projects/elfin/load_data/elf_load_options.pro)

## ELF_LOAD_PROXY_AE

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

    NAME:
      elf_load_proxy_ae
              This routine loads proxy_ae data.
              Proxy AE data is derived from plots at Kyoto

    KEYWORDS:
             trange:       time range of interest [starttime, endtime] with the format
                           ['YYYY-MM-DD','YYYY-MM-DD'] or to specify more or less than a day
                           ['YYYY-MM-DD/hh:mm:ss','YYYY-MM-DD/hh:mm:ss']
             smooth:       set this flag is you want the data smoothed
             nsmooth:      number points to smooth over. Default is 5

    EXAMPLE:
       elf_load_proxy_ae, trange=['2020-03-18','2020-03-19'], /smooth

    NOTES:

(See projects/elfin/load_data/elf_load_proxy_ae.pro)

## ELF_LOAD_STATE

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

     PROCEDURE:
             elf_load_state

     PURPOSE:
             Load the ELFIN ephemeris and attitude data

     KEYWORDS:
             trange:       time range of interest [starttime, endtime] with the format
                           ['YYYY-MM-DD','YYYY-MM-DD'] or to specify more or less than a day
                           ['YYYY-MM-DD/hh:mm:ss','YYYY-MM-DD/hh:mm:ss']
             probes:       list of probes, valid values for elf probes are ['a','b'].
                           if no probe is specified the default is probe 'a'
             datatype:     valid datatypes include ['pos', 'vel']
                           Note: attitude data will be added soon [spinras, spindec, spinper, ..].
             level:        there is only one level for state - 'l1'
             data_rate:    instrument data rates are not applicable for state data
             local_data_dir: local directory to store the CDF files; should be set if
                           you're on *nix or OSX, the default currently assumes Windows (c:\data\elf\)
             source:       specifies a different system variable. By default the elf mission system
                           variable is !elf
             get_support_data: load support data (defined by support_data attribute in the CDF)
             tplotnames:   names for tplot variables
             no_color_setup: don't setup graphics configuration; use this keyword when you're
                           using this load routine from a terminal without an X server running
             no_time_clip: don't clip the data to the requested time range; note that if you do use
                           this keyword you may load a longer time range than requested
             no_update:    set this flag to preserve the original data. if not set and newer data is
                           found the existing data will be overwritten
             suffix:       appends a suffix to the end of the tplot variable name. this is useful for
                           preserving original tplot variable.
             varformat:    should be a string (wildcards accepted) that will match the CDF variables
                           that should be loaded into tplot variables
             cdf_filenames:  this keyword returns the names of the CDF files used when loading the data
             cdf_version:  specify a specific CDF version # to load (e.g., cdf_version='4.3.0')
             latest_version: only grab the latest CDF version in the requested time interval
                           (e.g., /latest_version)
             major_version: only open the latest major CDF version (e.g., X in vX.Y.Z) in the requested time interval
             min_version:  specify a minimum CDF version # to load
             cdf_records:  specify a number of records to load from the CDF files.
                           e.g., cdf_records=1 only loads in the first data point in the file
                           This is especially useful for loading S/C position for a single time
             spdf:         grab the data from the SPDF instead of the LASP SDC (only works for public access)
             available:    returns a list of files available at the SDC for the requested parameters
                           this is useful for finding which files would be downloaded (along with their sizes) if
                           you didn't specify this keyword (also outputs total download size)
             versions:     this keyword returns the version #s of the CDF files used when loading the data
             no_download:  this keyword will turn downloading off and look for the file locally
             always_prompt: set this keyword to always prompt for the user's username and password;
                           useful if you accidently save an incorrect password, or if your SDC password has changed
             tt2000: flag for preserving TT2000 timestamps found in CDF files (note that many routines in
                           SPEDAS (e.g., tplot.pro) do not currently support these timestamps)
             pred: set this flag to retrieve predicted data. default is definitive.
             public_data:  set this flag to retrieve state data from the public area (default is private dir)

     EXAMPLES:
             to load/plot the S/C position data for probe a on 2/20/2016:
             elf> elf_load_state, probe='a', trange=['2016-02-20', '2016-02-21']
             elf> tplot, 'ela_pos_gsm'

     NOTES:
        Will need to add attitude data - so far this only handles position and velocity

    $LastChangedBy: clrussell $
    $LastChangedDate: 2018-12-06 11:58:25 -0700 (Mon, 06 Aug 2018) $
    $LastChangedRevision: 25588 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/projects/elfin/elf_load_state.pro $

(See projects/elfin/load_data/elf_load_state.pro)

## ELF_STATE_FIX_METADATA

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

     PROCEDURE:
             elf_state_fix_metadata

     PURPOSE:
             Helper routine for setting metadata of ELFIN state variables

    $LastChangedBy: egrimes $
    $LastChangedDate: 2017-05-01 13:00:22 -0700 (Mon, 01 May 2017) $
    $LastChangedRevision: 23255 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/projects/mms/mec/mms_mec_fix_metadata.pro $

(See projects/elfin/load_data/elf_state_fix_metadata.pro)

## ELF_UPDATE_DATA_AVAILABILITY_TABLE

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

     PROCEDURE:
             elf_update_data_availability_table

     PURPOSE:
             Update the data availability page

     KEYWORDS:
             tdate: time to be used for calculation
                    (format can be time string '2020-03-20'
                    or time double)
             probe: probe name, probes include 'a' and 'b'
             instrument: instrument name, insturments include 'epd', 'fgm', 'mrm'

     OUTPUT:

     EXAMPLE:
             elf_update_data_availability_table, '2020-03-20', probe='a', instrument='mrm'

    LAST EDITED: lauraiglesias4@gmail.com 05/18/21

(See projects/elfin/load_data/elf_update_data_availability_table.pro)

## ELF_WRITE_DATA_AVAILABILITY_TABLE

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

     PROCEDURE:
             elf_write_data_availability_table

     PURPOSE:
             Write to and update the data availability

     KEYWORDS:
             tdate: time to be used for calculation
                    (format can be time string '2020-03-20'
                    or time double)
             probe: probe name, probes include 'a' and 'b'
             instrument: instrument name, insturments include 'epde', 'epdi', 'fgm', 'mrm'
             data: structure containing the availability data, start times, stop
                   times and science zone

     OUTPUT:

     EXAMPLE:
             elf_write_data_availability_table, filename, data_avail, 'epd', 'a'

    LAST EDITED: lauraiglesias4@gmail.com 05/18/21

(See projects/elfin/load_data/elf_write_data_availability_table.pro)

## RUN_EPD_L2_PROCESSING

[Previous Routine] [List of Routines]

     PROCEDURE:
             run_epd_l2_processing

     PURPOSE:
             This is a wrapper routine for processing epd l2 cdf

     KEYWORDS:
             trange:       time range of interest [starttime, endtime] with the format
                           ['YYYY-MM-DD','YYYY-MM-DD'] or to specify more or less than a day
                           ['YYYY-MM-DD/hh:mm:ss','YYYY-MM-DD/hh:mm:ss']
             probe:        letter of the elfin spacecraft - 'a' or 'b'
             species:      letter of the type of data - e: electron or i: ion

    $LastChangedBy: clrussell $
    $LastChangedDate: 2018-12-06 11:58:25 -0700 (Mon, 06 Aug 2018) $
    $LastChangedRevision: 25588 $

(See projects/elfin/load_data/run_epd_l2_processing.pro)