public CoverageCoordAxis1D getTimeAxisForRun(CalendarDate rundate) { double rundateTarget = runCoord.convert(rundate); int run_index = new CoordAxisHelper(runCoord).findCoordElement(rundateTarget, false); // LOOK not Bounded return (run_index < 0 || run_index >= runCoord.getNcoords()) ? null : getTimeAxisForRun(run_index); }
public CoverageTransform getHorizTransform() { for (String name : getTransformNames()) { CoverageTransform ct = dataset.findCoordTransform(name); if (ct != null && ct.isHoriz()) return ct; } return null; }
public Object getCoordObject(int index) { if (axisType == AxisType.RunTime) return makeDate(getCoordMidpoint(index)); if (isInterval()) return new double[]{getCoordEdge1(index), getCoordEdge2(index)}; return getCoordMidpoint(index); }
public Coverage(Coverage from, CoverageCoordSys coordSysSubset) { this.name = from.getName(); this.dataType = from.getDataType(); this.atts = from.atts; this.units = from.getUnitsString(); this.description = from.getDescription(); this.coordSysName = (coordSysSubset != null) ? coordSysSubset.getName() : from.coordSysName; this.reader = from.reader; this.user = from.user; }
public boolean isRegularSpatial() { CoverageCoordAxis xaxis = getXAxis(); CoverageCoordAxis yaxis = getYAxis(); if (xaxis == null || !(xaxis instanceof CoverageCoordAxis1D) || !xaxis.isRegular()) return false; if (yaxis == null || !(yaxis instanceof CoverageCoordAxis1D) || !yaxis.isRegular()) return false; return true; }
@Override public int[] getShape() { if (runAxis.isScalar()) return new int[] {timeOffset.getNcoords()}; else return new int[] {runAxis.getNcoords(), timeOffset.getNcoords()}; }
public HorizCoordSys makeHorizCoordSys() { CoverageCoordAxis xaxis = getAxis(AxisType.GeoX); CoverageCoordAxis yaxis = getAxis(AxisType.GeoY); CoverageCoordAxis lataxis = getAxis(AxisType.Lat); CoverageCoordAxis lonaxis = getAxis(AxisType.Lon); CoverageTransform hct = getHorizTransform(); return HorizCoordSys.factory((CoverageCoordAxis1D) xaxis, (CoverageCoordAxis1D) yaxis, lataxis, lonaxis, hct); }
public CoverageCoordAxis getZAxis() { for (String axisName : getAxisNames()) { CoverageCoordAxis axis = dataset.findCoordAxis(axisName); if (axis == null) throw new IllegalStateException("Cant find axis with name "+axisName); if (axis.getAxisType() == AxisType.GeoZ || axis.getAxisType() == AxisType.Height || axis.getAxisType() == AxisType.Pressure) return axis; } return null; }
public ProjectionImpl getProjection() { for (String ctName : getTransformNames()) { CoverageTransform ct = dataset.findCoordTransform(ctName); if (ct != null && ct.isHoriz()) return ct.getProjection(); } return new LatLonProjection(); }
@Override public CoverageCoordAxis copy() { return new TimeOffsetAxis(new CoverageCoordAxisBuilder(this)); }
@Override public CoverageCoordAxis copy() { return new CoverageCoordAxis1D(new CoverageCoordAxisBuilder(this)); }
@Override public CoverageCoordAxis copy() { return new TimeAxis2DFmrc(new CoverageCoordAxisBuilder(this)); }
@Override public CoverageCoordAxis copy() { return new LatLonAxis2D(new CoverageCoordAxisBuilder(this)); }
@Override public CoverageCoordAxis copy() { return new TimeAxis2DSwath(new CoverageCoordAxisBuilder(this)); }
@Override public CoverageCoordAxis copy() { return new TimeAxis2DFmrcReg(new CoverageCoordAxisBuilder(this)); }
public int[] getShape() { if (getDependenceType() == CoverageCoordAxis.DependenceType.scalar) return new int[0]; return new int[]{ncoords}; }
public SubsetParams next() { SubsetParams next = currentElement(); done++; if (done < total) incr(); // increment for next call return next; }
private void incr() { int digit = getRank() - 1; while (digit >= 0) { odo[digit]++; if (odo[digit] < shape[digit]) break; // normal exit // else, carry to next digit in the odometer odo[digit] = 0; digit--; } }
public CoverageCoordAxis getAxis(AxisType type) { for (String axisName : getAxisNames()) { CoverageCoordAxis axis = dataset.findCoordAxis(axisName); if (axis == null) throw new IllegalStateException("Cant find axis with name "+axisName); else if (axis.getAxisType() == type) { return axis; } } return null; }