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

Last modified: Sat Jul 26 18:17:38 2025.

# Directory Listing of Routines

# projects/mms/common

- MMS_CONFIG
  This procedure serves as the MMS configuration file. It sets global (system)
- MMS_FIND_PERIGEE_TIMES
  Function that returns the times of perigee just before and after the input time (using the MEC data)
- MMS_FLIPBOOKIFY
  Turns the current tplot window into a "flipbook" containing:
- MMS_INIT
  Initializes system variables for MMS. Can be called from idl_startup to set
- MMS_PROXY
  (1) To set a proxy and establish a connection to SDC, on the fly.
- MMS_PROXY_PUBLIC
  (1) To set a proxy and establish a connection to SDC, on the fly.
- MMS_SET_VERBOSE
  Sets verbose level in !mms.verbose and in tplot_options
- MMS_UI_CONFIG
  A widget that allows the user to set some of the fields in the
- REDUCE_BFIELD_DIMENSIONS
  This routine reduces a tplot variable with B-field

# Routine Descriptions

## MMS_CONFIG

[Next Routine] [List of Routines]

    NAME:    mms_config

    PURPOSE:
      This procedure serves as the MMS configuration file.  It sets global (system)
      variables and initializes devices

      This procedure will define the location of data files and the data server.
      This procedure is intended to be called from within the "MMS_INIT" procedure.

      This should be the only MMS file that requires modification for use in different
      locations.

      There is no need to modify this file if:
         - Your computer is an SSL UNIX machine that mounts "/disks/data/"   (i.e. ALL Linux and Solaris machines at SSL)
         - You use a portable computer that will be caching files on a local hard drive.

      Settings  in this file will be overridden by settings in the environment.
      (see setup_themis or setup_themis_bash for examples of setting environment
      variables on UNIX-like systems.  The environment can also be set on Windows
      systems.)

    KEYWORDS
       NO_COLOR_SETUP   Do not do color setup if taken care for already
       COLORTABLE       Overwrite the default colortable initialization

    HISTORY:
     2015-04-10, moka, Created based on 'thm_config'

     $LastChangedBy: egrimes $
     $LastChangedDate: 2020-04-02 14:20:37 -0700 (Thu, 02 Apr 2020) $
     $LastChangedRevision: 28484 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/projects/mms/common/mms_config.pro $

(See projects/mms/common/mms_config.pro)

## MMS_FIND_PERIGEE_TIMES

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

     FUNCTION:
             mms_find_perigee_times

     PURPOSE:
             Function that returns the times of perigee just before and after the input time (using the MEC data)

     INPUT:
             time: time to find perigee

     KEYWORDS:
             probe: spacecraft probe #

     EXAMPLE:
             trange=mms_find_perigee_times('2015-09-02/00:00:00', probe='1')

     NOTES:
             Created by Naritoshi Kitamura

     $LastChangedBy: egrimes $
     $LastChangedDate: 2020-07-31 13:59:16 -0700 (Fri, 31 Jul 2020) $
     $LastChangedRevision: 28961 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/projects/mms/common/mms_find_perigee_times.pro $

(See projects/mms/common/mms_find_perigee_times.pro)

