Package ucar.nc2.geoloc.vertical
Class OceanSG2
- java.lang.Object
-
- ucar.nc2.geoloc.vertical.OceanSG2
-
- All Implemented Interfaces:
VerticalTransform
@Immutable public class OceanSG2 extends Object
Implement CF "ocean_s_coordinate_g2".Ocean s-coordinate, generic form 2 standard_name = "ocean_s_coordinate_g2" Definition z(n,k,j,i) = eta(n,j,i) + (eta(n,j,i) + depth(j,i)) * S(k,j,i) where S(k,j,i) = (depth_c * s(k) + depth(j,i) * C(k)) / (depth_c + depth(j,i)) where z(n,k,j,i) is height, positive upwards, relative to ocean datum (e.g. mean sea level) at gridpoint (n,k,j,i), eta(n,j,i) is the height of the ocean surface, positive upwards, relative to ocean datum at gridpoint (n,j,i), s(k) is the dimensionless coordinate at vertical gridpoint (k) with a range of -1 <= s(k) <= 0 , S(0) corresponds to eta(n,j,i) whereas s(-1) corresponds to depth(j,i); C(k) is the dimensionless vertical coordinate stretching function at gridpoint (k) with a range of -1 <= C(k) <= 0, C(0) corresponds to eta(n,j,i) whereas C(-1) corresponds to depth(j,i); the constant depth_c, (positive value), is a critical depth controlling the stretching and depth(j,i) is the distance from ocean datum to sea floor (positive value) at horizontal gridpoint (j,i). The format for the formula_terms attribute is formula_terms = "s: var1 C: var2 eta: var3 depth: var4 depth_c: var5"
- See Also:
- "http://cfconventions.org/Data/cf-conventions/cf-conventions-1.9/cf-conventions.html#_ocean_s_coordinate_generic_form_1"
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
OceanSG2.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Optional<VerticalTransform>
create(NetcdfDataset ds, AttributeContainer params, Formatter errlog)
Array<Number>
getCoordinateArray1D(int timeIndex, int xIndex, int yIndex)
Get the 1D vertical coordinate array for this time step and pointArray<Number>
getCoordinateArray3D(int timeIndex)
Get the 3D vertical coordinate array for this time step.String
getCtvName()
The name of the Coordinate Variable Transform container.String
getName()
The name of the Vertical Transform.String
getUnitString()
The unit string for the vertical coordinate.
-
-
-
Method Detail
-
create
public static Optional<VerticalTransform> create(NetcdfDataset ds, AttributeContainer params, Formatter errlog)
-
getCoordinateArray3D
public Array<Number> getCoordinateArray3D(int timeIndex) throws IOException, InvalidRangeException
Description copied from interface:VerticalTransform
Get the 3D vertical coordinate array for this time step. Must be in "canonical order" : z, y, x.- Parameters:
timeIndex
- the time index. Ignored if !isTimeDependent().- Returns:
- 3D vertical coordinate array, for the given t.
- Throws:
IOException
InvalidRangeException
-
getName
public String getName()
Description copied from interface:VerticalTransform
The name of the Vertical Transform.- Specified by:
getName
in interfaceVerticalTransform
-
getCtvName
public String getCtvName()
Description copied from interface:VerticalTransform
The name of the Coordinate Variable Transform container.- Specified by:
getCtvName
in interfaceVerticalTransform
-
getUnitString
@Nullable public String getUnitString()
Description copied from interface:VerticalTransform
The unit string for the vertical coordinate.- Specified by:
getUnitString
in interfaceVerticalTransform
-
getCoordinateArray1D
public Array<Number> getCoordinateArray1D(int timeIndex, int xIndex, int yIndex) throws IOException, InvalidRangeException
Description copied from interface:VerticalTransform
Get the 1D vertical coordinate array for this time step and point- Specified by:
getCoordinateArray1D
in interfaceVerticalTransform
- Parameters:
timeIndex
- the time index. Ignored if !isTimeDependent().xIndex
- the x indexyIndex
- the y index- Returns:
- vertical coordinate array
- Throws:
IOException
InvalidRangeException
-
-