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

Last modified: Mon Aug 25 17:03:10 2025.

# Directory Listing of Routines

# general/missions/wind/waves

- SPD_GEN_PROMPT_ROUTINE
- SPD_GET_VALID_TRANGE
- TEST_SPD_DATE_FORMAT
- WI_TDS_DUSTIMPACT_LOAD

# Routine Descriptions

## SPD_GEN_PROMPT_ROUTINE

[Next Routine] [List of Routines]

    *****************************************************************************************

      FUNCTION :   spd_gen_prompt_routine.pro
      PURPOSE  :   Prompts user for information related to STR_OUT or informs user with
                     information defined by PRO_OUT or ERRMSG.  The routine returns
                     the output from the prompt if the user set STR_OUT.

      CALLED BY:
                   NA

      INCLUDES:
                   NA

      CALLS:
                   is_num.pro

      REQUIRES:
                   1)  SPEDAS IDL Libraries

      INPUT:
                   TEST_IN    :  Scalar [see FORM_OUT] that is used to initialize the
                                   prompt return variable
                                   [Default = {not set}]

      EXAMPLES:
                   [calling sequence]
                   val__out = spd_gen_prompt_routine([test_in] [,STR_OUT=str_out]         $
                                                     [,PRO_OUT=pro_out] [,ERRMSG=errmsg]  $
                                                     [,FORM_OUT=form_out]                 )

      KEYWORDS:
                   STR_OUT    :  Scalar [string] that tells the user what to enter at
                                   prompt
                                   [Default = {not set}]
                   PRO_OUT    :  Scalar(or array) [string] containing instructions for
                                   input.  If input is an array, each element is output as
                                   a new line.
                                   [Default = {not set}]
                   ERRMSG     :  Scalar(or array) [string] containing error message(s) the
                                   user wishes to print to screen for feedback from a
                                   calling/wrapping routine.  If input is an array, each
                                   element is output as a new line.
                                   [Default = {not set}]
                   FORM_OUT   :  Scalar [integer/long] defining the type code of the prompt
                                   input and output.  Let us define the following,
                                   for brevity:
                                        FPN = floating-point #
                                        SP  = single-precision
                                        DP  = double-precision
                                        UI  = unsigned integer
                                        SI  = signed integer
                                   Allowed input values include:
                                      1  :  BYTE     [8-bit UI]
                                      2  :  INT      [16-bit SI]
                                      3  :  LONG     [32-bit SI]
                                      4  :  FLOAT    [32-bit, SP, FPN]
                                      5  :  DOUBLE   [64-bit, DP, FPN]
                                      6  :  COMPLEX  [32-bit, SP, FPN for Real and Imaginary]
                                      7  :  STRING   [0 to 2147483647 characters]
                                      9  :  DCOMPLEX [64-bit, DP, FPN for Real and Imaginary]
                                     12  :  UINT     [16-bit UI]
                                     13  :  ULONG    [32-bit UI]
                                     14  :  LONG64   [64-bit SI]
                                     15  :  ULONG64  [64-bit UI]
                                   [Default = 7]

       CHANGED:  1)  Finished writing routine and moved to ~/wind_3dp_pro/LYNN_PRO
                                                                       [04/29/2015   v1.0.0]
                 2)  Fixed a bug in type determining case statement and updated Man. page
                                                                       [09/08/2016   v1.1.0]
                 3)  Changed name from general_prompt_routine.pro to
                       spd_gen_prompt_routine.pro for migration of version
                       to SPEDAS libraries --> now calls:
                       is_num.pro
                                                                       [09/08/2016   v1.2.0]

       NOTES:
                   1)  See IDL documentation for SIZE.PRO for possible type codes
                   2)  If FORM_OUT = 7, then the routine will force a lower-case output
                   3)  This is a direct adaptation of the routine general_prompt_routine.pro
                         from L.B. Wilson's UMN Modified Wind/3DP IDL Libraries

      REFERENCES:
                   NA

       CREATED:  04/28/2015
       CREATED BY:  Lynn B. Wilson III
        LAST MODIFIED:  09/08/2016   v1.2.0
        MODIFIED BY: Lynn B. Wilson III

     $LastChangedBy: lbwilsoniii_desk $
     $LastChangedDate: 2016-09-08 13:15:03 -0700 (Thu, 08 Sep 2016) $
     $LastChangedRevision: 21805 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/general/missions/wind/waves/spd_gen_prompt_routine.pro $

    *****************************************************************************************

(See general/missions/wind/waves/spd_gen_prompt_routine.pro)

