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

Last modified: Sun Jul 27 18:17:41 2025.

# Directory Listing of Routines

# projects/maven/quicklook

- MVN_ATTITUDE_BAR
  Creates a horizontal color bar for tplot, where the spacecraft attitude
- MVN_CALL_PFPL2PLOT
- MVN_GEN_MULTIPNG_PLOT
  Creates full day, and single orbit plots
- MVN_GEN_OVERPLOT
  MAVEN PFP GEN Quicklook Plot
- MVN_L0_DB2FILE
  Given a date and/or a time range, find the appropriate l0 file
- MVN_LPW_QL_3PANELS
- MVN_NGI_READ_CSV
  Reads an NGIMS csv file
- MVN_OVER_SHELL
  Top shell for production of MAVEN PFP overview plots
- MVN_PFPL2_1DAY
  reads in a start and end date, and reprocesses all of the days in
- MVN_PFPL2_LONG_1DAY
  reads in a start and end date, and reprocesses all of the days in
- MVN_PFPL2_LONGPLOT
  MAVEN PFP GEN Quicklook Plot, long-term 2 weeks
- MVN_PFPL2_OVERPLOT
  MAVEN PFP GEN Quicklook Plot
- MVN_QL_PFP_TPLOT
- MVN_QL_PFP_TPLOT2
- MVN_QL_PFP_TPLOT_RESTORE
- MVN_QL_PFP_TPLOT_SAVE
- MVN_QL_PFP_TPLOT_YTICKNAME_MINUS_LOG
- MVN_QL_PFP_TPLOT_YTICKNAME_PLUS_LOG
- MVN_QLOOK_1DAY
  reads in a start and end date, and reprocesses all of the days in
- MVN_QLOOK_BURST_BAR
  creates burst data bar for overview plots
- MVN_QLOOK_FILENAME
  Create s filename for a qlook plot
- MVN_QLOOK_INIT
  Initialization for MAVEN qlook plotting
- MVN_QLOOK_KP_READ
  Reads a MAVEN KP text file,returns an array of values
- MVN_QLOOK_LOAD_KP
  Inputs MAVEN KP insitu data from text files for the given time range
- MVN_QLOOK_MAG_GEOM
  Wrapper for MVN_MAG_GEOM that loads mag data, and Spice kernels
- MVN_QLOOK_STATIC_D1_BAR
  creates static_d1 data bar for overview plots, checks for STATIC D1 data
- MVN_QLOOK_VCHECK
  CHecks to see if data exists for a list of variables. Also will
- MVN_SPACEWEATHER
- MVN_SPACEWEATHER_1DAY
  reads in a start and end date, and reprocesses all of the days in
- MVN_SPACEWEATHER_OVERPLOT
  MAVEN Spaceweather plots
- RUN_MVN_OVER_SHELL30
  Designed to run from a cronjob, sets up a lock file, and
- RUN_PFPL2PLOT
  Designed to run from a cronjob, sets up a lock file, and
- RUN_PFPL2PLOT15
  Designed to run from a cronjob, sets up a lock file, and

# Routine Descriptions

## MVN_ATTITUDE_BAR

[Next Routine] [List of Routines]

    PROCEDURE:   mvn_attitude_bar
    PURPOSE:
      Creates a horizontal color bar for tplot, where the spacecraft attitude
      is coded by color:

        orange = Sun point
        blue   = Earth point
        green  = Fly +/- Y
        red    = Fly-Z (including up and down variants)
        purple = Fly+Z (including up and down variants)

    USAGE:
      mvn_attitude_bar

    INPUTS:
           none

    KEYWORDS:
           FORCE:    Ignore the SPICE checks and forge ahead anyway.

           KEY:      Print out the color key and return.

     $LastChangedBy: dmitchell $
     $LastChangedDate: 2024-01-08 16:12:18 -0800 (Mon, 08 Jan 2024) $
     $LastChangedRevision: 32344 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/projects/maven/quicklook/mvn_attitude_bar.pro $

    CREATED BY:    David L. Mitchell

(See projects/maven/quicklook/mvn_attitude_bar.pro)

## MVN_CALL_PFPL2PLOT

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

    NAME:
     mvn_call_pfpl2plot
    CALLING SEQUENCE:
     mvn_call_pfpl2plot
    INPUT:
     All via keyword
    KEYWORDS:
     time_in = the time for which old files created *after* this date
               will be processed. E.g., if you pass in '2017-11-07'
               then all files created after 7-nov-2017/00:00:00 will
               be reprocessed. The default is to use the system time
               minus 24 hours.
     dtime = The number of seconds prior to system time used in the
             deafult case, defined as 84610.0 seconds.
     before_time = if set, process all of the files created *before* the
                  input time
     days_in = An array of dates, e.g., ['2009-01-30','2009-02-01'] to
               process. This ignores the input time. This option
               replicates the proceesing done by
               thm_reprocess_l2gen_days.
     out_dir = the directory for plots, default is to use the default
               database, /disks/data/maven/data/sci/pfp/l2/plots.
     use_file4time = if set, use filenames for time test instead of file
                     modified time, useful for reprocessing
     search_time_range = if set, then use this time range to find files
                         to be processed, instead of just before or after
                         time.
     no_proc_mail = do not send email when starting a process, so that
                    there aren't a bunch of e,ails during reprocessing
    HISTORY:
    Hacked from mvn_call_sta_l2gen.pro 2015-06-02, jmm
    Added call to mvn_pfpl2_longplot, 2019-12-10, jmm
    Added call to mvn_spaceweather_overplot, 2023-09-05, jmm
     $LastChangedBy: jimm $
     $LastChangedDate: 2023-09-26 14:32:36 -0700 (Tue, 26 Sep 2023) $
     $LastChangedRevision: 32134 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/projects/maven/quicklook/mvn_call_pfpl2plot.pro $

