gov.noaa.pmel.sgt.dm
Class ThreeDGrid

java.lang.Object
  extended by gov.noaa.pmel.sgt.dm.ThreeDGrid
All Implemented Interfaces:
Cartesian, CoordinateSystem, SGT3DGrid, SGTData, java.io.Serializable, java.lang.Cloneable

public class ThreeDGrid
extends java.lang.Object
implements SGT3DGrid, Cartesian, java.lang.Cloneable, java.io.Serializable

ThreeDGrid provides an implementation of the SGT3DGrid and Cartesian interfaces.

Since:
1.0
Version:
$Revision$, $Date$
Author:
Donald Denbo
See Also:
SGTGrid, Cartesian, Serialized Form

Field Summary
protected  SGTGrid associatedData_
           
protected  double[] grid_
           
protected  boolean hasXEdges_
           
protected  boolean hasYEdges_
           
protected  boolean hasZEdges_
           
protected  java.lang.String id_
           
protected  SGLabel keyTitle_
           
protected  GeoDate[] tEdges_
           
protected  java.lang.String title_
           
protected  GeoDate[] tloc_
           
protected  SGTMetaData valMetaData_
           
protected  double[] xEdges_
           
protected  double[] xloc_
           
protected  SGTMetaData xMetaData_
           
protected  boolean xTime_
           
protected  double[] yEdges_
           
protected  double[] yloc_
           
protected  SGTMetaData yMetaData_
           
protected  boolean yTime_
           
protected  double[] zEdges_
           
protected  double[] zloc_
           
protected  SGTMetaData zMetaData_
           
protected  boolean zTime_
           
 
Constructor Summary
ThreeDGrid()
          Default constructor.
ThreeDGrid(double[] grid, double[] xloc, double[] yloc, double[] zloc, java.lang.String title)
          Constructor for X, Y, and Z coordinates as double.
ThreeDGrid(double[] grid, double[] xloc, double[] yloc, GeoDate[] tloc, java.lang.String title)
          Constructor for X double and Y double, and Z time.
ThreeDGrid(double[] grid, double[] xloc, GeoDate[] tloc, double[] zloc, java.lang.String title)
          Constructor for X, Z double and Y time.
ThreeDGrid(double[] grid, GeoDate[] tloc, double[] yloc, double[] zloc, java.lang.String title)
          Constructor for X time and Y, Z double.
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener l)
          Add a PropertyChangeListener to the listener list.
 SGTData copy()
          Create a copy of the grid.
 SGTGrid getAssociatedData()
           
 java.lang.String getId()
          Get the unique identifier.
 SGLabel getKeyTitle()
          Get a title formatted for a Key.
 GeoDate[] getTimeArray()
           
 GeoDate[] getTimeEdges()
           
 java.lang.String getTitle()
          Get the title.
 int getTSize()
          Get the length of the Time axis
 double[] getValArray()
           
 int getValArraySize()
           
 SGTMetaData getValMetaData()
          Get the Value SGTMetaData.
 Range2D getValRange()
          Get the range of measured values on this 3D grid.
 double[] getXArray()
           
 double[] getXEdges()
           
 SoTRange getXEdgesRange()
          Return the range of the x edges
 SGTMetaData getXMetaData()
          Returns the X SGTMetaData.
 SoTRange getXRange()
          Returns the range of the X coordinates.
 int getXSize()
          Get the length of the x axis
 double[] getYArray()
           
 double[] getYEdges()
           
 SoTRange getYEdgesRange()
          Return the range of the y edges
 SGTMetaData getYMetaData()
          Returns the Y SGTMetaData.
 SoTRange getYRange()
          Returns the range of the Y coordinates.
 int getYSize()
          Get the length of the y axis
 double[] getZArray()
           
 double[] getZEdges()
          Get the Y coordinate edges.
 SoTRange getZEdgesRange()
          Get the range of Y coordinate edges.
 SGTMetaData getZMetaData()
           
 SoTRange getZRange()
           
 int getZSize()
          Get the length of Z value array.
 boolean hasAssociatedData()
           
 boolean hasXEdges()
           
 boolean hasYEdges()
           
 boolean hasZEdges()
          Z edges available?
 boolean isXTime()
          Returns true if the X coordinate is Time.
 boolean isYTime()
          Returns true if the Y coordinate is Time.
 boolean isZTime()
          Returns true if the Z coordinate is Time.
 void removePropertyChangeListener(java.beans.PropertyChangeListener l)
          Remove a PropertyChangeListener from the listener list.
 void setAssociatedData(SGTGrid assoc)
          Set the associated data grid.
 void setId(java.lang.String ident)
          Set the unique identifier.
 void setKeyTitle(SGLabel title)
          Set the title formatted for the VectorKey.
 void setTimeArray(GeoDate[] tloc)
          set the temporal grid centers
