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

Last modified: Wed Aug 27 18:18:07 2025.

# Directory Listing of Routines

# spedas_gui/display/draw_object

- SPD_UI_DRAW_OBJECT__ADDAXISLABELS
- SPD_UI_DRAW_OBJECT__ADDAXISTITLE
- SPD_UI_DRAW_OBJECT__ADDBACKGROUND
- SPD_UI_DRAW_OBJECT__ADDDATESTRING
- SPD_UI_DRAW_OBJECT__ADDLEGEND
- SPD_UI_DRAW_OBJECT__ADDMARKER
- SPD_UI_DRAW_OBJECT__ADDVARIABLES
- SPD_UI_DRAW_OBJECT__AGGREGATESPECPLOTS
- SPD_UI_DRAW_OBJECT__COLLATEDATA
- SPD_UI_DRAW_OBJECT__CONVERTCOLOR
- SPD_UI_DRAW_OBJECT__CREATEINSTANCE
- SPD_UI_DRAW_OBJECT__DRAW
- SPD_UI_DRAW_OBJECT__DRAWMARKER
- SPD_UI_DRAW_OBJECT__GETCLICK
- SPD_UI_DRAW_OBJECT__GETDIM
- SPD_UI_DRAW_OBJECT__GETLINEFILL
- SPD_UI_DRAW_OBJECT__GETLINEPLOT
- SPD_UI_DRAW_OBJECT__GETMARKERS
- SPD_UI_DRAW_OBJECT__GETPANELINFO
- SPD_UI_DRAW_OBJECT__GETPANELLAYOUTS
- SPD_UI_DRAW_OBJECT__GETPANELNUMBER
- SPD_UI_DRAW_OBJECT__GETPANELSIZE
- SPD_UI_DRAW_OBJECT__GETPANELTITLESIZE
- SPD_UI_DRAW_OBJECT__GETPLOTSIZE
- SPD_UI_DRAW_OBJECT__GETPROPERTY
- SPD_UI_DRAW_OBJECT__GETRANGE
- SPD_UI_DRAW_OBJECT__GETROWTEXTSIZES
- SPD_UI_DRAW_OBJECT__GETRUBBERBANDPOS
- SPD_UI_DRAW_OBJECT__GETSPECMODEL
- SPD_UI_DRAW_OBJECT__GETSPECREF
- SPD_UI_DRAW_OBJECT__GETTEXTMODEL
- SPD_UI_DRAW_OBJECT__GETTEXTOBJECT
- SPD_UI_DRAW_OBJECT__GETVARIABLESIZE
- SPD_UI_DRAW_OBJECT__GETZOOM
- SPD_UI_DRAW_OBJECT__GETZRANGE
- SPD_UI_DRAW_OBJECT__GOODTICKS
- SPD_UI_DRAW_OBJECT__HBAROFF
- SPD_UI_DRAW_OBJECT__HBARON
- SPD_UI_DRAW_OBJECT__HUEROTATION
- SPD_UI_DRAW_OBJECT__INBOUNDS
- SPD_UI_DRAW_OBJECT__INDEXMAGIC
- SPD_UI_DRAW_OBJECT__LEGENDOFF
- SPD_UI_DRAW_OBJECT__LEGENDON
- SPD_UI_DRAW_OBJECT__LOCKBOTTOM
- SPD_UI_DRAW_OBJECT__LOCKMIDDLE
- SPD_UI_DRAW_OBJECT__LOCKTOP
- SPD_UI_DRAW_OBJECT__LOGFIXTICKS
- SPD_UI_DRAW_OBJECT__MAKELINEREFERENCE
- SPD_UI_DRAW_OBJECT__MAKEMINORTICKS
- SPD_UI_DRAW_OBJECT__MAKESPEC
- SPD_UI_DRAW_OBJECT__MAKEVIEW
- SPD_UI_DRAW_OBJECT__MAKEXYAXISMODEL
- SPD_UI_DRAW_OBJECT__MAKEZAXISMODEL
- SPD_UI_DRAW_OBJECT__MARKEROFF
- SPD_UI_DRAW_OBJECT__MARKERON
- SPD_UI_DRAW_OBJECT__NICENUM
- SPD_UI_DRAW_OBJECT__NICENUMTIME
- SPD_UI_DRAW_OBJECT__NORM2PT
- SPD_UI_DRAW_OBJECT__NUKEDRAW
- SPD_UI_DRAW_OBJECT__PLACEMAJORTICKS
- SPD_UI_DRAW_OBJECT__PT2NORM
- SPD_UI_DRAW_OBJECT__REMOVEINSTANCE
- SPD_UI_DRAW_OBJECT__RUBBERBAND
- SPD_UI_DRAW_OBJECT__RUBBERBANDOFF
- SPD_UI_DRAW_OBJECT__RUBBERBANDON
- SPD_UI_DRAW_OBJECT__SETCLICK
- SPD_UI_DRAW_OBJECT__SETCURSOR
- SPD_UI_DRAW_OBJECT__SETLEGENDHIDE
- SPD_UI_DRAW_OBJECT__SETMODELHIDE
- SPD_UI_DRAW_OBJECT__SETPROPERTY
- SPD_UI_DRAW_OBJECT__SETVARHIDE
- SPD_UI_DRAW_OBJECT__SETZOOM
- SPD_UI_DRAW_OBJECT__UPDATE
- SPD_UI_DRAW_OBJECT__UPDATEHBAR
- SPD_UI_DRAW_OBJECT__UPDATELEGEND
- SPD_UI_DRAW_OBJECT__UPDATEPAGE
- SPD_UI_DRAW_OBJECT__UPDATEPANELS
- SPD_UI_DRAW_OBJECT__UPDATEVBAR
- SPD_UI_DRAW_OBJECT__VBAROFF
- SPD_UI_DRAW_OBJECT__VBARON
- SPD_UI_DRAW_OBJECT__XCLIP
- SPD_UI_DRAW_OBJECT__YCLIP

# Routine Descriptions

## SPD_UI_DRAW_OBJECT__ADDAXISLABELS

[Next Routine] [List of Routines]

    spd_ui_draw_object method: addAxisLabels

    This routine performs some of the tricky logic
    necessary to figure out how to place the axis labels

    model: the output model
    labels: IDL_Container storing labels
    margin: margin between axis & labels
    placeLabel: whether to place label on top/bottom left/right (changed from placeAnnotation to allow axis numbering on different side to labels)
    dir: x/y axis flag (x=0,y=1)
    orientation: horizontal/vertical text flag (h=0,v=1)
    stackLabels: stacklabels or rowlabels flag
    lazyLabels: convert underscores to carriage returns and override stacking
    pt1: multiplicand to change pt into view normalized coords(perp axis)
    pt2: multiplicand to change pt into view normalized coords(par axis)
    labelpos: returns the position of the most distant label from the axis
    blacklabels: indicates that default settings should be over-ridden to make all labels black

    $LastChangedBy: egrimes $
    $LastChangedDate: 2014-06-02 14:46:56 -0700 (Mon, 02 Jun 2014) $
    $LastChangedRevision: 15286 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/spedas_gui/display/draw_object/spd_ui_draw_object__addaxislabels.pro $

(See spedas_gui/display/draw_object/spd_ui_draw_object__addaxislabels.pro)

## SPD_UI_DRAW_OBJECT__ADDAXISTITLE

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

    spd_ui_draw_object method: addAxisTitle

    This routine works out where to add the axis title (x and y axes)

    model: the output model
    titleobj: the spd_ui_text object containing title info
    subtitleobj: subtitle obj
    titlemargin: margin between axis & title
    placeTitle: whether to place title on top/bottom left/right
    dir: x/y axis flag (x=0,y=1)
    titleorientation: horizontal/vertical text flag (h=0,v=1)
    pt1: multiplicand to change pt into view normalized coords(perp axis)
    pt2: multiplicand to change pt into view normalized coords(par axis)
     lazytitles: like lazy labels, determines if underscores should be treated as carriage returns.

    $LastChangedBy: aaflores $
    $LastChangedDate: 2014-05-16 17:51:22 -0700 (Fri, 16 May 2014) $
    $LastChangedRevision: 15160 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/spedas_gui/display/draw_object/spd_ui_draw_object__addaxistitle.pro $

(See spedas_gui/display/draw_object/spd_ui_draw_object__addaxistitle.pro)

## SPD_UI_DRAW_OBJECT__ADDBACKGROUND

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

    spd_ui_draw_object method: addBackground

    Adds the main page background to the target view

    view(object reference): IDLgrView to which the background is being added
    color(3 element byte array):  The color of the background.

    $LastChangedBy: jimm $
    $LastChangedDate: 2014-02-11 10:54:32 -0800 (Tue, 11 Feb 2014) $
    $LastChangedRevision: 14326 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/spedas_gui/display/draw_object/spd_ui_draw_object__addbackground.pro $

(See spedas_gui/display/draw_object/spd_ui_draw_object__addbackground.pro)

## SPD_UI_DRAW_OBJECT__ADDDATESTRING

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

    spd_ui_draw_object method: addDateString

    adds the dateString annotation to the axis

    Inputs:
      view(object reference): The IDLgrView to which the string will be added.
      axisSettings(object reference):  the spd_ui_axis_settings where the associated settings are stored
      range(2-element double): The start and stop range for the panel
      scaling(long):  Indicates the scaling used 0(linear),1(log10),2(logN)
      xplotsize: The length of the x-axis of the panel in normalized coordinates
      yplotsize: The length of the y-axis of the panel in normalized coordinates
      labelMargin:  The distance between the variable labels and the y-axis. This
                    parameter is also used to position the dateString, in lieu of a more specific parameter

    $LastChangedBy: jimm $
    $LastChangedDate: 2014-02-11 10:54:32 -0800 (Tue, 11 Feb 2014) $
    $LastChangedRevision: 14326 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/spedas_gui/display/draw_object/spd_ui_draw_object__adddatestring.pro $

(See spedas_gui/display/draw_object/spd_ui_draw_object__adddatestring.pro)

## SPD_UI_DRAW_OBJECT__ADDLEGEND

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

    spd_ui_draw_object method: addLegend

    This routine adds a legend to a particular view/panel.

    Inputs:
      view(IDLgrView):  The view to which the legend static components are added
      annotation(IDLgrView): The view to which the legend dynamic components are added
      panelInfo(struct):  This is the struct that stores all the information about the panel
      traceInfoArray(array of structs):  This is an array of structs that store all the
                                         info for all the traces in this panel

    NOTE this routine is currently automatically generating labels
    IT SHOULDN'T BE DOING THIS.  When default labels are being
    correctly set, it should just use the label text object from
    the appropriate axis.

    $LastChangedBy: egrimes $
    $LastChangedDate: 2014-06-16 08:02:17 -0700 (Mon, 16 Jun 2014) $
    $LastChangedRevision: 15376 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/spedas_gui/display/draw_object/spd_ui_draw_object__addlegend.pro $

(See spedas_gui/display/draw_object/spd_ui_draw_object__addlegend.pro)

