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

Last modified: Sat Sep 6 18:17:35 2025.

# Directory Listing of Routines

# general/science/spd_slice2d/plotting

- SPD_SLICE2D_ADD_LINE
- SPD_SLICE2D_GETINFO
- SPD_SLICE2D_GETTICKS
- SPD_SLICE2D_GETTICKS_RLOG
- SPD_SLICE2D_REMOVEZEROS

# Routine Descriptions

## SPD_SLICE2D_ADD_LINE

[Next Routine] [List of Routines]

    Procedure:
      spd_slice2d_add_line

    Purpose:
      Adds one or more contour lines at specified values to a 2D slice plot.
      This can be useful for notating the data in different units than
      those used for the original plot (e.g. adding a contour line
      representing N counts to a phase space density plot).

    Calling Sequence:
      spd_slice2d_add_line, slice, value  [...]

        -accepts valid keywords to IDL CONTOUR procedure

    Example Usage:

      ;add line at one count
        spd_slice2d_plot, slice_psd
        spd_slice2d_add_line, slice_counts, 1

      ;add colored, dotted lines at 1, 5, and 10 counts
        spd_slice2d_plot, slice_psd
        spd_slice2d_add_line, slice_counts, [1,5,10], c_linestype=1, c_colors= [60,170,230]

    Input:
      slice:  slice structure returnd by spd_slice2d
      value:  value to draw contour at (default=1)

      see IDL documentation for CONTOUR procedure keywords

    Output:
      none, draws to current plot window

    Notes:

    $LastChangedBy: aaflores $
    $LastChangedDate: 2016-05-17 18:50:32 -0700 (Tue, 17 May 2016) $
    $LastChangedRevision: 21102 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/general/science/spd_slice2d/plotting/spd_slice2d_add_line.pro $

(See general/science/spd_slice2d/plotting/spd_slice2d_add_line.pro)

## SPD_SLICE2D_GETINFO

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

    Procedure:
      spd_slice2d_getinfo

    Purpose:
      Helper function for spd_slice2d_plot.
      Forms various title annotations based on the slice's metadata.

    Input:
      slice: 2D slice structure from spd_slice2d

    Output:
      title: (string) Title to appear at the top of the plot.
      xtitle: (string) Title for x axis.
      ytitle: (string) Title for y axis.
      ztitle: (string) Title for z axis.

    Notes:

    $LastChangedBy: egrimes $
    $LastChangedDate: 2022-03-08 13:25:16 -0800 (Tue, 08 Mar 2022) $
    $LastChangedRevision: 30661 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/general/science/spd_slice2d/plotting/spd_slice2d_getinfo.pro $

(See general/science/spd_slice2d/plotting/spd_slice2d_getinfo.pro)

## SPD_SLICE2D_GETTICKS

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

    Procedure:
      spd_slice2d_getticks

    Purpose:
      Helper function for spd_slice2d_plot.
      Return an array of formatted annotation strings to be passed
      to an IDL plotting procedure through the [xyz]tickname keyword.

    Input:
      nticks: (int) # of ticks requested by user (optional)
      range: (float) two element array specifying axis range
      log: (bool/int) flag to denote logarithmic axis, this should always
                      be set to avoid persistence of the last axis setting
      precision: (int) number of significant digits for annotation
      style: (int) type of numberical annotation (0=auto, 1=decimal, 2=sci)

    Output:
      tickname: (string) Array of tick names
      tickv: (float) Array of tick values
      ticks: (int) Number of ticks - 1

    Notes:
      - This function should be called after the plot window has been initialized;
        otherwise, the AXIS procedure will create an extra window.
      - If the # of ticks is not specified it will be determined by IDL.
      - Associated tick values are returned via keyword (2013-April)

    $LastChangedBy: aaflores $
    $LastChangedDate: 2015-09-08 18:47:45 -0700 (Tue, 08 Sep 2015) $
    $LastChangedRevision: 18734 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/general/science/spd_slice2d/plotting/spd_slice2d_getticks.pro $

(See general/science/spd_slice2d/plotting/spd_slice2d_getticks.pro)

## SPD_SLICE2D_GETTICKS_RLOG

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

    Procedure:
      spd_slice2d_getticks_rlog

    Purpose:
      Helper function for spd_slice2d_plot.
      Return an array of formatted annotation strings to be passed
      to an IDL plotting procedure through the [xyz]tickname keyword.

    Input:
      range: (float) two element array specifying axis range
      precision: (int) number of significant digits for annotation
      style: (int) type of numberical annotation (0=auto, 1=decimal, 2=sci)
      nticks: (int) # of ticks requested by user, this will only be used
              if the axis range is less than 1 order of magnitude (optional)

    Output:
      tickname: (string) Array of tick names
      tickv: (float) Array of tick values in normalized/shift log space
      ticks: (int) Number of ticks - 1

    Notes:
      - This function should be called after the plot window has been initialized;
        otherwise, the AXIS procedure will create an extra window.
      - If the axis range is less than 1 order in log space then IDL will determine ticks.

    $LastChangedBy: aaflores $
    $LastChangedDate: 2015-09-08 18:47:45 -0700 (Tue, 08 Sep 2015) $
    $LastChangedRevision: 18734 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/general/science/spd_slice2d/plotting/spd_slice2d_getticks_rlog.pro $

(See general/science/spd_slice2d/plotting/spd_slice2d_getticks_rlog.pro)

## SPD_SLICE2D_REMOVEZEROS

[Previous Routine] [List of Routines]

    Procedure:
      spd_slice2d_removezeros

    Purpose:
      Helper routine for spd_slice2d_plot.
      Removes trailing zeros and/or decimal from string.

      This could probably be repurposed into a general routine.

    Input:
      sval: (string) Numerical string to be modified

    Output:
      return value: (string) copy of input string with trailing
                     zeros and/or decimal removed.

    Notes:
      -Assumes trailing spaces have already been removed.

    $LastChangedBy: aaflores $
    $LastChangedDate: 2015-09-08 18:47:45 -0700 (Tue, 08 Sep 2015) $
    $LastChangedRevision: 18734 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/general/science/spd_slice2d/plotting/spd_slice2d_removezeros.pro $

(See general/science/spd_slice2d/plotting/spd_slice2d_removezeros.pro)