    This function processes a 3D energy-time spectra from ELF EPD L2 data
    to produce pitch angle spectra, applying either specified energy bins
    or a defined energy range.

    Parameters
    ----------
        flux_tvar: str
            Tplot variable name of a 3d energy time spectra

        energybins: list of int, optional
            Specified the energy bins used for generating pitch angle spectra.
            Default is [(0,2),(3,5), (6,8), (9,15)], which bins energy as follows:
                ch0: Energy channels 0-2,
                ch1: Energy channels 3-5,
                ch2: Energy channels 6-8,
                ch3: Energy channels 9-15
            If both 'energybins' and 'energies' are set, 'energybins' takes precedence
            energy

        energies: list of tuple of float, optional
            Specifies the energy range for each bin in the pitch angle spectra.
            Example: energies=[(50.,160.),(160.,345.),(345.,900.),(900.,7000.)]
            If both 'energybins' and 'energies' are set, 'energybins' takes precedence.
            Energy and energybin table:
            channel     energy_range    energy_midbin
            0           50-80           63.2
            1           80-120          97.9
            2           120-160         138.5
            3           160-210         183.3
            4           210-270         238.1
            5           270-345         305.2
            6           345-430         385.1
            7           430-630         520.4
            8           630-900         752.9
            9           900-1300        1081.6
            10          1300-1800       1529.7
            11          1800-2500       2121.3
            12          2500-3350       2893.9
            13          3350-4150       3728.6
            14          4150-5800       4906.1
            15          5800+           6500.0
        Nodegap: bool, optional
            Flag for degap. If set, skip degap.
            Default is False.

    Return
    ----------
        List of tplot variable names for pitch angle spectra


    Calibrates data from the Energetic Particle Detector (EPD) and sets dlimits.

    Parameters
    ----------
        tplotnames : list of str
            The tplot names of EPD data to be postprocessed.

        trange : list of str
            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_ : str, optional
            Desired data type. Options: 'raw', 'cps', 'nflux', 'eflux'.

        nspinsinsum : int, optional
            Number of spins in sum which is needed by the calibration function.

        unit : str, optional
            Units of the data.

    Returns
    ----------
        List of tplot variables created.


    Process ELF EPD L2 data and generate omni, para, anti, perp flux spectra.

    Parameters
    ----------
        tplotnames : list of str
            The tplot names of EPD data to be postprocessed.

        fluxtype: str, optional
            Type of flux spectra.
            Options: 'nflux' for number flux, 'eflux' for energy flux.
            Default is 'nflux'.

        res: str, optional
            Resolution of spectra.
            Options: 'hs' for half spin, 'fs' for full spin.
            Default is 'hs'.

        datatype: str, optional
            Type of data.
            Options: 'e' for electron data, 'i' for ion data
            Default is 'e'.

        PAspec_energybins: list of tuple of int, optional
            Specified the energy bins used for generating l2 pitch angle spectra.
            Default is [(0,2),(3,5), (6,8), (9,15)]. If both 'PAspec_energybins' and 'PAspec_energies'
            are set, 'energybins' takes precedence

        PAspec_energies: list of tuple of float, optional
            Specifies the energy range for each bin in the l2 pitch angle spectra.
            Example: energies=[(50.,160.),(160.,345.),(345.,900.),(900.,7000.)]
            If both 'energybins' and 'energies' are set, 'energybins' takes precedence.
            Energy and energybin table:
            channel     energy_range    energy_midbin
            0           50-80           63.2
            1           80-120          97.9
            2           120-160         138.5
            3           160-210         183.3
            4           210-270         238.1
            5           270-345         305.2
            6           345-430         385.1
            7           430-630         520.4
            8           630-900         752.9
            9           900-1300        1081.6
            10          1300-1800       1529.7
            11          1800-2500       2121.3
            12          2500-3350       2893.9
            13          3350-4150       3728.6
            14          4150-5800       4906.1
            15          5800+           6500.0

        Espec_LCfatol: float, optional
            Tolerance angle for para and anti flux. A positive value makes the loss
            cone/antiloss cone smaller by this amount.
            Default is 22.25 deg.

        Espec_LCfptol: float, optional
            Tolerance angle for perp flux. A negative value means a wider angle for
            perp flux.
            Default is -11 deg.

    Returns
    ----------
        List of tplot variables created.


    Read ELFIN EPDE calibration data from file and return
    list of parsed calibration datasets.

    Parameters
    ----------
        path : pathlib.Path
            The path to the calibration data file.

    Returns
    ----------
        List of EPDE calibration data parsed from the file.


    Ported from IDL SPEDAS elf_cal_epd procedure. Originally authored
    by Colin Wilkins (colinwilkins@ucla.edu). Relevant comments on
    calibration details have been reproduced here.


    This function loads data from the ELFIN Magneto Resistive Magnetometer (MRMi)

    Parameters
    ----------
        trange : list of str
            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-19']]

        probe: str
            Spacecraft identifier ('a' or 'b')
            Default: 'a'

        datatype: str
            Data type; Valid options::

                'mrmi' for L1 data

            Default: 'mrmi'

        level: str
            Data level; options: 'l1'
            efault: 'l1'

        suffix: str
            The tplot variable names will be given this suffix.
            Default: no suffix is added.

        get_support_data: bool
            Data with an attribute "VAR_TYPE" with a value of "support_data"
            will be loaded into tplot.
            Default: only loads in data with a "VAR_TYPE" attribute of "data"

        varformat: str
            The file variable formats to load into tplot.  Wildcard character
            "*" is accepted.
            Default: all variables are loaded in

        varnames: list of str
            List of variable names to load
            Default: all data variables are loaded

        downloadonly: bool
            Set this flag to download the CDF files, but not load them into
            tplot variables
            Default: False

        notplot: bool
            Return the data in hash tables instead of creating tplot variables
            Default: False

        no_update: bool
            If set, only load data from your local cache
            Default: False

        time_clip: bool
            Time clip the variables to exactly the range specified in the trange keyword
            Default: False

        force_download: bool
            Download file even if local version is more recent than server version
            Default: False

    Returns
    ----------
        List of tplot variables created.

    Example
    ----------
        import pyspedas
        from pytplot import tplot
        mrmi_vars = pyspedas.projects.elfin.mrmi(probe='b', trange=['2022-08-19', '2022-08-19']
        tplot('elb_mrmi')


    This function loads data from the LEP instrument

    Parameters
    ----------
        trange : list of str
            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']

        datatype: str
            Data type; Valid options:

        suffix: str
            The tplot variable names will be given this suffix.  By default,
            no suffix is added.

        prefix: str
            The tplot variable names will be given this prefix.
            Default: no prefix is added

        get_support_data: bool
            Data with an attribute "VAR_TYPE" with a value of "support_data"
            will be loaded into tplot.  By default, only loads in data with a
            "VAR_TYPE" attribute of "data".

        varformat: str
            The file variable formats to load into tplot.  Wildcard character
            "*" is accepted.  By default, all variables are loaded in.

        varnames: list of str
            List of variable names to load (if not specified,
            all data variables are loaded)

        downloadonly: bool
            Set this flag to download the CDF files, but not load them into
            tplot variables

        notplot: bool
            Return the data in hash tables instead of creating tplot variables

        no_update: bool
            If set, only load data from your local cache

        time_clip: bool
            Time clip the variables to exactly the range specified in the trange keyword

        force_download: bool
            Download file even if local version is more recent than server version
            Default: False

    Returns
    ----------
        List of tplot variables created.


    This function loads data from the CPI instrument

    Parameters
    ----------
        trange : list of str
            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']

        datatype: str
            Data type; Valid options:

        suffix: str
            The tplot variable names will be given this suffix.  By default,
            no suffix is added.

        prefix: str
            The tplot variable names will be given this prefix.
            Default: no prefix is added

        get_support_data: bool
            Data with an attribute "VAR_TYPE" with a value of "support_data"
            will be loaded into tplot.  By default, only loads in data with a
            "VAR_TYPE" attribute of "data".

        varformat: str
            The file variable formats to load into tplot.  Wildcard character
            "*" is accepted.  By default, all variables are loaded in.

        varnames: list of str
            List of variable names to load (if not specified,
            all data variables are loaded)

        downloadonly: bool
            Set this flag to download the CDF files, but not load them into
            tplot variables

        notplot: bool
            Return the data in hash tables instead of creating tplot variables

        no_update: bool
            If set, only load data from your local cache

        time_clip: bool
            Time clip the variables to exactly the range specified in the trange keyword

        force_download: bool
            Download file even if local version is more recent than server version
            Default: False

    Returns
    ----------
        List of tplot variables created.


    This function loads data from the Geotail mission; this function is not meant
    to be called directly; instead, see the wrappers:
        pyspedas.projects.geotail.mgf
        pyspedas.projects.geotail.efd
        pyspedas.projects.geotail.lep
        pyspedas.projects.geotail.cpi
        pyspedas.projects.geotail.epi
        pyspedas.projects.geotail.pwi

    Parameters
    ----------
        trange : list of str
            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: ['2013-11-5', '2013-11-6']

        instrument: str
            Spacecraft identifier ('mgf', 'efd', 'lep', 'cpi', 'edi', 'pwi')
            Default: 'mgf'

        datatype: str
            Data type; Valid options: ('k0', ''eda3sec', 'edb3sec')
            Default: 'k0'

        suffix: str
            The tplot variable names will be given this suffix.
            Default: no suffix is added

        prefix: str
            The tplot variable names will be given this prefix.
            Default: no prefix is added

        get_support_data: bool
            Data with an attribute "VAR_TYPE" with a value of "support_data"
            will be loaded into tplot.
            Default: only loads in data with a "VAR_TYPE" attribute of "data".

        varformat: str
            The file variable formats to load into tplot.  Wildcard character
            "*" is accepted.
            Default: all variables are loaded in

        varnames: list of str
            List of variable names to load
            Default: all data variables are loaded

        downloadonly: bool
            Set this flag to download the CDF files, but not load them into
            tplot variables
            Default: False

        notplot: bool
            Return the data in hash tables instead of creating tplot variables
            Default: False

        no_update: bool
            If set, only load data from your local cache
            Default: False

        time_clip: bool
            Time clip the variables to exactly the range specified in the trange keyword
            Default: False

        force_download: bool
            Download file even if local version is more recent than server version
            Default: False

    Returns
    ----------
    list of str
        List of tplot variables created.

    Example
    ----------
    >>> import pyspedas
    >>> from pyspedas import tplot
    >>> mgf_vars = pyspedas.projects.geotail.mgf(trange=['2018-11-5', '2018-11-6'])
    >>> tplot(['IB', 'IB_vector'])

    >>> import pyspedas
    >>> from pyspedas import tplot
    >>> efd_vars = pyspedas.projects.geotail.efd(trange=['2018-11-5', '2018-11-6'])
    >>> tplot(['Es', 'Ss', 'Bs', 'Vs', 'Ew', 'Sw', 'Bw', 'Vw'])

    >>> import pyspedas
    >>> from pyspedas import tplot
    >>> lep_vars = pyspedas.projects.geotail.lep(trange=['2018-11-5/05:00', '2018-11-5/06:00'], time_clip=True)
    >>> tplot(['N0', 'V0'])

    >>> import pyspedas
    >>> from pyspedas import tplot
    >>> cpi_vars = pyspedas.projects.geotail.cpi(trange=['2018-11-5/15:00', '2018-11-5/18:00'], time_clip=True)
    >>> tplot(['SW_P_Den', 'SW_P_AVGE', 'SW_V', 'HP_P_Den'])

    >>> import pyspedas
    >>> from pyspedas import tplot
    >>> epic_vars = pyspedas.projects.geotail.epic(trange=['2018-11-5', '2018-11-6'])
    >>> tplot('IDiffI_I')

    >>> import pyspedas
    >>> from pyspedas import tplot
    >>> pwi_vars = pyspedas.projects.geotail.pwi(trange=['2018-11-5/06:00', '2018-11-5/07:00'], time_clip=True)
    >>> tplot(['MCAE_AVE', 'MCAB_AVE'])


    This function loads data from the EFD instrument

    Parameters
    ----------
        trange : list of str
            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']

        datatype: str
            Data type; Valid options:

        suffix: str
            The tplot variable names will be given this suffix.  By default,
            no suffix is added.

        prefix: str
            The tplot variable names will be given this prefix.
            Default: no prefix is added

        get_support_data: bool
            Data with an attribute "VAR_TYPE" with a value of "support_data"
            will be loaded into tplot.  By default, only loads in data with a
            "VAR_TYPE" attribute of "data".

        varformat: str
            The file variable formats to load into tplot.  Wildcard character
            "*" is accepted.  By default, all variables are loaded in.

        varnames: list of str
            List of variable names to load (if not specified,
            all data variables are loaded)

        downloadonly: bool
            Set this flag to download the CDF files, but not load them into
            tplot variables

        notplot: bool
            Return the data in hash tables instead of creating tplot variables

        no_update: bool
            If set, only load data from your local cache

        time_clip: bool
            Time clip the variables to exactly the range specified in the trange keyword

        force_download: bool
            Download file even if local version is more recent than server version
            Default: False

    Returns
    ----------
        List of tplot variables created.


    This function loads data from the MGF instrument

    Parameters
    ----------
        trange : list of str
            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']

        datatype: str
            Data type; Valid options:

        suffix: str
            The tplot variable names will be given this suffix.  By default,
            no suffix is added.

        prefix: str
            The tplot variable names will be given this prefix.
            Default: no prefix is added

        get_support_data: bool
            Data with an attribute "VAR_TYPE" with a value of "support_data"
            will be loaded into tplot.  By default, only loads in data with a
            "VAR_TYPE" attribute of "data".

        varformat: str
            The file variable formats to load into tplot.  Wildcard character
            "*" is accepted.  By default, all variables are loaded in.

        varnames: list of str
            List of variable names to load (if not specified,
            all data variables are loaded)

        downloadonly: bool
            Set this flag to download the CDF files, but not load them into
            tplot variables

        notplot: bool
            Return the data in hash tables instead of creating tplot variables

        no_update: bool
            If set, only load data from your local cache

        time_clip: bool
            Time clip the variables to exactly the range specified in the trange keyword

        force_download: bool
            Download file even if local version is more recent than server version
            Default: False

\
    Returns
    ----------
        List of tplot variables created.


    This function loads data from the PWI instrument

    Parameters
    ----------
        trange : list of str
            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']

        datatype: str
            Data type; Valid options:

        suffix: str
            The tplot variable names will be given this suffix.  By default,
            no suffix is added.

        prefix: str
            The tplot variable names will be given this prefix.
            Default: no prefix is added

        get_support_data: bool
            Data with an attribute "VAR_TYPE" with a value of "support_data"
            will be loaded into tplot.  By default, only loads in data with a
            "VAR_TYPE" attribute of "data".

        varformat: str
            The file variable formats to load into tplot.  Wildcard character
            "*" is accepted.  By default, all variables are loaded in.

        varnames: list of str
            List of variable names to load (if not specified,
            all data variables are loaded)

        downloadonly: bool
            Set this flag to download the CDF files, but not load them into
            tplot variables

        notplot: bool
            Return the data in hash tables instead of creating tplot variables

        no_update: bool
            If set, only load data from your local cache

        time_clip: bool
            Time clip the variables to exactly the range specified in the trange keyword

        force_download: bool
            Download file even if local version is more recent than server version
            Default: False

    Returns
    ----------
        List of tplot variables created.


    This function loads data from the EPIC instrument

    Parameters
    ----------
        trange : list of str
            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']

        datatype: str
            Data type; Valid options:

        suffix: str
            The tplot variable names will be given this suffix.  By default,
            no suffix is added.

        prefix: str
            The tplot variable names will be given this prefix.
            Default: no prefix is added

        get_support_data: bool
            Data with an attribute "VAR_TYPE" with a value of "support_data"
            will be loaded into tplot.  By default, only loads in data with a
            "VAR_TYPE" attribute of "data".

        varformat: str
            The file variable formats to load into tplot.  Wildcard character
            "*" is accepted.  By default, all variables are loaded in.

        varnames: list of str
            List of variable names to load (if not specified,
            all data variables are loaded)

        downloadonly: bool
            Set this flag to download the CDF files, but not load them into
            tplot variables

        notplot: bool
            Return the data in hash tables instead of creating tplot variables

        no_update: bool
            If set, only load data from your local cache

        time_clip: bool
            Time clip the variables to exactly the range specified in the trange keyword

        force_download: bool
            Download file even if local version is more recent than server version
            Default: False

    Returns
    ----------
        List of tplot variables created.


    Load FAST data into tplot variables.

    Parameters
    ----------
    trange : list of str, optional
        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 is ["1996-12-01", "1996-12-02"].
    instrument : str or list of str, optional
        Type of instrument.
        Values can be: 'dcf', 'acf', 'esa', 'teams', 'all'.
        If 'all' is specified, all instruments will be loaded.
        Default is 'dcf'.
    datatype : str, optional
        Data type to load. Depends on the instrument.
        For 'esa' valid options are: 'eeb', 'ees', 'ieb', 'ies'.
        For all other insturments, this keyword is ignored.
        Default is ''.
    level : str, optional
        Data level to load. Depends on the instrument.
        For 'dcf' and 'teams' valid options are: 'l2', 'k0'.
        For all other instruments, this keyword is ignored.
        Default is 'l2'.
    prefix : str, optional
        The tplot variable names will be given this prefix.
        Default is ''.
        In all cases a suitable prefix will be given depending on the instrument.
    suffix : str, optional
        The tplot variable names will be given this suffix.
        Default is no suffix is added.
    get_support_data : bool, optional
        Data with an attribute "VAR_TYPE" with a value of "support_data" will be loaded into tplot.
        Default is False; only loads in data with a "VAR_TYPE" attribute of "data".
    varformat : str, optional
        The file variable formats to load into tplot.
        Wildcard character "*" is accepted.
        Default is all variables are loaded in.
    varnames : list of str, optional
        List of variable names to load.
        Default is all data variables are loaded.
    downloadonly : bool, optional
        Set this flag to download the CDF files, but not load them into tplot variables.
        Default is False.
    notplot : bool, optional
        Return the data in hash tables instead of creating tplot variables.
        Default is False.
    no_update : bool, optional
        If set, only load data from your local cache.
        Default is False.
    time_clip : bool, optional
        Time clip the variables to exactly the range specified in the trange keyword.
        Default is False.
    force_download : bool, optional
        Download file even if local version is more recent than server version.
        Default is False.

    Returns
    -------
    list of str/dictionary
        List of tplot variables created.
        If downloadonly is set to True, returns a list of the downloaded files.
        If notplot is set to True, returns a dictionary of the data loaded.

    Examples
    --------
    >>> import pyspedas
    >>> from pyspedas import tplot
    >>> dcf_vars = pyspedas.projects.fast.dcf(trange=["1996-12-01", "1996-12-02"])
    >>> tplot(['fast_dcf_DeltaB_GEI'])
    >>> acf_vars = pyspedas.projects.fast.acf(trange=["1996-12-01", "1996-12-02"])
    >>> tplot('fast_acf_HF_E_SPEC')
    >>> esa_vars = pyspedas.projects.fast.esa(trange=["1996-12-01", "1996-12-02"])
    >>> tplot('fast_esa_eflux')
    >>> teams_vars = pyspedas.projects.fast.teams(trange=["2005-08-01", "2005-08-02"])
    >>> tplot(['fast_teams_helium_omni_flux'])


    Load Van Allen Probes (RBSP) data for various instruments and data levels.

    It is not intended to be called directly. Instead, use the following wrappers for specific instruments:
        - pyspedas.projects.rbsp.emfisis
        - pyspedas.projects.rbsp.rbspice
        - pyspedas.projects.rbsp.efw
        - pyspedas.projects.rbsp.mageis
        - pyspedas.projects.rbsp.hope
        - pyspedas.projects.rbsp.rept
        - pyspedas.projects.rbsp.rps

    Parameters
    ----------
    trange : list of str
        Time range of interest in the format ['YYYY-MM-DD', 'YYYY-MM-DD'] or
        ['YYYY-MM-DD/hh:mm:ss', 'YYYY-MM-DD/hh:mm:ss']. Default is ['2018-11-5', '2018-11-6'].

    probe : str or list of str, default='a'
        Spacecraft probe name: 'a' or 'b'

    instrument : str, default='emfisis'
        Name of the instrument.

    level : str, default='l3'
        Data level

    datatype : str, default='magnetometer'
        Instrument-specific data type.

        Suffix for the tplot variable names.
    prefix : str, default=''
        Prefix for the tplot variable names.

    suffix : str, default=''
        Suffix for the tplot variable names.

    force_download : bool, default=False
        Download file even if local version is more recent than server version.

    cadence : str, default='4sec'
        Data cadence

    coord : str, default='sm'
        Data coordinate system.

    wavetype : str, default='waveform'
        Type of level 2 waveform data (applicable for WFR and HFR data).

    rel : str, default='rel04'
        Data release version (for ECT data).

    get_support_data : bool, default=False
        If True, loads data with attribute "VAR_TYPE" of "support_data".

    varformat : str, optional
        The file variable formats to load. Accepts wildcard character "*".

    varnames : list of str, optional
        List of variable names to load. If not specified, all variables are loaded.

    downloadonly : bool, default=False
        If True, downloads the CDF files but does not load them into tplot variables.

    notplot : bool, default=False
        If True, returns data in hash tables instead of creating tplot variables.

    no_update : bool, default=False
        If True, only load data from the local cache.

    time_clip : bool, default=False
        If True, clips the variables to the specified range in trange.

    Returns
    -------
    tvars : dict or list
        List of created tplot variables or dict of data tables if notplot is True.

    Examples
    --------
    This function is not intended to be called directly.


    This function loads the Mag Ephemeris data for the Van Allen Probes
    The data is available from:
    https://spdf.gsfc.nasa.gov/pub/data/rbsp/rbspa/ephemeris

    Parameters
    ----------
        trange : list of str, default=['2018-11-5', '2018-11-6']
            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 : str or list of str, default='a'
            Spacecraft probe name: 'a' or 'b'

        cadence : str, default='1min'
            Data cadence; options: '1min', '5min'

        coord : str, default='op77q'
            Data coordinate system. options: 'op77q', 't89d', 't89q', and 'ts04d'

        prefix : str, optional
            The tplot variable names will be given this prefix. By default, no prefix is added.

        suffix : str, optional
            Suffix for tplot variable names. By default, no suffix is added.

        force_download : bool, default=False
            Download file even if local version is more recent than server version.

        get_support_data : bool, default=False
            Data with an attribute "VAR_TYPE" with a value of "support_data"
            will be loaded into tplot. By default, only loads in data with a
            "VAR_TYPE" attribute of "data".

        varformat : str, optional
            The file variable formats to load into tplot. Wildcard character
            "*" is accepted. By default, all variables are loaded in.

        varnames: list of str, optional
            List of variable names to load (if not specified,
            all data variables are loaded)

        downloadonly: bool, default=False
            Set this flag to download the CDF files, but not load them into
            tplot variables

        notplot: bool, default=False
            Return the data in hash tables instead of creating tplot variables

        no_update: bool, default=False
            If set, only load data from your local cache

        time_clip: bool, default=False
            Time clip the variables to exactly the range specified in the trange keyword

    Returns
    -------
    tvars : dict or list
        List of created tplot variables or dict of data tables if notplot is True.

    Examples
    --------
    >>> magephem_vars = pyspedas.projects.rbsp.magephem(trange=['2018-11-5/10:00', '2018-11-5/15:00'], cadence='1min', coord='op77q', time_clip=True)
    >>> tplot(['L','Lsimple','Kp','Dst'])


    @Author: Xiangning Chu, 2025-04-07
    Load magnetic field line mapping ephemeris data for the Van Allen Probes from the ECT website.

    This function retrieves and processes magnetic field line mapping data from the ECT website
    (https://rbsp-ect.newmexicoconsortium.org/data_pub/), which is particularly useful for periods
    when data is not available through CDAWeb. The data includes magnetic field line mapping parameters
    such as L-shell, MLT, and magnetic coordinates in various coordinate systems.

    Parameters
    ----------
    trange : list of str, default=['2018-11-5', '2018-11-6']
        Time range of interest [starttime, endtime] with the format:
        - ['YYYY-MM-DD', 'YYYY-MM-DD'] for daily ranges
        - ['YYYY-MM-DD/hh:mm:ss', 'YYYY-MM-DD/hh:mm:ss'] for specific time ranges

    probe : str or list of str, default='a'
        Spacecraft probe identifier: 'a' for RBSP-A or 'b' for RBSP-B

    cadence : str, default='1min'
        Temporal resolution of the data:
        - '1min': 1-minute resolution
        - '5min': 5-minute resolution

    coord : str, default='op77q'
        Magnetic coordinate system for the data:
        - 'op77q': Olson-Pfitzer quiet model
        - 't89d': Tsyganenko 1989 dynamic model
        - 't89q': Tsyganenko 1989 quiet model
        - 'ts04d': Tsyganenko-Sitnov 2004 dynamic model

    filetype : str, default='h5'
        File format for data retrieval:
        - 'h5': HDF5 format
        - 'txt': ASCII text format

    prefix : str, optional
        Prefix to be added to tplot variable names

    suffix : str, optional
        Suffix to be added to tplot variable names

    force_download : bool, default=False
        If True, forces download even if local version is more recent

    get_support_data : bool, default=False
        If True, loads support data (VAR_TYPE="support_data") into tplot

    varformat : str, optional
        File variable format to load into tplot (wildcard "*" accepted)

    varnames : list of str, optional
        Specific variable names to load (if empty, loads all variables)

    downloadonly : bool, default=False
        If True, downloads files without loading into tplot variables

    notplot : bool, default=False
        If True, returns data in hash tables instead of tplot variables

    no_update : bool, default=False
        If True, only loads data from local cache

    time_clip : bool, default=False
        If True, clips variables to exact time range specified in trange

    Returns
    -------
    tvars : dict or list
        List of created tplot variables or dict of data tables if notplot is True

    Examples
    --------
    >>> # Load 1-minute resolution data in Olson-Pfitzer quiet coordinates
    >>> magephem_vars = pyspedas.projects.rbsp.magephem_ect(
    ...     trange=['2018-11-5/10:00', '2018-11-5/15:00'],
    ...     cadence='1min',
    ...     coord='op77q',
    ...     time_clip=True
    ... )
    >>> # Plot L-shell and magnetic coordinates
    >>> tplot(['L', 'Lsimple', 'Kp', 'Dst'])

    Notes
    -----
    - This function is particularly useful for periods when data is not available through CDAWeb
    - The data includes magnetic field line mapping parameters essential for radiation belt studies
    - Coordinate systems are based on different magnetic field models for various geomagnetic conditions


    This function loads data from the Radiation Belt Storm Probes Ion Composition Experiment (RBSPICE) instrument

    Parameters
    ----------
        trange : list of str, default=['2018-11-5', '2018-11-6']
            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 : str or list of str, default='a'
            Spacecraft probe name: 'a' or 'b'

        datatype: str, default='TOFxEH'
            Data type; Valid options are specific to different data levels.

        level : str, default='l3'
            Data level. Valid options: 'l1', 'l2', 'l3'

        prefix : str, optional
            The tplot variable names will be given this prefix. By default, no prefix is added.

        suffix: str, optional
            The tplot variable names will be given this suffix.  By default,
            no suffix is added.

        force_download : bool, default=False
            Download file even if local version is more recent than server version.

        get_support_data: bool, default=True
            Data with an attribute "VAR_TYPE" with a value of "support_data"
            will be loaded into tplot.  By default, only loads in data with a
            "VAR_TYPE" attribute of "data".

        varformat: str, optional
            The file variable formats to load into tplot.  Wildcard character
            "*" is accepted.  By default, all variables are loaded in.

        varnames: list of str
            List of variable names to load (if not specified,
            all data variables are loaded)

        downloadonly: bool, default=False
            Set this flag to download the CDF files, but not load them into
            tplot variables

        notplot: bool, default=False
            Return the data in hash tables instead of creating tplot variables

        no_update: bool, default=False
            If set, only load data from your local cache

        time_clip: bool, default=False
            Time clip the variables to exactly the range specified in the trange keyword

    Returns
    -------
    tvars : dict or list
        List of created tplot variables or dict of data tables if notplot is True.

    Examples
    --------
    >>> rbspice_vars = pyspedas.projects.rbsp.rbspice(trange=['2018-11-5', '2018-11-6'], datatype='TOFxEH', level='l3')
    >>> tplot('rbspa_rbspice_l3_TOFxEH_proton_omni_spin')

    # Calculate the pitch angle distributions
    >>> from pyspedas.projects.rbsp.rbspice_lib.rbsp_rbspice_pad import rbsp_rbspice_pad
    >>> rbsp_rbspice_pad(probe='a', datatype='TOFxEH', level='l3')
    >>> tplot('rbspa_rbspice_l3_TOFxEH_proton_omni_0-1000keV_pad_spin')


    This function loads data from the Energetic Particle, Composition, and Thermal Plasma Suite (ECT)

    Parameters
    ----------
        trange : list of str, default=['2015-11-5', '2015-11-6']
            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 : str or list of str, default='a'
            Spacecraft probe name: 'a' or 'b'

        datatype : str, default='moments'
            Data type. Valid options are specific to different data levels.

        level : str, default='l3'
            Data level. Valid options: 'l1', 'l2', 'l3', 'l4'

        rel : str, default='rel04'
            Release version of the data.

        prefix : str, optional
            The tplot variable names will be given this prefix. By default, no prefix is added.

        suffix: str, optional
            The tplot variable names will be given this suffix.  By default,
            no suffix is added.

        force_download : bool, default=False
            Download file even if local version is more recent than server version.

        get_support_data: bool, default=False
            Data with an attribute "VAR_TYPE" with a value of "support_data"
            will be loaded into tplot.  By default, only loads in data with a
            "VAR_TYPE" attribute of "data".

        varformat: str, optional
            The file variable formats to load into tplot.  Wildcard character
            "*" is accepted.  By default, all variables are loaded in.

        varnames: list of str, optional
            List of variable names to load (if not specified,
            all data variables are loaded)

        downloadonly: bool, default=False
            Set this flag to download the CDF files, but not load them into
            tplot variables

        notplot: bool, default=False
            Return the data in hash tables instead of creating tplot variables

        no_update: bool, default=False
            If set, only load data from your local cache

        time_clip: bool, default=False
            Time clip the variables to exactly the range specified in the trange keyword

    Returns
    -------
    tvars : dict or list
        List of created tplot variables or dict of data tables if notplot is True.

    Examples
    --------
    >>> hope_vars = pyspedas.projects.rbsp.hope(trange=['2018-11-5', '2018-11-6'], datatype='moments', level='l3', rel='rel04')
    >>> tplot('Ion_density')


    This function loads data from the Energetic Particle, Composition, and Thermal Plasma Suite (ECT)

    Parameters
    ----------
        trange : list of str, default=['2015-11-5', '2015-11-6']
            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 : str or list of str, default='a'
            Spacecraft probe name: 'a' or 'b'

        datatype : str, default=''
            Data type. Valid options are specific to different data levels.

        level : str, default='l3'
            Data level. Valid options: 'l1', 'l2', 'l3', 'l4'

        rel : str, default='rel03'
            Release version of the data.

        prefix : str, optional
            The tplot variable names will be given this prefix. By default, no prefix is added.

        suffix: str, optional
            The tplot variable names will be given this suffix.  By default,
            no suffix is added.

        force_download : bool, default=False
            Download file even if local version is more recent than server version.

        get_support_data: bool, default=False
            Data with an attribute "VAR_TYPE" with a value of "support_data"
            will be loaded into tplot.  By default, only loads in data with a
            "VAR_TYPE" attribute of "data".

        varformat: str, optional
            The file variable formats to load into tplot.  Wildcard character
            "*" is accepted.  By default, all variables are loaded in.

        varnames: list of str, optional
            List of variable names to load (if not specified,
            all data variables are loaded)

        downloadonly: bool, default=False
            Set this flag to download the CDF files, but not load them into
            tplot variables

        notplot: bool, default=False
            Return the data in hash tables instead of creating tplot variables

        no_update: bool, default=False
            If set, only load data from your local cache

        time_clip: bool, default=False
            Time clip the variables to exactly the range specified in the trange keyword

    Returns
    -------
    tvars : dict or list
        List of created tplot variables or dict of data tables if notplot is True.

    Examples
    --------
    >>> rept_vars = pyspedas.projects.rbsp.rept(trange=['2018-11-5', '2018-11-6'], level='l3', rel='rel03')
    >>> tplot('FEDU')


    This function loads data from the Relativistic Proton Spectrometer (RPS)

    Parameters
    ----------
        trange : list of str, default=['2015-11-5', '2015-11-6']
            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 : str or list of str, default='a'
            Spacecraft probe name: 'a' or 'b'

        datatype : str, default='rps-1min'
            Data type. Valid options are specific to different data levels.

        level : str, default='l2'
            Data level. Valid options: 'l1', 'l2', 'l3', 'l4'

        prefix : str, optional
            The tplot variable names will be given this prefix. By default, no prefix is added.

        suffix: str, optional
            The tplot variable names will be given this suffix.  By default,
            no suffix is added.

        force_download : bool, default=False
            Download file even if local version is more recent than server version.

        get_support_data: bool, default=True
            Data with an attribute "VAR_TYPE" with a value of "support_data"
            will be loaded into tplot.  By default, only loads in data with a
            "VAR_TYPE" attribute of "data".

        varformat: str, optional
            The file variable formats to load into tplot.  Wildcard character
            "*" is accepted.  By default, all variables are loaded in.

        varnames: list of str, optional
            List of variable names to load (if not specified,
            all data variables are loaded)

        downloadonly: bool, default=False
            Set this flag to download the CDF files, but not load them into
            tplot variables

        notplot: bool, default=False
            Return the data in hash tables instead of creating tplot variables

        no_update: bool, default=False
            If set, only load data from your local cache

        time_clip: bool, default=False
            Time clip the variables to exactly the range specified in the trange keyword

    Returns
    -------
    tvars : dict or list
        List of created tplot variables or dict of data tables if notplot is True.

    Examples
    --------
    >>> rps_vars = pyspedas.projects.rbsp.rps(trange=['2018-11-5', '2018-11-6'], datatype='rps', level='l2')
    >>> tplot('DOSE1')


    This function loads data from the Energetic Particle, Composition, and Thermal Plasma Suite (ECT)

    Parameters
    ----------
        trange : list of str, default=['2015-11-5', '2015-11-6']
            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 : str or list of str, default='a'
            Spacecraft probe name: 'a' or 'b'

        datatype : str, default=''
            Data type. Valid options are specific to different data levels.

        level : str, default='l3'
            Data level. Valid options: 'l1', 'l2', 'l3', 'l4'

        rel : str, default='rel04'
            Release version of the data.

        prefix : str, optional
            The tplot variable names will be given this prefix. By default, no prefix is added.

        suffix: str, optional
            The tplot variable names will be given this suffix.  By default,
            no suffix is added.

        force_download : bool, default=False
            Download file even if local version is more recent than server version.

        get_support_data: bool, default=False
            Data with an attribute "VAR_TYPE" with a value of "support_data"
            will be loaded into tplot.  By default, only loads in data with a
            "VAR_TYPE" attribute of "data".

        varformat: str, optional
            The file variable formats to load into tplot.  Wildcard character
            "*" is accepted.  By default, all variables are loaded in.

        varnames: list of str, optional
            List of variable names to load (if not specified,
            all data variables are loaded)

        downloadonly: bool, default=False
            Set this flag to download the CDF files, but not load them into
            tplot variables

        notplot: bool, default=False
            Return the data in hash tables instead of creating tplot variables

        no_update: bool, default=False
            If set, only load data from your local cache

        time_clip: bool, default=False
            Time clip the variables to exactly the range specified in the trange keyword

    Returns
    -------
    tvars : dict or list
        List of created tplot variables or dict of data tables if notplot is True.

    Examples
    --------
    >>> mageis_vars = pyspedas.projects.rbsp.mageis(trange=['2018-11-5', '2018-11-6'], level='l3', rel='rel04')
    >>> tplot('I')


    Retrieves available datasets for the specified instrument on the Van Allen Probes (RBSP) mission.

    Parameters
    ----------
    instrument : str, optional
        Name of the instrument for which to find datasets. If None, finds datasets for all instruments on the mission.

    label : bool, default=True
        If True, the function prints both the dataset ID and label. If False, only the dataset ID is printed.

    Returns
    -------
    list of str
        List of available datasets for the specified instrument or for all instruments if no instrument is specified.

    Examples
    --------
    >>> pyspedas.projects.rbsp.find_datasets(instrument='REPT', label=True)
    ...
    RBSPA_REL03_ECT-REPT-SCI-L3: RBSP/ECT REPT Pitch Angle Resolved Electron and Proton Fluxes. Electron energies: 2 - 59.45 MeV. Proton energies: 21.25 - 0 MeV - D. Baker (University of Colorado at Boulder)
    ...


    This function loads data from the Electric Field and Waves Suite (EFW)

    Parameters
    ----------
        trange : list of str, default=['2015-11-5', '2015-11-6']
            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 : str or list of str, default='a'
            Spacecraft probe name: 'a' or 'b'

        datatype : str, default='spec'
            Data type. Valid options are specific to different data levels.

        level : str, default='l3'
            Data level. Valid options: 'l1', 'l2', 'l3', 'l4'

        prefix : str, optional
            The tplot variable names will be given this prefix. By default, no prefix is added.

        suffix : str, optional
            The tplot variable names will be given this suffix.  By default,
            no suffix is added.

        force_download : bool, default=False
            Download file even if local version is more recent than server version

        get_support_data: bool, default=False
            Data with an attribute "VAR_TYPE" with a value of "support_data"
            will be loaded into tplot.  By default, only loads in data with a
            "VAR_TYPE" attribute of "data".

        varformat: str, optional
            The file variable formats to load into tplot.  Wildcard character
            "*" is accepted.  By default, all variables are loaded in.

        varnames: list of str, optional
            List of variable names to load (if not specified,
            all data variables are loaded)

        downloadonly: bool, default=False
            Set this flag to download the CDF files, but not load them into
            tplot variables

        notplot: bool, default=False
            Return the data in hash tables instead of creating tplot variables

        no_update: bool, default=False
            If set, only load data from your local cache

        time_clip: bool, default=False
            Time clip the variables to exactly the range specified in the trange keyword

    Returns
    -------
    tvars : dict or list
        List of created tplot variables or dict of data tables if notplot is True.

    Examples
    --------
    >>> efw_vars = pyspedas.projects.rbsp.efw(trange=['2015-11-5', '2015-11-6'], level='l3')
    >>> tplot(['efield_in_inertial_frame_spinfit_mgse', 'spacecraft_potential'])


Read the txt file and return the data as a dictionary or save to tplot variables.


Read the h5 file and return the data as a dictionary or save to tplot variables.


    This function loads data from the Electric and Magnetic Field Instrument Suite and Integrated Science (EMFISIS) instrument

    For information on the EMFISIS data products, see:
        https://emfisis.physics.uiowa.edu/data/level_descriptions
        https://emfisis.physics.uiowa.edu/data/L2_products

    Parameters
    ----------
        trange : list of str, default=['2018-11-5', '2018-11-6']
            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 : str or list of str, default='a'
            Spacecraft probe name: 'a' or 'b'

        datatype : str, default='magnetometer'
            Data type with options varying by data level.
            Level 1:

                'magnetometer'
                'hfr'
                'housekeeping'
                'sc-hk'
                'spaceweather'
                'wfr'
                'wna'

            Level 2:

                'magnetometer'
                'wfr'
                'hfr'
                'housekeeping'

            Level 3:

                'magnetometer'

            Level 4:

                'density'
                'wna-survey'

        level : str, default='l3'
            Data level; options: 'l1', 'l2', 'l3', l4'

        cadence : str, default='4sec'
            Data cadence; options: '1sec', 'hires', '4sec'

        coord : str, default='sm'
            Data coordinate system

        wavetype : str, default='waveform'
            Type of level 2 waveform data with options:

                For WFR data:

                    'waveform' (default)
                    'waveform-continuous-burst'
                    'spectral-matrix'
                    'spectral-matrix-diagonal'
                    'spectral-matrix-diagonal-merged'

                For HFR data:

                    'waveform'
                    'spectra'
                    'spectra-burst'
                    'spectra-merged'

        prefix : str, optional
            The tplot variable names will be given this prefix. By default, no prefix is added.

        suffix : str, optional
            Suffix for tplot variable names. By default, no suffix is added.

        force_download : bool, default=False
            Download file even if local version is more recent than server version.

        get_support_data : bool, default=False
            Data with an attribute "VAR_TYPE" with a value of "support_data"
            will be loaded into tplot. By default, only loads in data with a
            "VAR_TYPE" attribute of "data".

        varformat : str, optional
            The file variable formats to load into tplot. Wildcard character
            "*" is accepted. By default, all variables are loaded in.

        varnames: list of str, optional
            List of variable names to load (if not specified,
            all data variables are loaded)

        downloadonly: bool, default=False
            Set this flag to download the CDF files, but not load them into
            tplot variables

        notplot: bool, default=False
            Return the data in hash tables instead of creating tplot variables

        no_update: bool, default=False
            If set, only load data from your local cache

        time_clip: bool, default=False
            Time clip the variables to exactly the range specified in the trange keyword

    Returns
    -------
    tvars : dict or list
        List of created tplot variables or dict of data tables if notplot is True.

    Examples
    --------
    >>> emfisis_vars = pyspedas.projects.rbsp.emfisis(trange=['2018-11-5/10:00', '2018-11-5/15:00'], datatype='magnetometer', level='l3', time_clip=True)
    >>> tplot(['Mag', 'Magnitude'])


    Works on previously loaded RBSPICE tplot variables: adds energy channel energy values to primary data variable, separates non-H species variables,
    creates variables for individual telescopes, and sets appropriate tplot options

    Parameters
    ----------
    level : str, default='l3'
        data level 'l1','l2','l3'

    probe : str or list of str, default='a'
        Spacecraft probe name: 'a' or 'b'

    datatype : str, default='TOFxEH'
        RBSPICE data type: 'EBR','ESRHELT','ESRLEHT','IBR','ISBR','ISRHELT','TOFxEH' (default),'TOFxEIon','TOFxEnonH','TOFxPHHHELT','TOFxPHHLEHT'
        but change for different data levels.

    Returns
    -------
    None

    Examples
    --------
    This function is called within pyspedas.projects.rbsp.rbspice


    Calculates the omni-directional flux for all 6 telescopes

    Parameters
    ----------
    probe : str or list of str, default='a'
        Spacecraft probe name: 'a' or 'b'

    datatype: str, default='TOFxEH'
        RBSPICE data type::

         'EBR', 'ESRHELT', 'ESRLEHT', 'IBR', 'ISBR', 'ISRHELT',
         'TOFxEH', 'TOFxEIon', 'TOFxEnonH', 'TOFxPHHHELT', 'TOFxPHHLEHT'

        Values depends on different data levels.

    level : str, default='l3'
        data level: 'l1','l2','l3'

    Returns
    -------
    out : list
        Tplot variables created

    Examples
    --------
    This function is called within pyspedas.projects.rbsp.rbspice


    Calculates spin-averaged fluxes for the RBSPICE instrument

    Parameters
    ----------
    probe : str or list of str, default='a'
        Spacecraft probe name: 'a' or 'b'

    datatype: str, default='TOFxEH'
        desired data type: 'TOFxEH', 'TOFxEnonH'

    level : str, default='l3'
        data level: 'l1','l2','l3'

    Returns
    --------
    out, list
        Tplot variables created

    Examples
    --------
    This function is called within pyspedas.projects.rbsp.rbspice


    Calculate pitch angle distributions using data from the
    RBSP Radiation Belt Storm Probes Ion Composition Experiment (RBSPICE)

    Parameters
    ----------
    probe : str or list of str, default='a'
        Spacecraft probe name: 'a' or 'b'

    datatype: str, default='TOFxEH'
        desired data type: 'TOFxEH', 'TOFxEnonH'

    level : str, default='l3'
        data level: 'l1','l2','l3'

    energy : list, default=[0,1000]
        user-defined energy range to include in the calculation in keV

    bin_size : float, default=15
        desired size of the pitch angle bins in degrees

    scopes : list, optional
        string array of telescopes to be included in PAD [0-5, default is all]

    Returns
    -------
    out : list
        Tplot variables created

    Examples
    --------
    >>> rbspice_vars = pyspedas.projects.rbsp.rbspice(trange=['2018-11-5', '2018-11-6'], datatype='TOFxEH', level='l3')
    >>> tplot('rbspa_rbspice_l3_TOFxEH_proton_omni_spin')

    >>> # Calculate the pitch angle distributions
    >>> from pyspedas.projects.rbsp.rbspice_lib.rbsp_rbspice_pad import rbsp_rbspice_pad
    >>> rbsp_rbspice_pad(probe='a', datatype='TOFxEH', level='l3')
    >>> tplot('rbspa_rbspice_l3_TOFxEH_proton_omni_0-1000keV_pad')


    Calculates spin-averaged pitch angle distributions using data from the
    RBSP Radiation Belt Storm Probes Ion Composition Experiment (RBSPICE)

    Parameters
    ----------
    probe : str or list of str, default='a'
        Spacecraft probe name: 'a' or 'b'

    datatype: str, default='TOFxEH'
        desired data type: 'TOFxEH', 'TOFxEnonH'

    level : str, default='l3'
        data level: 'l1','l2','l3'

    species : str, default='proton'
        desired ion species: 'proton' , 'helium', 'oxygen'

    energy : list, default=[0,1000]
        user-defined energy range to include in the calculation in keV

    bin_size : float, default = 15.
        desired size of the pitch angle bins in degrees

    scopes : list, optional
        string array of telescopes to be included in PAD [0-5, default is all]

    Returns
    --------
    out : list
        Tplot variables created

    Examples
    --------
    >>> rbspice_vars = pyspedas.projects.rbsp.rbspice(trange=['2018-11-5', '2018-11-6'], datatype='TOFxEH', level='l3')
    >>> tplot('rbspa_rbspice_l3_TOFxEH_proton_omni_spin')

    # Calculate the pitch angle distributions
    >>> from pyspedas.projects.rbsp.rbspice_lib.rbsp_rbspice_pad import rbsp_rbspice_pad_spinavg
    >>> rbsp_rbspice_pad_spinavg(probe='a', datatype='TOFxEH', level='l3')
    >>> tplot('rbspa_rbspice_l3_TOFxEH_proton_omni_0-1000keV_pad_spin')


    Load data from the Cluster Digital Wave Processing instrument

    Parameters
    ----------
        trange : list of str
            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: ['2018-11-5', '2018-11-6']

        probe: list of str
            List of probes to load.  Valid options: '1','2','3','4'
            Default: '1'

        datatype: str
            Data type; Valid options:
            Default: 'pp'

        prefix: str
            The tplot variable names will be given this prefix.
            Default: ''

        suffix: str
            The tplot variable names will be given this suffix.
            Default: ''

        get_support_data: bool
            If True, Data with an attribute "VAR_TYPE" with a value of "support_data"
            will be loaded into tplot.

        varformat: str
            The file variable formats to load into tplot.  Wildcard character
            "*" is accepted. If empty or None, all variables will be loaded.
            Default: None (all variables loaded)

        varnames: list of str
            List of CDF variable names to load (if empty or not specified,
            all data variables are loaded)
            Default: [] (all variables loaded)

        downloadonly: bool
            Set this flag to download the CDF files, but not load them into
            tplot variables
            Default: False

        notplot: bool
            Return the data in hash tables instead of creating tplot variables
            Default: False

        no_update: bool
            If set, only load data from your local cache
            Default: False

        time_clip: bool
            Time clip the variables to exactly the range specified in the trange keyword
            Default: False

        force_download: bool
            Download file even if local version is more recent than server version
            Default: False

    Returns
    -------
        list of str
            List of tplot variables created.

    Examples
    --------
    >>> import pyspedas
    >>> from pyspedas import tplot
    >>> dwp_vars = pyspedas.projects.cluster.dwp(trange=['2003-11-01','2003-11-02'],probe=['1','2'])
    >>> tplot(['Correl_freq__C1_PP_DWP','Correl_P__C1_PP_DWP'])


    Load data from the Cluster Ion Spectroscopy experiment

    Parameters
    ----------
        trange : list of str
            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: ['2018-11-5', '2018-11-6']

        probe: list of str
            List of probes to load.  Valid options: '1','2','3','4'
            Default: '1'

        datatype: str
            Data type; Valid options:
            Default: 'pp'

        prefix: str
            The tplot variable names will be given this prefix.
            Default: ''

        suffix: str
            The tplot variable names will be given this suffix.
            Default: ''

        get_support_data: bool
            If True, Data with an attribute "VAR_TYPE" with a value of "support_data"
            will be loaded into tplot.

        varformat: str
            The file variable formats to load into tplot.  Wildcard character
            "*" is accepted. If empty or None, all variables will be loaded.
            Default: None (all variables loaded)

        varnames: list of str
            List of CDF variable names to load (if empty or not specified,
            all data variables are loaded)
            Default: [] (all variables loaded)

        downloadonly: bool
            Set this flag to download the CDF files, but not load them into
            tplot variables
            Default: False

        notplot: bool
            Return the data in hash tables instead of creating tplot variables
            Default: False

        no_update: bool
            If set, only load data from your local cache
            Default: False

        time_clip: bool
            Time clip the variables to exactly the range specified in the trange keyword
            Default: False

        force_download: bool
            Download file even if local version is more recent than server version
            Default: False

    Returns
    -------
        list of str
            List of tplot variables created.

    Examples
    --------
    >>> import pyspedas
    >>> from pyspedas import tplot
    >>> cis_vars = pyspedas.projects.cluster.cis(trange=['2003-11-01','2003-11-02'],probe=['1'])
    >>> tplot(['N_p__C1_PP_CIS','N_O1__C1_PP_CIS','N_He1__C1_PP_CIS','N_He2__C1_PP_CIS','N_HIA__C1_PP_CIS'])


    Query SPDF for datasets available for a given Cluster instrument

    Parameters
    ----------
        instrument : str
            Instrument to use in query. Valid options: 'ASP','CIS','DWP','EDI','EFW','FGM','PEA','RAP','STA','WBD','WHI'
            Default: None

        label: bool
            If True, print both the dataset name and label; otherwise print only the dataset name.

    Examples
    --------
    >>> import pyspedas
    >>> pyspedas.projects.cluster.datasets('FGM')


    Load data from the Cluster Active Spacecraft Potential Control experiment

    Parameters
    ----------
        trange : list of str
            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: ['2003-11-5', '2003-11-6']

        probe: list of str
            List of probes to load.  Valid options: '1','2','3','4'
            Default: '1'

        datatype: str
            Data type; Valid options:
            Default: 'pp'

        prefix: str
            The tplot variable names will be given this prefix.
            Default: ''

        suffix: str
            The tplot variable names will be given this suffix.
            Default: ''

        get_support_data: bool
            If True, Data with an attribute "VAR_TYPE" with a value of "support_data"
            will be loaded into tplot.

        varformat: str
            The file variable formats to load into tplot.  Wildcard character
            "*" is accepted. If empty or None, all variables will be loaded.
            Default: None (all variables loaded)

        varnames: list of str
            List of CDF variable names to load (if empty or not specified,
            all data variables are loaded)
            Default: [] (all variables loaded)

        downloadonly: bool
            Set this flag to download the CDF files, but not load them into
            tplot variables
            Default: False

        notplot: bool
            Return the data in hash tables instead of creating tplot variables
            Default: False

        no_update: bool
            If set, only load data from your local cache
            Default: False

        time_clip: bool
            Time clip the variables to exactly the range specified in the trange keyword
            Default: False

        force_download: bool
            Download file even if local version is more recent than server version
            Default: False

    Returns
    -------
        list of str
            List of tplot variables created.

    Examples
    --------
    >>> import pyspedas
    >>> from pyspedas import tplot
    >>> aspoc_vars=pyspedas.projects.cluster.aspoc(trange=['2003-11-05','2003-11-06'],probe=['1','2'])
    >>> tplot(['I_ion__C1_PP_ASP','I_ion__C2_PP_ASP'])


    Load data from the Cluster Spatio-Temporal Analysis of Field Fluctuation experiment

    Parameters
    ----------
        trange : list of str
            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: ['2018-11-5', '2018-11-6']

        probe: list of str
            List of probes to load.  Valid options: '1','2','3','4'
            Default: '1'

        datatype: str
            Data type; Valid options:
            Default: 'pp'

        prefix: str
            The tplot variable names will be given this prefix.
            Default: ''

        suffix: str
            The tplot variable names will be given this suffix.
            Default: ''

        get_support_data: bool
            If True, Data with an attribute "VAR_TYPE" with a value of "support_data"
            will be loaded into tplot.

        varformat: str
            The file variable formats to load into tplot.  Wildcard character
            "*" is accepted. If empty or None, all variables will be loaded.
            Default: None (all variables loaded)

        varnames: list of str
            List of CDF variable names to load (if empty or not specified,
            all data variables are loaded)
            Default: [] (all variables loaded)

        downloadonly: bool
            Set this flag to download the CDF files, but not load them into
            tplot variables
            Default: False

        notplot: bool
            Return the data in hash tables instead of creating tplot variables
            Default: False

        no_update: bool
            If set, only load data from your local cache
            Default: False

        time_clip: bool
            Time clip the variables to exactly the range specified in the trange keyword
            Default: False

        force_download: bool
            Download file even if local version is more recent than server version
            Default: False

    Returns
    -------
        list of str
            List of tplot variables created.

    Examples
    --------
    >>> import pyspedas
    >>> from pyspedas import tplot
    >>> staff_vars = pyspedas.projects.cluster.staff(trange=['2003-11-01','2003-11-02'],probe=['1','2'])
    >>> tplot(['B_par_f1__C1_PP_STA', 'B_perp_f1__C1_PP_STA', 'B_par_f1__C2_PP_STA', 'B_perp_f1__C2_PP_STA'])


    Load data from the Cluster Electron Drift Instrument

    Parameters
    ----------
        trange : list of str
            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: ['2018-11-5', '2018-11-6']

        probe: list of str
            List of probes to load.  Valid options: '1','2','3','4'
            Default: '1'

        datatype: str
            Data type; Valid options:
            Default: 'pp'

        suffix: str
            The tplot variable names will be given this suffix.
            Default: ''

        prefix: str
            The tplot variable names will be given this prefix.
            Default: ''

        get_support_data: bool
            If True, Data with an attribute "VAR_TYPE" with a value of "support_data"
            will be loaded into tplot.

        varformat: str
            The file variable formats to load into tplot.  Wildcard character
            "*" is accepted. If empty or None, all variables will be loaded.
            Default: None (all variables loaded)

        varnames: list of str
            List of CDF variable names to load (if empty or not specified,
            all data variables are loaded)
            Default: [] (all variables loaded)

        downloadonly: bool
            Set this flag to download the CDF files, but not load them into
            tplot variables
            Default: False

        notplot: bool
            Return the data in hash tables instead of creating tplot variables
            Default: False

        no_update: bool
            If set, only load data from your local cache
            Default: False

        time_clip: bool
            Time clip the variables to exactly the range specified in the trange keyword
            Default: False

        force_download: bool
            Download file even if local version is more recent than server version
            Default: False

    Returns
    -------
        list of str
            List of tplot variables created.

    Examples
    --------
    >>> import pyspedas
    >>> from pyspedas import tplot
    >>> edi_vars = pyspedas.projects.cluster.edi(trange=['2003-11-01','2003-11-02'],probe=['1','2'])
    >>> tplot(['V_ed_xyz_gse__C1_PP_EDI','V_ed_xyz_gse__C1_PP_EDI'])


    Load data from Cluster instruments

    Parameters
    ----------
        trange : list of str
            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: ['2018-11-5', '2018-11-6']

        probe: list of str
            List of probes to load.  Valid options: '1','2','3','4'
            Default: '1'

        instrument: str
            Instrument to load.
            Default: 'fgm;

        datatype: str
            Data type; Valid options:
            Default: 'up'

        prefix: str
            The tplot variable names will be given this prefix.
            Default: ''

        suffix: str
            The tplot variable names will be given this suffix.
            Default: ''

        get_support_data: bool
            If True, Data with an attribute "VAR_TYPE" with a value of "support_data"
            will be loaded into tplot.

        varformat: str
            The file variable formats to load into tplot.  Wildcard character
            "*" is accepted. If empty or None, all variables will be loaded.
            Default: None (all variables loaded)

        varnames: list of str
            List of CDF variable names to load (if empty or not specified,
            all data variables are loaded)
            Default: [] (all variables loaded)

        downloadonly: bool
            Set this flag to download the CDF files, but not load them into
            tplot variables
            Default: False

        notplot: bool
            Return the data in hash tables instead of creating tplot variables
            Default: False

        no_update: bool
            If set, only load data from your local cache
            Default: False

        time_clip: bool
            Time clip the variables to exactly the range specified in the trange keyword
            Default: False

        force_download: bool
            Download file even if local version is more recent than server version
            Default: False

    Returns
    -------
        list of str
            List of tplot variables created.

    Notes
    -----
    This function loads data from the Cluster mission; this function is not meant
    to be called directly; instead, see the wrappers:
        pyspedas.projects.cluster.fgm
        pyspedas.projects.cluster.aspoc
        pyspedas.projects.cluster.cis
        pyspedas.projects.cluster.dwp
        pyspedas.projects.cluster.edi
        pyspedas.projects.cluster.efw
        pyspedas.projects.cluster.peace
        pyspedas.projects.cluster.rapid
        pyspedas.projects.cluster.staff
        pyspedas.projects.cluster.wbd
        pyspedas.projects.cluster.whi


    Load data from the Cluster Waves of High Frequency and Sounder for Probing of Density by Relaxation instrument

    Parameters
    ----------
        trange : list of str
            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: ['2018-11-5', '2018-11-6']

        probe: list of str
            List of probes to load.  Valid options: '1','2','3','4'
            Default: '1'

        datatype: str
            Data type; Valid options:
            Default: 'pp'

        prefix: str
            The tplot variable names will be given this prefix.
            Default: ''

        suffix: str
            The tplot variable names will be given this suffix.
            Default: ''

        get_support_data: bool
            If True, Data with an attribute "VAR_TYPE" with a value of "support_data"
            will be loaded into tplot.

        varformat: str
            The file variable formats to load into tplot.  Wildcard character
            "*" is accepted. If empty or None, all variables will be loaded.
            Default: None (all variables loaded)

        varnames: list of str
            List of CDF variable names to load (if empty or not specified,
            all data variables are loaded)
            Default: [] (all variables loaded)

        downloadonly: bool
            Set this flag to download the CDF files, but not load them into
            tplot variables
            Default: False

        notplot: bool
            Return the data in hash tables instead of creating tplot variables
            Default: False

        no_update: bool
            If set, only load data from your local cache
            Default: False

        time_clip: bool
            Time clip the variables to exactly the range specified in the trange keyword
            Default: False

        force_download: bool
            Download file even if local version is more recent than server version
            Default: False

    Returns
    -------
        list of str
            List of tplot variables created.

    Examples
    --------
    >>> import pyspedas
    >>> from pyspedas import tplot
    >>> whi_vars = pyspedas.projects.cluster.whi(trange=['2003-11-01','2003-11-02'],probe=['1','2'])
    >>> tplot(['N_e_res__C1_PP_WHI','E_pow_f4__C1_PP_WHI','N_e_res__C2_PP_WHI','E_pow_f4__C2_PP_WHI'])


    Load data from the Cluster Plasma Electron and Current Experiment

    Parameters
    ----------
        trange : list of str
            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: ['2018-11-5', '2018-11-6']

        probe: list of str
            List of probes to load.  Valid options: '1','2','3','4'
            Default: '1'

        datatype: str
            Data type; Valid options:
            Default: 'up'

        suffix: str
            The tplot variable names will be given this suffix.
            Default: ''

        prefix: str
            The tplot variable names will be given this prefix.
            Default: ''

        get_support_data: bool
            If True, Data with an attribute "VAR_TYPE" with a value of "support_data"
            will be loaded into tplot.

        varformat: str
            The file variable formats to load into tplot.  Wildcard character
            "*" is accepted. If empty or None, all variables will be loaded.
            Default: None (all variables loaded)

        varnames: list of str
            List of CDF variable names to load (if empty or not specified,
            all data variables are loaded)
            Default: [] (all variables loaded)

        downloadonly: bool
            Set this flag to download the CDF files, but not load them into
            tplot variables
            Default: False

        notplot: bool
            Return the data in hash tables instead of creating tplot variables
            Default: False

        no_update: bool
            If set, only load data from your local cache
            Default: False

        time_clip: bool
            Time clip the variables to exactly the range specified in the trange keyword
            Default: False

        force_download: bool
            Download file even if local version is more recent than server version
            Default: False

    Returns
    -------
        list of str
            List of tplot variables created.

    Examples
    --------
    >>> import pyspedas
    >>> from pyspedas import tplot
    >>> peace_vars = pyspedas.projects.cluster.peace(trange=['2003-11-01','2003-11-02'],probe=['1','2'])
    >>> tplot([ 'N_e_den__C1_PP_PEA', 'V_e_xyz_gse__C1_PP_PEA', 'N_e_den__C2_PP_PEA', 'V_e_xyz_gse__C2_PP_PEA'])


    Load data from the Cluster Fluxgate Magnetometer

    Parameters
    ----------
        trange : list of str
            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: ['2018-11-5', '2018-11-6']

        probe: str or list of str
            List of probes to load.  Valid options: '1','2','3','4'
            Default: '1'

        datatype: str
            Data type; Valid options:
            Default: 'up'

        prefix: str
            The tplot variable names will be given this prefix.
            Default: ''

        suffix: str
            The tplot variable names will be given this suffix.
            Default: ''

        get_support_data: bool
            If True, Data with an attribute "VAR_TYPE" with a value of "support_data"
            will be loaded into tplot.

        varformat: str
            The file variable formats to load into tplot.  Wildcard character
            "*" is accepted. If empty or None, all variables will be loaded.
            Default: None (all variables loaded)

        varnames: list of str
            List of CDF variable names to load (if empty or not specified,
            all data variables are loaded)
            Default: [] (all variables loaded)

        downloadonly: bool
            Set this flag to download the CDF files, but not load them into
            tplot variables
            Default: False

        notplot: bool
            Return the data in hash tables instead of creating tplot variables
            Default: False

        no_update: bool
            If set, only load data from your local cache
            Default: False

        time_clip: bool
            Time clip the variables to exactly the range specified in the trange keyword
            Default: False

        force_download: bool
            Download file even if local version is more recent than server version
            Default: False

    Returns
    -------
        list of str
            List of tplot variables created.

    Examples
    --------
    >>> import pyspedas
    >>> from pyspedas import tplot
    >>> fgm_vars = pyspedas.projects.cluster.fgm(trange=['2018-11-5', '2018-11-6'],probe=['1','2'])


Return list of data types.


Return a string formated for Cluster web services.


Load data using the Cluster Science Data archive.

    Parameters
    ----------
        trange : list of str
            Time range [start, end].
            Default: ['2001-02-01', '2001-02-03']

        probes : list of str
            List of Cluster probes. Valid options: 'C1','C2','C3','C4', '*' to load all probes
            Default: ['C1']

        datatypes : list of str
            List of Cluster data types. Valid options::
              'CE_WBD_WAVEFORM_CDF', 'CP_AUX_POSGSE_1M',
              'CP_CIS-CODIF_HS_H1_MOMENTS', 'CP_CIS-CODIF_HS_He1_MOMENTS',
              'CP_CIS-CODIF_HS_O1_MOMENTS', 'CP_CIS-CODIF_PAD_HS_H1_PF',
              'CP_CIS-CODIF_PAD_HS_He1_PF', 'CP_CIS-CODIF_PAD_HS_O1_PF',
              'CP_CIS-HIA_ONBOARD_MOMENTS', 'CP_CIS-HIA_PAD_HS_MAG_IONS_PF',
              'CP_EDI_AEDC', 'CP_EDI_MP', 'CP_EDI_SPIN', 'CP_EFW_L2_E3D_INERT',
              'CP_EFW_L2_P', 'CP_EFW_L2_V3D_INERT', 'CP_EFW_L3_E3D_INERT',
              'CP_EFW_L3_P', 'CP_EFW_L3_V3D_INERT', 'CP_FGM_5VPS', 'CP_FGM_FULL',
              'CP_FGM_SPIN', 'CP_PEA_MOMENTS', 'CP_PEA_PITCH_SPIN_DEFlux',
              'CP_PEA_PITCH_SPIN_DPFlux', 'CP_PEA_PITCH_SPIN_PSD', 'CP_RAP_ESPCT6',
              'CP_RAP_ESPCT6_R', 'CP_RAP_HSPCT', 'CP_RAP_HSPCT_R',
              'CP_RAP_ISPCT_CNO', 'CP_RAP_ISPCT_He', 'CP_STA_CS_HBR',
              'CP_STA_CS_NBR', 'CP_STA_CWF_GSE', 'CP_STA_CWF_HBR_ISR2',
              'CP_STA_CWF_NBR_ISR2', 'CP_STA_PSD', 'CP_WBD_WAVEFORM',
              'CP_WHI_ELECTRON_DENSITY', 'CP_WHI_NATURAL', 'JP_AUX_PMP', 'JP_AUX_PSE'

            Default: ['CP_CIS-CODIF_HS_H1_MOMENTS']

        downloadonly: bool
            If true, do not use cdf_to_tplot.
            Default: False

        time_clip: bool
            If true, apply time clip to data.
            Default: False

        suffix: str
            The tplot variable names will be given this suffix.
            Default: ''

        get_support_data: bool
            If True, data with an attribute "VAR_TYPE" with a value of "support_data"
            will be loaded into tplot.
            Default: False

        varformat : str
            The file variable formats to load into tplot.  Wildcard character
            "*" is accepted.
            Default: None (all variables will be loaded)

        varnames: str or list of str
            Load these variables only. If [] or ['*'], then load everything.
            Default: []

        notplot: bool
            If True, then data are returned in a hash table instead of
            being stored in tplot variables (useful for debugging, and
            access to multi-dimensional data products)
            Default: False

    Returns
    -------
        list of str
            List of tplot variables created (unless notplot keyword is used).

    Examples
    --------

    >>> import pyspedas
    >>> from pyspedas import tplot
    >>> fgm_vars = pyspedas.projects.cluster.load_csa(trange=['2008-11-01','2008-11-02'],datatypes=['CP_FGM_FULL'])
    >>> tplot(['B_vec_xyz_gse__C1_CP_FGM_FULL','B_mag__C1_CP_FGM_FULL'])


    Load data from the Cluster Wide Band Data receiver

    Parameters
    ----------
        trange : list of str
            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: ['2003-11-01/14:00:00','2003-11-01/14:05:00']

        probe: list of str
            List of probes to load.  Valid options: '1','2','3','4'
            Default: '1'

        datatype: str
            Data type; Valid options:
            Default: 'waveform'

        prefix: str
            The tplot variable names will be given this prefix.
            Default: ''

        suffix: str
            The tplot variable names will be given this suffix.
            Default: ''

        get_support_data: bool
            If True, Data with an attribute "VAR_TYPE" with a value of "support_data"
            will be loaded into tplot.

        varformat: str
            The file variable formats to load into tplot.  Wildcard character
            "*" is accepted. If empty or None, all variables will be loaded.
            Default: None (all variables loaded)

        varnames: list of str
            List of CDF variable names to load (if empty or not specified,
            all data variables are loaded)
            Default: [] (all variables loaded)

        downloadonly: bool
            Set this flag to download the CDF files, but not load them into
            tplot variables
            Default: False

        notplot: bool
            Return the data in hash tables instead of creating tplot variables
            Default: False

        no_update: bool
            If set, only load data from your local cache
            Default: False

        time_clip: bool
            Time clip the variables to exactly the range specified in the trange keyword
            Default: False

        force_download: bool
            Download file even if local version is more recent than server version
            Default: False

    Returns
    -------
        list of str
            List of tplot variables created.

    Examples
    --------
    >>> import pyspedas
    >>> from pyspedas import tplot
    >>> wbd_vars = pyspedas.projects.cluster.wbd(trange=['2003-11-01/14:00:00','2003-11-01/14:05:00'],probe=['1'])
    >>> # Note lack of probe IDs in the variables loaded -- only load one probe at a time
    >>> tplot('WBD_Elec')


    Load data from the Cluster Electric Field and Wave experiment

    Parameters
    ----------
        trange : list of str
            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: ['2018-11-5', '2018-11-6']

        probe: list of str
            List of probes to load.  Valid options: '1','2','3','4'
            Default: '1'

        datatype: str
            Data type; Valid options:
            Default: 'up'

        prefix: str
            The tplot variable names will be given this prefix.
            Default: ''

        suffix: str
            The tplot variable names will be given this suffix.
            Default: ''

        get_support_data: bool
            If True, Data with an attribute "VAR_TYPE" with a value of "support_data"
            will be loaded into tplot.

        varformat: str
            The file variable formats to load into tplot.  Wildcard character
            "*" is accepted. If empty or None, all variables will be loaded.
            Default: None (all variables loaded)

        varnames: list of str
            List of CDF variable names to load (if empty or not specified,
            all data variables are loaded)
            Default: [] (all variables loaded)

        downloadonly: bool
            Set this flag to download the CDF files, but not load them into
            tplot variables
            Default: False

        notplot: bool
            Return the data in hash tables instead of creating tplot variables
            Default: False

        no_update: bool
            If set, only load data from your local cache
            Default: False

        time_clip: bool
            Time clip the variables to exactly the range specified in the trange keyword
            Default: False

        force_download: bool
            Download file even if local version is more recent than server version
            Default: False

    Returns
    -------
        list of str
            List of tplot variables created.

    Examples
    --------
    >>> import pyspedas
    >>> from pyspedas import tplot
    >>> efw_vars = pyspedas.projects.cluster.efw(trange=['2003-11-01','2003-11-02'],probe=['2'])
    >>> tplot('E_pow_f1__C2_PP_EFW')


    Load data from the Cluster Research with Adaptive Particle Imaging Detectors

    Parameters
    ----------
        trange : list of str
            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: ['2018-11-5', '2018-11-6']

        probe: list of str
            List of probes to load.  Valid options: '1','2','3','4'
            Default: '1'

        datatype: str
            Data type; Valid options:
            Default: 'up'

        prefix: str
            The tplot variable names will be given this prefix.
            Default: ''

        suffix: str
            The tplot variable names will be given this suffix.
            Default: ''

        get_support_data: bool
            If True, Data with an attribute "VAR_TYPE" with a value of "support_data"
            will be loaded into tplot.

        varformat: str
            The file variable formats to load into tplot.  Wildcard character
            "*" is accepted. If empty or None, all variables will be loaded.
            Default: None (all variables loaded)

        varnames: list of str
            List of CDF variable names to load (if empty or not specified,
            all data variables are loaded)
            Default: [] (all variables loaded)

        downloadonly: bool
            Set this flag to download the CDF files, but not load them into
            tplot variables
            Default: False

        notplot: bool
            Return the data in hash tables instead of creating tplot variables
            Default: False

        no_update: bool
            If set, only load data from your local cache
            Default: False

        time_clip: bool
            Time clip the variables to exactly the range specified in the trange keyword
            Default: False

        force_download: bool
            Download file even if local version is more recent than server version
            Default: False

    Returns
    -------
        list of str
            List of tplot variables created.

    Examples
    --------
    >>> import pyspedas
    >>> from pyspedas import tplot
    >>> rapid_vars = pyspedas.projects.cluster.rapid(trange=['2003-11-01','2003-11-02'],probe=['1','2'])
    >>> tplot([ 'J_e_lo__C1_PP_RAP', 'J_e_hi__C1_PP_RAP', 'J_e_lo__C2_PP_RAP', 'J_e_hi__C2_PP_RAP'])


    Authenticates a user against OpenAM.

    Uses the esa_hapi_parameters dictionary for the parameters needed.
    Returns whether authentication was successful and the obtained cookie.
    If an error occurs, the exception is caught and the error printed.

    Parameters
    ----------
    None.

    Returns
    -------
    success: bool
        True, if authentication was successful
    auth_cookie: str
        The obtained authentication cookie


    Establishes a session with the ESA HAPI server.

    Uses the authentication cookie obtained from esa_get_auth_cookie().
    Returns whether a session was established successfully and if so,
        the obtained session cookies.
    If an error occurs, the exception is caught and the error is printed.

    Parameters
    ----------
    auth_cookie: str
        The obtained authentication cookie from esa_get_auth_cookie()

    Returns
    -------
    success: bool
        True, if authentication was successful
    jsession_id: str
        The obtained session cookie
    xsrf_token: str
        The obtained xsrf token


    Gets HAPI/capabilities from server.

    Uses the two cookies obtained using esa_get_session_cookies().
    If an error occurs, the exception is caught and the error printed.

    Parameters
    ----------
    jsession_id: str
        The obtained session cookie
    xsrf_token: str
        The obtained xsrf token

    Returns
    -------
    success: bool
        True, if function was successful
    capabilities: dict of str
        The obtained capabilities as a json dictionary of strings


    Gets either HAPI/data or HAPI/info from server.

    Uses the two cookies obtained from esa_get_session_cookies().
    If an error occurs, the exception is caught and the error printed.

    Parameters
    ----------
    jsession_id: str
        The obtained session cookie.
    xsrf_token: str
        The obtained xsrf token cookie.
    instrument: str
        The instrument name. Valid options: "sosmag", "electron", "protons".  Default: "sosmag"
    datatype: str
        Data type for sosmag, either '' (recalibrated) or '1m' (1 minute, real time).
    timemin: str
        Start time, for example: '2022-01-31T01:00:00.000Z'.
    timemax: str
        End time, for example: '2022-01-31T01:10:00.000Z'.

    Returns
    -------
    success: bool
        True, if function was successful.
    data: dict of str
        The obtained data as a json dictionary of strings.
    parameters: dict of str
        The obtained parameters for the data as a json dictionary of strings.
    description: str
        The obtained description of data.


    Stores magnetometer data as tplot variables.

    Parameters
    ----------
    data: dict of str
        The obtained data as a json dictionary of strings.
    parameters: dict of str
        The obtained parameters for the data as a json dictionary of strings.
    desc: str
        The obtained description for this set of data.
    datatype: str
        Data type can be either '' (recalibrated) or '1m' (1 minute real time).
    get_support_data: bool
        If True, loads everything into tplot variables, including flags.
    prefix: str
        Prefix for tplot names. Default is ''.
    suffix: str
        Suffix for tplot names. Default is ''.

    Returns
    -------
    success: bool
        True, if function was successful.
    var_names: list of str
        Names of tplot variables created.


    Stores proton or electron flux data as tplot variables.

    Parameters
    ----------
    data: dict of str
        The obtained data as a json dictionary of strings.
    parameters: dict of str
        The obtained parameters for the data as a json dictionary of strings.
    desc: str
        The obtained description for this set of data.
    ptype: str
        Particle type can be either 'p' (protons) or 'e' (electrons).
    get_support_data: bool
        If True, loads everything into tplot variables, including flags.
    prefix: str
        Prefix for tplot names. Default is ''.
    suffix: str
        Suffix for tplot names. Default is ''.

    Returns
    -------
    success: bool
        True, if function was successful.
    var_names: list of str
        Names of tplot variables created.


    This function loads data from the ESA HAPI server.

    Parameters
    ----------
    trange: list of str
        Start and end times.
        Many time formats are supported, see function time_double().
    instrument: str
        Instrument name. Default is 'sosmag'.
        Valid values are: 'sosmag' or 'mag', 'electrons' or 'e', 'protons' or 'p'.
    datatype: str
        Either '' (recalibrated) or '1m' (real time).
        Valid only for sosmag data. Ignored for particle data.
    get_support_data: bool
        If True, loads everything into tplot variables, including flags.
    prefix: str
        Prefix for tplot names. Default is ''.
    suffix: str
        Suffix for tplot names. Default is ''.

    Returns
    -------
    var_names: list of str
        Names of tplot variables created.

    Examples
    --------
    >>> from pyspedas import tplot
    >>> from pyspedas import kompsat_load

    >>> # Plot L2 magnetometer data
    >>> var_names = kompsat_load(trange=["2024-03-31 02:00:00", "2024-03-31 03:00:00"], datatype="1m")
    >>> tplot(var_names)

    >>> # Plot electron data
    >>> var_names = kompsat_load(trange=["2024-03-31 02:00:00", "2024-03-31 03:00:00"], instrument="e")
    >>> tplot(var_names)

    >>> # Plot proton data
    >>> var_names = kompsat_load(trange=["2024-03-31 02:00:00", "2024-03-31 03:00:00"], instrument="p")
    >>> tplot(var_names)

    Notes
    -----
    Data links that can be tested on a browser:

    SOSMAG data:

    https://swe.ssa.esa.int/hapi/data?id=spase://SSA/NumericalData/D3S/d3s_gk2a_sosmag_recalib&time.min=2021-01-31T01:00:00.000Z&time.max=2021-01-31T01:01:00.000Z&format=json

    https://swe.ssa.esa.int/hapi/data?id=spase://SSA/NumericalData/D3S/d3s_gk2a_sosmag_1m&time.min=2021-01-31T01:00:00.000Z&time.max=2021-01-31T01:01:00.000Z&format=json

    Particle data:

    https://swe.ssa.esa.int/hapi/data?id=spase://SSA/NumericalData/GEO-KOMPSAT-2A/kma_gk2a_ksem_pd_p_l1&time.min=2024-03-31T01:00:00.000Z&time.max=2024-03-31T02:00:00.000Z&format=json

    https://swe.ssa.esa.int/hapi/data?id=spase://SSA/NumericalData/GEO-KOMPSAT-2A/kma_gk2a_ksem_pd_e_l1&time.min=2024-03-31T01:00:00.000Z&time.max=2024-03-31T02:00:00.000Z&format=json