## SPD_GET_VALID_TRANGE

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

    *****************************************************************************************

      FUNCTION :   spd_get_valid_trange.pro
      PURPOSE  :   This routine determines a time range in several formats from inputs
                     define by the optional keywords or prompts to the user.

      CALLED BY:
                   NA

      INCLUDES:
                   NA

      CALLS:
                   time_double.pro
                   test_spd_date_format.pro
                   is_num.pro
                   spd_gen_prompt_routine.pro
                   time_string.pro
                   time_struct.pro

      REQUIRES:
                   1)  SPEDAS IDL Libraries

      INPUT:
                   NA

      EXAMPLES:
                   [calling sequence]
                   struc = spd_get_valid_trange([TDATE=tdate] [,TRANGE=trange] $
                                                [,PRECISION=prec]              )

      KEYWORDS:
                   TDATE          :  Scalar [string] defining the date of interest of the form:
                                       'YYYY-MM-DD' [MM=month, DD=day, YYYY=year]
                                       [Default = {prompted input if TRANGE not set}]
                   TRANGE         :  [2]-Element [double] array specifying the Unix time
                                       range for which to define/constrain data
                                       [Default = {prompted input if TDATE not set}]
                   PRECISION      :  Scalar [long] defining precision of the string output:
                                       = -5  :  Year only
                                       = -4  :  Year, month
                                       = -3  :  Year, month, date
                                       = -2  :  Year, month, date, hour
                                       = -1  :  Year, month, date, hour, minute
                                       = 0   :  Year, month, date, hour, minute, sec
                                       = >0  :  fractional seconds
                                       [Default = 0]
                   MIN_TDATE      :  Scalar [string] defining the minimum allowable
                                       date that user can specify [same format as TDATE]
                                       [Default = '1957-10-04']
                   MAX_TDATE      :  Scalar [numeric] defining the maximum allowable
                                       date that user can specify [same format as TDATE]
                                       [Default = {today's date}]

       CHANGED:  1)  Continued to write routine
                                                                       [09/25/2015   v1.0.0]
                 2)  Fixed bug when both TDATE and TRANGE are set
                                                                       [09/25/2015   v1.0.1]
                 3)  Changed a default output message, updated Man. page, and changed the
                       minimum time range limit from 1 hour to 1 microsecond
                                                                       [10/05/2015   v1.0.2]
                 4)  Added NOMSSG keyword to test_tdate_format.pro to reduce unnecessary
                       and/or redundant output messages
                                                                       [11/02/2015   v1.0.3]
                 5)  Fixed bug when NO_CLEAN keyword is set in call to time_struct.pro
                       [bug only affected day of year output]
                                                                       [09/08/2016   v1.1.0]
                 6)  Changed name from get_valid_trange.pro to
                       spd_get_valid_trange.pro for migration of version
                       to SPEDAS libraries --> now calls:
                       test_spd_date_format.pro
                       is_num.pro
                       spd_gen_prompt_routine.pro
                       and added keywords:  MAX_TDATE and MIN_TDATE
                                                                       [09/08/2016   v1.2.0]

       NOTES:
                   1)  If no keywords are given, the routine will prompt the user for a
                         single date and define the time range as that given date.
                   2)  See also:  time_struct.pro, time_string.pro, time_struct.pro
                   3)  Setting TDATE will result in a time range for the date defined from
                         the start to the end of the day
                   3)  This is a direct adaptation of the routine get_valid_trange.pro
                         from L.B. Wilson's UMN Modified Wind/3DP IDL Libraries

      REFERENCES:
                   NA

       CREATED:  09/23/2015
       CREATED BY:  Lynn B. Wilson III
        LAST MODIFIED:  09/08/2016   v1.2.0
        MODIFIED BY: Lynn B. Wilson III

     $LastChangedBy: lbwilsoniii_desk $
     $LastChangedDate: 2016-09-08 13:15:03 -0700 (Thu, 08 Sep 2016) $
     $LastChangedRevision: 21805 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/general/missions/wind/waves/spd_get_valid_trange.pro $

    *****************************************************************************************

(See general/missions/wind/waves/spd_get_valid_trange.pro)

