public class CoordinateSystem extends Object
F(i,j,k,...) -> (S1, S2, ...Sn) where i,j,k are integers, and S is the set of reals (R) or Strings.The components of F are just its coordinate axes:
F = (A1, A2, ...An) A1(i,j,k,...) -> S1 A2(i,j,k,...) -> S2 An(i,j,k,...) -> SnConcretely, a CoordinateSystem is a set of coordinate axes, and an optional set of coordinate transforms. The domain rank of F is the number of dimensions it is a function of. The range rank is the number of coordinate axes.
An important class of CoordinateSystems are georeferencing Coordinate Systems, that locate a Variable's values in space and time. A CoordinateSystem that has a Lat and Lon axis, or a GeoX and GeoY axis and a Projection CoordinateTransform will have isGeoReferencing() true. A CoordinateSystem that has a Height, Pressure, or GeoZ axis will have hasVerticalAxis() true.
Further CoordinateSystems specialization is done by "data type specific" classes such as ucar.nc2.ft2.coverage.grid.GridCoordSys.
Modifier and Type | Class and Description |
---|---|
static class |
CoordinateSystem.Builder<T extends CoordinateSystem.Builder<T>> |
Constructor and Description |
---|
CoordinateSystem(NetcdfDataset ds,
Collection<CoordinateAxis> axes,
Collection<CoordinateTransform> coordTrans)
Deprecated.
Use CoordinateSystem.builder()
|
Modifier and Type | Method and Description |
---|---|
void |
addCoordinateTransform(CoordinateTransform ct)
Deprecated.
Use CoordinateSystem.builder()
|
void |
addCoordinateTransforms(Collection<CoordinateTransform> ct)
Deprecated.
Use CoordinateSystem.builder()
|
static CoordinateSystem.Builder<?> |
builder()
Get Builder for this class that allows subclassing.
|
boolean |
containsAxes(List<CoordinateAxis> wantAxes)
Do we have all the axes in the list?
|
boolean |
containsAxis(String axisName)
Do we have the named axis?
|
boolean |
containsAxisType(AxisType wantAxisType)
Do we have an axes of the given type?
|
boolean |
containsAxisTypes(List<AxisType> wantAxes)
Do we have all the axes types in the list?
|
boolean |
containsDomain(List<Dimension> wantDimensions)
Do we have all the dimensions in the list?
|
static int |
countDomain(Variable[] axes) |
boolean |
equals(Object oo)
Instances which have same name, axes and transforms are equal.
|
CoordinateAxis |
findAxis(AxisType type)
Find the CoordinateAxis that has the given AxisType.
|
CoordinateAxis |
getAzimuthAxis()
get the CoordinateAxis with AxisType.RadialAzimuth, or null if none.
|
List<CoordinateAxis> |
getCoordinateAxes()
get the List of CoordinateAxis objects
|
List<CoordinateTransform> |
getCoordinateTransforms()
get the List of CoordinateTransform objects
|
Collection<Dimension> |
getDomain()
List of Dimensions that constitute the domain.
|
CoordinateAxis |
getElevationAxis()
get the CoordinateAxis with AxisType.RadialElevation, or null if none.
|
CoordinateAxis |
getEnsembleAxis()
get the CoordinateAxis with AxisType.Ensemble, or null if none.
|
CoordinateAxis |
getHeightAxis()
get the CoordinateAxis with AxisType.Height, or null if none.
|
CoordinateAxis |
getLatAxis()
get the CoordinateAxis with AxisType.Lat, or null if none.
|
CoordinateAxis |
getLonAxis()
get the CoordinateAxis with AxisType.Lon, or null if none.
|
String |
getName()
get the name of the Coordinate System
|
NetcdfDataset |
getNetcdfDataset()
Get the underlying NetcdfDataset
|
CoordinateAxis |
getPressureAxis()
get the CoordinateAxis with AxisType.Pressure, or null if none.
|
ProjectionImpl |
getProjection()
Get the Projection for this coordinate system.
|
ProjectionCT |
getProjectionCT()
Find the first ProjectionCT from the list of CoordinateTransforms.
|
CoordinateAxis |
getRadialAxis()
get the CoordinateAxis with AxisType.RadialDistance, or null if none.
|
int |
getRankDomain()
Get the domain rank of the coordinate system = number of dimensions it is a function of.
|
int |
getRankRange()
Get the range rank of the coordinate system = number of coordinate axes.
|
CoordinateAxis |
getTaxis()
get the CoordinateAxis with AxisType.Time, or null if none.
|
CoordinateAxis |
getXaxis()
get the CoordinateAxis with AxisType.GeoX, or null if none.
|
CoordinateAxis |
getYaxis()
get the CoordinateAxis with AxisType.GeoY, or null if none.
|
CoordinateAxis |
getZaxis()
get the CoordinateAxis with AxisType.GeoZ, or null if none.
|
int |
hashCode()
Override Object.hashCode() to implement equals.
|
boolean |
hasTimeAxis()
true if has Time axis
|
boolean |
hasVerticalAxis()
true if has Height, Pressure, or GeoZ axis
|
boolean |
isComplete(Variable v)
Check if this Coordinate System is complete for v, ie if all its dimensions are also used by v.
|
boolean |
isCoordinateSystemFor(Variable v)
Check if this Coordinate System can be used for the given variable.
|
boolean |
isGeoReferencing()
true if isGeoXY or isLatLon
|
boolean |
isGeoXY()
true if it has X and Y CoordinateAxis, and a CoordTransform Projection
|
boolean |
isImplicit()
Implicit Coordinate System are constructed based on which Coordinate Variables exist for the Dimensions of the
Variable.
|
boolean |
isLatLon()
true if it has Lat and Lon CoordinateAxis
|
boolean |
isProductSet()
true if all axes are CoordinateAxis1D
|
boolean |
isRadial()
true if it has radial distance and azimuth CoordinateAxis
|
boolean |
isRegular()
true if all axes are CoordinateAxis1D and are regular
|
static boolean |
isSubset(Collection<Dimension> subset,
Collection<Dimension> set)
Test if all the Dimensions in subset are in set
|
static boolean |
isSubset(Set<String> subset,
Set<String> set) |
static Set<Dimension> |
makeDomain(Iterable<? extends Variable> axes) |
static String |
makeName(List<CoordinateAxis> axes)
Create standard name from list of axes.
|
CoordinateSystem.Builder<?> |
toBuilder() |
String |
toString() |
@Deprecated public CoordinateSystem(NetcdfDataset ds, Collection<CoordinateAxis> axes, Collection<CoordinateTransform> coordTrans)
ds
- the containing datasetaxes
- Collection of type CoordinateAxis, must be at least one.coordTrans
- Collection of type CoordinateTransform, may be empty or null.public static String makeName(List<CoordinateAxis> axes)
axes
- list of CoordinateAxis@Deprecated public void addCoordinateTransform(CoordinateTransform ct)
ct
- add this CoordinateTransform@Deprecated public void addCoordinateTransforms(Collection<CoordinateTransform> ct)
ct
- add all CoordinateTransform in this collectionpublic List<CoordinateAxis> getCoordinateAxes()
public List<CoordinateTransform> getCoordinateTransforms()
public String getName()
public NetcdfDataset getNetcdfDataset()
public Collection<Dimension> getDomain()
public int getRankDomain()
public int getRankRange()
public CoordinateAxis findAxis(AxisType type)
type
- look for this axisTypepublic CoordinateAxis getXaxis()
public CoordinateAxis getYaxis()
public CoordinateAxis getZaxis()
public CoordinateAxis getTaxis()
public CoordinateAxis getLatAxis()
public CoordinateAxis getLonAxis()
public CoordinateAxis getHeightAxis()
public CoordinateAxis getPressureAxis()
public CoordinateAxis getEnsembleAxis()
public CoordinateAxis getAzimuthAxis()
public CoordinateAxis getRadialAxis()
public CoordinateAxis getElevationAxis()
public ProjectionCT getProjectionCT()
public ProjectionImpl getProjection()
public boolean isGeoXY()
public boolean isLatLon()
public boolean isRadial()
public boolean isGeoReferencing()
public boolean isProductSet()
public boolean isRegular()
public boolean isComplete(Variable v)
v
- check for this variablepublic boolean isCoordinateSystemFor(Variable v)
v
- check for this variablepublic static boolean isSubset(Collection<Dimension> subset, Collection<Dimension> set)
subset
- is this a subsetset
- of this?public static int countDomain(Variable[] axes)
public boolean isImplicit()
public boolean hasVerticalAxis()
public boolean hasTimeAxis()
public boolean containsAxes(List<CoordinateAxis> wantAxes)
wantAxes
- List of CoordinateAxispublic boolean containsAxis(String axisName)
axisName
- (full unescaped) name of axispublic boolean containsDomain(List<Dimension> wantDimensions)
wantDimensions
- List of Dimensionspublic boolean containsAxisTypes(List<AxisType> wantAxes)
wantAxes
- List of AxisTypepublic boolean containsAxisType(AxisType wantAxisType)
wantAxisType
- want this AxisTypepublic boolean equals(Object oo)
public int hashCode()
public CoordinateSystem.Builder<?> toBuilder()
public static CoordinateSystem.Builder<?> builder()