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

Last modified: Wed Sep 24 18:17:42 2025.

# Directory Listing of Routines

# projects/dscovr/misc

- DSC_CLEAROPTS
- DSC_DELETEVARS
- DSC_EZNAME
- DSC_GET_YLIMITS
- DSC_GETRNAME
- DSC_IS_PERMUTATION
- DSC_NOWIN
- DSC_REMOVE
  Contract a vector or up to 25 vectors by removing specified elements
- DSC_SET_YTITLE

# Routine Descriptions

## DSC_CLEAROPTS

[Next Routine] [List of Routines]

    NAME: DSC_CLEAROPTS

    DESCRIPTION:
     Clears non-default options from DSCOVR tplot variables.

    INPUTS:
     TN: Names or numbers of TPLOT variables to clear.  Will clear any valid variable, is
           not limited to DSCOVR.  (INT/STRING) Scalar or Array.

    KEYWORDS: (Optional)
     ALL:      Set to clear options from all loaded DSCOVR variables.  Will override any arguments
                 passed in TN
     VERBOSE=: Integer indicating the desired verbosity level.  Defaults to !dsc.verbose

    EXAMPLES:
    		dsc_clearopts,/all
    		dsc_clearopts,[3,5,12]
    		dsc_clearopts,'dsc_h0_mag_B1GSE'

    CREATED BY: Ayris Narock (ADNET/GSFC) 2017

     $LastChangedBy: nikos $
     $LastChangedDate: 2018-03-12 09:55:28 -0700 (Mon, 12 Mar 2018) $
     $LastChangedRevision: 24869 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/projects/dscovr/misc/dsc_clearopts.pro $

(See projects/dscovr/misc/dsc_clearopts.pro)

## DSC_DELETEVARS

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

    NAME: DSC_DELETEVARS

    DESCRIPTION:
     Deletes all DSCOVR data variables from TPLOT

    KEYWORDS: (Optional)
     ALL=: Delete both DSCOVR variables and any time shifted variables
     BASE=:  Delete all variables with the DSCOVR standard prefix (will delete time shifted DSCOVR variables)
     SHIFTVARS=: Delete all time-shifted single and compound variables - Not just DSCOVR vars.
     VERBOSE=: Integer indicating the desired verbosity level.  Defaults to !dsc.verbose

    EXAMPLE:
    		dsc_deletevars

    CREATED BY: Ayris Narock (ADNET/GSFC) 2017

     $LastChangedBy: nikos $
     $LastChangedDate: 2018-03-12 09:55:28 -0700 (Mon, 12 Mar 2018) $
     $LastChangedRevision: 24869 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/projects/dscovr/misc/dsc_deletevars.pro $

(See projects/dscovr/misc/dsc_deletevars.pro)

## DSC_EZNAME

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

    NAME: DSC_EZNAME

    DESCRIPTION:
     Given a DSCOVR shortcut string or string array, returns the full TPLOT variable name(s).
     Using shortcut strings implies GSE coordinate system.

    INPUTS:
     VARIN: Scalar or array of one of the shortcut strings recognized for DSCOVR.
              'bx','by','bz','bgse','b','bphi','btheta',
              'vx','vy','vz','vgse','v','vphi','vtheta','np,','temp','vth',
              'posx','posy','posz','pos'
              Case is ignored.
              Vector values are in GSE.

    KEYWORDS:
     CONF:     Set to return the compound variables containing the +-dy lines
                 if they are available.
                 ie: dsc_ezname('np') --> 'dsc_h1_fc_Np'
                     dsc_ezname('np',/conf) --> 'dsc_h1_fc_Np_wCONF'
                 where 'dsc_h1_fc_Np_wCONF' looks like:
                   17 dsc_h1_fc_Np_wCONF
                     15   dsc_h1_fc_Np+DY
                      3   dsc_h1_fc_Np
                     16   dsc_h1_fc_Np-DY
     HELP:     Set to return an array of the supported shortcut strings
     VERBOSE=: Integer indicating the desired verbosity level.  Defaults to !dsc.verbose

    OUTPUT:
     String or string array containing the full TPLOT varible name(s). Will return '' if passed
     unsupported fields.

    EXAMPLES:
    		fn = dsc_ezname('vx')
    		tn = dsc_ezname(['v','Np','Temp'])
    		tplot,fn

    CREATED BY: Ayris Narock (ADNET/GSFC) 2017

     $LastChangedBy: nikos $
     $LastChangedDate: 2018-03-12 09:55:28 -0700 (Mon, 12 Mar 2018) $
     $LastChangedRevision: 24869 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/projects/dscovr/misc/dsc_ezname.pro $

