dk.dmi.jog
Class Profile

java.lang.Object
  extended bydk.dmi.jog.Profile
All Implemented Interfaces:
Comparable

public class Profile
extends Object
implements Comparable

A vertical profile. Missing values are represented by Float.NaN.


Method Summary
 int compareTo(Object o)
          Compares this Profile to another Object.
 boolean equals(Object o)
          Compares this Profile to the specified Object.
 float[] getData()
          Returns the data of this Profile.
static Profile getInstance(Profile p)
          Returns a Profile copy of the argument.
static Profile getInstance(String id, float[] z, float[] data)
          Returns a Profile representation of the arguments.
static Profile getInstance(String id, String zunit, String dunit, float[] z, float[] data)
          Returns a Profile representation of the arguments.
 String getParameterID()
          Returns the parameter ID of this Profile, eg.
 String getUnitData()
          Returns the units of the data in this Profile.
 String getUnitVerticalLevels()
          Returns the units of the vertical levels in this Profile.
 float[] getVerticalLevels()
          Returns the vertical levels of this Profile.
 int hashCode()
           
 Profile interpolateVerticalLevels(float[] z)
          Returns a Profile with values interpolated to the values in z.
 boolean isInterpolated()
          Returns true if the data in this Profile are interpolated.
 void setInterpolated()
          Flags data as interpolated.
 String toString()
          Returns a String representation of this Profile.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

compareTo

public int compareTo(Object o)
Compares this Profile to another Object.

Specified by:
compareTo in interface Comparable
Parameters:
o - the Object to be compared.
Returns:
the value 0 if the argument is a Profile with the same parameter as this Profile; a value less than 0 if the parameter of the argument is lexically less than the parameter of this Profile and a value greater than 0 if the parameter of the argument is lexically more than the parameter of this Profile.

equals

public boolean equals(Object o)
Compares this Profile to the specified Object. The result is true if and only if the argument is not null and is a Profile containing the same data as this Profile.

Parameters:
o - the Object to be compared for equality with this Profile.
Returns:
true if the objects are identical; false otherwise.

getData

public float[] getData()
Returns the data of this Profile.

Returns:
the data of this Profile.

getInstance

public static Profile getInstance(Profile p)
Returns a Profile copy of the argument.

Parameters:
p - Profile to create a copy of.
Returns:
a copy of this Profile.

getInstance

public static Profile getInstance(String id,
                                  float[] z,
                                  float[] data)
Returns a Profile representation of the arguments. Units for the vertical levels and the data are not supplied and are stored as blanks in this Profile.

Parameters:
id - identifier for the data.
z - depth array.
data - data array (eg. temperature, salinity).
Returns:
a Profile representation of the arguments.

getInstance

public static Profile getInstance(String id,
                                  String zunit,
                                  String dunit,
                                  float[] z,
                                  float[] data)
Returns a Profile representation of the arguments.

Parameters:
id - identifier for the data.
zunit - units for depth array.
dunit - units for data array.
z - depth array.
data - data array (eg. temperature, salinity).
Returns:
a Profile representation of the arguments.

getParameterID

public String getParameterID()
Returns the parameter ID of this Profile, eg. Temperature.

Returns:
the parameter ID of this Profile.

getUnitData

public String getUnitData()
Returns the units of the data in this Profile.

Returns:
the units of the data in this Profile.

getUnitVerticalLevels

public String getUnitVerticalLevels()
Returns the units of the vertical levels in this Profile.

Returns:
the units of the vertical levels in this Profile.

getVerticalLevels

public float[] getVerticalLevels()
Returns the vertical levels of this Profile.

Returns:
the vertical levels of this Profile.

hashCode

public int hashCode()

interpolateVerticalLevels

public Profile interpolateVerticalLevels(float[] z)
Returns a Profile with values interpolated to the values in z.

Parameters:
z - depths to interpolate this Profile to.
Returns:
a Profile with values from this Profile interpolated to the depths in z.

isInterpolated

public boolean isInterpolated()
Returns true if the data in this Profile are interpolated.

Returns:
true if the data in this Profile are interpolated.

setInterpolated

public void setInterpolated()
Flags data as interpolated.


toString

public String toString()
Returns a String representation of this Profile.

Returns:
a String representation of this Profile.