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

Last modified: Fri Aug 29 03:18:49 2025.

# Directory Listing of Routines

# projects/maven/swea/Test

- MVN_SWE_KP5
  Calculates SWEA key parameters. The result is stored in tplot variables,
- MVN_SWE_L2GEN5
  Loads L0 data, creates L2 files for 1 day
- MVN_SWE_LOAD_L2A
  Reads in MAVEN Level 2 telemetry files (CDF format). Data are stored in
- MVN_SWE_MAKECDF_3D5
  Routine to produce CDF file from SWEA 3D data structures
- MVN_SWE_MAKECDF_PAD5
  Routine to produce CDF file from SWEA pad data structures
- MVN_SWE_MAKECDF_SPEC5
  Routine to produce CDF file from SWEA spec data structures.
- MVN_SWE_READCDF_3D5
  Routine to read CDF file from mvn_swe_makecdf_3d.pro
- MVN_SWE_READCDF_PAD5
  Routine to read CDF file from mvn_swe_makecdf_pad.pro
- MVN_SWE_READCDF_SPEC5
  Routine to read CDF file from mvn_swe_makecdf_spec.pro

# Routine Descriptions

## MVN_SWE_KP5

[Next Routine] [List of Routines]

    PROCEDURE:
    	mvn_swe_kp5
    PURPOSE:
    	Calculates SWEA key parameters.  The result is stored in tplot variables,
       and as a save file.

       WARNING: This routine is for use by the SWEA instrument team only.

    AUTHOR:
    	David L. Mitchell
    CALLING SEQUENCE:
    	mvn_swe_kp5
    INPUTS:
       None:      Uses data currently loaded into the SWEA common block.

    KEYWORDS:
       TRANGE:    Process data in this time range.

       PANS:      Named variable to return tplot variables created.

       MOM:       Calculate density using a moment.  This is the default and
                  only option for now.

       DDD:       Calculate density from 3D distributions (allows bin
                  masking).  Default is to use SPEC data.  This option fits
                  a Maxwell-Boltzmann distribution to the core and performs
                  a moment calculation for the halo.  This provides corrections
                  for both spacecraft potential and scattered photoelectrons.
                  (Currently disabled.)

       ABINS:     Anode bin mask - 16-element byte array (0 = off, 1 = on)
                  Default = replicate(1B, 16).

       DBINS:     Deflector bin mask - 6-element byte array (0 = off, 1 = on)
                  Default = replicate(1B, 6).

       OBINS:     Solid angle bin mask - 96-element byte array (0 = off, 1 = on)
                  Default = reform(ABINS # DBINS, 96).

       MASK_SC:   Mask PA bins that are blocked by the spacecraft.  This is in
                  addition to any masking specified by ABINS, DBINS, and OBINS.
                  Default = 1 (yes).

       L2ONLY:    Only process data using L2 MAG data.

       QLEVEL:    Minimum quality level for calculations.  Filters out the vast
                  majority of spectra affected by the sporadic low energy
                  anomaly below 28 eV.  The validity levels are:

                    0B = Data are affected by the low-energy anomaly.  There
                         are significant systematic errors below 28 eV.
                    1B = Unknown because: (1) the variability is too large to
                         confidently identify anomalous spectra, as in the
                         sheath, or (2) secondary electrons mask the anomaly,
                         as in the sheath just downstream of the bow shock.
                    2B = Data are not affected by the low-energy anomaly.
                         Caveat: There is increased noise around 23 eV, even
                         for "good" spectra.

                  Default for this procedure is 1B.

       OUTPUT_PATH: An output_path for testing, the save file will be put into
                    OUTPUT_PATH/yyyy/mm/.  Directories are created as needed.
                    Default = root_data_dir() + 'maven/data/sci/swe/kp'.

    OUTPUTS:

     $LastChangedBy: dmitchell $
     $LastChangedDate: 2023-08-21 10:46:02 -0700 (Mon, 21 Aug 2023) $
     $LastChangedRevision: 32045 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/projects/maven/swea/Test/mvn_swe_kp5.pro $

(See projects/maven/swea/Test/mvn_swe_kp5.pro)

## MVN_SWE_L2GEN5

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

    NAME:
     mvn_swe_l2gen5
    PURPOSE:
     Loads L0 data, creates L2 files for 1 day

       WARNING: This routine is for use by the SWEA instrument team only.

    CALLING SEQUENCE:
     mvn_swe_l2gen5, date=date
    INPUT:
       None.
    KEYWORDS:
       DATE:      If set, the input date. The default is today.

       DIRECTORY: If set, output into this directory, for testing
                   purposes, don't forget a slash '/'  at the end.

       L2ONLY:    If set, only generate PAD L2 data if MAG L2 data are available.

       NOL2:      If set, do not generate SWEA L2 data.  Takes precedence over the
                  next three keywords.

       DOSPEC:    Process the SPEC data.  Default = 1 (yes).

       DOPAD:     Process the PAD data.  Default = 1 (yes).

       DO3D:      Process the 3D data.  Default = 1 (yes).

       DOKP:      Process the KP data.  Default = 1 (yes).

       ABINS:     Anode bin mask -> 16 elements (0 = off, 1 = on)
                  Default = replicate(1,16)

       DBINS:     Deflector bin mask -> 6 elements (0 = off, 1 = on)
                  Default = replicate(1,6)

       OBINS:     3D solid angle bin mask -> 96 elements (0 = off, 1 = on)
                  Default = reform(ABINS # DBINS)

       MASK_SC:   Mask the spacecraft blockage.  This is in addition to any
                  masking defined by the ABINS, DBINS, and OBINS.
                  Default = 1 (yes).  Set this to 0 to disable and use the
                  above 3 keywords only (not recommended!).

       KP_QLEV:   Minimum quality level for calculating key parameters.  Filters out
                  the vast majority of spectra affected by the sporadic low energy
                  anomaly below 28 eV.  The validity levels are:

                    0B = Data are affected by the low-energy anomaly.  There
                         are significant systematic errors below 28 eV.
                    1B = Unknown because: (1) the variability is too large to
                         confidently identify anomalous spectra, as in the
                         sheath, or (2) secondary electrons mask the anomaly,
                         as in the sheath just downstream of the bow shock.
                    2B = Data are not affected by the low-energy anomaly.
                         Caveat: There is increased noise around 23 eV, even
                         for "good" spectra.

                  Default for this procedure is 1B.

    HISTORY:
     Hacked from Matt F's crib_l0_to_l2.txt, 2014-11-14: jmm
     Better memory management and added keywords to control processing: dlm
     Development code for data version 5; DLM: 2023-08

     $LastChangedBy: dmitchell $
     $LastChangedDate: 2023-08-22 12:48:17 -0700 (Tue, 22 Aug 2023) $
     $LastChangedRevision: 32051 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/projects/maven/swea/Test/mvn_swe_l2gen5.pro $

(See projects/maven/swea/Test/mvn_swe_l2gen5.pro)

## MVN_SWE_LOAD_L2A

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

    PROCEDURE:   mvn_swe_load_l2a
    PURPOSE:
      Reads in MAVEN Level 2 telemetry files (CDF format).  Data are stored in
      a common block (mvn_swe_com).

       WARNING: This routine is for use by the SWEA instrument team only.

      SWEA data structures are:

        3D Distributions:  mvn_swe_3d

        PAD Distributions: mvn_swe_pad

        ENGY Spectra:      mvn_swe_engy

    USAGE:
      mvn_swe_load_l2, trange

    INPUTS:
           trange:        Load SWEA packets from L2 data spanning this time range.
                          (Reads multiple L2 files, if necessary.)  This input is
                          not needed if you first call timespan.

    KEYWORDS:
           FILENAME:      Full path and file name for loading data.  Can be multiple
                          files.  Takes precedence over trange, ORBIT, and LATEST.

           ORBIT:         Load SWEA data by orbit number or range of orbit numbers
                          (trange and LATEST are ignored).  Orbits are numbered using
                          the NAIF convention, where the orbit number increments at
                          periapsis.  Data are loaded from the apoapsis preceding the
                          first orbit (periapsis) number to the apoapsis following the
                          last orbit number.

           LATEST:        Ignore trange (if present), and load all data within the
                          LATEST days leading up to the current date.

           SPEC:          Load SPEC data.

           PAD:           Load PAD data.

           DDD:           Load 3D data.

           ALL:           Load SPEC, PAD, and 3D data.

           BURST:         Load burst data.  (Default is to load survey data.)

           ARCHIVE:       Synonym for BURST.  (For backward compatibility.)

           STATUS:        Report statistics of data actually loaded.

           SUMPLOT:       Create a summary plot of the loaded data.

           LOADONLY:      Download data but do not process.

           NOERASE:       Do not clear the common block before loading.  This
                          allows multiple calls to load subsets of the data.

           SPICEINIT:     Force an initialization of SPICE.  Use with caution!
                          Best practice is to initialize SPICE before calling
                          this routine (or any other data loader).

           NOSPICE:       Do not initialize SPICE.

     $LastChangedBy: dmitchell $
     $LastChangedDate: 2023-08-21 10:46:02 -0700 (Mon, 21 Aug 2023) $
     $LastChangedRevision: 32045 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/projects/maven/swea/Test/mvn_swe_load_l2a.pro $

    CREATED BY:    David L. Mitchell  02-02-15
    FILE: mvn_swe_load_l2a.pro

(See projects/maven/swea/Test/mvn_swe_load_l2a.pro)

## MVN_SWE_MAKECDF_3D5

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

     NAME:
       MVN_SWE_MAKECDF_3D5
     SYNTAX:
    	MVN_SWEA_MAKECDF_3D5, DATA, FILE = FILE, VERSION = VERSION
     PURPOSE:
    	Routine to produce CDF file from SWEA 3D data structures

       WARNING: This routine is for use by the SWEA instrument team only.

     INPUTS:
       DATA: Structure with which to populate the CDF file
             (nominally created by mvn_swe_get3d.pro)
     OUTPUT:
       CDF file
     KEYWORDS:
       FILE: full file name of the output file - only used for testing
             if not specified (usually won't be), the program creates the appropriate filename
       VERSION: integer; software version
              - read from common block (SWE_CFG) defined in mvn_swe_calib.pro
              - keyword no longer needed (but kept for compatibility)
     HISTORY:
       Created by Matt Fillingim (with code stolen from JH and RL)
       Added directory keyword, and deletion of old files, jmm, 2014-11-14
       Read version number from common block; MOF: 2015-01-30
       ISTP compliance scrub; DLM: 2016-04-08
       Development code for data version 5; DLM: 2023-08
     VERSION:
       $LastChangedBy: dmitchell $
       $LastChangedDate: 2023-11-28 07:30:31 -0800 (Tue, 28 Nov 2023) $
       $LastChangedRevision: 32258 $
       $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/projects/maven/swea/Test/mvn_swe_makecdf_3d5.pro $

(See projects/maven/swea/Test/mvn_swe_makecdf_3d5.pro)

## MVN_SWE_MAKECDF_PAD5

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

     NAME:
       MVN_SWE_MAKECDF_PAD5
     SYNTAX:
       MVN_SWEA_MAKECDF_PAD5, DATA, FILE = FILE, VERSION = VERSION
     PURPOSE:
       Routine to produce CDF file from SWEA pad data structures

       WARNING: This routine is for use by the SWEA instrument team only.

     INPUT:
       DATA: Structure with which to populate the CDF file
             (nominally created by mvn_swe_getpad.pro)
     OUTPUT:
       CDF file
     KEYWORDS:
       FILE: full file name of the output file - only used for testing
             if not specified (usually won't be), the program creates the appropriate filename
       VERSION: integer; software version
              - read from common block (SWE_CFG) defined in mvn_swe_calib.pro
              - keyword no longer needed (but kept for compatibility)
       L2_ONLY: only create cdf if L2 MAG data are available.
     HISTORY:
       Created by Matt Fillingim (with code stolen from JH and RL)
       Added directory keyword, jmm, 2104-11-14
       Read version number from common block; MOF: 2015-01-30
       ISTP compliance scrub; DLM: 2016-04-08
       Development code for data version 5; DLM: 2023-08
     VERSION:
       $LastChangedBy: dmitchell $
       $LastChangedDate: 2023-11-28 07:30:31 -0800 (Tue, 28 Nov 2023) $
       $LastChangedRevision: 32258 $
       $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/projects/maven/swea/Test/mvn_swe_makecdf_pad5.pro $

(See projects/maven/swea/Test/mvn_swe_makecdf_pad5.pro)

## MVN_SWE_MAKECDF_SPEC5

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

     NAME:
       MVN_SWE_MAKECDF_SPEC5
     SYNTAX:
       MVN_SWE_MAKECDF_SPEC5, DATA, FILE = FILE, VERSION = VERSION
     PURPOSE:
       Routine to produce CDF file from SWEA spec data structures.

       WARNING: This routine is for use by the SWEA instrument team only.

     INPUT:
       DATA: Structure with which to populate the CDF file
             (nominally created by mvn_swe_getspec.pro)
     OUTPUT:
       CDF file
     KEYWORDS:
       FILE: full name of the output file - only used for testing
             if not specified (usually won't be), the program creates the appropriate filename
       VERSION: integer; software version
              - read from common block (SWE_CFG) defined in mvn_swe_calib.pro
              - keyword no longer need (but kept for compatibility)
     HISTORY:
       created by Matt Fillingim (with code stolen from JH and RL)
       Added directory keyword, and deletion of old files, jmm, 2014-11-14
       Read version number from common block; MOF: 2015-01-30
       ISTP compliance scrub; DLM: 2016-04-08
       Development code for data version 5; DLM: 2023-08
     VERSION:
       $LastChangedBy: dmitchell $
       $LastChangedDate: 2023-11-28 07:30:31 -0800 (Tue, 28 Nov 2023) $
       $LastChangedRevision: 32258 $
       $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/projects/maven/swea/Test/mvn_swe_makecdf_spec5.pro $

(See projects/maven/swea/Test/mvn_swe_makecdf_spec5.pro)

## MVN_SWE_READCDF_3D5

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

     NAME:
       MVN_SWE_READCDF_3D5
     SYNTAX:
       MVN_SWE_READCDF_3D5, INFILE, STRUCTURE
     PURPOSE:
       Routine to read CDF file from mvn_swe_makecdf_3d.pro

       WARNING: This routine is for use by the SWEA instrument team only.

     INPUTS:
       INFILE: CDF file name to read
               (nominally created by mvn_swe_makecdf_3d.pro)
     OUTPUT:
       STRUCTURE: IDL data structure
     KEYWORDS:
       OUTFILE: Output file name
     HISTORY:
       Created by Matt Fillingim
     VERSION:
       $LastChangedBy: dmitchell $
       $LastChangedDate: 2023-08-22 12:48:17 -0700 (Tue, 22 Aug 2023) $
       $LastChangedRevision: 32051 $
       $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/projects/maven/swea/Test/mvn_swe_readcdf_3d5.pro $

(See projects/maven/swea/Test/mvn_swe_readcdf_3d5.pro)

## MVN_SWE_READCDF_PAD5

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

     NAME:
       MVN_SWE_READCDF_PAD5
     SYNTAX:
       MVN_SWE_READCDF_PAD5, INFILE, STRUCTURE
     PURPOSE:
       Routine to read CDF file from mvn_swe_makecdf_pad.pro

       WARNING: This routine is for use by the SWEA instrument team only.

     INPUTS:
       INFILE: CDF file name to read
               (nominally created by mvn_swe_makecdf_pad.pro)
     OUTPUT:
       STRUCTURE: IDL data structure
     KEYWORDS:
       OUTFILE: Output file name
     HISTORY:
       Created by Matt Fillingim
     VERSION:
       $LastChangedBy: dmitchell $
       $LastChangedDate: 2023-08-22 12:48:17 -0700 (Tue, 22 Aug 2023) $
       $LastChangedRevision: 32051 $
       $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/projects/maven/swea/Test/mvn_swe_readcdf_pad5.pro $

(See projects/maven/swea/Test/mvn_swe_readcdf_pad5.pro)

## MVN_SWE_READCDF_SPEC5

[Previous Routine] [List of Routines]

     NAME:
       MVN_SWE_READCDF_SPEC5
     SYNTAX:
    	MVN_SWE_READCDF_SPEC5, INFILE, STRUCTURE
     PURPOSE:
    	Routine to read CDF file from mvn_swe_makecdf_spec.pro

       WARNING: This routine is for use by the SWEA instrument team only.

     INPUTS:
       INFILE: CDF file name to read
               (nominally created by mvn_swe_makecdf_spec.pro)
     OUTPUT:
       STRUCTURE: IDL data structure
     KEYWORDS:
       OUTFILE: Output file name
     HISTORY:
       Created by Matt Fillingim
       Development code for data version 5; DLM: 2023-08
     VERSION:
       $LastChangedBy: dmitchell $
       $LastChangedDate: 2023-08-22 12:48:17 -0700 (Tue, 22 Aug 2023) $
       $LastChangedRevision: 32051 $
       $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/projects/maven/swea/Test/mvn_swe_readcdf_spec5.pro $

(See projects/maven/swea/Test/mvn_swe_readcdf_spec5.pro)