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

Last modified: Fri Sep 26 18:17:39 2025.

# Directory Listing of Routines

# projects/maven/general/spice

- MVN_SCLK_TEST
  Compares MET to UNIX time conversions for multiple SCLK kernels.
- MVN_SCLK_VERSION_TEST
  compares MAVEN MET to UNIX time conversions for an SCLK kernel with
- MVN_SPICE_CRIB
  Demonstrates usage of MAVEN SPICE ROUTINES
- MVN_SPICE_KERNELS
  Provides maven spice kernel filename of specified type
- MVN_SPICE_KERNELS_UPDATE
  Updates all spice kernels from NAIF, should be run from a cronjob
- MVN_SPICE_LOAD
  LOADS SPICE kernels and creates a few tplot variables
- MVN_SPICE_STAT
  Reports the status of SPICE. This is mainly a wrapper for spice_kernel_info(),
- MVN_SPICE_VALID_TIMES
  Checks whether the currently loaded SPICE/kernels are valid for the specified time.

# Routine Descriptions

## MVN_SCLK_TEST

[Next Routine] [List of Routines]

    PROCEDURE:   mvn_sclk_test
    PURPOSE:
      Compares MET to UNIX time conversions for multiple SCLK kernels.
      Calculates the error incurred when different versions of the SCLK
      kernel are used to convert MET to UNIX time.

    USAGE:
      mvn_sclk_test

    INPUTS:

    KEYWORDS:
           VER:      Integer array indicating the SCLK versions to process.
                     Default is to analyze the latest six versions.

           TRUNC:    If set, then for each kernel only process times up to the
                     release date of the next kernel.

           YLIM:     Set the vertical plot limits.  Default = [0.001,10]

           RESULT:   Named variable to hold the result.

     $LastChangedBy: jimm $
     $LastChangedDate: 2015-09-16 15:37:49 -0700 (Wed, 16 Sep 2015) $
     $LastChangedRevision: 18810 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/projects/maven/general/spice/mvn_sclk_test.pro $

    CREATED BY:    David L. Mitchell

(See projects/maven/general/spice/mvn_sclk_test.pro)

## MVN_SCLK_VERSION_TEST

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

    NAME:
    mvn_sclk_version_test
    PURPOSE:
    compares MAVEN MET to UNIX time conversions for an SCLK kernel with
    the most recent kernels. Returns the time ranges for which kernels do
    and do not match.
    CALLING SEQUENCE:
    mvn_sclk_version_test, sclk_name, trange_ok, trange_not_ok, $
                           test_sclk_name = test_sclk_name
    INPUT:
    sckl_name = the name of the kernel file, this is typically available
    in L2 cdf files.
    OUTPUT:
    trange_ok = the time range for which the two kernels' values
    match. Note that times have resolution of 1 hour
    trange_not_ok = the time range for which the two kernels'
    values do not match
    KEYWORDS:
    test_sclk_name = a file name for the kernel to be tested against, the
    default is to use the current - most recent kernel file.
    dt_tolerance = dt values below this are treated as zero, the default
    is 0.0d0
    HISTORY:
    20-oct-2015, jmm, jimm@ssl.berkeley.edu, hacked from MVN_SCLK_TEST
     $LastChangedBy: jimm $
     $LastChangedDate: 2015-10-20 17:08:23 -0700 (Tue, 20 Oct 2015) $
     $LastChangedRevision: 19120 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/projects/maven/general/spice/mvn_sclk_version_test.pro $

(See projects/maven/general/spice/mvn_sclk_version_test.pro)

## MVN_SPICE_CRIB

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

    NAME: MVN_SPICE_CRIB
     Program: mvn_spice_crib
    PURPOSE:
     Demonstrates usage of MAVEN SPICE ROUTINES

    CALLING SEQUENCE:
      .run mvn_spice_crib

      Author:  Davin Larson
     $LastChangedBy: davin-mac $
     $LastChangedDate: 2014-01-21 17:01:02 -0800 (Tue, 21 Jan 2014) $
     $LastChangedRevision: 13960 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu:36867/repos/idl_socware/trunk/projects/maven/general/mvn_file_source.pro $

(See projects/maven/general/spice/mvn_spice_crib.pro)

## MVN_SPICE_KERNELS

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

    NAME: MVN_SPICE_KERNELS
     function: mvn_spice_kernels(name)
    PURPOSE:
     Provides maven spice kernel filename of specified type

    Typical CALLING SEQUENCE:
      kernels=mvn_spice_kernel()
    TYPICAL USAGE:
    INPUT:
      string must be one of:    Not implemented yet.  currently retrieves ALL files
    KEYWORDS:
     LOAD:   Set keyword to also load file
     TRANGE:  Set keyword to UT timerange to provide range of needed files.
     RECONSTRUCT: If set, then only kernels with reconstructed data (no predicts) are returned.
    OUTPUT:
     fully qualified kernel filename(s)

    WARNING: Be very careful using this routine with the /LOAD keyword. It will change the loaded SPICE kernels that users typically assume are not being changed
    PLEASE DO NOT USE this routine within general "LOAD" routines using the LOAD keyword. "LOAD" routines should assume that SPICE kernels are already loaded.

    Author: Davin Larson  - January 2014
     $LastChangedBy: dmitchell $
     $LastChangedDate: 2025-07-27 14:50:12 -0700 (Sun, 27 Jul 2025) $
     $LastChangedRevision: 33502 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/projects/maven/general/spice/mvn_spice_kernels.pro $