## SPD_UI_DRAW_OBJECT__ADDMARKER

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

    spd_ui_draw_object method: getMarker

    This routine adds a permanent marker to a view
    This is contrasted with a temporary marker, which
    is only drawn as an animation during a cursor event.

    Inputs:
    view(IDLgrView): the view to which the marker should be added
    marker(spd_ui_marker): the spd_ui_marker that is being added
    xrange(2-element double): the xrange of that view, needed to position the marker
    zstack(single double): the height at which the marker should be placed.  Marker stacking is
                             controlled by calling loop, to ensure that they layer correctly.
    Outputs:
    fail(boolean):  This will be set to 1 if a handled error occurs 0 otherwise.
    markerFrames(2-element object array),  2-IDLgrPolyline objects that constitute the border of the marker
    markerPos(2-element double array),  Stores the marker start and end
                                                        location normalized proportional to the panel
    markerColor(3-element byte array),  The color of the marker frame, prior to any hue rotation
    markerSelected(boolean):   Whether this marker is currently selected

    NOTES:
      Permanent marker is contrasted with a temporary marker, which
      is only drawn as an animation during a cursor event.

    $LastChangedBy: jimm $
    $LastChangedDate: 2014-02-11 10:54:32 -0800 (Tue, 11 Feb 2014) $
    $LastChangedRevision: 14326 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/spedas_gui/display/draw_object/spd_ui_draw_object__addmarker.pro $

(See spedas_gui/display/draw_object/spd_ui_draw_object__addmarker.pro)

## SPD_UI_DRAW_OBJECT__ADDVARIABLES

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

    spd_ui_draw_object method: addVariables

    adds spd_ui_variables to requested display

    $LastChangedBy: jimm $
    $LastChangedDate: 2014-02-11 10:54:32 -0800 (Tue, 11 Feb 2014) $
    $LastChangedRevision: 14326 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/spedas_gui/display/draw_object/spd_ui_draw_object__addvariables.pro $

(See spedas_gui/display/draw_object/spd_ui_draw_object__addvariables.pro)

## SPD_UI_DRAW_OBJECT__AGGREGATESPECPLOTS

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

     spd_ui_draw_object method: aggregateSpecplots

    A special kluge function to get around an IDL bug, that causes improper layering in eps
    Generates a composite image from a series of spectral plots to preserve layering when exporting to eps

    Inputs:
      spec_list(Object Ref): an IDL_Container with each spec_plot model
      panel_sz_pt(2 element numerical):  The number of points to be used for the x and y dimensions of the output, respectively
      bg_color(3 element byte array):  The background color for the panel, used to properly simulate transparency

    Outputs:
      aggregated model

    $LastChangedBy: jimm $
    $LastChangedDate: 2014-02-11 10:54:32 -0800 (Tue, 11 Feb 2014) $
    $LastChangedRevision: 14326 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/spedas_gui/display/draw_object/spd_ui_draw_object__aggregatespecplots.pro $

(See spedas_gui/display/draw_object/spd_ui_draw_object__aggregatespecplots.pro)

## SPD_UI_DRAW_OBJECT__COLLATEDATA

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

    spd_ui_draw_object method: collateData

    gets data from loadedData, collects into arrays and performs basic preprocessing.

    INPUT:

      traces(array of objects): spd_ui_line_settings or spd_ui_spectra_settings, with names of data to be requested
      loadedData(spd_ui_loaded_data):  The loaded data object from which data will be taken.
      yscale(long): 0(linear),1(log10),or 2(logN) to indicate the scaling mode used for the y-axis.  This is needed if
                    a dummy y-axis needs to be generated for a spectral plot with no y-data specified.

    OUTPUTS
      outXPtrs(array of pointers):  An array of pointers containing the extracted X traces
      outYPtrs(array of pointers):  An array of pointers containing the extracted Y traces
      outZPtrs(array of pointers):  An array of pointers containing the extracted Z traces(or null pointers if corresponding trace is line)
      mirror(array of pointers): An array of pointers containing pointers to mirror data(or null pointers if traces is not mirroring)
      fail(boolean) : 1 if the operation fails, 0 otherwise
      dataNames(array of strings):  Name of the dependent variable for each trace
      dataidx(array of indexes):  The indices of traces that are valid after processing, -1 if non are.

    $LastChangedBy: jimm $
    $LastChangedDate: 2014-02-11 10:54:32 -0800 (Tue, 11 Feb 2014) $
    $LastChangedRevision: 14326 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/spedas_gui/display/draw_object/spd_ui_draw_object__collatedata.pro $

(See spedas_gui/display/draw_object/spd_ui_draw_object__collatedata.pro)

## SPD_UI_DRAW_OBJECT__CONVERTCOLOR

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

    spd_ui_draw_object method: convertColor

    this routine converts between True color and indexed color
    depending upon which color mode is set by the window
    if keyword: backwards is set, the routine will return a 1x3 array,
    Which may be useful in some applications.

    $LastChangedBy: jimm $
    $LastChangedDate: 2014-02-11 10:54:32 -0800 (Tue, 11 Feb 2014) $
    $LastChangedRevision: 14326 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/spedas_gui/display/draw_object/spd_ui_draw_object__convertcolor.pro $

(See spedas_gui/display/draw_object/spd_ui_draw_object__convertcolor.pro)

## SPD_UI_DRAW_OBJECT__CREATEINSTANCE

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

    spd_ui_draw_object method: createInstance

    This routine creates an instance of the static components
    of any display, it also leaves only the dynamic components
    unhidden after it is complete, so the draw object is ready
    for instance based drawing

    See IDL Help documentation on instances.  The short explanantion
    is that instances are used in object graphics to make draws,
    much much faster.

    $LastChangedBy: jimm $
    $LastChangedDate: 2014-02-11 10:54:32 -0800 (Tue, 11 Feb 2014) $
    $LastChangedRevision: 14326 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/spedas_gui/display/draw_object/spd_ui_draw_object__createinstance.pro $

(See spedas_gui/display/draw_object/spd_ui_draw_object__createinstance.pro)

## SPD_UI_DRAW_OBJECT__DRAW

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

    spd_ui_draw_object method: draw

    This routine actually draws the display, it should be called after
    any update to this function via another call.  It should also be
    called any time that there is damage to the window from opening a
    panel or after an expose_event

    $LastChangedBy: jimm $
    $LastChangedDate: 2014-02-11 10:54:32 -0800 (Tue, 11 Feb 2014) $
    $LastChangedRevision: 14326 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/spedas_gui/display/draw_object/spd_ui_draw_object__draw.pro $

(See spedas_gui/display/draw_object/spd_ui_draw_object__draw.pro)

## SPD_UI_DRAW_OBJECT__DRAWMARKER

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

    spd_ui_draw_object method: drawMarker

    draws marker and updates the range in the marker object. Applies to marker is progress.

    markerRange (2-element double array):  The start and stop position of the marker in panel-normalized coordinates,
                                           (note that start may be larger than stop, if marker was drawn right->left)

    panel (struct): Struct used by draw object to store panel information

    marker(object):  Reference to the marker being drawn

    remove(boolean keyword): Set this keyword to remove the marker

    $LastChangedBy: jimm $
    $LastChangedDate: 2014-02-11 10:54:32 -0800 (Tue, 11 Feb 2014) $
    $LastChangedRevision: 14326 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/spedas_gui/display/draw_object/spd_ui_draw_object__drawmarker.pro $

(See spedas_gui/display/draw_object/spd_ui_draw_object__drawmarker.pro)

## SPD_UI_DRAW_OBJECT__GETCLICK

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

    spd_ui_draw_object method: GetClick

    returns a struct that identifies that panel and the part of the panel under the cursor
    Uses self.cursorLoc to determine current cursor location.
    Output:
      Struct of the form: {panelidx:0L,component:0,marker:-1}
    PanelIdx(long):  An index into the list of panels on the currently drawn display, not the panel ID field
    Components(short):  0=plot,1=xaxis,2=yaxis,3=zaxis,4=variables,5=legend
    Marker: the index of any marker under the cursor, is -1 if none, index is an index into the list of markers currently stored in the IDL_Container on the copy
    Returns 0L if click is nothing(ie page)

    NOTES:
      Resolution of position is only approximate at this point.
      In particular, this could be better and distinguishing z-axis from x/yaxis and variable from x axis

      Things that need to be done to improve approximation, account for text height, take layout issues
      into account.  Resolve variable/z-axis on the same size.

    $LastChangedBy: egrimes $
    $LastChangedDate: 2014-07-31 09:46:47 -0700 (Thu, 31 Jul 2014) $
    $LastChangedRevision: 15631 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/spedas_gui/display/draw_object/spd_ui_draw_object__getclick.pro $

(See spedas_gui/display/draw_object/spd_ui_draw_object__getclick.pro)

## SPD_UI_DRAW_OBJECT__GETDIM

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

    spd_ui_draw_object method: getDim

    gets dimensions in pixels,
    abstracts some unit fuss

    $LastChangedBy: jimm $
    $LastChangedDate: 2014-02-11 10:54:32 -0800 (Tue, 11 Feb 2014) $
    $LastChangedRevision: 14326 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/spedas_gui/display/draw_object/spd_ui_draw_object__getdim.pro $

(See spedas_gui/display/draw_object/spd_ui_draw_object__getdim.pro)

## SPD_UI_DRAW_OBJECT__GETLINEFILL

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

     spd_ui_draw_object method: getLineFill

     This method generates a shaded area between 2 lines and returns an IDLgrModel
     containing the associated ILDgrPolygon objects.  It is called during a panel
     update if the panel has valid spd_ui_linefill_settings objects in its
     lineFillSettings container.

     At this time it only returns a non-empty IDLgrModel if the requested lines
     match in number of data points and location of data gaps.  This is only tested
     to function properly when both data are functional (as in a time series) and
     do not cross (for example: data+error and data-error for a measurment.) Once this is
     extended to generalize between any traces within a panel it could be elevated
     to the panel options widget.

    Inputs:
      traces(2-element array of object reference): The spd_ui_line_settings of the 2 traces bounding the area
      xrange(2-element double array):              The xrange of the panel being draw on
      yrange(2-element double array):              The yrange of the panel being draw on
      dataX(2-element array of ptrs):              The x axis data of the boundary lines for area being shaded
      dataY(ptr to array):                         The y axis data of the boundary lines for area being shaded
      color(3 element bytarr):                     The shading color
      alpha(float):                                Opacity of shaded area.  Between 0(fully transparent) and 1(opaque)

    Returns:
      IDLgrModel containing IDLgrPolygon(s). May have multiple polygon objects in the case of data
      with gaps.

    CREATED BY: Ayris Narock (ADNET/GSFC) 2017

     $LastChangedBy: nikos $
     $LastChangedDate: 2017-11-20 12:50:10 -0800 (Mon, 20 Nov 2017) $
     $LastChangedRevision: 24322 $
     $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/spedas_gui/display/draw_object/spd_ui_draw_object__getlinefill.pro $

(See spedas_gui/display/draw_object/spd_ui_draw_object__getlinefill.pro)