Property Change: dataModified.
 void setTimeEdges(GeoDate[] edge)
          Set the values for the temporal grid edges.
 void setTitle(java.lang.String title)
          Set the grid title
 void setValArray(double[] grid)
          Set the z grid values.
 void setValMetaData(SGTMetaData md)
          Set the SGTMetaData associated with the z coordinate.
 void setXArray(double[] xloc)
          Set the x coordinate grid centers
Property Change: dataModified.
 void setXEdges(double[] edge)
          Set the values for the x grid edges.
 void setXMetaData(SGTMetaData md)
          Set the SGTMetaData associated with the x coordinate.
 void setXTime(boolean flag)
           
 void setYArray(double[] yloc)
          Set the y coordinate grid centers
Property Change: dataModified.
 void setYEdges(double[] edge)
          Set the values for the y grid edges.
 void setYMetaData(SGTMetaData md)
          Set the SGTMetaData associated with the y coordinate.
 void setYTime(boolean flag)
           
 void setZArray(double[] zloc)
          Set the z coordinate grid centers
Property Change: dataModified.
 void setZEdges(double[] edge)
          Set the values for the z grid edges.
 void setZMetaData(SGTMetaData md)
          Set the SGTMetaData associated with the z coordinate.
 void setZTime(boolean flag)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

xloc_

protected double[] xloc_

yloc_

protected double[] yloc_

zloc_

protected double[] zloc_

tloc_

protected GeoDate[] tloc_

grid_

protected double[] grid_

xEdges_

protected double[] xEdges_

yEdges_

protected double[] yEdges_

zEdges_

protected double[] zEdges_

tEdges_

protected GeoDate[] tEdges_

hasXEdges_

protected boolean hasXEdges_

hasYEdges_

protected boolean hasYEdges_

hasZEdges_

protected boolean hasZEdges_

title_

protected java.lang.String title_

keyTitle_

protected SGLabel keyTitle_

id_

protected java.lang.String id_

xTime_

protected boolean xTime_

yTime_

protected boolean yTime_

zTime_

protected boolean zTime_

xMetaData_

protected SGTMetaData xMetaData_

yMetaData_

protected SGTMetaData yMetaData_

zMetaData_

protected SGTMetaData zMetaData_

valMetaData_

protected SGTMetaData valMetaData_

associatedData_

protected SGTGrid associatedData_
Constructor Detail

ThreeDGrid

public ThreeDGrid()
Default constructor.


ThreeDGrid

public ThreeDGrid(double[] grid,
                  double[] xloc,
                  double[] yloc,
                  double[] zloc,
                  java.lang.String title)
Constructor for X, Y, and Z coordinates as double.

Parameters:
grid - Z values
xloc - X coordinates
yloc - Y coordinates
zloc - Z coordinates
title - the title

ThreeDGrid

public ThreeDGrid(double[] grid,
                  GeoDate[] tloc,
                  double[] yloc,
                  double[] zloc,
                  java.lang.String title)