## TEST_SPD_DATE_FORMAT

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

    *****************************************************************************************

      FUNCTION :   test_spd_date_format.pro
      PURPOSE  :   This routine tests whether an input is consistent with the expected
                     format for a date used by several software routines within the
                     TPLOT libraries.  The expected format is 'YYYY-MM-DD', where
                     YYYY=year, MM=month, and DD=day.

      CALLED BY:
                   NA

      INCLUDES:
                   NA

      CALLS:
                   NA

      REQUIRES:
                   NA

      INPUT:
                   TDATE    :  Scalar (or array) [string] defining the date of interest of
                                 the form:  'YYYY-MM-DD' [MM=month, DD=day, YYYY=year]

      EXAMPLES:
                   [calling sequence]
                   test = test_tdate_format(tdate [,NOMSSG=nomssg])

      KEYWORDS:
                   NOMSSG   :  If set, routine will not print out warning/informational
                                 messages
                                 [Default = FALSE]

       CHANGED:  1)  Added keyword:  NOMSSG
                                                                       [11/02/2015   v1.1.0]
                 2)  Changed name from test_tdate_format.pro to test_spd_date_format.pro
                       for migration of version to SPEDAS libraries
                                                                       [09/08/2016   v1.2.0]

       NOTES:
                   1)  The format expected by this routine is commonly used in the
                         SPEDAS/TDAS libraries
                   2)  This is a direct adaptation of the routine test_tdate_format.pro from
                         L.B. Wilson's UMN Modified Wind/3DP IDL Libraries

      REFERENCES:
                   NA

       CREATED:  09/22/2015
       CREATED BY:  Lynn B. Wilson III
        LAST MODIFIED:  09/08/2016   v1.2.0
        MODIFIED BY: Lynn B. Wilson III

     $LastChangedBy: lbwilsoniii_desk $
     $LastChangedDate: 2016-09-08 13:15:03 -0700 (Thu, 08 Sep 2016) $
     $LastChangedRevision: 21805 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/general/missions/wind/waves/test_spd_date_format.pro $

    *****************************************************************************************

(See general/missions/wind/waves/test_spd_date_format.pro)

## WI_TDS_DUSTIMPACT_LOAD