## SPD_UI_DRAW_OBJECT__GETLINEPLOT

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

     spd_ui_draw_object method: getLinePlot

    This function generates the line plot for an update
    There is actually a lot of room to increase draw speed
    by optimizing this function.  In specific we need to find
    a way to downsample a line plot, but the technique must work
    on series that are not functional(ex: circle), must not sort
    the inputs, must be imperceptible, must be fast, and must not
    expect the inputs to be spaced uniformly.  Some possibilities:
    1: uniform decimation
    2: pseudo-random decimation
    3: using pythagorean distance to rewrite non-functional series as functional series
       then interpolate
    4: DFT with frequency cutoff, iDFT, uniform sample?

    Another problem involves determining the correct number of points to
    which the target should be decimated. There is a tradeoff where at one
    end you start to introduce aliasing errors and at the other end you get
    a speed slowdown.

    Currently the system uses the some constant factor times the number of pixels
    across the plot as the target decimation and it only decimates inputs that have
    time as the x-axis(which can be assumed to be functional).  These can be reliably
    decimated using normal interpolation.

    Inputs:
      trace(object reference): the spd_ui_line_settings of the trace being generated
      xrange(2 element double): The xrange of the panel being draw on
      yrange(2 element double): The yrange of the panel being draw on
      plotdim1(2 element double): The normalized position of the panel(start,stop), relative to window for x-axis
      plotdim2(2 element double): The normalized position of the panel(start,stop), relative to window for y-axis
      xscaling(long) : the scaling mode for x-axis 0(linear),1(log10),2(logN)
      yscaling(long) : the scaling mode for y-axis 0(linear),1(log10),2(logN)
      xAxisMajors(double array, variable length):  The positions of the x-axis ticks, normalized relative to panel(need for drawing symbols)
      dx(ptr to array) : the x axis data being plotted
      dy(ptr to array) : the y axis data being plotted
      xistime(boolean):  1 if the x-axis is a time type, 0 other wise
      mirrorptr(ptr to array,optional) the ptr to the mirror data(will deallocate mirrorptr data)
    Outputs:
      linecolor(3 element bytarr):  The color of the line that was drawn
      refVar(ptr to array): the ptr to reference for use in legend
      abcissa_out(ptr to array): ptr to abcissa values associated with reference, this feature is not currently in use, as refVar is gridded to pixel resolution, and pixel indexes are used

    Returns:
      model with completed line plot

    $LastChangedBy: jimm $
    $LastChangedDate: 2014-02-11 10:54:32 -0800 (Tue, 11 Feb 2014) $
    $LastChangedRevision: 14326 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/spedas_gui/display/draw_object/spd_ui_draw_object__getlineplot.pro $

(See spedas_gui/display/draw_object/spd_ui_draw_object__getlineplot.pro)

## SPD_UI_DRAW_OBJECT__GETMARKERS

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

    spd_ui_draw_object method: GetMarkers

    Returns the marker or list of markers that were created
    by the most recent markeron/markeroff call
    if no markers available, returns 0
    Output:
     an array of structs of the form
    {idx:0,marker:obj_new('spd_ui_marker')}
    idx is index of the panel the marker is on, this is the index into the list of panels in the IDL_Container on the window, not the ID field of the panel
    the object is the marker, with correct default settings and range

    $LastChangedBy: jimm $
    $LastChangedDate: 2014-02-11 10:54:32 -0800 (Tue, 11 Feb 2014) $
    $LastChangedRevision: 14326 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/spedas_gui/display/draw_object/spd_ui_draw_object__getmarkers.pro $

(See spedas_gui/display/draw_object/spd_ui_draw_object__getmarkers.pro)

## SPD_UI_DRAW_OBJECT__GETPANELINFO

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

    spd_ui_draw_object method: GetPanelInfo

    Return a bunch of information about a panel with a particular index
    returns 0 on fail

    $LastChangedBy: jimm $
    $LastChangedDate: 2014-02-11 10:54:32 -0800 (Tue, 11 Feb 2014) $
    $LastChangedRevision: 14326 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/spedas_gui/display/draw_object/spd_ui_draw_object__getpanelinfo.pro $

(See spedas_gui/display/draw_object/spd_ui_draw_object__getpanelinfo.pro)

## SPD_UI_DRAW_OBJECT__GETPANELLAYOUTS

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

    spd_ui_draw_object method: getPanelLayouts

    This routine aggregates the layout structures from
    the panel objects into one array.  This makes certain
    layout operations simpler

    INPUTS:
      panels: An array of spd_ui_panels

    OUTPUTS:
      an array of layout structures returned by the spd_ui_panel->getLayoutStructure() method

    $LastChangedBy: jimm $
    $LastChangedDate: 2014-02-11 10:54:32 -0800 (Tue, 11 Feb 2014) $
    $LastChangedRevision: 14326 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/spedas_gui/display/draw_object/spd_ui_draw_object__getpanellayouts.pro $

(See spedas_gui/display/draw_object/spd_ui_draw_object__getpanellayouts.pro)

## SPD_UI_DRAW_OBJECT__GETPANELNUMBER

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

    spd_ui_draw_object method: GetPanelNumber

    Returns the number of panels currently displayed
    If there is any confusion about the output panel indices,
    This indicates the maximum value.  0 indicates no panels

    $LastChangedBy: jimm $
    $LastChangedDate: 2014-02-11 10:54:32 -0800 (Tue, 11 Feb 2014) $
    $LastChangedRevision: 14326 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/spedas_gui/display/draw_object/spd_ui_draw_object__getpanelnumber.pro $

(See spedas_gui/display/draw_object/spd_ui_draw_object__getpanelnumber.pro)

## SPD_UI_DRAW_OBJECT__GETPANELSIZE

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

    spd_ui_draw_object method: GetPanelSize

    Returns an array that shows panel size.
    Inputs:
      xdims(2 element double array):  The start and stop position of the panel x-axis, coordinates normalized to the draw area
      ydims(2 element double array):  The start and stop position of the panel y-axis, coordinates normalized to the draw area
    Outputs:
      array format = [xpos,ypos,width,height]

    $LastChangedBy: jimm $
    $LastChangedDate: 2014-02-11 10:54:32 -0800 (Tue, 11 Feb 2014) $
    $LastChangedRevision: 14326 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/spedas_gui/display/draw_object/spd_ui_draw_object__getpanelsize.pro $

(See spedas_gui/display/draw_object/spd_ui_draw_object__getpanelsize.pro)

## SPD_UI_DRAW_OBJECT__GETPANELTITLESIZE

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

    Method:
      getPanelTitleSize

    Purpose:
      Retreives the vertical size (in points) of the largest panel
      title from an array of panel objects.

    Input:
      panels: Array of panel object references

    Output:
      return value: Largest vertical size (pts)

    Notes:
      see also: __getVariableSize
                __getRowTextSizes

    $LastChangedBy: aaflores $
    $LastChangedDate: 2014-06-11 15:56:35 -0700 (Wed, 11 Jun 2014) $
    $LastChangedRevision: 15353 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/spedas_gui/display/draw_object/spd_ui_draw_object__getpaneltitlesize.pro $

(See spedas_gui/display/draw_object/spd_ui_draw_object__getpaneltitlesize.pro)

## SPD_UI_DRAW_OBJECT__GETPLOTSIZE

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

    spd_ui_draw_object method: getPlotSize

    calculates the panel size for the purpose of spectral plot generation
    Inputs:
      plotdim1(2-element double): The position of the panel/plot in x-direction [xstart,xstop]
      plotdim2(2-element double): The position of the panel/plot in the y-direction [ystart,ystop]

    Returns:
      2-element double
      xpanel_sz in points(multiple of pixels scaled to dims *not* desktop publishing points)
      ypanel_sz in points(multiple of pixels scaled to dims *not* desktop publishing points)

    $LastChangedBy: jimm $
    $LastChangedDate: 2014-02-11 10:54:32 -0800 (Tue, 11 Feb 2014) $
    $LastChangedRevision: 14326 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/spedas_gui/display/draw_object/spd_ui_draw_object__getplotsize.pro $

(See spedas_gui/display/draw_object/spd_ui_draw_object__getplotsize.pro)

## SPD_UI_DRAW_OBJECT__GETPROPERTY

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

    spd_ui_draw_object method: getProperty

    Query various draw object settings

    $LastChangedBy: jimm $
    $LastChangedDate: 2014-02-11 10:54:32 -0800 (Tue, 11 Feb 2014) $
    $LastChangedRevision: 14326 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/spedas_gui/display/draw_object/spd_ui_draw_object__getproperty.pro $

(See spedas_gui/display/draw_object/spd_ui_draw_object__getproperty.pro)

## SPD_UI_DRAW_OBJECT__GETRANGE

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

    spd_ui_draw_object method: getRange

    Calculates the range of a sequence. Based upon axis settings and the set of traces in the panel.
    This calculation is symmetric across the x/y axes.
    Inputs:

      dataPtrs(array of ptrs to arrays):  List of pointer to data quantities for which range is calculated
      axisSettings(object reference):  The spd_ui_axis_settings object for this panel.
      mirror(array of ptrs to arrays, optional):  List of pointers to mirror data quantities.
                                     Should have same number of elements as dataPtrs, and really only makes sense when used with the y-axis
      isspec: needed to catch a particular special case for spectrograms

    Outputs:

      range(2 element double):  The determined range
      scaling(long):  The scaling mode: 0(linear),1(log10),2logn
      istime(boolean): Returns the isTime flag from the axis being queried
      fail(boolean):  1 on fail, 0 on success
      errmsg: a struct describing an error that has occurred. Note that this only exists for some particular errors
      where it is necessary to pass the error information up to the calling routine. fail=1 does not guarantee the
      existance of errmsg and vice versa.

    $LastChangedBy: jimm $
    $LastChangedDate: 2014-02-11 10:54:32 -0800 (Tue, 11 Feb 2014) $
    $LastChangedRevision: 14326 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/spedas_gui/display/draw_object/spd_ui_draw_object__getrange.pro $

(See spedas_gui/display/draw_object/spd_ui_draw_object__getrange.pro)

## SPD_UI_DRAW_OBJECT__GETROWTEXTSIZES

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

    spd_ui_draw_object method: getVariablesRowSizes

    Purpose:
      generates an array that indicates the space variables will occupy for
        each row in the layout, sizes are in pts

      INPUTS:
        an array of spd_ui_panels

      OUTPUTS:
        an array of sizes in pts

    $LastChangedBy: aaflores $
    $LastChangedDate: 2014-06-11 15:56:35 -0700 (Wed, 11 Jun 2014) $
    $LastChangedRevision: 15353 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/spedas_gui/display/draw_object/spd_ui_draw_object__getrowtextsizes.pro $

(See spedas_gui/display/draw_object/spd_ui_draw_object__getrowtextsizes.pro)

