public boolean isHighResolution(NetcdfDataset nds) { // return true; Dimension r = nds.findDimension("scanR_HI"); Dimension v = nds.findDimension("scanV_HI"); if(r != null || v != null) return true; else return false; }
public boolean isHighResolution(NetcdfDataset nds) { // return true; Dimension r = nds.findDimension("scanR_HI"); Dimension v = nds.findDimension("scanV_HI"); if(r != null || v != null) return true; else return false; }
public boolean isHighResolution(NetcdfDataset nds) { // return true; Dimension r = nds.findDimension("scanR_HI"); Dimension v = nds.findDimension("scanV_HI"); if(r != null || v != null) return true; else return false; }
public Dimension findDimension(String name) { return ncd.findDimension(name); }
private Dimension findDimension(NetcdfDataset ds, String name) { Dimension result = ds.findDimension(name); if (result == null) { String aname = ds.findAttValueIgnoreCase(null, name+"Dimension", null); if (aname != null) result = ds.findDimension(aname); } return result; }
public boolean isMine(NetcdfDataset ds) { String format = ds.findAttValueIgnoreCase(null, "format", null); if(format != null) { if(format.startsWith("nssl/netcdf")) return true; } Dimension az = ds.findDimension("Azimuth"); Dimension gt = ds.findDimension("Gate"); if ((null != az) && (null != gt)) { return true; } return false; }
public Object isMine(FeatureType wantFeatureType, NetcdfDataset ncd, Formatter errlog) throws IOException { String format = ncd.findAttValueIgnoreCase(null, "format", null); if (format != null) { if (format.startsWith("nssl/netcdf")) return this; } Dimension az = ncd.findDimension("Azimuth"); Dimension gt = ncd.findDimension("Gate"); if ((null != az) && (null != gt)) { return this; } return null; }
public boolean isMine(NetcdfDataset ds) { String format = ds.findAttValueIgnoreCase(null, "format", null); if(format != null) { if(format.startsWith("nssl/netcdf")) return true; } Dimension az = ds.findDimension("Azimuth"); Dimension gt = ds.findDimension("Gate"); if ((null != az) && (null != gt)) { return true; } return false; }
TableMultidimInnerPsuedo(NetcdfDataset ds, TableConfig config) { super(ds, config); assert config.outerName != null; assert config.innerName != null; this.inner = ds.findDimension(config.innerName); this.outer = ds.findDimension(config.outerName); sm = new StructureMembers(config.name); for (Variable v : struct.getVariables()) { int rank = v.getRank(); int[] shape = new int[rank - 1]; System.arraycopy(v.getShape(), 1, shape, 0, rank - 1); sm.addMember(v.getShortName(), v.getDescription(), v.getUnitsString(), v.getDataType(), shape); } }
TableMultidimInnerPsuedo(NetcdfDataset ds, TableConfig config) { super(ds, config); assert config.outerName != null; assert config.innerName != null; this.inner = ds.findDimension(config.innerName); this.outer = ds.findDimension(config.outerName); sm = new StructureMembers(config.name); for (Variable v : struct.getVariables()) { int rank = v.getRank(); int[] shape = new int[rank - 1]; System.arraycopy(v.getShape(), 1, shape, 0, rank - 1); sm.addMember(v.getShortName(), v.getDescription(), v.getUnitsString(), v.getDataType(), shape); } replaceDataVars(sm); }
TableMultidimInnerPsuedo(NetcdfDataset ds, TableConfig config) { super(ds, config); assert config.outerName != null; assert config.innerName != null; this.inner = ds.findDimension(config.innerName); this.outer = ds.findDimension(config.outerName); sm = new StructureMembers(config.name); for (Variable v : struct.getVariables()) { int rank = v.getRank(); int[] shape = new int[rank - 1]; System.arraycopy(v.getShape(), 1, shape, 0, rank - 1); sm.addMember(v.getShortName(), v.getDescription(), v.getUnitsString(), v.getDataType(), shape); } replaceDataVars(sm); }
public boolean isMine(FeatureType wantFeatureType, NetcdfDataset ds) { if ((wantFeatureType != FeatureType.ANY_POINT) && (wantFeatureType != FeatureType.TRAJECTORY)) return false; String title = ds.findAttValueIgnoreCase(null, "title", null); if ((title == null) || !title.equals("MADIS ACARS data")) return false; if (!ds.hasUnlimitedDimension()) return false; if (ds.findDimension("recNum") == null) return false; VNames vn = getVariableNames(ds, null); if (ds.findVariable(vn.lat) == null) return false; if (ds.findVariable(vn.lon) == null) return false; if (ds.findVariable(vn.obsTime) == null) return false; if (ds.findVariable(TRAJ_ID) == null) return false; return true; }
public boolean isMine(FeatureType wantFeatureType, NetcdfDataset ds) { if ((wantFeatureType != FeatureType.ANY_POINT) && (wantFeatureType != FeatureType.TRAJECTORY)) return false; String title = ds.findAttValueIgnoreCase(null, "title", null); if ((title == null) || !title.equals("MADIS ACARS data")) return false; if (!ds.hasUnlimitedDimension()) return false; if (ds.findDimension("recNum") == null) return false; VNames vn = getVariableNames(ds, null); if (ds.findVariable(vn.lat) == null) return false; if (ds.findVariable(vn.lon) == null) return false; if (ds.findVariable(vn.obsTime) == null) return false; if (ds.findVariable(TRAJ_ID) == null) return false; return true; }
public boolean isMine(FeatureType wantFeatureType, NetcdfDataset ds) { if ((wantFeatureType != FeatureType.ANY_POINT) && (wantFeatureType != FeatureType.TRAJECTORY)) return false; String title = ds.findAttValueIgnoreCase(null, "title", null); if ((title == null) || !title.equals("MADIS ACARS data")) return false; if (!ds.hasUnlimitedDimension()) return false; if (ds.findDimension("recNum") == null) return false; VNames vn = getVariableNames(ds, null); if (ds.findVariable(vn.lat) == null) return false; if (ds.findVariable(vn.lon) == null) return false; if (ds.findVariable(vn.obsTime) == null) return false; if (ds.findVariable(TRAJ_ID) == null) return false; return true; }
@Category(NeedsCdmUnitTest.class) public void testAlias() throws IOException { String filename = TestDir.cdmUnitTestDir + "ft/grid/ensemble/demeter/MM_cnrm_129_red.ncml"; NetcdfDataset ncd = ucar.nc2.dataset.NetcdfDataset.openDataset(filename); Variable v = ncd.findCoordinateAxis("number"); assert v != null; //assert v.isCoordinateVariable(); assert v instanceof CoordinateAxis1D; assert null != ncd.findDimension("ensemble"); assert v.getDimension(0) == ncd.findDimension("ensemble"); ncd.close(); }
@Test public void testHybridSigmaPressure2() throws IOException, InvalidRangeException { String filename = testDir + "climo.cam2.h0.0000-09.nc"; NetcdfDataset ncd = ucar.nc2.dataset.NetcdfDataset.openDataset(filename); VerticalTransform vt = test(ncd, "lev", "T", "time", VerticalCT.Type.HybridSigmaPressure, HybridSigmaPressure.class, SimpleUnit.pressureUnit, true); Dimension timeDim = ncd.findDimension("time"); for (int i = 0; i < timeDim.getLength(); i++) { ucar.ma2.ArrayDouble.D3 coordVals = vt.getCoordinateArray(i); int[] shape = coordVals.getShape(); assert shape[0] == ncd.findDimension("lev").getLength(); assert shape[1] == ncd.findDimension("lat").getLength(); assert shape[2] == ncd.findDimension("lon").getLength(); } ncd.close(); }
private void makeYCoordAxis( NetcdfDataset ds, String units ) { Dimension dim = ds.findDimension( "ROW" ); final String newUnits = units.equals( "m" ) ? "km" : units; String desc = "synthesized y coordinate from YORIG, YCELL global attributes"; CoordinateAxis axis = new CoordinateAxis1D( ds, null, "y", DataType.DOUBLE, dim.getShortName(), newUnits, desc ); final double scale = units.equals("m") ? 0.001 : 1.0;//IDV BUG m->km final double yorig = doubleAttribute( "YORIG" ) * scale; final double ycell = doubleAttribute( "YCELL" ) * scale; ds.setValues(axis, dim.getLength(), yorig, ycell ); axis.addAttribute( new Attribute( CDM.UNITS, newUnits ) ); axis.addAttribute( new Attribute( CDM.LONG_NAME, desc ) ); axis.addAttribute( new Attribute( _Coordinate.AxisType, AxisType.GeoY.toString() ) ); ds.addCoordinateAxis( axis ); }
private void makeXCoordAxis( NetcdfDataset ds, String units ) { Dimension dim = ds.findDimension( "COL" ); final String newUnits = units.equals( "m" ) ? "km" : units; String desc = "synthesized x coordinate from XORIG, XCELL global attributes"; CoordinateAxis axis = new CoordinateAxis1D( ds, null, "x", DataType.DOUBLE, dim.getShortName(), newUnits, desc ); final double scale = units.equals("m") ? 0.001 : 1.0;//IDV BUG m->km final double xorig = doubleAttribute( "XORIG" ) * scale; final double xcell = doubleAttribute( "XCELL" ) * scale; ds.setValues(axis, dim.getLength(), xorig, xcell); axis.addAttribute( new Attribute( CDM.UNITS, newUnits ) ); axis.addAttribute( new Attribute( CDM.LONG_NAME, desc ) ); axis.addAttribute( new Attribute( _Coordinate.AxisType, AxisType.GeoX.toString() ) ); ds.addCoordinateAxis( axis ); }
public boolean isMine(FeatureType wantFeatureType, NetcdfDataset ds) { if ((wantFeatureType != FeatureType.ANY_POINT) && (wantFeatureType != FeatureType.STATION) && (wantFeatureType != FeatureType.POINT) && (wantFeatureType != FeatureType.STATION_PROFILE)) return false; if (!ds.hasUnlimitedDimension()) return false; if (ds.findDimension("recNum") == null) return false; if (ds.findVariable("staticIds") == null) return false; if (ds.findVariable("nStaticIds") == null) return false; if (ds.findVariable("lastRecord") == null) return false; if (ds.findVariable("prevRecord") == null) return false; VNames vn = getVariableNames(ds, null); if (ds.findVariable(vn.lat) == null) return false; if (ds.findVariable(vn.lon) == null) return false; if (ds.findVariable(vn.obsTime) == null) return false; return true; }
public void testMA() throws IOException, InvalidRangeException { NetcdfFile ncfile = TestDir.openFileLocal("jan.nc"); NetcdfDataset ncd = new NetcdfDataset( ncfile); Dimension dim = ncd.findDimension("time"); assert dim != null; Structure p = new ucar.nc2.dataset.StructurePseudoDS( ncd, null, "Psuedo", null, dim); assert( p.getDataType() == DataType.STRUCTURE); Array data = p.read(); assert( data instanceof ArrayStructure); assert( data instanceof ArrayStructureMA); assert(data.getElementType() == StructureData.class); test.testArrayStructure( (ArrayStructure) data); ncfile.close(); }