(See projects/maven/quicklook/mvn_call_pfpl2plot.pro)

## MVN_GEN_MULTIPNG_PLOT

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

    NAME:
     mvn_gen_multipng_plot
    PURPOSE:
     Creates full day, and single orbit plots
     Note that the data must have already been plotted for this
     routine to work properly. It calls tplot without arguments.
    CALLING SEQUENCE:
     mvn_gen_multipng_plot, filename_proto, date, directory=directory
    INPUT:
     filename_in = the first part of the eventual filename, e.g.,
                   'mvn_pfp_ql_yyyymmdd'
    OUTPUT:
     png files, with names directory+filename_proto+yyddmm_hshf.png,
     where hshf refers to start and end hours for the plot.
    KEYWORDS:
     directory = the output directory, remember the trailing slash....
     no_fdb = if set, the program will not create a .fdb file; the .fdb
              file for each day contains the start and end times and
              start and end orbits for each filename.
    HISTORY:
     Hacked from thm_gen_multipngplot, 15-oct-2014, jmm,
     jimm@ssl.berkeley.edu
     Switched to plot single orbit plots, 24-apr-2015, jmm
     Plots from apoapsis to apoapsis, suggested by Takuya Hara,
     2015-05-13
     Added date to filenames, 14-jul-2015, jmm
     $LastChangedBy: jimm $
     $LastChangedDate: 2019-05-03 12:00:40 -0700 (Fri, 03 May 2019) $
     $LastChangedRevision: 27186 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/projects/maven/quicklook/mvn_gen_multipngplot.pro $

(See projects/maven/quicklook/mvn_gen_multipngplot.pro)

## MVN_GEN_OVERPLOT

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

    NAME:
     mvn_gen_overplot
    PURPOSE:
     MAVEN PFP GEN Quicklook Plot
    CALLING SEQUENCE:
     mvn_gen_overplot, date = date, time_range = time_range, $
          makepng=makepng, device = device, directory = pdir, $
          l0_input_file = l0_input_file, multipngplot = multipngplot, $
          _extra=_extra
    INPUT:
     No explicit input, everthing is via keyword.
    OUTPUT:
     Plots, on the screen or in a png file
    KEYWORDS:
     date = If set, a plot for the input date.
     time_range = If set, plot this time range, note that this supercedes
                  the date keyword, if both are set, the time range is
                  attempted.
     l0_input_file = A filename for an input file, if this is set, the
                     date and time_range keywords are ignored.
     makepng = If set, make a png file, with filename
               'mvn_gen_qlook_start_time_end_time.png'
     device = a device for set_plot, the default is to use the current
              setting, for cron jobs, device = 'z' is recommended. Note
              that this does not reset the device at the end of the
              program.
     directory = If a png is created, this is the output directory, the
                 default is the current working directory.
     noload_data = If set, assume that all of the data is loaded, and
                   just plot.
     multipngplot = if set, then make multiple plots of 2 and 6 hour
                   duration, in addition to the regular png plot
    Quicklook Tplot Panels

(See projects/maven/quicklook/mvn_gen_overplot.pro)

## MVN_L0_DB2FILE

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

    NAME:
     mvn_l0_db2file
    PURPOSE:
     Given a date and/or a time range, find the appropriate l0 file
    CALLING SEQUENCE:
     filex = mvn_l0_db2file(date)
    INPUT:
     date = the date
    OUTPUT:
     filex = the filename
    KEYWORDS:
     l0_file_type = ['all', 'arc', 'svy'], the default is 'all'
     l0_file_path = if set, use this for the full-path to the l0 file,
                    which seems to be in flux. Don't forget the trailing '/'
    HISTORY:
     12-mar-2014, jmm, jimm@ssl.berkeley.edu
     22-apr-2014, jmm, Added l0_file_type, changed default path
     $LastChangedBy: muser $
     $LastChangedDate: 2020-01-23 16:56:45 -0800 (Thu, 23 Jan 2020) $
     $LastChangedRevision: 28222 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/projects/maven/quicklook/mvn_l0_db2file.pro $

(See projects/maven/quicklook/mvn_l0_db2file.pro)

## MVN_LPW_QL_3PANELS

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

    Helper function for LPW for mvn_gen_qlook
    Made changes to guard against missing data, jmm, 2014-03-25

(See projects/maven/quicklook/mvn_lpw_ql_3panels.pro)

