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

Last modified: Fri Nov 7 18:17:52 2025.

# Directory Listing of Routines

# projects/maven

- MORBIT
  Given the orbit size and shape (based on 2 of 5 orbital parameters),
- MVN_SPC_MET_TO_UNIXTIME

# Routine Descriptions

## MORBIT

[Next Routine] [List of Routines]

    PROCEDURE:   morbit
    PURPOSE:
      Given the orbit size and shape (based on 2 of 5 orbital parameters),
      calculates the orbital position and velocity of a satellite around a
      planet as a function of time.  This routine is very fast when the
      orbital eccentricity is less than 0.95, but labors when it is very
      close to unity.  This routine will not work at all for parabolic and
      hyperbolic orbits.

      Calculations assume a spherical central body with a spherically
      symmetric mass distribution, and that the mass of the central body
      dominates in the region of interest.

      You can also specify an orientation for the orbit and then create a
      'fly-through' in cartesian coordinates.

    USAGE:
      morbit, param, dt=dt, result=dat

    INPUTS:
           PARAM:     Orbit parameter structure, which has two of the
                      following tags:

                        period : orbital period (hours)
                        sma    : semi-major axis (km)
                        palt   : periapsis altitude (km)
                        aalt   : apoapsis altitude (km)
                        ecc    : eccentricity

                      The two parameters you specify must define the
                      size and shape of the orbit.  Any two will work,
                      except for period and sma, which both define the
                      orbit size.  The remaining parameters are
                      calculated from the two you specify.

    KEYWORDS:
           ORIENT:    A structure specifying the orientation of the
                      orbit with three tags:

                        lon    : longitude of periapsis (deg)
                        lat    : latitude  of periapsis (deg)
                        incl   : orbital inclination (deg)

                      Lon and lat can be arrays, resulting in a grid of
                      calculations.  Incl must be a scalar.

                      Note that abs(lat) <= abs(incl) is required.

                      Default = {lon:0, lat:0, incl:90}

                      Normally, the longitude, latitude, and inclination
                      are specified in planetocentric coordinates (i.e.,
                      relative to the planet's spin axis); however, any
                      coordinate system can be assumed, so long as all
                      three parameters are in the SAME coordinate system.

           FLYTHRU:   The name for a text output file containing the
                      cartesian coordinates of the satellite vs. time
                      for the orbit orientation specified in ORIENT.
                      The columns for this table are:

                         1 -> time (sec after apoapsis)
                         2 -> X (km)
                         3 -> Y (km)
                         4 -> Z (km)
                         5 -> orbital velocity (km/s)

                      If you don't specify this keyword, then the
                      fly-through is still calculated and saved in
                      RESULT.

           PLANET:    This can be a string to select one of the eight
                      planets.  The following are also recognized: Moon,
                      Sun, Pluto, Charon, Eris, and Ceres.  It can also
                      be a structure with the following tags:

                        Mass   : mass (g)
                        Radius : radius (km)
                        Name   : 'name'           [optional]

                      Default = 'Mars'.  If PLANET is unrecognized, you
                      will be prompted for mass and radius.  This routine
                      is not expected to give good results for the Pluto-
                      Charon system, because they have masses within a
                      factor of 10 of each other.

           SHOCK:     If PLANET = 'Mars' or 'Earth', then setting this
                      keyword will show the nominal shock location on the
                      orbit plots (see keyword OPLOT).  Default = no.

           SHCOL:     Colors for the shock and MPB.

           SHSTY:     Line style for the shock and MPB.

           DT:        Time resolution (sec).  Default = PARAM.period/1000.

           NORBIT:    Number of orbits for calculating the solution.
                      Default = 1.

           NMAX:      Maximum number of iterations for the orbit solver.
                      Default = 400.  Larger numbers might be needed if
                      the orbital eccentricity is greater than 0.95.

           OERR:      Maximum error in orbit solution, which translates
                      roughly into fractional error in the position.
                      Default = 1.e-6.  Increase this only if you want a
                      quicker solution at the expense of accuracy.

           RESULT:    A structure containing the satellite altitude and
                      true anomaly versus time.  The true anomaly is the
                      angle in the plane of the orbit about the center
                      of the planet, with zero degrees at periapsis.
                      The orbital velocity, and the orbit size and shape
                      parameters are also given.

           OPLOT:     Plot the orbit with three orthogonal views.

           TPLOT:     Show a time series of altitude and orbital velocity.
                      (The dashed red line shows escape velocity.)

           WSCALE:    Window size scale factor.  Default = 1.

           XYPLANE:   Plot the orbit in the XY plane only.  Only works if
                      OPLOT is set.

           XYRANGE:   Axis plot ranges in planetary radii.  Default is to
                      fit the orbit on the plot.

           NODOT:     Do not plot a symbol for periapsis.

           PS:        Postscript plots are produced for OPLOT and TPLOT.

           SILENT:    If set, then suppress output.

           SEGMENTS:  Divide the orbit up into segments for color coding.
                      This keyword should contain the time in minutes
                      relative to apoapsis of each segment boundary.
                      The first segment extends from APO to SEGMENTS[0].
                      The last segment extends from SEGMENTS[N-1] to APO,
                      where N is the number of segments.

           SCOLORS:   Color for each segment.  Must have the same number of
                      elements as SEGMENTS.

           STHICK:    Line thickness for segments.

           NOPLOT:    No text output, no plots.  Useful for calling this
                      routine within a loop.

     $LastChangedBy: dmitchell $
     $LastChangedDate: 2025-01-03 12:12:29 -0800 (Fri, 03 Jan 2025) $
     $LastChangedRevision: 33038 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/projects/maven/morbit.pro $

    CREATED BY:	David L. Mitchell

(See projects/maven/morbit.pro)

## MVN_SPC_MET_TO_UNIXTIME

[Previous Routine] [List of Routines]

    Function:  mvn_spc_met_to_unixtime
    Purpose:  Convert MET (mission Elapsed Time) to Unix Time  (which is almost equivalent to UTC)
    see also:  "mvn_spc_unixtime_to_met" for the reverse conversion
     This routine is in the process of being modified to use SPICE Kernels to correct for clock drift as needed.
     Author: Davin Larson
     $LastChangedBy: jimm $
     $LastChangedDate: 2024-03-05 14:36:55 -0800 (Tue, 05 Mar 2024) $
     $LastChangedRevision: 32478 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/projects/maven/mvn_spc_met_to_unixtime.pro $

(See projects/maven/mvn_spc_met_to_unixtime.pro)