String candidateDimension = variableDS.getDimensions().get(0).getFullName(); MultipleBandsDimensionInfo multipleBands = reader.ancillaryFileManager.getMultipleBandsDimensionInfo(candidateDimension);
String candidateDimension = wrapper.variableDS.getDimensions().get(0).getFullName(); MultipleBandsDimensionInfo multipleBands = ancillaryFileManager.getMultipleBandsDimensionInfo(candidateDimension);
private int findDimension(Dimension want) { java.util.List dims = vs.getDimensions(); for (int i = 0; i < dims.size(); i++) { Dimension d = (Dimension) dims.get(i); if (d.equals(want)) return i; } return -1; }
private int findDimension(Dimension want) { java.util.List dims = vs.getDimensions(); for (int i = 0; i < dims.size(); i++) { Dimension d = (Dimension) dims.get(i); if (d.equals(want)) return i; } return -1; }
private int findDimension(Dimension want) { java.util.List dims = vs.getDimensions(); for (int i = 0; i < dims.size(); i++) { Dimension d = (Dimension) dims.get(i); if (d.equals(want)) return i; } return -1; }
private int findDimension(Dimension want) { java.util.List dims = vs.getDimensions(); for (int i = 0; i < dims.size(); i++) { Dimension d = (Dimension) dims.get(i); if (d.equals(want)) return i; } return -1; }
private boolean checkCoordinates(NetcdfDataset ds, EncodingInfo info, Formatter errlog) { boolean ok = true; info.time = CoordSysEvaluator.findCoordByType(ds, AxisType.Time); if (info.time == null) { errlog.format("CFpointObs cant find a Time coordinate %n"); ok = false; } // find lat coord info.lat = CoordSysEvaluator.findCoordByType(ds, AxisType.Lat); if (info.lat == null) { errlog.format("CFpointObs cant find a Latitude coordinate %n"); ok = false; } // find lon coord info.lon = CoordSysEvaluator.findCoordByType(ds, AxisType.Lon); if (info.lon == null) { errlog.format("CFpointObs cant find a Longitude coordinate %n"); ok = false; } if (!ok) return false; // dimensions must match List<Dimension> dimLat = info.lat.getDimensions(); List<Dimension> dimLon = info.lon.getDimensions(); if (!dimLat.equals(dimLon)) { errlog.format("CFpointObs Lat, Lon coordinate dimensions must match lat=%s lon=%s %n", info.lat.getNameAndDimensions(), info.lon.getNameAndDimensions()); ok = false; } return ok; }
protected boolean checkCoordinates(NetcdfDataset ds, EncodingInfo info, Formatter errlog) { boolean ok = true; info.time = CoordSysEvaluator.findCoordByType(ds, AxisType.Time); if (info.time == null) { errlog.format("CFpointObs cant find a Time coordinate %n"); ok = false; } // find lat coord info.lat = CoordSysEvaluator.findCoordByType(ds, AxisType.Lat); if (info.lat == null) { errlog.format("CFpointObs cant find a Latitude coordinate %n"); ok = false; } // find lon coord info.lon = CoordSysEvaluator.findCoordByType(ds, AxisType.Lon); if (info.lon == null) { errlog.format("CFpointObs cant find a Longitude coordinate %n"); ok = false; } if (!ok) return false; // dimensions must match List<Dimension> dimLat = info.lat.getDimensions(); List<Dimension> dimLon = info.lon.getDimensions(); if (!dimLat.equals(dimLon)) { errlog.format("CFpointObs Lat, Lon coordinate dimensions must match lat=%s lon=%s %n", info.lat.getNameAndDimensions(), info.lon.getNameAndDimensions()); ok = false; } return ok; }
protected boolean checkCoordinates(NetcdfDataset ds, EncodingInfo info, Formatter errlog) { boolean ok = true; info.time = CoordSysEvaluator.findCoordByType(ds, AxisType.Time); if (info.time == null) { errlog.format("CFpointObs cant find a Time coordinate %n"); ok = false; } // find lat coord info.lat = CoordSysEvaluator.findCoordByType(ds, AxisType.Lat); if (info.lat == null) { errlog.format("CFpointObs cant find a Latitude coordinate %n"); ok = false; } // find lon coord info.lon = CoordSysEvaluator.findCoordByType(ds, AxisType.Lon); if (info.lon == null) { errlog.format("CFpointObs cant find a Longitude coordinate %n"); ok = false; } if (!ok) return false; // dimensions must match List<Dimension> dimLat = info.lat.getDimensions(); List<Dimension> dimLon = info.lon.getDimensions(); if (!dimLat.equals(dimLon)) { errlog.format("CFpointObs Lat, Lon coordinate dimensions must match lat=%s lon=%s %n", info.lat.getNameAndDimensions(), info.lon.getNameAndDimensions()); ok = false; } return ok; }
List<Dimension> oldDims = vs.getDimensions(); int[] permuteIndex = new int[vs.getRank()]; int count = 0;
List dims = var.getDimensions(); for (int i=0; i<dims.size(); i++) { Dimension dim = (Dimension) dims.get(i);
List dims = var.getDimensions(); for (int i=0; i<dims.size(); i++) { Dimension dim = (Dimension) dims.get(i);
List dims = var.getDimensions(); for (int i=0; i<dims.size(); i++) { Dimension dim = (Dimension) dims.get(i);
public GridDatatype makeSubset(Range rt_range, Range e_range, Range t_range, Range z_range, Range y_range, Range x_range) throws InvalidRangeException { // get the ranges list int rank = getRank(); Range[] ranges = new Range[rank]; if (null != getXDimension()) ranges[xDimOrgIndex] = x_range; if (null != getYDimension()) ranges[yDimOrgIndex] = y_range; if (null != getZDimension()) ranges[zDimOrgIndex] = z_range; if (null != getTimeDimension()) ranges[tDimOrgIndex] = t_range; if (null != getRunTimeDimension()) ranges[rtDimOrgIndex] = rt_range; if (null != getEnsembleDimension()) ranges[eDimOrgIndex] = e_range; List<Range> rangesList = Arrays.asList(ranges); // subset the variable VariableDS v_section = (VariableDS) vs.section( new Section(rangesList)); List<Dimension> dims = v_section.getDimensions(); for (Dimension dim : dims) { dim.setShared(true); // make them shared (section will make them unshared) } // subset the axes in the GridCoordSys GridCoordSys gcs_section = new GridCoordSys(gcs, rt_range, e_range, t_range, z_range, y_range, x_range); // now we can make the geogrid return new GeoGrid(dataset, v_section, gcs_section); }
public GridDatatype makeSubset(Range rt_range, Range e_range, Range t_range, Range z_range, Range y_range, Range x_range) throws InvalidRangeException { // get the ranges list int rank = getRank(); Range[] ranges = new Range[rank]; if (null != getXDimension()) ranges[xDimOrgIndex] = x_range; if (null != getYDimension()) ranges[yDimOrgIndex] = y_range; if (null != getZDimension()) ranges[zDimOrgIndex] = z_range; if (null != getTimeDimension()) ranges[tDimOrgIndex] = t_range; if (null != getRunTimeDimension()) ranges[rtDimOrgIndex] = rt_range; if (null != getEnsembleDimension()) ranges[eDimOrgIndex] = e_range; List<Range> rangesList = Arrays.asList(ranges); // subset the variable VariableDS v_section = (VariableDS) vs.section( new Section(rangesList)); List<Dimension> dims = v_section.getDimensions(); for (Dimension dim : dims) { dim.setShared(true); // make them shared (section will make them unshared) } // subset the axes in the GridCoordSys GridCoordSys gcs_section = new GridCoordSys(gcs, rt_range, e_range, t_range, z_range, y_range, x_range); // now we can make the geogrid return new GeoGrid(dataset, v_section, gcs_section); }
public GridDatatype makeSubset(Range rt_range, Range e_range, Range t_range, Range z_range, Range y_range, Range x_range) throws InvalidRangeException { // get the ranges list int rank = getRank(); Range[] ranges = new Range[rank]; if (null != getXDimension()) ranges[xDimOrgIndex] = x_range; if (null != getYDimension()) ranges[yDimOrgIndex] = y_range; if (null != getZDimension()) ranges[zDimOrgIndex] = z_range; if (null != getTimeDimension()) ranges[tDimOrgIndex] = t_range; if (null != getRunTimeDimension()) ranges[rtDimOrgIndex] = rt_range; if (null != getEnsembleDimension()) ranges[eDimOrgIndex] = e_range; List<Range> rangesList = Arrays.asList(ranges); // subset the variable VariableDS v_section = (VariableDS) vs.section( new Section(rangesList)); List<Dimension> dims = v_section.getDimensions(); for (Dimension dim : dims) { dim.setShared(true); // make them shared (section will make them unshared) } // subset the axes in the GridCoordSys GridCoordSys gcs_section = new GridCoordSys(gcs, rt_range, e_range, t_range, z_range, y_range, x_range); // now we can make the geogrid return new GeoGrid(dataset, v_section, gcs_section); }
for (Dimension d : info.lat.getDimensions()) { if (!d.equals(obsDim)) { info.set(Encoding.multidim, d, obsDim);
for (Dimension d : info.lat.getDimensions()) { if (!d.equals(obsDim)) { info.set(Encoding.multidim, d, obsDim);
@Test public void testCoordinateSystemDomain() throws Exception { System.err.printf("%nOpen %s grid='%s'%n", filename, gridName); Grib.setDebugFlags(new DebugFlagsImpl("Grib/indexOnly")); try (NetcdfDataset ncd = NetcdfDataset.openDataset(filename)) { Assert.assertNotNull( filename, ncd); VariableDS vds = (VariableDS) ncd.findVariable(gridName); Assert.assertNotNull( gridName, vds); for (CoordinateSystem cs : vds.getCoordinateSystems()) { System.err.printf(" CoordinateSystem= '%s'%n", cs); testDomain("CoordinateSystem ", vds.getDimensions(), cs.getCoordinateAxes()); } } finally { Grib.setDebugFlags(new DebugFlagsImpl("")); } }
for (Dimension d : info.lat.getDimensions()) { if (!d.equals(obsDim)) { info.set(Encoding.multidim, d, obsDim);