## MVN_NGI_READ_CSV

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

    NAME:
     mvn_ngi_read_csv
    PURPOSE:
     Reads an NGIMS csv file
    CALLING SEQUENCE:
     p = mvn_ngi_read_csv(filename)
    INPUT:
     filename = the input file name, full path.
    OUTPUT:
     p = a structure with tags corresponding to the columns in the file
     tplot_vars = an array of tplot var names, one for each column
     Currently:
         TIME, MASS, SCRIPT, COUNTS_PER_SECOND, MODE, CS_FIL1_EMISSION,
         CS_FIL2_EMISSION, OS_FIL1_EMISSION, OS_FIL2_EMISSION,
         EM1_VOLTAGE, EM2_VOLTAGE
     The column names are encoded in the file.
     tplot_spec = the name of the tplot mass spectrogram variable
    NOTES:
    NGIMS CSV file notes (via Mehdi)

    four operation modes:
         - csn = closed source neutrals
         - osnt = open source neutrals thermal (grid at 0 V)
         - osnb = open source neutrals beam (grid at ~1 V)
             - osi = open source ion

    modes are typically combined on a periapsis pass:
         csn/osnb, csn/osi

    masses are in amu, modulo 150:
         -   0 < mass <= 150 --> attenuation factor = 1
         - 150 < mass <= 300 --> attenuation factor = 10
         - 300 < mass <= 450 --> attenuation factor = 100

    masses can come in any order
    a given mass can be present with multiple attenuation factors

    Noete that the most recent test file has masses up to the
    400's so I assumet aht this is fixed... jmm, 2014-09-22
    masses can come with 1-amu resolution or fractional (~0.1-amu) resolution
         - for fractional resolution, take all masses within 0.5 amu of an
               integer, and take the peak count rate in that range
    *** changed to 0.3 amu, for ovelap issues at m= 27, 28 boundary, jmm,
        2014-08-20 ***

    Corrected Rate = Raw Rate * Attenuation Factor * Emission Gain

    Maybe 3 panels: CSN, OSN, OSI
         - OSN and OSI can be combined, since they cannot be done
           simultaneously, but this might be confusing

    Build up spectrograms one pixel at a time?
    HISTORY:
     2014-07-28, jmm, jimm@ssl.berkeley.edu
     $LastChangedBy: jimm $
     $LastChangedDate: 2015-03-06 16:33:35 -0800 (Fri, 06 Mar 2015) $
     $LastChangedRevision: 17101 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/projects/maven/quicklook/mvn_ngi_read_csv.pro $

(See projects/maven/quicklook/mvn_ngi_read_csv.pro)

## MVN_OVER_SHELL

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

    NAME:
     mvn_over_shell
    PURPOSE:
     Top shell for production of MAVEN PFP overview plots
    CALLING SEQUENCE:
     mvn_over_shell, date = date, $
                     num_days = num_days, $
                     reprocess = reprocess, $
                     instr_to_process = instr_to_process, $
                     start_date=start_date, end_date=end_date
    INPUT:
     All via keyword
    OUTPUT:
     No explicit outputs, just plots
    KEYWORDS:
     date = start date for process, default is today
     num_days = number of days to process, default is 1
     instr_to_process = which instruments, or plopt types, currently one
                        of: ['over', 'lpw', 'mag', 'sep', 'sta', 'swe', 'swia']
     plot_dir = the output directory. The deafult is to write files to:
                '/disks/data/maven/pfp/whatever_instrument/YYYY/MM' given
                the date
     directory = same as plot_dir, kept for backwards compatibility. If
                 both plot_dir and directoy are set, plot_dir should
                 take precedence.
     start_date, end_date = Start and end dates to facilitate
                            reprocessing.
    HISTORY:
     Hacked from thm_over_shell, 2013-05-12, jmm, jimm@ssl.berkeley.edu
     Added pfpl2 overplots, 2015-04-22, jmm
     $LastChangedBy: jimm $
     $LastChangedDate: 2015-06-03 10:53:07 -0700 (Wed, 03 Jun 2015) $
     $LastChangedRevision: 17796 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/projects/maven/quicklook/mvn_over_shell.pro $

(See projects/maven/quicklook/mvn_over_shell.pro)

## MVN_PFPL2_1DAY

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

    NAME:
    mvn_pfpl2_1day
    PURPOSE:
    reads in a start and end date, and reprocesses all of the days in
    the interval. This is a main program, designed to be called from a
    shell script. Processes 1 day at a time
    CALLING SEQUENCE:
     .run mvn_pfpl2_1day
    INPUT:
    start_time, end_time are input from files
    mvn_pfpl2_1day_start_time.txt and
    mvn_pfpl2_1day_end_time.txt.
    OUTPUT:
    PLots, so far pfpl2 1 -day and orbit plots
    HISTORY:
     2015-04-24, jmm, jimm@ssl.berkeley.edu
     2023-10-11, jmm, Calls mvn_call_pfpl2plot instead of mvn_over_shell

(See projects/maven/quicklook/mvn_pfpl2_1day.pro)

## MVN_PFPL2_LONGPLOT

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

    NAME:
     mvn_pfpl2_longplot
    PURPOSE:
     MAVEN PFP GEN Quicklook Plot, long-term 2 weeks
    CALLING SEQUENCE:
     mvn_pfpl2_longplot, date = date, ndays = nays, makepng=makepng, $
                         device = device, directory = pdir
    INPUT:
     No explicit input, everthing is via keyword.
    OUTPUT:
     Plots, on the screen or in a png file
    KEYWORDS:
     date = If set, a plot for the input date and the previous ndays
     ndays = the number of days to plot
                  attempted.
     makepng = If set, make a png file, with filename
               'mvn_gen_qlook_start_time_end_time.png'
     device = a device for set_plot, the default is to use the current
              setting, for cron jobs, device = 'z' is recommended. Note
              that this does not reset the device at the end of the
              program.
     directory = If a png is created, this is the output directory, the
                 default is the current working directory.
     multipngplot = if set, then make multiple plots for each orbit
    HISTORY:
     Hacked from mvn_pfpl2_overplot, 2019-12-10, jmm, jimm@ssl.berkeley.edu
     $LastChangedBy: muser $
     $LastChangedDate: 2019-12-18 13:09:39 -0800 (Wed, 18 Dec 2019) $
     $LastChangedRevision: 28124 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/projects/maven/quicklook/mvn_pfpl2_longplot.pro $