(See projects/dscovr/misc/dsc_ezname.pro)

## DSC_GETRNAME

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

    NAME: DSC_GETRNAME

    DESCRIPTION
    	Returns the routine name of the calling function.

    CREATED BY: Ayris Narock (ADNET/GSFC) 2017

     $LastChangedBy: nikos $
     $LastChangedDate: 2018-03-12 09:55:28 -0700 (Mon, 12 Mar 2018) $
     $LastChangedRevision: 24869 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/projects/dscovr/misc/dsc_getrname.pro $

(See projects/dscovr/misc/dsc_getrname.pro)

## DSC_GET_YLIMITS

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

    NAME: DSC_GET_YLIMITS

    DESCRIPTION:
     Calculates appropriate ylimits for a string array of TPLOT variables
     to be plotted in the same panel.

    INPUT:
     DATASTR: String array of TPLOT variables
     LIMITS:  Limits structure to be modified (usually the limits
                structure of the TPLOT variable whose data
                field is a string array of TPLOT variables)
     TRG:     Time range over which to calculate the limits (double[2])

    KEYWORDS: (Optional)
     BUFF:          Set to add a 10% buffer to yrange.  Default is exact to data min/max.
     COMP=:         Indicate with vector component to range over.  (int) Ignored for scalar variables.
     INCLUDE_ERROR: Set to include the data.dy in the range calculation
     VERBOSE=:      Integer indicating the desired verbosity level.  Defaults to !dsc.verbose

    OUTPUTS:
     LIMITS.yrange is created or modified.

    EXAMPLES:
    		dsc_get_ylimits,'dsc_h0_mag_B1F1',limstr,trg
    		dsc_get_ylimits,'dsc_h1_fc_V_GSE_x',limstr,trg,/inc,/buff

    		tn = dsc_ezname(['vx','vy','b','temp'])
    		dsc_get_ylimits,tn,limstr,trg,/buff	 ;All variables set to the same yrange

    NOTES:
     Adapted from TPLOT 'get_ylimits' procedure.
       -Added support for limit based on single component of a vector
       -Added /BUFF flag for 10% buffer in y-range
       -Added /INCLUDE_ERROR flag to include any 'dy' in the min/max calculations

    ADAPTED BY: Ayris Narock (ADNET/GSFC) 2017

     $LastChangedBy: nikos $
     $LastChangedDate: 2018-03-12 09:55:28 -0700 (Mon, 12 Mar 2018) $
     $LastChangedRevision: 24869 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/projects/dscovr/misc/dsc_get_ylimits.pro $

(See projects/dscovr/misc/dsc_get_ylimits.pro)

## DSC_IS_PERMUTATION

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

    NAME: DSC_IS_PERMUTATION

    DESCRIPTION:
     Returns !TRUE if ARR2 is a permutation of the elements of ARR1
     ARR1 must be a STR or (INT/LONG), non-empty array with unique values.

    INPUT:
     ARR1,ARR2:  Arrays to compare.  (STR or INT/LONG)

    KEYWORDS: (NONE)

    OUTPUTS:
     Returns BOOLEAN

    EXAMPLE:
     a = [4,2,6,7]
     b = [7,2,6,4]
     c = [3,2,7,2]
     dsc_is_permutation(a,b)
       ==> true
     dsc_is_permutation(a,c)
       ==> false

    CREATED BY: Ayris Narock (ADNET/GSFC) 2018

     $LastChangedBy: nikos $
     $LastChangedDate: 2018-03-12 09:55:28 -0700 (Mon, 12 Mar 2018) $
     $LastChangedRevision: 24869 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/projects/dscovr/misc/dsc_is_permutation.pro $

(See projects/dscovr/misc/dsc_is_permutation.pro)

