DODSStructure( DODSNetcdfFile dodsfile, Group parentGroup, Structure parentStructure, String shortName, DArray dodsArray, DodsV dodsV) throws IOException { this( dodsfile, parentGroup, parentStructure, shortName, dodsV); List<Dimension> dims = dodsfile.constructDimensions( parentGroup, dodsArray); setDimensions(dims); setSPobject(dodsV); }
DODSVariable( DODSNetcdfFile dodsfile, Group parentGroup, Structure parentStructure, String dodsShortName, DodsV dodsV) { super(dodsfile, parentGroup, parentStructure, DODSNetcdfFile.makeShortName(dodsShortName)); setDODSName(DODSNetcdfFile.makeDODSName(dodsShortName)); this.dodsfile = dodsfile; setSPobject(dodsV); }
protected DODSAttribute(String dodsName, String val) { super(DODSNetcdfFile.makeShortName(dodsName), val); setDODSName(DODSNetcdfFile.makeDODSName(dodsName)); }
@org.junit.Test public void testGrid() throws IOException { DODSNetcdfFile dodsfile = TestDODSRead.open("test.06"); Variable v = null; assert(null != (v = dodsfile.findVariable("OneD"))); checkVariable(v); assert(null != (v = dodsfile.findVariable("x"))); checkVariable(v); assert(null != (v = dodsfile.findVariable("y"))); checkVariable(v); assert(null != (v = dodsfile.findVariable("FourD"))); assert v instanceof DODSGrid; checkVariable2(v); }
@Test public void testScalarReadUncached() throws IOException { DODSNetcdfFile.setPreload( false); DODSNetcdfFile dodsfile = TestDODSRead.open("test.04"); DODSNetcdfFile.setPreload( true); Variable v = null; assert null != (v = dodsfile.findVariable("types")); assert v instanceof Structure; v.setCaching(false); scalarRead((Structure) v); }
@org.junit.Test public void testGrid() throws IOException { DODSNetcdfFile dodsfile = TestDODSRead.open("test.06a"); Variable v = null; // arrays assert(null != (v = dodsfile.findVariable("OneD"))); assert v instanceof DODSVariable; checkArray(v); // map assert(null != (v = dodsfile.findVariable("x"))); checkArray(v); }
@Test public void testScalarRead() throws IOException { DODSNetcdfFile dodsfile = TestDODSRead.open("test.04"); Variable v = null; assert null != (v = dodsfile.findVariable("types")); assert v instanceof Structure; scalarRead((Structure) v); }
@org.junit.Test public void testStructureRead() throws IOException { DODSNetcdfFile dodsfile = TestDODSRead.open("test.04"); Variable v = null; Array a = null; assert null != (v = dodsfile.findVariable("types")); assert v instanceof Structure; Structure s = (Structure) v; StructureData sdata = s.readStructure(); checkSD( sdata); }
String getNetcdfShortName() { return DODSNetcdfFile.makeShortName(getClearName()); }
protected DODSVariable(DODSVariable from) { super(from); setDODSName(from.getDODSName()); dodsfile = from.dodsfile; CE = from.CE; }
/** Copy constructor. * @param from copy from this */ private DODSStructure( DODSStructure from) { // boolean reparent) { super( from); dodsfile = from.dodsfile; setDODSName(from.getDODSName()); ds = from.ds; }
DataType getDataType() { if (bt == null) throw new IllegalStateException("DodsV.bt == null"); if (bt instanceof DGrid) return DODSNetcdfFile.convertToNCType(elemType, isUnsigned()); else return DODSNetcdfFile.convertToNCType(bt, isUnsigned()); }
static private void test(String url) throws IOException, ParseException, DAP2Exception, InvalidRangeException { testDataDDSfromServer(url, ""); testArray(url); }
@BeforeClass public static void setUp() throws Exception { DODSNetcdfFile.setPreload(false); dodsfile = TestDODSRead.open("test.53"); DODSNetcdfFile.setPreload(true); }
private void assignSequence(DodsV root) { for (DodsV nested : children) { nested.assignSequence(root); nested.seq = root.nextInSequence; nextInSequence++; } }
@Override protected Variable copy() { return new DODSVariable(this); }
@Override protected Variable copy() { return new DODSStructure(this); // dont need to reparent }
public static void main(String args[]) throws IOException, DAP2Exception { // doit("http://localhost:8080/thredds/dodsC/ncdodsTest/conventions/zebra/SPOL_3Volumes.nc"); doit("http://iridl.ldeo.columbia.edu/SOURCES/.CAYAN/dods"); }
@Override protected Variable copy() { return new DODSGrid(this); }
static DODSNetcdfFile open(String name) throws IOException { String filename = TestSources.XURL1 + "/" + name; return openAbs( filename); }