本文整理匯總了Java中ucar.nc2.dataset.CoordinateAxis2D.getAxisType方法的典型用法代碼示例。如果您正苦於以下問題:Java CoordinateAxis2D.getAxisType方法的具體用法?Java CoordinateAxis2D.getAxisType怎麽用?Java CoordinateAxis2D.getAxisType使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ucar.nc2.dataset.CoordinateAxis2D
的用法示例。
在下文中一共展示了CoordinateAxis2D.getAxisType方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: computeLatMinMax
import ucar.nc2.dataset.CoordinateAxis2D; //導入方法依賴的package包/類
/**
* Compute lat min max.
*
* @param latAxis the lat axis
* @param minj the minj
* @param mini the mini
* @param maxj the maxj
* @param maxi the maxi
* @throws MotuException the motu exception
*/
public void computeLatMinMax(CoordinateAxis2D latAxis, int minj, int mini, int maxj, int maxi) throws MotuException {
if (latAxis == null) {
throw new MotuException(ErrorType.INVALID_LATITUDE, "ERROR in ExtractCriteriaLatLon#computeLatMinMax for CoordinateAxis2D: axis is null");
}
if (latAxis.getAxisType() != AxisType.Lat) {
String msg = String.format(
"ERROR in ExtractCriteriaLatLon#computeLatMinMax for CoordinateAxis2D: axis name '%s' - type is '%s' and expected type is '%s'",
latAxis.getName(),
latAxis.getAxisType().name(),
AxisType.Lat.name());
throw new MotuException(ErrorType.INVALID_LATITUDE, msg);
}
double latMin = Double.MAX_VALUE;
double latMax = -(Double.MAX_VALUE);
for (int j = minj; j <= maxj; j++) {
for (int i = mini; i <= maxi; i++) {
double value = latAxis.getCoordValue(j, i);
if (latMin > value) {
latMin = value;
}
if (latMax < value) {
latMax = value;
}
}
}
minMaxYValue2D = computeMinMax(minMaxYValue2D, new MinMax(latMin, latMax));
}
示例2: computeLonMinMax
import ucar.nc2.dataset.CoordinateAxis2D; //導入方法依賴的package包/類
/**
* Compute lon min max.
*
* @param lonAxis the lon axis
* @param minj the minj
* @param mini the mini
* @param maxj the maxj
* @param maxi the maxi
* @param minx the minx
* @throws MotuException the motu exception
*/
public void computeLonMinMax(CoordinateAxis2D lonAxis, int minj, int mini, int maxj, int maxi, double minx, double maxx) throws MotuException {
if (lonAxis == null) {
throw new MotuException(
ErrorType.INVALID_LONGITUDE,
"ERROR in ExtractCriteriaLatLon#computeLonMinMax for CoordinateAxis2D: axis is null");
}
if (lonAxis.getAxisType() != AxisType.Lon) {
String msg = String.format(
"ERROR in ExtractCriteriaLatLon#computeLonMinMax for CoordinateAxis2D: axis name '%s' - type is '%s' and expected type is '%s'",
lonAxis.getName(),
lonAxis.getAxisType().name(),
AxisType.Lon.name());
throw new MotuException(ErrorType.INVALID_LONGITUDE, msg);
}
double longitudeCenter = (minx + maxx) / 2;
double lonMin = Double.MAX_VALUE;
double lonMax = -(Double.MAX_VALUE);
for (int j = minj; j <= maxj; j++) {
for (int i = mini; i <= maxi; i++) {
double value = lonAxis.getCoordValue(j, i);
if (lonMin > value) {
lonMin = value;
}
if (lonMax < value) {
lonMax = value;
}
if (lonMin < minx) {
lonMin = LatLonPointImpl.lonNormal(lonMin, longitudeCenter);
}
if (lonMax < minx) {
lonMax = LatLonPointImpl.lonNormal(lonMax, longitudeCenter);
}
if (lonMin > lonMax) {
double temp = lonMin;
lonMin = lonMax;
lonMax = temp;
}
}
}
minMaxXValue2D = computeMinMax(minMaxXValue2D, new MinMax(lonMin, lonMax));
}