## SPD_UI_DRAW_OBJECT__GETRUBBERBANDPOS

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

    spd_ui_draw_object method: GetRubberBandPos

    Returns an array of structs that indicate the panels overlapped by the rubber band
    Input:
      xonly:
        If set, constrain along the x-axis only.

    Output:
       structs have the form {idx:0,xrange:[0,1],yrange[0,1],vars:ptr_new()}
       idx is the panel index in the current display, this is an index into the list of panels displayed, not the ID field from the spd_ui_panel object
       xrange is the xrange of the panel in non-logarithmic(normal) space
       yrange is the yrange of the panel in non-logarithmic(normal) space
       vars is either a null pointer or an array of structs of the form:
           {range:[0,1]} which stores the range of each variable on the panel
       returns 0 on fail

    Notes: No inputs, uses the information in self.panelInfo, self.rubberStart, self.cursorLoc(considered rubber band stop position
    $LastChangedBy: jimm $
    $LastChangedDate: 2014-02-11 10:54:32 -0800 (Tue, 11 Feb 2014) $
    $LastChangedRevision: 14326 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/spedas_gui/display/draw_object/spd_ui_draw_object__getrubberbandpos.pro $

(See spedas_gui/display/draw_object/spd_ui_draw_object__getrubberbandpos.pro)

## SPD_UI_DRAW_OBJECT__GETSPECMODEL

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

    spd_ui_draw_object method: getSpecModel

    Purpose:  This procedure finishes the creation of a spectral image.
              It uses the newly calculated range and the information in plotdata

    Inputs:
      plotData(struct):  The plotData struct that was returned from getSpecRef, contains plotting information, like scaling, data position and clipping
      zrange(2 element double):  The z range of the panel, after recalculating for closer autorange fit, if necessary.
      palette(long): The number of the palette that will be used to draw this spectral plot
    Outputs:
      model(IDLgrModel):  The model that the result is stored in.

    $LastChangedBy: jimm $
    $LastChangedDate: 2014-02-11 10:54:32 -0800 (Tue, 11 Feb 2014) $
    $LastChangedRevision: 14326 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/spedas_gui/display/draw_object/spd_ui_draw_object__getspecmodel.pro $

(See spedas_gui/display/draw_object/spd_ui_draw_object__getspecmodel.pro)

## SPD_UI_DRAW_OBJECT__GETSPECREF

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

    spd_ui_draw_object method: getSpecRef

    Generates a gridded and fully clipped spectragram during the update function.
    The output from this is used to generate the model for display and used directly
    as a reference for the legend

    Inputs:
      xrange(2 element double):  The range([min,max]) of the panel on the x-axis.
      yrange(2 element double):  The range([min,max]) of the panel on the y-axis.
      xpanel_sz_pt(long):  The size of the panel in the x-direction.  Units are a multiple/fraction of screen pixels.
      ypanel_sz_pt(long):  The size of the panel in the y-direction.  Units are a multiple/fraction of screen pixels.
      xscale(long):  x axis scaling mode. 0(linear),1(log10),2(logN)
      yscale(long):  y axis scaling mode. 0(linear),1(log10),2(logN)
      zscale(long):  z axis scaling mode. 0(linear),1(log10),2(logN)
      dx(ptr to array): x data for this spectral plot
      dy(ptr to array): y data for this spectral plot
      dz(ptr to array): z data for this spectral plot
    Outputs:
      refVar(double array):  Array containing final clipped, gridded data
      plotData(struct) : structure containing information about range,position,scaling, and clipping of resulting quantity, for use with getSpecModel

    NOTES:
      1. xrange,yrange may be different from the range of the data because not all spectragrams span the entire panel, and some span more than the entire panel.
      2. xpanel_sz_pt,ypanel_sz_pt will be increased due to aliasing correction factor, but decreased because panel spans only a portion of the screen
      3. May-2013: makeSpec now produces a spectrogram corresponding to the panel itself instead
                   of the input data; this code has been modified to accomodate that change.

    $LastChangedBy: jimm $
    $LastChangedDate: 2014-02-11 10:54:32 -0800 (Tue, 11 Feb 2014) $
    $LastChangedRevision: 14326 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/spedas_gui/display/draw_object/spd_ui_draw_object__getspecref.pro $

(See spedas_gui/display/draw_object/spd_ui_draw_object__getspecref.pro)

## SPD_UI_DRAW_OBJECT__GETTEXTMODEL

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

    spd_ui_draw_object method: getTextModel

    returns a text model by digesting the settings on a spd_ui_text object.
    This is basically just a wrapper for getTextObject
    text: a spd_ui_text object
    loc: the normalized location of the text, relative to the view [xpos,ypos,zpos]
    offsetDirFlag: 0=centered,1=abovelocation,-1=belowlocation
    justify, -1 = left, 1=right, 0 = middle

    Output:
      an IDLgrModel containing an IDLgrText object

    $LastChangedBy: jimm $
    $LastChangedDate: 2014-02-11 10:54:32 -0800 (Tue, 11 Feb 2014) $
    $LastChangedRevision: 14326 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/spedas_gui/display/draw_object/spd_ui_draw_object__gettextmodel.pro $

(See spedas_gui/display/draw_object/spd_ui_draw_object__gettextmodel.pro)

## SPD_UI_DRAW_OBJECT__GETTEXTOBJECT

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

    spd_ui_draw_object method: getTextObject

    returns a text object by digesting the settings on a spd_ui_text object
    text: a spd_ui_text object
    loc: the normalized location of the text, relative to the view [xpos,ypos,zpos]
    offsetDirFlag: 0=centered,1=abovelocation,-1=belowlocation
    justify, -1 = left, 1=right, 0 = middle

    $LastChangedBy: nikos $
    $LastChangedDate: 2014-07-24 11:24:17 -0700 (Thu, 24 Jul 2014) $
    $LastChangedRevision: 15597 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/spedas_gui/display/draw_object/spd_ui_draw_object__gettextobject.pro $

(See spedas_gui/display/draw_object/spd_ui_draw_object__gettextobject.pro)

## SPD_UI_DRAW_OBJECT__GETVARIABLESIZE

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

    spd_ui_draw_object method: getVariablesSize

    Calculates the maximum space that will be occupied, by any panel's x-axes
    Name is because it used to only account for variables
    Inputs:
      panels(array of objects): List of spd_ui_panels

    NOTES:
      consider returning an array of panel sizes and performing the max after the fact

    $LastChangedBy: jimm $
    $LastChangedDate: 2014-02-11 10:54:32 -0800 (Tue, 11 Feb 2014) $
    $LastChangedRevision: 14326 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/spedas_gui/display/draw_object/spd_ui_draw_object__getvariablesize.pro $

(See spedas_gui/display/draw_object/spd_ui_draw_object__getvariablesize.pro)

## SPD_UI_DRAW_OBJECT__GETZOOM

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

    spd_ui_draw_object method: getZoom

    This routine returns the current zoom of the destination object
     Used primarily for determining scaling values to be applied to
     text when drawn.  IDL doesn't properly correct for zoom, unless
     an object is already rendered.  If you initially draw while at
     non 1. zoom text will be mis-sized unless scaled by zoom factor.

     Doesn't really apply to non-IDLgrWindow, because they don't
     have associated zoom factors.

    $LastChangedBy: jimm $
    $LastChangedDate: 2014-02-11 10:54:32 -0800 (Tue, 11 Feb 2014) $
    $LastChangedRevision: 14326 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/spedas_gui/display/draw_object/spd_ui_draw_object__getzoom.pro $

(See spedas_gui/display/draw_object/spd_ui_draw_object__getzoom.pro)

## SPD_UI_DRAW_OBJECT__GETZRANGE

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

    spd_ui_draw_object method: getZRange

    Calculates the zrange of a spectral plot based upon the set of spectral traces in the panel
    and the z-axis settings

    Inputs:
      dataPtrs(array of ptrs to arrays):  Array of ptrs to the z-axis data for this panel.
      zaxisSettings:  spd_ui_zaxis_settings object for this panel.

    Output:
      range(2 element double):  The determined range
      scaling(long):  The scaling mode: 0(linear),1(log10),2logn
      fail(boolean):  1 on fail, 0 on success
      fixed(boolean):  1 if fixed range is used, 0 if autorange is used

    Keywords:
      forceauto:
        Forces an auto calculation to identify the full range of the data

    $LastChangedBy: jimm $
    $LastChangedDate: 2014-02-11 10:54:32 -0800 (Tue, 11 Feb 2014) $
    $LastChangedRevision: 14326 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/spedas_gui/display/draw_object/spd_ui_draw_object__getzrange.pro $

(See spedas_gui/display/draw_object/spd_ui_draw_object__getzrange.pro)

## SPD_UI_DRAW_OBJECT__GOODTICKS

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

    spd_ui_draw_object method: goodTicks

    This routine actually does the bulk of the work
    to select good ticks.

    NOTE:  Now that we've switched over to a set of user input parameters that maps
      pretty nearly to the set of options that IDL provides, we might want to do
      tick placement by lookup with IDL plotting routines and /nodraw.
      We just need to be VERY careful about interaction/interference with command line utilities

    $LastChangedBy: pcruce $
    $LastChangedDate: 2014-06-25 17:47:00 -0700 (Wed, 25 Jun 2014) $
    $LastChangedRevision: 15444 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/spedas_gui/display/draw_object/spd_ui_draw_object__goodticks.pro $

(See spedas_gui/display/draw_object/spd_ui_draw_object__goodticks.pro)

## SPD_UI_DRAW_OBJECT__HBAROFF

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

    spd_ui_draw_object method: hBarOff

    stop drawing the horizontal bar

    $LastChangedBy: jimm $
    $LastChangedDate: 2014-02-11 10:54:32 -0800 (Tue, 11 Feb 2014) $
    $LastChangedRevision: 14326 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/spedas_gui/display/draw_object/spd_ui_draw_object__hbaroff.pro $

(See spedas_gui/display/draw_object/spd_ui_draw_object__hbaroff.pro)

## SPD_UI_DRAW_OBJECT__HBARON

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

    spd_ui_draw_object method: hBarOn

    start drawing the horizontal bar
      all(boolean keyword):  Set to turn on for all panels.
                             Default is for single panel mode

    $LastChangedBy: jimm $
    $LastChangedDate: 2014-02-11 10:54:32 -0800 (Tue, 11 Feb 2014) $
    $LastChangedRevision: 14326 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/spedas_gui/display/draw_object/spd_ui_draw_object__hbaron.pro $

(See spedas_gui/display/draw_object/spd_ui_draw_object__hbaron.pro)

## SPD_UI_DRAW_OBJECT__HUEROTATION

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

    spd_ui_draw_object method: hueRotation

    This rotates the hue of of the input color by 120 degrees
    The output is the rotated color

    $LastChangedBy: jimm $
    $LastChangedDate: 2014-02-11 10:54:32 -0800 (Tue, 11 Feb 2014) $
    $LastChangedRevision: 14326 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/spedas_gui/display/draw_object/spd_ui_draw_object__huerotation.pro $

(See spedas_gui/display/draw_object/spd_ui_draw_object__huerotation.pro)

## SPD_UI_DRAW_OBJECT__INBOUNDS

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

    spd_ui_draw_object method: inBounds

    returns true if the current cursor location is within the bounds of the panel past as an argument
    panelInfo(struct):  struct that stores information for the draw object about the panel in question
    location(keyword, 2-element double):  Overrides the default location stored in self.cursorLoc with the value in the keyword
                                          Default behavior uses self.cursorloc

    $LastChangedBy: jimm $
    $LastChangedDate: 2014-02-11 10:54:32 -0800 (Tue, 11 Feb 2014) $
    $LastChangedRevision: 14326 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/spedas_gui/display/draw_object/spd_ui_draw_object__inbounds.pro $

(See spedas_gui/display/draw_object/spd_ui_draw_object__inbounds.pro)

## SPD_UI_DRAW_OBJECT__INDEXMAGIC

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

    spd_ui_draw_object method: indexMagic

    This function returns indices of all the data values greater(or less)
    than the index limit + 1(or -1).  It is vectorized, so
    that it will work quickly even if there is a lot of data.

    Inputs:
      Data(2-dimensional array of data points any numeric type):
         The values that will be modified dims = MxN
      Idx(array of indices): an M element array of indices
         that specify the limit.  All indices greater(or less) than
         this index + 1 in a particular column will be returned
      Less(boolean keyword):  If set, indicates that indices less than
                        index - 1 should be returned

    Outputs:
      All the indices that fit the limit critereon, -1 if no values found.

    NOTES:
     1.  This is used in y-clipping spectrograms.  We want there to be a small amount
      of margin on spectrograms to prevent any blank from showing up at the edge
      of plots, but we don't want to render the whole data set because performance
      would suffer a precipitous drop.

    2. Each element of data[i,*] should be sorted in descending order.

    3. This is quite tricky to do without looping, hence the magic.

    $LastChangedBy: jimm $
    $LastChangedDate: 2014-02-11 10:54:32 -0800 (Tue, 11 Feb 2014) $
    $LastChangedRevision: 14326 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/spedas_gui/display/draw_object/spd_ui_draw_object__indexmagic.pro $

(See spedas_gui/display/draw_object/spd_ui_draw_object__indexmagic.pro)

## SPD_UI_DRAW_OBJECT__LEGENDOFF

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

    spd_ui_draw_object method: legendOff

    Stop drawing the legend

    $LastChangedBy: jimm $
    $LastChangedDate: 2014-02-11 10:54:32 -0800 (Tue, 11 Feb 2014) $
    $LastChangedRevision: 14326 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/spedas_gui/display/draw_object/spd_ui_draw_object__legendoff.pro $

(See spedas_gui/display/draw_object/spd_ui_draw_object__legendoff.pro)

## SPD_UI_DRAW_OBJECT__LEGENDON

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

    spd_ui_draw_object method: legendOn

    Start drawing a legend on one or more panels
      all(boolean keyword):  Set to turn on for all panels.
                             Default is for single panel mode

    $LastChangedBy: jimm $
    $LastChangedDate: 2014-02-11 10:54:32 -0800 (Tue, 11 Feb 2014) $
    $LastChangedRevision: 14326 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/spedas_gui/display/draw_object/spd_ui_draw_object__legendon.pro $

(See spedas_gui/display/draw_object/spd_ui_draw_object__legendon.pro)

## SPD_UI_DRAW_OBJECT__LOCKBOTTOM

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

    spd_ui_draw_object method: lockBottom

    This routine sets the locked settings for a bottom panel in a column of a layout.
    Inputs:
      panel(object): Reference to a spd_ui_panel that will be modified.
                     This will generally be a copy to prevent mutation of
                     central gui copy.

    $LastChangedBy: aaflores $
    $LastChangedDate: 2014-06-11 15:56:35 -0700 (Wed, 11 Jun 2014) $
    $LastChangedRevision: 15353 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/spedas_gui/display/draw_object/spd_ui_draw_object__lockbottom.pro $

(See spedas_gui/display/draw_object/spd_ui_draw_object__lockbottom.pro)

## SPD_UI_DRAW_OBJECT__LOCKMIDDLE

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

    spd_ui_draw_object method: lockMiddle

    This routine sets the locked settings for a middle panel in a column of a layout.
    Inputs:
      panel(object): Reference to a spd_ui_panel that will be modified.
                     This will generally be a copy to prevent mutation of
                     central gui copy.

    $LastChangedBy: aaflores $
    $LastChangedDate: 2014-06-11 15:56:35 -0700 (Wed, 11 Jun 2014) $
    $LastChangedRevision: 15353 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/spedas_gui/display/draw_object/spd_ui_draw_object__lockmiddle.pro $

(See spedas_gui/display/draw_object/spd_ui_draw_object__lockmiddle.pro)

## SPD_UI_DRAW_OBJECT__LOCKTOP

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

    spd_ui_draw_object method: lockTop

    This routine sets the locked settings for a top panel in a column of a layout.
    Inputs:
      panel(object): Reference to a spd_ui_panel that will be modified.
                     This will generally be a copy to prevent mutation of
                     central gui copy.

    $LastChangedBy: jimm $
    $LastChangedDate: 2014-02-11 10:54:32 -0800 (Tue, 11 Feb 2014) $
    $LastChangedRevision: 14326 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/spedas_gui/display/draw_object/spd_ui_draw_object__locktop.pro $

(See spedas_gui/display/draw_object/spd_ui_draw_object__locktop.pro)

## SPD_UI_DRAW_OBJECT__LOGFIXTICKS

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

    spd_ui_draw_object method: logFixTicks

    It is sometimes the case that logarithmic axes end up with 1 or 0 ticks
    when more were requested.  This routine attempts to fix this problem

    It does this by using a little trick of the change of base formula.
    Essentially, if ticks are evenly spaced in base-2 log, then they will
    be evenly spaced in another base.

    So if the goodTick algorithm couldn't find ticks at 1x10^1,1x10^2,...
    This algorithm may find ticks at,  5,10,20,40

    $LastChangedBy: jimm $
    $LastChangedDate: 2014-02-11 10:54:32 -0800 (Tue, 11 Feb 2014) $
    $LastChangedRevision: 14326 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/spedas_gui/display/draw_object/spd_ui_draw_object__logfixticks.pro $

(See spedas_gui/display/draw_object/spd_ui_draw_object__logfixticks.pro)

## SPD_UI_DRAW_OBJECT__MAKELINEREFERENCE

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

    spd_ui_draw_object method: makeLineReference

    this routine constructs a reference for legend lookup that has
    no more than the number of points on the screen times some number
    to account for pixel-level aliasing.  Operation vectorized with
    value-locate
    x = clipped abcissa values, normalized to fractions of the total
    y = clipped data values, with the same number of elements as x
    n = the number of points requested in the output
    ref = data returned in named variable
    tolerance = the distance that a cursor can be from a real data point, before NaNs
                  get filled in.  This is a number proportional to the x range.(ex: .01 = 1% tolerance)

    $LastChangedBy: jimm $
    $LastChangedDate: 2014-02-11 10:54:32 -0800 (Tue, 11 Feb 2014) $
    $LastChangedRevision: 14326 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/spedas_gui/display/draw_object/spd_ui_draw_object__makelinereference.pro $

(See spedas_gui/display/draw_object/spd_ui_draw_object__makelinereference.pro)

## SPD_UI_DRAW_OBJECT__MAKEMINORTICKS

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

    spd_ui_draw_object method: makeMinorTicks

    This routine takes generates the minor ticks for the z-axis and the xy axes.
    It does most of the work to guarantee proper spacing of minor ticks on logarithmic axes
    Inputs:
      Range:  The range of the data values.(log applied, not real)
      Scaling: The scaling factor used on this axis. (O: Linear, 1: Log10, 2:LogN)
      MinorNum: The requested number of minor ticks per major tick
      MajorValues: An array of major tick positions, normalized relative to their respective axis.  Minimum 2 major ticks.
      MajorSpacing:  The spacing between major ticks, in normalized units.
      MinorAuto: Whether automatic minor ticks are being used or not.

    Outputs:
      MinorValues: An array of minor tick positions.  Not for a single major tick, but for the entire axis.
      Fail: 0 indicates no fail, 1 indicates fail.  If no ticks can fit on axis, failure is indicated.

    NOTES:
      Minor ticks will appear to be more evenly spaced the smaller the interval is between ticks on a logarithmic axis.
      On a non-log axis, they will always be evenly spaced.

    $LastChangedBy: jimm $
    $LastChangedDate: 2014-02-11 10:54:32 -0800 (Tue, 11 Feb 2014) $
    $LastChangedRevision: 14326 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/spedas_gui/display/draw_object/spd_ui_draw_object__makeminorticks.pro $

(See spedas_gui/display/draw_object/spd_ui_draw_object__makeminorticks.pro)

## SPD_UI_DRAW_OBJECT__MAKESPEC

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

     spd_ui_draw_object method: makeSpec

    Purpose:
      helper routine for draw object.  It helps construct the image for spectrograms
      very quickly.

    Inputs:
      x: the 1-d x scaling values for the z components(x-axis)
      y: the 1-d y scaling values for the z components
      z: the 2-d z array of values for the image
      pixx: the desired resolution of the output on the x-axis
      pixy: the desired resolution of the output on the y-axis
      xrange: x range of the desired output in data space
      yrange: y range of the desired output in data space

    Output:
       refz: The gridded z-axis array
       refx: The x-values associated with the z-values
       refy: The y-values associated with the z-values

       Notes:
       1. This uses an alpha channel to make all NaNs transparent.
       2. PixX and PixY are not totally necessary because object graphics can
          stretch an image quite well, but selecting the resolution of the screen
          with them prevents any inadvertent errors from showing up during interpolation.
          It might actually be better to render the image at twice the screen resolution
          to prevent aliasing errors.
       3. May-2013: Code modified to create a spectrogram over the panel's range
                    (xrange/yrange) rather than over the data's range. The pixx/pixy
                    variables should now contain the number of pixels across the
                    panel instead of those required to represent the entire dataset.

    $LastChangedBy: jimm $
    $LastChangedDate: 2014-02-11 10:54:32 -0800 (Tue, 11 Feb 2014) $
    $LastChangedRevision: 14326 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/spedas_gui/display/draw_object/spd_ui_draw_object__makespec.pro $

(See spedas_gui/display/draw_object/spd_ui_draw_object__makespec.pro)

## SPD_UI_DRAW_OBJECT__MAKEVIEW

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

    spd_ui_draw_object method: makeView

    creates the views for a panel,
    incorporates all the layout information
    that can effect this.

    Inputs:
      dims(2 element long) : The number of rows and columns in the overall layout
      margins(6 element double):  [leftMargin,rightMargin,topMargin,bottomMargin,horizontalMargin,verticalMargin] in draw-area normalized coordinates
      pos(4 element long):  [row,col,rowSpan,colSpan] of the panel being drawn.
      pcoord(4 element double): User defined explicit panel position, in draw-area normalized coords: [xpos,ypos,xsize,ysize], if unused, will be -1
      markernum(long): The number of markers in the panel.  Each marker is in a different view, so a number of markerviews equal to markernum will be returned
      bottomsizes(double array): Array of verical text sizes to be allocated at the bottom of each panel
      topsizes(double array): Array of verical text sizes to be allocated at the top of each panel
    Outputs:
      view(object reference):  The static panel IDLgrView
      annotation(object reference):  The panel IDLgrView for dynamic display elements(ie annotations etc.. that are being updated)
      markers(array of object references):  Array of IDLgrViews for each marker.  Each marker ends up needing to be put in separate views,
                                          to guarantee proper layering.
      xplotpos(2 element double):  The determined x-position of panel in draw-area normalized coordinates [xstart,xstop]
      yplotpos(2 element double):  The determined y-position of panel in draw-area normalized coordinates [ystart,ystop]
      fail(boolean):  Will be 1 if operation fails, 0 otherwise
      outmargins(5 element double) :  Indicates the size of the various panel regions in draw-normalized coordinates, so that cursor clicks can be properly resolved. [left,right,top,bottom,var]
      errmsg(anonymous struct): Returns information about an error that has occured. This is not implemented uniformly, but used in particular
        cases where it is helpful to return error information up to the calling routine so, for example, popup messages can be issued to user.
        It is intended that developers make use of it to return other errors (or informational messages) when they find it necessary.
        Note: if no such error occurs errmsg is simply not set.
        errmsg being set does not guarantee fail=1 and likewise fail=1 is not an indication that errmsg is set.
        See also notes in spd_ui_draw_object__update

    $LastChangedBy: aaflores $
    $LastChangedDate: 2014-06-11 15:56:35 -0700 (Wed, 11 Jun 2014) $
    $LastChangedRevision: 15353 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/spedas_gui/display/draw_object/spd_ui_draw_object__makeview.pro $

(See spedas_gui/display/draw_object/spd_ui_draw_object__makeview.pro)

## SPD_UI_DRAW_OBJECT__MAKEXYAXISMODEL

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

    spd_ui_draw_object method: makeXYAxisModel

    Constructs an X or Y axis model from a spd_ui_axis_settings object
    Inputs:
    dir = direction of the axis(0=x,1=y)
    xrange,yrange: data range of the panel
    scaling: scaling mode of the panel 0(linear),1(log10),2(logN)
    axisSettings: axis settings object
    plotDim1: normalized length of the plot on the dimension perpendicual to the axis
    plotDim2: normalized length of the plot on the dimension parallel to the axis
    color: The color of the plot frame in RGB
    thick: The thickness of the plot frame/ticks
    useIsTime: use this keyword to override the current isTime value
    Outputs
    gridmodel: the model containing any axis grids
    model: the axis model is returned in this keyword
    majorTickValues:the major tickvalues are returned in this keyword
    numMinorTicks: the number of minor ticks is returned in this keyword
    isTimeAxis: flag indicating whether the axis is time annotated or not returned in this keyword
    labelPos: this keyword returns the most distant label position from the axis
    fail: 1 indicates failure, 0 success

    $LastChangedBy: pcruce $
    $LastChangedDate: 2014-06-25 17:47:00 -0700 (Wed, 25 Jun 2014) $
    $LastChangedRevision: 15444 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/spedas_gui/display/draw_object/spd_ui_draw_object__makexyaxismodel.pro $

(See spedas_gui/display/draw_object/spd_ui_draw_object__makexyaxismodel.pro)

## SPD_UI_DRAW_OBJECT__MAKEZAXISMODEL

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

    spd_ui_draw_object method: makeZAxisModel

    constructs a zaxis model for display, from a spd_ui_zaxis_settings object

    Inputs:
      zrange(2 element double):  The min & max range of the axis in logged space.
      zAxis(object reference):  The spd_ui_zaxis_settings object from which settings will be drawn.
      xPlotPos(2 element double):  The x-start & stop position of the panel in draw area normal coordinates
      yPlotPos(2 element double):  The y-start & stop position of the panel in draw area normal coordinates
      frameColor(3 element bytarr):  The rgb color of the panel frame.
      frameThick(double):  the thickness of the panel frame, in idl standard line thickness units

    Outputs:
      model(object reference):  The completed IDLgrModel
      palette(object reference): The palette object used for this axis.
      majorNum(long):  The number of major ticks on this axis.
      minorNum(long):  The number of minor ticks per major tick on this axis

    $LastChangedBy: aaflores $
    $LastChangedDate: 2014-06-27 11:32:10 -0700 (Fri, 27 Jun 2014) $
    $LastChangedRevision: 15454 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/spedas_gui/display/draw_object/spd_ui_draw_object__makezaxismodel.pro $

(See spedas_gui/display/draw_object/spd_ui_draw_object__makezaxismodel.pro)

## SPD_UI_DRAW_OBJECT__MARKEROFF

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

    spd_ui_draw_object method: markerOff

    stops drawing the marker

    $LastChangedBy: jimm $
    $LastChangedDate: 2014-02-11 10:54:32 -0800 (Tue, 11 Feb 2014) $
    $LastChangedRevision: 14326 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/spedas_gui/display/draw_object/spd_ui_draw_object__markeroff.pro $

(See spedas_gui/display/draw_object/spd_ui_draw_object__markeroff.pro)

## SPD_UI_DRAW_OBJECT__MARKERON

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

    spd_ui_draw_object method: markerOn

    starts drawing a new marker at the current location
    'default' is a marker object from which the marker defaults will be copied
    'all' indicates that markers should be drawn on all panels
    note that markerOn can fail if the current location isn't within the
    boundaries of a panel.  The 'fail' keyword indicates this

    $LastChangedBy: jimm $
    $LastChangedDate: 2014-02-11 10:54:32 -0800 (Tue, 11 Feb 2014) $
    $LastChangedRevision: 14326 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/spedas_gui/display/draw_object/spd_ui_draw_object__markeron.pro $

(See spedas_gui/display/draw_object/spd_ui_draw_object__markeron.pro)

## SPD_UI_DRAW_OBJECT__NICENUM

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

    spd_ui_draw_object method: niceNum

    Function adapted from Graphics Gems:
    Heckbert, Paul S., Nice Numbers for Graph Labels, Graphics Gems, p. 61-63, code: p. 657-659
    It identifies the closest "nice" number
    Nice being a number j * 10 ^ n where j = 1,2,5,10 and n = any integer

    Inputs:
      n(double):  The number for which the nearest nicenum is being found

      floor(optional,boolean keyword): The routine picks the nearest nicenum below n

      ceil(optional,boolean keyword): The routine picks the nearest nicenum above n

      factors(optional, array of numeric types): rather than using 1,2,5,10, pass an array
                                          of alternate values. Common inputs are
                                          [1,2,3,4,5,6,7,8,9,10], or [1,2,3,6,10]

      bias(optional,long): Some sets of factors may entail looking at the first 2 or D
                           digits of the nearest nicenum, rather than just the first.
                           If this is the case, this argument should be set to instruct
                           this algorithm to look at 2 digits.  For example, if
                           factors = dindgen(101), bias should be 1, if factors = dindgen(1001)
                           bias should be 2. The default is 0
      Outputs:
        factor_index(long): this returns an index into the factor_array indicating which
                            factor actually got selected.  For example: If nicenum = 2, then
                            factor_index = 1

      Returns:
         The nicenum that was found

    NOTES:
      Default behavior is to find the nearest nicenum above or below N, but the algorithm from
      graphics gems could only approximate this somewhat roughly.  So instead, two calls one
      with /floor and one with /ceil is made by the calling routine and the called decides
      which result is closest.

    factor_index:  The index of the factor that will be used for the result.(ie different j's)

    $LastChangedBy: jimm $
    $LastChangedDate: 2014-02-11 10:54:32 -0800 (Tue, 11 Feb 2014) $
    $LastChangedRevision: 14326 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/spedas_gui/display/draw_object/spd_ui_draw_object__nicenum.pro $

(See spedas_gui/display/draw_object/spd_ui_draw_object__nicenum.pro)

## SPD_UI_DRAW_OBJECT__NICENUMTIME

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

    spd_ui_draw_object method: niceNumTime

    Function adapted from Graphics Gems:
    Heckbert, Paul S., Nice Numbers for Graph Labels, Graphics Gems, p. 61-63, code: p. 657-659
    It identifies the closest "nice" number
    Nice being a number j * 10 ^ n where j = 1,2,5 and n = any integer

    This routine performs nicenum on a time in seconds, it will
    account for whether the input is closer to an hour or a minute or a day.
    Good factors to use with this routine are [1,2,3,6,10]

    Its Input/Output/Return parameter are identifcal to niceNum

    $LastChangedBy: jimm $
    $LastChangedDate: 2014-02-11 10:54:32 -0800 (Tue, 11 Feb 2014) $
    $LastChangedRevision: 14326 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/spedas_gui/display/draw_object/spd_ui_draw_object__nicenumtime.pro $

(See spedas_gui/display/draw_object/spd_ui_draw_object__nicenumtime.pro)

## SPD_UI_DRAW_OBJECT__NORM2PT

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

    spd_ui_draw_object method: norm2pt

    converts back from the normalized value into points,
    While the normalized value is dependent on screen dimensions
    zoom, & resolution.  The value in points should be an
    absolute quantity

    Inputs:
      Value(numeric or array of numerics):  A value in screen normal coords
      xy(boolean) 0 : convert from x-axis, 1:convert from y-axis(because screen dims differ, axis must be specified)

    $LastChangedBy: pcruce $
    $LastChangedDate: 2014-05-14 11:58:59 -0700 (Wed, 14 May 2014) $
    $LastChangedRevision: 15133 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/spedas_gui/display/draw_object/spd_ui_draw_object__norm2pt.pro $

(See spedas_gui/display/draw_object/spd_ui_draw_object__norm2pt.pro)

## SPD_UI_DRAW_OBJECT__NUKEDRAW

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

    spd_ui_draw_object method: nukeDraw

    This routine should blank the current contents of the object
    Generally used in the event of an error

    $LastChangedBy: jimm $
    $LastChangedDate: 2014-02-11 10:54:32 -0800 (Tue, 11 Feb 2014) $
    $LastChangedRevision: 14326 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/spedas_gui/display/draw_object/spd_ui_draw_object__nukedraw.pro $

(See spedas_gui/display/draw_object/spd_ui_draw_object__nukedraw.pro)

## SPD_UI_DRAW_OBJECT__PLACEMAJORTICKS

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

    spd_ui_draw_object method: placeMajorTicks

    Determines where to place the tick marks for
    an axis, and deals with the various input validation issues
    and positioning options.
    If they are placed automatically,
    They should be at human readable values, if possible.
    In this case human readable means that if the axis
    is non time, the ticks will be at values of
    1*10^n or 2*10^n or 5*10^n where n is some number
    appropriate to the scale of the axis
    If the axis is a time axis the ticks will be at
    1,2,5 * 10^n or 60*1,2,5*10^n or 60*60*1,2,5*10^n or
    24*60*60*1,2,5*10^n  With selection/n dependent on scale

    $LastChangedBy: pcruce $
    $LastChangedDate: 2014-06-25 17:47:00 -0700 (Wed, 25 Jun 2014) $
    $LastChangedRevision: 15444 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/spedas_gui/display/draw_object/spd_ui_draw_object__placemajorticks.pro $

(See spedas_gui/display/draw_object/spd_ui_draw_object__placemajorticks.pro)

## SPD_UI_DRAW_OBJECT__PT2NORM

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

    spd_ui_draw_object method: pt2norm

    Convert pts into draw area normal coordinates.
    Inputs:
      Value(numeric type, or array of numeric types): the point value(s) to be converted
      xy(boolean):  0: convert for x-axis, 1 convert for y-axis.(because screen dims differ, axis must be specified)

    Returns, the value in normalized coordinates

    $LastChangedBy: pcruce $
    $LastChangedDate: 2014-05-14 11:58:59 -0700 (Wed, 14 May 2014) $
    $LastChangedRevision: 15133 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/spedas_gui/display/draw_object/spd_ui_draw_object__pt2norm.pro $

(See spedas_gui/display/draw_object/spd_ui_draw_object__pt2norm.pro)

## SPD_UI_DRAW_OBJECT__REMOVEINSTANCE

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

    spd_ui_draw_object method: removeInstance

    this method will remove the instance hide settings from static components
    This is generally meant to be used by image export routines when the
    the legend is off,  if the legend is on, this method may leave the
    dynamic components of the legend hidden

    $LastChangedBy: jimm $
    $LastChangedDate: 2014-02-11 10:54:32 -0800 (Tue, 11 Feb 2014) $
    $LastChangedRevision: 14326 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/spedas_gui/display/draw_object/spd_ui_draw_object__removeinstance.pro $

(See spedas_gui/display/draw_object/spd_ui_draw_object__removeinstance.pro)

## SPD_UI_DRAW_OBJECT__RUBBERBAND

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

    spd_ui_draw_object method: rubberBand

    for making a rubber band.  This thing actually manipulates the
    draw tree to move the rubber band around according to the current cursor position
    location is the location in draw-area normalized coordinates [x,y]
    dimensions is the dimensions in draw-area normalized coordinates [xsize,ysize]

    $LastChangedBy: jimm $
    $LastChangedDate: 2014-02-11 10:54:32 -0800 (Tue, 11 Feb 2014) $
    $LastChangedRevision: 14326 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/spedas_gui/display/draw_object/spd_ui_draw_object__rubberband.pro $

(See spedas_gui/display/draw_object/spd_ui_draw_object__rubberband.pro)

## SPD_UI_DRAW_OBJECT__RUBBERBANDOFF

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

    spd_ui_draw_object method: rubberBandOff

    Stops drawing the rubber band

    $LastChangedBy: jimm $
    $LastChangedDate: 2014-02-11 10:54:32 -0800 (Tue, 11 Feb 2014) $
    $LastChangedRevision: 14326 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/spedas_gui/display/draw_object/spd_ui_draw_object__rubberbandoff.pro $

(See spedas_gui/display/draw_object/spd_ui_draw_object__rubberbandoff.pro)

## SPD_UI_DRAW_OBJECT__RUBBERBANDON

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

    spd_ui_draw_object method: rubberBandOn

    Starts drawing the rubber band at the current location

    $LastChangedBy: jimm $
    $LastChangedDate: 2014-02-11 10:54:32 -0800 (Tue, 11 Feb 2014) $
    $LastChangedRevision: 14326 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/spedas_gui/display/draw_object/spd_ui_draw_object__rubberbandon.pro $

(See spedas_gui/display/draw_object/spd_ui_draw_object__rubberbandon.pro)

## SPD_UI_DRAW_OBJECT__SETCLICK

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

    spd_ui_draw_object method: SetClick

    This routine performs the draw work necessary to display a marker click
    basically this means mutating the selected flag on markerinfo.
    Then when drawn the marker will show up with the appropriate highlighting

    Inputs:
      InfoStruct(struct) : This is the struct returned by spd_ui_draw_object::getClick

    NOTES:
      This is separated from getclick() to preserve separation between routines that
         give information on the display, and ones that mutate display.
         This way, the calling routine doesn't need to expect a mutation to
         query the layout

    $LastChangedBy: jimm $
    $LastChangedDate: 2014-02-11 10:54:32 -0800 (Tue, 11 Feb 2014) $
    $LastChangedRevision: 14326 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/spedas_gui/display/draw_object/spd_ui_draw_object__setclick.pro $

(See spedas_gui/display/draw_object/spd_ui_draw_object__setclick.pro)

## SPD_UI_DRAW_OBJECT__SETCURSOR

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

    spd_ui_draw_object method: setCursor
    Makes a vertical bar, updates legends, draws rubber band,
    draws markers(during draw animation), highlights markers
    during mouseover.
    This routine should be called pretty much
    any time the cursor moves in the draw area.

    Location(2-element double):  The cursor location
    in coordinates normalized to the draw area size.

    $LastChangedBy: jimm $
    $LastChangedDate: 2014-02-11 10:54:32 -0800 (Tue, 11 Feb 2014) $
    $LastChangedRevision: 14326 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/spedas_gui/display/draw_object/spd_ui_draw_object__setcursor.pro $

(See spedas_gui/display/draw_object/spd_ui_draw_object__setcursor.pro)

## SPD_UI_DRAW_OBJECT__SETLEGENDHIDE

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

    spd_ui_draw_object method: setLegendHide

    Because the static components of the legend are still somewhat
    dynamic(Because they can be manipulated between updates),
    This routine is needed to manipulate them separately
    From the lists in self.staticViews & self.dynamicViews
    Inputs:
      dynamic(boolean keyword):, set to hide dynamic component of the legend
      hide:(boolean): set to the hide value you want to use

    $LastChangedBy: jimm $
    $LastChangedDate: 2014-02-11 10:54:32 -0800 (Tue, 11 Feb 2014) $
    $LastChangedRevision: 14326 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/spedas_gui/display/draw_object/spd_ui_draw_object__setlegendhide.pro $

(See spedas_gui/display/draw_object/spd_ui_draw_object__setlegendhide.pro)

## SPD_UI_DRAW_OBJECT__SETMODELHIDE

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

    spd_ui_draw_object method: setModelHide

    This routine sets the hide values for all the models inside the views that it receives as an argument
    It just exists to remove some duplication that occurs when generating an instanced display
    This is a recursive function

    Inputs:
      hidevalue(boolean): The value that the hide flag will be set to.

    $LastChangedBy: jimm $
    $LastChangedDate: 2014-02-11 10:54:32 -0800 (Tue, 11 Feb 2014) $
    $LastChangedRevision: 14326 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/spedas_gui/display/draw_object/spd_ui_draw_object__setmodelhide.pro $

(See spedas_gui/display/draw_object/spd_ui_draw_object__setmodelhide.pro)

## SPD_UI_DRAW_OBJECT__SETPROPERTY

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

    spd_ui_draw_object method: setProperty

    Set a couple of properties related to drawing
    Mainly used to perform output to other devices

    Destination:
      The target to which draws will be made.
      Some parameters used in updated are also drawn from the destination.
      This should be some sort of IDLgr* destination object.

    LineRes:
      The resolution at which lines will be drawn.
      Ideally, this is a scalar multiple of the current screen resolution.
      (ie plot with 500 pixel width, and lineRes 2 will send 1000 points to the output destination)
      Line resolution modification is currently limited by aliasing issues. So it is ignored in the current version
      and all line plots send every point to the output destination.

    SpecRes:
      The resolution at which spectral plots will be drawn.
      SpecRes is a multiple of screen resolution.  If specRes is 2
      and a plot has a screen resolution of 400x300 pixels, a spectral
      plot of 800x600 will be output to the destination.

    HistoryWin:
      The history object that the draw object sends its history output to.

    statusBar:
      The status bar object that the draw object sends status messages to.

    fancompressionfactor:
      The percentage error to be applied to the fancompression algorithm during postscript plotting.
      0 = No compression

    $LastChangedBy: jimm $
    $LastChangedDate: 2014-02-11 10:54:32 -0800 (Tue, 11 Feb 2014) $
    $LastChangedRevision: 14326 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/spedas_gui/display/draw_object/spd_ui_draw_object__setproperty.pro $

(See spedas_gui/display/draw_object/spd_ui_draw_object__setproperty.pro)

## SPD_UI_DRAW_OBJECT__SETVARHIDE

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

    spd_ui_draw_object method: setVarHide

    This routine sets the hide value for variables on a panel with
    a particular index.  It is mainly here for organization and to prevent duplication

    Inputs:
      hidevalue(boolean): The value that the hide flag will be set to.

    $LastChangedBy: jimm $
    $LastChangedDate: 2014-02-11 10:54:32 -0800 (Tue, 11 Feb 2014) $
    $LastChangedRevision: 14326 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/spedas_gui/display/draw_object/spd_ui_draw_object__setvarhide.pro $

(See spedas_gui/display/draw_object/spd_ui_draw_object__setvarhide.pro)

## SPD_UI_DRAW_OBJECT__SETZOOM

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

    spd_ui_draw_object method: setZoom

    Set the zoom factor on the current destination object
    Only works if the destination is an IDLgrWindow

    $LastChangedBy: jimm $
    $LastChangedDate: 2014-02-11 10:54:32 -0800 (Tue, 11 Feb 2014) $
    $LastChangedRevision: 14326 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/spedas_gui/display/draw_object/spd_ui_draw_object__setzoom.pro $

(See spedas_gui/display/draw_object/spd_ui_draw_object__setzoom.pro)

## SPD_UI_DRAW_OBJECT__UPDATE

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

    spd_ui_draw_object method: Update

    This function updates the entire display, it will be pretty
    slow so it should only be called after panel applies, but not
    during common widget events.

    WindowStorage:
     the spd_ui_windows object that stores the windows for the scene that is being updated

    LoadedData:
     thm spd_ui_loaded_data object that stores the data used in the scene that is being drawn

    Postscript=postscript:
     set this keyword when postscripts are being drawn.  Special kluges for dealing with
     postscript transparency and layering issues are turned on.

     Error=error:
     Pass a named variable in via this keyword when updates are being drawn.  After completion
     It will return a 1 if there was an error and a 0 if there was no error.

     errmsg=errmsg:
     Pass a named variable in via this keyword when updates are being drawn (optional). If a draw object
     error occurs for which an error message has been defined, errmsg will return an anonymous struct with fields
     describing the error. errmsg does not exist for all cases where error=1, nor is it guaranteed than error=1
     if errmsg exists. This keyword is intended to return error information to calling routines where messages
     may need to be issued to the user (eg. pop up messages).
     It is intended that developers make use of errmsg & add it to procedures/functions as they need it.
     Note that when handling error messages in the calling routine it is necessary to always check the relevant
     fields in the errmsg struct exist before using them as the routine may pick up errors that you don't
     anticipate defined in other areas of the code, with different fields in the struct.
     Note: if no error occurs for which an error message has been defined errmsg is simply not set. It is necessary
     to check if errmsg has been set before handling any messages in the calling routine.
     Note: update itself does not currently produce any errmsg, errmsg is simply passed on to other routines (currently updatePanels).

     NOTES:
      1.  Slowness depends on complexity of displayed layout.(number of panels, size of data)
          It can range from 1/10th of a second to 10 or more seconds

      2.  Memory usage can spike moderately during this function, but memory usage between
          calls should be minimal because lookup tables are used for cursor functions.
          Memory will max out at ~2x the memory of the largest panel being plotted, because data
          must be copied to process it without corrupting the main data store.
          In other words O(N*M), where N is the time resolution of the data on your largest
          panel, and M is the number of dimensions on this panel.

    $LastChangedBy: jimm $
    $LastChangedDate: 2014-02-11 10:54:32 -0800 (Tue, 11 Feb 2014) $
    $LastChangedRevision: 14326 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/spedas_gui/display/draw_object/spd_ui_draw_object__update.pro $

(See spedas_gui/display/draw_object/spd_ui_draw_object__update.pro)

## SPD_UI_DRAW_OBJECT__UPDATEHBAR

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

    spd_ui_draw_object method: updateHBar

    This routine updates the location of the horizontal bar
    in each panel.  Behavior is a function of the various
    tracking options and the location of the cursor

    location(2-element double): The position of the cursor
    in coordinates normalized to the draw area

    panelInfo(pointer to array of structs): Each struct stores the
    metadata for each panel in a format for internal use by the draw object

    $LastChangedBy: jimm $
    $LastChangedDate: 2014-02-11 10:54:32 -0800 (Tue, 11 Feb 2014) $
    $LastChangedRevision: 14326 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/spedas_gui/display/draw_object/spd_ui_draw_object__updatehbar.pro $

(See spedas_gui/display/draw_object/spd_ui_draw_object__updatehbar.pro)

## SPD_UI_DRAW_OBJECT__UPDATELEGEND

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

    spd_ui_draw_object method: updateLegend

    this code performs an update on the legend text values for the provided panel
    it fills them in with the normalized data values provided as arguments

    panelLocation(2-element double): The position of the cursor in coordinates normalized to the panel
    panel(struct):  The draw object struct representing the panel
    blank(boolean keyword):  Set this keyword to make the legend blank
    noyvalue(boolean keyword): If this keyword is set, the yvalue will be set to an empty string and other values will be updated as normal

    $LastChangedBy: jimm $
    $LastChangedDate: 2014-02-11 10:54:32 -0800 (Tue, 11 Feb 2014) $
    $LastChangedRevision: 14326 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/spedas_gui/display/draw_object/spd_ui_draw_object__updatelegend.pro $

(See spedas_gui/display/draw_object/spd_ui_draw_object__updatelegend.pro)

## SPD_UI_DRAW_OBJECT__UPDATEPAGE

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

    spd_ui_draw_object method: makeView

    updates the draw object to reflect the page settings
    Inputs:
      pageSettings(object reference):  the spd_ui_page_settings associated with the window being drawn

    Outputs:
      returns: 1 on success, 0 on failure.

    Mutates:
      self.pageview, self.scene,self.currentPageSize,self.staticviews

    $LastChangedBy: jimm $
    $LastChangedDate: 2014-02-11 10:54:32 -0800 (Tue, 11 Feb 2014) $
    $LastChangedRevision: 14326 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/spedas_gui/display/draw_object/spd_ui_draw_object__updatepage.pro $

(See spedas_gui/display/draw_object/spd_ui_draw_object__updatepage.pro)

## SPD_UI_DRAW_OBJECT__UPDATEPANELS

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

    spd_ui_draw_object method: updatePanels

    draws the panels for this window.
    This routine is the workhorse of the draw object,

    Inputs:
      Layout Dims(2-elements long):  The number of rows and columns in the layout(from the spd_ui_window)
      Margins(6-elements double):  The size of the margins for the panel in points. Elements are as follows
                                   [left,right,top,bottom,horizontal_internal,vertical_internal]
      PanelObjs(array of objects):  Array of references to the spd_ui_panel objects being drawn
      LoadedData(object): Reference to the spd_ui_loaded_data object in which the data to be plotted is stored
      Backgroundcolor(3-element Byte array):  The color of the background, needed to emulate some transparency effects.
      Locked(long index):  The locked value from the window object.  -1 is unlocked, otherwise it is the index
                           of the panel to which others are locked.  Index in terms of the list of panelObjs
      Window(object):  The active window from which the drawn panels originate. Needed to query layout information.

    Outputs:
      returns 1 on success, 0 on failure
      errmsg: a struct describing an error that has occurred, to be passed up to calling routine.
        The existance of errmsg does not guarantee updatePanels returns 0 and vice versa.
        Currently updatepanels itself does not set errmsg, it is simply passed on through here to other routines
        (presently only getRange and makeView).
        See spd_ui_draw_object_update for more details.

    Mutates:
      self.panelViews,self.staticViews,self.dynamicViews,self.panelInfo

    NOTE:  The order in which various elements of the panel are added to the display is IMPORTANT
    If you change the ordering be sure to check that this change hasn't oscured some
    important feature.

    $LastChangedBy: nikos $
    $LastChangedDate: 2017-11-20 10:43:28 -0800 (Mon, 20 Nov 2017) $
    $LastChangedRevision: 24317 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/spedas_gui/display/draw_object/spd_ui_draw_object__updatepanels.pro $

(See spedas_gui/display/draw_object/spd_ui_draw_object__updatepanels.pro)

## SPD_UI_DRAW_OBJECT__UPDATEVBAR

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

    spd_ui_draw_object method: updateVBar
    This routine updates the location of the vertical bar
    in each panel.  Behavior is a function of the various
    tracking options and the location of the cursor

    location(2-element double): The position of the cursor
    in coordinates normalized to the draw area

    panelInfo(pointer to array of structs): Each struct stores the
    metadata for each panel in a format for internal use by the draw object
    $LastChangedBy: jimm $
    $LastChangedDate: 2014-02-11 10:54:32 -0800 (Tue, 11 Feb 2014) $
    $LastChangedRevision: 14326 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/spedas_gui/display/draw_object/spd_ui_draw_object__updatevbar.pro $

(See spedas_gui/display/draw_object/spd_ui_draw_object__updatevbar.pro)

## SPD_UI_DRAW_OBJECT__VBAROFF

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

    spd_ui_draw_object method: vBarOff

    stop drawing a vertical bar

    $LastChangedBy: jimm $
    $LastChangedDate: 2014-02-11 10:54:32 -0800 (Tue, 11 Feb 2014) $
    $LastChangedRevision: 14326 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/spedas_gui/display/draw_object/spd_ui_draw_object__vbaroff.pro $

(See spedas_gui/display/draw_object/spd_ui_draw_object__vbaroff.pro)

## SPD_UI_DRAW_OBJECT__VBARON

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

    spd_ui_draw_object method: vBarOn

    start drawing a vertical bar on one or all panels
    Inputs:
      all(boolean keyword):  Set to turn on for all panels.
                             Default is for single panel mode

    $LastChangedBy: jimm $
    $LastChangedDate: 2014-02-11 10:54:32 -0800 (Tue, 11 Feb 2014) $
    $LastChangedRevision: 14326 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/spedas_gui/display/draw_object/spd_ui_draw_object__vbaron.pro $

(See spedas_gui/display/draw_object/spd_ui_draw_object__vbaron.pro)

## SPD_UI_DRAW_OBJECT__XCLIP

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

    spd_ui_draw_object method: xclip

    This routine, performs prepocessing with respect to the x-axis

    1. translates data from linear to log space, if necessary
    2. Removes invalid values because:
        a. non-finite
        b. out of range
        c. le 0 on log axis

    3. Performs analogous removals on y/z/mirror data

    Inputs:

    xPtr(array of pointers to arrays):  A list of the data quantities for all x-values used in the panel.
                         The number of pointers should match the number of pointers in y and z.
                         If an x/y has no z(ie line plot), the corresponding element should be a null pointer
    yPtr(array of pointers to arrays) : A list of the data quantities for all y-values used in the panel.
                         The number of pointers should match the number of pointers in x and z.
                         If an x/y has no z(ie line plot), the corresponding element should be a null pointer
    zPtr(array of pointers to arrays) : A list of the data quantities for all z-values used in the panel.
                         The number of pointers should match the number of pointers in x and y.
                         If an x/y has no z(ie line plot), the corresponding element should be a null pointer

    range(2-element double) : The min and max x-range that the data should be clipped to.

    scale(long) : The scaling method to be used on this axis(0: linear,1:log10,2:logN)

    mirrorPtr(array of pointers to arrays) : A list of the data quantities for all mirror-values used in the panel.
                         The number of pointers should match the number of pointers in x,y, z
                         If an x/y has no mirror the corresponding element should be a null pointer

    Outputs:
      xPtr(array of pointers to arrays): Input data replaced with clipped data. Format is the same
      yPtr(array of pointers to arrays): Input data replaced with clipped data. Format is the same
      zPtr(array of pointers to arrays): Input data replaced with clipped data. Format is the same
      fail(named variable keyword):  Will store 1 if routine fails, 0 otherwise

    NOTES:
     This routine is a partial replacement for spd_ui_xyclip, which became unwieldy to maintain
     as the reponsibilities of the routine diverged.

    $LastChangedBy: jimm $
    $LastChangedDate: 2014-02-11 10:54:32 -0800 (Tue, 11 Feb 2014) $
    $LastChangedRevision: 14326 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/spedas_gui/display/draw_object/spd_ui_draw_object__xclip.pro $

(See spedas_gui/display/draw_object/spd_ui_draw_object__xclip.pro)

## SPD_UI_DRAW_OBJECT__YCLIP

[Previous Routine] [List of Routines]

    spd_ui_draw_object method: yclip

    This routine, performs prepocessing with respect to the y-axis

    1. translates data from linear to log space, if necessary
    2. Removes invalid values or marks with NaNs depending on whether trace in spectrographic and spec geometry.
       Reasons for marking/removing
        a. non-finite.
        b. out of range
        c. le 0 on log axis

    3. Performs analogous removals on z/mirror data

    Inputs:

    xPtr(array of pointers to arrays):  A list of the data quantities for all x-values used in the panel.
                         The number of pointers should match the number of pointers in y and z.
                         If an x/y has no z(ie line plot), the corresponding element should be a null pointer
    yPtr(array of pointers to arrays) : A list of the data quantities for all y-values used in the panel.
                         The number of pointers should match the number of pointers in x and z.
                         If an x/y has no z(ie line plot), the corresponding element should be a null pointer
    zPtr(array of pointers to arrays) : A list of the data quantities for all z-values used in the panel.
                         The number of pointers should match the number of pointers in x and y.
                         If an x/y has no z(ie line plot), the corresponding element should be a null pointer

    range(2-element double) : The min and max y-range that the data should be clipped to.

    scale(long) : The scaling method to be used on this axis(0: linear,1:log10,2:logN)

    mirrorPtr(array of pointers to arrays) : A list of the data quantities for all mirror-values used in the panel.
                         The number of pointers should match the number of pointers in x,y, z
                         If an x/y has no mirror the corresponding element should be a null pointer

    Outputs:
      xPtr(array of pointers to arrays): Input data replaced with clipped data. Format is the same
      yPtr(array of pointers to arrays): Input data replaced with clipped data. Format is the same
      zPtr(array of pointers to arrays): Input data replaced with clipped data. Format is the same
      fail(named variable keyword):  Will store 1 if routine fails, 0 otherwise

    NOTES:
     This routine is a partial replacement for spd_ui_xyclip, which became unwieldy to maintain
     as the reponsibilities of the routine diverged.

    $LastChangedBy: jimm $
    $LastChangedDate: 2014-02-11 10:54:32 -0800 (Tue, 11 Feb 2014) $
    $LastChangedRevision: 14326 $
    $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/spedas_gui/display/draw_object/spd_ui_draw_object__yclip.pro $

(See spedas_gui/display/draw_object/spd_ui_draw_object__yclip.pro)