## MMS_FLIPBOOKIFY

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

     PROCEDURE:
         mms_flipbookify

     PURPOSE:
         Turns the current tplot window into a "flipbook" containing:

         1) the current figure (vertical line at each time step)
         2) MMS distribution slices at each time step

     KEYWORDS:
         trange: limit the time range of plots produced (will draw a box around trange by default)
         instrument: instrument for the slices (default: fpi)
         probe:  probe # for the slices (default: 1)
         level: level of data for the slices (default: l2)
         data_rate: data rate to use for the slices (default: brst)
         species: species of the slices; valid options include: (default: 'i')
             FPI: 'e' or 'i'
             HPCA: 'hplus', 'oplus', 'heplus', 'heplusplus'

         xrange:  two-element array specifying x-axis range for the slices
         yrange:  two-element array specifying y-axis range for the slices
         zrange:  two-element array specifying z-axis range for the slices

         slices: three-element array specifying the slices to plot:
             'BV':  The x axis is parallel to B field; the bulk velocity defines the x-y plane
             'BE':  The x axis is parallel to B field; the B x V(bulk) vector defines the x-y plane
             'xy':  (default) The x axis is along the data's x axis and y is along the data's y axis
             'xz':  The x axis is along the data's x axis and y is along the data's z axis
             'yz':  The x axis is along the data's y axis and y is along the data's z axis
             'xvel':  The x axis is along the data's x axis; the x-y plane is defined by the bulk velocity
             'perp':  The x axis is the bulk velocity projected onto the plane normal to the B field; y is B x V(bulk)
             'perp_xy':  The data's x & y axes are projected onto the plane normal to the B field
             'perp_xz':  The data's x & z axes are projected onto the plane normal to the B field
             'perp_yz':  The data's y & z axes are projected onto the plane normal to the B field

             default: ['xy', 'xz', 'yz']

         three_d_interp: use the 3D interpolation method (default)
         two_d_interp: use the 2D interpolation method
         geometric: use the geometric interpolation method

         custom_rotation: Applies a custom rotation matrix to the data.  Input may be a
                       3x3 rotation matrix or a tplot variable containing matrices.
                       If the time window covers multiple matrices they will be averaged.
                       This is applied before other transformations

         /subtract_error: subtract the distErr variable from the FPI distribution before plotting (FPI only)
         /subtract_bulk: subtract the bulk velocity from the slices before plotting
         /subtract_spintone: subtract the spin-tone from the bulk velocity data prior to subtracting the bulk velocity data (FPI only)
         /energy: produce energy slices instead of velocity slices

         thickness: thickness of the vertical line drawn at each time step
         linestyle: style of the vertical line drawn at each time step

         note: box_* keywords require that you specify a trange
         box_color: color of the box
         box_style: linestyle of the box
         box_thickness: thickness of the box
         /no_box: disable the box

         left_margin: adjust the left-margin of the output images
         right_margin: adjust the right-margin of the output images (where the
             slices are stored)

         title: title of the plot; accepts common time string formats, e.g.,
             title="YYYY-MM-DD/hh:mm:ss.fff"

         seconds: specify the # of seconds for each slice
             (e.g., seconds=1.5 -> plot at every 1.5 seconds)
         time_step: integer specifying the interval to produce plots at
             (e.g., time_step=1 -> plot at every time, time_step=2 -> every other time, etc)

         /postscript: save the images as postscript files instead of PNGs

         output_dir: directory where the plots are saved (default: 'flipbook/')
         filename_suffix: suffix to append to the end of the newly created files

         /video: save the sequence of images as a video (.mp4) - currently only works for PNG
         vid_format: format of the output video; default .mp4;
             (options include: avi flv gif matroska mjpeg mov mp4 swf wav webm)
         vid_fps: frames per second for the video; default: 6

     EXAMPLES:
         MMS> .run mms_basic_dayside
         MMS> mms_flipbookify, data_rate='fast', time_step=10000

         see examples/advanced/mms_flipbook_crib.pro for more examples

     NOTES:

        - experimental, work in progress! email problems to: egrimes@igpp.ucla.edu

        - the default time steps are taken from the first panel in the current window
          warning: if this happens to be a full day of srvy mode FGM data,
          this will produce > 1 million plots, one at each FGM data point - use the
          time_step or seconds keywords to avoid this, e.g.,
               time_step=10000 for one plot per 10,000 FGM data points
               seconds=6 for one plot every 6 seconds

     $LastChangedBy: egrimes $
     $LastChangedDate: 2023-05-25 11:46:39 -0700 (Thu, 25 May 2023) $
     $LastChangedRevision: 31870 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/projects/mms/common/mms_flipbookify.pro $

(See projects/mms/common/mms_flipbookify.pro)

## MMS_INIT

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

    NAME:    mms_init

    PURPOSE:
       Initializes system variables for MMS. Can be called from idl_startup to set
       custom locations.

    NOTE:
       The system variable !MMS is defined here, just like !THEMIS.
       The elements of this structure are explained below:

       !MMS.LOCAL_DATA_DIR    This is the root location for all MMS data files.
                      The MMS software expects all data files to reside in specific subdirectories relative
                      to this root directory.;

       !MMS.REMOTE_DATA_DIR   (warning: SPDF ONLY) - This is the URL of the server that can provide the data files.
                      (default is: "https://spdf.gsfc.nasa.gov/pub/data/mms/")
                      if the software does not find a needed file in LOCAL_DATA_DIR,
                      then it will attempt to download the data from the URL and REMOTE_DATA_DIR is defined,
                      the software will attempt to download the file from REMOTE_DATA_DIR, place it in LOCAL_DATA_DIR
                      with the same relative pathname, and then continue processing.

       !MMS.MIRROR_DATA_DIR  - this is a mirror directory (typically over the local network); setting this
                     will cause the load routines to check this for files after checking your local data directory.
                     If files are found here, they're copied to your local data directory, and the copied files
                     are loaded

       Regarding data directory environment variables: it is highly advised to use the mission specific environment variables
                      (e.g., MMS_DATA_DIR) rather than ROOT_DATA_DIR to avoid conflicts with other missions/projects

       *** please note that setting REMOTE_DATA_DIR will have no effect when loading data from the LASP SDC, due to the
           custom web services at the SDC; this still allows you override the remote path to the data at SPDF, though ***

    KEYWORDS:
       RESET:           Reset !mms to values in environment (or values in keywords).
       LOCAL_DATA_DIR:  use given value for local_data_dir, rather than environment. Only works on
                        initial call or reset.
       REMOTE_DATA_DIR: Use given value for remote_data_dir, rather than env.  Only works on inital
                        call or reset.
       MIRROR_DATA_DIR:  network mirror directory - for loading data from the local network; note that this
                        will copy files to your local data directory if they're found on the mirror, and this is
                        only checked if the files do not currently exist in the LOCAL_DATA_DIR. Only works on inital
                        call or reset.
       NO_COLOR_SETUP   do not set colors if already taken care of
       DEBUGGING_GUI:   set this keyword if you intend to put 'stop's in any GUI widget code, i.e., if you're debugging
                        any code that involves widget events (EVA or the SPEDAS GUI)

    HISTORY:
     2015-04-10, moka, Created based on 'thm_init'
     2015-02-15, egrimes, commented out dialog_message in CDF version error due to a bug on MacOS X 10.11.6/IDL 8.5
     2018-04-05, egrimes, added MIRROR_DATA_DIR functionality
     2019-08-28, egrimes, made debugging fix (!debug_process_events=0) dependent on a keyword (DEBUGGING_GUI)
                          this debugging fix is known to cause problems with widgets on some machines

     $LastChangedBy: egrimes $
     $LastChangedDate: 2020-08-06 11:36:42 -0700 (Thu, 06 Aug 2020) $
     $LastChangedRevision: 29000 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/projects/mms/common/mms_init.pro $