(See projects/maven/quicklook/mvn_pfpl2_longplot.pro)

## MVN_PFPL2_LONG_1DAY

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

    NAME:
    mvn_pfpl2_long_1day
    PURPOSE:
    reads in a start and end date, and reprocesses all of the days in
    the interval. This is a main program, designed to be called from a
    shell script. Processes 1 day at a time
    CALLING SEQUENCE:
     .run mvn_pfpl2_long_1day
    INPUT:
    start_time, end_time are input from files
    mvn_pfpl2_long_1day_start_time.txt and
    mvn_pfpl2_long_1day_end_time.txt.
    OUTPUT:
    PLots, so far pfpl2 long-term (2 week plots)
    HISTORY:
     2015-04-24, jmm, jimm@ssl.berkeley.edu
     2019-12-18, jmm, Optimized for pfpl2_long reprocess

(See projects/maven/quicklook/mvn_pfpl2_long_1day.pro)

## MVN_PFPL2_OVERPLOT

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

    NAME:
     mvn_pfpl2_overplot
    PURPOSE:
     MAVEN PFP GEN Quicklook Plot
    CALLING SEQUENCE:
     mvn_pfpl2_overplot, date = date, time_range = time_range, $
          makepng=makepng, device = device, directory = pdir, $
          multipngplot = multipngplot
    INPUT:
     No explicit input, everthing is via keyword.
    OUTPUT:
     Plots, on the screen or in a png file
    KEYWORDS:
     date = If set, a plot for the input date.
     time_range = If set, plot this time range, note that this supercedes
                  the date keyword, if both are set, the time range is
                  attempted.
     makepng = If set, make a png file, with filename
               'mvn_pfp_l2_date.png'
     device = a device for set_plot, the default is to use the current
              setting, for cron jobs, device = 'z' is recommended. Note
              that this does not reset the device at the end of the
              program.
     directory = If a png is created, this is the output directory, the
                 default is the current working directory.
     multipngplot = if set, then make multiple plots for each orbit
    HISTORY:
     Hacked from thm_over_shell, 2013-05-12, jmm, jimm@ssl.berkeley.edu
     CHanged to use thara's mvn_pl_pfp_tplot.pro, 2015-04-14, jmm
     $LastChangedBy: jimm $
     $LastChangedDate: 2024-04-03 14:29:06 -0700 (Wed, 03 Apr 2024) $
     $LastChangedRevision: 32518 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/projects/maven/quicklook/mvn_pfpl2_overplot.pro $

(See projects/maven/quicklook/mvn_pfpl2_overplot.pro)

## MVN_QLOOK_1DAY

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

    NAME:
    mvn_qlook_1day
    PURPOSE:
    reads in a start and end date, and reprocesses all of the days in
    the interval. This is a main program, designed to be called from a
    shell script. Processes 1 day at a time
    CALLING SEQUENCE:
     .run mvn_qlook_1day
    INPUT:
    start_time, end_time are input from files
    mvn_qlook_1day_start_time.txt and
    mvn_qlook_1day_end_time.txt.
    OUTPUT:
     Maven PFP plots
    HISTORY:
     2014-11-05, jmm, jimm@ssl.berkeley.edu

(See projects/maven/quicklook/mvn_qlook_1day.pro)

## MVN_QLOOK_BURST_BAR

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

    NAME:
     mvn_qlook_burst_bar
    PURPOSE:
     creates burst data bar for overview plots
    CALLING SEQUENCE:
     p = mvn_qlook_burst_bar(date,duration)
    INPUT:
     date =  the date for the start of the timespan,
     duration = the duration of your bar in days
    KEYWORDS:
     outline: set this to 1 to generate a sample rate panel with
              a black outline rather than no outline
     from_l2 = input SWIA L2 data to check for archive data, otherwise
               use L0 input
    OUTPUT:
     p = the variable name of the qlook_burst_bar, set to '' if not
         sccessful
    HISTORY:
     20-nov-2007, jmm, jimm@ssl.berkeley.edu
     $LastChangedBy: jimm $
     $LastChangedDate: 2015-04-22 17:37:04 -0700 (Wed, 22 Apr 2015) $
     $LastChangedRevision: 17402 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/projects/maven/quicklook/mvn_qlook_burst_bar.pro $

(See projects/maven/quicklook/mvn_qlook_burst_bar.pro)

## MVN_QLOOK_FILENAME

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

    NAME:
     mvn_qlook_filename
    PURPOSE:
     Create s filename for a qlook plot
    CALLING SEQUENCE:
     filename = mvn_qlook_filename(intstrument, time_range, $
                                   date_only = date_only)
    INPUT:
     instrument = a string for the instrument, e.g., 'swia', 'swea',
                  etc...
     time_range = start and end times for the data
    OUTPUT:
     filename = a filename
     'mvn_'+instrument+'_ql_'+date+start_hour+end_hour
    KEYWORDS:
     date_only =  if set, only put the start date in the filename
    HISTORY:
     jmm, 2013-06-05