Constructor for X time and Y, Z double.

Parameters:
grid - values
tloc - Time coordinates
yloc - Y coordinates
zloc - Z coordinates
title - the title

ThreeDGrid

public ThreeDGrid(double[] grid,
                  double[] xloc,
                  GeoDate[] tloc,
                  double[] zloc,
                  java.lang.String title)
Constructor for X, Z double and Y time.

Parameters:
grid - values
xloc - X coordinates
xloc - Z coordinates
tloc - Time coordinates
title - the title

ThreeDGrid

public ThreeDGrid(double[] grid,
                  double[] xloc,
                  double[] yloc,
                  GeoDate[] tloc,
                  java.lang.String title)
Constructor for X double and Y double, and Z time.

Parameters:
grid - Z values
xloc - X coordinates
tloc - Time coordinates
title - the title
Method Detail

copy

public SGTData copy()
Create a copy of the grid.

Specified by:
copy in interface SGTData
Returns:
shallow copy
Since:
2.0
See Also:
SGTData

getXArray

public double[] getXArray()

getXSize

public int getXSize()
Get the length of the x axis

Since:
2.0

getYArray

public double[] getYArray()

getYSize

public int getYSize()
Get the length of the y axis

Since:
2.0

getZArray

public double[] getZArray()

getZSize

public int getZSize()
Description copied from interface: SGT3DGrid
Get the length of Z value array.

Specified by:
getZSize in interface SGT3DGrid

getValArray

public double[] getValArray()

getValArraySize

public int getValArraySize()

getTimeArray

public GeoDate[] getTimeArray()

getTSize

public int getTSize()
Get the length of the Time axis

Since:
2.0

isXTime

public boolean isXTime()
Description copied from interface: SGTData
Returns true if the X coordinate is Time.

Specified by:
isXTime in interface SGTData

isYTime

public boolean isYTime()
Description copied from interface: SGTData
Returns true if the Y coordinate is Time.

Specified by:
isYTime in interface SGTData

isZTime

public boolean isZTime()
Description copied from interface: SGT3DGrid
Returns true if the Z coordinate is Time.

Specified by:
isZTime in interface SGT3DGrid

setXTime

public void setXTime(boolean flag)

setYTime

public void setYTime(boolean flag)

setZTime

public void setZTime(boolean flag)

getXMetaData

public SGTMetaData getXMetaData()
Description copied from interface: SGTData
Returns the X SGTMetaData.

Specified by:
getXMetaData in interface SGTData

getYMetaData

public SGTMetaData getYMetaData()
Description copied from interface: SGTData
Returns the Y SGTMetaData.

Specified by:
getYMetaData in interface SGTData

getZMetaData

public SGTMetaData getZMetaData()

getValMetaData

public SGTMetaData getValMetaData()
Description copied from interface: SGT3DGrid
Get the Value SGTMetaData.

Specified by:
getValMetaData in interface SGT3DGrid

getTitle

public java.lang.String getTitle()
Description copied from interface: SGTData
Get the title.

Specified by:
getTitle in interface SGTData

setAssociatedData

public void setAssociatedData(SGTGrid assoc)
Set the associated data grid.
Property Change: associatedDataModified.

Since:
2.0

getAssociatedData

public SGTGrid getAssociatedData()

hasAssociatedData

public boolean hasAssociatedData()

hasXEdges

public boolean hasXEdges()

getXEdges

public double[] getXEdges()

hasZEdges

public boolean hasZEdges()
Description copied from interface: SGT3DGrid
Z edges available?

Specified by:
hasZEdges in interface SGT3DGrid

setZEdges

public void setZEdges(double[] edge)
Set the values for the z grid edges.


getZEdges

public double[] getZEdges()
Description copied from interface: SGT3DGrid
Get the Y coordinate edges. The YEdge length will be one greater than the YArray length.