## DSC_NOWIN

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

    NAME: DSC_NOWIN

    DESCRIPTION:
    	Closes all open direct graphics windows

    KEYWORDS: (Optional)
     VERBOSE=: Integer indicating the desired verbosity level.  Defaults to !dsc.verbose

    CREATED BY: Ayris Narock (ADNET/GSFC) 2017

     $LastChangedBy: nikos $
     $LastChangedDate: 2018-03-12 09:55:28 -0700 (Mon, 12 Mar 2018) $
     $LastChangedRevision: 24869 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/projects/dscovr/misc/dsc_nowin.pro $

(See projects/dscovr/misc/dsc_nowin.pro)

## DSC_REMOVE

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

     NAME:
           DSC_REMOVE
     PURPOSE:
           Contract a vector or up to 25 vectors by removing specified elements
     CALLING SEQUENCE:
           DSC_REMOVE, index, v1,[ v2, v3, v4, v5, v6, ... v25]
     INPUTS:
           INDEX - scalar or vector giving the index number of elements to
                   be removed from vectors.  Duplicate entries in index are
                   ignored.    An error will occur if one attempts to remove
                   all the elements of a vector.     DSC_REMOVE will return quietly
                   (no error message) if index is !NULL or undefined.

     INPUT-OUTPUT:
           v1 - Vector or array.  Elements specifed by INDEX will be
                   removed from v1.  Upon return v1 will contain
                   N fewer elements, where N is the number of distinct values in
                   INDEX.

     OPTIONAL INPUT-OUTPUTS:
           v2,v3,...v25 - additional vectors containing
                   the same number of elements as v1.  These will be
                   contracted in the same manner as v1.

     EXAMPLES:
           (1) If INDEX = [2,4,6,4] and V = [1,3,4,3,2,5,7,3] then after the call

                   IDL> dsc_remove,index,v

           V will contain the values [1,3,3,5,3]

           (2) Suppose one has a wavelength vector W, and three associated flux
           vectors F1, F2, and F3.    Remove all points where a quality vector,
           EPS is negative

                   IDL> bad = where( EPS LT 0, Nbad)
                   IDL> if Nbad GT 0 then remove, bad, w, f1, f2, f3

     METHOD:
           If more than one element is to be removed, then HISTOGRAM is used
           to generate a 'keep' subscripting vector.    To minimize the length of
           the subscripting vector, it is only computed between the minimum and
           maximum values of the index.   Therefore, the slowest case of DSC_REMOVE
           is when both the first and last element are removed.

     REVISION HISTORY:
           Written W. Landsman        ST Systems Co.       April 28, 1988
           Cleaned up code          W. Landsman            September, 1992
           Major rewrite for improved speed   W. Landsman    April 2000
           Accept up to 25 variables, use SCOPE_VARFETCH internally
                  W. Landsman   Feb 2010
           Fix occasional integer overflow problem  V. Geers  Feb 2011
           Quietly return if index is !null or undefined W.L. Aug 2011

     SOURCE: The IDL Astronomy User's Library (2018)
     				https://idlastro.gsfc.nasa.gov/
    					Modified only in procedure name.

     $LastChangedBy: nikos $
     $LastChangedDate: 2018-03-12 09:55:28 -0700 (Mon, 12 Mar 2018) $
     $LastChangedRevision: 24869 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/projects/dscovr/misc/dsc_remove.pro $;

(See projects/dscovr/misc/dsc_remove.pro)

## DSC_SET_YTITLE

[Previous Routine] [List of Routines]

    NAME: DSC_SET_YTITLE

    DESCRIPTION:
     Sets sensible default ytitle for DSCOVR tplot variables

    INPUT:
     TVAR: TPLOT variable - either string or TPLOT variable number

    KEYWORDS: (Optional)
     METADATA=: Metadata structure to mine for sensible title information.
    	             If omitted, use the dlimits structure returned for TVAR
     VERBOSE=:  Integer indicating the desired verbosity level.  Defaults to !dsc.verbose

    OUTPUTS:
     TITLE=: A named variable that will hold the ytitle string that has been set

    EXAMPLE:
    		dsc_set_ytitle,'dsc_h1_fc_V_GSE',title=vtitle

    CREATED BY: Ayris Narock (ADNET/GSFC) 2017

     $LastChangedBy: nikos $
     $LastChangedDate: 2018-03-12 09:55:28 -0700 (Mon, 12 Mar 2018) $
     $LastChangedRevision: 24869 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/projects/dscovr/misc/dsc_set_ytitle.pro $

(See projects/dscovr/misc/dsc_set_ytitle.pro)