(See projects/maven/quicklook/mvn_qlook_filename.pro)

## MVN_QLOOK_INIT

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

    NAME:
     mvn_qlook_init
    PURPOSE:
     Initialization for MAVEN qlook plotting
    CALLING SEQUENCE:
     mvn_qlook_init, device = device
    INPUT:
     none
    OUTPUT:
     none
    KEYWORDS:
     device = a device for set_plot, the default is to use the current
              setting, for cron jobs, device = 'z' is recommended. Note
              that this does not reset the device at the end of the
              program.
    HISTORY:
     2013-05-13, jmm, jimm@ssl.berkeley.edu
     $LastChangedBy: jimm $
     $LastChangedDate: 2023-04-12 11:14:27 -0700 (Wed, 12 Apr 2023) $
     $LastChangedRevision: 31737 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/projects/maven/quicklook/mvn_qlook_init.pro $

(See projects/maven/quicklook/mvn_qlook_init.pro)

## MVN_QLOOK_KP_READ

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

    NAME:
     mvn_qlook_kp_read
    PURPOSE:
     Reads a MAVEN KP text file,returns an array of values
    CALLING SEQUENCE:
     otp_array = mvn_qlook_kp_read(filename, time_array, column_ids, $
                 tplot = tplot, tvars = tvars)
    INPUT:
     filename = the input filename
    OUTPUT:
     otp_array =  an array of data pointers
     time_array = a time array for the values
     col_quantity = the quantity in the appropriate column
     col_source = the source instrument
     col_units = units
     col_fmt = the format code of the original quantity
     header = a string array of the header lines
    HISTORY:
     18-sep-2015, jmm, jimm@ssl.berkeley.edu
     25-sep-2015, jmm, Moved tplot variable stuff to mvn_qlook_load_kp.pro
    $LastChangedBy: ali $
    $LastChangedDate: 2019-08-27 13:59:45 -0700 (Tue, 27 Aug 2019) $
    $LastChangedRevision: 27681 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/projects/maven/quicklook/mvn_qlook_kp_read.pro $

(See projects/maven/quicklook/mvn_qlook_kp_read.pro)

## MVN_QLOOK_LOAD_KP

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

    NAME:
     mvn_qlook_load_kp
    CALLING SEQUENCE:
     mvn_qlook_load_kp, trange = trange, files = files
    PURPOSE:
     Inputs MAVEN KP insitu data from text files for the given time range
    INPUT:
    OUTPUT:
     a set of tplot variables for the KP data
    KEYWORDS:
     files = if set, then read from these files, otherwise, files are
             figured out from the time range.
     trange = read in the data from this time range, note that if both
              files and time range are set, files takes precedence in
              finding files. If not set, the default is to use the output
              of timerange(), which may prompt the user
     user_pass = a user, password combination to be passed through to
                 file_retrieve.pro, a string with format:
                 'user:password' for sites that require Basic
                 authentication. Digest authentication is not supported.
     no_time_clip = if set do not clip the data to the time range. The
                    trange is only used for file selection.
     tvars = the array of tplot names for variables created
    HISTORY:
     25-sep-2015, jmm, jimm@ssl.berkeley.edu
     $LastChangedBy: jimm $
     $LastChangedDate: 2016-01-08 13:33:01 -0800 (Fri, 08 Jan 2016) $
     $LastChangedRevision: 19704 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/projects/maven/quicklook/mvn_qlook_load_kp.pro $

(See projects/maven/quicklook/mvn_qlook_load_kp.pro)

## MVN_QLOOK_MAG_GEOM

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

    NAME:
     mvn_qlook_mag_geom
    PURPOSE:
     Wrapper for MVN_MAG_GEOM that loads mag data, and Spice kernels
    CALLING SEQUENCE:
     mvn_qlook_mag_gemp, trange=trange, alt=alt, var=var
    INPUT:
     None explicit
    OUTPUT:
     tplot variables for B field
    KEYWORDS: (passed into mvn_mag_geom)
     trange = If set, use this time range
     alt = Electron absorption altitude.  Default = 170 km.
     var = Tplot variable name that contains the magnetic field data
           in payload coordinates.  Default = 'mvn_B_1sec'.  Variable
           names for MAG data in other frames are derived from this.
    HISTORY:
     6-oct-2015, jmm, jimm@ssl.berkeley.edu
     $LastChangedBy: jimm $
     $LastChangedDate: 2015-10-06 13:54:55 -0700 (Tue, 06 Oct 2015) $
     $LastChangedRevision: 19016 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/projects/maven/quicklook/mvn_qlook_mag_geom.pro $

(See projects/maven/quicklook/mvn_qlook_mag_geom.pro)

