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

Last modified: Wed Nov 5 03:16:59 2025.

# Directory Listing of Routines

# projects/elfin/cal_data

- ELF_CAL_EPD
  Calibrate EPD raw data (counts/sector) into calibrated products.
- ELF_CAL_FGM
  Calibrate ELFIN FGM data
- ELF_CAL_MRMA
  Calibrate ELFIN MRM ACB data
- ELF_CAL_MRMI
  Calibrate ELFIN MRM IDPU data
- ELF_CONVERT_EPD_MV2ENG
  This procedure converts epd engineering units to mV2end
- ELF_GET_EPD_CALIBRATION
  returns epd calibration parameters
- ELF_GET_EPD_CALIBRATION_LOG
  This routine reads the epd calibration logs for ELFIN-A and ELFIN-B. The calibration logs
- ELF_READ_EPD_CAL_DATA
  This routine retrieves and reads the epd calibration data files for ELFIN-A and ELFIN-B.
- ELF_READ_EPD_CALFILE
  returns epd calibration parameters

# Routine Descriptions

## ELF_CAL_EPD

[Next Routine] [List of Routines]

    PROCEDURE:
       elf_cal_epd

    PURPOSE:
       Calibrate EPD raw data (counts/sector) into calibrated products.
       Supported product types are:
       - 'raw': raw data from epd packets
       - 'cps': counts per second [counts/s] in 16 ADC pulse-height channels
       - 'nflux': differential-directional number flux [#/cm^2-s-str-MeV] in 16 energy channels
       - 'eflux': differential-directional energy flux [MeV/cm^2-s-str-MeV] in 16 energy channels

    KEYWORDS:
       tplotname: name of tplot variable containing epd data. tvars include ela_pef, ela_pif,
                  ela_pes, ela_pis (and same for elb)
       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']
       type: type of calibrated data cps, nflux, eflux
       probe:  name of probe 'a' or 'b'
       nodownload: set this flag to force routine to use local files
       deadtime_corr: set this flag to zero to not correct for deadtime, or to your preferred deadtime (default = 8.e-6 seconds)

    AUTHOR:
     2021-03-21 (VA) added capability for summed spins [normalizes cps etc. accordingly]
                            also vectorized dt (accumulation time) division, avoiding do-loops (faster)
     2021-02-19 (VA) fixed: dt to median over spin (does not falter if it includes gaps)
                            overaccumulation now applied along with dt, prior to deadtime
                            dead time correction now applied on total cps in sector
                            revised maxcps to 1.25e5 +2% after review of all 2019 data
                            eliminated <0 val's from deadtime cor. (set=0 & then nearest-neighbor interpol.)
     Version: xprmnt4_wIBO_collection
     Initially written by Colin Wilkins (colinwilkins@ucla.edu)

(See projects/elfin/cal_data/elf_cal_epd.pro)

## ELF_CAL_FGM

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

     PROCEDURE:
             elf_cal_fgm

     PURPOSE:
             Calibrate ELFIN FGM data

     INPUT:
             tvars:       tplot variable names to be calibrated

     KEYWORDS:
             level:       processing level
             error:       1 indicates an error occurred, 0 indicates success
             units:       'nT' or 'ADC' default is 'nT'

     EXAMPLES:

             elf> elf_cal_fgm, tvars, level='l1'

     NOTES:

     HISTORY:
             - egrimes, fixed bug in calibration calculations reported by Andrei, 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_cal_fgm.pro $

(See projects/elfin/cal_data/elf_cal_fgm.pro)

## ELF_CAL_MRMA

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

     PROCEDURE:
             elf_cal_mrma

     PURPOSE:
             Calibrate ELFIN MRM ACB data

     KEYWORDS:
             tvars:       tplot variable names to be calibrated
             level:       'l1' or 'l2', default value is 'l1'

     EXAMPLES:

             elf> elf_cal_mrma, tvars

     NOTES:

     HISTORY:

    $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_cal_mrma.pro $

(See projects/elfin/cal_data/elf_cal_mrma.pro)

## ELF_CAL_MRMI

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

     PROCEDURE:
             elf_cal_mrmi

     PURPOSE:
             Calibrate ELFIN MRM IDPU data

     KEYWORDS:
             tvars:       tplot variable names to be calibrated
             level:       'l1' or 'l2', default is 'l1'

     EXAMPLES:

             elf> elf_cal_mrmi, tvars

     NOTES:

     HISTORY:

    $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_cal_mrmi.pro $

(See projects/elfin/cal_data/elf_cal_mrmi.pro)

## ELF_CONVERT_EPD_MV2ENG

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

    NAME:
     elf_convert_epd_mV2eng

    PURPOSE:
     This procedure converts epd engineering units to mV2end

    INPUTS:
      trange:   time range of epd engineering data to be converted
                Ex:  ['2022-04-15','2022-04-16']

    CALLING SEQUENCE:
     elf_convert_epd_mV2eng, trange=trange

     $LastChangedBy:
     $LastChangedDate:
     $LastChangedRevision:
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/projects/elfin/common/elf_convert_epd_mV2eng.pro $

(See projects/elfin/cal_data/elf_convert_epd_mv2eng.pro)

## ELF_GET_EPD_CALIBRATION

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

     PROCEDURE:
             elf_get_epd_calibration

     PURPOSE:
             returns epd calibration parameters

     OUTPUT:
             EPD calibration data structure
             cal_params include: epd_gf
                                 epd_overaccumulation_factors
                                 epd_thresh_factors
                                 epd_ch_efficiencies
                                 epd_cal_ch_factors
                                 epd_ebins
                                 epd_ebins_logmean
                                 epd_ebin_lbls

     KEYWORDS:
             trange:      start/stop time frame ['mmmm-yy-dd/hh:mm:ss','mmmm-yy-dd/hh:mm:ss']
             probe:       elfin probe name, 'a' or 'b'
             instrument:  epd instrument name, 'epde' or 'epdi'
             no_download: set this flag to turn off download and use local files only

     EXAMPLES:
             elf> cal_params = elf_get_epd_calibration(probe='a', instrument='epde', trange=tr)

     NOTES:
         There are still a few hard coded variables. There is also no calibration data for epdi

     HISTORY:

    $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_cal_mrmi.pro $

(See projects/elfin/cal_data/elf_get_epd_calibration.pro)

## ELF_GET_EPD_CALIBRATION_LOG

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

    PROCEDURE:
       elf_get_epd_calibration_log

    PURPOSE:
       This routine reads the epd calibration logs for ELFIN-A and ELFIN-B. The calibration logs
       contain information from operations such as threshold and efficiency values. This routine
       returns a structure with the following values
       epd_cal_logs = {cal_date:time_double(this_data[0]), $
                       probe:probe, $
                       epd_thresh_factors:float(this_data[24:25]), $
                       epd_ch_efficiencies:float(this_data[108:123]), $
                       epd_ebins:float(this_data[74:89])}

    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']
       instrument: 'epde' or 'epdi'
       probe:  name of probe 'a' or 'b'
       nodownload: set this flag to force routine to use local files

(See projects/elfin/cal_data/elf_get_epd_calibration_log.pro)

## ELF_READ_EPD_CALFILE

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

     PROCEDURE:
             elf_read_epd_calibration

     PURPOSE:
             returns epd calibration parameters

     OUTPUT:
             EPD calibration data structure
             cal_params include: epd_gf
                                 epd_overaccumulation_factors
                                 epd_thresh_factors
                                 epd_ch_efficiencies
                                 epd_cal_ch_factors
                                 epd_ebins
                                 epd_ebins_logmean
                                 epd_ebin_lbls

     KEYWORDS:
             probe:       elfin probe name, 'a' or 'b'
             instrument:  epd instrument name, 'epde' or 'epdi'
             no_download: if set this routine will look locally for calibration file

     EXAMPLES:
             elf> cal_params = elf_get_epd_calibration(probe='a', instrument='epde')

     NOTES:  This routine is obsolete and has been replaced by elf_read_epd_cal_data. Originally this
             routine was written to read the initial calibration data. The calibration data has now been
             split into 2 different files - one containing calibration data, the other containing operational
             data.

     HISTORY:

    $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_cal_mrmi.pro $

(See projects/elfin/cal_data/elf_read_epd_calfile.pro)

## ELF_READ_EPD_CAL_DATA

[Previous Routine] [List of Routines]

    PROCEDURE:
       elf_read_epd_cal_data

    PURPOSE:
       This routine retrieves and reads the epd calibration data files for ELFIN-A and ELFIN-B.
       The calibration files contain information needed to calibrate epd data. This routine
       returns a structure with the following values
       epd_cal_logs = {date:date, $
         probe:probe, $
         gf:gf, $
         overaccumulation_factors:overaccumulation_factors, $
         thresh_factors:thresh_factors, $
         ch_efficiencies:ch_efficiencies, $
         ebins:ebins}
       The structure returned is based on the time stamp passed as a parameter.

    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']
       instrument: 'epde' or 'epdi'
       probe:  name of probe 'a' or 'b'
       nodownload: set this flag to force routine to use local files

(See projects/elfin/cal_data/elf_read_epd_cal_data.pro)