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

Last modified: Thu Nov 6 18:16:58 2025.

# Directory Listing of Routines

# projects/maven/eph

- GET_MVN_EPH
- MVN_EPH_COM
  Defines MAVEN ephemeris common blocks.
- MVN_EPH_RESAMPLE
- MVN_EPH_STRUCT
- MVN_EPH_SUBSOL_POS
- MVN_PFP_COTRANS
- MVN_PHOBOS_TPLOT
  Create tplot variable for the distance between MAVEN and Phobos

# Routine Descriptions

## GET_MVN_EPH

[Next Routine] [List of Routines]

    PROCEDURE:       GET_MVN_EPH

    PURPOSE:         Loads the MAVEN ephemeris data. The result is
                     packaged into a common block structure and returned.

                     The available coordinate frames are:

                     GEO = body-fixed Mars geographic coordinates (non-inertial) = IAU_MARS
                     (sometimes called planetocentric (PC) coordinates)
                     X ->  0 deg E longitude, 0 deg latitude
                     Y -> 90 deg E longitude, 0 deg latitude
                     Z -> 90 deg N latitude (= X x Y)
                     origin = center of Mars
                     units = kilometers

                     MSO = Mars-Sun-Orbit coordinates (approx. inertial)

                     X -> from center of Mars to center of Sun
                     Y -> opposite to Mars' orbital angular velocity vector
                     Z = X x Y
                     origin = center of Mars
                     units = kilometers

    USAGE:           get_mvn_eph, trange, eph

    INPUTS:

        tvar:        An array in any format accepted by time_double().
                     You explicitly input the specified time you want to get.

        eph:         A named variable to hold the result.

    KEYWORDS:

        resolution:  The time resolution with which you want to get
                     the ephemeris data can be determined.

        silent:      Minimizes the information shown in the terminal.

        make_array:  Even if you do not use the "resolution" keyword,
                     10,000 elements structure array is automatically returned.

        status:      Returns the calculation status:
                     0 = no data found
                     1 = partial data found
                     2 = complete data found

        load:        If set, it forces to compute the ephemeris data,
                     i.e., 'mvn_eph_resample' is not used.

        no_download: If set, the SPICE/kernels stored in the local platform
                     are loaded.

        lst:         Specifies whether it computes the local time or not,
                     because 'FOR' loop is used. Default is lst = 1.

    CREATED BY:	  Takuya Hara on 2014-10-07.

    LAST MODIFICATION:
     $LastChangedBy: hara $
     $LastChangedDate: 2017-02-22 16:18:59 -0800 (Wed, 22 Feb 2017) $
     $LastChangedRevision: 22853 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/projects/maven/eph/get_mvn_eph.pro $

(See projects/maven/eph/get_mvn_eph.pro)

## MVN_EPH_COM

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

    COMMON BLOCK:   mvn_eph_com
    PURPOSE:
      Defines MAVEN ephemeris common blocks.

     $LastChangedBy: hara $
     $LastChangedDate: 2014-11-26 11:42:32 -0800 (Wed, 26 Nov 2014) $
     $LastChangedRevision: 16310 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/projects/maven/eph/mvn_eph_com.pro $

    CREATED BY:  Takuya Hara  on 2014-11-25.

(See projects/maven/eph/mvn_eph_com.pro)

## MVN_EPH_RESAMPLE

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

    PROCEDURE:       MVN_EPH_RESAMPLE

    PURPOSE:         Samples MAVEN ephemeris data at the times specirided
                     by user. Uses spline interpolation.

    USAGE:           mvn_eph_resample, time, eph_in, eph_out

    INPUTS:
          time:      An array of times at which ephemeris data are
                     desired.  Can be in any format accepted by
                     time_double().

        eph_in:      An MAVEN ephemeris structure obtained from 'get_mvn_eph'.
                     These data should have at least some overlap with
                     the input time array (obviously).

                     *** This routine WILL NOT extrapolate. ***

       eph_out:      The ephemeris data sampled at the input times.

    KEYWORDS:        None.

    CREATED BY:	  Takuya Hara on 2014-10-07.

    LAST MODIFICATION:
     $LastChangedBy: hara $
     $LastChangedDate: 2015-03-24 16:28:09 -0700 (Tue, 24 Mar 2015) $
     $LastChangedRevision: 17176 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/projects/maven/eph/mvn_eph_resample.pro $