## MVN_QLOOK_STATIC_D1_BAR

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

    NAME:
     mvn_qlook_static_d1_bar
    PURPOSE:
     creates static_d1 data bar for overview plots, checks for STATIC D1 data
     in L0 files
    CALLING SEQUENCE:
     p = mvn_qlook_static_d1_bar(date,duration)
    INPUT:
     date =  the date for the start of the timespan,
     duration = the duration of your bar in days
    KEYWORDS:
     outline: set this to 1 to generate a sample rate panel with
              a black outline rather than no outline
    OUTPUT:
     p = the variable name of the qlook_static_d1_bar, set to '' if not
         sccessful
    HISTORY:
     2025-05-14, jmm, jimm@ssl.berkeley.edu, hacked from mvn_qlook_burst_bar.pro
     $LastChangedBy: $
     $LastChangedDate: $
     $LastChangedRevision: $
     $URL: $

(See projects/maven/quicklook/mvn_qlook_static_d1_bar.pro)

## MVN_QLOOK_VCHECK

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

    NAME:
     mvn_qlook_vcheck
    PURPOSE:
     CHecks to see if data exists for a list of variables. Also will
     return the overall time range:
    CALLING SEQUENCE:
     vlist_ok = mvn_qlook_vcheck(varlist, tr = tr, ok_vars=ok_vars)
    INPUT:
     vlist = a list of TPLOT variables, can be anything that can be
             resolved by TNAMES, scalar or vector, wildcards, etc...
    OUTPUT:
     vlist_ok = A cleaned list
    KEYWORDS:
     tr = the time range of all of the variables
     ok_vars = subscripts of the good variables in the input list.
     blankp = if set, add a blank panel for missing variables
    HISTORY:
     jmm, jimm@ssl.berkeley.edu, 21-May-2013
     $LastChangedBy: jimm $
     $LastChangedDate: 2014-03-26 14:17:04 -0700 (Wed, 26 Mar 2014) $
     $LastChangedRevision: 14676 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/projects/maven/quicklook/mvn_qlook_vcheck.pro $

(See projects/maven/quicklook/mvn_qlook_vcheck.pro)

## MVN_QL_PFP_TPLOT

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

    PROCEDURE:       MVN_QL_PFP_TPLOT

    PURPOSE:         Creates quicklook summary tplot(s) of MAVEN PF packages.

    INPUTS:

          TRANGE:    An array in any format accepted by time_double().
                     The minimum and maximum values in this array specify
                     the time range to load.

    KEYWORDS:

           ORBIT:    Specifies the time range to show by using
                     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.

       NO_DELETE:    Not deleting pre-exist tplot variable(s).

             PAD:    Restores the SWEA resampling PAD tplot save files by
                     using 'mvn_swe_pad_restore'.

           TPLOT:    Plots the summary tplots.

          WINDOW:    Sets the window number to show tplots.
                     Default is 0.

           TNAME:    Returns the tplot names to plot (or defines the
                     tplot names to plot if user knows the precise names).

          PHOBOS:    Computes the MAVEN and Phobos distance by 'mvn_phobos_tplot'.

          BCRUST:    Defines to execute calculating the crustal magnetic
                     field model, if tplot save files are not available.

       BURST_BAR:    Draw a color bar during the time intervals when the burst
                     (archive) PFP data has been already downlinked and available.

          SUNDIR:    Computes the direction of the Sun in the payload coordinates.
                     It can be useful for Tohban to check the MAG rolls.

          TOHBAN:    If set, some additional tplot variables, which burst request
                     "Tohban" should sometimes check, are automatically generated.
                        - Currently available burst data time segments,
                        - Phobos-MAVEN distance,
                        - Sun direction in the payload coordinates used
                          to check the MAG rolls.

    SPACEWEATHER:    If set, some representative tplot variables useful
                     for the spaceweather studies will be created.

         SWIA, SWEA, STATIC, SEP, MAG, LPW, EUV individual instruments' switches to load:
                     Default = 1 except for EUV. If they set to be zero (e.g., swia=0), it skips to load.

    NOTE:            This routine is assumed to be used when there are
                     no tplot variables.

    CREATED BY:      Takuya Hara on 2015-04-09.

    LAST MODIFICATION:
     $LastChangedBy: jimm $
     $LastChangedDate: 2024-03-14 13:06:27 -0700 (Thu, 14 Mar 2024) $
     $LastChangedRevision: 32496 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/projects/maven/quicklook/mvn_ql_pfp_tplot.pro $

(See projects/maven/quicklook/mvn_ql_pfp_tplot.pro)