Specified by:
getZEdges in interface SGT3DGrid

setXEdges

public void setXEdges(double[] edge)
Set the values for the x grid edges.


hasYEdges

public boolean hasYEdges()

getYEdges

public double[] getYEdges()

setYEdges

public void setYEdges(double[] edge)
Set the values for the y grid edges.


getTimeEdges

public GeoDate[] getTimeEdges()

setTimeEdges

public void setTimeEdges(GeoDate[] edge)
Set the values for the temporal grid edges.


setXMetaData

public void setXMetaData(SGTMetaData md)
Set the SGTMetaData associated with the x coordinate.


setYMetaData

public void setYMetaData(SGTMetaData md)
Set the SGTMetaData associated with the y coordinate.


setZMetaData

public void setZMetaData(SGTMetaData md)
Set the SGTMetaData associated with the z coordinate.


setValMetaData

public void setValMetaData(SGTMetaData md)
Set the SGTMetaData associated with the z coordinate.


setTitle

public void setTitle(java.lang.String title)
Set the grid title


getKeyTitle

public SGLabel getKeyTitle()
Description copied from interface: SGTData
Get a title formatted for a Key. JPlotLayout will use this if an explicit Key title is not given in the addData method.

Specified by:
getKeyTitle in interface SGTData
See Also:
SGLabel, ColorKey, LineKey, PointCollectionKey, VectorKey

setKeyTitle

public void setKeyTitle(SGLabel title)
Set the title formatted for the VectorKey.


getId

public java.lang.String getId()
Get the unique identifier. The presence of the identifier is optional, but if it is present it should be unique. This field is used to search for the layer that contains the data.

Specified by:
getId in interface SGTData
Returns:
unique identifier
Since:
2.0
See Also:
Pane, Layer

setId

public void setId(java.lang.String ident)
Set the unique identifier.


setXArray

public void setXArray(double[] xloc)
Set the x coordinate grid centers
Property Change: dataModified.


setYArray

public void setYArray(double[] yloc)
Set the y coordinate grid centers
Property Change: dataModified.


setZArray

public void setZArray(double[] zloc)
Set the z coordinate grid centers
Property Change: dataModified.


setValArray

public void setValArray(double[] grid)
Set the z grid values.
Property Change: dataModified.


setTimeArray

public void setTimeArray(GeoDate[] tloc)
set the temporal grid centers
Property Change: dataModified.


getXRange

public SoTRange getXRange()
Description copied from interface: SGTData
Returns the range of the X coordinates. If all the data in the array is missing, this method will return Double.NaN as the start and end values for data of type double and return GeoDate(Long.MIN_VALUE) for data of type GeoDate.

Specified by:
getXRange in interface SGTData
See Also:
GeoDate.isMissing()

getYRange

public SoTRange getYRange()
Description copied from interface: SGTData
Returns the range of the Y coordinates.

Specified by:
getYRange in interface SGTData
See Also:
SGTData.getXRange()

getZRange

public SoTRange getZRange()

getValRange

public Range2D getValRange()
Description copied from interface: SGT3DGrid
Get the range of measured values on this 3D grid.

Specified by:
getValRange in interface SGT3DGrid

getXEdgesRange

public SoTRange getXEdgesRange()
Return the range of the x edges

Since:
2.0

getYEdgesRange

public SoTRange getYEdgesRange()
Return the range of the y edges

Since:
2.0

getZEdgesRange

public SoTRange getZEdgesRange()
Description copied from interface: SGT3DGrid
Get the range of Y coordinate edges.

Specified by:
getZEdgesRange in interface SGT3DGrid

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener l)
Description copied from interface: SGTData
Add a PropertyChangeListener to the listener list.

Specified by:
addPropertyChangeListener in interface SGTData

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener l)
Description copied from interface: SGTData
Remove a PropertyChangeListener from the listener list.

Specified by:
removePropertyChangeListener in interface SGTData