(See projects/maven/general/spice/mvn_spice_kernels.pro)

## MVN_SPICE_KERNELS_UPDATE

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

    NAME:
     MVN_SPICE_KERNELS_UPDATE
    PURPOSE:
     Updates all spice kernels from NAIF, should be run from a cronjob
     once in a while; it can take a long time because all ck kernel
     files are checked
    CALLING SEQUENCE:
     mvn_spice_kernels_update
    INPUT:
     none
    OUTPUT:
     none, spice kernels are updated
     $LastChangedBy: jimm $
     $LastChangedDate: 2017-03-27 13:38:59 -0700 (Mon, 27 Mar 2017) $
     $LastChangedRevision: 23049 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/projects/maven/general/spice/mvn_spice_kernels_update.pro $

(See projects/maven/general/spice/mvn_spice_kernels_update.pro)

## MVN_SPICE_LOAD

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

    NAME: MVN_SPICE_LOAD
     Procedure: mvn_spice_load
    PURPOSE:
     LOADS SPICE kernels and creates a few tplot variables
     Demonstrates usage of MAVEN SPICE ROUTINES

    CALLING SEQUENCE:
       mvn_spice_load  [,kernels=kernels] [,trange=trange]

      Author:  Davin Larson
     $LastChangedBy: ali $
     $LastChangedDate: 2023-12-29 18:52:02 -0800 (Fri, 29 Dec 2023) $
     $LastChangedRevision: 32325 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/projects/maven/general/spice/mvn_spice_load.pro $

(See projects/maven/general/spice/mvn_spice_load.pro)

## MVN_SPICE_STAT

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

    PROCEDURE:   mvn_spice_stat
    PURPOSE:
      Reports the status of SPICE.  This is mainly a wrapper for spice_kernel_info(),
      providing a concise summary of the key information.  The naming convention for
      C kernels (ck) includes a type string:

        red  = reconstructed, daily
        rec  = reconstructed, contact-to-contact (typically a few days)
        rel  = reconstructed, long (typically one week)
        pred = predicted

    USAGE:
      mvn_spice_stat

    INPUTS:

    KEYWORDS:

        LIST:          If set, list the kernels in use.

        INFO:          Returns an array of structures providing detailed information
                       about each kernel, including coverage in time.

        TPLOT:         Makes a colored bar as a tplot variable, to visually show
                       coverage:

                          green  = all kernels available
                          yellow = S/C spk and ck available, missing APP ck
                          red    = S/C spk available, missing S/C ck
                          blank  = missing S/C spk

                       which translates to:

                          green  = spacecraft and all instruments
                          yellow = spacecraft and body-mounted instruments only
                          red    = spacecraft position only
                          blank  = no geometry at all

        SUMMARY:       Provides a concise summary.

        FULL:          Provides additional details: time coverage and objects.

        CHECK:         Set this keyword to a time array to test whether the loaded
                       kernels are sufficient to cover the entire time range.  The
                       time array can be in any format accepted by time_double.
                       If CHECK is set, then keyword SUMMARY will include success
                       flags (1 = sufficient coverage, 0 = insufficient coverage).

        KEY:           Print out the color key and return.

        SILENT:        Shhh.

     $LastChangedBy: dmitchell $
     $LastChangedDate: 2025-07-14 11:38:38 -0700 (Mon, 14 Jul 2025) $
     $LastChangedRevision: 33462 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/projects/maven/general/spice/mvn_spice_stat.pro $

    CREATED BY:    David L. Mitchell  09/14/18

(See projects/maven/general/spice/mvn_spice_stat.pro)

## MVN_SPICE_VALID_TIMES

[Previous Routine] [List of Routines]

    FUNCTION:        MVN_SPICE_VALID_TIMES

    PURPOSE:
                     Checks whether the currently loaded SPICE/kernels are valid for the specified time.

    INPUTS:
         tvar:       Time or time array to be checked.

    KEYWORDS:
         TOLERANCE:  Maximum time difference between input time and nearest valid SPICE coverage.
                     Default = 120 sec.

         SPKONLY:    Consider only SPK kernels.  Any missing CK information is ignored.
                     Useful when spacecraft orientation is not needed.

         BUSONLY:    Consider only C kernels for the spacecraft bus.  Any missing CK information
                     for the APP is ignored.  Useful for instruments not mounted on the APP.

    CREATED BY:      Takuya Hara on 2018-07-11.

    LAST MODIFICATION:
     $LastChangedBy: hara $
     $LastChangedDate: 2021-01-17 18:28:37 -0800 (Sun, 17 Jan 2021) $
     $LastChangedRevision: 29607 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/projects/maven/general/spice/mvn_spice_valid_times.pro $

(See projects/maven/general/spice/mvn_spice_valid_times.pro)