## MVN_QL_PFP_TPLOT2

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

    PROCEDURE:       MVN_QL_PFP_TPLOT2

    PURPOSE:         Creates quicklook summary tplot(s) of MAVEN PF packages.

    INPUTS:

          TRANGE:    An array in any format accepted by time_double().
                     The minimum and maximum values in this array specify
                     the time range to load.

    KEYWORDS:

           ORBIT:    Specifies the time range to show by using
                     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.

       NO_DELETE:    Not deleting pre-exist tplot variable(s).

             PAD:    Restores the SWEA resampling PAD tplot save files by
                     using 'mvn_swe_pad_restore'.

           TPLOT:    Plots the summary tplots.

          WINDOW:    Sets the window number to show tplots.
                     Default is 0.

           TNAME:    Returns the tplot names to plot (or defines the
                     tplot names to plot if user knows the precise names).

          PHOBOS:    Computes the MAVEN and Phobos distance by 'mvn_phobos_tplot'.

          BCRUST:    Defines to execute calculating the crustal magnetic
                     field model, if tplot save files are not available.

       BURST_BAR:    Draw a color bar during the time intervals when the burst
                     (archive) PFP data has been already downlinked and available.

          SUNDIR:    Computes the direction of the Sun in the payload coordinates.
                     It can be useful for Tohban to check the MAG rolls.

          TOHBAN:    If set, some additional tplot variables, which burst request
                     "Tohban" should sometimes check, are automatically generated.
                        - Currently available burst data time segments,
                        - Phobos-MAVEN distance,
                        - Sun direction in the payload coordinates used
                          to check the MAG rolls.

    SPACEWEATHER:    If set, some representative tplot variables useful
                     for the spaceweather studies will be created.

         SWIA, SWEA, STATIC, SEP, MAG, LPW, EUV individual instruments' switches to load:
                     Default = 1 except for EUV. If they set to be zero (e.g., swia=0), it skips to load.

    NOTE:            This routine is assumed to be used when there are
                     no tplot variables.

    CREATED BY:      Takuya Hara on 2015-04-09.

    LAST MODIFICATION:
     $LastChangedBy: jimm $
     $LastChangedDate: 2024-03-14 13:06:27 -0700 (Thu, 14 Mar 2024) $
     $LastChangedRevision: 32496 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/projects/maven/quicklook/mvn_ql_pfp_tplot2.pro $

(See projects/maven/quicklook/mvn_ql_pfp_tplot2.pro)

## MVN_QL_PFP_TPLOT_RESTORE

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

    PROCEDURE:       MVN_QL_PFP_TPLOT_RESTORE

    PURPOSE:         Restores a daily summary tplot save file of Tohban's MAVEN PFP data.

    INPUTS:          Time range to be restored.

    CREATED BY:      Takuya Hara on 2019-11-19.

    LAST MODIFICATION:
     $LastChangedBy: jimm $
     $LastChangedDate: 2023-10-09 15:39:51 -0700 (Mon, 09 Oct 2023) $
     $LastChangedRevision: 32181 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/projects/maven/quicklook/mvn_ql_pfp_tplot_restore.pro $

(See projects/maven/quicklook/mvn_ql_pfp_tplot_restore.pro)

## MVN_QL_PFP_TPLOT_SAVE

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

    PROCEDURE:       MVN_QL_PFP_TPLOT_SAVE

    PURPOSE:         Creates a daily summary tplot save file of Tohban's MAVEN PFP data.

    INPUTS:          Time range as a string format of 'YYYY-MM-DD'.

    EXAMPLE:         IDL> mvn_ql_pfp_tplot_save, '2019-11-13', '2019-11-19'

    CREATED BY:      Takuya Hara on 2019-11-13.

    LAST MODIFICATION:
     $LastChangedBy: jimm $
     $LastChangedDate: 2019-12-10 13:25:11 -0800 (Tue, 10 Dec 2019) $
     $LastChangedRevision: 28105 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/projects/maven/quicklook/mvn_ql_pfp_tplot_save.pro $

(See projects/maven/quicklook/mvn_ql_pfp_tplot_save.pro)

## MVN_QL_PFP_TPLOT_YTICKNAME_MINUS_LOG

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

     Helper function -- split out of mvn_ql_pfp_tplot. Generates ytickformat

     $LastChangedBy: jimm $
     $LastChangedDate: 2017-02-17 11:57:18 -0800 (Fri, 17 Feb 2017) $
     $LastChangedRevision: 22819 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/projects/maven/quicklook/mvn_ql_pfp_tplot_ytickname_minus_log.pro $

(See projects/maven/quicklook/mvn_ql_pfp_tplot_ytickname_minus_log.pro)

## MVN_QL_PFP_TPLOT_YTICKNAME_PLUS_LOG

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

     Helper function -- split out of mvn_ql_pfp_tplot. Generates ytickformat

     $LastChangedBy: muser $
     $LastChangedDate: 2017-10-03 12:16:45 -0700 (Tue, 03 Oct 2017) $
     $LastChangedRevision: 24102 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/projects/maven/quicklook/mvn_ql_pfp_tplot_ytickname_plus_log.pro $

(See projects/maven/quicklook/mvn_ql_pfp_tplot_ytickname_plus_log.pro)

## MVN_SPACEWEATHER

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

    PROCEDURE:       MVN_SPACEWEATHER

    PURPOSE:         Creates tplot variables w.r.t the spaceweather events at Mars observed by MAVEN.
                     It is anticipated that the result will be sent to the M2M/CCMC team.

    INPUTS:          Time range to be loaded.

    KEYWORDS:

          PATH:      Spacifies the PATH where to output the result. Default is './' (i.e., current directory).

         TPLOT:      If set, visualizes the result on the tplot window.
                     This keyword is useful for C. Lee's spaceweather report at the MAVEN Thursday telecon.

         PRINT:      If set, the result will be output to .dat file(s).

       HALEKAS:      If set, J. Halekas's upstream driver file is downloaded and then used.

        NOLOAD:      If users have already loaded tplot variables yet, users can skip the data loading section when it is on.

          TEST:      If set, users can check whether it works well.

    CREATED BY:      Takuya Hara on 2022-11-04.

    LAST MODIFICATION:
     $LastChangedBy: hara $
     $LastChangedDate: 2023-10-18 15:16:24 -0700 (Wed, 18 Oct 2023) $
     $LastChangedRevision: 32202 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/projects/maven/quicklook/mvn_spaceweather.pro $

