public VariableSimpleIF getDataVariable(String shortName) { return ncd.getRootGroup().findVariable(shortName); }
public VariableSimpleIF getDataVariable(String shortName) { return ncd.getRootGroup().findVariable(shortName); }
public List getAttributes() { return ncd.getRootGroup().getAttributes(); }
public VariableSimpleIF getDataVariable(String shortName) { return ds.getRootGroup().findVariable(shortName); }
public List getAttributes() { return ncd.getRootGroup().getAttributes(); }
/** * Copy contents of "src" to "target". skip ones that already exist (by name). * Dimensions and Variables are replaced with equivalent elements, but unlimited dimensions are turned into regular dimensions. * Attribute doesnt have to be replaced because its immutable, so its copied by reference. * * @param src transfer from here. If src is a NetcdfDataset, transferred variables get reparented to target group. * @param target transfer to this NetcdfDataset. * @param replaceCheck if null, add if a Variable of the same name doesnt already exist, otherwise * replace if replaceCheck.replace( Variable v) is true */ static public void transferDataset(NetcdfFile src, NetcdfDataset target, ReplaceVariableCheck replaceCheck) { transferGroup(src, target, src.getRootGroup(), target.getRootGroup(), replaceCheck); }
protected void setDatasetAcquireProxy(Dataset typicalDataset, NetcdfDataset newds) throws IOException { DatasetProxyReader proxy = new DatasetProxyReader(typicalDataset); setDatasetAcquireProxy( proxy, newds.getRootGroup()); }
/** * Copy contents of "src" to "target". skip ones that already exist (by name). * Dimensions and Variables are replaced with equivalent elements, but unlimited dimensions are turned into regular dimensions. * Attribute doesnt have to be replaced because its immutable, so its copied by reference. * * @param src transfer from here. If src is a NetcdfDataset, transferred variables get reparented to target group. * @param target transfer to this NetcdfDataset. * @param replaceCheck if null, add if a Variable of the same name doesnt already exist, otherwise * replace if replaceCheck.replace( Variable v) is true */ static public void transferDataset(NetcdfFile src, NetcdfDataset target, ReplaceVariableCheck replaceCheck) { transferGroup(src, target, src.getRootGroup(), target.getRootGroup(), replaceCheck); }
/** * All non-agg variables use a proxy to acquire the file before reading. * If the variable is caching, read data into cache now. * If not caching, VariableEnhanced.setProxyReader() is called. * * @param typicalDataset read from a "typical dataset" * @param newds containing dataset * @throws IOException on i/o error */ protected void setDatasetAcquireProxy(Dataset typicalDataset, NetcdfDataset newds) throws IOException { DatasetProxyReader proxy = new DatasetProxyReader(typicalDataset); setDatasetAcquireProxy( proxy, newds.getRootGroup()); }
/** * Copy contents of "src" to "target". skip ones that already exist (by name). * Dimensions and Variables are replaced with equivalent elements, but unlimited dimensions are turned into regular dimensions. * Attribute doesnt have to be replaced because its immutable, so its copied by reference. * * @param src transfer from here. If src is a NetcdfDataset, transferred variables get reparented to target group. * @param target transfer to this NetcdfDataset. * @param replaceCheck if null, add if a Variable of the same name doesnt already exist, otherwise * replace if replaceCheck.replace( Variable v) is true */ static public void transferDataset(NetcdfFile src, NetcdfDataset target, ReplaceVariableCheck replaceCheck) { transferGroup(src, target, src.getRootGroup(), target.getRootGroup(), replaceCheck); }
protected void setDatasetAcquireProxy(Dataset typicalDataset, NetcdfDataset newds) throws IOException { DatasetProxyReader proxy = new DatasetProxyReader(typicalDataset); setDatasetAcquireProxy( proxy, newds.getRootGroup()); }
/** * Debugging * * @param out write here * @param ncd info about this */ public static void debugDump(PrintWriter out, NetcdfDataset ncd) { String referencedLocation = ncd.orgFile == null ? "(null)" : ncd.orgFile.getLocation(); out.println("\nNetcdfDataset dump = " + ncd.getLocation() + " url= " + referencedLocation + "\n"); ncd.dumpClasses(ncd.getRootGroup(), out); }
/** * Debugging * * @param out write here * @param ncd info about this */ public static void debugDump(PrintStream out, NetcdfDataset ncd) { String referencedLocation = ncd.orgFile == null ? "(null)" : ncd.orgFile.getLocation(); out.println("\nNetcdfDataset dump = " + ncd.getLocation() + " url= " + referencedLocation + "\n"); ncd.dumpClasses(ncd.getRootGroup(), out); }
/** * Debugging * * @param out write here * @param ncd info about this */ public static void debugDump(PrintWriter out, NetcdfDataset ncd) { String referencedLocation = ncd.orgFile == null ? "(null)" : ncd.orgFile.getLocation(); out.println("\nNetcdfDataset dump = " + ncd.getLocation() + " url= " + referencedLocation + "\n"); ncd.dumpClasses(ncd.getRootGroup(), out); }
public void augmentDataset(NetcdfDataset ds, CancelTask cancelTask) throws IOException { addTimeCoord = addTimeCoordinate(ds); augmentGroup(ds, ds.getRootGroup()); ds.addAttribute(ds.getRootGroup(), new Attribute(CDM.CONVENTIONS, "CF-1.0")); ds.finish(); }
public void augmentDataset(NetcdfDataset ds, CancelTask cancelTask) throws IOException { addTimeCoord = addTimeCoordinate(ds); augmentGroup(ds, ds.getRootGroup()); ds.addAttribute(ds.getRootGroup(), new Attribute(CDM.CONVENTIONS, "CF-1.0")); ds.finish(); }
public void augmentDataset(NetcdfDataset ds, CancelTask cancelTask) throws IOException { addTimeCoord = addTimeCoordinate(ds); augmentGroup(ds, ds.getRootGroup()); ds.addAttribute(ds.getRootGroup(), new Attribute(CDM.CONVENTIONS, "CF-1.0")); ds.finish(); }
protected void rebuildDataset() throws IOException { super.rebuildDataset(); if (timeUnitsChange) { VariableDS joinAggCoord = (VariableDS) ncDataset.getRootGroup().findVariable(dimName); readTimeCoordinates(joinAggCoord, null); } }
protected void rebuildDataset() throws IOException { super.rebuildDataset(); if (timeUnitsChange) { VariableDS joinAggCoord = (VariableDS) ncDataset.getRootGroup().findVariable(dimName); readTimeCoordinates(joinAggCoord, null); } }
@Test public void test_true_degrees() throws IOException { // Make sure we return grib units of "degree true" as "degree_true" String filename = "tds/ncep/NDFD_CONUS_5km_20140805_1200.grib2"; try (NetcdfDataset ds = NetcdfDataset.openDataset(TestDir.cdmUnitTestDir + filename)) { Group grp = ds.getRootGroup(); Assert.assertNotNull(grp); Variable var = grp.findVariable("Wind_direction_from_which_blowing_height_above_ground"); Assert.assertNotNull(var); Attribute att = var.findAttribute("units"); Assert.assertNotNull(att); Assert.assertEquals("degree_true", att.getStringValue()); } }