(See projects/maven/eph/mvn_eph_resample.pro)

## MVN_EPH_STRUCT

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

    FUNCTION:        MVN_EPH_STRUCT

    PURPOSE:         Creates a MAVEN ephemeris structure template.
                     The structure elements are as follows:

         time    :   spacecraft event time (seconds since 1970-01-01/00:00:00)
         ;;orbit   : orbit numbers (TBD)
         x_ss    :   s/c location in ss coordinates (x)
         y_ss    :   s/c location in ss coordinates (y)
         z_ss    :   s/c location in ss coordinates (z)
         vx_ss   :   s/c velocity in ss coordinates (x)
         vy_ss   :   s/c velocity in ss coordinates (y)
         vz_ss   :   s/c velocity in ss coordinates (z)
         x_pc    :   s/c location in pc coordinates (x)
         y_pc    :   s/c location in pc coordinates (y)
         z_pc    :   s/c location in pc coordinates (z)
         Elon    :   east longitude of s/c [radians]
         lat     :   latitude of s/c [radians]
         alt     :   s/c altitude above Mars surface [km]
         sza     :   solar zenith angle of s/c [radians]
         lst     :   local solar time of s/c (0 = midnight, 12 = noon) [hour]
         ;;sun     : sunlight flag (0 = s/c in Mars' optical shadow
                                    1 = s/c illuminated by sun) (TBD)

         The coordinate systems are:

         SS = Mars-centered, sun-state coordinates: (MSO)
                     X -> Sun
                     Y -> opposite to Mars' orbital motion
                     Z -> X x Y

         PC = Mars-centered, body-fixed coordinates: (IAU_MARS)
                     X -> 0 deg longitude, 0 deg latitude
                     Z -> +90 deg latitude (Mars' north pole)
                     Y -> Z x X (= +90 deg east longitude)

    USAGE:           mvn_eph = mvn_eph_struct(npts)

    INPUTS:

         NPTS:       Number of ephemeris points.

    KEYWORDS:

         INIT:       Initialize the structure with the specified float scalar.
                     Default = !values.f_nan

    CREATED BY:	  Takuya Hara on 2014-10-06.

    LAST MODIFICATION:
     $LastChangedBy: hara $
     $LastChangedDate: 2015-03-24 16:28:09 -0700 (Tue, 24 Mar 2015) $
     $LastChangedRevision: 17176 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/projects/maven/eph/mvn_eph_struct.pro $

(See projects/maven/eph/mvn_eph_struct.pro)

## MVN_EPH_SUBSOL_POS

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

    PROCEDURE:       MVN_EPH_SUBSOL_POS

    PURPOSE:         Computes Mars subsolar points in the geographic
                     latitude and east longitude, and makes tplot variables.

    INPUTS:

           TRANGE:   An array in any format accepted by time_double().
                     The minimum and maximum pairs for the time array specify
                     the time range to compute.

    KEYWORDS:

            ORBIT:   Specifies the time range by orbit number or range of
                     orbit numbers (trange is 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.

       RESOLUTION:   Sets the time resolution to compute in sec.
                     Default = 1 sec.

             DATA:   Returns the conputed result as a structure.

           RADIAN:   If set, the computed unit set to be radian.
                     Default is degree.

               LS:   Computes also the Martian solar longitude (=Ls).

    CREATED BY:      Takuya Hara on 2015-03-27.

    LAST MODIFICATION:
     $LastChangedBy: hara $
     $LastChangedDate: 2015-04-12 17:04:33 -0700 (Sun, 12 Apr 2015) $
     $LastChangedRevision: 17298 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/projects/maven/eph/mvn_eph_subsol_pos.pro $

(See projects/maven/eph/mvn_eph_subsol_pos.pro)

## MVN_PFP_COTRANS

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

    PROCEDURE:       MVN_PFP_COTRANS

    PURPOSE:         Computes the MAVEN PFP instruments' angular (theta & phi)
                     arrays in the user specified new coordinate systems.
                     The results are returned by using "theta" & "phi" keywords.
                     Now SWIA, SWEA, STATIC are applicable.

    USAGE (EXAMPLE):
    	          mvn_pfp_cotrans, data, from='MAVEN_STATIC', to='MAVEN_MSO', $
                                      vx=vx, vy=vy, vz=vz, theta=theta, phi=phi, $
                                      px=px, py=py, pz=pz

    INPUTS:          SWIA, SWEA, and STATIC snapshot data.
                     They can be obtained from the following functions:

                     - SWIA: mvn_swia_get_3dc(), mvn_swia_get_3df(), mvn_swia_get_3ds().
                     - SWEA: mvn_swe_get3d(), mvn_swe_getpad(), mvn_swe_getspec().
                     - STATIC: mvn_sta_get_**(); (** corresponds to any apid modes).

    KEYWORDS:

       FROM:         Defines the initial coordinate system as string.

       TO:           Defines the coordinate system to which you want to convert.

                     Both "from" and "to" keywords must be defined the
                     coordinates defined in the MAVEN SPICE frame kernels.
                     It means that the coordinate system(s) derived from the
                     SPICE/Kernels can be utilized, such as 'MAVEN_MSO', 'IAU_MARS',
                     or so on in the present version.

       Vi:           (i=X, Y, Z).
                     Returns unit vector compnents in the new coordinates.

       THETA:        Returns the polar angle in the new coordinates.

       PHI:          Returns the azimuth angle in the new coordinates.

       Pi:           (i=X, Y, Z).
                     Returns the instrument axes in the new coordinates.

       STATUS:       Returns the computation status (0: Failure / 1: Success).

       SPICE_LOAD:   Loads the MAVEN SPICE/kernels.

       NOCHECK:      Do not check for validity of SPICE kernels.  This can be
                     overkill if SPICE coverage has already been checked.

       OVERWRITE:    Overwrites resultant angular (theta & phi) arrays in the
                     new coordinates into the input snapshot data structure.

                     *** !!! ***
                     Be careful using this keyword.
                     It does not guarantee unexpected behaviors caused
                     by using this keyword, because it does not take into
                     account effects of deformation of the solid angle
                     (including dtheta, dphi) in the new coordinates.
                     For example, do not use this keyword for a purpose
                     of plasma moment calculation in the new coordinates.
                     *** !!! ***

    ADVANCED:        Specially, this procedure can use the 2 new coordinate
                     coordinate systems which are not defined in SPICE/kernels.

                     One is the local geographic coordinate system, which is
                     defined as 'LGEO'.
                     The coordinate system is centered at the spacecraft and
                     decomposes into zonal(East-West), meridional(North-South),
                     and radial components:

                     - X: Positive toward the local East.
                     - Y: Positive toward the local North.
                     - Z: Positive away from the planetary surface.

                     This coordinate system has been utilized in MGS IMF
                     draping direction proxy.

                     The other is the streamline-aligned geographic coordinate system,
                     which is defined as 'SGEO'.
                     The coordinate system is centered at the spacecraft.
                     The streamline direction is determined under the assumption
                     that flow is symmetrical both the Mars-Sun line and mainly
                     tangential(horizontal) to the obstracle.

                     - X: Streamline flown from the dayside to nightside.
                     - Y: Z x X (Completes right-handed system; horizontal).
                     - Z: Positive away from the planetary surface.

                     The detailed definision and useful figure are shown in
                     Strangeway and Russell [1996, JGR].

    CREATED BY:      Takuya Hara on 2014-11-24.

     $LastChangedBy: dmitchell $
     $LastChangedDate: 2018-09-13 14:13:46 -0700 (Thu, 13 Sep 2018) $
     $LastChangedRevision: 25794 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/projects/maven/eph/mvn_pfp_cotrans.pro $

(See projects/maven/eph/mvn_pfp_cotrans.pro)

## MVN_PHOBOS_TPLOT

[Previous Routine] [List of Routines]

    FUNCTION: MVN_PHOBOS_TPLOT
    PURPOSE:
         Create tplot variable for the distance between MAVEN and Phobos

    USAGE:
        IDL> mvn_phobos_tplot

    INPUTS:

    KEYWORDS:
       trange:     time interval
       loadspice:  In case you need to load spice variables
       rm:         Use units of Mars radii instead of [km]

    CREATED BY:    Roberto Livi  03-30-15

(See projects/maven/eph/mvn_phobos_tplot.pro)