(See projects/maven/quicklook/mvn_spaceweather.pro)

## MVN_SPACEWEATHER_1DAY

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

    NAME:
    mvn_spaceweather_1day
    PURPOSE:
    reads in a start and end date, and reprocesses all of the days in
    the interval. This is a main program, designed to be called from a
    shell script. Processes 1 day at a time
    CALLING SEQUENCE:
     .run mvn_spaceweather_1day
    INPUT:
    start_time, end_time are input from files
    mvn_spaceweather_1day_start_time.txt and
    mvn_spaceweather_1day_end_time.txt.
    OUTPUT:
    PLots, spaceweather 1,3 and 7-day
    HISTORY:
     2023-10-11, jmm, jimm@ssl.berkeley.edu

(See projects/maven/quicklook/mvn_spaceweather_1day.pro)

## MVN_SPACEWEATHER_OVERPLOT

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

    NAME:
     mvn_spaceweather_overplot
    PURPOSE:
     MAVEN Spaceweather plots
    CALLING SEQUENCE:
     mvn_spaceweather_overplot, date = date, time_range = time_range, $
                   makepng=makepng, device = device, directory = pdir
    INPUT:
     No explicit input, everthing is via keyword.
    OUTPUT:
     Plots, on the screen or in 3 png files
    KEYWORDS:
     date = If set, a plot for the input date. If /makepng is set, then 3
            plots, date input now refers to the end time
     time_range = If set, plot this time range, note that this supercedes
                  the date keyword, if both are set, the time range is
                  attempted, and this will plot a single plot, not for 3
                  different date ranges
     makepng = If set, make png files, with filenames:
               mvn_spaceweather_date_1d.png, for a single day starting at
               the input date
               mvn_spaceweather_date_3d.png, for 3 days starting at
               the input date
               mvn_spaceweather_date_7d.png, for 7 days starting at
               the input date
     device = a device for set_plot, the default is to use the current
              setting, for cron jobs, device = 'z' is recommended. Note
              that this does not reset the device at the end of the
              program.
     directory = If a pngs are created, this is the output directory, the
                 default is the current working directory. The plots are
                 created in subdirectories /1day, /3day, /7day
    HISTORY:
     2023-09-05, jmm, jimm@ssl.berkeley.edu
     2023-10-11, jmm, Input date is now the end time?
     $LastChangedBy: jimm $
     $LastChangedDate: 2023-10-17 13:55:01 -0700 (Tue, 17 Oct 2023) $
     $LastChangedRevision: 32198 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/projects/maven/quicklook/mvn_spaceweather_overplot.pro $

(See projects/maven/quicklook/mvn_spaceweather_overplot.pro)

## RUN_MVN_OVER_SHELL30

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

    NAME:
     run_mvn_over_shell30
    PURPOSE:
     Designed to run from a cronjob, sets up a lock file, and
     processes the single-instrument plots from thirty days ago. If the
     lock file exists, no processing. Added 7, 14 day reprocess, jmm,
     2020-12-30.
    CALLING SEQUENCE:
     run_mvn_over_shell30, ndays_offset = ndays_offset
    INPUT:
     none
    OUTPUT:
     none
    KEYWORDS:
     ndays_offset = days from now that is being processed, the default is
                    [3,7,14,30].
    HISTORY:
     8-dec-2020, jmm, jimm@ssl.berkeley.edu
     $LastChangedBy: jimm $
     $LastChangedDate: 2024-05-28 13:41:50 -0700 (Tue, 28 May 2024) $
     $LastChangedRevision: 32654 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/projects/maven/quicklook/run_mvn_over_shell30.pro $

(See projects/maven/quicklook/run_mvn_over_shell30.pro)

## RUN_PFPL2PLOT

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

    NAME:
     run_pfpl2plot
    PURPOSE:
     Designed to run from a cronjob, sets up a lock file, and
     processes. It the lock file exists, no processing
    CALLING SEQUENCE:
     run_pfpl2plot, noffset_sec = noffset_sec
    INPUT:
     none
    OUTPUT:
     none
    KEYWORDS:
     none
    HISTORY:
     25-jun-2014, jmm, jimm@ssl.berkeley.edu
     $LastChangedBy: jimmpc1 $
     $LastChangedDate: 2017-09-05 11:35:05 -0700 (Tue, 05 Sep 2017) $
     $LastChangedRevision: 23885 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/projects/maven/quicklook/run_pfpl2plot.pro $

(See projects/maven/quicklook/run_pfpl2plot.pro)

## RUN_PFPL2PLOT15

[Previous Routine] [List of Routines]

    NAME:
     run_pfpl2plot15
    PURPOSE:
     Designed to run from a cronjob, sets up a lock file, and
     processes. It the lock file exists, no processing. This program
     process the most recent N depending on the num_days keyword, default
     value is 15.
    CALLING SEQUENCE:
     run_pfpl2plot15, num_days = num_days
    INPUT:
     none
    OUTPUT:
     none
    KEYWORDS:
     num_days =  process the last num_days days, default is 15
    HISTORY:
     19-oct-2023, jmm, jimm@ssl.berkeley.edu
     $LastChangedBy: $
     $LastChangedDate: $
     $LastChangedRevision: $
     $URL: $

(See projects/maven/quicklook/run_pfpl2plot15.pro)