(See projects/mms/common/mms_init.pro)

## MMS_PROXY

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

    NAME:    mms_proxy

    PURPOSE:
       (1) To set a proxy and establish a connection to SDC, on the fly.
       (2) To store/delete proxy information into/from a configuration file.

    NOTE:
       If the proxy requires proxy_username and proxy_password, then the user
       needs to use this program everytime he/she needs to access SDC because
       we do not store a password.

    KEYWORDS:

    HISTORY:
     2015-07-20, moka, Created

     $LastChangedBy: moka $
     $LastChangedDate: 2015-07-20 22:46:29 -0700 (Mon, 20 Jul 2015) $
     $LastChangedRevision: 18189 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/projects/mms/common/mms_proxy.pro $

(See projects/mms/common/mms_proxy.pro)

## MMS_PROXY_PUBLIC

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

    NAME:    mms_proxy_public

    PURPOSE:
       (1) To set a proxy and establish a connection to SDC, on the fly.
       (2) To store/delete proxy information into/from a configuration file.

    NOTE:
       If the proxy requires proxy_username and proxy_password, then the user
       needs to use this program everytime he/she needs to access SDC because
       we do not store a password.

    KEYWORDS:

    HISTORY:
     2015-07-20, moka, Created
     2019-06-13, egrimes, forked from original to add support for public users
                          (forked specifically to avoid regressions for current SITL users)

     $LastChangedBy: egrimes $
     $LastChangedDate: 2019-06-13 13:18:04 -0700 (Thu, 13 Jun 2019) $
     $LastChangedRevision: 27348 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/projects/mms/common/mms_proxy_public.pro $

(See projects/mms/common/mms_proxy_public.pro)

## MMS_SET_VERBOSE

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

    NAME:
     mms_set_verbose
    PURPOSE:
     Sets verbose level in !mms.verbose and in tplot_options
    CALLING SEQUENCE:
     mms_set_verbose, vlevel
    INPUT:
     vlevel = a verbosity level, if not set then !mms.verbose is used
              (this is how you would propagate the !mms.verbose value
              into tplot options)
    HISTORY:
     21-aug-2012, jmm, jimm@ssl.berkeley.edu
     12-oct-2012, jmm, Added this comment to test SVN
     12-oct-2012, jmm, Added this comment to test SVN, again
     18-oct-2012, jmm, Another SVN test
     10-apr-2015, moka, adapted for MMS from 'thm_set_verbose'

     $LastChangedBy: egrimes $
     $LastChangedDate: 2017-07-13 07:39:47 -0700 (Thu, 13 Jul 2017) $
     $LastChangedRevision: 23597 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/projects/mms/common/mms_set_verbose.pro $

(See projects/mms/common/mms_set_verbose.pro)

## MMS_UI_CONFIG

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

    NAME:
     mms_ui_config

    PURPOSE:
     A widget that allows the user to set some of the fields in the
     !mms system variable: Also allows the user to set the mms
     configuration text file, and save it

    HISTORY:
     17-may-2007, jmm, jimm@ssl.berkeley.edu
     2-jul-2007, jmm, 'Add trailing slash to data directories, if necessary
     5-may-2008, cg, removed text boxes and replaced with radio buttons or
                     pulldowns, fixed reset to default
     11-feb-2009, jmm, restored old version
     11-jan-2019, egrimes, forked for MMS

    $LastChangedBy: egrimes $
    $LastChangedDate: 2019-01-11 12:28:10 -0800 (Fri, 11 Jan 2019) $
    $LastChangedRevision: 26454 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/projects/mms/common/mms_ui_config.pro $

(See projects/mms/common/mms_ui_config.pro)

## REDUCE_BFIELD_DIMENSIONS

[Previous Routine] [List of Routines]

     PROCEDURE:
         reduce_bfield_dimensions

     PURPOSE:
         This routine reduces a tplot variable with B-field
         magnitude (like those found in the MMS FGM files)
         to a tplot variable containing only the B-field vector

     $LastChangedBy: egrimes $
     $LastChangedDate: 2018-11-19 15:28:17 -0800 (Mon, 19 Nov 2018) $
     $LastChangedRevision: 26152 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/projects/mms/common/reduce_bfield_dimensions.pro $

(See projects/mms/common/reduce_bfield_dimensions.pro)