[Previous Routine] [List of Routines]

    *****************************************************************************************

      PROCEDURE:   wi_tds_dustimpact_load.pro
      PURPOSE  :   This routine retrieves/downloads CDF files and loads the resulting data
                     into TPLOT.  The data files contain the dust impact database from the
                     Wind/WAVES instrument's time domain sampler (TDS), created by
                     David M. Malaspina and Lynn B. Wilson III as part of a 2014 NASA
                     ROSES Heliophysics Guest Investigator (H-GI) program for the Open Data-
                     Development Element (ODDE) grant.

      CALLED BY:
                   NA

      INCLUDES:
                   NA

      CALLS:
                   time_string.pro
                   time_double.pro
                   root_data_dir.pro
                   wind_init.pro
                   spd_get_valid_trange.pro
                   is_num.pro
                   file_dailynames.pro
                   spd_download.pro
                   file_retrieve.pro
                   timespan.pro
                   cdf2tplot.pro
                   tnames.pro
                   options.pro
                   tplot_options.pro
                   get_data.pro
                   store_data.pro

      REQUIRES:
                   1)  SPEDAS IDL Libraries
                   2)  TDS dust impact database CDF files at:
                         http://spdf.gsfc.nasa.gov/pub/data/wind/waves/dust_impact_l3/

      INPUT:
                   NA

      EXAMPLES:
                   [calling sequence]
                   wi_tds_dustimpact_load [,TRANGE=trange] [,VERBOSE=verbose]       $
                                          [,/DOWNLOADONLY] [,VARFORMAT=varformat]   $
                                          [,SOURCE_OPTIONS=source] [,/ADDMASTER]    $
                                          [,PREFIX=prefix] [,MIDFIX=midfix]         $
                                          [,MIDPOS=midpos] [,SUFFIX=suffix]         $
                                          [/LOAD_LABELS] [,FILES=files]             $
                                          [,TPLOTNAMES=tplotnames]

                   ;;  Example:  Get dust impacts between Jan. 1-4, 2000
                   tdate_st       = '2000-01-01'
                   tdate_en       = '2000-01-04'
                   start_of_day   = '00:00:00.000'
                   end___of_day   = '23:59:59.999'
                   tr_t           = [tdate_st[0]+'/'+start_of_day[0],tdate_en[0]+'/'+end___of_day[0]]
                   tran           = time_double(tr_t)
                   wi_tds_dustimpact_load,TRANGE=tran,FILES=files,TPLOTNAMES=tplotnames

      KEYWORDS:
                   **********************************
                   ***       DIRECT  INPUTS       ***
                   **********************************
                   TRANGE          :  [2]-Element [double] array specifying the Unix time
                                       range for which to limit the data in DATA
                                       [Default = handled by file finding routines]
                   VERBOSE         :  Scalar [numeric] defining the level to which the
                                        routine dprint.pro outputs information
                   DOWNLOADONLY    :  If set, routine will exit after it retrieves the
                                        desired data files
                                        [Default = FALSE]
                   VARFORMAT       :  Scalar or [N]-Element [string] array specifying the
                                        CDF variable names to load into TPLOT
                                        [Default = '*' (for all variables)]
                   DATATYPE        :  ***  Not Used by this routine  ***
                                        [kept for compatibility with other SPEDAS routines]
                   SOURCE_OPTIONS  :  Scalar [structure] defining information relevant to
                                        local and remote file management
                                        [Default = !wind (initiated by wind_init.pro)]
                   ADDMASTER       :  If set, the routine file_dailynames.pro will add a
                                        file path with the zeroth date
                                        [Default = FALSE]
                   PREFIX          :  Scalar [string] defining the characters that will
                                        pre-pend all TPLOT handles produced by this routine
                                        [Default = 'Wind_tds_dust_']
                   MIDFIX          :  Scalar [string] defining the characters that will
                                        be placed at MIDPOS within all TPLOT handles
                                        produced by this routine
                                        [Default = '']
                   MIDPOS          :  Scalar [numeric] defining the starting character
                                        position in which to place the string defined by
                                        the MIDFIX keyword
                                        [Default = 0]
                   SUFFIX          :  Scalar [string] defining the characters that will
                                        append all TPLOT handles produced by this routine
                                        [Default = '']
                   LOAD_LABELS     :  If set, the labels from labl_ptr_1 in the CDF file
                                        attributes will be copied into the TPLOT DLIMITS
                                        structure
                   *****************
                   ***  OUTPUTS  ***
                   *****************
                   FILES           :  [N]-Element [string] array of file names, with full
                                        directory paths, to the CDF files downloaded and
                                        loaded (or just loaded) into TPLOT
                   TPLOTNAMES      :  [N]-Element [string] array of TPLOT handles loaded

       CHANGED:  1)  Continued to write routine
                                                                       [08/24/2016   v1.0.0]
                 2)  Continued to write routine
                                                                       [08/24/2016   v1.0.0]
                 3)  Continued to write routine
                                                                       [08/25/2016   v1.0.0]
                 4)  Continued to write routine
                                                                       [09/02/2016   v1.0.0]
                 5)  Continued to write routine
                                                                       [09/02/2016   v1.0.0]
                 6)  Continued to write routine
                                                                       [09/02/2016   v1.0.0]
                 7)  Finished writing routine
                                                                       [09/02/2016   v1.0.0]
                 8)  Now calls spd_get_valid_trange.pro and cleaned up a little and
                       moved to SPEDAS directory
                                                                       [09/08/2016   v1.1.0]
                 9)  Updated SPDF URL:  All NASA URLs are now https
                                                                       [02/09/2017   v1.1.1]

       NOTES:
                   1)  If the TRANGE keyword is not set, the routine will prompt the user
                         for a date and then define the time range as one full day

      REFERENCES:
                   1)  Bougeret, J.-L., M.L. Kaiser, P.J. Kellogg, R. Manning, K. Goetz,
                          S.J. Monson, N. Monge, L. Friel, C.A. Meetre, C. Perche,
                          L. Sitruk, and S. Hoang "WAVES:  The Radio and Plasma
                          Wave Investigation on the Wind Spacecraft," Space Sci. Rev.
                          Vol. 71, pp. 231-263, doi:10.1007/BF00751331, (1995).
                   2)  Malaspina, D.M., M. Horanyi, A. Zaslavsky, K. Goetz, L.B. Wilson III,
                          and K. Kersten "Interplanetary and interstellar dust observed by
                          the Wind/WAVES electric field instrument," Geophys. Res. Lett.
                          Vol. 41, pp. 266-272, doi:10.1002/2013GL058786, (2014).
                   3)  Malaspina, D.M., and L.B. Wilson III "A Database of Interplanetary
                          and Interstellar Dust Detected by the Wind Spacecraft,"
                          J. Geophys. Res. Vol. 121, submitted July 19, 2016.

       CREATED:  08/23/2016
       CREATED BY:  Lynn B. Wilson III
        LAST MODIFIED:  02/09/2017   v1.1.1
        MODIFIED BY: Lynn B. Wilson III

     $LastChangedBy: lbwilsoniii_desk $
     $LastChangedDate: 2017-02-09 11:42:45 -0800 (Thu, 09 Feb 2017) $
     $LastChangedRevision: 22754 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/general/missions/wind/waves/wi_tds_dustimpact_load.pro $

    *****************************************************************************************

(See general/missions/wind/waves/wi_tds_dustimpact_load.pro)