From baa8aebb82356f6ed09e1697ff0644d23541652d Mon Sep 17 00:00:00 2001 From: Dennis Heimbigner Date: Mon, 21 Oct 2019 11:58:34 -0600 Subject: [PATCH 1/5] ckp --- .../test/java/dap4/test/TestDAP4Client.java | 406 ++++++++++++++++++ .../src/test/java/dap4/test/TestHyrax.java | 1 + 2 files changed, 407 insertions(+) create mode 100644 dap4/d4tests/src/test/java/dap4/test/TestDAP4Client.java diff --git a/dap4/d4tests/src/test/java/dap4/test/TestDAP4Client.java b/dap4/d4tests/src/test/java/dap4/test/TestDAP4Client.java new file mode 100644 index 0000000000..8ddca4ec20 --- /dev/null +++ b/dap4/d4tests/src/test/java/dap4/test/TestDAP4Client.java @@ -0,0 +1,406 @@ +package dap4.test; + +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import ucar.httpservices.HTTPException; +import ucar.httpservices.HTTPFactory; +import ucar.httpservices.HTTPMethod; +import ucar.nc2.dataset.NetcdfDataset; +import ucar.unidata.util.test.UnitTestCommon; +import java.io.IOException; +import java.io.StringWriter; +import java.lang.invoke.MethodHandles; +import java.util.ArrayList; +import java.util.List; + +/** + * Test OpenDap Server at the NetcdfDataset level + */ +public class TestDAP4Client extends DapTestCommon { + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); + + static final boolean DEBUG = false; + + static final boolean BROKEN = false; // on/off known broken tests + + static final boolean BUILDBASELINE = false; + + static final boolean NCDUMP = true; // Use NcDumpW instead of NCPrint + + static final String EXTENSION = (NCDUMP ? "ncdump" : "dmp"); + + static final String TESTEXTENSION = "dmr"; + + // Mnemonic + static final boolean HEADERONLY = false; + + ////////////////////////////////////////////////// + // Constants + + static final String SERVLETPATH = "d4ts/testfiles"; + + static final String DATADIR = "src/test/data"; // relative to dap4 root + static final String BASELINEDIR = "TestDAP4Client/baseline"; + + // Define the names of the xfail tests + static final String[] XFAIL_TESTS = {}; + + static boolean isXfailTest(String t) { + for (String s : XFAIL_TESTS) { + if (s.equals(t)) + return true; + } + return false; + } + + ////////////////////////////////////////////////// + // Type Declarations + + static class Server { + public static String SERVLET = "dts"; + public String ip; + public String port; + + public Server(String ip, String port) { + this.ip = ip; + this.port = port; + } + + public String getURL() { + StringBuilder buf = new StringBuilder(); + buf.append("http://"); + buf.append(this.ip); + if (port != null) { + buf.append(":"); + buf.append(this.port); + } + return buf.toString(); + } + + // Return a URL for testing if server is up/down + public String getTestURL() { + StringBuilder baseurl = new StringBuilder().append(getURL()); + baseurl.append("/"); + baseurl.append(SERVLET); + return baseurl.toString(); + } + + } + + static class ClientTest { + static String root = null; + static String server = null; + static String servlet = null; + static int counter = 0; + + boolean checksumming = true; + boolean xfail = false; + boolean headeronly = false; + + String title; + String dataset; // path minus the server url part. + String baselinepath; + String constraint; + int id; + + ClientTest(String dataset) { + this(0, dataset, null); + } + + ClientTest(int id, String datasetpath, String constraint) { + if (constraint == null) + constraint = ""; + // Break off the final file set name + int index = datasetpath.lastIndexOf('/'); + this.dataset = datasetpath.substring(index + 1, datasetpath.length()); + this.title = this.dataset; + this.id = id; + this.constraint = (constraint.length() == 0 ? null : constraint); + this.baselinepath = root + "/" + BASELINEDIR + "/" + dataset; + if (this.constraint != null) + this.baselinepath += ("." + String.valueOf(this.id)); + } + + public ClientTest nochecksum() { + this.checksumming = false; + return this; + } + + public ClientTest xfail() { + this.xfail = true; + return this; + } + + public ClientTest headeronly() { + this.headeronly = true; + return this; + } + + String makeurl() { + String url = this.server + "/" + this.servlet + "/" + this.dataset; + if (constraint != null) + url += ("?" + constraint); + url += "#dap4"; + return url; + } + + public String toString() { + return dataset; + } + } + + ////////////////////////////////////////////////// + // Class variables + + // Order is important; testing reachability is in the order listed + static List SERVERS; + + static { + SERVERS = new ArrayList<>(); + SERVERS.add(new Server("149.165.169.123", "8080")); + SERVERS.add(new Server("remotetest.unidata.ucar.edu", null)); + } + + ////////////////////////////////////////////////// + // Instance variables + + // Test cases + + List alltestcases = new ArrayList(); + List chosentests = new ArrayList(); + + String datasetpath = null; + + Server server = null; + + ////////////////////////////////////////////////// + + @Before + public void setup() throws Exception { + // Find the server to use + this.server = null; + for (Server svc : SERVERS) { + String url = svc.getTestURL(); + try (HTTPMethod method = HTTPFactory.Get(url)) { + try { + int code = method.execute(); + if (code == 200) { + this.server = svc; + System.out.println("Using server url " + url); + break; + } + } catch (HTTPException e) { + this.server = null; + } + } + } + if (this.server == null) + throw new Exception("Cannot locate server"); + defineAllTestcases(this.getResourceDir(), SERVLETPATH, this.server.getURL()); + chooseTestcases(); + if (BUILDBASELINE) + prop_baseline = true; + } + + ////////////////////////////////////////////////// + // Define test cases + + void chooseTestcases() { + if (false) { + chosentests = locate("test_atomic_types.nc"); + prop_baseline = true; + } else { + for (ClientTest tc : alltestcases) { + chosentests.add(tc); + } + } + } + + boolean defineAllTestcases(String root, String servlet, String server) { + boolean what = HEADERONLY; + ClientTest.root = root; + ClientTest.server = server; + ClientTest.servlet = servlet; + alltestcases.add(new ClientTest("test_atomic_array.nc")); + alltestcases.add(new ClientTest("test_atomic_types.nc")); + alltestcases.add(new ClientTest("test_enum.nc")); + alltestcases.add(new ClientTest("test_enum_2.nc")); + alltestcases.add(new ClientTest("test_enum_array.nc")); + alltestcases.add(new ClientTest("test_enum1.nc")); + alltestcases.add(new ClientTest("test_fill.nc")); + alltestcases.add(new ClientTest("test_groups1.nc")); + if (BROKEN) + alltestcases.add(new ClientTest("test_misc1.nc")); // 0 size unlimited + if (BROKEN) + alltestcases.add(new ClientTest("test_one_var.nc")); // 0 size unlimited + alltestcases.add(new ClientTest("test_one_vararray.nc")); + alltestcases.add(new ClientTest("test_opaque.nc")); + alltestcases.add(new ClientTest("test_opaque_array.nc")); + alltestcases.add(new ClientTest("test_struct_array.nc")); + alltestcases.add(new ClientTest("test_struct_nested.nc")); + alltestcases.add(new ClientTest("test_struct_nested3.nc")); + alltestcases.add(new ClientTest("test_struct_type.nc")); + alltestcases.add(new ClientTest("test_struct1.nc")); + alltestcases.add(new ClientTest("test_test.nc")); + if (BROKEN) + alltestcases.add(new ClientTest("test_unlim.nc")); // ? + if (BROKEN) + alltestcases.add(new ClientTest("test_unlim1.nc")); // ? + if (BROKEN) + alltestcases.add(new ClientTest("test_utf8.nc")); // ? + alltestcases.add(new ClientTest("test_vlen1.nc")); + if (BROKEN) + alltestcases.add(new ClientTest("test_vlen2.nc")); // non scalar vlen + if (BROKEN) + alltestcases.add(new ClientTest("test_vlen3.nc")); // non scalar vlen + if (BROKEN) + alltestcases.add(new ClientTest("test_vlen4.nc")); // non scalar vlen + alltestcases.add(new ClientTest("test_vlen5.nc")); + if (BROKEN) + alltestcases.add(new ClientTest("test_vlen6.nc")); // non-scalar vlen + if (BROKEN) + alltestcases.add(new ClientTest("test_vlen7.nc")); // non-scalar vlen + if (BROKEN) + alltestcases.add(new ClientTest("test_vlen8.nc")); // non-scalar vlen + if (BROKEN) + alltestcases.add(new ClientTest("test_vlen9.nc")); // non-scalar + if (BROKEN) + alltestcases.add(new ClientTest("test_vlen10.nc")); // non-scalar + if (BROKEN) + alltestcases.add(new ClientTest("test_vlen11.nc")); // unknown failure + if (BROKEN) + alltestcases.add(new ClientTest("test_zerodim.nc")); // non-scalar seq + alltestcases.add(new ClientTest("tst_fills.nc")); + for (ClientTest test : alltestcases) { + if (what == HEADERONLY) + test.headeronly(); + } + return true; + } + + ////////////////////////////////////////////////// + // Junit test method + + @Test + public void testDAP4Client() throws Exception { + boolean pass = true; + for (ClientTest testcase : chosentests) { + if (!doOneTest(testcase)) + pass = false; + } + Assert.assertTrue("*** Fail: TestDAP4Client", pass); + } + + ////////////////////////////////////////////////// + // Primary test method + + boolean doOneTest(ClientTest testcase) throws Exception { + boolean pass = true; + System.out.println("Testcase: " + testcase.dataset); + String url = testcase.makeurl(); + NetcdfDataset ncfile = null; + try { + ncfile = openDataset(url); + } catch (Exception e) { + System.err.println(testcase.xfail ? "XFail" : "Fail"); + e.printStackTrace(); + return testcase.xfail; + } + String usethisname = UnitTestCommon.extractDatasetname(url, null); + String metadata = (NCDUMP ? ncdumpmetadata(ncfile, usethisname) : null); + if (prop_visual) { + visual(testcase.title + ".dmr", metadata); + } + + String data = null; + if (!testcase.headeronly) { + data = (NCDUMP ? ncdumpdata(ncfile, usethisname) : null); + if (prop_visual) { + visual(testcase.title + ".dap", data); + } + } + + String testoutput = (testcase.headeronly ? metadata : (NCDUMP ? data : metadata + data)); + + String baselinefile = testcase.baselinepath + "." + EXTENSION; + + if (prop_baseline) + writefile(baselinefile, testoutput); + + if (prop_diff) { // compare with baseline + // Read the baseline file(s) + String baselinecontent = readfile(baselinefile); + System.out.println("Comparison: vs " + baselinefile); + pass = pass && same(getTitle(), baselinecontent, testoutput); + System.out.println(pass ? "Pass" : "Fail"); + } + return pass; + } + + + String ncdumpmetadata(NetcdfDataset ncfile, String datasetname) throws Exception { + StringWriter sw = new StringWriter(); + + StringBuilder args = new StringBuilder("-strict"); + if (datasetname != null) { + args.append(" -datasetname "); + args.append(datasetname); + } + // Print the meta-databuffer using these args to NcdumpW + try { + if (!ucar.nc2.NCdumpW.print(ncfile, args.toString(), sw, null)) + throw new Exception("NcdumpW failed"); + } catch (IOException ioe) { + throw new Exception("NcdumpW failed", ioe); + } + sw.close(); + return sw.toString(); + } + + String ncdumpdata(NetcdfDataset ncfile, String datasetname) throws Exception { + StringWriter sw = new StringWriter(); + + StringBuilder args = new StringBuilder("-strict -vall"); + if (datasetname != null) { + args.append(" -datasetname "); + args.append(datasetname); + } + + // Dump the databuffer + sw = new StringWriter(); + try { + if (!ucar.nc2.NCdumpW.print(ncfile, args.toString(), sw, null)) + throw new Exception("NCdumpW failed"); + } catch (IOException ioe) { + ioe.printStackTrace(); + throw new Exception("NCdumpW failed", ioe); + } + sw.close(); + return sw.toString(); + } + + ////////////////////////////////////////////////// + // Utility methods + + + // Locate the test cases with given prefix + List locate(String prefix) { + List results = new ArrayList(); + for (ClientTest ct : this.alltestcases) { + if (!ct.dataset.startsWith(prefix)) + continue; + results.add(ct); + } + return results; + } + + static boolean report(String msg) { + System.err.println(msg); + return false; + } + +} // class TestDAP4Client + diff --git a/dap4/d4tests/src/test/java/dap4/test/TestHyrax.java b/dap4/d4tests/src/test/java/dap4/test/TestHyrax.java index efced4af87..038d26f437 100644 --- a/dap4/d4tests/src/test/java/dap4/test/TestHyrax.java +++ b/dap4/d4tests/src/test/java/dap4/test/TestHyrax.java @@ -20,6 +20,7 @@ /** * Test OpenDap Server at the NetcdfDataset level */ +@Ignore public class TestHyrax extends DapTestCommon { private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); From 975b5dcb30f1a9f19573e80dab8d7a8b783cf75d Mon Sep 17 00:00:00 2001 From: Dennis Heimbigner Date: Sun, 15 Jan 2023 13:09:49 -0700 Subject: [PATCH 2/5] ## Description of Changes This PR make major changes to the DAP4 code. It also makes some small but necessary changes to non-DAP4 code, the of which will be described in some detail below. ## DAP4 Changes * Biggest change is to merge all of the dap submodules (dap4:d4core, dap4:d4cdm, etc) into just one single "dap4" module. * Get rid of the old DAP4 CDMXXX types and instead use the standard netcdf-java Array types; this has some consequences with respect to what kind of sequence objects can be handled. * Reduce the set of DAP4 tests to be similar to those used by netcdf-c. * Convert tests to JUNIT-4 parameterized tests. * Remove all tests that use server mocking -- we will use a real server instead. * Enable inclusion of dap4 in fatJars and ncIdv. * Switch compile action in dap4 build.gradle to implementation in anticipation of a gradle version upgrade. * Aggregate all DAP4 constants into DapConstants.java. * Move selected NetCDF-4 related constants from Attribute.java to CDM.java * Get the HttpServices interceptor mechanism to work again; this is for debugging * Remove unused code * Move some DAP4 only code from UnitTestCommon.java to DapTestCommon.java * Begin the conversion to the new checksum mode capability. * Remove the now unused Bison-based DMR parser. * Remove the Odometer code as no longer used. ## Non-DAP4 related Changes * Remove extraneous code from TestCDF5Reading.java * Clean up UnitTestCommon.java * Allow zero-length dimensions, but also ignore any variables that have a zero length dimension. * Change NetcdfFiles warning from mentioning H5iop to H5iospNew. * Modify DatasetUrl to properly detect things like ".drm.xml" as of type ServiceType.DAP4. ## TODO * Search and destroy unused imports ## PR Checklist - [X] Link to any issues that the PR addresses - [ ] Add labels - [ ] Open as a [draft PR](https://github.blog/2019-02-14-introducing-draft-pull-requests/) until ready for review - [X] Make sure GitHub tests pass - [X] Mark PR as "Ready for Review" --- .github/workflows/deps.yml | 2 +- .github/workflows/style.yml | 2 +- .github/workflows/tests.yml | 2 +- .../java/ucar/nc2/iosp/bufr/Construct2.java | 2 +- .../unidata/util/test/UnitTestCommon.java | 117 +- cdm/core/src/main/java/ucar/ma2/Index.java | 2 +- .../src/main/java/ucar/nc2/Attribute.java | 23 - .../src/main/java/ucar/nc2/Dimension.java | 3 - cdm/core/src/main/java/ucar/nc2/Group.java | 78 +- .../src/main/java/ucar/nc2/NetcdfFile.java | 4 +- .../src/main/java/ucar/nc2/NetcdfFiles.java | 2 +- .../src/main/java/ucar/nc2/Structure.java | 3 +- cdm/core/src/main/java/ucar/nc2/Variable.java | 4 +- .../src/main/java/ucar/nc2/constants/CDM.java | 27 +- .../java/ucar/nc2/dataset/DatasetUrl.java | 28 +- .../nc2/internal/iosp/hdf5/H5headerNew.java | 71 +- .../nc2/internal/iosp/hdf5/H5iospNew.java | 2 +- .../nc2/internal/iosp/hdf5/H5objects.java | 2 +- .../internal/iosp/netcdf3/N3headerWriter.java | 5 +- .../java/ucar/nc2/iosp/hdf5/H5header.java | 6 +- .../main/java/ucar/nc2/ncml/NcMLReader.java | 4 +- .../java/ucar/nc2/util/CompareNetcdf2.java | 13 +- .../main/java/ucar/nc2/write/CDLWriter.java | 16 +- .../src/main/java/ucar/nc2/write/Ncdump.java | 3 +- .../core/src/test/data/hdf5/test_enum_2.nc4 | Bin .../java/ucar/nc2/TestSpecialAttributes.java | 7 +- .../ucar/nc2/dataset/TestCoordSysCompare.java | 2 +- .../ucar/nc2/iosp/hdf5/TestDataBTree.java | 6 +- .../ucar/nc2/iosp/hdf5/TestEnumTypedef.java | 42 +- .../java/ucar/nc2/iosp/hdf5/TestH5iosp.java | 7 +- .../nc2/iosp/netcdf3/TestN3iospCompare.java | 2 +- dap4/build.gradle | 56 +- dap4/d4cdm/build.gradle | 11 - dap4/d4cdm/src/main/java/dap4/cdm/arch.txt | 36 - .../src/main/java/dap4/cdm/dsp/CDMCursor.java | 253 --- .../src/main/java/dap4/cdm/dsp/CDMDMR.java | 84 - .../src/main/java/dap4/cdm/dsp/CDMDSP.java | 1056 --------- .../src/main/java/dap4/cdm/nc2/CDMArray.java | 27 - .../java/dap4/cdm/nc2/CDMArrayAtomic.java | 549 ----- .../java/dap4/cdm/nc2/CDMArrayDelegate.java | 60 - .../java/dap4/cdm/nc2/CDMArraySequence.java | 286 --- .../java/dap4/cdm/nc2/CDMArrayStructure.java | 487 ---- .../src/main/java/dap4/cdm/nc2/DataToCDM.java | 199 -- .../ucar.nc2.dataset.spi.NetcdfFileProvider | 1 - dap4/d4core/build.gradle | 5 - .../java/dap4/core/data/ChecksumMode.java | 44 - .../main/java/dap4/core/data/Constraint.java | 15 - .../src/main/java/dap4/core/data/DSP.java | 58 - .../main/java/dap4/core/data/DataCursor.java | 88 - .../java/dap4/core/dmr/AnnotatedNode.java | 14 - .../src/main/java/dap4/core/dmr/DapXML.java | 253 --- .../dap4/core/dmr/parser/bison/Bison.java | 92 - .../core/dmr/parser/bison/Dap4Actions.java | 182 -- .../dmr/parser/bison/Dap4BisonParser.java | 1954 ----------------- .../dmr/parser/bison/Dap4EventHandler.java | 196 -- .../core/dmr/parser/bison/Dap4ParserImpl.java | 1056 --------- .../dap4/core/dmr/parser/bison/Dap4Token.java | 13 - .../dap4/core/dmr/parser/bison/Debug.java | 140 -- .../core/dmr/parser/bison/LexException.java | 49 - .../dap4/core/dmr/parser/bison/Lexeme.java | 56 - .../dap4/core/dmr/parser/bison/SaxEvent.java | 71 - .../dmr/parser/bison/SaxEventHandler.java | 278 --- .../core/dmr/parser/bison/SaxEventType.java | 22 - .../src/main/java/dap4/core/util/Index.java | 97 - .../java/dap4/core/util/MultiOdometer.java | 146 -- .../main/java/dap4/core/util/Odometer.java | 269 --- .../java/dap4/core/util/ScalarOdometer.java | 47 - dap4/d4lib/build.gradle | 16 - .../java/dap4/dap4lib/AbstractCursor.java | 239 -- .../main/java/dap4/dap4lib/AbstractDSP.java | 294 --- .../java/dap4/dap4lib/ChunkInputStream.java | 336 --- .../main/java/dap4/dap4lib/DSPPrinter.java | 382 ---- .../src/main/java/dap4/dap4lib/Dap4Util.java | 25 - .../main/java/dap4/dap4lib/DapProtocol.java | 74 - .../src/main/java/dap4/dap4lib/FileDSP.java | 111 - .../src/main/java/dap4/dap4lib/HttpDSP.java | 315 --- .../src/main/java/dap4/dap4lib/XURI.java | 319 --- .../d4lib/src/main/java/dap4/dap4lib/keep.jar | Bin 38155 -> 0 bytes .../java/dap4/dap4lib/netcdf/Nc4Cursor.java | 655 ------ .../main/java/dap4/dap4lib/netcdf/Nc4DMR.java | 84 - .../dap4/dap4lib/netcdf/Nc4DMRCompiler.java | 740 ------- .../main/java/dap4/dap4lib/netcdf/Nc4DSP.java | 405 ---- .../java/dap4/dap4lib/netcdf/Nc4Notes.java | 316 --- .../java/dap4/dap4lib/serial/D4Cursor.java | 374 ---- .../main/java/dap4/dap4lib/serial/D4DSP.java | 95 - .../dap4/dap4lib/serial/D4DataCompiler.java | 282 --- dap4/d4tests/build.gradle | 44 - .../baseline/test_anon_dim.syn.2.raw.txt | 12 - .../baseline/test_anon_dim.syn.raw.txt | 11 - .../baseline/test_atomic_array.nc.5.raw.txt | 30 - .../baseline/test_atomic_array.nc.raw.txt | 63 - .../baseline/test_atomic_array.syn.raw.txt | 63 - .../baseline/test_atomic_types.nc.raw.txt | 72 - .../baseline/test_atomic_types.syn.raw.txt | 72 - .../baseline/test_fill.nc.raw.txt | 19 - .../baseline/test_one_var.nc.raw.txt | 10 - .../baseline/test_one_vararray.nc.3.raw.txt | 14 - .../baseline/test_sequence_1.syn.raw.txt | 23 - .../baseline/test_struct_array.nc.6.raw.txt | 34 - .../baseline/test_struct_array.syn.raw.txt | 78 - .../testinput/test_anon_dim.syn.raw | Bin 481 -> 0 bytes .../testinput/test_atomic_types.syn.raw | Bin 1904 -> 0 bytes .../testinput/test_one_vararray.nc.raw | Bin 502 -> 0 bytes .../testinput/test_opaque.nc.raw | Bin 430 -> 0 bytes .../testinput/test_sequence_1.syn.raw | Bin 506 -> 0 bytes .../testinput/test_sequence_2.syn.raw | Bin 565 -> 0 bytes .../baseline/test_anon_dim.syn.2.raw.txt | 12 - .../baseline/test_atomic_array.nc.5.raw.txt | 30 - .../baseline/test_atomic_array.nc.8.raw.txt | 12 - .../baseline/test_atomic_array.nc.9.raw.txt | 12 - .../baseline/test_enum_array.nc.4.raw.txt | 16 - .../baseline/test_one_vararray.nc.1.raw.txt | 12 - .../baseline/test_one_vararray.nc.3.raw.txt | 14 - .../baseline/test_opaque_array.nc.7.raw.txt | 13 - .../baseline/test_anon_dim.syn.2.raw.txt | 19 - .../baseline/test_anon_dim.syn.raw.txt | 18 - .../baseline/test_atomic_array.nc.5.raw.txt | 33 - .../baseline/test_atomic_array.nc.8.raw.txt | 18 - .../baseline/test_atomic_array.nc.9.raw.txt | 18 - .../baseline/test_atomic_array.nc.raw.txt | 89 - .../baseline/test_atomic_array.syn.raw.txt | 89 - .../baseline/test_atomic_types.nc.raw.txt | 60 - .../baseline/test_atomic_types.syn.raw.txt | 60 - .../TestDSP/baseline/test_enum.nc.raw.txt | 28 - .../TestDSP/baseline/test_enum_2.nc.raw.txt | 30 - .../baseline/test_enum_array.nc.4.raw.txt | 34 - .../baseline/test_enum_array.nc.raw.txt | 34 - .../TestDSP/baseline/test_fill.nc.raw.txt | 18 - .../TestDSP/baseline/test_groups1.nc.raw.txt | 50 - .../TestDSP/baseline/test_one_var.nc.raw.txt | 10 - .../baseline/test_one_vararray.nc.1.raw.txt | 16 - .../baseline/test_one_vararray.nc.raw.txt | 14 - .../TestDSP/baseline/test_opaque.nc.raw.txt | 10 - .../baseline/test_opaque_array.nc.7.raw.txt | 19 - .../baseline/test_opaque_array.nc.raw.txt | 17 - .../baseline/test_sequence_1.syn.raw.txt | 17 - .../baseline/test_sequence_2.syn.raw.txt | 33 - .../baseline/test_struct_array.nc.6.raw.txt | 34 - .../baseline/test_struct_array.syn.raw.txt | 77 - .../baseline/test_struct_nested.hdf5.raw.txt | 28 - .../baseline/test_struct_nested3.hdf5.raw.txt | 22 - .../baseline/test_struct_type.nc.raw.txt | 16 - .../TestDSP/baseline/test_utf8.nc.raw.txt | 14 - .../data/resources/TestDSR/baseline/test1.dsr | 29 - .../baseline/test_sequence_1.syn.1.dap | 3 - .../baseline/test_sequence_1.syn.1.dmr | 11 - .../baseline/test_sequence_1.syn.2.dap | 3 - .../baseline/test_frontpage.html | 296 --- .../data/resources/TestHyrax/dmr/DMR_0.1.xml | 27 - .../data/resources/TestHyrax/dmr/DMR_0.xml | 11 - .../data/resources/TestHyrax/dmr/DMR_1.xml | 8 - .../data/resources/TestHyrax/dmr/DMR_2.1.xml | 15 - .../data/resources/TestHyrax/dmr/DMR_2.xml | 13 - .../data/resources/TestHyrax/dmr/DMR_3.1.xml | 35 - .../data/resources/TestHyrax/dmr/DMR_3.2.xml | 9 - .../data/resources/TestHyrax/dmr/DMR_3.3.xml | 37 - .../data/resources/TestHyrax/dmr/DMR_3.4.xml | 16 - .../data/resources/TestHyrax/dmr/DMR_3.5.xml | 43 - .../data/resources/TestHyrax/dmr/DMR_3.xml | 13 - .../data/resources/TestHyrax/dmr/DMR_4.1.xml | 18 - .../data/resources/TestHyrax/dmr/DMR_4.xml | 29 - .../data/resources/TestHyrax/dmr/DMR_5.1.xml | 53 - .../data/resources/TestHyrax/dmr/DMR_5.xml | 30 - .../data/resources/TestHyrax/dmr/DMR_6.1.xml | 42 - .../data/resources/TestHyrax/dmr/DMR_6.2.xml | 48 - .../data/resources/TestHyrax/dmr/DMR_6.xml | 32 - .../data/resources/TestHyrax/dmr/DMR_7.1.xml | 46 - .../data/resources/TestHyrax/dmr/DMR_7.2.xml | 22 - .../data/resources/TestHyrax/dmr/DMR_7.3.xml | 38 - .../data/resources/TestHyrax/dmr/DMR_7.4.xml | 62 - .../data/resources/TestHyrax/dmr/DMR_7.5.xml | 23 - .../data/resources/TestHyrax/dmr/DMR_7.xml | 11 - .../data/resources/TestHyrax/dmr/DMR_8.xml | 17 - .../resources/TestHyrax/dmr/test_array_1.xml | 12 - .../resources/TestHyrax/dmr/test_array_10.xml | 18 - .../resources/TestHyrax/dmr/test_array_11.xml | 24 - .../resources/TestHyrax/dmr/test_array_2.xml | 13 - .../resources/TestHyrax/dmr/test_array_3.xml | 12 - .../resources/TestHyrax/dmr/test_array_4.xml | 64 - .../resources/TestHyrax/dmr/test_array_5.xml | 30 - .../resources/TestHyrax/dmr/test_array_6.xml | 15 - .../resources/TestHyrax/dmr/test_array_7.xml | 12 - .../resources/TestHyrax/dmr/test_array_8.xml | 12 - .../TestHyrax/dmr/test_escaped_paths.xml | 69 - .../resources/TestHyrax/dmr/test_simple_1.dmr | 10 - .../resources/TestHyrax/dmr/test_simple_1.xml | 10 - .../TestHyrax/dmr/test_simple_10.xml | 8 - .../resources/TestHyrax/dmr/test_simple_2.xml | 27 - .../resources/TestHyrax/dmr/test_simple_3.xml | 13 - .../TestHyrax/dmr/test_simple_3_error_1.xml | 13 - .../TestHyrax/dmr/test_simple_3_error_2.xml | 13 - .../TestHyrax/dmr/test_simple_3_error_3.xml | 13 - .../resources/TestHyrax/dmr/test_simple_4.xml | 14 - .../resources/TestHyrax/dmr/test_simple_5.xml | 19 - .../resources/TestHyrax/dmr/test_simple_6.xml | 11 - .../resources/TestHyrax/dmr/test_simple_7.xml | 11 - .../resources/TestHyrax/dmr/test_simple_8.xml | 13 - .../TestHyrax/dmr/test_simple_9.1.xml | 23 - .../resources/TestHyrax/dmr/test_simple_9.xml | 14 - .../test/data/resources/TestHyrax/hyrax.html | 380 ---- .../baseline/test_struct_array.nc.nc4.dap | 67 - .../baseline/test_struct_nested.nc.nc4.dmr | 24 - .../TestIosp/baseline/test_vlen1.nc.nc4.dap | 11 - .../TestIosp/baseline/test_vlen1.nc.nc4.dmr | 8 - .../TestIosp/baseline/test_vlen2.nc.nc4.dap | 21 - .../TestIosp/baseline/test_vlen3.nc.nc4.dap | 17 - .../TestIosp/baseline/test_vlen4.nc.nc4.dap | 20 - .../TestIosp/baseline/test_vlen5.nc.nc4.dap | 23 - .../baseline/test_anon_dim.syn.dmp | 11 - .../baseline/test_atomic_array.nc.dmp | 57 - .../baseline/test_atomic_array.syn.dmp | 57 - .../baseline/test_atomic_types.nc.dmp | 44 - .../baseline/test_atomic_types.syn.dmp | 44 - .../TestParsers/baseline/test_enum.nc.dmp | 26 - .../TestParsers/baseline/test_enum_2.nc.dmp | 28 - .../baseline/test_enum_array.nc.dmp | 28 - .../TestParsers/baseline/test_fill.nc.dmp | 14 - .../TestParsers/baseline/test_groups1.nc.dmp | 29 - .../TestParsers/baseline/test_one_var.nc.dmp | 8 - .../baseline/test_one_vararray.nc.dmp | 11 - .../TestParsers/baseline/test_opaque.nc.dmp | 8 - .../baseline/test_opaque_array.nc.dmp | 12 - .../baseline/test_sequence_1.syn.dmp | 11 - .../baseline/test_sequence_2.syn.dmp | 13 - .../baseline/test_struct_array.nc.dmp | 15 - .../baseline/test_struct_array.syn.dmp | 21 - .../baseline/test_struct_nested.hdf5.dmp | 17 - .../baseline/test_struct_nested3.hdf5.dmp | 14 - .../baseline/test_struct_type.nc.dmp | 11 - .../TestParsers/baseline/test_utf8.nc.dmp | 11 - .../TestParsers/baseline/test_vlen1.nc.dmp | 10 - .../TestParsers/baseline/test_vlen2.nc.dmp | 14 - .../TestParsers/baseline/test_vlen3.hdf5.dmp | 12 - .../TestParsers/baseline/testall.dmp | 57 - .../dmrset/test_atomic_array.nc.dmr | 57 - .../dmrset/test_atomic_array.syn.dmr | 57 - .../dmrset/test_atomic_types.nc.dmr | 44 - .../dmrset/test_atomic_types.syn.dmr | 48 - .../TestParsers/dmrset/test_enum.nc.dmr | 26 - .../TestParsers/dmrset/test_enum_array.nc.dmr | 28 - .../TestParsers/dmrset/test_groups1.nc.dmr | 29 - .../TestParsers/dmrset/test_one_var.nc.dmr | 8 - .../dmrset/test_one_vararray.nc.dmr | 11 - .../dmrset/test_struct_array.nc.dmr | 15 - .../dmrset/test_struct_nested.hdf5.dmr | 17 - .../dmrset/test_struct_nested3.hdf5.dmr | 14 - .../dmrset/test_struct_type.nc.dmr | 11 - .../TestParsers/dmrset/test_utf8.nc.dmr | 11 - .../TestParsers/dmrset/test_vlen1.nc.dmr | 10 - .../TestParsers/dmrset/test_vlen3.hdf5.dmr | 12 - .../TestParsers/dmrset/test_vlen5.hdf5.dmr | 14 - .../resources/TestParsers/dmrset/testall.dmr | 78 - .../resources/TestParsers/testinput/ce1.txt | 8 - .../TestParsers/testinput/ce1_dmr.txt | 39 - .../TestParsers/testinput/test_misc1.xml | 18 - .../TestParsers/testinput/test_misc2.xml | 37 - .../TestParsers/testinput/test_simple_1.xml | 14 - .../TestParsers/testinput/test_simple_2.xml | 33 - .../TestParsers/testinput/testall.xml | 77 - .../TestSerial/baseline/test_aaa.nc.dmp | 9 - .../baseline/test_atomic_array.nc.0.dmp | 24 - .../baseline/test_atomic_array.nc.1.dmp | 18 - .../baseline/test_atomic_array.nc.dmp | 83 - .../baseline/test_atomic_array.nc.ncdump | 57 - .../baseline/test_atomic_types.nc.dmp | 53 - .../baseline/test_atomic_types.nc.ncdump | 61 - .../TestSerial/baseline/test_enum.nc.dmp | 21 - .../baseline/test_enum_array.nc.0.dmp | 27 - .../baseline/test_enum_array.nc.1.dmp | 23 - .../baseline/test_enum_array.nc.dmp | 27 - .../TestSerial/baseline/test_groups1.nc.dmp | 4 - .../baseline/test_groups1.nc.ncdump | 7 - .../TestSerial/baseline/test_one_var.nc.dmp | 5 - .../baseline/test_one_var.nc.ncdump | 9 - .../baseline/test_one_vararray.nc.0.dmp | 9 - .../baseline/test_one_vararray.nc.1.dmp | 7 - .../baseline/test_one_vararray.nc.dmp | 9 - .../baseline/test_struct_array.nc.0.dmp | 25 - .../baseline/test_struct_array.nc.dmp | 59 - .../baseline/test_struct_array.nc.ncdump | 26 - .../baseline/test_struct_nested.hdf5.dmp | 23 - .../baseline/test_struct_type.nc.dmp | 11 - .../baseline/test_struct_type.nc.ncdump | 18 - .../TestSerial/baseline/test_utf8.nc.dmp | 9 - .../TestSerial/baseline/test_vlen1.nc.dmp | 11 - .../TestSerial/baseline/test_vlen2.nc.dmp | 17 - .../TestSerial/baseline/test_vlen3.hdf5.dmp | 15 - .../TestSerial/baseline/test_vlen5.hdf5.dmp | 20 - .../baseline/test_anon_dim.syn.dap | 1 - .../baseline/test_anon_dim.syn.dmr | 12 - .../baseline/test_atomic_array.nc.dap | 8 - .../baseline/test_atomic_array.syn.dap | 8 - .../baseline/test_atomic_types.nc.dap | 15 - .../baseline/test_atomic_types.syn.dap | 15 - .../baseline/test_atomic_types.syn.dmr | 45 - .../TestServlet/baseline/test_enum.nc.dap | 1 - .../TestServlet/baseline/test_enum_2.nc.dap | 1 - .../baseline/test_enum_array.nc.dap | 1 - .../TestServlet/baseline/test_fill.nc.dap | 3 - .../TestServlet/baseline/test_groups1.nc.dap | 4 - .../TestServlet/baseline/test_one_var.nc.dap | 1 - .../baseline/test_one_vararray.nc.dap | 1 - .../baseline/test_one_vararray.nc.dmr | 12 - .../TestServlet/baseline/test_opaque.nc.dap | 1 - .../baseline/test_opaque_array.nc.dap | 1 - .../baseline/test_sequence_1.syn.dap | 2 - .../baseline/test_sequence_1.syn.dmr | 12 - .../baseline/test_sequence_2.syn.dap | 5 - .../baseline/test_sequence_2.syn.dmr | 14 - .../baseline/test_struct_array.syn.dap | 15 - .../baseline/test_struct_nested.hdf5.dap | 1 - .../baseline/test_struct_nested3.hdf5.dap | 1 - .../baseline/test_struct_type.nc.dap | 1 - .../TestServlet/baseline/test_utf8.nc.dap | 3 - .../baseline/test_anon_dim.syn.2.dap | 1 - .../baseline/test_anon_dim.syn.2.dmr | 14 - .../baseline/test_atomic_array.nc.5.dap | 4 - .../baseline/test_atomic_array.nc.8.dap | 1 - .../baseline/test_atomic_array.nc.9.dap | 1 - .../baseline/test_enum_array.nc.4.dap | 1 - .../baseline/test_one_vararray.nc.1.dap | 1 - .../baseline/test_one_vararray.nc.3.dap | 1 - .../baseline/test_opaque_array.nc.7.dap | 1 - .../baseline/test_struct_array.nc.6.dap | 1 - .../src/test/data/resources/favicon.ico | Bin 4286 -> 0 bytes .../test/data/resources/testfiles/Makefile | 75 - .../resources/testfiles/dmr/test_aaa.nc.dmr | 11 - .../testfiles/dmr/test_atomic_array.nc.dmr | 55 - .../testfiles/dmr/test_atomic_types.nc.dmr | 44 - .../resources/testfiles/dmr/test_enum.nc.dmr | 24 - .../resources/testfiles/dmr/test_enum1.nc.dmr | 27 - .../resources/testfiles/dmr/test_enum2.nc.dmr | 26 - .../testfiles/dmr/test_enum_array.nc.dmr | 26 - .../testfiles/dmr/test_groups1.nc.dmr | 29 - .../testfiles/dmr/test_numeric_types.nc.dmr | 22 - .../testfiles/dmr/test_one_var.nc.dmr | 8 - .../testfiles/dmr/test_one_vararray.nc.dmr | 11 - .../testfiles/dmr/test_opaque_type.nc.dmr | 8 - .../testfiles/dmr/test_string_type.nc.dmr | 8 - .../testfiles/dmr/test_struct1.nc.dmr | 11 - .../testfiles/dmr/test_struct_array.nc.dmr | 15 - .../testfiles/dmr/test_struct_nested.hdf5.dmr | 17 - .../testfiles/dmr/test_struct_nested.nc.dmr | 17 - .../testfiles/dmr/test_struct_type.nc.dmr | 11 - .../resources/testfiles/dmr/test_utf8.nc.dmr | 11 - .../resources/testfiles/dmr/test_vlen1.nc.dmr | 11 - .../resources/testfiles/dmr/test_vlen2.nc.dmr | 15 - .../testfiles/dmr/test_vlen3.hdf5.dmr | 14 - .../resources/testfiles/dmr/test_vlen3.nc.dmr | 8 - .../testfiles/dmr/test_vlen4.hdf5.dmr | 14 - .../testfiles/dmr/test_vlen5.hdf5.dmr | 15 - .../src/test/data/resources/testfiles/doit | 0 .../resources/testfiles/test_anon_dim.syn | 11 - .../resources/testfiles/test_atomic_array.cdl | 39 - .../resources/testfiles/test_atomic_array.nc | Bin 14523 -> 0 bytes .../testfiles/test_atomic_array.ncdump | 48 - .../resources/testfiles/test_atomic_array.syn | 55 - .../resources/testfiles/test_atomic_types.cdl | 42 - .../testfiles/test_atomic_types.ncdump | 57 - .../resources/testfiles/test_atomic_types.syn | 40 - .../data/resources/testfiles/test_enum.cdl | 12 - .../data/resources/testfiles/test_enum.nc | Bin 1239 -> 0 bytes .../data/resources/testfiles/test_enum.ncdump | 13 - .../data/resources/testfiles/test_enum1.cdl | 12 - .../data/resources/testfiles/test_enum1.nc | Bin 1239 -> 0 bytes .../resources/testfiles/test_enum1.ncdump | 13 - .../data/resources/testfiles/test_enum_2.cdl | 15 - .../resources/testfiles/test_enum_2.ncdump | 16 - .../resources/testfiles/test_enum_array.cdl | 14 - .../testfiles/test_enum_array.ncdump | 15 - .../data/resources/testfiles/test_fill.cdl | 11 - .../data/resources/testfiles/test_fill.nc | Bin 1271 -> 0 bytes .../data/resources/testfiles/test_fill.ncdump | 14 - .../data/resources/testfiles/test_groups1.cdl | 35 - .../data/resources/testfiles/test_groups1.nc | Bin 8469 -> 0 bytes .../resources/testfiles/test_groups1.ncdump | 35 - .../data/resources/testfiles/test_misc1.nc | Bin 22465 -> 0 bytes .../data/resources/testfiles/test_one_var.cdl | 6 - .../data/resources/testfiles/test_one_var.nc | Bin 603 -> 0 bytes .../resources/testfiles/test_one_var.ncdump | 7 - .../resources/testfiles/test_one_vararray.cdl | 8 - .../testfiles/test_one_vararray.ncdump | 9 - .../data/resources/testfiles/test_opaque.cdl | 8 - .../data/resources/testfiles/test_opaque.nc | Bin 711 -> 0 bytes .../resources/testfiles/test_opaque.ncdump | 9 - .../resources/testfiles/test_opaque_array.cdl | 12 - .../testfiles/test_opaque_array.ncdump | 13 - .../resources/testfiles/test_sequence_1.syn | 12 - .../resources/testfiles/test_sequence_2.syn | 13 - .../data/resources/testfiles/test_struct1.cdl | 11 - .../data/resources/testfiles/test_struct1.nc | Bin 805 -> 0 bytes .../resources/testfiles/test_struct1.ncdump | 12 - .../resources/testfiles/test_struct_array.cdl | 18 - .../resources/testfiles/test_struct_array.nc | Bin 6534 -> 0 bytes .../testfiles/test_struct_array.ncdump | 19 - .../resources/testfiles/test_struct_array.syn | 25 - .../testfiles/test_struct_nested.cdl | 15 - .../testfiles/test_struct_nested.hdf5 | Bin 723 -> 0 bytes .../resources/testfiles/test_struct_nested.nc | Bin 1330 -> 0 bytes .../testfiles/test_struct_nested.ncdump | 16 - .../testfiles/test_struct_nested3.cdl | 16 - .../testfiles/test_struct_nested3.hdf5 | Bin 736 -> 0 bytes .../testfiles/test_struct_nested3.nc | Bin 1206 -> 0 bytes .../testfiles/test_struct_nested3.ncdump | 17 - .../resources/testfiles/test_struct_type.cdl | 11 - .../resources/testfiles/test_struct_type.nc | Bin 805 -> 0 bytes .../testfiles/test_struct_type.ncdump | 12 - .../data/resources/testfiles/test_test.cdl | 11 - .../data/resources/testfiles/test_test.nc | Bin 777 -> 0 bytes .../data/resources/testfiles/test_test.ncdump | 9 - .../data/resources/testfiles/test_unlim1.cdl | 27 - .../resources/testfiles/test_unlim1.ncdump | 34 - .../data/resources/testfiles/test_utf8.cdl | 8 - .../data/resources/testfiles/test_utf8.ncdump | 9 - .../data/resources/testfiles/test_vlen1.cdl | 11 - .../resources/testfiles/test_vlen1.ncdump | 9 - .../data/resources/testfiles/test_vlen10.cdl | 14 - .../data/resources/testfiles/test_vlen10.nc | Bin 5133 -> 0 bytes .../resources/testfiles/test_vlen10.ncdump | 13 - .../data/resources/testfiles/test_vlen11.cdl | 13 - .../resources/testfiles/test_vlen11.ncdump | 10 - .../data/resources/testfiles/test_vlen2.cdl | 15 - .../data/resources/testfiles/test_vlen2.nc | Bin 6336 -> 0 bytes .../resources/testfiles/test_vlen2.ncdump | 15 - .../data/resources/testfiles/test_vlen3.cdl | 13 - .../resources/testfiles/test_vlen3.ncdump | 12 - .../data/resources/testfiles/test_vlen4.cdl | 13 - .../resources/testfiles/test_vlen4.ncdump | 12 - .../data/resources/testfiles/test_vlen5.cdl | 16 - .../resources/testfiles/test_vlen5.ncdump | 14 - .../data/resources/testfiles/test_vlen6.cdl | 16 - .../resources/testfiles/test_vlen6.ncdump | 11 - .../data/resources/testfiles/test_vlen7.cdl | 16 - .../resources/testfiles/test_vlen7.ncdump | 11 - .../data/resources/testfiles/test_vlen8.cdl | 19 - .../data/resources/testfiles/test_vlen8.nc | Bin 6304 -> 0 bytes .../resources/testfiles/test_vlen8.ncdump | 14 - .../data/resources/testfiles/test_vlen9.cdl | 16 - .../data/resources/testfiles/test_vlen9.nc | Bin 6272 -> 0 bytes .../resources/testfiles/test_vlen9.ncdump | 15 - .../data/resources/testfiles/test_zerodim.cdl | 23 - .../data/resources/testfiles/test_zerodim.nc | Bin 14339 -> 0 bytes .../resources/testfiles/test_zerodim.ncdump | 28 - .../test/data/resources/testfiles/tst_fills.c | 51 - .../data/resources/testfiles/tst_fills.nc | Bin 1050 -> 0 bytes .../test/java/dap4/test/DapTestCommon.java | 264 --- dap4/d4tests/src/test/java/dap4/test/Diff.j | 794 ------- .../test/java/dap4/test/TestCDMClient.java | 326 --- .../test/java/dap4/test/TestDAP4Client.java | 406 ---- .../src/test/java/dap4/test/TestDSP.java | 351 --- .../src/test/java/dap4/test/TestH5Iosp.java | 287 --- .../src/test/java/dap4/test/TestHyrax.java | 393 ---- .../src/test/java/dap4/test/TestNc4Iosp.java | 287 --- .../src/test/java/dap4/test/TestParserCE.java | 226 -- .../test/java/dap4/test/TestParserDMR.java | 244 -- .../src/test/java/dap4/test/TestPrinter.java | 116 - .../src/test/java/dap4/test/TestSerial.java | 302 --- dap4/grammars/Makefile | 24 +- dap4/grammars/ce.y | 22 +- .../src/main/java/dap4/core/ce/CEAST.java | 0 .../main/java/dap4/core/ce/CECompiler.java | 0 .../main/java/dap4/core/ce/CEConstraint.java | 73 +- .../src/main/java/dap4/core/ce/Universal.java | 0 .../java/dap4/core/ce/parser/CEActions.java | 0 .../dap4/core/ce/parser/CEBisonParser.java | 989 +++++---- .../java/dap4/core/ce/parser/CELexer.java | 0 .../dap4/core/ce/parser/CEParserImpl.java | 4 +- .../main/java/dap4/core/dmr/DMRFactory.java | 2 +- .../main/java/dap4/core/dmr}/DMRPrinter.java | 229 +- .../main/java/dap4/core/dmr/DapAttribute.java | 11 +- .../java/dap4/core/dmr/DapAttributeSet.java | 0 .../main/java/dap4/core/dmr/DapDataset.java | 8 +- .../src/main/java/dap4/core/dmr/DapDecl.java | 0 .../main/java/dap4/core/dmr/DapDimension.java | 0 .../main/java/dap4/core/dmr/DapEnumConst.java | 0 .../java/dap4/core/dmr/DapEnumeration.java | 31 + .../src/main/java/dap4/core/dmr/DapGroup.java | 19 +- .../src/main/java/dap4/core/dmr/DapMap.java | 19 +- .../src/main/java/dap4/core/dmr/DapNode.java | 37 +- .../main/java/dap4/core/dmr/DapOtherXML.java | 0 .../main/java/dap4/core/dmr/DapSequence.java | 0 .../main/java/dap4/core/dmr/DapStructure.java | 0 .../src/main/java/dap4/core/dmr/DapType.java | 0 .../main/java/dap4/core/dmr/DapVariable.java | 10 +- .../java/dap4/core/dmr/ErrorResponse.java | 0 .../src/main/java/dap4/core/dmr/TypeSort.java | 0 .../java/dap4/core/dmr/parser/DOM4Parser.java | 90 +- .../java/dap4/core/dmr/parser/Dap4Parser.java | 0 .../dap4/core/dmr/parser/ParseException.java | 0 .../java/dap4/core/dmr/parser/ParseUtil.java | 0 .../dap4/core/interfaces/CEConstraintIF.java | 24 + .../java/dap4/core/interfaces/DataCursor.java | 53 + .../java/dap4/core/interfaces/DataIndex.java | 23 + .../java/dap4/core/util/ChecksumMode.java | 62 + .../dap4/core/util/ConversionException.java | 0 .../src/main/java/dap4/core/util/Convert.java | 1 + .../java/dap4/core/util/CoreTypeFcns.java | 0 .../java/dap4/core/util/DapConstants.java | 72 + .../main/java/dap4/core/util/DapContext.java | 13 +- .../src/main/java/dap4/core/util/DapDump.java | 30 +- .../java/dap4/core/util/DapException.java | 0 .../main/java/dap4/core/util/DapIterator.java | 0 .../src/main/java/dap4/core/util/DapSort.java | 0 .../src/main/java/dap4/core/util/DapUtil.java | 305 ++- .../src/main/java/dap4/core/util/Escape.java | 6 +- .../java/dap4/core/util/IndentWriter.java | 10 +- .../main/java/dap4/core/util/MultiSlice.java | 8 +- .../main/java/dap4/core/util/PowerSet.java | 0 .../java/dap4/core/util/ResponseFormat.java | 22 +- .../src/main/java/dap4/core/util/Slice.java | 62 +- .../java/dap4/core/util/SliceConstraint.java | 0 .../java/dap4/core/util/SliceIterator.java | 0 dap4/src/main/java/dap4/core/util/XURI.java | 554 +++++ dap4/src/main/java/dap4/dap4lib/D4Cursor.java | 109 + dap4/src/main/java/dap4/dap4lib/D4DSP.java | 401 ++++ .../java/dap4/dap4lib/D4DataCompiler.java | 504 +++++ dap4/src/main/java/dap4/dap4lib/D4Index.java | 152 ++ .../main/java/dap4/dap4lib}/DSPRegistry.java | 20 +- .../src/main/java/dap4/dap4lib/DapCodes.java | 0 .../src/main/java/dap4/dap4lib/DapLog.java | 0 .../main/java/dap4/dap4lib/DapProtocol.java | 164 ++ .../main/java/dap4/dap4lib/DapStartLog.java | 0 .../dap4/dap4lib/DeChunkedInputStream.java | 333 +++ .../java/dap4/dap4lib/ErrorException.java | 0 dap4/src/main/java/dap4/dap4lib/HttpDSP.java | 179 ++ .../main/java/dap4/dap4lib/LibTypeFcns.java | 0 dap4/src/main/java/dap4/dap4lib/RawDSP.java | 109 + .../main/java/dap4/dap4lib/RequestMode.java | 21 +- .../java/dap4/dap4lib}/cdm/CDMTypeFcns.java | 167 +- .../main/java/dap4/dap4lib}/cdm/CDMUtil.java | 183 +- .../main/java/dap4/dap4lib}/cdm/NodeMap.java | 2 +- .../dap4/dap4lib}/cdm/nc2/CDMCompiler.java | 50 +- .../cdm/nc2/D4StructureDataIterator.java | 53 + .../java/dap4/dap4lib}/cdm/nc2/DMRToCDM.java | 15 +- .../dap4/dap4lib}/cdm/nc2/DapNetcdfFile.java | 189 +- .../cdm/nc2/DapNetcdfFileProvider.java | 2 +- .../java/dap4/dap4lib/cdm/nc2/DataToCDM.java | 81 + .../ucar.nc2.dataset.spi.NetcdfFileProvider | 1 + .../test_atomic_array.1.nc.ncdump | 58 + .../test_atomic_array.2.nc.ncdump | 58 + .../test_atomic_array.3.nc.ncdump | 58 + .../test_enum_array.6.nc.ncdump} | 11 +- .../test_one_vararray.4.nc.ncdump} | 11 +- .../test_one_vararray.5.nc.ncdump} | 13 +- .../test_opaque_array.7.nc.ncdump | 17 + .../test_struct_array.8.nc.ncdump | 57 + ...Std_H031.v4.0.21.0.G06101132853.hdf.ncdump | 213 ++ .../baselinehyrax/amsre_20060131v5.dat.ncdump | 32 + .../nc4_nc_classic_comp.nc.ncdump | 137 ++ .../nc4_nc_classic_no_comp.nc.ncdump | 137 ++ .../baselinehyrax/nc4_strings.nc.ncdump | 36 + .../baselinehyrax/nc4_strings_comp.nc.ncdump | 36 + .../nc4_unsigned_types.nc.ncdump | 75 + .../nc4_unsigned_types_comp.nc.ncdump | 75 + .../baselinehyrax/ref_tst_compounds.nc.ncdump | 43 + .../test_atomic_array.2.nc.ncdump} | 11 +- .../test_atomic_array.3.nc.ncdump} | 11 +- .../baselineraw/test_atomic_array.nc.ncdump} | 49 +- .../baselineraw/test_atomic_types.nc.ncdump} | 37 +- .../baselineraw/test_enum_1.nc.ncdump} | 7 +- .../baselineraw/test_enum_2.nc.ncdump} | 8 +- .../baselineraw/test_enum_3.nc.ncdump | 16 + .../baselineraw/test_enum_array.6.nc.ncdump} | 11 +- .../baselineraw/test_enum_array.nc.ncdump} | 7 +- .../resources/baselineraw/test_fill.nc.ncdump | 17 + .../baselineraw/test_fill_2.nc.ncdump | 32 + .../baselineraw/test_groups1.nc.ncdump} | 27 +- .../baselineraw/test_misc1.nc.ncdump | 30 + .../baselineraw/test_one_var.nc.ncdump} | 3 + .../test_one_vararray.4.nc.ncdump} | 11 +- .../baselineraw/test_one_vararray.5.nc.ncdump | 13 + .../baselineraw/test_one_vararray.nc.ncdump} | 7 +- .../baselineraw/test_opaque.nc.ncdump} | 6 +- .../test_opaque_array.7.nc.ncdump} | 11 +- .../baselineraw/test_opaque_array.nc.ncdump} | 12 +- .../baselineraw/test_struct1.nc.ncdump} | 8 +- .../test_struct_array.8.nc.ncdump} | 41 +- .../baselineraw/test_struct_array.nc.ncdump | 56 + .../baselineraw/test_struct_nested.nc.ncdump} | 18 +- .../test_struct_nested3.nc.ncdump} | 15 +- .../baselineraw/test_struct_type.nc.ncdump} | 7 +- .../resources/baselineraw/test_test.nc.ncdump | 13 + .../baselineraw/test_unlim.nc.ncdump | 50 + .../baselineraw/test_unlim1.nc.ncdump | 50 + .../baselineraw/test_utf8.nc.ncdump} | 6 +- .../baselineraw/test_vlen1.nc.ncdump | 24 + .../baselineraw/test_vlen11.nc.ncdump | 19 + .../baselineraw/test_vlen3.nc.ncdump} | 11 +- .../baselineraw/test_zerodim.nc.ncdump | 30 + .../test_atomic_array.2.nc.ncdump | 57 + .../test_atomic_array.3.nc.ncdump | 57 + .../test_atomic_array.nc.ncdump} | 29 +- .../test_atomic_types.nc.ncdump} | 21 +- .../baselineremote/test_enum_1.nc.ncdump} | 6 +- .../baselineremote/test_enum_2.nc.ncdump | 18 + .../baselineremote/test_enum_3.nc.ncdump | 17 + .../test_enum_array.6.nc.ncdump} | 14 +- .../baselineremote/test_enum_array.nc.ncdump} | 5 + .../baselineremote/test_fill.nc.ncdump | 18 + .../baselineremote/test_fill_2.nc.ncdump | 33 + .../baselineremote/test_groups1.nc.ncdump | 42 + .../baselineremote/test_misc1.nc.ncdump | 31 + .../baselineremote/test_one_var.nc.ncdump} | 6 +- .../test_one_vararray.4.nc.ncdump | 14 + .../test_one_vararray.5.nc.ncdump | 14 + .../test_one_vararray.nc.ncdump} | 5 + .../baselineremote/test_opaque.nc.ncdump} | 13 +- .../test_opaque_array.7.nc.ncdump | 17 + .../test_opaque_array.nc.ncdump | 17 + .../baselineremote/test_struct1.nc.ncdump} | 14 +- .../test_struct_array.8.nc.ncdump | 69 + .../test_struct_array.nc.ncdump | 57 + .../test_struct_nested.nc.ncdump} | 18 +- .../test_struct_nested3.nc.ncdump | 29 + .../test_struct_type.nc.ncdump} | 8 +- .../baselineremote/test_test.nc.ncdump | 14 + .../baselineremote/test_unlim.nc.ncdump | 51 + .../baselineremote/test_unlim1.nc.ncdump | 51 + .../baselineremote/test_utf8.nc.ncdump} | 10 +- .../baselineremote/test_vlen1.nc.ncdump | 25 + .../baselineremote/test_vlen11.nc.ncdump | 20 + .../baselineremote/test_zerodim.nc.ncdump | 31 + .../nctestfiles/test_atomic_array.nc | Bin 0 -> 14477 bytes .../nctestfiles}/test_atomic_types.nc | Bin 13136 -> 12685 bytes .../data/resources/nctestfiles/test_enum_1.nc | Bin 0 -> 989 bytes .../data/resources/nctestfiles/test_enum_2.nc | Bin 0 -> 1180 bytes .../data/resources/nctestfiles/test_enum_3.nc | Bin 0 -> 870 bytes .../resources/nctestfiles}/test_enum_array.nc | Bin 8293 -> 8197 bytes .../data/resources/nctestfiles/test_fill.nc | Bin 0 -> 1173 bytes .../resources/nctestfiles/test_groups1.nc | Bin 0 -> 8321 bytes .../data/resources/nctestfiles/test_misc1.nc | Bin 0 -> 16155 bytes .../resources/nctestfiles/test_one_var.nc | Bin 0 -> 606 bytes .../nctestfiles}/test_one_vararray.nc | Bin 6248 -> 6152 bytes .../data/resources/nctestfiles/test_opaque.nc | Bin 0 -> 659 bytes .../nctestfiles}/test_opaque_array.nc | Bin 6272 -> 6176 bytes .../resources/nctestfiles/test_struct1.nc | Bin 0 -> 679 bytes .../nctestfiles/test_struct_array.nc} | Bin 6272 -> 6240 bytes .../nctestfiles/test_struct_nested.nc | Bin 0 -> 844 bytes .../nctestfiles/test_struct_nested3.nc | Bin 0 -> 894 bytes .../resources/nctestfiles/test_struct_type.nc | Bin 0 -> 679 bytes .../data/resources/nctestfiles/test_test.nc | Bin 0 -> 666 bytes .../data/resources/nctestfiles}/test_unlim.nc | Bin 18392 -> 18251 bytes .../resources/nctestfiles}/test_unlim1.nc | Bin 10266 -> 10059 bytes .../data/resources/nctestfiles}/test_utf8.nc | Bin 6272 -> 6176 bytes .../data/resources/nctestfiles}/test_vlen1.nc | Bin 4863 -> 4765 bytes .../resources/nctestfiles}/test_vlen11.nc | Bin 4944 -> 4850 bytes .../data/resources/nctestfiles/test_vlen2.nc} | Bin 4762 -> 6240 bytes .../data/resources/nctestfiles}/test_vlen3.nc | Bin 4982 -> 4855 bytes .../data/resources/nctestfiles}/test_vlen4.nc | Bin 4990 -> 4884 bytes .../data/resources/nctestfiles/test_vlen5.nc} | Bin 6224 -> 6176 bytes .../data/resources/nctestfiles}/test_vlen6.nc | Bin 6272 -> 6176 bytes .../data/resources/nctestfiles}/test_vlen7.nc | Bin 6256 -> 6160 bytes .../data/resources/nctestfiles/test_vlen8.nc} | Bin 4733 -> 6208 bytes .../resources/nctestfiles/test_zerodim.nc | Bin 0 -> 14107 bytes .../resources/rawtestfiles/CMakeLists.txt | 13 + .../rawtestfiles/test_atomic_array.1.nc.dap} | Bin 917 -> 1042 bytes .../rawtestfiles/test_atomic_array.1.nc.dmr} | 6 + .../rawtestfiles/test_atomic_array.2.nc.dap} | Bin 564 -> 701 bytes .../rawtestfiles/test_atomic_array.2.nc.dmr} | 6 + .../rawtestfiles/test_atomic_array.3.nc.dap} | Bin 564 -> 701 bytes .../rawtestfiles/test_atomic_array.3.nc.dmr} | 6 + .../rawtestfiles/test_atomic_array.nc.dap} | Bin 2206 -> 2408 bytes .../rawtestfiles}/test_atomic_array.nc.dmr | 8 +- .../rawtestfiles/test_atomic_types.nc.dap} | Bin 1897 -> 1962 bytes .../rawtestfiles}/test_atomic_types.nc.dmr | 10 +- .../rawtestfiles/test_enum_1.nc.dap} | Bin 1236 -> 1367 bytes .../rawtestfiles/test_enum_1.nc.dmr} | 10 +- .../rawtestfiles/test_enum_2.nc.dap} | Bin 1294 -> 1423 bytes .../rawtestfiles}/test_enum_2.nc.dmr | 8 +- .../resources/rawtestfiles/test_enum_3.nc.dap | Bin 0 -> 836 bytes .../resources/rawtestfiles/test_enum_3.nc.dmr | 22 + .../rawtestfiles/test_enum_array.6.nc.dap} | Bin 1379 -> 1508 bytes .../rawtestfiles/test_enum_array.6.nc.dmr} | 8 +- .../rawtestfiles/test_enum_array.nc.dap} | Bin 1310 -> 1550 bytes .../rawtestfiles}/test_enum_array.nc.dmr | 8 +- .../resources/rawtestfiles/test_fill.nc.dap} | Bin 598 -> 724 bytes .../resources/rawtestfiles}/test_fill.nc.dmr | 12 +- .../rawtestfiles/test_fill_2.nc.dap} | Bin 2222 -> 1953 bytes .../rawtestfiles/test_fill_2.nc.dmr} | 57 +- .../rawtestfiles/test_groups1.nc.dap} | Bin 1155 -> 1280 bytes .../rawtestfiles}/test_groups1.nc.dmr | 6 + .../resources/rawtestfiles/test_misc1.nc.dap | Bin 0 -> 1434 bytes .../resources/rawtestfiles/test_misc1.nc.dmr | 39 + .../rawtestfiles/test_one_var.nc.dap} | Bin 416 -> 553 bytes .../rawtestfiles}/test_one_var.nc.dmr | 6 + .../rawtestfiles/test_one_vararray.4.nc.dap} | Bin 554 -> 691 bytes .../rawtestfiles/test_one_vararray.4.nc.dmr} | 6 + .../rawtestfiles/test_one_vararray.5.nc.dap | Bin 0 -> 697 bytes .../rawtestfiles/test_one_vararray.5.nc.dmr} | 13 +- .../rawtestfiles/test_one_vararray.nc.dap} | Bin 599 -> 736 bytes .../rawtestfiles/test_one_vararray.nc.dmr} | 7 +- .../rawtestfiles/test_opaque.nc.dap} | Bin 571 -> 567 bytes .../rawtestfiles}/test_opaque.nc.dmr | 6 + .../rawtestfiles/test_opaque_array.7.nc.dap} | Bin 618 -> 755 bytes .../rawtestfiles/test_opaque_array.7.nc.dmr} | 6 + .../rawtestfiles/test_opaque_array.nc.dap} | Bin 589 -> 828 bytes .../rawtestfiles}/test_opaque_array.nc.dmr | 6 + .../rawtestfiles/test_struct1.nc.dap | Bin 0 -> 632 bytes .../rawtestfiles/test_struct1.nc.dmr} | 18 +- .../rawtestfiles/test_struct_array.8.nc.dap} | Bin 678 -> 815 bytes .../rawtestfiles/test_struct_array.8.nc.dmr} | 6 + .../rawtestfiles/test_struct_array.nc.dap} | Bin 938 -> 957 bytes .../rawtestfiles}/test_struct_array.nc.dmr | 6 + .../rawtestfiles/test_struct_nested.nc.dap} | Bin 695 -> 830 bytes .../rawtestfiles/test_struct_nested.nc.dmr} | 8 +- .../rawtestfiles/test_struct_nested3.nc.dap} | Bin 608 -> 743 bytes .../rawtestfiles/test_struct_nested3.nc.dmr} | 8 +- .../rawtestfiles/test_struct_type.nc.dap} | Bin 499 -> 636 bytes .../rawtestfiles}/test_struct_type.nc.dmr | 6 + .../resources/rawtestfiles/test_test.nc.dap | Bin 0 -> 754 bytes .../resources/rawtestfiles/test_test.nc.dmr | 20 + .../resources/rawtestfiles/test_unlim.nc.dap | Bin 0 -> 2135 bytes .../resources/rawtestfiles/test_unlim.nc.dmr | 60 + .../resources/rawtestfiles/test_unlim1.nc.dap | Bin 0 -> 2136 bytes .../resources/rawtestfiles/test_unlim1.nc.dmr | 60 + .../resources/rawtestfiles/test_utf8.nc.dap} | Bin 522 -> 659 bytes .../resources/rawtestfiles}/test_utf8.nc.dmr | 6 + .../resources/rawtestfiles/test_vlen1.nc.dap | Bin 0 -> 721 bytes .../resources/rawtestfiles/test_vlen1.nc.dmr | 20 + .../resources/rawtestfiles/test_vlen11.nc.dap | Bin 0 -> 714 bytes .../resources/rawtestfiles/test_vlen11.nc.dmr | 20 + .../resources/rawtestfiles/test_vlen2.nc.dap | Bin 0 -> 937 bytes .../resources/rawtestfiles}/test_vlen2.nc.dmr | 10 + .../resources/rawtestfiles/test_vlen3.nc.dap | Bin 0 -> 676 bytes .../resources/rawtestfiles/test_vlen3.nc.dmr | 19 + .../resources/rawtestfiles/test_vlen4.nc.dap | Bin 0 -> 721 bytes .../resources/rawtestfiles/test_vlen4.nc.dmr | 20 + .../resources/rawtestfiles/test_vlen5.nc.dap | Bin 0 -> 754 bytes .../resources/rawtestfiles/test_vlen5.nc.dmr} | 9 +- .../resources/rawtestfiles/test_vlen6.nc.dap | Bin 0 -> 801 bytes .../resources/rawtestfiles/test_vlen6.nc.dmr | 22 + .../resources/rawtestfiles/test_vlen7.nc.dap | Bin 0 -> 781 bytes .../resources/rawtestfiles/test_vlen7.nc.dmr | 22 + .../resources/rawtestfiles/test_vlen8.nc.dap | Bin 0 -> 907 bytes .../resources/rawtestfiles/test_vlen8.nc.dmr | 24 + .../rawtestfiles/test_zerodim.nc.dap | Bin 0 -> 1436 bytes .../rawtestfiles/test_zerodim.nc.dmr | 39 + .../test/java/dap4/test/Dap4ManifestIF.java | 33 + dap4/src/test/java/dap4/test/Dap4Server.java | 110 + .../test/java/dap4/test/DapTestCommon.java | 404 ++++ .../src/test/java/dap4/test/Dump.java | 3 +- .../test/java/dap4/test/TestConstraints.java | 186 ++ dap4/src/test/java/dap4/test/TestHyrax.java | 190 ++ .../src/test/java/dap4/test/TestParserCE.java | 174 ++ .../test/java/dap4/test/TestParserDMR.java | 186 ++ dap4/src/test/java/dap4/test/TestRaw.java | 206 ++ dap4/src/test/java/dap4/test/TestRemote.java | 180 ++ .../src/test/resources/logback-test.xml | 8 + gradle/any/coverage.gradle | 2 +- gradle/root/fatJars.gradle | 2 + .../ucar/httpservices/HTTPIntercepts.java | 416 ++++ .../java/ucar/httpservices/HTTPMethod.java | 27 +- .../java/ucar/httpservices/HTTPSession.java | 237 +- .../main/java/ucar/httpservices/HTTPUtil.java | 175 +- .../src/main/java/ucar/httpservices/fix | 5 - .../ucar/nc2/util/net/TestHTTPSession.java | 8 +- netcdf-java-bom/build.gradle | 4 +- netcdf-java-platform/build.gradle | 2 +- .../java/ucar/nc2/jni/netcdf/Nc4Iosp.java | 9 +- .../ucar/nc2/jni/netcdf/TestCDF5Reading.java | 6 - opendap/src/test/data/baseline1/fix | 84 - opendap/src/test/data/testdata1/fix | 84 - settings.gradle | 5 +- uicdm/build.gradle | 2 +- uicdm/src/main/java/ucar/nc2/ui/ToolsUI.java | 2 - 765 files changed, 9854 insertions(+), 27171 deletions(-) rename dap4/d4tests/src/test/data/resources/testfiles/test_enum_2.nc => cdm/core/src/test/data/hdf5/test_enum_2.nc4 (100%) delete mode 100644 dap4/d4cdm/build.gradle delete mode 100644 dap4/d4cdm/src/main/java/dap4/cdm/arch.txt delete mode 100644 dap4/d4cdm/src/main/java/dap4/cdm/dsp/CDMCursor.java delete mode 100644 dap4/d4cdm/src/main/java/dap4/cdm/dsp/CDMDMR.java delete mode 100644 dap4/d4cdm/src/main/java/dap4/cdm/dsp/CDMDSP.java delete mode 100644 dap4/d4cdm/src/main/java/dap4/cdm/nc2/CDMArray.java delete mode 100644 dap4/d4cdm/src/main/java/dap4/cdm/nc2/CDMArrayAtomic.java delete mode 100644 dap4/d4cdm/src/main/java/dap4/cdm/nc2/CDMArrayDelegate.java delete mode 100644 dap4/d4cdm/src/main/java/dap4/cdm/nc2/CDMArraySequence.java delete mode 100644 dap4/d4cdm/src/main/java/dap4/cdm/nc2/CDMArrayStructure.java delete mode 100644 dap4/d4cdm/src/main/java/dap4/cdm/nc2/DataToCDM.java delete mode 100644 dap4/d4cdm/src/main/resources/META-INF/services/ucar.nc2.dataset.spi.NetcdfFileProvider delete mode 100644 dap4/d4core/build.gradle delete mode 100644 dap4/d4core/src/main/java/dap4/core/data/ChecksumMode.java delete mode 100644 dap4/d4core/src/main/java/dap4/core/data/Constraint.java delete mode 100644 dap4/d4core/src/main/java/dap4/core/data/DSP.java delete mode 100644 dap4/d4core/src/main/java/dap4/core/data/DataCursor.java delete mode 100644 dap4/d4core/src/main/java/dap4/core/dmr/AnnotatedNode.java delete mode 100644 dap4/d4core/src/main/java/dap4/core/dmr/DapXML.java delete mode 100644 dap4/d4core/src/main/java/dap4/core/dmr/parser/bison/Bison.java delete mode 100644 dap4/d4core/src/main/java/dap4/core/dmr/parser/bison/Dap4Actions.java delete mode 100644 dap4/d4core/src/main/java/dap4/core/dmr/parser/bison/Dap4BisonParser.java delete mode 100644 dap4/d4core/src/main/java/dap4/core/dmr/parser/bison/Dap4EventHandler.java delete mode 100644 dap4/d4core/src/main/java/dap4/core/dmr/parser/bison/Dap4ParserImpl.java delete mode 100644 dap4/d4core/src/main/java/dap4/core/dmr/parser/bison/Dap4Token.java delete mode 100644 dap4/d4core/src/main/java/dap4/core/dmr/parser/bison/Debug.java delete mode 100644 dap4/d4core/src/main/java/dap4/core/dmr/parser/bison/LexException.java delete mode 100644 dap4/d4core/src/main/java/dap4/core/dmr/parser/bison/Lexeme.java delete mode 100644 dap4/d4core/src/main/java/dap4/core/dmr/parser/bison/SaxEvent.java delete mode 100644 dap4/d4core/src/main/java/dap4/core/dmr/parser/bison/SaxEventHandler.java delete mode 100644 dap4/d4core/src/main/java/dap4/core/dmr/parser/bison/SaxEventType.java delete mode 100644 dap4/d4core/src/main/java/dap4/core/util/Index.java delete mode 100644 dap4/d4core/src/main/java/dap4/core/util/MultiOdometer.java delete mode 100644 dap4/d4core/src/main/java/dap4/core/util/Odometer.java delete mode 100644 dap4/d4core/src/main/java/dap4/core/util/ScalarOdometer.java delete mode 100644 dap4/d4lib/build.gradle delete mode 100644 dap4/d4lib/src/main/java/dap4/dap4lib/AbstractCursor.java delete mode 100644 dap4/d4lib/src/main/java/dap4/dap4lib/AbstractDSP.java delete mode 100644 dap4/d4lib/src/main/java/dap4/dap4lib/ChunkInputStream.java delete mode 100644 dap4/d4lib/src/main/java/dap4/dap4lib/DSPPrinter.java delete mode 100644 dap4/d4lib/src/main/java/dap4/dap4lib/Dap4Util.java delete mode 100644 dap4/d4lib/src/main/java/dap4/dap4lib/DapProtocol.java delete mode 100644 dap4/d4lib/src/main/java/dap4/dap4lib/FileDSP.java delete mode 100644 dap4/d4lib/src/main/java/dap4/dap4lib/HttpDSP.java delete mode 100644 dap4/d4lib/src/main/java/dap4/dap4lib/XURI.java delete mode 100644 dap4/d4lib/src/main/java/dap4/dap4lib/keep.jar delete mode 100644 dap4/d4lib/src/main/java/dap4/dap4lib/netcdf/Nc4Cursor.java delete mode 100644 dap4/d4lib/src/main/java/dap4/dap4lib/netcdf/Nc4DMR.java delete mode 100644 dap4/d4lib/src/main/java/dap4/dap4lib/netcdf/Nc4DMRCompiler.java delete mode 100644 dap4/d4lib/src/main/java/dap4/dap4lib/netcdf/Nc4DSP.java delete mode 100644 dap4/d4lib/src/main/java/dap4/dap4lib/netcdf/Nc4Notes.java delete mode 100644 dap4/d4lib/src/main/java/dap4/dap4lib/serial/D4Cursor.java delete mode 100644 dap4/d4lib/src/main/java/dap4/dap4lib/serial/D4DSP.java delete mode 100644 dap4/d4lib/src/main/java/dap4/dap4lib/serial/D4DataCompiler.java delete mode 100644 dap4/d4tests/build.gradle delete mode 100644 dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_anon_dim.syn.2.raw.txt delete mode 100644 dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_anon_dim.syn.raw.txt delete mode 100644 dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_atomic_array.nc.5.raw.txt delete mode 100644 dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_atomic_array.nc.raw.txt delete mode 100644 dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_atomic_array.syn.raw.txt delete mode 100644 dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_atomic_types.nc.raw.txt delete mode 100644 dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_atomic_types.syn.raw.txt delete mode 100644 dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_fill.nc.raw.txt delete mode 100644 dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_one_var.nc.raw.txt delete mode 100644 dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_one_vararray.nc.3.raw.txt delete mode 100644 dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_sequence_1.syn.raw.txt delete mode 100644 dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_struct_array.nc.6.raw.txt delete mode 100644 dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_struct_array.syn.raw.txt delete mode 100644 dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_anon_dim.syn.raw delete mode 100644 dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_atomic_types.syn.raw delete mode 100644 dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_one_vararray.nc.raw delete mode 100644 dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_opaque.nc.raw delete mode 100644 dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_sequence_1.syn.raw delete mode 100644 dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_sequence_2.syn.raw delete mode 100644 dap4/d4tests/src/test/data/resources/TestConstraints/baseline/test_anon_dim.syn.2.raw.txt delete mode 100644 dap4/d4tests/src/test/data/resources/TestConstraints/baseline/test_atomic_array.nc.5.raw.txt delete mode 100644 dap4/d4tests/src/test/data/resources/TestConstraints/baseline/test_atomic_array.nc.8.raw.txt delete mode 100644 dap4/d4tests/src/test/data/resources/TestConstraints/baseline/test_atomic_array.nc.9.raw.txt delete mode 100644 dap4/d4tests/src/test/data/resources/TestConstraints/baseline/test_enum_array.nc.4.raw.txt delete mode 100644 dap4/d4tests/src/test/data/resources/TestConstraints/baseline/test_one_vararray.nc.1.raw.txt delete mode 100644 dap4/d4tests/src/test/data/resources/TestConstraints/baseline/test_one_vararray.nc.3.raw.txt delete mode 100644 dap4/d4tests/src/test/data/resources/TestConstraints/baseline/test_opaque_array.nc.7.raw.txt delete mode 100644 dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_anon_dim.syn.2.raw.txt delete mode 100644 dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_anon_dim.syn.raw.txt delete mode 100644 dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_atomic_array.nc.5.raw.txt delete mode 100644 dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_atomic_array.nc.8.raw.txt delete mode 100644 dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_atomic_array.nc.9.raw.txt delete mode 100644 dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_atomic_array.nc.raw.txt delete mode 100644 dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_atomic_array.syn.raw.txt delete mode 100644 dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_atomic_types.nc.raw.txt delete mode 100644 dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_atomic_types.syn.raw.txt delete mode 100644 dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_enum.nc.raw.txt delete mode 100644 dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_enum_2.nc.raw.txt delete mode 100644 dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_enum_array.nc.4.raw.txt delete mode 100644 dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_enum_array.nc.raw.txt delete mode 100644 dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_fill.nc.raw.txt delete mode 100644 dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_groups1.nc.raw.txt delete mode 100644 dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_one_var.nc.raw.txt delete mode 100644 dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_one_vararray.nc.1.raw.txt delete mode 100644 dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_one_vararray.nc.raw.txt delete mode 100644 dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_opaque.nc.raw.txt delete mode 100644 dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_opaque_array.nc.7.raw.txt delete mode 100644 dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_opaque_array.nc.raw.txt delete mode 100644 dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_sequence_1.syn.raw.txt delete mode 100644 dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_sequence_2.syn.raw.txt delete mode 100644 dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_struct_array.nc.6.raw.txt delete mode 100644 dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_struct_array.syn.raw.txt delete mode 100644 dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_struct_nested.hdf5.raw.txt delete mode 100644 dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_struct_nested3.hdf5.raw.txt delete mode 100644 dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_struct_type.nc.raw.txt delete mode 100644 dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_utf8.nc.raw.txt delete mode 100644 dap4/d4tests/src/test/data/resources/TestDSR/baseline/test1.dsr delete mode 100644 dap4/d4tests/src/test/data/resources/TestFilters/baseline/test_sequence_1.syn.1.dap delete mode 100644 dap4/d4tests/src/test/data/resources/TestFilters/baseline/test_sequence_1.syn.1.dmr delete mode 100644 dap4/d4tests/src/test/data/resources/TestFilters/baseline/test_sequence_1.syn.2.dap delete mode 100644 dap4/d4tests/src/test/data/resources/TestFrontPage/baseline/test_frontpage.html delete mode 100644 dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_0.1.xml delete mode 100644 dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_0.xml delete mode 100644 dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_1.xml delete mode 100644 dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_2.1.xml delete mode 100644 dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_2.xml delete mode 100644 dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_3.1.xml delete mode 100644 dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_3.2.xml delete mode 100644 dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_3.3.xml delete mode 100644 dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_3.4.xml delete mode 100644 dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_3.5.xml delete mode 100644 dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_3.xml delete mode 100644 dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_4.1.xml delete mode 100644 dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_4.xml delete mode 100644 dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_5.1.xml delete mode 100644 dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_5.xml delete mode 100644 dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_6.1.xml delete mode 100644 dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_6.2.xml delete mode 100644 dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_6.xml delete mode 100644 dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_7.1.xml delete mode 100644 dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_7.2.xml delete mode 100644 dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_7.3.xml delete mode 100644 dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_7.4.xml delete mode 100644 dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_7.5.xml delete mode 100644 dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_7.xml delete mode 100644 dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_8.xml delete mode 100644 dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_array_1.xml delete mode 100644 dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_array_10.xml delete mode 100644 dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_array_11.xml delete mode 100644 dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_array_2.xml delete mode 100644 dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_array_3.xml delete mode 100644 dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_array_4.xml delete mode 100644 dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_array_5.xml delete mode 100644 dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_array_6.xml delete mode 100644 dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_array_7.xml delete mode 100644 dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_array_8.xml delete mode 100644 dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_escaped_paths.xml delete mode 100644 dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_1.dmr delete mode 100644 dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_1.xml delete mode 100644 dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_10.xml delete mode 100644 dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_2.xml delete mode 100644 dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_3.xml delete mode 100644 dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_3_error_1.xml delete mode 100644 dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_3_error_2.xml delete mode 100644 dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_3_error_3.xml delete mode 100644 dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_4.xml delete mode 100644 dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_5.xml delete mode 100644 dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_6.xml delete mode 100644 dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_7.xml delete mode 100644 dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_8.xml delete mode 100644 dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_9.1.xml delete mode 100644 dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_9.xml delete mode 100644 dap4/d4tests/src/test/data/resources/TestHyrax/hyrax.html delete mode 100644 dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_struct_array.nc.nc4.dap delete mode 100644 dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_struct_nested.nc.nc4.dmr delete mode 100644 dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_vlen1.nc.nc4.dap delete mode 100644 dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_vlen1.nc.nc4.dmr delete mode 100644 dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_vlen2.nc.nc4.dap delete mode 100644 dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_vlen3.nc.nc4.dap delete mode 100644 dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_vlen4.nc.nc4.dap delete mode 100644 dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_vlen5.nc.nc4.dap delete mode 100644 dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_anon_dim.syn.dmp delete mode 100644 dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_atomic_array.nc.dmp delete mode 100644 dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_atomic_array.syn.dmp delete mode 100644 dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_atomic_types.nc.dmp delete mode 100644 dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_atomic_types.syn.dmp delete mode 100644 dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_enum.nc.dmp delete mode 100644 dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_enum_2.nc.dmp delete mode 100644 dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_enum_array.nc.dmp delete mode 100644 dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_fill.nc.dmp delete mode 100644 dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_groups1.nc.dmp delete mode 100644 dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_one_var.nc.dmp delete mode 100644 dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_one_vararray.nc.dmp delete mode 100644 dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_opaque.nc.dmp delete mode 100644 dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_opaque_array.nc.dmp delete mode 100644 dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_sequence_1.syn.dmp delete mode 100644 dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_sequence_2.syn.dmp delete mode 100644 dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_struct_array.nc.dmp delete mode 100644 dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_struct_array.syn.dmp delete mode 100644 dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_struct_nested.hdf5.dmp delete mode 100644 dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_struct_nested3.hdf5.dmp delete mode 100644 dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_struct_type.nc.dmp delete mode 100644 dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_utf8.nc.dmp delete mode 100644 dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_vlen1.nc.dmp delete mode 100644 dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_vlen2.nc.dmp delete mode 100644 dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_vlen3.hdf5.dmp delete mode 100644 dap4/d4tests/src/test/data/resources/TestParsers/baseline/testall.dmp delete mode 100644 dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_atomic_array.nc.dmr delete mode 100644 dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_atomic_array.syn.dmr delete mode 100644 dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_atomic_types.nc.dmr delete mode 100644 dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_atomic_types.syn.dmr delete mode 100644 dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_enum.nc.dmr delete mode 100644 dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_enum_array.nc.dmr delete mode 100644 dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_groups1.nc.dmr delete mode 100644 dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_one_var.nc.dmr delete mode 100644 dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_one_vararray.nc.dmr delete mode 100644 dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_struct_array.nc.dmr delete mode 100644 dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_struct_nested.hdf5.dmr delete mode 100644 dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_struct_nested3.hdf5.dmr delete mode 100644 dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_struct_type.nc.dmr delete mode 100644 dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_utf8.nc.dmr delete mode 100644 dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_vlen1.nc.dmr delete mode 100644 dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_vlen3.hdf5.dmr delete mode 100644 dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_vlen5.hdf5.dmr delete mode 100644 dap4/d4tests/src/test/data/resources/TestParsers/dmrset/testall.dmr delete mode 100644 dap4/d4tests/src/test/data/resources/TestParsers/testinput/ce1.txt delete mode 100644 dap4/d4tests/src/test/data/resources/TestParsers/testinput/ce1_dmr.txt delete mode 100644 dap4/d4tests/src/test/data/resources/TestParsers/testinput/test_misc1.xml delete mode 100644 dap4/d4tests/src/test/data/resources/TestParsers/testinput/test_misc2.xml delete mode 100644 dap4/d4tests/src/test/data/resources/TestParsers/testinput/test_simple_1.xml delete mode 100644 dap4/d4tests/src/test/data/resources/TestParsers/testinput/test_simple_2.xml delete mode 100644 dap4/d4tests/src/test/data/resources/TestParsers/testinput/testall.xml delete mode 100644 dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_aaa.nc.dmp delete mode 100644 dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_atomic_array.nc.0.dmp delete mode 100644 dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_atomic_array.nc.1.dmp delete mode 100644 dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_atomic_array.nc.dmp delete mode 100644 dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_atomic_array.nc.ncdump delete mode 100644 dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_atomic_types.nc.dmp delete mode 100644 dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_atomic_types.nc.ncdump delete mode 100644 dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_enum.nc.dmp delete mode 100644 dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_enum_array.nc.0.dmp delete mode 100644 dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_enum_array.nc.1.dmp delete mode 100644 dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_enum_array.nc.dmp delete mode 100644 dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_groups1.nc.dmp delete mode 100644 dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_groups1.nc.ncdump delete mode 100644 dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_one_var.nc.dmp delete mode 100644 dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_one_var.nc.ncdump delete mode 100644 dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_one_vararray.nc.0.dmp delete mode 100644 dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_one_vararray.nc.1.dmp delete mode 100644 dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_one_vararray.nc.dmp delete mode 100644 dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_struct_array.nc.0.dmp delete mode 100644 dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_struct_array.nc.dmp delete mode 100644 dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_struct_array.nc.ncdump delete mode 100644 dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_struct_nested.hdf5.dmp delete mode 100644 dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_struct_type.nc.dmp delete mode 100644 dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_struct_type.nc.ncdump delete mode 100644 dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_utf8.nc.dmp delete mode 100644 dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_vlen1.nc.dmp delete mode 100644 dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_vlen2.nc.dmp delete mode 100644 dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_vlen3.hdf5.dmp delete mode 100644 dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_vlen5.hdf5.dmp delete mode 100644 dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_anon_dim.syn.dap delete mode 100644 dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_anon_dim.syn.dmr delete mode 100644 dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_atomic_array.nc.dap delete mode 100644 dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_atomic_array.syn.dap delete mode 100644 dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_atomic_types.nc.dap delete mode 100644 dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_atomic_types.syn.dap delete mode 100644 dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_atomic_types.syn.dmr delete mode 100644 dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_enum.nc.dap delete mode 100644 dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_enum_2.nc.dap delete mode 100644 dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_enum_array.nc.dap delete mode 100644 dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_fill.nc.dap delete mode 100644 dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_groups1.nc.dap delete mode 100644 dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_one_var.nc.dap delete mode 100644 dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_one_vararray.nc.dap delete mode 100644 dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_one_vararray.nc.dmr delete mode 100644 dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_opaque.nc.dap delete mode 100644 dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_opaque_array.nc.dap delete mode 100644 dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_sequence_1.syn.dap delete mode 100644 dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_sequence_1.syn.dmr delete mode 100644 dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_sequence_2.syn.dap delete mode 100644 dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_sequence_2.syn.dmr delete mode 100644 dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_struct_array.syn.dap delete mode 100644 dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_struct_nested.hdf5.dap delete mode 100644 dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_struct_nested3.hdf5.dap delete mode 100644 dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_struct_type.nc.dap delete mode 100644 dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_utf8.nc.dap delete mode 100644 dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_anon_dim.syn.2.dap delete mode 100644 dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_anon_dim.syn.2.dmr delete mode 100644 dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_atomic_array.nc.5.dap delete mode 100644 dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_atomic_array.nc.8.dap delete mode 100644 dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_atomic_array.nc.9.dap delete mode 100644 dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_enum_array.nc.4.dap delete mode 100644 dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_one_vararray.nc.1.dap delete mode 100644 dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_one_vararray.nc.3.dap delete mode 100644 dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_opaque_array.nc.7.dap delete mode 100644 dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_struct_array.nc.6.dap delete mode 100644 dap4/d4tests/src/test/data/resources/favicon.ico delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/Makefile delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/dmr/test_aaa.nc.dmr delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/dmr/test_atomic_array.nc.dmr delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/dmr/test_atomic_types.nc.dmr delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/dmr/test_enum.nc.dmr delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/dmr/test_enum1.nc.dmr delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/dmr/test_enum2.nc.dmr delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/dmr/test_enum_array.nc.dmr delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/dmr/test_groups1.nc.dmr delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/dmr/test_numeric_types.nc.dmr delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/dmr/test_one_var.nc.dmr delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/dmr/test_one_vararray.nc.dmr delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/dmr/test_opaque_type.nc.dmr delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/dmr/test_string_type.nc.dmr delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/dmr/test_struct1.nc.dmr delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/dmr/test_struct_array.nc.dmr delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/dmr/test_struct_nested.hdf5.dmr delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/dmr/test_struct_nested.nc.dmr delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/dmr/test_struct_type.nc.dmr delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/dmr/test_utf8.nc.dmr delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/dmr/test_vlen1.nc.dmr delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/dmr/test_vlen2.nc.dmr delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/dmr/test_vlen3.hdf5.dmr delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/dmr/test_vlen3.nc.dmr delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/dmr/test_vlen4.hdf5.dmr delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/dmr/test_vlen5.hdf5.dmr delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/doit delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_anon_dim.syn delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_atomic_array.cdl delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_atomic_array.nc delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_atomic_array.ncdump delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_atomic_array.syn delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_atomic_types.cdl delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_atomic_types.ncdump delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_atomic_types.syn delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_enum.cdl delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_enum.nc delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_enum.ncdump delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_enum1.cdl delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_enum1.nc delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_enum1.ncdump delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_enum_2.cdl delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_enum_2.ncdump delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_enum_array.cdl delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_enum_array.ncdump delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_fill.cdl delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_fill.nc delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_fill.ncdump delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_groups1.cdl delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_groups1.nc delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_groups1.ncdump delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_misc1.nc delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_one_var.cdl delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_one_var.nc delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_one_var.ncdump delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_one_vararray.cdl delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_one_vararray.ncdump delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_opaque.cdl delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_opaque.nc delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_opaque.ncdump delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_opaque_array.cdl delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_opaque_array.ncdump delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_sequence_1.syn delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_sequence_2.syn delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_struct1.cdl delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_struct1.nc delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_struct1.ncdump delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_struct_array.cdl delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_struct_array.nc delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_struct_array.ncdump delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_struct_array.syn delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_struct_nested.cdl delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_struct_nested.hdf5 delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_struct_nested.nc delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_struct_nested.ncdump delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_struct_nested3.cdl delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_struct_nested3.hdf5 delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_struct_nested3.nc delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_struct_nested3.ncdump delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_struct_type.cdl delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_struct_type.nc delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_struct_type.ncdump delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_test.cdl delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_test.nc delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_test.ncdump delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_unlim1.cdl delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_unlim1.ncdump delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_utf8.cdl delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_utf8.ncdump delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_vlen1.cdl delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_vlen1.ncdump delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_vlen10.cdl delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_vlen10.nc delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_vlen10.ncdump delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_vlen11.cdl delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_vlen11.ncdump delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_vlen2.cdl delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_vlen2.nc delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_vlen2.ncdump delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_vlen3.cdl delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_vlen3.ncdump delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_vlen4.cdl delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_vlen4.ncdump delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_vlen5.cdl delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_vlen5.ncdump delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_vlen6.cdl delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_vlen6.ncdump delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_vlen7.cdl delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_vlen7.ncdump delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_vlen8.cdl delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_vlen8.nc delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_vlen8.ncdump delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_vlen9.cdl delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_vlen9.nc delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_vlen9.ncdump delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_zerodim.cdl delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_zerodim.nc delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/test_zerodim.ncdump delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/tst_fills.c delete mode 100644 dap4/d4tests/src/test/data/resources/testfiles/tst_fills.nc delete mode 100644 dap4/d4tests/src/test/java/dap4/test/DapTestCommon.java delete mode 100644 dap4/d4tests/src/test/java/dap4/test/Diff.j delete mode 100644 dap4/d4tests/src/test/java/dap4/test/TestCDMClient.java delete mode 100644 dap4/d4tests/src/test/java/dap4/test/TestDAP4Client.java delete mode 100644 dap4/d4tests/src/test/java/dap4/test/TestDSP.java delete mode 100644 dap4/d4tests/src/test/java/dap4/test/TestH5Iosp.java delete mode 100644 dap4/d4tests/src/test/java/dap4/test/TestHyrax.java delete mode 100644 dap4/d4tests/src/test/java/dap4/test/TestNc4Iosp.java delete mode 100644 dap4/d4tests/src/test/java/dap4/test/TestParserCE.java delete mode 100644 dap4/d4tests/src/test/java/dap4/test/TestParserDMR.java delete mode 100644 dap4/d4tests/src/test/java/dap4/test/TestPrinter.java delete mode 100644 dap4/d4tests/src/test/java/dap4/test/TestSerial.java rename dap4/{d4core => }/src/main/java/dap4/core/ce/CEAST.java (100%) rename dap4/{d4core => }/src/main/java/dap4/core/ce/CECompiler.java (100%) rename dap4/{d4core => }/src/main/java/dap4/core/ce/CEConstraint.java (94%) rename dap4/{d4core => }/src/main/java/dap4/core/ce/Universal.java (100%) rename dap4/{d4core => }/src/main/java/dap4/core/ce/parser/CEActions.java (100%) rename dap4/{d4core => }/src/main/java/dap4/core/ce/parser/CEBisonParser.java (50%) rename dap4/{d4core => }/src/main/java/dap4/core/ce/parser/CELexer.java (100%) rename dap4/{d4core => }/src/main/java/dap4/core/ce/parser/CEParserImpl.java (98%) rename dap4/{d4core => }/src/main/java/dap4/core/dmr/DMRFactory.java (98%) rename dap4/{d4lib/src/main/java/dap4/dap4lib => src/main/java/dap4/core/dmr}/DMRPrinter.java (75%) rename dap4/{d4core => }/src/main/java/dap4/core/dmr/DapAttribute.java (78%) rename dap4/{d4core => }/src/main/java/dap4/core/dmr/DapAttributeSet.java (100%) rename dap4/{d4core => }/src/main/java/dap4/core/dmr/DapDataset.java (98%) rename dap4/{d4core => }/src/main/java/dap4/core/dmr/DapDecl.java (100%) rename dap4/{d4core => }/src/main/java/dap4/core/dmr/DapDimension.java (100%) rename dap4/{d4core => }/src/main/java/dap4/core/dmr/DapEnumConst.java (100%) rename dap4/{d4core => }/src/main/java/dap4/core/dmr/DapEnumeration.java (81%) rename dap4/{d4core => }/src/main/java/dap4/core/dmr/DapGroup.java (92%) rename dap4/{d4core => }/src/main/java/dap4/core/dmr/DapMap.java (72%) rename dap4/{d4core => }/src/main/java/dap4/core/dmr/DapNode.java (93%) rename dap4/{d4core => }/src/main/java/dap4/core/dmr/DapOtherXML.java (100%) rename dap4/{d4core => }/src/main/java/dap4/core/dmr/DapSequence.java (100%) rename dap4/{d4core => }/src/main/java/dap4/core/dmr/DapStructure.java (100%) rename dap4/{d4core => }/src/main/java/dap4/core/dmr/DapType.java (100%) rename dap4/{d4core => }/src/main/java/dap4/core/dmr/DapVariable.java (93%) rename dap4/{d4core => }/src/main/java/dap4/core/dmr/ErrorResponse.java (100%) rename dap4/{d4core => }/src/main/java/dap4/core/dmr/TypeSort.java (100%) rename dap4/{d4core => }/src/main/java/dap4/core/dmr/parser/DOM4Parser.java (94%) rename dap4/{d4core => }/src/main/java/dap4/core/dmr/parser/Dap4Parser.java (100%) rename dap4/{d4core => }/src/main/java/dap4/core/dmr/parser/ParseException.java (100%) rename dap4/{d4core => }/src/main/java/dap4/core/dmr/parser/ParseUtil.java (100%) create mode 100644 dap4/src/main/java/dap4/core/interfaces/CEConstraintIF.java create mode 100644 dap4/src/main/java/dap4/core/interfaces/DataCursor.java create mode 100644 dap4/src/main/java/dap4/core/interfaces/DataIndex.java create mode 100644 dap4/src/main/java/dap4/core/util/ChecksumMode.java rename dap4/{d4core => }/src/main/java/dap4/core/util/ConversionException.java (100%) rename dap4/{d4core => }/src/main/java/dap4/core/util/Convert.java (99%) rename dap4/{d4core => }/src/main/java/dap4/core/util/CoreTypeFcns.java (100%) create mode 100644 dap4/src/main/java/dap4/core/util/DapConstants.java rename dap4/{d4core => }/src/main/java/dap4/core/util/DapContext.java (67%) rename dap4/{d4core => }/src/main/java/dap4/core/util/DapDump.java (74%) rename dap4/{d4core => }/src/main/java/dap4/core/util/DapException.java (100%) rename dap4/{d4core => }/src/main/java/dap4/core/util/DapIterator.java (100%) rename dap4/{d4core => }/src/main/java/dap4/core/util/DapSort.java (100%) rename dap4/{d4core => }/src/main/java/dap4/core/util/DapUtil.java (69%) rename dap4/{d4core => }/src/main/java/dap4/core/util/Escape.java (99%) rename dap4/{d4core => }/src/main/java/dap4/core/util/IndentWriter.java (95%) rename dap4/{d4core => }/src/main/java/dap4/core/util/MultiSlice.java (97%) rename dap4/{d4core => }/src/main/java/dap4/core/util/PowerSet.java (100%) rename dap4/{d4core => }/src/main/java/dap4/core/util/ResponseFormat.java (57%) rename dap4/{d4core => }/src/main/java/dap4/core/util/Slice.java (84%) rename dap4/{d4core => }/src/main/java/dap4/core/util/SliceConstraint.java (100%) rename dap4/{d4core => }/src/main/java/dap4/core/util/SliceIterator.java (100%) create mode 100644 dap4/src/main/java/dap4/core/util/XURI.java create mode 100644 dap4/src/main/java/dap4/dap4lib/D4Cursor.java create mode 100644 dap4/src/main/java/dap4/dap4lib/D4DSP.java create mode 100644 dap4/src/main/java/dap4/dap4lib/D4DataCompiler.java create mode 100644 dap4/src/main/java/dap4/dap4lib/D4Index.java rename dap4/{d4core/src/main/java/dap4/core/data => src/main/java/dap4/dap4lib}/DSPRegistry.java (85%) rename dap4/{d4lib => }/src/main/java/dap4/dap4lib/DapCodes.java (100%) rename dap4/{d4lib => }/src/main/java/dap4/dap4lib/DapLog.java (100%) create mode 100644 dap4/src/main/java/dap4/dap4lib/DapProtocol.java rename dap4/{d4lib => }/src/main/java/dap4/dap4lib/DapStartLog.java (100%) create mode 100644 dap4/src/main/java/dap4/dap4lib/DeChunkedInputStream.java rename dap4/{d4lib => }/src/main/java/dap4/dap4lib/ErrorException.java (100%) create mode 100644 dap4/src/main/java/dap4/dap4lib/HttpDSP.java rename dap4/{d4lib => }/src/main/java/dap4/dap4lib/LibTypeFcns.java (100%) create mode 100644 dap4/src/main/java/dap4/dap4lib/RawDSP.java rename dap4/{d4lib => }/src/main/java/dap4/dap4lib/RequestMode.java (56%) rename dap4/{d4cdm/src/main/java/dap4 => src/main/java/dap4/dap4lib}/cdm/CDMTypeFcns.java (91%) rename dap4/{d4cdm/src/main/java/dap4 => src/main/java/dap4/dap4lib}/cdm/CDMUtil.java (75%) rename dap4/{d4cdm/src/main/java/dap4 => src/main/java/dap4/dap4lib}/cdm/NodeMap.java (98%) rename dap4/{d4cdm/src/main/java/dap4 => src/main/java/dap4/dap4lib}/cdm/nc2/CDMCompiler.java (70%) create mode 100644 dap4/src/main/java/dap4/dap4lib/cdm/nc2/D4StructureDataIterator.java rename dap4/{d4cdm/src/main/java/dap4 => src/main/java/dap4/dap4lib}/cdm/nc2/DMRToCDM.java (97%) rename dap4/{d4cdm/src/main/java/dap4 => src/main/java/dap4/dap4lib}/cdm/nc2/DapNetcdfFile.java (54%) rename dap4/{d4cdm/src/main/java/dap4 => src/main/java/dap4/dap4lib}/cdm/nc2/DapNetcdfFileProvider.java (96%) create mode 100644 dap4/src/main/java/dap4/dap4lib/cdm/nc2/DataToCDM.java create mode 100644 dap4/src/main/resources/META-INF/services/ucar.nc2.dataset.spi.NetcdfFileProvider create mode 100644 dap4/src/test/data/resources/baselineconstraints/test_atomic_array.1.nc.ncdump create mode 100644 dap4/src/test/data/resources/baselineconstraints/test_atomic_array.2.nc.ncdump create mode 100644 dap4/src/test/data/resources/baselineconstraints/test_atomic_array.3.nc.ncdump rename dap4/{d4tests/src/test/data/resources/TestCDMClient/baseline/test_enum_array.nc.raw.txt => src/test/data/resources/baselineconstraints/test_enum_array.6.nc.ncdump} (77%) rename dap4/{d4tests/src/test/data/resources/TestCDMClient/baseline/test_one_vararray.nc.raw.txt => src/test/data/resources/baselineconstraints/test_one_vararray.4.nc.ncdump} (60%) rename dap4/{d4tests/src/test/data/resources/TestIosp/baseline/test_vlen5.nc.nc4.dmr => src/test/data/resources/baselineconstraints/test_one_vararray.5.nc.ncdump} (56%) create mode 100644 dap4/src/test/data/resources/baselineconstraints/test_opaque_array.7.nc.ncdump create mode 100644 dap4/src/test/data/resources/baselineconstraints/test_struct_array.8.nc.ncdump create mode 100644 dap4/src/test/data/resources/baselinehyrax/AIRS.2002.12.01.L3.RetStd_H031.v4.0.21.0.G06101132853.hdf.ncdump create mode 100644 dap4/src/test/data/resources/baselinehyrax/amsre_20060131v5.dat.ncdump create mode 100644 dap4/src/test/data/resources/baselinehyrax/nc4_nc_classic_comp.nc.ncdump create mode 100644 dap4/src/test/data/resources/baselinehyrax/nc4_nc_classic_no_comp.nc.ncdump create mode 100644 dap4/src/test/data/resources/baselinehyrax/nc4_strings.nc.ncdump create mode 100644 dap4/src/test/data/resources/baselinehyrax/nc4_strings_comp.nc.ncdump create mode 100644 dap4/src/test/data/resources/baselinehyrax/nc4_unsigned_types.nc.ncdump create mode 100644 dap4/src/test/data/resources/baselinehyrax/nc4_unsigned_types_comp.nc.ncdump create mode 100644 dap4/src/test/data/resources/baselinehyrax/ref_tst_compounds.nc.ncdump rename dap4/{d4tests/src/test/data/resources/TestCDMClient/baseline/test_atomic_array.nc.8.raw.txt => src/test/data/resources/baselineraw/test_atomic_array.2.nc.ncdump} (59%) rename dap4/{d4tests/src/test/data/resources/TestCDMClient/baseline/test_atomic_array.nc.9.raw.txt => src/test/data/resources/baselineraw/test_atomic_array.3.nc.ncdump} (59%) rename dap4/{d4tests/src/test/data/resources/TestIosp/baseline/test_atomic_array.nc.nc4.dap => src/test/data/resources/baselineraw/test_atomic_array.nc.ncdump} (64%) rename dap4/{d4tests/src/test/data/resources/TestIosp/baseline/test_atomic_types.nc.nc4.dap => src/test/data/resources/baselineraw/test_atomic_types.nc.ncdump} (67%) rename dap4/{d4tests/src/test/data/resources/TestIosp/baseline/test_enum.nc.nc4.dap => src/test/data/resources/baselineraw/test_enum_1.nc.ncdump} (89%) rename dap4/{d4tests/src/test/data/resources/TestCDMClient/baseline/test_enum_2.nc.raw.txt => src/test/data/resources/baselineraw/test_enum_2.nc.ncdump} (83%) create mode 100644 dap4/src/test/data/resources/baselineraw/test_enum_3.nc.ncdump rename dap4/{d4tests/src/test/data/resources/TestCDMClient/baseline/test_enum_array.nc.4.raw.txt => src/test/data/resources/baselineraw/test_enum_array.6.nc.ncdump} (79%) rename dap4/{d4tests/src/test/data/resources/TestIosp/baseline/test_enum_array.nc.nc4.dap => src/test/data/resources/baselineraw/test_enum_array.nc.ncdump} (90%) create mode 100644 dap4/src/test/data/resources/baselineraw/test_fill.nc.ncdump create mode 100644 dap4/src/test/data/resources/baselineraw/test_fill_2.nc.ncdump rename dap4/{d4tests/src/test/data/resources/TestCDMClient/baseline/test_groups1.nc.raw.txt => src/test/data/resources/baselineraw/test_groups1.nc.ncdump} (50%) create mode 100644 dap4/src/test/data/resources/baselineraw/test_misc1.nc.ncdump rename dap4/{d4tests/src/test/data/resources/TestIosp/baseline/test_one_var.nc.nc4.dmr => src/test/data/resources/baselineraw/test_one_var.nc.ncdump} (87%) rename dap4/{d4tests/src/test/data/resources/TestCDMClient/baseline/test_one_vararray.nc.1.raw.txt => src/test/data/resources/baselineraw/test_one_vararray.4.nc.ncdump} (60%) create mode 100644 dap4/src/test/data/resources/baselineraw/test_one_vararray.5.nc.ncdump rename dap4/{d4tests/src/test/data/resources/TestIosp/baseline/test_one_vararray.nc.nc4.dap => src/test/data/resources/baselineraw/test_one_vararray.nc.ncdump} (84%) rename dap4/{d4tests/src/test/data/resources/TestCDMClient/baseline/test_opaque.nc.raw.txt => src/test/data/resources/baselineraw/test_opaque.nc.ncdump} (63%) rename dap4/{d4tests/src/test/data/resources/TestCDMClient/baseline/test_opaque_array.nc.7.raw.txt => src/test/data/resources/baselineraw/test_opaque_array.7.nc.ncdump} (54%) rename dap4/{d4tests/src/test/data/resources/TestCDMClient/baseline/test_opaque_array.nc.raw.txt => src/test/data/resources/baselineraw/test_opaque_array.nc.ncdump} (55%) rename dap4/{d4tests/src/test/data/resources/TestIosp/baseline/test_struct_type.nc.nc4.dmr => src/test/data/resources/baselineraw/test_struct1.nc.ncdump} (74%) rename dap4/{d4tests/src/test/data/resources/TestConstraints/baseline/test_struct_array.nc.6.raw.txt => src/test/data/resources/baselineraw/test_struct_array.8.nc.ncdump} (51%) create mode 100644 dap4/src/test/data/resources/baselineraw/test_struct_array.nc.ncdump rename dap4/{d4tests/src/test/data/resources/TestIosp/baseline/test_struct_nested.nc.nc4.dap => src/test/data/resources/baselineraw/test_struct_nested.nc.ncdump} (74%) rename dap4/{d4tests/src/test/data/resources/TestCDMClient/baseline/test_struct_nested3.hdf5.raw.txt => src/test/data/resources/baselineraw/test_struct_nested3.nc.ncdump} (60%) rename dap4/{d4tests/src/test/data/resources/TestIosp/baseline/test_struct_type.nc.nc4.dap => src/test/data/resources/baselineraw/test_struct_type.nc.ncdump} (91%) create mode 100644 dap4/src/test/data/resources/baselineraw/test_test.nc.ncdump create mode 100644 dap4/src/test/data/resources/baselineraw/test_unlim.nc.ncdump create mode 100644 dap4/src/test/data/resources/baselineraw/test_unlim1.nc.ncdump rename dap4/{d4tests/src/test/data/resources/TestCDMClient/baseline/test_utf8.nc.raw.txt => src/test/data/resources/baselineraw/test_utf8.nc.ncdump} (63%) create mode 100644 dap4/src/test/data/resources/baselineraw/test_vlen1.nc.ncdump create mode 100644 dap4/src/test/data/resources/baselineraw/test_vlen11.nc.ncdump rename dap4/{d4tests/src/test/data/resources/TestIosp/baseline/test_vlen3.nc.nc4.dmr => src/test/data/resources/baselineraw/test_vlen3.nc.ncdump} (70%) create mode 100644 dap4/src/test/data/resources/baselineraw/test_zerodim.nc.ncdump create mode 100644 dap4/src/test/data/resources/baselineremote/test_atomic_array.2.nc.ncdump create mode 100644 dap4/src/test/data/resources/baselineremote/test_atomic_array.3.nc.ncdump rename dap4/{d4tests/src/test/data/resources/TestIosp/baseline/test_atomic_array.nc.nc4.dmr => src/test/data/resources/baselineremote/test_atomic_array.nc.ncdump} (59%) rename dap4/{d4tests/src/test/data/resources/TestIosp/baseline/test_atomic_types.nc.nc4.dmr => src/test/data/resources/baselineremote/test_atomic_types.nc.ncdump} (65%) rename dap4/{d4tests/src/test/data/resources/TestIosp/baseline/test_enum.nc.nc4.dmr => src/test/data/resources/baselineremote/test_enum_1.nc.ncdump} (84%) create mode 100644 dap4/src/test/data/resources/baselineremote/test_enum_2.nc.ncdump create mode 100644 dap4/src/test/data/resources/baselineremote/test_enum_3.nc.ncdump rename dap4/{d4tests/src/test/data/resources/TestCDMClient/baseline/test_enum.nc.raw.txt => src/test/data/resources/baselineremote/test_enum_array.6.nc.ncdump} (68%) rename dap4/{d4tests/src/test/data/resources/TestIosp/baseline/test_enum_array.nc.nc4.dmr => src/test/data/resources/baselineremote/test_enum_array.nc.ncdump} (85%) create mode 100644 dap4/src/test/data/resources/baselineremote/test_fill.nc.ncdump create mode 100644 dap4/src/test/data/resources/baselineremote/test_fill_2.nc.ncdump create mode 100644 dap4/src/test/data/resources/baselineremote/test_groups1.nc.ncdump create mode 100644 dap4/src/test/data/resources/baselineremote/test_misc1.nc.ncdump rename dap4/{d4tests/src/test/data/resources/TestIosp/baseline/test_one_var.nc.nc4.dap => src/test/data/resources/baselineremote/test_one_var.nc.ncdump} (74%) create mode 100644 dap4/src/test/data/resources/baselineremote/test_one_vararray.4.nc.ncdump create mode 100644 dap4/src/test/data/resources/baselineremote/test_one_vararray.5.nc.ncdump rename dap4/{d4tests/src/test/data/resources/TestIosp/baseline/test_one_vararray.nc.nc4.dmr => src/test/data/resources/baselineremote/test_one_vararray.nc.ncdump} (74%) rename dap4/{d4tests/src/test/data/resources/TestIosp/baseline/test_vlen4.nc.nc4.dmr => src/test/data/resources/baselineremote/test_opaque.nc.ncdump} (50%) create mode 100644 dap4/src/test/data/resources/baselineremote/test_opaque_array.7.nc.ncdump create mode 100644 dap4/src/test/data/resources/baselineremote/test_opaque_array.nc.ncdump rename dap4/{d4tests/src/test/data/resources/TestIosp/baseline/test_struct_array.nc.nc4.dmr => src/test/data/resources/baselineremote/test_struct1.nc.ncdump} (66%) create mode 100644 dap4/src/test/data/resources/baselineremote/test_struct_array.8.nc.ncdump create mode 100644 dap4/src/test/data/resources/baselineremote/test_struct_array.nc.ncdump rename dap4/{d4tests/src/test/data/resources/TestCDMClient/baseline/test_struct_nested.hdf5.raw.txt => src/test/data/resources/baselineremote/test_struct_nested.nc.ncdump} (70%) create mode 100644 dap4/src/test/data/resources/baselineremote/test_struct_nested3.nc.ncdump rename dap4/{d4tests/src/test/data/resources/TestCDMClient/baseline/test_struct_type.nc.raw.txt => src/test/data/resources/baselineremote/test_struct_type.nc.ncdump} (79%) create mode 100644 dap4/src/test/data/resources/baselineremote/test_test.nc.ncdump create mode 100644 dap4/src/test/data/resources/baselineremote/test_unlim.nc.ncdump create mode 100644 dap4/src/test/data/resources/baselineremote/test_unlim1.nc.ncdump rename dap4/{d4tests/src/test/data/resources/TestIosp/baseline/test_vlen2.nc.nc4.dmr => src/test/data/resources/baselineremote/test_utf8.nc.ncdump} (54%) create mode 100644 dap4/src/test/data/resources/baselineremote/test_vlen1.nc.ncdump create mode 100644 dap4/src/test/data/resources/baselineremote/test_vlen11.nc.ncdump create mode 100644 dap4/src/test/data/resources/baselineremote/test_zerodim.nc.ncdump create mode 100644 dap4/src/test/data/resources/nctestfiles/test_atomic_array.nc rename dap4/{d4tests/src/test/data/resources/testfiles => src/test/data/resources/nctestfiles}/test_atomic_types.nc (57%) create mode 100644 dap4/src/test/data/resources/nctestfiles/test_enum_1.nc create mode 100644 dap4/src/test/data/resources/nctestfiles/test_enum_2.nc create mode 100644 dap4/src/test/data/resources/nctestfiles/test_enum_3.nc rename dap4/{d4tests/src/test/data/resources/testfiles => src/test/data/resources/nctestfiles}/test_enum_array.nc (74%) create mode 100644 dap4/src/test/data/resources/nctestfiles/test_fill.nc create mode 100644 dap4/src/test/data/resources/nctestfiles/test_groups1.nc create mode 100644 dap4/src/test/data/resources/nctestfiles/test_misc1.nc create mode 100644 dap4/src/test/data/resources/nctestfiles/test_one_var.nc rename dap4/{d4tests/src/test/data/resources/testfiles => src/test/data/resources/nctestfiles}/test_one_vararray.nc (78%) create mode 100644 dap4/src/test/data/resources/nctestfiles/test_opaque.nc rename dap4/{d4tests/src/test/data/resources/testfiles => src/test/data/resources/nctestfiles}/test_opaque_array.nc (76%) create mode 100644 dap4/src/test/data/resources/nctestfiles/test_struct1.nc rename dap4/{d4tests/src/test/data/resources/testfiles/test_vlen5.nc => src/test/data/resources/nctestfiles/test_struct_array.nc} (67%) create mode 100644 dap4/src/test/data/resources/nctestfiles/test_struct_nested.nc create mode 100644 dap4/src/test/data/resources/nctestfiles/test_struct_nested3.nc create mode 100644 dap4/src/test/data/resources/nctestfiles/test_struct_type.nc create mode 100644 dap4/src/test/data/resources/nctestfiles/test_test.nc rename dap4/{d4tests/src/test/data/resources/testfiles => src/test/data/resources/nctestfiles}/test_unlim.nc (58%) rename dap4/{d4tests/src/test/data/resources/testfiles => src/test/data/resources/nctestfiles}/test_unlim1.nc (66%) rename dap4/{d4tests/src/test/data/resources/testfiles => src/test/data/resources/nctestfiles}/test_utf8.nc (76%) rename dap4/{d4tests/src/test/data/resources/testfiles => src/test/data/resources/nctestfiles}/test_vlen1.nc (85%) rename dap4/{d4tests/src/test/data/resources/testfiles => src/test/data/resources/nctestfiles}/test_vlen11.nc (80%) rename dap4/{d4tests/src/test/data/resources/testfiles/test_vlen4.hdf5 => src/test/data/resources/nctestfiles/test_vlen2.nc} (65%) rename dap4/{d4tests/src/test/data/resources/testfiles => src/test/data/resources/nctestfiles}/test_vlen3.nc (81%) rename dap4/{d4tests/src/test/data/resources/testfiles => src/test/data/resources/nctestfiles}/test_vlen4.nc (80%) rename dap4/{d4tests/src/test/data/resources/testfiles/test_vlen5.hdf5 => src/test/data/resources/nctestfiles/test_vlen5.nc} (77%) rename dap4/{d4tests/src/test/data/resources/testfiles => src/test/data/resources/nctestfiles}/test_vlen6.nc (75%) rename dap4/{d4tests/src/test/data/resources/testfiles => src/test/data/resources/nctestfiles}/test_vlen7.nc (75%) rename dap4/{d4tests/src/test/data/resources/testfiles/test_vlen3.hdf5 => src/test/data/resources/nctestfiles/test_vlen8.nc} (66%) create mode 100644 dap4/src/test/data/resources/nctestfiles/test_zerodim.nc create mode 100644 dap4/src/test/data/resources/rawtestfiles/CMakeLists.txt rename dap4/{d4tests/src/test/data/resources/TestCDMClient/testinput/test_atomic_array.nc.5.raw => src/test/data/resources/rawtestfiles/test_atomic_array.1.nc.dap} (75%) rename dap4/{d4tests/src/test/data/resources/TestServletConstraints/baseline/test_atomic_array.nc.5.dmr => src/test/data/resources/rawtestfiles/test_atomic_array.1.nc.dmr} (75%) rename dap4/{d4tests/src/test/data/resources/TestCDMClient/testinput/test_atomic_array.nc.8.raw => src/test/data/resources/rawtestfiles/test_atomic_array.2.nc.dap} (69%) rename dap4/{d4tests/src/test/data/resources/TestServletConstraints/baseline/test_atomic_array.nc.8.dmr => src/test/data/resources/rawtestfiles/test_atomic_array.2.nc.dmr} (64%) rename dap4/{d4tests/src/test/data/resources/TestCDMClient/testinput/test_atomic_array.nc.9.raw => src/test/data/resources/rawtestfiles/test_atomic_array.3.nc.dap} (69%) rename dap4/{d4tests/src/test/data/resources/TestServletConstraints/baseline/test_atomic_array.nc.9.dmr => src/test/data/resources/rawtestfiles/test_atomic_array.3.nc.dmr} (64%) rename dap4/{d4tests/src/test/data/resources/TestCDMClient/testinput/test_atomic_array.nc.raw => src/test/data/resources/rawtestfiles/test_atomic_array.nc.dap} (78%) rename dap4/{d4tests/src/test/data/resources/TestServlet/baseline => src/test/data/resources/rawtestfiles}/test_atomic_array.nc.dmr (86%) rename dap4/{d4tests/src/test/data/resources/TestCDMClient/testinput/test_atomic_types.nc.raw => src/test/data/resources/rawtestfiles/test_atomic_types.nc.dap} (80%) rename dap4/{d4tests/src/test/data/resources/TestServlet/baseline => src/test/data/resources/rawtestfiles}/test_atomic_types.nc.dmr (81%) rename dap4/{d4tests/src/test/data/resources/TestCDMClient/testinput/test_enum.nc.raw => src/test/data/resources/rawtestfiles/test_enum_1.nc.dap} (78%) rename dap4/{d4tests/src/test/data/resources/TestServlet/baseline/test_enum.nc.dmr => src/test/data/resources/rawtestfiles/test_enum_1.nc.dmr} (75%) rename dap4/{d4tests/src/test/data/resources/TestCDMClient/testinput/test_enum_2.nc.raw => src/test/data/resources/rawtestfiles/test_enum_2.nc.dap} (81%) rename dap4/{d4tests/src/test/data/resources/TestServlet/baseline => src/test/data/resources/rawtestfiles}/test_enum_2.nc.dmr (78%) create mode 100644 dap4/src/test/data/resources/rawtestfiles/test_enum_3.nc.dap create mode 100644 dap4/src/test/data/resources/rawtestfiles/test_enum_3.nc.dmr rename dap4/{d4tests/src/test/data/resources/TestCDMClient/testinput/test_enum_array.nc.4.raw => src/test/data/resources/rawtestfiles/test_enum_array.6.nc.dap} (82%) rename dap4/{d4tests/src/test/data/resources/TestServletConstraints/baseline/test_enum_array.nc.4.dmr => src/test/data/resources/rawtestfiles/test_enum_array.6.nc.dmr} (80%) rename dap4/{d4tests/src/test/data/resources/TestCDMClient/testinput/test_enum_array.nc.raw => src/test/data/resources/rawtestfiles/test_enum_array.nc.dap} (75%) rename dap4/{d4tests/src/test/data/resources/TestServlet/baseline => src/test/data/resources/rawtestfiles}/test_enum_array.nc.dmr (79%) rename dap4/{d4tests/src/test/data/resources/TestCDMClient/testinput/test_fill.nc.raw => src/test/data/resources/rawtestfiles/test_fill.nc.dap} (58%) rename dap4/{d4tests/src/test/data/resources/TestServlet/baseline => src/test/data/resources/rawtestfiles}/test_fill.nc.dmr (52%) rename dap4/{d4tests/src/test/data/resources/TestCDMClient/testinput/test_atomic_array.syn.raw => src/test/data/resources/rawtestfiles/test_fill_2.nc.dap} (54%) rename dap4/{d4tests/src/test/data/resources/TestServlet/baseline/test_atomic_array.syn.dmr => src/test/data/resources/rawtestfiles/test_fill_2.nc.dmr} (60%) rename dap4/{d4tests/src/test/data/resources/TestCDMClient/testinput/test_groups1.nc.raw => src/test/data/resources/rawtestfiles/test_groups1.nc.dap} (77%) rename dap4/{d4tests/src/test/data/resources/TestServlet/baseline => src/test/data/resources/rawtestfiles}/test_groups1.nc.dmr (79%) create mode 100644 dap4/src/test/data/resources/rawtestfiles/test_misc1.nc.dap create mode 100644 dap4/src/test/data/resources/rawtestfiles/test_misc1.nc.dmr rename dap4/{d4tests/src/test/data/resources/TestCDMClient/testinput/test_one_var.nc.raw => src/test/data/resources/rawtestfiles/test_one_var.nc.dap} (62%) rename dap4/{d4tests/src/test/data/resources/TestServlet/baseline => src/test/data/resources/rawtestfiles}/test_one_var.nc.dmr (54%) rename dap4/{d4tests/src/test/data/resources/TestCDMClient/testinput/test_one_vararray.nc.1.raw => src/test/data/resources/rawtestfiles/test_one_vararray.4.nc.dap} (69%) rename dap4/{d4tests/src/test/data/resources/TestServletConstraints/baseline/test_one_vararray.nc.1.dmr => src/test/data/resources/rawtestfiles/test_one_vararray.4.nc.dmr} (63%) create mode 100644 dap4/src/test/data/resources/rawtestfiles/test_one_vararray.5.nc.dap rename dap4/{d4tests/src/test/data/resources/TestDSP/baseline/test_one_vararray.nc.3.raw.txt => src/test/data/resources/rawtestfiles/test_one_vararray.5.nc.dmr} (52%) rename dap4/{d4tests/src/test/data/resources/TestCDMClient/testinput/test_one_vararray.nc.3.raw => src/test/data/resources/rawtestfiles/test_one_vararray.nc.dap} (71%) rename dap4/{d4tests/src/test/data/resources/TestServletConstraints/baseline/test_one_vararray.nc.3.dmr => src/test/data/resources/rawtestfiles/test_one_vararray.nc.dmr} (63%) rename dap4/{d4tests/src/test/data/resources/TestCDMClient/testinput/test_anon_dim.syn.2.raw => src/test/data/resources/rawtestfiles/test_opaque.nc.dap} (63%) rename dap4/{d4tests/src/test/data/resources/TestServlet/baseline => src/test/data/resources/rawtestfiles}/test_opaque.nc.dmr (54%) rename dap4/{d4tests/src/test/data/resources/TestCDMClient/testinput/test_opaque_array.nc.7.raw => src/test/data/resources/rawtestfiles/test_opaque_array.7.nc.dap} (68%) rename dap4/{d4tests/src/test/data/resources/TestServletConstraints/baseline/test_opaque_array.nc.7.dmr => src/test/data/resources/rawtestfiles/test_opaque_array.7.nc.dmr} (65%) rename dap4/{d4tests/src/test/data/resources/TestCDMClient/testinput/test_opaque_array.nc.raw => src/test/data/resources/rawtestfiles/test_opaque_array.nc.dap} (55%) rename dap4/{d4tests/src/test/data/resources/TestServlet/baseline => src/test/data/resources/rawtestfiles}/test_opaque_array.nc.dmr (62%) create mode 100644 dap4/src/test/data/resources/rawtestfiles/test_struct1.nc.dap rename dap4/{d4tests/src/test/data/resources/TestServlet/baseline/test_struct_array.syn.dmr => src/test/data/resources/rawtestfiles/test_struct1.nc.dmr} (53%) rename dap4/{d4tests/src/test/data/resources/TestCDMClient/testinput/test_struct_array.nc.6.raw => src/test/data/resources/rawtestfiles/test_struct_array.8.nc.dap} (70%) rename dap4/{d4tests/src/test/data/resources/TestServletConstraints/baseline/test_struct_array.nc.6.dmr => src/test/data/resources/rawtestfiles/test_struct_array.8.nc.dmr} (68%) rename dap4/{d4tests/src/test/data/resources/TestCDMClient/testinput/test_struct_array.syn.raw => src/test/data/resources/rawtestfiles/test_struct_array.nc.dap} (57%) rename dap4/{d4tests/src/test/data/resources/TestServlet/baseline => src/test/data/resources/rawtestfiles}/test_struct_array.nc.dmr (67%) rename dap4/{d4tests/src/test/data/resources/TestCDMClient/testinput/test_struct_nested.hdf5.raw => src/test/data/resources/rawtestfiles/test_struct_nested.nc.dap} (68%) rename dap4/{d4tests/src/test/data/resources/TestServlet/baseline/test_struct_nested.hdf5.dmr => src/test/data/resources/rawtestfiles/test_struct_nested.nc.dmr} (64%) rename dap4/{d4tests/src/test/data/resources/TestCDMClient/testinput/test_struct_nested3.hdf5.raw => src/test/data/resources/rawtestfiles/test_struct_nested3.nc.dap} (66%) rename dap4/{d4tests/src/test/data/resources/TestServlet/baseline/test_struct_nested3.hdf5.dmr => src/test/data/resources/rawtestfiles/test_struct_nested3.nc.dmr} (60%) rename dap4/{d4tests/src/test/data/resources/TestCDMClient/testinput/test_struct_type.nc.raw => src/test/data/resources/rawtestfiles/test_struct_type.nc.dap} (66%) rename dap4/{d4tests/src/test/data/resources/TestServlet/baseline => src/test/data/resources/rawtestfiles}/test_struct_type.nc.dmr (60%) create mode 100644 dap4/src/test/data/resources/rawtestfiles/test_test.nc.dap create mode 100644 dap4/src/test/data/resources/rawtestfiles/test_test.nc.dmr create mode 100644 dap4/src/test/data/resources/rawtestfiles/test_unlim.nc.dap create mode 100644 dap4/src/test/data/resources/rawtestfiles/test_unlim.nc.dmr create mode 100644 dap4/src/test/data/resources/rawtestfiles/test_unlim1.nc.dap create mode 100644 dap4/src/test/data/resources/rawtestfiles/test_unlim1.nc.dmr rename dap4/{d4tests/src/test/data/resources/TestCDMClient/testinput/test_utf8.nc.raw => src/test/data/resources/rawtestfiles/test_utf8.nc.dap} (63%) rename dap4/{d4tests/src/test/data/resources/TestServlet/baseline => src/test/data/resources/rawtestfiles}/test_utf8.nc.dmr (60%) create mode 100644 dap4/src/test/data/resources/rawtestfiles/test_vlen1.nc.dap create mode 100644 dap4/src/test/data/resources/rawtestfiles/test_vlen1.nc.dmr create mode 100644 dap4/src/test/data/resources/rawtestfiles/test_vlen11.nc.dap create mode 100644 dap4/src/test/data/resources/rawtestfiles/test_vlen11.nc.dmr create mode 100644 dap4/src/test/data/resources/rawtestfiles/test_vlen2.nc.dap rename dap4/{d4tests/src/test/data/resources/TestParsers/dmrset => src/test/data/resources/rawtestfiles}/test_vlen2.nc.dmr (50%) create mode 100644 dap4/src/test/data/resources/rawtestfiles/test_vlen3.nc.dap create mode 100644 dap4/src/test/data/resources/rawtestfiles/test_vlen3.nc.dmr create mode 100644 dap4/src/test/data/resources/rawtestfiles/test_vlen4.nc.dap create mode 100644 dap4/src/test/data/resources/rawtestfiles/test_vlen4.nc.dmr create mode 100644 dap4/src/test/data/resources/rawtestfiles/test_vlen5.nc.dap rename dap4/{d4tests/src/test/data/resources/TestParsers/baseline/test_vlen5.hdf5.dmp => src/test/data/resources/rawtestfiles/test_vlen5.nc.dmr} (52%) create mode 100644 dap4/src/test/data/resources/rawtestfiles/test_vlen6.nc.dap create mode 100644 dap4/src/test/data/resources/rawtestfiles/test_vlen6.nc.dmr create mode 100644 dap4/src/test/data/resources/rawtestfiles/test_vlen7.nc.dap create mode 100644 dap4/src/test/data/resources/rawtestfiles/test_vlen7.nc.dmr create mode 100644 dap4/src/test/data/resources/rawtestfiles/test_vlen8.nc.dap create mode 100644 dap4/src/test/data/resources/rawtestfiles/test_vlen8.nc.dmr create mode 100644 dap4/src/test/data/resources/rawtestfiles/test_zerodim.nc.dap create mode 100644 dap4/src/test/data/resources/rawtestfiles/test_zerodim.nc.dmr create mode 100644 dap4/src/test/java/dap4/test/Dap4ManifestIF.java create mode 100644 dap4/src/test/java/dap4/test/Dap4Server.java create mode 100644 dap4/src/test/java/dap4/test/DapTestCommon.java rename dap4/{d4tests => }/src/test/java/dap4/test/Dump.java (98%) create mode 100644 dap4/src/test/java/dap4/test/TestConstraints.java create mode 100644 dap4/src/test/java/dap4/test/TestHyrax.java create mode 100644 dap4/src/test/java/dap4/test/TestParserCE.java create mode 100644 dap4/src/test/java/dap4/test/TestParserDMR.java create mode 100644 dap4/src/test/java/dap4/test/TestRaw.java create mode 100644 dap4/src/test/java/dap4/test/TestRemote.java rename dap4/{d4tests => }/src/test/resources/logback-test.xml (86%) create mode 100644 httpservices/src/main/java/ucar/httpservices/HTTPIntercepts.java delete mode 100644 httpservices/src/main/java/ucar/httpservices/fix delete mode 100644 opendap/src/test/data/baseline1/fix delete mode 100755 opendap/src/test/data/testdata1/fix diff --git a/.github/workflows/deps.yml b/.github/workflows/deps.yml index f76545c2ea..6ab86ef8b8 100644 --- a/.github/workflows/deps.yml +++ b/.github/workflows/deps.yml @@ -1,4 +1,4 @@ -on: [pull_request] +on: [push,pull_request] jobs: check-dependency-availability: diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml index 44309a647f..5cc5e71c0b 100644 --- a/.github/workflows/style.yml +++ b/.github/workflows/style.yml @@ -1,4 +1,4 @@ -on: [pull_request] +on: [push,pull_request] jobs: check-style: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 465ebc5ad4..214d68e14e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,4 +1,4 @@ -on: [pull_request] +on: [push,pull_request] jobs: netcdf-java-tests: diff --git a/bufr/src/main/java/ucar/nc2/iosp/bufr/Construct2.java b/bufr/src/main/java/ucar/nc2/iosp/bufr/Construct2.java index 3932a6fbe5..cb768431d0 100644 --- a/bufr/src/main/java/ucar/nc2/iosp/bufr/Construct2.java +++ b/bufr/src/main/java/ucar/nc2/iosp/bufr/Construct2.java @@ -299,7 +299,7 @@ else if (nbytes == 4) Group g = struct.getParentGroupOrRoot(); if (g == null) log.warn("Struct parent group is null."); - EnumTypedef enumTypedef = g.findEnumeration(ct.getName()); + EnumTypedef enumTypedef = g.findEnumeration(ct.getName(), false); if (enumTypedef == null) { enumTypedef = new EnumTypedef(ct.getName(), ct.getMap()); g.addEnumeration(enumTypedef); diff --git a/cdm-test-utils/src/main/java/ucar/unidata/util/test/UnitTestCommon.java b/cdm-test-utils/src/main/java/ucar/unidata/util/test/UnitTestCommon.java index 8809a4a0b7..04607014ac 100644 --- a/cdm-test-utils/src/main/java/ucar/unidata/util/test/UnitTestCommon.java +++ b/cdm-test-utils/src/main/java/ucar/unidata/util/test/UnitTestCommon.java @@ -209,16 +209,6 @@ public String modify(String text) { ////////////////////////////////////////////////// // Instance variables - // System properties - protected boolean prop_ascii = true; - protected boolean prop_diff = true; - protected boolean prop_baseline = false; - protected boolean prop_visual = false; - protected boolean prop_debug = DEBUG; - protected boolean prop_generate = true; - protected String prop_controls = null; - protected boolean prop_display = false; - protected String title = "Testing"; protected String name = "testcommon"; @@ -231,32 +221,6 @@ public UnitTestCommon() { public UnitTestCommon(String name) { this.title = name; - setSystemProperties(); - } - - /** - * Try to get the system properties - */ - protected void setSystemProperties() { - if (System.getProperty("nodiff") != null) - prop_diff = false; - if (System.getProperty("baseline") != null) - prop_baseline = true; - if (System.getProperty("nogenerate") != null) - prop_generate = false; - if (System.getProperty("debug") != null) - prop_debug = true; - if (System.getProperty("visual") != null) - prop_visual = true; - if (System.getProperty("ascii") != null) - prop_ascii = true; - if (System.getProperty("utf8") != null) - prop_ascii = false; - if (System.getProperty("hasdisplay") != null) - prop_display = true; - if (prop_baseline && prop_diff) - prop_diff = false; - prop_controls = System.getProperty("controls", ""); } ////////////////////////////////////////////////// @@ -379,12 +343,10 @@ protected void unbindstd() { // Copy result into the a specified dir public static void writefile(String path, String content) throws IOException { - File f = new File(path); - if (f.exists()) - f.delete(); - FileWriter out = new FileWriter(f); - out.write(content); - out.close(); + // We need to set the Charset to UTF-8, but that is not possible + // until JDK level 11, so fake it. + byte utf8[] = content.getBytes("UTF-8"); + writefile(path, utf8); } // Copy result into the a specified dir @@ -616,75 +578,4 @@ protected static boolean check(int code, int[] ok) { return false; } - /* - * // Replacement for stderr & stdout - * static public class STDIO - * { - * public STDIO(String name) - * { - * } - * - * public void - * printf(String format, Object... args) - * { - * System.err.println(String.format(format, args)); - * } - * - * public void - * println(String msg) - * { - * printf("%s%n", msg); - * } - * - * public void - * print(String msg) - * { - * printf("%s", msg); - * } - * - * public void - * flush() - * { - * } - * } - * - * static public STDIO stderr = new STDIO("test"); - * static public STDIO stdout = new STDIO("test"); - * - * static TemporaryFolder temporaryfolder = null; - * - * static public File - * makeTemporaryDir(String name) - * throws IOException - * { - * if(temporaryfolder == null) - * temporaryfolder = new TemporaryFolder(); - * return temporaryfolder.newFolder(name); - * } - * - * static public File - * makeTemporaryFile(String name) - * throws IOException - * { - * if(temporaryfolder == null) - * temporaryfolder = new TemporaryFolder(); - * return temporaryfolder.newFile(name); - * } - * static public void - * logify(String s) - * { - * StringReader rs = new StringReader(s); - * BufferedReader r = new BufferedReader(rs); - * String line = null; - * for(; ; ) { - * try { - * line = r.readLine(); - * } catch (IOException ioe) { - * break; - * } - * if(line == null) break; - * System.err.println(line); - * } - * } - */ } diff --git a/cdm/core/src/main/java/ucar/ma2/Index.java b/cdm/core/src/main/java/ucar/ma2/Index.java index 11f6ebb0a6..7d3fea3420 100644 --- a/cdm/core/src/main/java/ucar/ma2/Index.java +++ b/cdm/core/src/main/java/ucar/ma2/Index.java @@ -570,7 +570,7 @@ public Index set(int[] index) { throw new ArrayIndexOutOfBoundsException(); if (rank == 0) return this; - int prefixrank = (hasvlen ? rank : rank - 1); + int prefixrank = (!hasvlen ? rank : rank - 1); System.arraycopy(index, 0, current, 0, prefixrank); if (hasvlen) current[prefixrank] = -1; diff --git a/cdm/core/src/main/java/ucar/nc2/Attribute.java b/cdm/core/src/main/java/ucar/nc2/Attribute.java index b8dca41f7a..fc20509233 100644 --- a/cdm/core/src/main/java/ucar/nc2/Attribute.java +++ b/cdm/core/src/main/java/ucar/nc2/Attribute.java @@ -32,15 +32,6 @@ * @author caron */ public class Attribute extends CDMNode { - /** @deprecated move to jni.Nc4Iosp */ - @Deprecated - private static final String SPECIALPREFIX = "_"; - - /** @deprecated move to jni.Nc4Iosp */ - @Deprecated - static final String[] SPECIALS = - {CDM.NCPROPERTIES, CDM.ISNETCDF4, CDM.SUPERBLOCKVERSION, CDM.DAP4_LITTLE_ENDIAN, CDM.EDU_UCAR_PREFIX}; - /** * Turn a list into a map * @@ -59,20 +50,6 @@ public static Map makeMap(List atts) { return result; } - /** @deprecated move to jni.Nc4Iosp */ - @Deprecated - public static boolean isspecial(Attribute a) { - String nm = a.getShortName(); - if (nm.startsWith(SPECIALPREFIX)) { - /* Check for selected special attributes */ - for (String s : SPECIALS) { - if (nm.startsWith(s)) - return true; /* is special */ - } - } - return false; /* is not special */ - } - /////////////////////////////////////////////////////////////////////////////////// /** diff --git a/cdm/core/src/main/java/ucar/nc2/Dimension.java b/cdm/core/src/main/java/ucar/nc2/Dimension.java index a5bfc510b1..051c237ee6 100644 --- a/cdm/core/src/main/java/ucar/nc2/Dimension.java +++ b/cdm/core/src/main/java/ucar/nc2/Dimension.java @@ -457,9 +457,6 @@ public void setLength(int n) { } else if (isUnlimited) { if (n < 0) throw new IllegalArgumentException("Unlimited Dimension length =" + n + " must >= 0"); - } else { - if (n < 1) - throw new IllegalArgumentException("Dimension length =" + n + " must be > 0"); } this.length = n; } diff --git a/cdm/core/src/main/java/ucar/nc2/Group.java b/cdm/core/src/main/java/ucar/nc2/Group.java index e73edd8277..0af2b83f60 100755 --- a/cdm/core/src/main/java/ucar/nc2/Group.java +++ b/cdm/core/src/main/java/ucar/nc2/Group.java @@ -2,8 +2,10 @@ * Copyright (c) 1998-2018 University Corporation for Atmospheric Research/Unidata * See LICENSE for license information. */ + package ucar.nc2; +import static java.util.Optional.ofNullable; import static ucar.nc2.NetcdfFiles.reservedFullName; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableList; @@ -18,6 +20,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import ucar.ma2.DataType; +import ucar.nc2.constants.CDM; import ucar.nc2.util.EscapeStrings; import ucar.nc2.util.Indent; import java.util.ArrayList; @@ -295,7 +298,7 @@ public Dimension findDimensionLocal(String shortName) { /** The attributes contained by this Group. */ public AttributeContainer attributes() { - return attributes; + return AttributeContainer.filter(attributes, CDM.SPECIALS); } /** Find the attribute by name, return null if not exist */ @@ -316,7 +319,7 @@ public String findAttributeString(String attName, String defaultValue) { /** @deprecated Use attributes() */ @Deprecated public java.util.List getAttributes() { - return AttributeContainer.filter(attributes, Attribute.SPECIALS).getAttributes(); + return attributes().getAttributes(); } /** @deprecated Use attributes() */ @@ -374,20 +377,27 @@ public boolean removeAttributeIgnoreCase(String attName) { //////////////////////////////////////////////////////////////////////// - /** Find a Enumeration in this or a parent Group, using its short name. */ + /** Find a Enumeration in this Group, using its short name. */ @Nullable public EnumTypedef findEnumeration(String name) { + // Keep the old behavior + return findEnumeration(name, false); + } + + /** Find a Enumeration in this or optionally the parent Groups, using its short name. */ + @Nullable + public EnumTypedef findEnumeration(String name, boolean searchup) { if (name == null) return null; // name = NetcdfFile.makeNameUnescaped(name); - for (EnumTypedef d : enumTypedefs) { + // search this group's EnumTypedefs + for (EnumTypedef d : this.getEnumTypedefs()) { if (name.equals(d.getShortName())) return d; } Group parent = getParentGroup(); - if (parent != null) - return parent.findEnumeration(name); - + if (parent != null && searchup) + return parent.findEnumeration(name, searchup); return null; } @@ -515,7 +525,7 @@ void writeCDL(Formatter out, Indent indent, boolean strict) { for (Attribute att : attributes) { // String name = strict ? NetcdfFile.escapeNameCDL(getShortName()) : getShortName(); - if (!Attribute.isspecial(att)) { + if (!CDM.isspecial(att)) { out.format("%s", indent); att.writeCDL(out, strict, null); out.format(";"); @@ -1114,6 +1124,52 @@ public Group.Builder commonParent(Group.Builder other) { return other; } + public Optional findSimilarEnumTypedef(EnumTypedef template, boolean searchup, boolean anyname) { + Optional ed = Optional.empty(); + assert (template != null); + // search this group builders's EnumTypedefs but with constraint on name + ed = this.enumTypedefs.stream() + .filter(e -> (anyname || !template.getShortName().equals(e.getShortName())) && e.equalsMapOnly(template)) + .findFirst(); + if (ed.isPresent()) + return ed; + // Optionally search parents + if (searchup) { + Group.Builder gb = getParentGroup(); + if (gb != null) + ed = gb.findSimilarEnumTypedef(template, searchup, anyname); + if (ed.isPresent()) + return ed; + } + return Optional.empty(); + } + + /** Find a Enumeration in this Group Builder, using its short name. */ + public Optional findEnumTypedef(String name) { + // Keep the old behavior + return findEnumTypedef(name, false); + } + + /** Find a Enumeration in this or a parent Group Builder, using its short name. */ + public Optional findEnumTypedef(String name, boolean searchup) { + if (name == null) + return Optional.empty(); + // name = NetcdfFile.makeNameUnescaped(name); + // search this group builders's EnumTypedefs + Optional ed = this.enumTypedefs.stream().filter(e -> e.shortName.equals(name)).findFirst(); + if (ed.isPresent()) + return ed; + // Optionally search parents + if (searchup) { + Group.Builder gb = getParentGroup(); + if (gb != null) + ed = gb.findEnumTypedef(name, searchup); + if (ed.isPresent()) + return ed; + } + return Optional.empty(); + } + public Builder addEnumTypedef(EnumTypedef typedef) { Preconditions.checkNotNull(typedef); enumTypedefs.add(typedef); @@ -1131,7 +1187,7 @@ public Builder addEnumTypedefs(Collection typedefs) { * Return new or existing. */ public EnumTypedef findOrAddEnumTypedef(String name, Map map) { - Optional opt = findEnumTypedef(name); + Optional opt = findEnumTypedef(name, false); // Find in this group if (opt.isPresent()) { return opt.get(); } else { @@ -1141,10 +1197,6 @@ public EnumTypedef findOrAddEnumTypedef(String name, Map map) { } } - public Optional findEnumTypedef(String name) { - return this.enumTypedefs.stream().filter(e -> e.shortName.equals(name)).findFirst(); - } - /** Add a Variable, throw error if one of the same name if it exists. */ public Builder addVariable(Variable.Builder variable) { Preconditions.checkNotNull(variable); diff --git a/cdm/core/src/main/java/ucar/nc2/NetcdfFile.java b/cdm/core/src/main/java/ucar/nc2/NetcdfFile.java index 9c7f7e3dfb..645328cff4 100644 --- a/cdm/core/src/main/java/ucar/nc2/NetcdfFile.java +++ b/cdm/core/src/main/java/ucar/nc2/NetcdfFile.java @@ -41,12 +41,12 @@ import ucar.ma2.InvalidRangeException; import ucar.ma2.Section; import ucar.ma2.StructureDataIterator; +import ucar.nc2.internal.iosp.hdf5.H5iospNew; import ucar.nc2.internal.iosp.netcdf3.N3headerNew; import ucar.nc2.iosp.AbstractIOServiceProvider; import ucar.nc2.iosp.IOServiceProvider; import ucar.nc2.iosp.IospHelper; import ucar.nc2.iosp.hdf5.H5header; -import ucar.nc2.iosp.hdf5.H5iosp; import ucar.nc2.iosp.netcdf3.N3header; import ucar.nc2.iosp.netcdf3.N3iosp; import ucar.nc2.iosp.netcdf3.SPFactory; @@ -830,7 +830,7 @@ private static IOServiceProvider getIosp(RandomAccessFile raf) throws IOExceptio return SPFactory.getServiceProvider(); } else if (H5header.isValidFile(raf)) { - return new H5iosp(); + return new H5iospNew(); } else { diff --git a/cdm/core/src/main/java/ucar/nc2/NetcdfFiles.java b/cdm/core/src/main/java/ucar/nc2/NetcdfFiles.java index 9aa9c3dba2..3806ee7b02 100644 --- a/cdm/core/src/main/java/ucar/nc2/NetcdfFiles.java +++ b/cdm/core/src/main/java/ucar/nc2/NetcdfFiles.java @@ -70,7 +70,7 @@ public class NetcdfFiles { registerIOProvider("ucar.nc2.internal.iosp.hdf5.H5iospNew"); } catch (Throwable e) { if (loadWarnings) - log.info("Cant load class H5iosp", e); + log.info("Cant load class H5iospNew", e); } try { registerIOProvider("ucar.nc2.stream.NcStreamIosp"); diff --git a/cdm/core/src/main/java/ucar/nc2/Structure.java b/cdm/core/src/main/java/ucar/nc2/Structure.java index 65ab45900b..cc9d4872e6 100644 --- a/cdm/core/src/main/java/ucar/nc2/Structure.java +++ b/cdm/core/src/main/java/ucar/nc2/Structure.java @@ -23,6 +23,7 @@ import ucar.ma2.StructureData; import ucar.ma2.StructureDataIterator; import ucar.ma2.StructureMembers; +import ucar.nc2.constants.CDM; import ucar.nc2.util.Indent; /** @@ -635,7 +636,7 @@ protected void writeCDL(Formatter buf, Indent indent, boolean useFullName, boole buf.format(";%s%n", extraInfo()); for (Attribute att : attributes()) { - if (Attribute.isspecial(att)) + if (CDM.isspecial(att)) continue; buf.format("%s", indent); att.writeCDL(buf, strict, getShortName()); diff --git a/cdm/core/src/main/java/ucar/nc2/Variable.java b/cdm/core/src/main/java/ucar/nc2/Variable.java index 19d6b98060..8410a46274 100644 --- a/cdm/core/src/main/java/ucar/nc2/Variable.java +++ b/cdm/core/src/main/java/ucar/nc2/Variable.java @@ -1025,7 +1025,7 @@ else if (dataType.isEnum()) { indent.incr(); for (Attribute att : attributes()) { - if (Attribute.isspecial(att)) + if (CDM.isspecial(att)) continue; buf.format("%s", indent); att.writeCDL(buf, strict, getShortName()); @@ -1830,7 +1830,7 @@ protected Variable(Builder builder, Group parentGroup) { this.cache = builder.cache; if (this.dataType.isEnum()) { - this.enumTypedef = this.group.findEnumeration(builder.enumTypeName); + this.enumTypedef = this.group.findEnumeration(builder.enumTypeName, true); if (this.enumTypedef == null) { throw new IllegalStateException( String.format("EnumTypedef '%s' does not exist in a parent Group", builder.enumTypeName)); diff --git a/cdm/core/src/main/java/ucar/nc2/constants/CDM.java b/cdm/core/src/main/java/ucar/nc2/constants/CDM.java index 21f06b01c9..c6eeb46725 100644 --- a/cdm/core/src/main/java/ucar/nc2/constants/CDM.java +++ b/cdm/core/src/main/java/ucar/nc2/constants/CDM.java @@ -5,6 +5,8 @@ package ucar.nc2.constants; +import ucar.nc2.Attribute; + /** * CDM constants. * @@ -55,12 +57,31 @@ public class CDM { public static final String TIME_OFFSET_HOUR = "hoursFrom0z"; public static final String RUNTIME_COORDINATE = "runtimeCoordinate"; - // Special Attribute Names used in jni.Nc4Iosp + // Special attributes + + private static final String SPECIALPREFIX = "_"; + + // Define Special attributes that should be suppressed public static final String NCPROPERTIES = "_NCProperties"; public static final String ISNETCDF4 = "_IsNetcdf4"; public static final String SUPERBLOCKVERSION = "_SuperblockVersion"; - public static final String DAP4_LITTLE_ENDIAN = "_DAP4_Little_Endian"; - public static final String EDU_UCAR_PREFIX = "_edu.ucar"; + + static public final String[] SPECIALS = {NCPROPERTIES, ISNETCDF4, SUPERBLOCKVERSION}; + + // public static final String DAP4_LITTLE_ENDIAN = "_DAP4_Little_Endian"; + // public static final String EDU_UCAR_PREFIX = "_edu.ucar"; + + public static boolean isspecial(Attribute a) { + String nm = a.getShortName(); + if (nm.startsWith(SPECIALPREFIX)) { + /* Check for selected special attributes */ + for (String s : SPECIALS) { + if (nm.startsWith(s)) + return true; /* is special */ + } + } + return false; /* is not special */ + } // class not interface, per Bloch edition 2 item 19 private CDM() {} // disable instantiation diff --git a/cdm/core/src/main/java/ucar/nc2/dataset/DatasetUrl.java b/cdm/core/src/main/java/ucar/nc2/dataset/DatasetUrl.java index a333a49a74..2bdab61062 100644 --- a/cdm/core/src/main/java/ucar/nc2/dataset/DatasetUrl.java +++ b/cdm/core/src/main/java/ucar/nc2/dataset/DatasetUrl.java @@ -287,7 +287,7 @@ private static ServiceType decodePathExtension(String path) { if (path.endsWith(".dds") || path.endsWith(".das") || path.endsWith(".dods")) return ServiceType.OPENDAP; - if (path.endsWith(".dmr") || path.endsWith(".dap") || path.endsWith(".dsr")) + if (path.matches("^.*[.](dmr|dap|dsr)([.](xml|html))?$")) return ServiceType.DAP4; if (path.endsWith(".xml") || path.endsWith(".ncml")) @@ -365,7 +365,7 @@ private static ServiceType disambiguateHttp(String location) throws IOException checkDap2 = true; } - if (location.contains("dap4")) { + if (location.contains("dap4") || location.contains("d4ts")) { ServiceType result = checkIfDap4(location); if (result != null) return result; @@ -445,27 +445,27 @@ private static ServiceType checkIfDods(String location) throws IOException { // check for dmr private static ServiceType checkIfDap4(String location) throws IOException { - // Strip off any trailing DAP4 prefix - if (location.endsWith(".dap")) - location = location.substring(0, location.length() - ".dap".length()); - else if (location.endsWith(".dmr")) - location = location.substring(0, location.length() - ".dmr".length()); - else if (location.endsWith(".dmr.xml")) - location = location.substring(0, location.length() - ".dmr.xml".length()); - else if (location.endsWith(".dsr")) - location = location.substring(0, location.length() - ".dsr".length()); - try (HTTPMethod method = HTTPFactory.Get(location + ".dmr.xml")) { + if (!location.matches("^.*[.](dmr|dap|dsr)([.](xml|html))?$")) + return null; + // Strip off any trailing DAP4 suffix + if (location.endsWith(".xml")) + location = location.substring(0, location.length() - ".xml".length()); + else if (location.endsWith(".html")) + location = location.substring(0, location.length() - ".html".length()); + // location must end with dap, dmr, or dsr + location = location.substring(0, location.length() - ".dxx".length()); + + try (HTTPMethod method = HTTPFactory.Get(location + ".dsr.xml")) { int status = method.execute(); if (status == HTTP_OK) { Optional value = method.getResponseHeaderValue("Content-Type"); if (value.isPresent()) { - if (value.get().startsWith("application/vnd.opendap.org")) + if (value.get().contains("application/vnd.opendap.dap4")) return ServiceType.DAP4; } } if (status == HTTP_UNAUTHORIZED || status == HTTP_FORBIDDEN) throw new IOException("Unauthorized to open dataset " + location); - // not dods return null; } diff --git a/cdm/core/src/main/java/ucar/nc2/internal/iosp/hdf5/H5headerNew.java b/cdm/core/src/main/java/ucar/nc2/internal/iosp/hdf5/H5headerNew.java index 765721f8f1..faa7fb8fa6 100644 --- a/cdm/core/src/main/java/ucar/nc2/internal/iosp/hdf5/H5headerNew.java +++ b/cdm/core/src/main/java/ucar/nc2/internal/iosp/hdf5/H5headerNew.java @@ -17,13 +17,8 @@ import java.nio.ShortBuffer; import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; -import java.util.ArrayList; -import java.util.Formatter; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.TimeZone; +import java.util.*; + import ucar.ma2.Array; import ucar.ma2.ArrayChar; import ucar.ma2.ArrayObject; @@ -44,7 +39,6 @@ import ucar.nc2.Structure; import ucar.nc2.Variable; import ucar.nc2.constants.CDM; -import ucar.nc2.filter.Filter; import ucar.nc2.internal.iosp.hdf4.HdfEos; import ucar.nc2.internal.iosp.hdf4.HdfHeaderIF; import ucar.nc2.internal.iosp.hdf5.H5objects.DataObject; @@ -498,7 +492,7 @@ private boolean makeNetcdfGroup(Group.Builder parentGroup, H5Group h5group) thro } if (facadeNested.dobj.mdt.map != null) { - EnumTypedef enumTypedef = parentGroup.findEnumTypedef(facadeNested.name).orElse(null); + EnumTypedef enumTypedef = parentGroup.findEnumTypedef(facadeNested.name, true).orElse(null); if (enumTypedef == null) { DataType basetype; switch (facadeNested.dobj.mdt.byteSize) { @@ -554,7 +548,7 @@ private boolean makeNetcdfGroup(Group.Builder parentGroup, H5Group h5group) thro } // This code apparently addresses the possibility of an anonymous enum LOOK ?? if (enumTypeName.isEmpty()) { - EnumTypedef enumTypedef = parentGroup.findEnumTypedef(facadeNested.name).orElse(null); + EnumTypedef enumTypedef = parentGroup.findEnumTypedef(facadeNested.name, true).get(); if (enumTypedef == null) { enumTypedef = new EnumTypedef(facadeNested.name, facadeNested.dobj.mdt.map); parentGroup.addEnumTypedef(enumTypedef); @@ -1553,14 +1547,51 @@ private boolean makeVariableShapeAndType(Group.Builder parent, Variable.Builder // set the enumTypedef if (dt.isEnum()) { - // TODO Not sure why, but there may be both a user type and a "local" mdt enum. May need to do a value match? - EnumTypedef enumTypedef = parent.findEnumTypedef(mdt.enumTypeName).orElse(null); - if (enumTypedef == null) { // if shared object, wont have a name, shared version gets added later - EnumTypedef local = new EnumTypedef(mdt.enumTypeName, mdt.map); - enumTypedef = parent.enumTypedefs.stream().filter((e) -> e.equalsMapOnly(local)).findFirst().orElse(local); - parent.addEnumTypedef(enumTypedef); - } - v.setEnumTypeName(enumTypedef.getShortName()); + // dmh: HDF5, at least as used by netcdf-4, defines an enumeration type multiple times. + // One is when the enum type is defined, and then for every variable or field typed by that + // enum type, another enum type is created but with the name of the variable/field instead of + // the name of the actual type. This appears to be because H5header(New) does not pass + // down enough information for the HDF5->CDM translator to recognize the second case. + // The solution provided is to see if the following conditions hold when an enum typed + // variable is encountered: + // 1. The enum name is the same as the variable name. + // 2. There is no enum of that name in the current group. + // 3. There is another enum type in some containing group + // that is structurally identical to the EnumTypedef -- but with a + // different name -- associated with the variable. This is in contrast + // to testing for name equality. + // + // If all three conditions are true, then use the enum found + // in condition 3 as the enum type for the variable. + // Note that provision is made only for a shortname rather than a + // fully qualified name, which is incorrect, but too hard to change. + // + // If condition 1 if false, then it is ok to create a new EnumTypedef. + // Else if condition 2 is false then it is an error because the existence + // of such an enum is illegal netcdf-4 because duplicate name. + // Else if condition 3 is false, then it is an error because the + // variable's enum type is not defined. + + EnumTypedef actualEnumTypedef = null; // The final chosen EnumTypedef + // Create the variables EnumTypedef on speculation + EnumTypedef template = new EnumTypedef(mdt.enumTypeName, mdt.map); + if (template.getShortName().equals(v.shortName)) { // Condition 1 + Optional candidate = parent.findEnumTypedef(mdt.enumTypeName, false); + if (!candidate.isPresent()) { // Condition 2 + candidate = parent.findSimilarEnumTypedef(template, true, false); + if (candidate.isPresent()) // Condition 3; use correct EnumTypedef + actualEnumTypedef = candidate.get(); + else { // !Condition 3 + log.warn("EnumTypedef is missing for variable: {}", v.shortName); + throw new IllegalStateException("EnumTypedef is missing for variable: " + v.shortName); + } + } else { // !Condition 2 + log.warn("Duplicate name: EnumTypedef and Variable: {}", v.shortName); + throw new IllegalStateException("Duplicate name: EnumTypedef and Variable: " + v.shortName); + } + } else // ! Condition 1; use template + actualEnumTypedef = template; + v.setEnumTypeName(actualEnumTypedef.getShortName()); } return true; @@ -1610,6 +1641,10 @@ public class Vinfo { boolean useFillValue; byte[] fillValue; + public DataBTree getBtree() { + return btree; + } + public String getCompression() { if (mfp == null) return null; diff --git a/cdm/core/src/main/java/ucar/nc2/internal/iosp/hdf5/H5iospNew.java b/cdm/core/src/main/java/ucar/nc2/internal/iosp/hdf5/H5iospNew.java index e881ee9103..771737de0e 100644 --- a/cdm/core/src/main/java/ucar/nc2/internal/iosp/hdf5/H5iospNew.java +++ b/cdm/core/src/main/java/ucar/nc2/internal/iosp/hdf5/H5iospNew.java @@ -97,7 +97,7 @@ public String getFileTypeDescription() { return "Hierarchical Data Format, version 5"; } - RandomAccessFile getRandomAccessFile() { + public RandomAccessFile getRandomAccessFile() { return raf; } diff --git a/cdm/core/src/main/java/ucar/nc2/internal/iosp/hdf5/H5objects.java b/cdm/core/src/main/java/ucar/nc2/internal/iosp/hdf5/H5objects.java index 110885a280..23794555d0 100644 --- a/cdm/core/src/main/java/ucar/nc2/internal/iosp/hdf5/H5objects.java +++ b/cdm/core/src/main/java/ucar/nc2/internal/iosp/hdf5/H5objects.java @@ -1774,7 +1774,7 @@ String getName() { } int getId() { - return (int) this.properties.get(Filters.Keys.ID); + return ((Short) this.properties.get(Filters.Keys.ID)).intValue(); } Map getProperties() { diff --git a/cdm/core/src/main/java/ucar/nc2/internal/iosp/netcdf3/N3headerWriter.java b/cdm/core/src/main/java/ucar/nc2/internal/iosp/netcdf3/N3headerWriter.java index 2cb14b793e..74d60d5f9b 100644 --- a/cdm/core/src/main/java/ucar/nc2/internal/iosp/netcdf3/N3headerWriter.java +++ b/cdm/core/src/main/java/ucar/nc2/internal/iosp/netcdf3/N3headerWriter.java @@ -19,6 +19,7 @@ import ucar.nc2.Dimension; import ucar.nc2.NetcdfFile; import ucar.nc2.Variable; +import ucar.nc2.constants.CDM; import ucar.unidata.io.RandomAccessFile; /** Class to write a netcdf3 header. */ @@ -217,8 +218,8 @@ int sizeHeader(boolean largeFile) { private void writeAtts(Iterable atts, Formatter fout) throws IOException { - final List attributesToWrite = StreamSupport.stream(atts.spliterator(), false) - .filter(att -> !Attribute.isspecial(att)).collect(Collectors.toList()); + final List attributesToWrite = + StreamSupport.stream(atts.spliterator(), false).filter(att -> !CDM.isspecial(att)).collect(Collectors.toList()); int n = Iterables.size(attributesToWrite); if (n == 0) { diff --git a/cdm/core/src/main/java/ucar/nc2/iosp/hdf5/H5header.java b/cdm/core/src/main/java/ucar/nc2/iosp/hdf5/H5header.java index 3db0bd88c1..5d6f73d268 100644 --- a/cdm/core/src/main/java/ucar/nc2/iosp/hdf5/H5header.java +++ b/cdm/core/src/main/java/ucar/nc2/iosp/hdf5/H5header.java @@ -489,7 +489,7 @@ private boolean makeNetcdfGroup(ucar.nc2.Group ncGroup, H5Group h5group) throws } if (facadeNested.dobj.mdt.map != null) { - EnumTypedef enumTypedef = ncGroup.findEnumeration(facadeNested.name); + EnumTypedef enumTypedef = ncGroup.findEnumeration(facadeNested.name, false); if (enumTypedef == null) { DataType basetype; switch (facadeNested.dobj.mdt.byteSize) { @@ -547,7 +547,7 @@ private boolean makeNetcdfGroup(ucar.nc2.Group ncGroup, H5Group h5group) throws // This code apparently addresses the possibility of an anonymous enum LOOK ?? String ename = enumTypedef.getShortName(); if (ename == null || ename.isEmpty()) { - enumTypedef = ncGroup.findEnumeration(facadeNested.name); + enumTypedef = ncGroup.findEnumeration(facadeNested.name, false); if (enumTypedef == null) { enumTypedef = new EnumTypedef(facadeNested.name, facadeNested.dobj.mdt.map); ncGroup.addEnumeration(enumTypedef); @@ -1745,7 +1745,7 @@ private boolean makeVariableShapeAndType(Variable v, MessageDatatype mdt, Messag ncGroup.getEnumTypedefs().stream().filter((e) -> e.equalsMapOnly(local)).findFirst().orElse(local); if (enumTypedef != null) { // if found, make sure it is added to the group - ncGroup.addEnumeration(enumTypedef); + assert (ncGroup.getEnumTypedefs().contains(enumTypedef)); } else { // if shared object, wont have a name, shared version gets added later enumTypedef = new EnumTypedef(mdt.enumTypeName, mdt.map); ncGroup.addEnumeration(enumTypedef); diff --git a/cdm/core/src/main/java/ucar/nc2/ncml/NcMLReader.java b/cdm/core/src/main/java/ucar/nc2/ncml/NcMLReader.java index 189a8a2abd..c757a94a1f 100644 --- a/cdm/core/src/main/java/ucar/nc2/ncml/NcMLReader.java +++ b/cdm/core/src/main/java/ucar/nc2/ncml/NcMLReader.java @@ -996,7 +996,7 @@ private void readVariable(NetcdfDataset ds, Group g, Group refg, Element varElem if (dtype.isEnum()) { String typedefS = varElem.getAttributeValue("typedef"); if (typedefS != null) - typedef = g.findEnumeration(typedefS); + typedef = g.findEnumeration(typedefS, true); } String shape = varElem.getAttributeValue("shape"); @@ -1207,7 +1207,7 @@ private Variable readVariableNew(NetcdfDataset ds, Group g, Structure parentS, E if (dtype.isEnum()) { String typedefS = varElem.getAttributeValue("typedef"); if (typedefS != null) - typedef = g.findEnumeration(typedefS); + typedef = g.findEnumeration(typedefS, true); } String shape = varElem.getAttributeValue("shape"); diff --git a/cdm/core/src/main/java/ucar/nc2/util/CompareNetcdf2.java b/cdm/core/src/main/java/ucar/nc2/util/CompareNetcdf2.java index f71c84a0bc..5de0fa63f4 100644 --- a/cdm/core/src/main/java/ucar/nc2/util/CompareNetcdf2.java +++ b/cdm/core/src/main/java/ucar/nc2/util/CompareNetcdf2.java @@ -165,6 +165,7 @@ public static boolean checkContains(String what, List container, List 0) out.format(","); printStringArray(out, slice, indent, ct); diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_enum_2.nc b/cdm/core/src/test/data/hdf5/test_enum_2.nc4 similarity index 100% rename from dap4/d4tests/src/test/data/resources/testfiles/test_enum_2.nc rename to cdm/core/src/test/data/hdf5/test_enum_2.nc4 diff --git a/cdm/core/src/test/java/ucar/nc2/TestSpecialAttributes.java b/cdm/core/src/test/java/ucar/nc2/TestSpecialAttributes.java index d888260dba..c54effe7fb 100644 --- a/cdm/core/src/test/java/ucar/nc2/TestSpecialAttributes.java +++ b/cdm/core/src/test/java/ucar/nc2/TestSpecialAttributes.java @@ -10,6 +10,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import ucar.nc2.constants.CDM; +import ucar.nc2.iosp.netcdf4.Nc4; import ucar.unidata.util.test.TestDir; import java.io.IOException; import java.lang.invoke.MethodHandles; @@ -21,9 +22,9 @@ public class TestSpecialAttributes { @Test public void testReadAll() throws IOException { NetcdfFile ncfile = TestDir.openFileLocal("testSpecialAttributes.nc4"); - // Iterate over all top-level attributes and see if it is special + // Iterate over all top-level visible attributes and see if it is special for (Attribute a : ncfile.getRootGroup().getAttributes()) { - Assert.assertFalse("Attribute iteration found special attribute: " + a.getShortName(), Attribute.isspecial(a)); + Assert.assertFalse("Attribute iteration found special attribute: " + a.getShortName(), CDM.isspecial(a)); } ncfile.close(); } @@ -34,7 +35,7 @@ public void testReadByName() throws IOException { // Attempt to read special attributes by name for (String name : new String[] {CDM.NCPROPERTIES}) { Attribute special = ncfile.getRootGroup().findAttribute(name); - Assert.assertTrue("Could not access special attribute: " + name, special != null && Attribute.isspecial(special)); + Assert.assertTrue("Could not access special attribute: " + name, special != null && CDM.isspecial(special)); } ncfile.close(); } diff --git a/cdm/core/src/test/java/ucar/nc2/dataset/TestCoordSysCompare.java b/cdm/core/src/test/java/ucar/nc2/dataset/TestCoordSysCompare.java index 650bda95bf..c15198d257 100644 --- a/cdm/core/src/test/java/ucar/nc2/dataset/TestCoordSysCompare.java +++ b/cdm/core/src/test/java/ucar/nc2/dataset/TestCoordSysCompare.java @@ -52,7 +52,7 @@ public void compareCoordSysBuilders() throws IOException { try (NetcdfDataset org = NetcdfDataset.openDataset(fileLocation)) { try (NetcdfDataset withBuilder = NetcdfDatasets.openDataset(fileLocation)) { Formatter f = new Formatter(); - CompareNetcdf2 compare = new CompareNetcdf2(f, false, false, true); + CompareNetcdf2 compare = new CompareNetcdf2(f, false, false, true, false); boolean ok = compare.compare(org, withBuilder, new CoordsObjFilter()); System.out.printf("%s %s%n", ok ? "OK" : "NOT OK", f); System.out.printf("org = %s%n", org.getRootGroup().findAttributeString(_Coordinate._CoordSysBuilder, "")); diff --git a/cdm/core/src/test/java/ucar/nc2/iosp/hdf5/TestDataBTree.java b/cdm/core/src/test/java/ucar/nc2/iosp/hdf5/TestDataBTree.java index a6b018dac2..0964b9446c 100644 --- a/cdm/core/src/test/java/ucar/nc2/iosp/hdf5/TestDataBTree.java +++ b/cdm/core/src/test/java/ucar/nc2/iosp/hdf5/TestDataBTree.java @@ -11,7 +11,7 @@ import org.slf4j.LoggerFactory; import ucar.nc2.NetcdfFile; import ucar.nc2.Variable; -import ucar.nc2.iosp.hdf5.H5header.Vinfo; +import ucar.nc2.internal.iosp.hdf5.H5headerNew; import ucar.unidata.util.test.TestDir; public class TestDataBTree { @@ -34,7 +34,7 @@ public void close() throws Exception { public void shouldReleaseRafs() throws IOException { final Variable variable = netcdfFile.findVariable("data"); assertThat((Object) variable).isNotNull(); - final DataBTree bTree = ((Vinfo) variable.getSPobject()).btree; + final DataBTree bTree = ((H5headerNew.Vinfo) variable.getSPobject()).getBtree(); assertThat(bTree.getRandomAccessFile()).isNotNull(); netcdfFile.release(); @@ -45,7 +45,7 @@ public void shouldReleaseRafs() throws IOException { public void shouldCloseRafs() throws IOException { final Variable variable = netcdfFile.findVariable("data"); assertThat((Object) variable).isNotNull(); - final DataBTree bTree = ((Vinfo) variable.getSPobject()).btree; + final DataBTree bTree = ((H5headerNew.Vinfo) variable.getSPobject()).getBtree(); assertThat(bTree.getRandomAccessFile()).isNotNull(); netcdfFile.close(); diff --git a/cdm/core/src/test/java/ucar/nc2/iosp/hdf5/TestEnumTypedef.java b/cdm/core/src/test/java/ucar/nc2/iosp/hdf5/TestEnumTypedef.java index da45ee3a65..dee04157e5 100644 --- a/cdm/core/src/test/java/ucar/nc2/iosp/hdf5/TestEnumTypedef.java +++ b/cdm/core/src/test/java/ucar/nc2/iosp/hdf5/TestEnumTypedef.java @@ -3,29 +3,53 @@ import static com.google.common.truth.Truth.assertThat; import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import java.lang.invoke.MethodHandles; import ucar.ma2.DataType; -import ucar.nc2.EnumTypedef; -import ucar.nc2.NetcdfFile; -import ucar.nc2.NetcdfFiles; -import ucar.nc2.Variable; +import ucar.nc2.*; import ucar.unidata.util.test.TestDir; /** Test handling of enums in hdf5 / netcdf 4 files. */ +// see Issue #126 public class TestEnumTypedef { + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); + // Test case where enum type is in same group to the variable using it. @Test - public void problem() throws Exception { - try (NetcdfFile ncfile = NetcdfFiles.open(TestDir.cdmLocalTestDataDir + "hdf5/test_atomic_types.nc")) { - Variable primaryCloud = ncfile.findVariable("primary_cloud"); + public void test1() throws Exception { + String s = TestDir.cdmLocalTestDataDir + "hdf5/test_atomic_types.nc"; + logger.info("TestEnumTypedef on {}%n", s); + try (NetcdfFile ncfile = NetcdfFiles.open(s)) { + Variable primaryCloud = ncfile.findVariable("/primary_cloud"); assertThat((Object) primaryCloud).isNotNull(); assertThat(primaryCloud.getDataType().isEnum()); assertThat(primaryCloud.getDataType()).isEqualTo(DataType.ENUM1); assertThat(primaryCloud.getEnumTypedef()).isNotNull(); EnumTypedef typedef = primaryCloud.getEnumTypedef(); assertThat(typedef).isNotNull(); - // TODO disable this until we have a fix see Issue #126 - // assertThat(typedef.getShortName()).isEqualTo("cloud_class_t"); + logger.info("TestEnumTypedef typedef name {}%n", typedef.getShortName()); + assertThat(typedef.getShortName()).isEqualTo("cloud_class_t"); } } + // Test case where enum type is in a parent group to the variable using it. + @Test + public void test2() throws Exception { + String s = TestDir.cdmLocalTestDataDir + "hdf5/test_enum_2.nc4"; + logger.info("TestEnumTypedef on {}%n", s); + try (NetcdfFile ncfile = NetcdfFiles.open(s)) { + Group h = ncfile.findGroup("/h"); + Variable primaryCloud = h.findVariableLocal("primary_cloud"); + assertThat((Object) primaryCloud).isNotNull(); + assertThat(primaryCloud.getDataType().isEnum()); + assertThat(primaryCloud.getDataType()).isEqualTo(DataType.ENUM1); + assertThat(primaryCloud.getEnumTypedef()).isNotNull(); + EnumTypedef typedef = primaryCloud.getEnumTypedef(); + assertThat(typedef).isNotNull(); + logger.info("TestEnumTypedef typedef name {}%n", typedef.getShortName()); + assertThat(typedef.getShortName()).isEqualTo("cloud_class_t"); + } + } } + diff --git a/cdm/core/src/test/java/ucar/nc2/iosp/hdf5/TestH5iosp.java b/cdm/core/src/test/java/ucar/nc2/iosp/hdf5/TestH5iosp.java index fdc07ae719..d056de3a7b 100644 --- a/cdm/core/src/test/java/ucar/nc2/iosp/hdf5/TestH5iosp.java +++ b/cdm/core/src/test/java/ucar/nc2/iosp/hdf5/TestH5iosp.java @@ -10,6 +10,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import ucar.nc2.NetcdfFile; +import ucar.nc2.internal.iosp.hdf5.H5iospNew; import ucar.nc2.iosp.IOServiceProvider; import ucar.unidata.util.test.TestDir; @@ -18,14 +19,14 @@ public class TestH5iosp { private static final String TEST_FILE = TestDir.cdmLocalTestDataDir + "hdf5/structmetadata_eos.h5"; private NetcdfFile netcdfFile; - private H5iosp h5iosp; + private H5iospNew h5iosp; @Before public void open() throws Exception { netcdfFile = NetcdfFile.open(TEST_FILE); final IOServiceProvider iosp = netcdfFile.getIosp(); - assertThat(iosp).isInstanceOf(H5iosp.class); - h5iosp = (H5iosp) iosp; + assertThat(iosp).isInstanceOf(H5iospNew.class); + h5iosp = (H5iospNew) iosp; assertThat(h5iosp).isNotNull(); } diff --git a/cdm/core/src/test/java/ucar/nc2/iosp/netcdf3/TestN3iospCompare.java b/cdm/core/src/test/java/ucar/nc2/iosp/netcdf3/TestN3iospCompare.java index 2af94e4d8a..d98c42610f 100644 --- a/cdm/core/src/test/java/ucar/nc2/iosp/netcdf3/TestN3iospCompare.java +++ b/cdm/core/src/test/java/ucar/nc2/iosp/netcdf3/TestN3iospCompare.java @@ -52,7 +52,7 @@ public void compareWithBuilder() SPFactory.setServiceProvider("ucar.nc2.internal.iosp.netcdf3.N3iospNew"); try (NetcdfFile withBuilder = NetcdfFiles.open(filename)) { Formatter f = new Formatter(); - CompareNetcdf2 compare = new CompareNetcdf2(f, false, false, true); + CompareNetcdf2 compare = new CompareNetcdf2(f, false, false, true, false); if (!compare.compare(org, withBuilder)) { System.out.printf("Compare %s%n%s%n", filename, f); fail(); diff --git a/dap4/build.gradle b/dap4/build.gradle index dbdef58cfb..7df0a6635b 100644 --- a/dap4/build.gradle +++ b/dap4/build.gradle @@ -1,22 +1,40 @@ ext.title = 'Data Access Protocol (DAP) version 4.0' // Will be inherited by subprojects. -// dap4 has no source code nor any artifacts to publish - -// NON-TRANSITIVE Dependency graph: -// module depends on -// ---------------------------------------- -// common: -// d4core nothing -// d4lib d4core httpservices -// d4cdm d4lib cdm -// server: -// d4servletshared d4cdmshared netcdf4 -// d4ts d4servletshared -// d4tswar d4ts -// tests: -// d4tests d4servletshared d4ts - -subprojects { - // TODO: Give the subprojects real titles. - ext.title = "DAP4: $name" +apply from: "$rootDir/gradle/any/dependencies.gradle" +apply from: "$rootDir/gradle/any/java-library.gradle" +apply from: "$rootDir/gradle/any/gretty.gradle" + +dependencies { + api enforcedPlatform(project(':netcdf-java-platform')) + + implementation project(':httpservices') + implementation project(':cdm:cdm-core') + implementation project(':netcdf4') + testImplementation project(':cdm-test-utils') + + implementation 'org.apache.httpcomponents:httpclient' + compileOnly 'org.apache.httpcomponents:httpcore' + compileOnly 'net.java.dev.jna:jna' + compileOnly 'com.beust:jcommander' + compileOnly 'org.slf4j:slf4j-api' + + compileOnly enforcedPlatform(project(':netcdf-java-platform')) + testImplementation enforcedPlatform(project(':netcdf-java-testing-platform')) + testImplementation 'junit:junit' + testImplementation 'org.slf4j:slf4j-api' + testRuntimeOnly 'ch.qos.logback:logback-classic' +} + +test { + systemProperties['testargs'] = System.getProperty('testargs', '') + + include 'dap4/test/TestParserDMR.class' + include 'dap4/test/TestParserCE.class' + include 'dap4/test/TestRaw.class' + include 'dap4/test/TestRemote.class' + include 'dap4/test/TestConstraints.class' + include 'dap4/test/TestHyrax.class' + + dependsOn('farmBeforeIntegrationTest') + finalizedBy('farmAfterIntegrationTest') } diff --git a/dap4/d4cdm/build.gradle b/dap4/d4cdm/build.gradle deleted file mode 100644 index 1337719928..0000000000 --- a/dap4/d4cdm/build.gradle +++ /dev/null @@ -1,11 +0,0 @@ -apply from: "$rootDir/gradle/any/dependencies.gradle" -apply from: "$rootDir/gradle/any/java-library.gradle" - -dependencies { - api enforcedPlatform(project(':netcdf-java-platform')) - - compile project(':dap4:d4core') - compile project(':dap4:d4lib') - compile project(':cdm:cdm-core') - compile project(':netcdf4') -} diff --git a/dap4/d4cdm/src/main/java/dap4/cdm/arch.txt b/dap4/d4cdm/src/main/java/dap4/cdm/arch.txt deleted file mode 100644 index 9b05ad15a3..0000000000 --- a/dap4/d4cdm/src/main/java/dap4/cdm/arch.txt +++ /dev/null @@ -1,36 +0,0 @@ -CDM :: Dap4 Interactions occur in two ways. - -1. Server side. -The goal is to wrap a NetcdfDataset object as a DSP -so it can be written using the DAP4 protocol. -The relevant classes are: - thredds.server.dap4.ThreddsDSP.java (in /tds/src/main/java/thredds/server/dap4 for access reasons) - dap4.cdm.dsp.CDMDSP.java - dap4.cdm.dsp.CDMDataCompoundArray.java - dap4.cdm.dsp.CDMDataDataset.java - dap4.cdm.dsp.CDMDataRecord.java - dap4.cdm.dsp.CDMDataset.java - dap4.cdm.dsp.CDMDataStructure.java - dap4.cdm.dsp.CDMDataVariable.java - dap4.cdm.dsp.CDMDataAtomic.java - -2. Client Side -The goal is to wrap a D4DSP to make it look like a CDM NetcdfDataset. -The D4DSP itself wraps the serialized data of the DAP4 protocol. -The relevant classes are as follows: - dap4.cdm.nc2.DapNetcdfDataset.java - dap4.cdm.nc2.DMRToCDM.java - dap4.cdm.nc2.DataToCDM.java - dap4.cdm.nc2.CDMCompiler.java - dap4.cdm.nc2.CDMArray.java - dap4.cdm.nc2.CDMArrayAtomic.java - dap4.cdm.nc2.CDMArrayDelegate.java - dap4.cdm.nc2.CDMArraySequence.java - dap4.cdm.nc2.CDMArrayStructure.java - -The following are shared Utilities: - CDMUtil.java - NodeMap.java - -What about? - CDMDataFactory.java diff --git a/dap4/d4cdm/src/main/java/dap4/cdm/dsp/CDMCursor.java b/dap4/d4cdm/src/main/java/dap4/cdm/dsp/CDMCursor.java deleted file mode 100644 index 16afc87c86..0000000000 --- a/dap4/d4cdm/src/main/java/dap4/cdm/dsp/CDMCursor.java +++ /dev/null @@ -1,253 +0,0 @@ -/* - * Copyright 2012, UCAR/Unidata. - * See the LICENSE file for more information. - */ - -package dap4.cdm.dsp; - -import dap4.cdm.CDMTypeFcns; -import dap4.cdm.CDMUtil; -import dap4.core.dmr.*; -import dap4.core.util.*; -import dap4.core.util.Index; -import dap4.dap4lib.AbstractCursor; -import ucar.ma2.*; -import java.util.List; - -public class CDMCursor extends AbstractCursor { - ////////////////////////////////////////////////// - // Instance variables - - protected ucar.ma2.Array array = null; - protected ucar.ma2.StructureData structdata = null; // scheme == STRUCTURE - ucar.ma2.StructureMembers.Member member = null; // for field cursors - - ////////////////////////////////////////////////// - // Constructor(s) - - public CDMCursor(Scheme scheme, CDMDSP dsp, DapNode template, CDMCursor container) throws DapException { - super(scheme, dsp, template, container); - } - - public CDMCursor(CDMCursor c) { - super(c); - assert false; - this.array = c.array; - this.structdata = c.structdata; - this.member = c.member; - - } - - ////////////////////////////////////////////////// - // AbstractCursor Abstract Methods - - @Override - public Object read(List slices) throws DapException { - switch (this.scheme) { - case ATOMIC: - return readAtomic(slices); - case STRUCTURE: - if (((DapVariable) this.getTemplate()).getRank() > 0 || DapUtil.isScalarSlices(slices)) - throw new DapException("Cannot slice a scalar variable"); - CDMCursor[] instances = new CDMCursor[1]; - instances[0] = this; - return instances; - case SEQUENCE: - if (((DapVariable) this.getTemplate()).getRank() > 0 || DapUtil.isScalarSlices(slices)) - throw new DapException("Cannot slice a scalar variable"); - instances = new CDMCursor[1]; - instances[0] = this; - return instances; - case STRUCTARRAY: - Odometer odom = Odometer.factory(slices); - instances = new CDMCursor[(int) odom.totalSize()]; - for (int i = 0; odom.hasNext(); i++) { - instances[i] = readStructure(odom.next()); - } - return instances; - case SEQARRAY: - instances = readSequence(slices); - return instances; - default: - throw new DapException("Attempt to slice a scalar object"); - } - } - - @Override - public Object read(Index index) throws DapException { - return read(DapUtil.indexToSlices(index)); - } - - @Override - public CDMCursor readField(int findex) throws DapException { - if (this.scheme != scheme.RECORD && this.scheme != scheme.STRUCTURE) - throw new DapException("Illegal cursor scheme for readfield()"); - DapVariable var = (DapVariable) getTemplate(); - DapStructure basetype = (DapStructure) var.getBaseType(); - if (findex < 0 || findex >= basetype.getFields().size()) - throw new DapException("Field index out of range: " + findex); - CDMCursor fieldcursor = null; - if (this.scheme == Scheme.RECORD) { - DapSequence seq = (DapSequence) basetype; - DapVariable field = seq.getField(0); - DapType fieldtype = field.getBaseType(); - switch (fieldtype.getTypeSort()) { - default: // atomic - DataType cdmfieldtype = CDMTypeFcns.daptype2cdmtype(fieldtype); - if (cdmfieldtype == null) - throw new dap4.core.util.DapException("Unknown field type: " + fieldtype); - int ri = (int) this.recordindex; - Object o = array.getObject(ri); - Array fielddata = CDMTypeFcns.arrayify(cdmfieldtype, o); // not very efficient; should do conversion - fieldcursor = new CDMCursor(Scheme.ATOMIC, (CDMDSP) this.dsp, field, this); - fieldcursor.setArray(fielddata); - break; - case Sequence: - case Structure: - break; - } - } else { // scheme == STRUCTURE - assert this.structdata != null; - fieldcursor = getFieldCursor(this, findex); - } - return fieldcursor; - } - - protected CDMCursor getFieldCursor(CDMCursor container, int findex) throws DapException { - // Now, create a cursors for a field f this instance - DapVariable var = (DapVariable) getTemplate(); - DapStructure type = (DapStructure) var.getBaseType(); - DapVariable field = (DapVariable) type.getFields().get(findex); - DapType ftype = field.getBaseType(); - Scheme scheme = schemeFor(field); - CDMCursor fc = new CDMCursor(scheme, (CDMDSP) this.dsp, field, this); - StructureMembers.Member member = this.structdata.getStructureMembers().getMember(findex); - fc.setMember(member); - fc.setArray(this.structdata.getArray(fc.member)); - return fc; - } - - @Override - public CDMCursor readRecord(long i) throws DapException { - if (this.scheme != scheme.SEQUENCE) - throw new DapException("Attempt to read record from non-sequence cursor"); - if (i < 0 || i >= this.recordcount) - throw new DapException("Record index out of bounds"); - DapVariable var = (DapVariable) getTemplate(); - CDMCursor c = new CDMCursor(Scheme.RECORD, (CDMDSP) this.dsp, var, this); - c.setArray(this.array); - c.setRecordIndex(i); - return c; - } - - ////////////////////////////////////////////////// - // Support Methods - - protected Object readAtomic(List slices) throws DapException { - if (slices == null) - throw new DapException("DataCursor.read: null set of slices"); - assert (this.scheme == scheme.ATOMIC); - DapVariable atomvar = (DapVariable) getTemplate(); - assert slices != null && ((atomvar.getRank() == 0 && slices.size() == 1) || (slices.size() == atomvar.getRank())); - return sliceAtomic(slices, this.array, atomvar); - } - - protected Object sliceAtomic(List slices, Array array, DapVariable var) throws DapException { - List dimset = var.getDimensions(); - DapType basetype = var.getBaseType(); - // If content.getDataType returns object, then we - // really do not know its true datatype. So, as a rule, - // we will rely on this.basetype. - DataType datatype = CDMTypeFcns.daptype2cdmtype(basetype); - if (datatype == null) - throw new dap4.core.util.DapException("Unknown basetype: " + basetype); - Object content = array.get1DJavaArray(datatype); // not very efficient; should do conversion - Odometer odom = Odometer.factory(slices, dimset); - Object data = CDMTypeFcns.createVector(datatype, odom.totalSize()); - for (int dstoffset = 0; odom.hasNext(); dstoffset++) { - Index index = odom.next(); - long srcoffset = index.index(); - CDMTypeFcns.vectorcopy(basetype, content, data, srcoffset, dstoffset); - } - return data; - } - - - protected CDMCursor readStructure(Index index) throws DapException { - assert (index != null); - DapVariable var = (DapVariable) getTemplate(); - DapStructure type = (DapStructure) var.getBaseType(); - long pos = index.index(); - if (pos < 0 || pos > var.getCount()) - throw new IndexOutOfBoundsException("read: " + index); - ArrayStructure sarray = (ArrayStructure) this.array; - CDMCursor instance; - assert (this.scheme == scheme.STRUCTARRAY); - ucar.ma2.StructureData sd = sarray.getStructureData((int) pos); - assert sd != null; - instance = new CDMCursor(Scheme.STRUCTURE, (CDMDSP) this.dsp, var, null).setStructureData(sd); - instance.setIndex(index); - return instance; - } - - protected CDMCursor[] readSequence(List slices) throws DapException { - assert (this.scheme == scheme.SEQARRAY); - DapVariable var = (DapVariable) getTemplate(); - DapSequence type = (DapSequence) var.getBaseType(); - // new CDMCursor(Scheme.SEQUENCE, (CDMDSP) this.dsp, var, this); - CDMCursor[] instances = new CDMCursor[(int) DapUtil.sliceProduct(slices)]; - Array seqarray = this.array; - if (var.getRank() == 0) {// scalar - if (!DapUtil.isScalarSlices(slices)) - throw new DapException("Non-scalar slice set applied to scalar variable"); - instances[0] = new CDMCursor(Scheme.SEQUENCE, (CDMDSP) this.dsp, var, this); - instances[0].setArray(seqarray); - instances[0].setRecordCount(seqarray.getSize()); - } else { - List rlist = CDMUtil.createCDMRanges(slices); - Array instancearray; - try { - instancearray = seqarray.section(rlist); - } catch (InvalidRangeException e) { - throw new DapException("Illegal slice set", e); - } - // extracted via List. IN theory, this should be an array of arrays, - // but if the sequence field basetype is atomic, thenit is an array - // of atomic values. - int slicecount = (int) DapUtil.sliceProduct(slices); - for (int i = 0; i < slicecount; i++) { - Array ao = (Array) instancearray.getObject(i); - CDMCursor c = new CDMCursor(Scheme.SEQUENCE, (CDMDSP) this.dsp, var, this); - c.setArray(ao); - long rcount = ao.getSize(); - c.setRecordCount(rcount); - instances[i] = c; - } - } - return instances; - } - - ////////////////////////////////////////////////// - // CDMCursor Extensions - - public CDMCursor setArray(ucar.ma2.Array a) { - this.array = a; - return this; - } - - public ucar.ma2.Array getArray() { - return this.array; - } - - public CDMCursor setStructureData(ucar.ma2.StructureData sd) { - this.structdata = sd; - return this; - } - - public CDMCursor setMember(ucar.ma2.StructureMembers.Member m) { - this.member = m; - return this; - } - - -} diff --git a/dap4/d4cdm/src/main/java/dap4/cdm/dsp/CDMDMR.java b/dap4/d4cdm/src/main/java/dap4/cdm/dsp/CDMDMR.java deleted file mode 100644 index 296d7cdeda..0000000000 --- a/dap4/d4cdm/src/main/java/dap4/cdm/dsp/CDMDMR.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright 2012, UCAR/Unidata. - * See the LICENSE file for more information. - */ - -package dap4.cdm.dsp; - -import dap4.core.dmr.*; - -public class CDMDMR { - ////////////////////////////////////////////////// - - public static class CDMAttribute extends DapAttribute { - public CDMAttribute(String name, DapType basetype) { - super(name, basetype); - } - } - - public static class CDMAttributeSet extends DapAttributeSet { - public CDMAttributeSet(String name) { - super(name); - } - } - - public static class CDMDimension extends DapDimension { - public CDMDimension(String name, long size) { - super(name, size); - } - } - - public static class CDMMap extends DapMap { - public CDMMap(DapVariable target) { - super(target); - } - } - - public abstract static class CDMVariable extends DapVariable { - public CDMVariable(String name, DapType t) { - super(name, t); - } - } - - public static class CDMGroup extends DapGroup { - public CDMGroup(String name) { - super(name); - } - } - - public static class CDMDataset extends DapDataset { - public CDMDataset(String name) { - super(name); - } - } - - public static class CDMEnumeration extends DapEnumeration { - public CDMEnumeration(String name, DapType basetype) { - super(name, basetype); - } - } - - public static class CDMEnumConst extends DapEnumConst { - public CDMEnumConst(String name, long value) { - super(name, value); - } - } - - public static class CDMStructure extends DapStructure { - public CDMStructure(String name) { - super(name); - } - } - - public static class CDMSequence extends DapSequence { - public CDMSequence(String name) { - super(name); - } - } - - public static class CDMOtherXML extends DapOtherXML { - public CDMOtherXML(String name) { - super(name); - } - } -} diff --git a/dap4/d4cdm/src/main/java/dap4/cdm/dsp/CDMDSP.java b/dap4/d4cdm/src/main/java/dap4/cdm/dsp/CDMDSP.java deleted file mode 100644 index 95b271e745..0000000000 --- a/dap4/d4cdm/src/main/java/dap4/cdm/dsp/CDMDSP.java +++ /dev/null @@ -1,1056 +0,0 @@ -/* - * Copyright (c) 2012-2018 University Corporation for Atmospheric Research/Unidata - * See LICENSE for license information. - */ - -package dap4.cdm.dsp; - -import dap4.cdm.CDMTypeFcns; -import dap4.cdm.CDMUtil; -import dap4.cdm.NodeMap; -import dap4.core.data.DataCursor; -import dap4.core.dmr.*; -import dap4.core.util.Convert; -import dap4.core.util.DapContext; -import dap4.core.util.DapException; -import dap4.core.util.DapUtil; -import dap4.dap4lib.AbstractDSP; -import ucar.ma2.Array; -import ucar.ma2.DataType; -import ucar.ma2.IndexIterator; -import ucar.nc2.*; -import ucar.nc2.constants.CDM; -import ucar.nc2.dataset.*; -import ucar.nc2.util.CancelTask; -import java.io.IOException; -import java.util.*; -import ucar.nc2.write.CDLWriter; - -/** - * Wrap CDM source (NetcdfDataset) to be a DSP - * This basically means wrapping various (CDM)Array - * object to look like DataVariable objects. - * Currently only used on server side - */ - -public class CDMDSP extends AbstractDSP { - - ////////////////////////////////////////////////// - // Constants - - protected static final boolean DEBUG = false; - protected static final boolean DUMPCDL = false; - - // NetcdfDataset enhancement to use: need only coord systems - protected static Set ENHANCEMENT = EnumSet.of(NetcdfDataset.Enhance.CoordSystems); - - protected static final String FILLVALUE = "_FillValue"; - - ////////////////////////////////////////////////// - // Class variables - - protected static boolean nc4loaded = false; - - ////////////////////////////////////////////////// - // Class methods - - - ////////////////////////////////////////////////// - // Instance variables - - protected NetcdfDataset ncdfile = null; - protected boolean closed = false; - protected DMRFactory dmrfactory = null; - - // Keep various context-dependent maps between - // CDMNode instances and DapNode instances - // package access - - // Variable map - protected NodeMap varmap = new NodeMap<>(); - - // Variable <-> DapStructure (basetype) map; compound types only - protected NodeMap compoundmap = new NodeMap<>(); - - // Map Variable <-> DapSequence vlen type - protected NodeMap vlenmap = new NodeMap<>(); - - // Map All other kinds of CDMNode <-> DapNode - protected NodeMap nodemap = new NodeMap<>(); - - ////////////////////////////////////////////////// - // Constructor(s) - - public CDMDSP() {} - - public CDMDSP(String path) throws DapException { - super(); - setLocation(path); - } - - ////////////////////////////////////////////////// - // DSP Interface - - // This is intended to be the last DSP checked - @Override - public boolean dspMatch(String path, DapContext context) { - return true; - } - - /** - * @param filepath - absolute path to a file - * @return CDMDSP instance - * @throws DapException - */ - @Override - public CDMDSP open(String filepath) throws DapException { - try { - NetcdfFile ncfile = createNetcdfFile(filepath, null); - NetcdfDataset ncd = new NetcdfDataset(ncfile, ENHANCEMENT); - return open(ncd); - } catch (IOException ioe) { - throw new DapException("CDMDSP: cannot process: " + filepath, ioe); - } - } - - /** - * Provide an extra API for use in testing - * - * @param ncd netcdf dataset - * @return the cdmdsp - * @throws DapException - */ - public CDMDSP open(NetcdfDataset ncd) throws DapException { - assert this.context != null; - this.dmrfactory = new DMRFactory(); - this.ncdfile = ncd; - setLocation(this.ncdfile.getLocation()); - buildDMR(); - return this; - } - - @Override - public void close() throws IOException { - if (this.ncdfile != null) - this.ncdfile.close(); - } - - - @Override - public DataCursor getVariableData(DapVariable var) throws DapException { - Variable cdmvar = this.varmap.get(var); - if (cdmvar == null) - throw new DapException("Unknown variable: " + var); - CDMCursor vardata = (CDMCursor) super.getVariableData(var); - if (vardata == null) { - DataCursor.Scheme scheme = CDMCursor.schemeFor(var); - try { - vardata = new CDMCursor(scheme, this, var, null); - vardata.setArray(cdmvar.read()); - } catch (IOException e) { - throw new DapException(e); - } - super.addVariableData(var, vardata); - } - return vardata; - } - - ////////////////////////////////////////////////// - // Abstract DSP Abstract methods - - ////////////////////////////////////////////////// - // CDMDSP Specific Accessors - - public NetcdfDataset getNetcdfDataset() { - return this.ncdfile; - } - - ////////////////////////////////////////////////// - // Nodemap Management - - /* - * Make sure that we use the proper - * object in order to avoid identity - * problems. - */ - - /** - * Track generic CDMNode <-> DapNode - */ - protected void recordNode(CDMNode cdm, DapNode dap) { - assert this.nodemap.get(cdm) == null && this.nodemap.get(dap) == null; - this.nodemap.put(cdm, dap); - } - - /** - * Track Variable <-> DapVariable - */ - protected void recordVar(Variable cdm, DapVariable dap) { - cdm = CDMUtil.unwrap(cdm); - assert varmap.get(cdm) == null && varmap.get(dap) == null; - varmap.put(cdm, dap); - } - - /** - * Track Variable <-> DapStructure - */ - protected void recordStruct(Variable cdm, DapStructure dap) { - cdm = CDMUtil.unwrap(cdm); - assert this.nodemap.get(cdm) == null && this.nodemap.get(dap) == null; - compoundmap.put(cdm, dap); - } - - /** - * Track Variable <-> DapSequence - */ - protected void recordSeq(Variable cdm, DapSequence dap) { - cdm = CDMUtil.unwrap(cdm); - assert this.vlenmap.get(cdm) == null && this.vlenmap.get(dap) == null; - vlenmap.put(cdm, dap); - } - - /** - * Lookup a cdmnode in the cdmnodemap. - * Make sure that we use the proper - * object in order to avoid identity - * problems. - * - * @param cdmnode The CMDNode (variable, dimension, etc) to record - * @return The DapNode to which the cdmnode is to be mapped or null. - */ - /* - * protected DapNode - * lookupNode(CDMNode cdmnode) - * { - * CDMSort sort = cdmnode.getSort(); - * if(sort == CDMSort.VARIABLE || sort == CDMSort.STRUCTURE) { - * Variable basev = CDMUtil.unwrap((Variable) cdmnode); - * assert (basev != null) : "Unwrap() failed"; - * cdmnode = (CDMNode) basev; - * } - * return this.nodemap.get(cdmnode); - * } - */ - - ////////////////////////////////////////////////// - - /** - * Extract the metadata from the NetcdfDataset - * and build the DMR. - */ - - public void buildDMR() throws DapException { - if (getDMR() != null) - return; - try { - if (DUMPCDL) { - System.out.println("writecdl:"); - CDLWriter.writeCDL(this.ncdfile, System.out, false); - System.out.flush(); - } - // Use the file path to define the dataset name - String name = this.ncdfile.getLocation(); - // Normalize the name - name = DapUtil.canonicalpath(name); - // Remove any path prefix - int index = name.lastIndexOf('/'); - if (index >= 0) - name = name.substring(index + 1, name.length()); - // Initialize the root dataset node - setDMR((DapDataset) dmrfactory.newDataset(name).annotate(NetcdfDataset.class, this.ncdfile)); - // Map the CDM root group to this group - recordNode(this.ncdfile.getRootGroup(), getDMR()); - getDMR().setBase(DapUtil.canonicalpath(this.ncdfile.getLocation())); - - // Now recursively build the tree. Start by - // Filling the dataset with the contents of the ncfile - // root group. - fillgroup(getDMR(), this.ncdfile.getRootGroup()); - - // Add an order index to the tree - getDMR().sort(); - - // Now locate the coordinate variables for maps - - /* Walk looking for VariableDS instances */ - processmappedvariables(this.ncdfile.getRootGroup()); - - // Now set the view - getDMR().finish(); - - } catch (DapException e) { - setDMR(null); - throw new DapException(e); - } - } - - ////////////////////////////////////////////////// - // Actions - - protected void fillgroup(DapGroup dapgroup, Group cdmgroup) throws DapException { - // Create decls in dap group for Dimensions - for (Dimension cdmdim : cdmgroup.getDimensions()) { - DapDimension dapdim = builddim(cdmdim); - } - // Create decls in dap group for Enumerations - for (EnumTypedef cdmenum : cdmgroup.getEnumTypedefs()) { - String name = cdmenum.getShortName(); - DapEnumeration dapenum = buildenum(cdmenum); - dapenum.setShortName(name); - dapgroup.addDecl(dapenum); - } - // Create decls in dap group for vlen induced Sequences - // Do this before building compound types - for (Variable cdmvar0 : cdmgroup.getVariables()) { - Variable cdmvar = CDMUtil.unwrap(cdmvar0); - buildseqtypes(cdmvar); - } - // Create decls in dap group for Compound Types - for (Variable cdmvar0 : cdmgroup.getVariables()) { - Variable cdmvar = CDMUtil.unwrap(cdmvar0); - if (cdmvar.getDataType() != DataType.STRUCTURE && cdmvar.getDataType() != DataType.SEQUENCE) - continue; - DapStructure struct = buildcompoundtype(cdmvar, dapgroup); - } - - // Create decls in dap group for Variables - for (Variable cdmvar0 : cdmgroup.getVariables()) { - Variable cdmvar = CDMUtil.unwrap(cdmvar0); - DapNode newvar = buildvariable(cdmvar, dapgroup, cdmvar.getDimensions()); - } - // Create decls in dap group for subgroups - for (Group subgroup : cdmgroup.getGroups()) { - DapGroup newgroup = buildgroup(subgroup); - dapgroup.addDecl(newgroup); - } - // Create decls in dap group for group-level attributes - buildattributes(dapgroup, cdmgroup.attributes()); - } - - ////////////////////////////////////////////////// - // Declaration Builders - - protected DapDimension builddim(Dimension cdmdim) throws DapException { - if (cdmdim.isVariableLength()) - throw new DapException("* dimensions not supported"); - DapDimension dapdim = null; - long cdmsize = dapsize(cdmdim); - String name = cdmdim.getShortName(); - if (name != null && name.length() == 0) - name = null; - boolean shared = cdmdim.isShared(); - if (!shared) { - // Unlike the parser, since we are working - // from a NetcdfDataset instance, there might - // be multiple anonymous dimension objects - // the same size. So, just go ahead and create - // multiple instances. - dapdim = (DapDimension) dmrfactory.newDimension(null, cdmsize); - getDMR().addDecl(dapdim); - } else { // Non anonymous; create in current group - dapdim = (DapDimension) dmrfactory.newDimension(name, cdmsize); - dapdim.setShared(true); - if (cdmdim.isUnlimited()) { - dapdim.setUnlimited(true); - } - Group cdmparent = cdmdim.getGroup(); - DapGroup dapparent = (DapGroup) this.nodemap.get(cdmparent); - assert dapparent != null; - assert (dapparent != null); - dapparent.addDecl(dapdim); - } - recordNode(cdmdim, dapdim); - return dapdim; - } - - protected DapEnumeration buildenum(EnumTypedef cdmenum) throws DapException { - // Set the enum's basetype - DapType base = null; - switch (cdmenum.getBaseType()) { - case ENUM1: - base = DapType.INT8; - break; - case ENUM2: - base = DapType.INT16; - break; - case ENUM4: - default: - base = DapType.INT32; - break; - } - DapEnumeration dapenum = (DapEnumeration) dmrfactory.newEnumeration(cdmenum.getShortName(), base); - recordNode(cdmenum, dapenum); - // Create the enum constants - Map ecvalues = cdmenum.getMap(); - for (Map.Entry entry : ecvalues.entrySet()) { - String name = entry.getValue(); - assert (name != null); - int value = (int) entry.getKey(); - dapenum.addEnumConst(dmrfactory.newEnumConst(name, new Long(value))); - } - return dapenum; - } - - protected DapStructure buildcompoundtype(Variable cdmvar, DapNode parent) throws DapException { - cdmvar = CDMUtil.unwrap(cdmvar); - DapStructure struct; - if (cdmvar.getDataType() == DataType.STRUCTURE) - struct = (DapStructure) dmrfactory.newStructure(cdmvar.getShortName()); - else if (cdmvar.getDataType() == DataType.SEQUENCE) - struct = (DapStructure) dmrfactory.newSequence(cdmvar.getShortName()); - else - throw new DapException("Internal error"); - struct.setParent(parent); - recordStruct(cdmvar, struct); - Structure cdmstruct = (Structure) cdmvar; - List fields = cdmstruct.getVariables(); - // recurse to create compound types of any fields c - for (CDMNode node : fields) { - Variable cdmfield = (Variable) node; - List dimset = cdmfield.getDimensions(); - // Recurse on any nested compound types - if (cdmfield.getDataType() == DataType.STRUCTURE || cdmfield.getDataType() == DataType.SEQUENCE) { - DapStructure fieldstruct = buildcompoundtype(cdmfield, struct); - } - } - // Add the fields to this compound type - for (CDMNode node : fields) { - Variable cdmfield = (Variable) node; - DapType basetype = null; - switch (cdmfield.getDataType()) { - default: - basetype = CDMTypeFcns.cdmtype2daptype(cdmfield.getDataType()); - break; - case STRUCTURE: - case SEQUENCE: - basetype = compoundmap.get(cdmfield);// since no forward references - break; - } - // build the field variable - List fielddims = cdmfield.getDimensions(); - DapVariable dapfield; - if (CDMUtil.hasVLEN(cdmfield)) { - // Get the fake sequence associated with this vlen - DapSequence seq = vlenmap.get(cdmfield); - List coredims = getCoreDimset(fielddims); - // We need to build a variable whose basetype is the - // fake sequence rather than the cdmfield type - // First, build a variable using the existing cdmfield - dapfield = buildvariable(cdmfield, struct, coredims); - // Now modify it to use the fake sequence - dapfield.setBaseType(seq); - } else { - dapfield = buildvariable(cdmfield, struct, fielddims); - } - struct.addField(dapfield); - } - return struct; - } - - protected DapVariable buildvariable(Variable cdmbasevar, DapNode parent, List cdmdims) - throws DapException { - DapVariable dapvar = null; - CDMSort sort = cdmbasevar.getSort(); - switch (sort) { - case VARIABLE: - switch (cdmbasevar.getDataType()) { - default: - dapvar = buildatomicvar(cdmbasevar, parent); - break; - case ENUM1: - case ENUM2: - case ENUM4: - dapvar = buildenumvar(cdmbasevar); - break; - case OPAQUE: - dapvar = buildopaquevar(cdmbasevar); - break; - case STRING: - dapvar = buildstringvar(cdmbasevar); - break; - case STRUCTURE: - case SEQUENCE: - assert false : "Internal error"; // How could this ever happen? - break; - - } - builddimrefs(dapvar, cdmdims); - break; - case STRUCTURE: - dapvar = buildstructvar(cdmbasevar); - builddimrefs(dapvar, cdmdims); - break; - case SEQUENCE: - default: - assert false : "Internal Error"; - } - if (parent != null) - addToParent(parent, dapvar); - return dapvar; - } - - protected DapVariable buildatomicvar(Variable cdmvar, DapNode parent) throws DapException { - // Atomic => not opaque and not enum - DapType basetype = CDMTypeFcns.cdmtype2daptype(cdmvar.getDataType()); - if (basetype == null) - throw new DapException("DapFile: illegal CDM variable base type: " + cdmvar.getDataType()); - DapVariable dapvar = (DapVariable) dmrfactory.newVariable(cdmvar.getShortName(), basetype); - recordVar(cdmvar, dapvar); - buildattributes(dapvar, cdmvar.attributes()); - if (CDMUtil.hasVLEN(cdmvar)) { - // Get the fake sequence associated with this vlen - DapSequence seq = vlenmap.get(cdmvar); - List coredims = getCoreDimset(cdmvar.getDimensions()); - // We need to build a variable whose basetype is the - // fake sequence rather than the cdmfield type - // First, build a variable using the existing cdmfield - // Now modify it to use the fake sequence - dapvar.setBaseType(seq); - } - return dapvar; - } - - protected DapVariable buildopaquevar(Variable cdmvar) throws DapException { - assert (cdmvar.getDataType() == DataType.OPAQUE) : "Internal error"; - DapVariable dapvar = (DapVariable) dmrfactory.newVariable(cdmvar.getShortName(), DapType.OPAQUE); - recordVar(cdmvar, dapvar); - buildattributes(dapvar, cdmvar.attributes()); - Object osize = cdmvar.annotation(UCARTAGOPAQUE); - if (osize != null) { - dapvar.addXMLAttribute(UCARTAGOPAQUE, osize.toString()); - } - return dapvar; - } - - protected DapVariable buildstringvar(Variable cdmvar) throws DapException { - assert (cdmvar.getDataType() == DataType.STRING) : "Internal error"; - DapVariable dapvar = (DapVariable) dmrfactory.newVariable(cdmvar.getShortName(), DapType.STRING); - recordVar(cdmvar, dapvar); - buildattributes(dapvar, cdmvar.attributes()); - return dapvar; - } - - protected DapVariable buildenumvar(Variable cdmvar) throws DapException { - assert (cdmvar.getDataType() == DataType.ENUM1 || cdmvar.getDataType() == DataType.ENUM2 - || cdmvar.getDataType() == DataType.ENUM4) : "Internal error"; - - // Now, we need to locate the actual enumeration decl - EnumTypedef enumdef = cdmvar.getEnumTypedef(); - EnumTypedef trueenumdef = findMatchingEnum(enumdef); - // Modify the cdmvar - cdmvar.setEnumTypedef(trueenumdef); - // Now, map to a DapEnumeration - DapEnumeration dapenum = (DapEnumeration) this.nodemap.get(trueenumdef); - assert (dapenum != null); - DapVariable dapvar = (DapVariable) dmrfactory.newVariable(cdmvar.getShortName(), dapenum); - recordVar(cdmvar, dapvar); - buildattributes(dapvar, cdmvar.attributes()); - return dapvar; - } - - protected DapVariable buildstructvar(Variable cdmvar) throws DapException { - assert (cdmvar.getDataType() == DataType.STRUCTURE) : "Internal error"; - // Find the DapStructure that is the basetype for this var - DapStructure struct = compoundmap.get(cdmvar); - assert struct != null : "Internal Error"; - DapVariable dapvar = (DapVariable) dmrfactory.newVariable(cdmvar.getShortName(), struct); - recordVar(cdmvar, dapvar); - buildattributes(dapvar, cdmvar.attributes()); - return dapvar; - } - - /* - * Create a sequence from a variable with a - * variable length last dimension. - * Suppose we have cdm equivalent to this: - * T var[d1]...[dn]][*] - * We convert to the following - * - * - * - * ... - * - * - */ - - protected DapSequence buildseqtype(Variable cdmvar) throws DapException { - cdmvar = CDMUtil.unwrap(cdmvar); - assert (CDMUtil.hasVLEN(cdmvar)); - DataType dt = cdmvar.getDataType(); - DapType daptype = CDMTypeFcns.cdmtype2daptype(dt); - DapSequence seq = (DapSequence) dmrfactory.newSequence(cdmvar.getShortName()); - // fill DapSequence with a single field; note that the dimensions - // are elided because they will attach to the sequence variable, - // not the field - DapVariable field = dmrfactory.newVariable(cdmvar.getShortName(), daptype); - seq.addField(field); - field.setParent(seq); - recordSeq(cdmvar, seq); - return seq; - } - - /** - * Walk this variable, including fields, to construct sequence types - * for any contained vlen dimensions - * - * @param cdmvar variable to walk - */ - - protected void buildseqtypes(Variable cdmvar) throws DapException { - if (CDMUtil.hasVLEN(cdmvar)) { - buildseqtype(cdmvar); - } - if (cdmvar.getDataType() == DataType.STRUCTURE || cdmvar.getDataType() == DataType.SEQUENCE) { - Structure struct = (Structure) cdmvar; - List fields = struct.getVariables(); - for (int i = 0; i < fields.size(); i++) { - Variable field = fields.get(i); - buildseqtypes(field); // recurse for inner vlen dims - } - } - } - - protected void buildattributes(DapNode node, AttributeContainer attributes) throws DapException { - for (Attribute attr : attributes) { - if (!suppress(attr.getShortName())) { - DapAttribute dapattr = buildattribute(attr); - node.addAttribute(dapattr); - } - } - } - - protected DapAttribute buildattribute(Attribute cdmattr) throws DapException { - DapType attrtype = CDMTypeFcns.cdmtype2daptype(cdmattr.getDataType()); - EnumTypedef cdmenum = cdmattr.getEnumType(); - boolean enumfillvalue = (cdmattr.getShortName().equals(FILLVALUE) && cdmenum != null); - DapEnumeration dapenum = null; - - // We need to handle _FillValue specially if the - // the variable is enum typed. - if (enumfillvalue) { - cdmenum = findMatchingEnum(cdmenum); - // Make sure the cdm attribute has type enumx - if (!cdmenum.getBaseType().isEnum()) - throw new DapException("CDM _FillValue attribute type is not enumX"); - // Modify the attr - cdmattr.setEnumType(cdmenum); - // Now, map to a DapEnumeration - dapenum = (DapEnumeration) this.nodemap.get(cdmenum); - if (dapenum == null) - throw new DapException("Illegal CDM variable attribute type: " + cdmenum); - attrtype = dapenum; - } - if (attrtype == null) - throw new DapException("DapFile: illegal CDM variable attribute type: " + cdmattr.getDataType()); - DapAttribute dapattr = (DapAttribute) dmrfactory.newAttribute(cdmattr.getShortName(), attrtype); - recordNode(cdmattr, dapattr); - // Transfer the values - Array values = cdmattr.getValues(); - if (!validatecdmtype(cdmattr.getDataType(), values.getElementType())) - throw new DapException("Attr type versus attribute data mismatch: " + values.getElementType()); - IndexIterator iter = values.getIndexIterator(); - String[] valuelist = null; - Object vec = CDMTypeFcns.createVector(cdmattr.getDataType(), values.getSize()); - for (int i = 0; iter.hasNext(); i++) { - java.lang.reflect.Array.set(vec, i, iter.next()); - } - valuelist = (String[]) Convert.convert(DapType.STRING, attrtype, vec); - dapattr.setValues(valuelist); - return dapattr; - } - - /** - * Assign dimensions to a variable - * - * @param dapvar The variable to which we wish to assign dimensions - * @param cdmdims The cdm dimensions from which we will find the dimension info - */ - protected void builddimrefs(DapVariable dapvar, List cdmdims) throws DapException { - if (cdmdims == null || cdmdims.size() == 0) - return; - // It is unfortunately the case that the dimensions - // associated with the variable are not - // necessarily the same object as those dimensions - // as declared, so we need to use a non-trivial - // matching algorithm. - for (Dimension cdmdim : cdmdims) { - DapDimension dapdim = null; - if (cdmdim.isShared()) { - Dimension declareddim = finddimdecl(cdmdim); - if (declareddim == null) - throw new DapException("Unprocessed cdm dimension: " + cdmdim); - dapdim = (DapDimension) this.nodemap.get(declareddim); - assert dapdim != null; - } else if (cdmdim.isVariableLength()) {// ignore - continue; - } else {// anonymous - dapdim = builddim(cdmdim); - } - assert (dapdim != null) : "Internal error"; - dapvar.addDimension(dapdim); - } - } - - protected void processmappedvariables(Group g) throws DapException { - for (Variable v0 : g.getVariables()) { - Variable cdmvar = CDMUtil.unwrap(v0); - if (cdmvar == null) - throw new DapException("NetcdfDataset synthetic variable: " + v0); - DapNode dapvar = this.varmap.get(cdmvar); - if (dapvar == null) - throw new DapException("Unknown variable: " + cdmvar); - if (!(dapvar instanceof DapVariable)) - throw new DapException("CDMVariable not mapping to dap variable: " + cdmvar); - buildmaps((DapVariable) dapvar, v0); - } - } - - - /** - * @param dapvar The variable to which we wish to assign maps - * @param var The NetcdfDataset variable from which to extract coord system - */ - protected void buildmaps(DapVariable dapvar, Variable var) throws DapException { - // See if this cdm variable has one (or more) coordinate system - List css = null; - if (var.getSort() == CDMSort.VARIABLE) { - VariableDS vds = (VariableDS) var; - css = vds.getCoordinateSystems(); - } else { - StructureDS sds = (StructureDS) var; - css = sds.getCoordinateSystems(); - } - if (css != null && css.size() > 0) { - // Not sure what to do with multiple coordinate systems - // For now, only use the first - CoordinateSystem coordsystems = css.get(0); - for (CoordinateAxis axis : coordsystems.getCoordinateAxes()) { - // First step is to find the dap variable - // corresponding to the map - VariableDS vds = (VariableDS) axis.getOriginalVariable(); - if (vds != null) { - Variable v = CDMUtil.unwrap(vds); - if (v != null) { - DapVariable mapvar = varmap.get(v); - if (mapvar == null) - throw new DapException("Illegal map variable:" + v.toString()); - if (!mapvar.isAtomic()) - throw new DapException("Non-atomic map variable:" + v.toString()); - // Ignore maps where the map variable is inside this scope - /* - * if(!mapvar.isTopLevel()) { - * DapNode parent = mapvar.getContainer(); - * switch (parent.getSort()) { - * case SEQUENCE: - * case STRUCTURE: - * if(dapvar.getBaseType() == parent) // Do we need to do transitive closure? - * throw new DapException("Map var cannot be in same structure as map"); - * break; - * default: - * assert false : "Unexpected container type"; - * } - */ - DapMap map = (DapMap) dmrfactory.newMap(mapvar); - dapvar.addMap(map); - } - } - } - } - } - - protected DapGroup buildgroup(Group cdmgroup) throws DapException { - DapGroup dapgroup = (DapGroup) dmrfactory.newGroup(cdmgroup.getShortName()); - recordNode(cdmgroup, dapgroup); - dapgroup.setShortName(cdmgroup.getShortName()); - fillgroup(dapgroup, cdmgroup); - return dapgroup; - } - - ////////////////////////////////////////////////// - // Utilities - - /** - * Unfortunately, the CDM Iosp does not - * actually use the declared enums. Rather, - * for every enum type'd variable, a new - * enum decl is defined. So, we need - * to find the original enum decl that matches - * the variable's enum. - */ - - protected EnumTypedef findMatchingEnum(EnumTypedef varenum) throws DapException { - List candidates = new ArrayList<>(); - for (Map.Entry entry : this.nodemap.getCDMMap().entrySet()) { - CDMNode cdmnode = entry.getValue(); - if (cdmnode.getSort() != CDMSort.ENUMERATION) - continue; - // Compare the enumeration (note names will differ) - EnumTypedef target = (EnumTypedef) cdmnode; - /* - * Ideally, we should test the types of the enums, - * but, unfortunately, the var enum is always enum4. - * if(target.getBaseType() != varenum.getBaseType()) - * continue; - */ - Map targetmap = target.getMap(); - Map varmap = varenum.getMap(); - if (targetmap.size() != varmap.size()) - continue; - boolean match = true; // until otherwise shown - for (Map.Entry tpair : targetmap.entrySet()) { - String tname = tpair.getValue(); - int value = (int) tpair.getKey(); - boolean found = false; - for (Map.Entry vpair : varmap.entrySet()) { - if (tname.equals(vpair.getValue()) && value == (int) vpair.getKey()) { - found = true; - break; - } - } - if (!found) { - match = false; - break; - } - } - if (!match) - continue; - - // Save it unless it is shadowed by a closer enum - boolean shadowed = false; - for (EnumTypedef etd : candidates) { - if (shadows(etd.getGroup(), target.getGroup())) { - shadowed = true; - break; - } - } - if (!shadowed) - candidates.add(target); - } - - switch (candidates.size()) { - case 0: - throw new DapException("CDMDSP: No matching enum type decl: " + varenum.getShortName()); - case 1: - break; - default: - throw new DapException("CDMDSP: Multiple matching enum type decls: " + varenum.getShortName()); - } - return candidates.get(0); - } - - protected boolean shadows(Group parent, Group child) { - if (child == parent) - return true; - Group candidate = child; - do { - candidate = candidate.getGroup(); - } while (candidate != null && candidate != parent); - return (candidate == parent); - } - - // Convert cdm size to DapDimension size - protected long dapsize(Dimension cdmdim) { - assert (!cdmdim.isVariableLength()); - return (long) cdmdim.getLength(); - } - - protected boolean validatecdmtype(DataType datatype, Class typeclass) { - switch (datatype) { - case CHAR: - return typeclass == char.class; - case BYTE: - case UBYTE: - return typeclass == byte.class; - case SHORT: - case USHORT: - return typeclass == short.class; - case INT: - case UINT: - return typeclass == int.class; - case LONG: - case ULONG: - return typeclass == long.class; - case FLOAT: - return typeclass == float.class; - case DOUBLE: - return typeclass == double.class; - case STRING: - return typeclass == String.class; - case OPAQUE: - return typeclass == Byte[].class; - // For these, return the integer basetype - case ENUM1: - return typeclass == byte.class; - case ENUM2: - return typeclass == short.class; - case ENUM4: - return typeclass == int.class; - - // Undefined - case SEQUENCE: - case STRUCTURE: - default: - break; - } - return false; - } - - - protected Dimension finddimdecl(Dimension dimref) { - // Search on the full name, but be careful, - // the rule is that the declared dimension's fqn - // must be a prefix of the dimension reference. - for (Map.Entry entry : this.nodemap.getCDMMap().entrySet()) { - if (entry.getValue().getSort() != CDMSort.DIMENSION) - continue; - Dimension d = (Dimension) entry.getValue(); - if (isDimDeclFor(d, dimref)) - return d; - } - return null; - } - - protected boolean isDimDeclFor(Dimension decl, Dimension ref) { - if (!decl.isShared()) - return false; // Has no name - // First check shortname and size - if (!decl.getShortName().equals(ref.getShortName())) - return false; - if (decl.getLength() != ref.getLength()) - return false; - // Make sure they are in the same group - String dprefix = decl.getGroup().getFullName(); - String rprefix = ref.getGroup().getFullName(); - return (dprefix.equals(rprefix)); - } - - /* - * protected String - * fixvalue(Object o, DapType datatype) - * { - * TypeSort atype = datatype.getTypeSort(); - * if(o instanceof Character) { - * long l = (long) ((Character) o).charValue(); - * if(atype.isUnsigned()) - * l = l & 0xffL; - * o = Long.valueOf(l); - * } else if(o instanceof Float || o instanceof Double) { - * if(atype == TypeSort.Float32) - * o = Float.valueOf(((Number) o).floatValue()); - * else if(atype == TypeSort.Float64) - * o = Double.valueOf(((Number) o).doubleValue()); - * else - * assert false : "Internal error"; - * } else if(o instanceof Number) { - * long l = ((Number) o).longValue(); - * switch (atype) { - * case Char: - * case UInt8: - * l = l & 0xffL; - * break; - * case UInt16: - * l = l & 0xffffL; - * break; - * case UInt32: - * l = l & 0xffffffffL; - * break; - * default: - * break; - * } - * o = Long.valueOf(l); - * } else if(o instanceof String) { - * o = o.toString(); - * } else if(o instanceof ByteBuffer) { - * // leave it unchanged - * } else if(o instanceof byte[]) { - * o = ByteBuffer.wrap((byte[]) o); - * } else if(o instanceof Byte[]) { - * Byte[] ob = (Byte[]) o; - * byte[] bb = new byte[ob.length]; - * for(int i = 0; i < bb.length; i++) { - * bb[i] = (byte) ob[i]; - * } - * o = ByteBuffer.wrap(bb); - * } //else { // leave it unchanged - * return o; - * } - */ - - ////////////////////////////////////////////////// - - protected NetcdfFile createNetcdfFile(String location, CancelTask canceltask) throws DapException { - try { - NetcdfFile ncfile = NetcdfFile.open(location, -1, canceltask, getContext()); - return ncfile; - } catch (DapException de) { - if (DEBUG) - de.printStackTrace(); - throw de; - } catch (Exception e) { - if (DEBUG) - e.printStackTrace(); - throw new DapException(e); - } - } - - ////////////////////////////////////////////////// - // Utilities - - /** - * Strip vlen dimensions from a set of dimensions - * - * @param dimset - * @return subset of dimset with (trailing) vlen removed - * @throws DapException - */ - static List getCoreDimset(List dimset) throws DapException { - if (dimset == null) - return null; - List core = new ArrayList<>(); - int pos = -1; - int count = 0; - for (int i = 0; i < dimset.size(); i++) { - if (dimset.get(i).isVariableLength()) { - pos = i; - count++; - } else - core.add(dimset.get(i)); - } - if ((pos != dimset.size() - 1) || count > 1) - throw new DapException("Unsupported use of (*) Dimension"); - return core; - } - - /** - * Some attributes that are added by the NetcdfDataset - * need to be kept out of the DMR. This function - * defines that set. - * - * @param attrname A non-escaped attribute name to be tested for suppression - * @return true if the attribute should be suppressed, false otherwise. - */ - protected boolean suppress(String attrname) { - if (attrname.startsWith("_Coord")) - return true; - if (attrname.equals(CDM.UNSIGNED)) - return true; - return false; - } - - protected void addToParent(DapNode parent, DapVariable dapvar) throws DapException { - assert (parent != null); - switch (parent.getSort()) { - case GROUP: - case DATASET: - ((DapGroup) parent).addDecl(dapvar); - break; - case SEQUENCE: - case STRUCTURE: - dapvar.setParent(parent); - break; - default: - assert (false) : "Internal error"; - } - } - -} diff --git a/dap4/d4cdm/src/main/java/dap4/cdm/nc2/CDMArray.java b/dap4/d4cdm/src/main/java/dap4/cdm/nc2/CDMArray.java deleted file mode 100644 index 8fd48da4a2..0000000000 --- a/dap4/d4cdm/src/main/java/dap4/cdm/nc2/CDMArray.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2012, UCAR/Unidata. - * See the LICENSE file for more information. - */ - -package dap4.cdm.nc2; - -import dap4.core.dmr.*; -import dap4.core.data.DSP; - -/** - * It is convenient to be able to create - * a common "parent" interface for all - * the CDM array classes - */ - -/* package */ interface CDMArray { - public DSP getDSP(); - - public DapVariable getTemplate(); - - public long getSizeBytes(); // In bytes - - public DapType getBaseType(); - - -} diff --git a/dap4/d4cdm/src/main/java/dap4/cdm/nc2/CDMArrayAtomic.java b/dap4/d4cdm/src/main/java/dap4/cdm/nc2/CDMArrayAtomic.java deleted file mode 100644 index b82b3fe2c9..0000000000 --- a/dap4/d4cdm/src/main/java/dap4/cdm/nc2/CDMArrayAtomic.java +++ /dev/null @@ -1,549 +0,0 @@ -/* - * Copyright 2012, UCAR/Unidata. - * See the LICENSE file for more information. - */ - -package dap4.cdm.nc2; - -import dap4.cdm.CDMTypeFcns; -import dap4.cdm.CDMUtil; -import dap4.core.data.DSP; -import dap4.core.data.DataCursor; -import dap4.core.dmr.DapType; -import dap4.core.dmr.DapVariable; -import dap4.core.util.Convert; -import dap4.core.util.DapException; -import dap4.core.util.DapUtil; -import dap4.core.util.Slice; -import ucar.ma2.Array; -import ucar.ma2.DataType; -import ucar.ma2.Index; -import ucar.ma2.IndexIterator; -import ucar.nc2.Group; -import java.io.IOException; -import java.util.List; -import static dap4.core.data.DataCursor.Scheme; - -/** - * CDMArrayAtomic wraps a DataCursor object to present - * the ucar.ma2.Array interface. - * CDMArrayAtomic manages a single CDM atomic variable: - * either top-level or for a member. - */ - -/* package */ class CDMArrayAtomic extends Array implements CDMArray { - ///////////////////////////////////////////////////// - // Constants - - ///////////////////////////////////////////////////// - // Instance variables - - protected DSP dsp = null; - protected DapVariable template = null; - protected DapType basetype = null; - - // CDMArray variables - protected DataCursor data = null; - protected Group cdmroot = null; - protected int elementsize = 0; // of one element - protected long dimsize = 0; // # of elements in array; scalar uses value 1 - protected long totalsize = 0; // elementsize*dimsize except when isbytestring - - ////////////////////////////////////////////////// - // Constructor(s) - - /** - * Constructor - * - * @param data DataCursor object providing the actual data - */ - CDMArrayAtomic(DataCursor data) throws DapException { - super(CDMTypeFcns.daptype2cdmtype(((DapVariable) data.getTemplate()).getBaseType()), - CDMUtil.computeEffectiveShape(((DapVariable) data.getTemplate()).getDimensions())); - this.dsp = data.getDSP(); - this.data = data; - this.template = (DapVariable) this.data.getTemplate(); - this.basetype = this.template.getBaseType(); - - this.dimsize = DapUtil.dimProduct(this.template.getDimensions()); - this.elementsize = this.basetype.getSize(); - } - - ///////////////////////////////////////////////// - // CDMArray Interface - - @Override - public DapType getBaseType() { - return this.basetype; - } - - @Override - public DSP getDSP() { - return this.dsp; - } - - @Override - public DapVariable getTemplate() { - return this.template; - } - - ////////////////////////////////////////////////// - // Accessors - - ////////////////////////////////////////////////// - // Array Interface - - public String toString() { - StringBuilder buf = new StringBuilder(); - DapType basetype = getBaseType(); - String sbt = (basetype == null ? "?" : basetype.toString()); - String st = (template == null ? "?" : template.getShortName()); - buf.append(String.format("%s %s[%d]", sbt, st, dimsize)); - return buf.toString(); - } - - ////////////////////////////////////////////////// - // Array API - // TODO: add index range checks - - public Class getElementType() { - DataType dt = CDMTypeFcns.daptype2cdmtype(this.basetype); - if (dt == null) - throw new IllegalArgumentException("Unknown datatype: " + this.basetype); - return CDMTypeFcns.cdmElementClass(dt); - } - - public double getDouble(ucar.ma2.Index cdmidx) { - return getDouble(CDMUtil.cdmIndexToIndex(cdmidx)); - } - - public float getFloat(ucar.ma2.Index cdmidx) { - return getFloat(CDMUtil.cdmIndexToIndex(cdmidx)); - } - - public long getLong(ucar.ma2.Index cdmidx) { - return getLong(CDMUtil.cdmIndexToIndex(cdmidx)); - } - - public int getInt(ucar.ma2.Index cdmidx) { - return getInt(CDMUtil.cdmIndexToIndex(cdmidx)); - } - - public short getShort(ucar.ma2.Index cdmidx) { - return getShort(CDMUtil.cdmIndexToIndex(cdmidx)); - } - - public byte getByte(ucar.ma2.Index cdmidx) { - return getByte(CDMUtil.cdmIndexToIndex(cdmidx)); - } - - public char getChar(ucar.ma2.Index cdmidx) { - return getChar(CDMUtil.cdmIndexToIndex(cdmidx)); - } - - public boolean getBoolean(ucar.ma2.Index cdmidx) { - return getBoolean(CDMUtil.cdmIndexToIndex(cdmidx)); - } - - public Object getObject(ucar.ma2.Index cdmidx) { - return getObject(CDMUtil.cdmIndexToIndex(cdmidx)); - } - - // Convert int base to Index based - - public double getDouble(int offset) { - DapVariable d4var = (DapVariable) getTemplate(); - long[] dimsizes = DapUtil.getDimSizes(d4var.getDimensions()); - return getDouble(DapUtil.offsetToIndex(offset, dimsizes)); - } - - public float getFloat(int offset) { - DapVariable d4var = (DapVariable) getTemplate(); - long[] dimsizes = DapUtil.getDimSizes(d4var.getDimensions()); - return getFloat(DapUtil.offsetToIndex(offset, dimsizes)); - } - - public long getLong(int offset) { - DapVariable d4var = (DapVariable) getTemplate(); - long[] dimsizes = DapUtil.getDimSizes(d4var.getDimensions()); - return getLong(DapUtil.offsetToIndex(offset, dimsizes)); - } - - public int getInt(int offset) { - DapVariable d4var = (DapVariable) getTemplate(); - long[] dimsizes = DapUtil.getDimSizes(d4var.getDimensions()); - return getInt(DapUtil.offsetToIndex(offset, dimsizes)); - } - - public short getShort(int offset) { - DapVariable d4var = (DapVariable) getTemplate(); - long[] dimsizes = DapUtil.getDimSizes(d4var.getDimensions()); - return getShort(DapUtil.offsetToIndex(offset, dimsizes)); - } - - public byte getByte(int offset) { - DapVariable d4var = (DapVariable) getTemplate(); - long[] dimsizes = DapUtil.getDimSizes(d4var.getDimensions()); - return getByte(DapUtil.offsetToIndex(offset, dimsizes)); - } - - public char getChar(int offset) { - DapVariable d4var = (DapVariable) getTemplate(); - long[] dimsizes = DapUtil.getDimSizes(d4var.getDimensions()); - return getChar(DapUtil.offsetToIndex(offset, dimsizes)); - } - - public boolean getBoolean(int offset) { - DapVariable d4var = (DapVariable) getTemplate(); - long[] dimsizes = DapUtil.getDimSizes(d4var.getDimensions()); - return getBoolean(DapUtil.offsetToIndex(offset, dimsizes)); - } - - public Object getObject(int offset) { - DapVariable d4var = (DapVariable) getTemplate(); - long[] dimsizes = DapUtil.getDimSizes(d4var.getDimensions()); - return getObject(DapUtil.offsetToIndex(offset, dimsizes)); - } - - public Object getStorage() { - try { - List slices = DapUtil.dimsetToSlices(this.template.getDimensions()); - Object result = this.data.read(slices); - return result; - } catch (DapException e) { - throw new IllegalArgumentException(); - } - } - - - // Unsupported Methods - - public void setDouble(Index ima, double value) { - throw new UnsupportedOperationException(); - } - - public void setFloat(Index ima, float value) { - throw new UnsupportedOperationException(); - } - - public void setLong(Index ima, long value) { - throw new UnsupportedOperationException(); - } - - public void setInt(Index ima, int value) { - throw new UnsupportedOperationException(); - } - - public void setShort(Index ima, short value) { - throw new UnsupportedOperationException(); - } - - public void setByte(Index ima, byte value) { - throw new UnsupportedOperationException(); - } - - public void setChar(Index ima, char value) { - throw new UnsupportedOperationException(); - } - - public void setBoolean(Index ima, boolean value) { - throw new UnsupportedOperationException(); - } - - public void setObject(Index ima, Object value) { - throw new UnsupportedOperationException(); - } - - public void setDouble(int elem, double value) { - throw new UnsupportedOperationException(); - } - - public void setFloat(int elem, float value) { - throw new UnsupportedOperationException(); - } - - public void setLong(int elem, long value) { - throw new UnsupportedOperationException(); - } - - public void setInt(int elem, int value) { - throw new UnsupportedOperationException(); - } - - public void setShort(int elem, short value) { - throw new UnsupportedOperationException(); - } - - public void setByte(int elem, byte value) { - throw new UnsupportedOperationException(); - } - - public void setChar(int elem, char value) { - throw new UnsupportedOperationException(); - } - - public void setBoolean(int elem, boolean value) { - throw new UnsupportedOperationException(); - } - - public void setObject(int elem, Object value) { - throw new UnsupportedOperationException(); - } - - protected void copyTo1DJavaArray(IndexIterator indexIterator, Object o) { - throw new UnsupportedOperationException(); - } - - protected void copyFrom1DJavaArray(IndexIterator iter, Object javaArray) { - throw new UnsupportedOperationException(); - } - - protected Array createView(Index index) { - return this; - } - - ////////////////////////////////////////////////// - // Internal common extractors - - /** - * Get the array element at a specific dap4 index as a double - * - * @param idx of element to get - * @return value at index cast to double if necessary. - */ - protected double getDouble(dap4.core.util.Index idx) { - assert data.getScheme() == Scheme.ATOMIC; - try { - Object value = data.read(idx); - value = Convert.convert(DapType.FLOAT64, this.basetype, value); - return (Double) java.lang.reflect.Array.get(value, 0); - } catch (IOException ioe) { - throw new IndexOutOfBoundsException(ioe.getMessage()); - } - } - - /** - * Get the array element at a specific dap4 index as a float - * converting as needed. - * - * @param idx of element to get - * @return value at index cast to float if necessary. - */ - protected float getFloat(dap4.core.util.Index idx) { - assert data.getScheme() == Scheme.ATOMIC; - try { - Object value = data.read(idx); - value = Convert.convert(DapType.FLOAT32, this.basetype, value); - return (Float) java.lang.reflect.Array.get(value, 0); - } catch (IOException ioe) { - throw new IndexOutOfBoundsException(ioe.getMessage()); - } - } - - /** - * Get the array element at a specific dap4 index as a long - * - * @param idx of element to get - * @return value at index cast to long if necessary. - */ - protected long getLong(dap4.core.util.Index idx) { - assert data.getScheme() == Scheme.ATOMIC; - try { - Object value = data.read(idx); - value = Convert.convert(DapType.INT64, this.basetype, value); - return (Long) java.lang.reflect.Array.get(value, 0); - } catch (IOException ioe) { - throw new IndexOutOfBoundsException(ioe.getMessage()); - } - } - - /** - * Get the array element at a specific dap4 index as a integer - * - * @param idx of element to get - * @return value at index cast to integer if necessary. - */ - protected int getInt(dap4.core.util.Index idx) { - assert data.getScheme() == Scheme.ATOMIC; - try { - Object value = data.read(idx); - value = Convert.convert(DapType.INT32, this.basetype, value); - return (Integer) java.lang.reflect.Array.get(value, 0); - } catch (IOException ioe) { - throw new IndexOutOfBoundsException(ioe.getMessage()); - } - } - - /** - * Get the array element at a specific dap4 index as a short - * - * @param idx of element to get - * @return value at index cast to short if necessary. - */ - protected short getShort(dap4.core.util.Index idx) { - assert data.getScheme() == Scheme.ATOMIC; - try { - Object value = data.read(idx); - value = Convert.convert(DapType.INT16, this.basetype, value); - return (Short) java.lang.reflect.Array.get(value, 0); - } catch (IOException ioe) { - throw new IndexOutOfBoundsException(ioe.getMessage()); - } - } - - /** - * Get the array element at a specific dap4 index as a byte - * - * @param idx of element to get - * @return value at index cast to byte if necessary. - */ - protected byte getByte(dap4.core.util.Index idx) { - assert data.getScheme() == Scheme.ATOMIC; - try { - Object value = data.read(idx); - value = Convert.convert(DapType.INT8, this.basetype, value); - return (Byte) java.lang.reflect.Array.get(value, 0); - } catch (IOException ioe) { - throw new IndexOutOfBoundsException(ioe.getMessage()); - } - } - - /** - * Get the array element at a specific dap4 index as a char - * - * @param idx of element to get - * @return value at index cast to char if necessary. - */ - protected char getChar(dap4.core.util.Index idx) { - assert data.getScheme() == Scheme.ATOMIC; - try { - Object value = data.read(idx); - value = Convert.convert(DapType.CHAR, this.basetype, value); - return (Character) java.lang.reflect.Array.get(value, 0); - } catch (IOException ioe) { - throw new IndexOutOfBoundsException(ioe.getMessage()); - } - } - - /** - * Get the array element at a specific dap4 index as a boolean - * - * @param idx of element to get - * @return value at index cast to char if necessary. - */ - protected boolean getBoolean(dap4.core.util.Index idx) { - assert data.getScheme() == Scheme.ATOMIC; - try { - Object value = data.read(idx); - value = Convert.convert(DapType.INT64, this.basetype, value); - return ((Long) java.lang.reflect.Array.get(value, 0)) != 0; - } catch (IOException ioe) { - throw new IndexOutOfBoundsException(ioe.getMessage()); - } - } - - /** - * Get the array element at a specific dap4 index as an Object - * - * @param idx of element to get - * @return value at index cast to Object if necessary. - */ - protected Object getObject(dap4.core.util.Index idx) { - assert data.getScheme() == Scheme.ATOMIC; - try { - Object value = data.read(idx); - value = java.lang.reflect.Array.get(value, 0); - return value; - } catch (IOException ioe) { - throw new IndexOutOfBoundsException(ioe.getMessage()); - } - } - - - ////////////////////////////////////////////////// - // DataAtomic Interface - - public DapVariable getVariable() { - return this.template; - } - - public DapType getType() { - return this.basetype; - } - - /* - * protected Object - * read(long index, DapType datatype, DataAtomic content) - * throws DapException - * { - * Object result; - * int i = (int) index; - * long tmp = 0; - * switch (datatype.getTypeSort()) { - * case Int8: - * result = (Byte) content.getByte(i); - * break; - * case Char: - * result = (Character) content.getChar(i); - * break; - * case SHORT: - * result = (Short) content.getShort(i); - * break; - * case INT: - * result = (Integer) content.getInt(i); - * break; - * case LONG: - * result = (Long) content.getLong(i); - * break; - * case FLOAT: - * result = (Float) content.getFloat(i); - * break; - * case DOUBLE: - * result = (Double) content.getDouble(i); - * break; - * case STRING: - * result = content.getObject(i).toString(); - * break; - * case OBJECT: - * result = content.getObject(i); - * break; - * case UBYTE: - * tmp = content.getByte(i) & 0xFF; - * result = (Byte) (byte) tmp; - * break; - * case USHORT: - * tmp = content.getShort(i) & 0xFFFF; - * result = (Short) (short) tmp; - * break; - * case UINT: - * tmp = content.getInt(i) & 0xFFFFFFFF; - * result = (Integer) (int) tmp; - * break; - * case ULONG: - * result = (Long) content.getLong(i); - * break; - * case ENUM1: - * result = read(index, DataType.BYTE, content); - * break; - * case ENUM2: - * result = read(index, DataType.SHORT, content); - * break; - * case ENUM4: - * result = read(index, DataType.INT, content); - * break; - * case OPAQUE: - * result = content.getObject(i); - * break; - * case STRUCTURE: - * case SEQUENCE: - * default: - * throw new DapException("Attempt to read non-atomic value of type: " + datatype); - * } - * return result; - * } - */ - - ////////////////////////////////////////////////// - // Utilities -} - diff --git a/dap4/d4cdm/src/main/java/dap4/cdm/nc2/CDMArrayDelegate.java b/dap4/d4cdm/src/main/java/dap4/cdm/nc2/CDMArrayDelegate.java deleted file mode 100644 index ec75886200..0000000000 --- a/dap4/d4cdm/src/main/java/dap4/cdm/nc2/CDMArrayDelegate.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2012, UCAR/Unidata. - * See the LICENSE file for more information. - */ - -package dap4.cdm.nc2; - -import dap4.core.dmr.*; -import dap4.core.data.DSP; - -/** - * Since we can't use AbstractCDMArray, - * we define a delegator for CDMArray. - * This class actually is never used, it is just - * a placeholder to store the API that should be - * included in every class implementing CMDArray. - * If this class fails to compile then any fix - * must be propagated to the CDMArray implementing classes. - */ - -/* package */ class CDMArrayDelegate implements CDMArray { - protected DSP dsp = null; - protected DapVariable template = null; - protected long bytesize = 0; - protected DapType basetype = null; - protected TypeSort primitivetype = null; - - /* - * The implementing class will need to - * initialize the fields. - * this.template = template; - * this.bytesize = 0; - * this.root = root; - * this.dsp = dsp; - * this.bytesize = size; - * this.basetype = this.template.getBaseType(); - * this.primitivetype = this.basetype.getPrimitiveType(); - */ - - @Override - public DSP getDSP() { - return this.dsp; - } - - @Override - public DapVariable getTemplate() { - return this.template; - } - - @Override - public long getSizeBytes() { - return this.bytesize; - } - - @Override - public DapType getBaseType() { - return this.basetype; - } - -} diff --git a/dap4/d4cdm/src/main/java/dap4/cdm/nc2/CDMArraySequence.java b/dap4/d4cdm/src/main/java/dap4/cdm/nc2/CDMArraySequence.java deleted file mode 100644 index b60a033e8f..0000000000 --- a/dap4/d4cdm/src/main/java/dap4/cdm/nc2/CDMArraySequence.java +++ /dev/null @@ -1,286 +0,0 @@ -/* - * Copyright 2012, UCAR/Unidata. - * See the LICENSE file for more information. - */ - -package dap4.cdm.nc2; - -import dap4.cdm.CDMTypeFcns; -import dap4.core.data.DSP; -import dap4.core.data.DataCursor; -import dap4.core.dmr.DapSequence; -import dap4.core.dmr.DapStructure; -import dap4.core.dmr.DapType; -import dap4.core.dmr.DapVariable; -import dap4.core.util.*; -import ucar.ma2.*; -import ucar.nc2.Group; -import java.io.IOException; -import java.util.List; - -/** - * CDM now has an ArraySequence type intended to - * support VLEN (aka CDM (*) dimension). - * So, sequence is simulated as a rank n+1 structure where - * the last dimension is "*" (i.e. variable length). - * That is, given the following DAP4: - * Sequence S {f1,f2,...fm} [d1][d2]...[dn] - * Represent it in CDM as this: - * Structure S {f1,f2,...fm} [d1][d2]...[dn][*] - * We cannot subclass CDMArrayStructure because we need to subclass - * ArraySequence, so we are forced to duplicate a lot of the CDMArrayStructure - * code. - * The important point to note is that for CDM, we do not need to support - * Dimensioned sequences; the dimensions are supported by the enclosing - * ArrayStructure covering the non-vlen dimensions - */ - -/* package */ class CDMArraySequence extends ArraySequence implements CDMArray { - - ////////////////////////////////////////////////// - // Type decls - - // Define an open wrapper around a field array in order - // to make the code somewhat more clear - - protected static class FieldSet { - public Array[] fields; - - FieldSet(int nfields) { - fields = new Array[nfields]; - } - } - - public static class SDI implements StructureDataIterator { - protected StructureData[] list; - protected int position; - - public SDI() { - this.list = null; - this.position = 0; - } - - public SDI setList(StructureData[] list) { - this.list = list; - return this; - } - - public boolean hasNext() throws IOException { - return position < list.length; - } - - public StructureData next() throws IOException { - if (position >= list.length) - throw new IOException("No next element"); - return list[position++]; - } - - public StructureDataIterator reset() { - position = 0; - return this; - } - - public int getCurrentRecno() { - return position; - } - - } - - ////////////////////////////////////////////////// - // Instance variables - - protected Group cdmroot = null; - protected DSP dsp; - protected DapVariable template; - protected DapType basetype; - protected long bytesize = 0; - protected long recordcount = 0; - protected int nmembers = 0; - - protected DataCursor seqdata = null; - - /** - * Since in CDM a sequence is the last dimension of - * array, we do not need to keep dimensionality info, only - * the variable length stuff, which we do using - * StructureDataA instances: 1 per record. - */ - - // Track the records of this sequence as an array - // Note: term records here means the elements of the array, - // not record as in Sequence - - protected FieldSet[] records = null; // list of records - - ////////////////////////////////////////////////// - // Constructor(s) - - /** - * Constructor - * - * @param data - */ - CDMArraySequence(Group group, DataCursor data) throws DapException { - super(CDMArrayStructure.computemembers((DapVariable) data.getTemplate()), new SDI(), 0); - this.template = (DapVariable) data.getTemplate(); - this.basetype = this.template.getBaseType(); - // Currently do not allow non-scalar sequences - if (this.template.getRank() != 0) - throw new DapException("Non-scalar sequences unsupported through CDM interface"); - assert data.getScheme() == DataCursor.Scheme.SEQARRAY; - this.cdmroot = group; - this.dsp = dsp; - // Since this is a scalar, pull out the single instance - this.seqdata = ((DataCursor[]) data.read(dap4.core.util.Index.SCALAR))[0]; - this.recordcount = this.seqdata.getRecordCount(); - this.nmembers = ((DapStructure) this.basetype).getFields().size(); - - // Fill in the structdata (in parent) and record vectors - super.sdata = new StructureDataA[(int) this.recordcount]; - records = new FieldSet[(int) this.recordcount]; - for (int i = 0; i < this.recordcount; i++) { - super.sdata[i] = new StructureDataA(this, i); - records[i] = new FieldSet(this.nmembers); - } - - ((SDI) super.iter).setList(super.sdata); - } - - ////////////////////////////////////////////////// - // Compiler API - - /* package */ - void add(long recno, int fieldno, Array field) { - // Make sure all the space is allocated - if (records.length <= recno) { - FieldSet[] newrecs = new FieldSet[(int) recno + 1]; - System.arraycopy(records, 0, newrecs, 0, records.length); - records = newrecs; - } - FieldSet fs = records[(int) recno]; - if (fs == null) { - records[(int) recno] = (fs = new FieldSet(this.nmembers)); - } - fs.fields[fieldno] = field; - } - - ////////////////////////////////////////////////// - // CDMArray Interface - - @Override - public DapType getBaseType() { - return this.basetype; - } - - @Override - public DSP getDSP() { - return this.dsp; - } - - @Override - public DapVariable getTemplate() { - return template; - } - - ////////////////////////////////////////////////// - - public String toString() { - StringBuilder buf = new StringBuilder(); - DapVariable var = this.template; - DapSequence seq = (DapSequence) this.basetype; - long dimsize = DapUtil.dimProduct(var.getDimensions()); - for (int i = 0; i < dimsize; i++) { - List fields = seq.getFields(); - if (i < (dimsize - 1)) - buf.append("\n"); - buf.append("Sequence {\n"); - buf.append(String.format("} [%d/%d]", i, dimsize)); - } - return buf.toString(); - } - - - ////////////////////////////////////////////////// - // ArraySequence/ArrayStructure overrides - - @Override - public int getStructureDataCount() { - return this.records.length; - } - - @Override - protected StructureData makeStructureData(ArrayStructure as, int index) { - throw new UnsupportedOperationException("Cannot subset a Sequence"); - } - - /** - * Get the index'th StructureData(StructureDataA) object - * We need instances of StructureData to give to the user. - * We use StructureDataA so we can centralize everything - * in this class. The total number of StructureData objects - * is dimsize. - * - * @param index - * @return - */ - @Override - public StructureData getStructureData(int index) { - assert (super.sdata != null); - if (index < 0 || index >= this.records.length) - throw new IllegalArgumentException(index + " >= " + super.sdata.length); - assert (super.sdata[index] != null); - return super.sdata[index]; - } - - public ArraySequence getArraySequence(StructureMembers.Member m) { - return this; - } - - ///////////////////////// - // Define API required by StructureDataA - @Override - public Array copy() { - return this; // temporary - } - - /** - * Get member data of any type for a specific record as an Array. - * This may avoid the overhead of creating the StructureData object, - * but is equivalent to getStructure(recno).getArray( Member m). - * - * @param recno get data from the recnum-th StructureData of the ArrayStructure. - * Must be less than getSize(); - * @param m get data from this StructureMembers.Member. - * @return Array values. - */ - public Array getArray(int recno, StructureMembers.Member m) { - return (ucar.ma2.Array) memberArray(recno, CDMArrayStructure.memberIndex(m)); - } - - ///////////////////////// - - protected CDMArrayAtomic getAtomicArray(int index, StructureMembers.Member m) { - Array dd = memberArray(index, CDMArrayStructure.memberIndex(m)); - if (dd.getDataType() != DataType.STRUCTURE && dd.getDataType() != DataType.SEQUENCE) - return (CDMArrayAtomic) dd; - throw new ForbiddenConversionException("Cannot convert structure to AtomicArray"); - } - - protected Array memberArray(int recno, int memberindex) { - - Object[] values = new Object[(int) this.recordcount]; - for (int i = 0; i < this.recordcount; i++) { - FieldSet fs = records[i]; - values[i] = fs.fields[memberindex]; - } - DapVariable field = ((DapStructure) this.basetype).getField(memberindex); - DapType base = field.getBaseType(); - if (base == null) - throw new IllegalStateException("Unknown field type: " + field); - DataType dt = CDMTypeFcns.daptype2cdmtype(base); - Class elemtype = CDMTypeFcns.cdmElementClass(dt); - int shape[] = new int[] {(int) this.recordcount}; - return new ArrayObject(dt, elemtype, false, shape, values); - } -} - diff --git a/dap4/d4cdm/src/main/java/dap4/cdm/nc2/CDMArrayStructure.java b/dap4/d4cdm/src/main/java/dap4/cdm/nc2/CDMArrayStructure.java deleted file mode 100644 index 57421103f9..0000000000 --- a/dap4/d4cdm/src/main/java/dap4/cdm/nc2/CDMArrayStructure.java +++ /dev/null @@ -1,487 +0,0 @@ -/* - * Copyright 2012, UCAR/Unidata. - * See the LICENSE file for more information. - */ - -package dap4.cdm.nc2; - -import dap4.cdm.CDMTypeFcns; -import dap4.cdm.CDMUtil; -import dap4.core.data.DSP; -import dap4.core.data.DataCursor; -import dap4.core.dmr.DapStructure; -import dap4.core.dmr.DapType; -import dap4.core.dmr.DapVariable; -import dap4.core.util.DapException; -import dap4.core.util.DapUtil; -import dap4.core.util.Slice; -import dap4.dap4lib.LibTypeFcns; -import ucar.ma2.*; -import ucar.nc2.Group; -import java.nio.ByteBuffer; -import java.util.List; -import static dap4.core.data.DataCursor.Scheme; - -/** - * Implementation of ArrayStructure that wraps - * DAP4 databuffer - * (Note: Needs serious optimization applied). - *

- * Given - * Structure S {f1,f2,...fm} [d1][d2]...[dn], - * internally, this is stored as a 2-D array - * CDMArray[][] instances; - * The first dimension's length is d1*d2*...dn. - * The second dimension has size |members| i.e. the number - * of fields in the sequence. - */ - -/* package */ class CDMArrayStructure extends ArrayStructure implements CDMArray { - ////////////////////////////////////////////////// - // Type decls - - /** - * We need to keep a map of index X fieldno -> Array - * representing the Array behind each field for each - * struct instance in a matrix of struct instances. - * To promote some clarity a eschew Array[|dimset|][|fields|] - * in favor of FieldArrays[|dimset|]. - */ - protected static class FieldArrays { - public Array[] fields; // Make externally accessible - - FieldArrays(int nfields) { - fields = new Array[nfields]; - } - - } - - ////////////////////////////////////////////////// - // Instance variables - - // CDMArry variables - protected Group cdmroot = null; - protected DSP dsp = null; - protected DapVariable template = null; - protected DapType basetype = null; - protected long dimsize = 0; - protected int nmembers = 0; - - protected DataCursor data = null; - - /** - * Since we are using StructureDataA, - * we store a list Field sets - * So we have a map: index -> Field object. - * Total number of objects is dimsize. - * Accessed by calls from StructureDataA. - * Note: We use the super.sdata field to store - * the StructureData instances. - */ - - // Note: term records here means the elements of the array, - // not record as in Sequence - - protected FieldArrays[] records = null; // list of Structure elements - - - ////////////////////////////////////////////////// - // Constructor(s) - - /** - * Constructor - * - * @param cdmroot the parent CDMDataset - * @param data the structure data - */ - CDMArrayStructure(Group cdmroot, DataCursor data) { - super(computemembers((DapVariable) data.getTemplate()), - CDMUtil.computeEffectiveShape(((DapVariable) data.getTemplate()).getDimensions())); - this.template = (DapVariable) data.getTemplate(); - assert data.getScheme() == Scheme.STRUCTARRAY; - this.dsp = data.getDSP(); - this.cdmroot = cdmroot; - this.basetype = this.template.getBaseType(); - this.dimsize = DapUtil.dimProduct(template.getDimensions()); - this.nmembers = ((DapStructure) template.getBaseType()).getFields().size(); - - this.data = data; - - // Fill in the structdata (in parent) and instance vectors - super.sdata = new StructureDataA[(int) this.dimsize]; - records = new FieldArrays[(int) this.dimsize]; - for (int i = 0; i < dimsize; i++) { - super.sdata[i] = new StructureDataA(this, i); - records[i] = new FieldArrays(this.nmembers); - } - } - - /** - * - * @param recno struct instance - * @param fieldno field of that struct - * @param field Array backing this field in this struct instance - */ - /* package */ - void add(long recno, int fieldno, Array field) { - FieldArrays fs = records[(int) recno]; - if (fs == null) - records[(int) recno] = (fs = new FieldArrays(this.nmembers)); - fs.fields[fieldno] = field; - } - ////////////////////////////////////////////////// - // CDMArray Interface - - @Override - public DSP getDSP() { - return this.dsp; - } - - @Override - public DapVariable getTemplate() { - return this.template; - } - - @Override - public DapType getBaseType() { - return this.basetype; - } - - ////////////////////////////////////////////////// - // Accessors - - @Override - public long getSize() { - return this.dimsize; - } - - ////////////////////////////////////////////////// - - public String toString() { - StringBuilder buf = new StringBuilder(); - DapVariable var = (DapVariable) this.template; - DapStructure struct = (DapStructure) var.getBaseType(); - for (int i = 0; i < this.dimsize; i++) { - List fields = struct.getFields(); - if (i < (this.dimsize - 1)) - buf.append("\n"); - buf.append("Structure {\n"); - if (fields != null) { - for (int j = 0; j < this.nmembers; j++) { - Array field = records[i].fields[j]; - String sfield = (field == null ? "null" : fields.toString()); - buf.append(sfield + "\n"); - } - } - buf.append(String.format("} [%d/%d]", i, dimsize)); - } - return buf.toString(); - } - - ////////////////////////////////////////////////// - // ArrayStructure interface - - /** - * Get the index'th StructureData(StructureDataA) object - * We need instances of StructureData to give to the user. - * We use StructureDataA so we can centralize everything - * in this class. The total number of StructureData objects - * is dimsize. - * - * @param index - * @return - */ - @Override - public StructureData getStructureData(int index) { - assert (super.sdata != null); - if (index < 0 || index >= this.dimsize) - throw new IllegalArgumentException(index + " >= " + super.sdata.length); - assert (super.sdata[index] != null); - return super.sdata[index]; - } - - public double getScalarDouble(int index, StructureMembers.Member m) { - CDMArrayAtomic data = getAtomicArray(index, m); - return data.getDouble(0); - } - - public float getScalarFloat(int index, StructureMembers.Member m) { - CDMArrayAtomic data = getAtomicArray(index, m); - return data.getFloat(0); - } - - public byte getScalarByte(int index, StructureMembers.Member m) { - CDMArrayAtomic data = getAtomicArray(index, m); - return data.getByte(0); - } - - public short getScalarShort(int index, StructureMembers.Member m) { - CDMArrayAtomic data = getAtomicArray(index, m); - return data.getShort(0); - } - - public int getScalarInt(int index, StructureMembers.Member m) { - CDMArrayAtomic data = getAtomicArray(index, m); - return data.getInt(0); - } - - public long getScalarLong(int index, StructureMembers.Member m) { - CDMArrayAtomic data = getAtomicArray(index, m); - return data.getLong(0); - } - - public char getScalarChar(int index, StructureMembers.Member m) { - CDMArrayAtomic data = getAtomicArray(index, m); - return data.getChar(0); - } - - /** - * Get member databuffer of type String or char. - * - * @param recnum get databuffer from the recnum-th StructureData of the ArrayStructure. Must be less than getSize(); - * @param m get databuffer from this StructureMembers.Member. Must be of type String or char. - * @return scalar String value - */ - public String getScalarString(int recnum, StructureMembers.Member m) { - Array data = m.getDataArray(); - return (String) data.getObject(recnum).toString(); - } - - public double[] getJavaArrayDouble(int recnum, StructureMembers.Member m) { - CDMArrayAtomic array = getAtomicArray(recnum, m); - if (!array.getBaseType().isNumericType()) - throw new IllegalArgumentException("Cannot convert non-numeric type"); - DapType atomtype = array.getBaseType(); - try { - List slices = CDMUtil.shapeToSlices(m.getShape()); - Object vector = data.read(slices); - return (double[]) LibTypeFcns.convertVector(DapType.FLOAT64, atomtype, vector); - } catch (DapException de) { - throw new UnsupportedOperationException(de); - } - } - - public float[] getJavaArrayFloat(int index, StructureMembers.Member m) { - CDMArrayAtomic array = getAtomicArray(index, m); - if (!array.getBaseType().isNumericType()) - throw new IllegalArgumentException("Cannot convert non-numeric type"); - DapType atomtype = array.getBaseType(); - try { - List slices = CDMUtil.shapeToSlices(m.getShape()); - Object vector = data.read(slices); - return (float[]) LibTypeFcns.convertVector(DapType.FLOAT32, atomtype, vector); - } catch (DapException de) { - throw new UnsupportedOperationException(de); - } - } - - public byte[] getJavaArrayByte(int index, StructureMembers.Member m) { - CDMArrayAtomic array = getAtomicArray(index, m); - if (!array.getBaseType().isNumericType()) - throw new IllegalArgumentException("Cannot convert non-numeric type"); - DapType atomtype = array.getBaseType(); - try { - List slices = CDMUtil.shapeToSlices(m.getShape()); - Object vector = data.read(slices); - return (byte[]) LibTypeFcns.convertVector(DapType.INT8, atomtype, vector); - } catch (DapException de) { - throw new UnsupportedOperationException(de); - } - } - - public short[] getJavaArrayShort(int index, StructureMembers.Member m) { - CDMArrayAtomic array = getAtomicArray(index, m); - if (!array.getBaseType().isNumericType()) - throw new IllegalArgumentException("Cannot convert non-numeric type"); - DapType atomtype = array.getBaseType(); - try { - List slices = CDMUtil.shapeToSlices(m.getShape()); - Object vector = data.read(slices); - return (short[]) LibTypeFcns.convertVector(DapType.INT16, atomtype, vector); - } catch (DapException de) { - throw new UnsupportedOperationException(de); - } - } - - public int[] getJavaArrayInt(int index, StructureMembers.Member m) { - CDMArrayAtomic array = getAtomicArray(index, m); - if (!array.getBaseType().isNumericType()) - throw new IllegalArgumentException("Cannot convert non-numeric type"); - DapType atomtype = array.getBaseType(); - try { - List slices = CDMUtil.shapeToSlices(m.getShape()); - Object vector = data.read(slices); - return (int[]) LibTypeFcns.convertVector(DapType.INT32, atomtype, vector); - } catch (DapException de) { - throw new UnsupportedOperationException(de); - } - } - - public long[] getJavaArrayLong(int index, StructureMembers.Member m) { - CDMArrayAtomic array = getAtomicArray(index, m); - if (!array.getBaseType().isNumericType()) - throw new IllegalArgumentException("Cannot convert non-numeric type"); - DapType atomtype = array.getBaseType(); - try { - List slices = CDMUtil.shapeToSlices(m.getShape()); - Object vector = data.read(slices); - return (long[]) LibTypeFcns.convertVector(DapType.INT64, atomtype, vector); - } catch (DapException de) { - throw new UnsupportedOperationException(de); - } - } - - public char[] getJavaArrayChar(int index, StructureMembers.Member m) { - CDMArrayAtomic array = getAtomicArray(index, m); - if (!array.getBaseType().isNumericType()) - throw new IllegalArgumentException("Cannot convert non-numeric type"); - DapType atomtype = array.getBaseType(); - try { - List slices = CDMUtil.shapeToSlices(m.getShape()); - Object vector = data.read(slices); - return (char[]) LibTypeFcns.convertVector(DapType.CHAR, atomtype, vector); - } catch (DapException de) { - throw new UnsupportedOperationException(de); - } - } - - public String[] getJavaArrayString(int index, StructureMembers.Member m) { - CDMArrayAtomic array = getAtomicArray(index, m); - DapType atomtype = array.getBaseType(); - try { - List slices = CDMUtil.shapeToSlices(m.getShape()); - Object vector = data.read(slices); - return (String[]) LibTypeFcns.convertVector(DapType.STRING, atomtype, vector); - } catch (DapException de) { - throw new UnsupportedOperationException(de); - } - } - - public ByteBuffer[] getJavaArrayOpaque(int index, StructureMembers.Member m) { - CDMArrayAtomic array = getAtomicArray(index, m); - DapType atomtype = array.getBaseType(); - try { - List slices = CDMUtil.shapeToSlices(m.getShape()); - Object vector = data.read(slices); - return (ByteBuffer[]) LibTypeFcns.convertVector(DapType.OPAQUE, atomtype, vector); - } catch (DapException de) { - throw new UnsupportedOperationException(de); - } - } - - // Non-atomic cases - - public StructureData getScalarStructure(int index, StructureMembers.Member m) { - if (m.getDataType() != DataType.STRUCTURE) - throw new ForbiddenConversionException("Atomic field cannot be converted to Structure"); - Array ca = memberArray(index, memberIndex(m)); - if (ca.getDataType() != DataType.STRUCTURE && ca.getDataType() != DataType.SEQUENCE) - throw new ForbiddenConversionException("Attempt to access non-structure member"); - CDMArrayStructure as = (CDMArrayStructure) ca; - return as.getStructureData(0); - } - - public ArrayStructure getArrayStructure(int index, StructureMembers.Member m) { - if (m.getDataType() != DataType.STRUCTURE) - throw new ForbiddenConversionException("Atomic field cannot be converted to Structure"); - Array dd = memberArray(index, memberIndex(m)); - if (dd.getDataType() != DataType.STRUCTURE && dd.getDataType() != DataType.SEQUENCE) - throw new ForbiddenConversionException("Attempt to access non-structure member"); - return (CDMArrayStructure) dd; - } - - public ArraySequence getArraySequence(StructureMembers.Member m) { - throw new UnsupportedOperationException("CDMArraySequence"); - } - - @Override - public Array copy() { - return this; // temporary - } - - ///////////////////////// - // Define API required by StructureDataA - - /** - * Key interface method coming in from StructureDataA. - * - * @param recno The instance # of the array of Structure instances - * @param m The member of interest in the Structure instance - * @return The ucar.ma2.Array instance corresponding to the instance. - *

- * Hidden: friend of StructureDataA - */ - @Override - public ucar.ma2.Array getArray(int recno, StructureMembers.Member m) { - return (ucar.ma2.Array) memberArray(recno, memberIndex(m)); - } - - ////////////////////////////////////////////////// - // Utilities - - @Override - protected StructureData makeStructureData(ArrayStructure as, int index) { - if (super.sdata[index] == null) - super.sdata[index] = new StructureDataA(as, index); - return super.sdata[index]; - } - - /** - * Compute the StructureMembers object - * from a DapStructure. May need to recurse - * if a field is itself a Structure - * - * @param var The DapVariable to use to construct - * a StructureMembers object. - * @return The StructureMembers object for the given DapStructure - */ - static StructureMembers computemembers(DapVariable var) { - DapStructure ds = (DapStructure) var.getBaseType(); - StructureMembers sm = new StructureMembers(ds.getShortName()); - List fields = ds.getFields(); - for (int i = 0; i < fields.size(); i++) { - DapVariable field = fields.get(i); - DapType dt = field.getBaseType(); - DataType cdmtype = CDMTypeFcns.daptype2cdmtype(dt); - StructureMembers.Member m = - sm.addMember(field.getShortName(), "", null, cdmtype, CDMUtil.computeEffectiveShape(field.getDimensions())); - m.setDataParam(i); // So we can index into various lists - // recurse if this field is itself a structure - if (dt.getTypeSort().isStructType()) { - StructureMembers subsm = computemembers(field); - m.setStructureMembers(subsm); - } - } - return sm; - } - - /** - * @param recno The instance # of the array of Structure instances - * @param memberindex The member of interest in the Structure instance - * @return The ucar.ma2.Array instance corresponding to the instance. - */ - protected Array memberArray(int recno, int memberindex) { - DapVariable var = (DapVariable) this.getTemplate(); - DapStructure struct = (DapStructure) var.getBaseType(); - DapVariable field = struct.getField(memberindex); - DapType base = field.getBaseType(); - if (base == null) - throw new IllegalStateException("Unknown field type: " + field); - Object[] values = new Object[(int) field.getCount()]; - FieldArrays fs = records[recno]; - Array fa = fs.fields[memberindex]; - return fa; - } - - protected static int memberIndex(StructureMembers.Member m) { - return m.getDataParam(); - } - - protected CDMArrayAtomic getAtomicArray(int index, StructureMembers.Member m) { - Array dd = memberArray(index, memberIndex(m)); - if (dd.getDataType() != DataType.STRUCTURE && dd.getDataType() != DataType.SEQUENCE) - return (CDMArrayAtomic) dd; - throw new ForbiddenConversionException("Cannot convert structure to AtomicArray"); - } - -} diff --git a/dap4/d4cdm/src/main/java/dap4/cdm/nc2/DataToCDM.java b/dap4/d4cdm/src/main/java/dap4/cdm/nc2/DataToCDM.java deleted file mode 100644 index 96b85a765d..0000000000 --- a/dap4/d4cdm/src/main/java/dap4/cdm/nc2/DataToCDM.java +++ /dev/null @@ -1,199 +0,0 @@ -/* - * Copyright 2012, UCAR/Unidata. - * See the LICENSE file for more information. - */ - - -package dap4.cdm.nc2; - -import dap4.cdm.NodeMap; -import dap4.core.data.DSP; -import dap4.core.data.DataCursor; -import dap4.core.dmr.*; -import dap4.core.util.DapException; -import dap4.core.util.DapUtil; -import dap4.core.util.Index; -import dap4.core.util.Odometer; -import ucar.ma2.Array; -import ucar.nc2.Attribute; -import ucar.nc2.Group; -import ucar.nc2.Variable; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * Create a set of CDM ucar.ma2.array objects that wrap a DSP. - */ - -public class DataToCDM { - public static boolean DEBUG = false; - - ////////////////////////////////////////////////// - // Constants - - protected static final int COUNTSIZE = 8; // databuffer as specified by the DAP4 spec - - protected static final String LBRACE = "{"; - protected static final String RBRACE = "}"; - - ////////////////////////////////////////////////// - // Instance variables - - protected DapNetcdfFile ncfile = null; - protected DSP dsp = null; - protected DapDataset dmr = null; - protected Group cdmroot = null; - protected Map arraymap = null; - protected NodeMap nodemap = null; - - ////////////////////////////////////////////////// - // Constructor(s) - - /** - * Constructor - * - * @param ncfile the target NetcdfDataset - * @param dsp the compiled D4 databuffer - */ - - public DataToCDM(DapNetcdfFile ncfile, DSP dsp, NodeMap nodemap) throws DapException { - this.ncfile = ncfile; - this.dsp = dsp; - this.dmr = dsp.getDMR(); - this.nodemap = nodemap; - this.cdmroot = ncfile.getRootGroup(); - arraymap = new HashMap(); - // Add endianness attribute to the group - /* - * ByteOrder remoteorder = ncfile.getDSP().getOrder(); - * String endianness = null; - * if(remoteorder != null) { - * if(remoteorder == ByteOrder.BIG_ENDIAN) - * endianness = "big"; - * else if(remoteorder == ByteOrder.BIG_ENDIAN) - * endianness = "little"; - * } - * if(endianness != null) { - * Attribute aendian = new Attribute(DapUtil.ENDIANATTRNAME, endianness); - * this.cdmroot.addAttribute(aendian); - * } - */ - } - - ////////////////////////////////////////////////// - // Compile DataCursor objects to ucar.ma2.Array objects - - /* package access */ - Map create() throws DapException { - // iterate over the variables represented in the DSP - List topvars = this.dmr.getTopVariables(); - Map map = null; - for (DapVariable var : topvars) { - DataCursor cursor = this.dsp.getVariableData(var); - Array array = createVar(cursor); - Variable cdmvar = (Variable) nodemap.get(var); - arraymap.put(cdmvar, array); - } - return this.arraymap; - } - - protected Array createVar(DataCursor data) throws DapException { - Array array = null; - DapVariable d4var = (DapVariable) data.getTemplate(); - switch (d4var.getBaseType().getTypeSort()) { - default: // atomic var - array = createAtomicVar(data); - break; - case Sequence: - array = createSequence(data); - break; - case Structure: - array = createStructure(data); - break; - } - if (d4var.isTopLevel() && this.dsp.getChecksumMode().enabled(dsp.getChecksumMode())) { - // transfer the checksum attribute - int csum = d4var.getChecksum(); - String scsum = String.format("0x%08x", csum); - Variable cdmvar = (Variable) nodemap.get(d4var); - Attribute acsum = new Attribute(DapUtil.CHECKSUMATTRNAME, scsum); - cdmvar.addAttribute(acsum); - } - return array; - } - - /** - * Create an Atomic Valued variable. - * - * @return An Array object wrapping d4var. - * @throws DapException - */ - protected CDMArrayAtomic createAtomicVar(DataCursor data) throws DapException { - CDMArrayAtomic array = new CDMArrayAtomic(data); - return array; - } - - /** - * Create an array of structures. WARNING: the underlying CDM code - * (esp. NetcdfDataset) apparently does not support nested - * structure arrays; so this code may throw an exception. - * - * @return A CDMArrayStructure for the databuffer for this struct. - * @throws DapException - */ - protected CDMArrayStructure createStructure(DataCursor data) throws DapException { - CDMArrayStructure arraystruct = new CDMArrayStructure(this.cdmroot, data); - DapVariable var = (DapVariable) data.getTemplate(); - DapStructure struct = (DapStructure) var.getBaseType(); - int nmembers = struct.getFields().size(); - List dimset = var.getDimensions(); - Odometer odom = Odometer.factory(DapUtil.dimsetToSlices(dimset)); - while (odom.hasNext()) { - Index index = odom.next(); - long offset = index.index(); - DataCursor[] cursors = (DataCursor[]) data.read(index); - DataCursor ithelement = cursors[0]; - for (int f = 0; f < nmembers; f++) { - DataCursor dc = (DataCursor) ithelement.readField(f); - Array afield = createVar(dc); - arraystruct.add(offset, f, afield); - } - } - return arraystruct; - } - - /** - * Create a sequence. WARNING: the underlying CDM code - * (esp. NetcdfDataset) apparently does not support nested - * sequence arrays. - * - * @param data the data underlying this sequence instance - * @return A CDMArraySequence for this instance - * @throws DapException - */ - - protected CDMArraySequence createSequence(DataCursor data) throws DapException { - CDMArraySequence arrayseq = new CDMArraySequence(this.cdmroot, data); - DapVariable var = (DapVariable) data.getTemplate(); - DapSequence template = (DapSequence) var.getBaseType(); - List dimset = var.getDimensions(); - long dimsize = DapUtil.dimProduct(dimset); - int nfields = template.getFields().size(); - Odometer odom = Odometer.factory(DapUtil.dimsetToSlices(dimset)); - while (odom.hasNext()) { - odom.next(); - DataCursor seq = ((DataCursor[]) data.read(odom.indices()))[0]; - long nrecords = seq.getRecordCount(); - for (int r = 0; r < nrecords; r++) { - DataCursor rec = seq.readRecord(r); - for (int f = 0; f < nfields; f++) { - DataCursor dc = rec.readField(f); - Array afield = createVar(dc); - arrayseq.add(r, f, afield); - } - } - } - return arrayseq; - } -} diff --git a/dap4/d4cdm/src/main/resources/META-INF/services/ucar.nc2.dataset.spi.NetcdfFileProvider b/dap4/d4cdm/src/main/resources/META-INF/services/ucar.nc2.dataset.spi.NetcdfFileProvider deleted file mode 100644 index 8acc1012f6..0000000000 --- a/dap4/d4cdm/src/main/resources/META-INF/services/ucar.nc2.dataset.spi.NetcdfFileProvider +++ /dev/null @@ -1 +0,0 @@ -dap4.cdm.nc2.DapNetcdfFileProvider \ No newline at end of file diff --git a/dap4/d4core/build.gradle b/dap4/d4core/build.gradle deleted file mode 100644 index 9e4a50d5b4..0000000000 --- a/dap4/d4core/build.gradle +++ /dev/null @@ -1,5 +0,0 @@ -// d4core has no dependencies -apply from: "$rootDir/gradle/any/java-library.gradle" - -dependencies { -} diff --git a/dap4/d4core/src/main/java/dap4/core/data/ChecksumMode.java b/dap4/d4core/src/main/java/dap4/core/data/ChecksumMode.java deleted file mode 100644 index 5554e36c42..0000000000 --- a/dap4/d4core/src/main/java/dap4/core/data/ChecksumMode.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2012, UCAR/Unidata. - * See the LICENSE file for more information. - */ - -package dap4.core.data; - -/** - * Define possible checksum modes: - * - */ -public enum ChecksumMode { - NONE, // => serialized data has no checksums - IGNORE, // => skip, but ignore any checksumming (client side) - DMR, // => compute checksums for DMR requests only - DAP, // => compute checksums for Data requests only - ALL; // => compute checksums for both kinds of requestsNONE, DMR, DAP, ALL; - - /** - * Return true if the ckm mode is allowed with this, false otherwise - * - * @param ckm - * @return true, if enabled - */ - public boolean enabled(ChecksumMode ckm) { - if (ckm == null || this == NONE) - return false; - if (this == ckm) - return true; - if (this == ALL) - return true; - return false; - } - - public static ChecksumMode modeFor(String s) { - if (s == null || s.length() == 0) - return DAP; - for (ChecksumMode mode : values()) { - if (mode.name().equalsIgnoreCase(s)) - return mode; - } - return null; - } -} diff --git a/dap4/d4core/src/main/java/dap4/core/data/Constraint.java b/dap4/d4core/src/main/java/dap4/core/data/Constraint.java deleted file mode 100644 index 271e341d78..0000000000 --- a/dap4/d4core/src/main/java/dap4/core/data/Constraint.java +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright 2012, UCAR/Unidata. - * See the LICENSE file for more information. - */ - -package dap4.core.data; - -/** - * This interface is intended to serve - * as a standin for some kind of constraint. - */ - -public interface Constraint { - // Deliberately empty -} diff --git a/dap4/d4core/src/main/java/dap4/core/data/DSP.java b/dap4/d4core/src/main/java/dap4/core/data/DSP.java deleted file mode 100644 index 7715ee5a35..0000000000 --- a/dap4/d4core/src/main/java/dap4/core/data/DSP.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2012, UCAR/Unidata. - * See the LICENSE file for more information. - */ - -package dap4.core.data; - -import dap4.core.dmr.DapDataset; -import dap4.core.dmr.DapVariable; -import dap4.core.util.DapContext; -import dap4.core.util.DapException; -import java.io.IOException; -import java.nio.ByteOrder; - -public interface DSP { - /* - * All implementing classes must implement: - * 1. a static dspMatch() function - * 2. A parameterless constructor - */ - - /** - * Determine if a path refers to an object processable by this DSP - * - * @param path - * @param context - * @return true if this path can be processed by an instance of this DSP - */ - public boolean dspMatch(String path, DapContext context); - - /** - * @param path It is assumed that the path - * is appropriate to the dsp - * E.g. an absolute path or a url - * @return DSP wrapping the path source - * @throws dap4.core.util.DapException - */ - public DSP open(String path) throws DapException; - - public void close() throws IOException; - - public String getLocation(); - - public DSP setLocation(String location); - - public Object getContext(); - - public void setContext(DapContext cxt); - - public DapDataset getDMR() throws dap4.core.util.DapException; - - public DataCursor getVariableData(DapVariable var) throws DapException; - - public ByteOrder getOrder(); - - public ChecksumMode getChecksumMode(); - -} diff --git a/dap4/d4core/src/main/java/dap4/core/data/DataCursor.java b/dap4/d4core/src/main/java/dap4/core/data/DataCursor.java deleted file mode 100644 index 2da280d972..0000000000 --- a/dap4/d4core/src/main/java/dap4/core/data/DataCursor.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright 2012, UCAR/Unidata. - * See the LICENSE file for more information. - */ - -package dap4.core.data; - -import dap4.core.dmr.DapNode; -import dap4.core.util.DapException; -import dap4.core.util.Index; -import dap4.core.util.Slice; -import java.util.List; - -/** - * For data access, we adopt a cursor model. - * This comes from database technology where a - * cursor object is used to walk over the - * results of a database query. Here the cursor - * walks the underlying data and stores enough - * state to extract data depending on its - * sort. The cursor may (or may not) contain - * internal subclasses to track various kinds of - * state. - */ - -public interface DataCursor { - ////////////////////////////////////////////////// - // Kinds of Cursor - - public static enum Scheme { - ATOMIC, STRUCTARRAY, STRUCTURE, SEQARRAY, SEQUENCE, RECORD; - - public boolean isCompoundArray() { - return this == STRUCTARRAY || this == SEQARRAY; - } - } - - ////////////////////////////////////////////////// - // API - - public Scheme getScheme(); - - public DSP getDSP(); - - public DapNode getTemplate(); - - public Index getIndex() throws DapException; - - public boolean isScalar(); - - public boolean isField(); - - // Return null if top-level, else return the struct/seq from which this is derived - public DataCursor getContainer(); - - ////////////////////////////////////////////////// - // Atomic Data Management - - // As a rule, only one will be fully implemented and the other written - // to use the fully implemented one. - // Returns: - // atomic - array of data values - // structure/sequence - DataCursor[] - // Even if the result is a scalar, - // a 1-element array will be returned. - - public Object read(List slices) throws DapException; - - public Object read(Index index) throws DapException; - - ////////////////////////////////////////////////// - // Sequence record management - // assert scheme == SEQUENCE - - public long getRecordCount() throws DapException; - - public DataCursor readRecord(long i) throws DapException; - - public long getRecordIndex() throws DapException; // assert scheme == RECORD - - ////////////////////////////////////////////////// - // field management - // assert scheme == STRUCTURE | scheme == RECORD - - public int fieldIndex(String name) throws DapException; // Convert a name to an index - - public DataCursor readField(int fieldindex) throws DapException; -} diff --git a/dap4/d4core/src/main/java/dap4/core/dmr/AnnotatedNode.java b/dap4/d4core/src/main/java/dap4/core/dmr/AnnotatedNode.java deleted file mode 100644 index d1fc804b04..0000000000 --- a/dap4/d4core/src/main/java/dap4/core/dmr/AnnotatedNode.java +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Copyright 2012, UCAR/Unidata. - * See the LICENSE file for more information. - */ - -package dap4.core.dmr; - -public interface AnnotatedNode { - public void annotate(Object key, Object value); - - public Object annotation(Object key); - - public void clearAnnotations(); -} diff --git a/dap4/d4core/src/main/java/dap4/core/dmr/DapXML.java b/dap4/d4core/src/main/java/dap4/core/dmr/DapXML.java deleted file mode 100644 index 74256c63b5..0000000000 --- a/dap4/d4core/src/main/java/dap4/core/dmr/DapXML.java +++ /dev/null @@ -1,253 +0,0 @@ -/* - * Copyright 2012, UCAR/Unidata. - * See the LICENSE file for more information. - */ - -package dap4.core.dmr; - -import dap4.core.util.DapException; -import org.w3c.dom.Node; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * This class is not intended to be a full org.w3c.DOM - * implementation. Rather it stores more-or-less - * equivalent information in a more AST like form. - */ - -public class DapXML { - ////////////////////////////////////////////////// - // Types - - public static class XMLList extends ArrayList { - } - - // This corresponds to a subset of the org.w3c.dom.Node - // nodetype codes. - - public static enum NodeType { - ELEMENT(Node.ELEMENT_NODE), ATTRIBUTE(Node.ATTRIBUTE_NODE), TEXT(Node.TEXT_NODE), CDATA( - Node.CDATA_SECTION_NODE), COMMENT( - Node.COMMENT_NODE), DOCUMENT(Node.DOCUMENT_NODE), DOCTYPE(Node.DOCUMENT_TYPE_NODE); - - private short w3c_nodetype; - - private NodeType(short nodetype) { - this.w3c_nodetype = nodetype; - } - - public short getW3CNodeType() { - return w3c_nodetype; - } - } - - ////////////////////////////////////////////////// - // Instance Variables - - protected String name = null; - protected DapXML parent = null; - - // Applies to all (or almost all) node types - protected NodeType nodetype = null; - protected String prefix = null; // namespace prefix or null - - // case NodeType.ELEMENT - protected List elements = new ArrayList(); - protected Map xmlattributes = new HashMap(); - - // case NodeType.ATTRIBUTE - protected String value = null; // for attribute nodes - - // case NodeType.TEXT - // case NodeType.CDATA - // case NodeType.COMMENT - protected String text = null; // for text or cdata nodes - - // case NodeType.DOCUMENT - // case NodeType.DOCTYPE - // unused - - ////////////////////////////////////////////////// - // Constructor(s) - - public DapXML() { - super(); - } - - public DapXML(NodeType nodetype, String fullname) { - setNodeType(nodetype); - // Decompose name into prefix plus short name - int i = fullname.indexOf(':'); - if (i >= 0) { - this.prefix = fullname.substring(i); - fullname = fullname.substring(i + 1, fullname.length()); - if (this.prefix.length() == 0) - this.prefix = null; - } - setName(fullname); - } - - ////////////////////////////////////////////////// - // Get/Set - - public String getName() { - return this.name; - } - - public void setName(String name) { - this.name = name; - } - - public NodeType getNodeType() { - return nodetype; - } - - public void setNodeType(NodeType nodetype) { - this.nodetype = nodetype; - this.prefix = null; - String fullname = null; - switch (nodetype) { - case COMMENT: - fullname = "#comment"; - break; - case TEXT: - fullname = "#text"; - break; - case DOCUMENT: - fullname = "#document"; - break; - case CDATA: - fullname = "#cdata-section"; - break; - default: - break; - } - setName(fullname); - } - - public String getLocalName() { - return getName(); - } - - public void setLocalName(String localname) { - setName(localname); - } - - public String getPrefix() { - return prefix; - } - - public void setPrefix(String prefix) { - this.prefix = prefix; - } - - public DapXML getParent() { - return this.parent; - } - - public void setParent(DapXML parent) { - this.parent = parent; - } - - public List getElements() { - return this.elements; - } - - public void addElement(DapXML child) { - if (elements == null) - this.elements = new ArrayList(); - elements.add(child); - child.setParent(this); - } - - public Map getXMLAttributes() { - return xmlattributes; - } - - public void addXMLAttribute(DapXML attr) throws DapException { - if (xmlattributes == null) - this.xmlattributes = new HashMap(); - if (xmlattributes.containsKey(attr.getName())) - throw new DapException("DapXML: attempt to add duplicate xml attribute: " + attr.getName()); - xmlattributes.put(attr.getName(), attr); - } - - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } - - public String getText() { - return text; - } - - public void setText(String text) { - this.text = text; - } - - public String toString() { - StringBuilder buf = new StringBuilder(); - stringify(0, buf); - return buf.toString(); - } - - protected void stringify(int depth, StringBuilder buf) { - switch (this.nodetype) { - case ELEMENT: - indent(depth, buf); - buf.append(this.name); - for (Map.Entry entry : xmlattributes.entrySet()) { - buf.append(' '); - entry.getValue().stringify(depth + 1, buf); - } - buf.append(">\n"); - for (DapXML sub : elements) { - sub.stringify(depth + 1, buf); - } - buf.append("\n"); - break; - case ATTRIBUTE: - buf.append(this.name); - buf.append('='); - buf.append('"'); - buf.append(this.value); - buf.append('"'); - break; - case TEXT: - indent(depth, buf); - buf.append(this.text); - buf.append("\n"); - break; - case CDATA: - indent(depth, buf); - buf.append("\n"); - break; - case COMMENT: - indent(depth, buf); - buf.append("\n"); - break; - case DOCUMENT: - case DOCTYPE: - break; - } - } - - protected void indent(int n, StringBuilder buf) { - for (int i = 0; i < n; i++) { - buf.append(' '); - } - } - -} diff --git a/dap4/d4core/src/main/java/dap4/core/dmr/parser/bison/Bison.java b/dap4/d4core/src/main/java/dap4/core/dmr/parser/bison/Bison.java deleted file mode 100644 index 245bfffc17..0000000000 --- a/dap4/d4core/src/main/java/dap4/core/dmr/parser/bison/Bison.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright 2012, UCAR/Unidata. - * See the LICENSE file for more information. - */ - -/** - * Define Bison specific decls. - */ - -package dap4.core.dmr.parser.bison; - -import org.xml.sax.Locator; - -public abstract class Bison { - public static class Position { - public Locator location; - - public Position(Locator loc) { - this.location = loc; - } - - public String toString() { - return location.getLineNumber() + ":" + location.getColumnNumber(); - } - - @Override - public boolean equals(Object o) { - if (!(o instanceof Position)) - return false; - Position po = (Position) o; - return po.location.getLineNumber() == po.location.getLineNumber() - && po.location.getColumnNumber() == po.location.getColumnNumber(); - } - - @Override - public int hashCode() { - return location.getLineNumber() << 20 | location.getColumnNumber(); - } - } - - /** - * A class defining a pair of positions. Positions, defined by the - * Bison.Position class, denote a point in the input. - * Locations represent a part of the input through the beginning - * and ending positions. - */ - public static class Location { - /** - * The first, inclusive, position in the range. - */ - public Bison.Position begin; - - /** - * The first position beyond the range. - */ - public Bison.Position end; - - /** - * Create a Location denoting an empty range located at - * a given point. - * - * @param loc The position at which the range is anchored. - */ - public Location(Bison.Position loc) { - this.begin = this.end = loc; - } - - /** - * Create a Location from the endpoints of the range. - * - * @param begin The first position included in the range. - * @param end The first position beyond the range. - */ - public Location(Bison.Position begin, Bison.Position end) { - this.begin = begin; - this.end = end; - } - - /** - * Print a representation of the location. For this to be correct, - * Bison.Position should override the equals - * method. - */ - public String toString() { - if (begin.equals(end)) - return begin.toString(); - else - return begin.toString() + "-" + end.toString(); - } - } - -} diff --git a/dap4/d4core/src/main/java/dap4/core/dmr/parser/bison/Dap4Actions.java b/dap4/d4core/src/main/java/dap4/core/dmr/parser/bison/Dap4Actions.java deleted file mode 100644 index 6843d415a9..0000000000 --- a/dap4/d4core/src/main/java/dap4/core/dmr/parser/bison/Dap4Actions.java +++ /dev/null @@ -1,182 +0,0 @@ -/* - * Copyright 2012, UCAR/Unidata. - * See the LICENSE file for more information. - */ - -package dap4.core.dmr.parser.bison; - -import dap4.core.dmr.DapXML; -import dap4.core.dmr.parser.ParseException; -import dap4.core.util.DapException; -import dap4.core.util.DapSort; -import java.math.BigInteger; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Map; - -/** - * The role of this class is as follows: - * 1. Define the abstract action procedures - * 2. Define useful common constants - * 3. Define useful common utility procedures - */ - -public abstract class Dap4Actions extends Dap4EventHandler { - - ////////////////////////////////////////////////// - // Constants - - static final float DAPVERSION = 4.0f; - static final float DMRVERSION = 1.0f; - - static final int RULENULL = 0; - static final int RULEDIMREF = 1; - static final int RULEMAPREF = 2; - static final int RULEVAR = 3; - static final int RULEMETADATA = 4; - - static final String[] RESERVEDTAGS = new String[] {"_edu.ucar"}; - - static final BigInteger BIG_INT64_MAX = BigInteger.valueOf(Long.MAX_VALUE); - - static final DapSort[] METADATASCOPES = new DapSort[] {DapSort.DATASET, DapSort.GROUP, DapSort.DIMENSION, DapSort.MAP, - DapSort.VARIABLE, DapSort.STRUCTURE, DapSort.SEQUENCE, DapSort.ATTRIBUTESET}; - - ////////////////////////////////////////////////// - // Type Decls - - // Predefined map types - static class XMLAttributeMap extends HashMap { - } - - static class NamespaceList extends ArrayList { - } - - - ////////////////////////////////////////////////// - // Instance variables - - ////////////////////////////////////////////////// - // Constructor(s) - - public Dap4Actions() {} - - /////////////////////////////////////////////////// - // Non-abstract parser actions - - XMLAttributeMap xml_attribute_map() throws DapException { - return new XMLAttributeMap(); - } - - XMLAttributeMap xml_attribute_map(XMLAttributeMap map, SaxEvent token) throws DapException { - assert (map != null && token != null); - if (map.containsKey(token.name)) - throw new DapException("XML attribute: duplicate xml attribute: " + token.name); - map.put(token.name.toLowerCase(), token); - return map; - } - - NamespaceList namespace_list() throws DapException { - return new NamespaceList(); - } - - NamespaceList namespace_list(NamespaceList list, SaxEvent token) throws DapException { - assert (list != null); - if (token != null && !list.contains(token.name)) - list.add(token.name); - return list; - } - - DapXML createxmltext(String text) throws DapException { - DapXML node = new DapXML(DapXML.NodeType.TEXT, null); - node.setText(text); - return node; - } - - DapXML createxmlelement(SaxEvent open, XMLAttributeMap map) throws DapException { - DapXML node = new DapXML(DapXML.NodeType.ELEMENT, open.name); - for (Map.Entry entry : map.entrySet()) { - SaxEvent att = entry.getValue(); - DapXML a = new DapXML(DapXML.NodeType.ATTRIBUTE, att.name); - a.addXMLAttribute(a); - } - return node; - } - - ////////////////////////////////////////////////// - // Abstract (subclass defined) parser actions - - abstract void enterdataset(XMLAttributeMap attrs) throws ParseException; - - abstract void leavedataset() throws ParseException; - - abstract void entergroup(XMLAttributeMap attrs) throws ParseException; - - abstract void leavegroup() throws ParseException; - - abstract void enterenumdef(XMLAttributeMap attrs) throws ParseException; - - abstract void leaveenumdef() throws ParseException; - - abstract void enumconst(SaxEvent name, SaxEvent value) throws ParseException; - - abstract void enterdimdef(XMLAttributeMap attrs) throws ParseException; - - abstract void leavedimdef() throws ParseException; - - abstract void dimref(SaxEvent nameorsize) throws ParseException; - - abstract void enteratomicvariable(SaxEvent open, XMLAttributeMap attrs) throws ParseException; - - abstract void leaveatomicvariable(SaxEvent close) throws ParseException; - - abstract void enterenumvariable(XMLAttributeMap attrs) throws ParseException; - - abstract void leaveenumvariable(SaxEvent close) throws ParseException; - - abstract void entermap(SaxEvent name) throws ParseException; - - abstract void leavemap() throws ParseException; - - abstract void enterstructurevariable(XMLAttributeMap attrs) throws ParseException; - - abstract void leavestructurevariable(SaxEvent close) throws ParseException; - - abstract void entersequencevariable(XMLAttributeMap attrs) throws ParseException; - - abstract void leavesequencevariable(SaxEvent close) throws ParseException; - - abstract void enteratomicattribute(XMLAttributeMap attrs, NamespaceList nslist) throws ParseException; - - abstract void leaveatomicattribute() throws ParseException; - - abstract void entercontainerattribute(XMLAttributeMap attrs, NamespaceList nslist) throws ParseException; - - abstract void leavecontainerattribute() throws ParseException; - - abstract void value(SaxEvent value) throws ParseException; - - abstract void value(String value) throws ParseException; - - abstract void entererror(XMLAttributeMap attrs) throws ParseException; - - abstract void leaveerror() throws ParseException; - - abstract void errormessage(String value) throws ParseException; - - abstract void errorcontext(String value) throws ParseException; - - abstract void errorotherinfo(String value) throws ParseException; - - abstract void otherxml(XMLAttributeMap attrs, DapXML root) throws ParseException; - - abstract DapXML.XMLList xml_body(DapXML.XMLList body, DapXML elemortext) throws ParseException; - - abstract DapXML element_or_text(SaxEvent open, XMLAttributeMap xmlattrlist, DapXML.XMLList body, SaxEvent close) - throws ParseException; - - abstract DapXML xmltext(SaxEvent text) throws ParseException; - - abstract String textstring(String prefix, SaxEvent text) throws ParseException; - -}// class Dap4Actions diff --git a/dap4/d4core/src/main/java/dap4/core/dmr/parser/bison/Dap4BisonParser.java b/dap4/d4core/src/main/java/dap4/core/dmr/parser/bison/Dap4BisonParser.java deleted file mode 100644 index c35758d2dd..0000000000 --- a/dap4/d4core/src/main/java/dap4/core/dmr/parser/bison/Dap4BisonParser.java +++ /dev/null @@ -1,1954 +0,0 @@ -/* A Bison parser, made by GNU Bison 3.0.4. */ - -/* - * Skeleton implementation for Bison LALR(1) parsers in Java - * - * Copyright (C) 2007-2015 Free Software Foundation, Inc. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -/* - * As a special exception, you may create a larger work that contains - * part or all of the Bison parser skeleton and distribute that work - * under terms of your choice, so long as that work isn't itself a - * parser generator using the skeleton or a modified version thereof - * as a parser skeleton. Alternatively, if you modify or redistribute - * the parser skeleton itself, you may (at your option) remove this - * special exception, which will cause the skeleton and the resulting - * Bison output files to be licensed under the GNU General Public - * License without this special exception. - * - * This special exception was added by the Free Software Foundation in - * version 2.2 of Bison. - */ - -package dap4.core.dmr.parser.bison; -/* First part of user declarations. */ - -/* "Dap4BisonParser.java":37 */ /* lalr1.java:91 */ - -/* "Dap4BisonParser.java":39 */ /* lalr1.java:92 */ -/* "%code imports" blocks. */ -/* "dap4.y":17 */ /* lalr1.java:93 */ - -import dap4.core.util.DapException; -import dap4.core.dmr.DapXML; - -/* "Dap4BisonParser.java":46 */ /* lalr1.java:93 */ - -/** - * A Bison parser, automatically generated from dap4.y. - * - * @author LALR (1) parser skeleton written by Paolo Bonzini. - */ -abstract class Dap4BisonParser extends Dap4Actions { - /** Version number for the Bison executable that generated this parser. */ - public static final String bisonVersion = "3.0.4"; - - /** Name of the skeleton that generated this parser. */ - public static final String bisonSkeleton = "lalr1.java"; - - - /** - * True if verbose error messages are enabled. - */ - private boolean yyErrorVerbose = true; - - /** - * Return whether verbose error messages are enabled. - */ - public final boolean getErrorVerbose() { - return yyErrorVerbose; - } - - /** - * Set the verbosity of error messages. - * - * @param verbose True to request verbose error messages. - */ - public final void setErrorVerbose(boolean verbose) { - yyErrorVerbose = verbose; - } - - - - /** - * Communication interface between the scanner and the Bison-generated - * parser Dap4BisonParser. - */ - public interface Lexer { - /** Token returned by the scanner to signal the end of its input. */ - public static final int EOF = 0; - - /* Tokens. */ - /** Token number,to be returned by the scanner. */ - static final int DATASET_ = 258; - /** Token number,to be returned by the scanner. */ - static final int _DATASET = 259; - /** Token number,to be returned by the scanner. */ - static final int GROUP_ = 260; - /** Token number,to be returned by the scanner. */ - static final int _GROUP = 261; - /** Token number,to be returned by the scanner. */ - static final int ENUMERATION_ = 262; - /** Token number,to be returned by the scanner. */ - static final int _ENUMERATION = 263; - /** Token number,to be returned by the scanner. */ - static final int ENUMCONST_ = 264; - /** Token number,to be returned by the scanner. */ - static final int _ENUMCONST = 265; - /** Token number,to be returned by the scanner. */ - static final int NAMESPACE_ = 266; - /** Token number,to be returned by the scanner. */ - static final int _NAMESPACE = 267; - /** Token number,to be returned by the scanner. */ - static final int DIMENSION_ = 268; - /** Token number,to be returned by the scanner. */ - static final int _DIMENSION = 269; - /** Token number,to be returned by the scanner. */ - static final int DIM_ = 270; - /** Token number,to be returned by the scanner. */ - static final int _DIM = 271; - /** Token number,to be returned by the scanner. */ - static final int ENUM_ = 272; - /** Token number,to be returned by the scanner. */ - static final int _ENUM = 273; - /** Token number,to be returned by the scanner. */ - static final int MAP_ = 274; - /** Token number,to be returned by the scanner. */ - static final int _MAP = 275; - /** Token number,to be returned by the scanner. */ - static final int STRUCTURE_ = 276; - /** Token number,to be returned by the scanner. */ - static final int _STRUCTURE = 277; - /** Token number,to be returned by the scanner. */ - static final int SEQUENCE_ = 278; - /** Token number,to be returned by the scanner. */ - static final int _SEQUENCE = 279; - /** Token number,to be returned by the scanner. */ - static final int VALUE_ = 280; - /** Token number,to be returned by the scanner. */ - static final int _VALUE = 281; - /** Token number,to be returned by the scanner. */ - static final int ATTRIBUTE_ = 282; - /** Token number,to be returned by the scanner. */ - static final int _ATTRIBUTE = 283; - /** Token number,to be returned by the scanner. */ - static final int OTHERXML_ = 284; - /** Token number,to be returned by the scanner. */ - static final int _OTHERXML = 285; - /** Token number,to be returned by the scanner. */ - static final int ERROR_ = 286; - /** Token number,to be returned by the scanner. */ - static final int _ERROR = 287; - /** Token number,to be returned by the scanner. */ - static final int MESSAGE_ = 288; - /** Token number,to be returned by the scanner. */ - static final int _MESSAGE = 289; - /** Token number,to be returned by the scanner. */ - static final int CONTEXT_ = 290; - /** Token number,to be returned by the scanner. */ - static final int _CONTEXT = 291; - /** Token number,to be returned by the scanner. */ - static final int OTHERINFO_ = 292; - /** Token number,to be returned by the scanner. */ - static final int _OTHERINFO = 293; - /** Token number,to be returned by the scanner. */ - static final int CHAR_ = 294; - /** Token number,to be returned by the scanner. */ - static final int _CHAR = 295; - /** Token number,to be returned by the scanner. */ - static final int BYTE_ = 296; - /** Token number,to be returned by the scanner. */ - static final int _BYTE = 297; - /** Token number,to be returned by the scanner. */ - static final int INT8_ = 298; - /** Token number,to be returned by the scanner. */ - static final int _INT8 = 299; - /** Token number,to be returned by the scanner. */ - static final int UINT8_ = 300; - /** Token number,to be returned by the scanner. */ - static final int _UINT8 = 301; - /** Token number,to be returned by the scanner. */ - static final int INT16_ = 302; - /** Token number,to be returned by the scanner. */ - static final int _INT16 = 303; - /** Token number,to be returned by the scanner. */ - static final int UINT16_ = 304; - /** Token number,to be returned by the scanner. */ - static final int _UINT16 = 305; - /** Token number,to be returned by the scanner. */ - static final int INT32_ = 306; - /** Token number,to be returned by the scanner. */ - static final int _INT32 = 307; - /** Token number,to be returned by the scanner. */ - static final int UINT32_ = 308; - /** Token number,to be returned by the scanner. */ - static final int _UINT32 = 309; - /** Token number,to be returned by the scanner. */ - static final int INT64_ = 310; - /** Token number,to be returned by the scanner. */ - static final int _INT64 = 311; - /** Token number,to be returned by the scanner. */ - static final int UINT64_ = 312; - /** Token number,to be returned by the scanner. */ - static final int _UINT64 = 313; - /** Token number,to be returned by the scanner. */ - static final int FLOAT32_ = 314; - /** Token number,to be returned by the scanner. */ - static final int _FLOAT32 = 315; - /** Token number,to be returned by the scanner. */ - static final int FLOAT64_ = 316; - /** Token number,to be returned by the scanner. */ - static final int _FLOAT64 = 317; - /** Token number,to be returned by the scanner. */ - static final int STRING_ = 318; - /** Token number,to be returned by the scanner. */ - static final int _STRING = 319; - /** Token number,to be returned by the scanner. */ - static final int URL_ = 320; - /** Token number,to be returned by the scanner. */ - static final int _URL = 321; - /** Token number,to be returned by the scanner. */ - static final int OPAQUE_ = 322; - /** Token number,to be returned by the scanner. */ - static final int _OPAQUE = 323; - /** Token number,to be returned by the scanner. */ - static final int ATTR_BASE = 324; - /** Token number,to be returned by the scanner. */ - static final int ATTR_BASETYPE = 325; - /** Token number,to be returned by the scanner. */ - static final int ATTR_DAPVERSION = 326; - /** Token number,to be returned by the scanner. */ - static final int ATTR_DMRVERSION = 327; - /** Token number,to be returned by the scanner. */ - static final int ATTR_ENUM = 328; - /** Token number,to be returned by the scanner. */ - static final int ATTR_HREF = 329; - /** Token number,to be returned by the scanner. */ - static final int ATTR_NAME = 330; - /** Token number,to be returned by the scanner. */ - static final int ATTR_NAMESPACE = 331; - /** Token number,to be returned by the scanner. */ - static final int ATTR_NS = 332; - /** Token number,to be returned by the scanner. */ - static final int ATTR_SIZE = 333; - /** Token number,to be returned by the scanner. */ - static final int ATTR_TYPE = 334; - /** Token number,to be returned by the scanner. */ - static final int ATTR_VALUE = 335; - /** Token number,to be returned by the scanner. */ - static final int ATTR_HTTPCODE = 336; - /** Token number,to be returned by the scanner. */ - static final int ATTR_SPECIAL = 337; - /** Token number,to be returned by the scanner. */ - static final int TEXT = 338; - /** Token number,to be returned by the scanner. */ - static final int UNKNOWN_ATTR = 339; - /** Token number,to be returned by the scanner. */ - static final int UNKNOWN_ELEMENT_ = 340; - /** Token number,to be returned by the scanner. */ - static final int _UNKNOWN_ELEMENT = 341; - - - - /** - * Method to retrieve the semantic value of the last scanned token. - * - * @return the semantic value of the last scanned token. - */ - Object getLVal(); - - /** - * Entry point for the scanner. Returns the token identifier corresponding - * to the next token and prepares to return the semantic value - * of the token. - * - * @return the token identifier corresponding to the next token. - */ - int yylex() throws DapException; - - /** - * Entry point for error reporting. Emits an error - * in a user-defined way. - * - * - * @param msg The string for the error message. - */ - void yyerror(String msg); - } - - private class YYLexer implements Lexer { - /* "%code lexer" blocks. */ - /* "dap4.y":22 */ /* lalr1.java:236 */ - - public Object getLVal() { - return null; - } - - public int yylex() { - return 0; - } - - public Bison.Position getStartPos() { - return null; - } - - public Bison.Position getEndPos() { - return null; - } - - public void yyerror(String s) { - System.err.println(s); - System.err.printf("near %s%n", getLocator()); - } - - - /* "Dap4BisonParser.java":304 */ /* lalr1.java:236 */ - - } - - /** - * The object doing lexical analysis for us. - */ - private Lexer yylexer; - - - - /** - * Instantiates the Bison-generated parser. - */ - public Dap4BisonParser() { - - this.yylexer = new YYLexer(); - - } - - - /** - * Instantiates the Bison-generated parser. - * - * @param yylexer The scanner that will supply tokens to the parser. - */ - protected Dap4BisonParser(Lexer yylexer) { - - this.yylexer = yylexer; - - } - - private java.io.PrintStream yyDebugStream = System.err; - - /** - * Return the PrintStream on which the debugging output is - * printed. - */ - public final java.io.PrintStream getDebugStream() { - return yyDebugStream; - } - - /** - * Set the PrintStream on which the debug output is printed. - * - * @param s The stream that is used for debugging output. - */ - public final void setDebugStream(java.io.PrintStream s) { - yyDebugStream = s; - } - - private int yydebug = 0; - - /** - * Answer the verbosity of the debugging output; 0 means that all kinds of - * output from the parser are suppressed. - */ - public final int getDebugLevel() { - return yydebug; - } - - /** - * Set the verbosity of the debugging output; 0 means that all kinds of - * output from the parser are suppressed. - * - * @param level The verbosity level for debugging output. - */ - public final void setDebugLevel(int level) { - yydebug = level; - } - - /** - * Print an error message via the lexer. - * - * @param msg The error message. - */ - public final void yyerror(String msg) { - yylexer.yyerror(msg); - } - - - protected final void yycdebug(String s) { - if (yydebug > 0) - yyDebugStream.println(s); - } - - private final class YYStack { - private int[] stateStack = new int[16]; - - private Object[] valueStack = new Object[16]; - - public int size = 16; - public int height = -1; - - public final void push(int state, Object value) { - height++; - if (size == height) { - int[] newStateStack = new int[size * 2]; - System.arraycopy(stateStack, 0, newStateStack, 0, height); - stateStack = newStateStack; - - - Object[] newValueStack = new Object[size * 2]; - System.arraycopy(valueStack, 0, newValueStack, 0, height); - valueStack = newValueStack; - - size *= 2; - } - - stateStack[height] = state; - - valueStack[height] = value; - } - - public final void pop() { - pop(1); - } - - public final void pop(int num) { - // Avoid memory leaks... garbage collection is a white lie! - if (num > 0) { - java.util.Arrays.fill(valueStack, height - num + 1, height + 1, null); - - } - height -= num; - } - - public final int stateAt(int i) { - return stateStack[height - i]; - } - - public final Object valueAt(int i) { - return valueStack[height - i]; - } - - // Print the state stack on the debug stream. - public void print(java.io.PrintStream out) { - out.print("Stack now"); - - for (int i = 0; i <= height; i++) { - out.print(' '); - out.print(stateStack[i]); - } - out.println(); - } - } - - /** - * Returned by a Bison action in order to stop the parsing process and - * return success (true). - */ - public static final int YYACCEPT = 0; - - /** - * Returned by a Bison action in order to stop the parsing process and - * return failure (false). - */ - public static final int YYABORT = 1; - - - /** - * Returned by a Bison action in order to request a new token. - */ - public static final int YYPUSH_MORE = 4; - - /** - * Returned by a Bison action in order to start error recovery without - * printing an error message. - */ - public static final int YYERROR = 2; - - /** - * Internal return codes that are not supported for user semantic - * actions. - */ - private static final int YYERRLAB = 3; - private static final int YYNEWSTATE = 4; - private static final int YYDEFAULT = 5; - private static final int YYREDUCE = 6; - private static final int YYERRLAB1 = 7; - private static final int YYRETURN = 8; - private static final int YYGETTOKEN = 9; /* Signify that a new token is expected when doing push-parsing. */ - - private int yyerrstatus_ = 0; - - - /* Lookahead and lookahead in internal form. */ - int yychar = yyempty_; - int yytoken = 0; - - /* State. */ - int yyn = 0; - int yylen = 0; - int yystate = 0; - YYStack yystack = new YYStack(); - int label = YYNEWSTATE; - - /* Error handling. */ - int yynerrs_ = 0; - - - /* Semantic value of the lookahead. */ - Object yylval = null; - - /** - * Return whether error recovery is being done. In this state, the parser - * reads token until it reaches a known state, and then restarts normal - * operation. - */ - public final boolean recovering() { - return yyerrstatus_ == 0; - } - - /** - * Compute post-reduction state. - * - * @param yystate the current state - * @param yysym the nonterminal to push on the stack - */ - private int yy_lr_goto_state_(int yystate, int yysym) { - int yyr = yypgoto_[yysym - yyntokens_] + yystate; - if (0 <= yyr && yyr <= yylast_ && yycheck_[yyr] == yystate) - return yytable_[yyr]; - else - return yydefgoto_[yysym - yyntokens_]; - } - - private int yyaction(int yyn, YYStack yystack, int yylen) throws DapException { - Object yyval; - - - /* - * If YYLEN is nonzero, implement the default value of the action: - * '$$ = $1'. Otherwise, use the top of the stack. - * - * Otherwise, the following line sets YYVAL to garbage. - * This behavior is undocumented and Bison - * users should not rely upon it. - */ - if (yylen > 0) - yyval = yystack.valueAt(yylen - 1); - else - yyval = yystack.valueAt(0); - - yy_reduce_print(yyn, yystack); - - switch (yyn) { - case 4: - if (yyn == 4) - /* "dap4.y":106 */ /* lalr1.java:489 */ - { - leavedataset(); - } ; - break; - - - case 5: - if (yyn == 5) - /* "dap4.y":112 */ /* lalr1.java:489 */ - { - enterdataset(((XMLAttributeMap) (yystack.valueAt(2 - (2))))); - } ; - break; - - - case 6: - if (yyn == 6) - /* "dap4.y":119 */ /* lalr1.java:489 */ - { - leavegroup(); - } ; - break; - - - case 7: - if (yyn == 7) - /* "dap4.y":125 */ /* lalr1.java:489 */ - { - entergroup(((XMLAttributeMap) (yystack.valueAt(2 - (2))))); - } ; - break; - - - case 14: - if (yyn == 14) - /* "dap4.y":147 */ /* lalr1.java:489 */ - { - leaveenumdef(); - } ; - break; - - - case 15: - if (yyn == 15) - /* "dap4.y":153 */ /* lalr1.java:489 */ - { - enterenumdef(((XMLAttributeMap) (yystack.valueAt(2 - (2))))); - } ; - break; - - - case 18: - if (yyn == 18) - /* "dap4.y":163 */ /* lalr1.java:489 */ - { - enumconst(((SaxEvent) (yystack.valueAt(4 - (2)))), ((SaxEvent) (yystack.valueAt(4 - (3))))); - } ; - break; - - - case 19: - if (yyn == 19) - /* "dap4.y":165 */ /* lalr1.java:489 */ - { - enumconst(((SaxEvent) (yystack.valueAt(4 - (3)))), ((SaxEvent) (yystack.valueAt(4 - (2))))); - } ; - break; - - - case 20: - if (yyn == 20) - /* "dap4.y":172 */ /* lalr1.java:489 */ - { - leavedimdef(); - } ; - break; - - - case 21: - if (yyn == 21) - /* "dap4.y":178 */ /* lalr1.java:489 */ - { - enterdimdef(((XMLAttributeMap) (yystack.valueAt(2 - (2))))); - } ; - break; - - - case 22: - if (yyn == 22) - /* "dap4.y":183 */ /* lalr1.java:489 */ - { - dimref(((SaxEvent) (yystack.valueAt(3 - (2))))); - } ; - break; - - - case 23: - if (yyn == 23) - /* "dap4.y":185 */ /* lalr1.java:489 */ - { - dimref(((SaxEvent) (yystack.valueAt(3 - (2))))); - } ; - break; - - - case 28: - if (yyn == 28) - /* "dap4.y":200 */ /* lalr1.java:489 */ - { - leaveatomicvariable(((SaxEvent) (yystack.valueAt(3 - (3))))); - } ; - break; - - - case 29: - if (yyn == 29) - /* "dap4.y":207 */ /* lalr1.java:489 */ - { - enteratomicvariable(((SaxEvent) (yystack.valueAt(2 - (1)))), ((XMLAttributeMap) (yystack.valueAt(2 - (2))))); - } ; - break; - - - case 30: - if (yyn == 30) - /* "dap4.y":214 */ /* lalr1.java:489 */ - { - leaveenumvariable(((SaxEvent) (yystack.valueAt(3 - (3))))); - } ; - break; - - - case 31: - if (yyn == 31) - /* "dap4.y":221 */ /* lalr1.java:489 */ - { - enterenumvariable(((XMLAttributeMap) (yystack.valueAt(2 - (2))))); - } ; - break; - - - case 32: - if (yyn == 32) - /* "dap4.y":226 */ /* lalr1.java:489 */ - { - yyval = (((SaxEvent) (yystack.valueAt(1 - (1))))); - } ; - break; - - - case 33: - if (yyn == 33) - /* "dap4.y":227 */ /* lalr1.java:489 */ - { - yyval = (((SaxEvent) (yystack.valueAt(1 - (1))))); - } ; - break; - - - case 34: - if (yyn == 34) - /* "dap4.y":228 */ /* lalr1.java:489 */ - { - yyval = (((SaxEvent) (yystack.valueAt(1 - (1))))); - } ; - break; - - - case 35: - if (yyn == 35) - /* "dap4.y":229 */ /* lalr1.java:489 */ - { - yyval = (((SaxEvent) (yystack.valueAt(1 - (1))))); - } ; - break; - - - case 36: - if (yyn == 36) - /* "dap4.y":230 */ /* lalr1.java:489 */ - { - yyval = (((SaxEvent) (yystack.valueAt(1 - (1))))); - } ; - break; - - - case 37: - if (yyn == 37) - /* "dap4.y":231 */ /* lalr1.java:489 */ - { - yyval = (((SaxEvent) (yystack.valueAt(1 - (1))))); - } ; - break; - - - case 38: - if (yyn == 38) - /* "dap4.y":232 */ /* lalr1.java:489 */ - { - yyval = (((SaxEvent) (yystack.valueAt(1 - (1))))); - } ; - break; - - - case 39: - if (yyn == 39) - /* "dap4.y":233 */ /* lalr1.java:489 */ - { - yyval = (((SaxEvent) (yystack.valueAt(1 - (1))))); - } ; - break; - - - case 40: - if (yyn == 40) - /* "dap4.y":234 */ /* lalr1.java:489 */ - { - yyval = (((SaxEvent) (yystack.valueAt(1 - (1))))); - } ; - break; - - - case 41: - if (yyn == 41) - /* "dap4.y":235 */ /* lalr1.java:489 */ - { - yyval = (((SaxEvent) (yystack.valueAt(1 - (1))))); - } ; - break; - - - case 42: - if (yyn == 42) - /* "dap4.y":236 */ /* lalr1.java:489 */ - { - yyval = (((SaxEvent) (yystack.valueAt(1 - (1))))); - } ; - break; - - - case 43: - if (yyn == 43) - /* "dap4.y":237 */ /* lalr1.java:489 */ - { - yyval = (((SaxEvent) (yystack.valueAt(1 - (1))))); - } ; - break; - - - case 44: - if (yyn == 44) - /* "dap4.y":238 */ /* lalr1.java:489 */ - { - yyval = (((SaxEvent) (yystack.valueAt(1 - (1))))); - } ; - break; - - - case 45: - if (yyn == 45) - /* "dap4.y":239 */ /* lalr1.java:489 */ - { - yyval = (((SaxEvent) (yystack.valueAt(1 - (1))))); - } ; - break; - - - case 46: - if (yyn == 46) - /* "dap4.y":240 */ /* lalr1.java:489 */ - { - yyval = (((SaxEvent) (yystack.valueAt(1 - (1))))); - } ; - break; - - - case 47: - if (yyn == 47) - /* "dap4.y":244 */ /* lalr1.java:489 */ - { - yyval = (((SaxEvent) (yystack.valueAt(1 - (1))))); - } ; - break; - - - case 48: - if (yyn == 48) - /* "dap4.y":245 */ /* lalr1.java:489 */ - { - yyval = (((SaxEvent) (yystack.valueAt(1 - (1))))); - } ; - break; - - - case 49: - if (yyn == 49) - /* "dap4.y":246 */ /* lalr1.java:489 */ - { - yyval = (((SaxEvent) (yystack.valueAt(1 - (1))))); - } ; - break; - - - case 50: - if (yyn == 50) - /* "dap4.y":247 */ /* lalr1.java:489 */ - { - yyval = (((SaxEvent) (yystack.valueAt(1 - (1))))); - } ; - break; - - - case 51: - if (yyn == 51) - /* "dap4.y":248 */ /* lalr1.java:489 */ - { - yyval = (((SaxEvent) (yystack.valueAt(1 - (1))))); - } ; - break; - - - case 52: - if (yyn == 52) - /* "dap4.y":249 */ /* lalr1.java:489 */ - { - yyval = (((SaxEvent) (yystack.valueAt(1 - (1))))); - } ; - break; - - - case 53: - if (yyn == 53) - /* "dap4.y":250 */ /* lalr1.java:489 */ - { - yyval = (((SaxEvent) (yystack.valueAt(1 - (1))))); - } ; - break; - - - case 54: - if (yyn == 54) - /* "dap4.y":251 */ /* lalr1.java:489 */ - { - yyval = (((SaxEvent) (yystack.valueAt(1 - (1))))); - } ; - break; - - - case 55: - if (yyn == 55) - /* "dap4.y":252 */ /* lalr1.java:489 */ - { - yyval = (((SaxEvent) (yystack.valueAt(1 - (1))))); - } ; - break; - - - case 56: - if (yyn == 56) - /* "dap4.y":253 */ /* lalr1.java:489 */ - { - yyval = (((SaxEvent) (yystack.valueAt(1 - (1))))); - } ; - break; - - - case 57: - if (yyn == 57) - /* "dap4.y":254 */ /* lalr1.java:489 */ - { - yyval = (((SaxEvent) (yystack.valueAt(1 - (1))))); - } ; - break; - - - case 58: - if (yyn == 58) - /* "dap4.y":255 */ /* lalr1.java:489 */ - { - yyval = (((SaxEvent) (yystack.valueAt(1 - (1))))); - } ; - break; - - - case 59: - if (yyn == 59) - /* "dap4.y":256 */ /* lalr1.java:489 */ - { - yyval = (((SaxEvent) (yystack.valueAt(1 - (1))))); - } ; - break; - - - case 60: - if (yyn == 60) - /* "dap4.y":257 */ /* lalr1.java:489 */ - { - yyval = (((SaxEvent) (yystack.valueAt(1 - (1))))); - } ; - break; - - - case 61: - if (yyn == 61) - /* "dap4.y":258 */ /* lalr1.java:489 */ - { - yyval = (((SaxEvent) (yystack.valueAt(1 - (1))))); - } ; - break; - - - case 62: - if (yyn == 62) - /* "dap4.y":259 */ /* lalr1.java:489 */ - { - yyval = (((SaxEvent) (yystack.valueAt(1 - (1))))); - } ; - break; - - - case 67: - if (yyn == 67) - /* "dap4.y":273 */ /* lalr1.java:489 */ - { - leavemap(); - } ; - break; - - - case 68: - if (yyn == 68) - /* "dap4.y":279 */ /* lalr1.java:489 */ - { - entermap(((SaxEvent) (yystack.valueAt(2 - (2))))); - } ; - break; - - - case 69: - if (yyn == 69) - /* "dap4.y":286 */ /* lalr1.java:489 */ - { - leavestructurevariable(((SaxEvent) (yystack.valueAt(3 - (3))))); - } ; - break; - - - case 70: - if (yyn == 70) - /* "dap4.y":292 */ /* lalr1.java:489 */ - { - enterstructurevariable(((XMLAttributeMap) (yystack.valueAt(2 - (2))))); - } ; - break; - - - case 76: - if (yyn == 76) - /* "dap4.y":307 */ /* lalr1.java:489 */ - { - leavesequencevariable(((SaxEvent) (yystack.valueAt(3 - (3))))); - } ; - break; - - - case 77: - if (yyn == 77) - /* "dap4.y":313 */ /* lalr1.java:489 */ - { - entersequencevariable(((XMLAttributeMap) (yystack.valueAt(2 - (2))))); - } ; - break; - - - case 89: - if (yyn == 89) - /* "dap4.y":345 */ /* lalr1.java:489 */ - { - leaveatomicattribute(); - } ; - break; - - - case 90: - if (yyn == 90) - /* "dap4.y":349 */ /* lalr1.java:489 */ - { - leaveatomicattribute(); - } ; - break; - - - case 91: - if (yyn == 91) - /* "dap4.y":356 */ /* lalr1.java:489 */ - { - enteratomicattribute(((XMLAttributeMap) (yystack.valueAt(3 - (2)))), - ((NamespaceList) (yystack.valueAt(3 - (3))))); - } ; - break; - - - case 92: - if (yyn == 92) - /* "dap4.y":361 */ /* lalr1.java:489 */ - { - yyval = namespace_list(); - } ; - break; - - - case 93: - if (yyn == 93) - /* "dap4.y":363 */ /* lalr1.java:489 */ - { - yyval = namespace_list(((NamespaceList) (yystack.valueAt(2 - (1)))), ((SaxEvent) (yystack.valueAt(2 - (2))))); - } ; - break; - - - case 94: - if (yyn == 94) - /* "dap4.y":370 */ /* lalr1.java:489 */ - { - yyval = (((SaxEvent) (yystack.valueAt(3 - (2))))); - } ; - break; - - - case 95: - if (yyn == 95) - /* "dap4.y":377 */ /* lalr1.java:489 */ - { - leavecontainerattribute(); - } ; - break; - - - case 96: - if (yyn == 96) - /* "dap4.y":384 */ /* lalr1.java:489 */ - { - entercontainerattribute(((XMLAttributeMap) (yystack.valueAt(3 - (2)))), - ((NamespaceList) (yystack.valueAt(3 - (3))))); - } ; - break; - - - case 101: - if (yyn == 101) - /* "dap4.y":401 */ /* lalr1.java:489 */ - { - value(((String) (yystack.valueAt(3 - (2))))); - } ; - break; - - - case 102: - if (yyn == 102) - /* "dap4.y":403 */ /* lalr1.java:489 */ - { - value(((SaxEvent) (yystack.valueAt(3 - (2))))); - } ; - break; - - - case 103: - if (yyn == 103) - /* "dap4.y":411 */ /* lalr1.java:489 */ - { - otherxml(((XMLAttributeMap) (yystack.valueAt(4 - (2)))), ((DapXML) (yystack.valueAt(4 - (3))))); - } ; - break; - - - case 104: - if (yyn == 104) - /* "dap4.y":415 */ /* lalr1.java:489 */ - { - yyval = xml_body(null, ((DapXML) (yystack.valueAt(1 - (1))))); - } ; - break; - - - case 105: - if (yyn == 105) - /* "dap4.y":416 */ /* lalr1.java:489 */ - { - yyval = xml_body(((DapXML.XMLList) (yystack.valueAt(2 - (1)))), ((DapXML) (yystack.valueAt(2 - (2))))); - } ; - break; - - - case 106: - if (yyn == 106) - /* "dap4.y":424 */ /* lalr1.java:489 */ - { - yyval = - element_or_text(((SaxEvent) (yystack.valueAt(4 - (1)))), ((XMLAttributeMap) (yystack.valueAt(4 - (2)))), - ((DapXML.XMLList) (yystack.valueAt(4 - (3)))), ((SaxEvent) (yystack.valueAt(4 - (4))))); - } ; - break; - - - case 107: - if (yyn == 107) - /* "dap4.y":426 */ /* lalr1.java:489 */ - { - yyval = xmltext(((SaxEvent) (yystack.valueAt(1 - (1))))); - } ; - break; - - - case 108: - if (yyn == 108) - /* "dap4.y":434 */ /* lalr1.java:489 */ - { - yyval = xml_attribute_map(); - } ; - break; - - - case 109: - if (yyn == 109) - /* "dap4.y":436 */ /* lalr1.java:489 */ - { - yyval = xml_attribute_map(((XMLAttributeMap) (yystack.valueAt(2 - (1)))), - ((SaxEvent) (yystack.valueAt(2 - (2))))); - } ; - break; - - - case 184: - if (yyn == 184) - /* "dap4.y":530 */ /* lalr1.java:489 */ - { - leaveerror(); - } ; - break; - - - case 185: - if (yyn == 185) - /* "dap4.y":537 */ /* lalr1.java:489 */ - { - entererror(((XMLAttributeMap) (yystack.valueAt(2 - (2))))); - } ; - break; - - - case 188: - if (yyn == 188) - /* "dap4.y":547 */ /* lalr1.java:489 */ - { - errormessage(((String) (yystack.valueAt(3 - (2))))); - } ; - break; - - - case 189: - if (yyn == 189) - /* "dap4.y":549 */ /* lalr1.java:489 */ - { - errorcontext(((String) (yystack.valueAt(3 - (2))))); - } ; - break; - - - case 190: - if (yyn == 190) - /* "dap4.y":551 */ /* lalr1.java:489 */ - { - errorotherinfo(((String) (yystack.valueAt(3 - (2))))); - } ; - break; - - - case 191: - if (yyn == 191) - /* "dap4.y":556 */ /* lalr1.java:489 */ - { - yyval = textstring(null, ((SaxEvent) (yystack.valueAt(1 - (1))))); - } ; - break; - - - case 192: - if (yyn == 192) - /* "dap4.y":558 */ /* lalr1.java:489 */ - { - yyval = textstring(((String) (yystack.valueAt(2 - (1)))), ((SaxEvent) (yystack.valueAt(2 - (2))))); - } ; - break; - - - - /* "Dap4BisonParser.java":1087 */ /* lalr1.java:489 */ - default: - break; - } - - yy_symbol_print("-> $$ =", yyr1_[yyn], yyval); - - yystack.pop(yylen); - yylen = 0; - - /* Shift the result of the reduction. */ - int yystate = yy_lr_goto_state_(yystack.stateAt(0), yyr1_[yyn]); - yystack.push(yystate, yyval); - return YYNEWSTATE; - } - - - /* - * Return YYSTR after stripping away unnecessary quotes and - * backslashes, so that it's suitable for yyerror. The heuristic is - * that double-quoting is unnecessary unless the string contains an - * apostrophe, a comma, or backslash (other than backslash-backslash). - * YYSTR is taken from yytname. - */ - private final String yytnamerr_(String yystr) { - if (yystr.charAt(0) == '"') { - StringBuffer yyr = new StringBuffer(); - strip_quotes: for (int i = 1; i < yystr.length(); i++) - switch (yystr.charAt(i)) { - case '\'': - case ',': - break strip_quotes; - - case '\\': - if (yystr.charAt(++i) != '\\') - break strip_quotes; - /* Fall through. */ - default: - yyr.append(yystr.charAt(i)); - break; - - case '"': - return yyr.toString(); - } - } else if (yystr.equals("$end")) - return "end of input"; - - return yystr; - } - - - /*--------------------------------. - | Print this symbol on YYOUTPUT. | - `--------------------------------*/ - - private void yy_symbol_print(String s, int yytype, Object yyvaluep) { - if (yydebug > 0) - yycdebug(s + (yytype < yyntokens_ ? " token " : " nterm ") + yytname_[yytype] + " (" - + (yyvaluep == null ? "(null)" : yyvaluep.toString()) + ")"); - } - - - - /** - * Push Parse input from external lexer - * - * @param yylextoken current token - * @param yylexval current lval - * - * - * @return YYACCEPT, YYABORT, YYPUSH_MORE - */ - public int push_parse(int yylextoken, Object yylexval) throws DapException, DapException { - - - - if (!this.push_parse_initialized) { - push_parse_initialize(); - - yycdebug("Starting parse\n"); - yyerrstatus_ = 0; - } else - label = YYGETTOKEN; - - boolean push_token_consumed = true; - - for (;;) - switch (label) { - /* - * New state. Unlike in the C/C++ skeletons, the state is already - * pushed when we come here. - */ - case YYNEWSTATE: - yycdebug("Entering state " + yystate + "\n"); - if (yydebug > 0) - yystack.print(yyDebugStream); - - /* Accept? */ - if (yystate == yyfinal_) { - label = YYACCEPT; - break; - } - - /* Take a decision. First try without lookahead. */ - yyn = yypact_[yystate]; - if (yy_pact_value_is_default_(yyn)) { - label = YYDEFAULT; - break; - } - /* Fall Through */ - - case YYGETTOKEN: - /* Read a lookahead token. */ - if (yychar == yyempty_) { - - if (!push_token_consumed) - return YYPUSH_MORE; - yycdebug("Reading a token: "); - yychar = yylextoken; - yylval = yylexval; - push_token_consumed = false; - - } - - /* Convert token to internal form. */ - if (yychar <= Lexer.EOF) { - yychar = yytoken = Lexer.EOF; - yycdebug("Now at end of input.\n"); - } else { - yytoken = yytranslate_(yychar); - yy_symbol_print("Next token is", yytoken, yylval); - } - - /* - * If the proper action on seeing token YYTOKEN is to reduce or to - * detect an error, take that action. - */ - yyn += yytoken; - if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yytoken) - label = YYDEFAULT; - - /* <= 0 means reduce or error. */ - else if ((yyn = yytable_[yyn]) <= 0) { - if (yy_table_value_is_error_(yyn)) - label = YYERRLAB; - else { - yyn = -yyn; - label = YYREDUCE; - } - } - - else { - /* Shift the lookahead token. */ - yy_symbol_print("Shifting", yytoken, yylval); - - /* Discard the token being shifted. */ - yychar = yyempty_; - - /* - * Count tokens shifted since error; after three, turn off error - * status. - */ - if (yyerrstatus_ > 0) - --yyerrstatus_; - - yystate = yyn; - yystack.push(yystate, yylval); - label = YYNEWSTATE; - } - break; - - /*-----------------------------------------------------------. - | yydefault -- do the default action for the current state. | - `-----------------------------------------------------------*/ - case YYDEFAULT: - yyn = yydefact_[yystate]; - if (yyn == 0) - label = YYERRLAB; - else - label = YYREDUCE; - break; - - /*-----------------------------. - | yyreduce -- Do a reduction. | - `-----------------------------*/ - case YYREDUCE: - yylen = yyr2_[yyn]; - label = yyaction(yyn, yystack, yylen); - yystate = yystack.stateAt(0); - break; - - /*------------------------------------. - | yyerrlab -- here on detecting error | - `------------------------------------*/ - case YYERRLAB: - /* If not already recovering from an error, report this error. */ - if (yyerrstatus_ == 0) { - ++yynerrs_; - if (yychar == yyempty_) - yytoken = yyempty_; - yyerror(yysyntax_error(yystate, yytoken)); - } - - - if (yyerrstatus_ == 3) { - /* - * If just tried and failed to reuse lookahead token after an - * error, discard it. - */ - - if (yychar <= Lexer.EOF) { - /* Return failure if at end of input. */ - if (yychar == Lexer.EOF) { - label = YYABORT; - break; - } - } else - yychar = yyempty_; - } - - /* - * Else will try to reuse lookahead token after shifting the error - * token. - */ - label = YYERRLAB1; - break; - - /*-------------------------------------------------. - | errorlab -- error raised explicitly by YYERROR. | - `-------------------------------------------------*/ - case YYERROR: - - - /* - * Do not reclaim the symbols of the rule which action triggered - * this YYERROR. - */ - yystack.pop(yylen); - yylen = 0; - yystate = yystack.stateAt(0); - label = YYERRLAB1; - break; - - /*-------------------------------------------------------------. - | yyerrlab1 -- common code for both syntax error and YYERROR. | - `-------------------------------------------------------------*/ - case YYERRLAB1: - yyerrstatus_ = 3; /* Each real token shifted decrements this. */ - - for (;;) { - yyn = yypact_[yystate]; - if (!yy_pact_value_is_default_(yyn)) { - yyn += yyterror_; - if (0 <= yyn && yyn <= yylast_ && yycheck_[yyn] == yyterror_) { - yyn = yytable_[yyn]; - if (0 < yyn) - break; - } - } - - /* - * Pop the current state because it cannot handle the - * error token. - */ - if (yystack.height == 0) { - label = YYABORT; - break; - } - - - yystack.pop(); - yystate = yystack.stateAt(0); - if (yydebug > 0) - yystack.print(yyDebugStream); - } - - if (label == YYABORT) - /* Leave the switch. */ - break; - - - - /* Shift the error token. */ - yy_symbol_print("Shifting", yystos_[yyn], yylval); - - yystate = yyn; - yystack.push(yyn, yylval); - label = YYNEWSTATE; - break; - - /* Accept. */ - case YYACCEPT: - this.push_parse_initialized = false; - return YYACCEPT; - - /* Abort. */ - case YYABORT: - this.push_parse_initialized = false; - return YYABORT; - } - } - - boolean push_parse_initialized = false; - - /** - * (Re-)Initialize the state of the push parser. - */ - public void push_parse_initialize() { - /* Lookahead and lookahead in internal form. */ - this.yychar = yyempty_; - this.yytoken = 0; - - /* State. */ - this.yyn = 0; - this.yylen = 0; - this.yystate = 0; - this.yystack = new YYStack(); - this.label = YYNEWSTATE; - - /* Error handling. */ - this.yynerrs_ = 0; - - - /* Semantic value of the lookahead. */ - this.yylval = null; - - yystack.push(this.yystate, this.yylval); - - this.push_parse_initialized = true; - - } - - - - // Generate an error message. - private String yysyntax_error(int yystate, int tok) { - if (yyErrorVerbose) { - /* - * There are many possibilities here to consider: - * - If this state is a consistent state with a default action, - * then the only way this function was invoked is if the - * default action is an error action. In that case, don't - * check for expected tokens because there are none. - * - The only way there can be no lookahead present (in tok) is - * if this state is a consistent state with a default action. - * Thus, detecting the absence of a lookahead is sufficient to - * determine that there is no unexpected or expected token to - * report. In that case, just report a simple "syntax error". - * - Don't assume there isn't a lookahead just because this - * state is a consistent state with a default action. There - * might have been a previous inconsistent state, consistent - * state with a non-default action, or user semantic action - * that manipulated yychar. (However, yychar is currently out - * of scope during semantic actions.) - * - Of course, the expected token list depends on states to - * have correct lookahead information, and it depends on the - * parser not to perform extra reductions after fetching a - * lookahead from the scanner and before detecting a syntax - * error. Thus, state merging (from LALR or IELR) and default - * reductions corrupt the expected token list. However, the - * list is correct for canonical LR with one exception: it - * will still contain any token that will not be accepted due - * to an error action in a later state. - */ - if (tok != yyempty_) { - /* - * FIXME: This method of building the message is not compatible - * with internationalization. - */ - StringBuffer res = new StringBuffer("syntax error, unexpected "); - res.append(yytnamerr_(yytname_[tok])); - int yyn = yypact_[yystate]; - if (!yy_pact_value_is_default_(yyn)) { - /* - * Start YYX at -YYN if negative to avoid negative - * indexes in YYCHECK. In other words, skip the first - * -YYN actions for this state because they are default - * actions. - */ - int yyxbegin = yyn < 0 ? -yyn : 0; - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = yylast_ - yyn + 1; - int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_; - int count = 0; - for (int x = yyxbegin; x < yyxend; ++x) - if (yycheck_[x + yyn] == x && x != yyterror_ && !yy_table_value_is_error_(yytable_[x + yyn])) - ++count; - if (count < 5) { - count = 0; - for (int x = yyxbegin; x < yyxend; ++x) - if (yycheck_[x + yyn] == x && x != yyterror_ && !yy_table_value_is_error_(yytable_[x + yyn])) { - res.append(count++ == 0 ? ", expecting " : " or "); - res.append(yytnamerr_(yytname_[x])); - } - } - } - return res.toString(); - } - } - - return "syntax error"; - } - - /** - * Whether the given yypact_ value indicates a defaulted state. - * - * @param yyvalue the value to check - */ - private static boolean yy_pact_value_is_default_(int yyvalue) { - return yyvalue == yypact_ninf_; - } - - /** - * Whether the given yytable_ - * value indicates a syntax error. - * - * @param yyvalue the value to check - */ - private static boolean yy_table_value_is_error_(int yyvalue) { - return yyvalue == yytable_ninf_; - } - - private static final short yypact_ninf_ = -186; - private static final short yytable_ninf_ = -97; - - /* - * YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - * STATE-NUM. - */ - private static final short yypact_[] = yypact_init(); - - private static final short[] yypact_init() { - return new short[] {5, -186, -186, 12, -186, -186, -186, -186, 315, 315, -186, 36, 41, -186, -186, -186, -186, -186, - -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, - -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, - -186, 29, -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, 14, -186, - -10, -186, -186, -38, -38, -38, -186, 315, 315, 315, 315, 315, 315, 315, 43, 204, -62, 129, -186, -5, 255, 217, - 315, 271, 316, -36, -186, 104, -186, -186, 107, -186, -14, -32, -12, 197, -186, -186, -186, -186, -186, -186, - -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, - -186, -186, -186, -186, -186, -186, -186, 25, -186, -186, 0, 30, -186, -186, -186, -186, 55, -186, 32, -186, - -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, - -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, 83, -16, -186, -186, -186, -186, -186, - -186, -186, -186, 50, -186, -186, 43, 121, 164, 159, 190, -186, -4, -186, -186, 195, 137, -186, -186, -186, - -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, - -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, -186, -186}; - } - - /* - * YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. - * Performed when YYTABLE does not specify something else to do. Zero - * means the default is an error. - */ - private static final short yydefact_[] = yydefact_init(); - - private static final short[] yydefact_init() { - return new short[] {0, 108, 108, 0, 2, 8, 3, 186, 5, 185, 1, 0, 0, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 109, 4, 108, 108, 108, 108, 108, 108, 108, 108, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 13, 8, 10, 0, 9, 83, 11, 24, 63, 25, 63, 108, 26, 71, 27, 78, 12, 85, 86, 0, 87, 0, 88, 184, 0, - 0, 0, 187, 7, 15, 21, 31, 70, 77, 92, 0, 0, 0, 0, 16, 0, 0, 0, 29, 0, 0, 0, 90, 0, 99, 97, 0, 191, 0, 0, 0, 91, - 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151, 152, 107, 153, 0, 108, 6, 0, 0, 14, 17, 20, 84, 0, 62, 0, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 64, 28, 65, 83, 66, 30, 69, 72, 73, 74, 75, 76, 79, 80, 81, 82, 0, 0, 89, - 100, 95, 98, 188, 192, 189, 190, 0, 93, 103, 0, 0, 0, 0, 0, 68, 0, 102, 101, 0, 0, 104, 18, 19, 22, 23, 67, 94, - 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, - 176, 177, 178, 179, 180, 181, 182, 183, 105, 106}; - } - - /* YYPGOTO[NTERM-NUM]. */ - private static final short yypgoto_[] = yypgoto_init(); - - private static final short[] yypgoto_init() { - return new short[] {-186, -186, -186, -186, -186, -186, 160, -186, -186, -186, 122, -186, -186, 72, 74, -186, -186, - -186, -186, -186, -186, 152, 76, -186, -186, -186, -186, -186, -186, -186, 45, -91, -66, -186, -186, -186, -186, - -186, -186, -186, -186, 116, -186, -186, -185, -2, -186, -186, -186, -186, -186, -186, -186, -63}; - } - - /* YYDEFGOTO[NTERM-NUM]. */ - private static final short yydefgoto_[] = yydefgoto_init(); - - private static final short[] yydefgoto_init() { - return new short[] {-1, 3, 4, 5, 52, 53, 11, 54, 55, 90, 91, 56, 57, 167, 58, 59, 60, 61, 62, 63, 168, 93, 169, 170, - 64, 65, 96, 66, 67, 97, 92, 68, 69, 70, 71, 108, 194, 72, 73, 103, 100, 101, 74, 206, 140, 8, 27, 141, 245, 6, - 7, 12, 79, 105}; - } - - /* - * YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If - * positive, shift that token. If negative, reduce the rule whose - * number is the opposite. If YYTABLE_NINF, syntax error. - */ - private static final short yytable_[] = yytable_init(); - - private static final short[] yytable_init() { - return new short[] {9, 148, 171, 171, 191, 177, 182, 102, 1, 147, 204, 207, 10, 143, 106, 107, 212, 35, 144, 36, - 189, 244, 35, 35, 36, 36, 192, 80, 81, 82, 83, 84, 85, 86, 87, 184, 2, 188, 89, 98, 28, 29, 99, 30, 183, 104, - 109, 104, 110, 31, 111, 190, 112, 32, 113, 195, 114, 33, 115, 34, 116, 95, 117, 35, 118, 36, 119, 190, 120, 190, - 121, 190, 122, 75, 76, 37, 77, 38, 78, 39, 197, 40, 123, 41, 124, 42, 125, 43, 126, 44, 127, 45, 128, 46, 129, - 47, 130, 48, 131, 49, 132, 50, 133, 51, 134, 198, 135, 201, 136, 203, 137, 148, 13, 14, 15, 16, 17, 18, 19, 20, - 21, 22, 23, 24, 205, 25, 138, 26, 139, 98, 199, 208, 185, 200, 35, 187, 36, 145, 89, 196, 109, 214, 110, 215, - 111, 216, 112, 217, 113, 218, 114, 219, 115, 220, 116, 221, 117, 222, 118, 223, 119, 224, 120, 225, 121, 226, - 122, 227, 174, 179, 175, 180, 176, 181, 209, 210, 123, 228, 124, 229, 125, 230, 126, 231, 127, 232, 128, 233, - 129, 234, 130, 235, 131, 236, 132, 237, 133, 238, 134, 239, 135, 240, 136, 241, 137, 242, 211, 213, 193, 29, - 142, 30, 146, 88, 94, 202, 186, 31, 0, 0, 138, 32, 139, 243, -96, 33, -96, 34, 0, 0, 0, 35, 149, 36, 0, 172, - 151, 0, 0, 0, 0, 0, 0, 37, 35, 38, 36, 39, 0, 40, 0, 41, 0, 42, 0, 43, 0, 44, 0, 45, 0, 46, 0, 47, 0, 48, 0, 49, - 0, 50, 149, 51, 0, 150, 151, 0, 0, 0, 0, 0, 0, 0, 35, 0, 36, 0, 149, 0, 32, 0, 151, 0, 33, 173, 34, 152, 0, 153, - 35, 154, 36, 155, 0, 156, 0, 157, 0, 158, 0, 159, 37, 160, 38, 161, 39, 162, 40, 163, 41, 164, 42, 165, 43, 166, - 44, 0, 45, 0, 46, 0, 47, 149, 48, 32, 49, 151, 50, 33, 51, 34, 178, 0, 0, 35, 0, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 37, 0, 38, 0, 39, 0, 40, 0, 41, 0, 42, 0, 43, 0, 44, 0, 45, 0, 46, 0, 47, 0, 48, 0, 49, 0, 50, 0, 51, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 0, 25, 0, 26}; - } - - private static final short yycheck_[] = yycheck_init(); - - private static final short[] yycheck_init() { - return new short[] {2, 92, 93, 94, 36, 96, 97, 73, 3, 14, 26, 196, 0, 75, 77, 78, 20, 27, 80, 29, 34, 206, 27, 27, - 29, 29, 38, 29, 30, 31, 32, 33, 34, 35, 36, 98, 31, 103, 9, 25, 4, 5, 28, 7, 80, 83, 3, 83, 5, 13, 7, 83, 9, 17, - 11, 30, 13, 21, 15, 23, 17, 63, 19, 27, 21, 29, 23, 83, 25, 83, 27, 83, 29, 32, 33, 39, 35, 41, 37, 43, 80, 45, - 39, 47, 41, 49, 43, 51, 45, 53, 47, 55, 49, 57, 51, 59, 53, 61, 55, 63, 57, 65, 59, 67, 61, 75, 63, 75, 65, 26, - 67, 202, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 74, 82, 83, 84, 85, 25, 75, 10, 28, 78, 27, 28, 29, 8, - 9, 141, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 96, 97, 96, 97, 96, 97, 10, 16, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 16, 12, 11, 5, 6, 7, 90, 53, 62, 170, 100, 13, -1, -1, 83, 17, 85, 86, - 27, 21, 29, 23, -1, -1, -1, 27, 15, 29, -1, 18, 19, -1, -1, -1, -1, -1, -1, 39, 27, 41, 29, 43, -1, 45, -1, 47, - -1, 49, -1, 51, -1, 53, -1, 55, -1, 57, -1, 59, -1, 61, -1, 63, -1, 65, 15, 67, -1, 18, 19, -1, -1, -1, -1, -1, - -1, -1, 27, -1, 29, -1, 15, -1, 17, -1, 19, -1, 21, 22, 23, 40, -1, 42, 27, 44, 29, 46, -1, 48, -1, 50, -1, 52, - -1, 54, 39, 56, 41, 58, 43, 60, 45, 62, 47, 64, 49, 66, 51, 68, 53, -1, 55, -1, 57, -1, 59, 15, 61, 17, 63, 19, - 65, 21, 67, 23, 24, -1, -1, 27, -1, 29, -1, -1, -1, -1, -1, -1, -1, -1, -1, 39, -1, 41, -1, 43, -1, 45, -1, 47, - -1, 49, -1, 51, -1, 53, -1, 55, -1, 57, -1, 59, -1, 61, -1, 63, -1, 65, -1, 67, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, -1, 82, -1, 84}; - } - - /* - * YYSTOS[STATE-NUM] -- The (internal number of the) accessing - * symbol of state STATE-NUM. - */ - private static final short yystos_[] = yystos_init(); - - private static final short[] yystos_init() { - return new short[] {0, 3, 31, 88, 89, 90, 136, 137, 132, 132, 0, 93, 138, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, - 79, 80, 82, 84, 133, 4, 5, 7, 13, 17, 21, 23, 27, 29, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63, 65, - 67, 91, 92, 94, 95, 98, 99, 101, 102, 103, 104, 105, 106, 111, 112, 114, 115, 118, 119, 120, 121, 124, 125, 129, - 32, 33, 35, 37, 139, 132, 132, 132, 132, 132, 132, 132, 132, 93, 9, 96, 97, 117, 108, 108, 132, 113, 116, 25, - 28, 127, 128, 119, 126, 83, 140, 140, 140, 122, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 39, 41, 43, - 45, 47, 49, 51, 53, 55, 57, 59, 61, 63, 65, 67, 83, 85, 131, 134, 6, 75, 80, 8, 97, 14, 118, 15, 18, 19, 40, 42, - 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 100, 107, 109, 110, 118, 18, 22, 100, 101, 109, 118, 24, - 100, 101, 109, 118, 80, 140, 28, 128, 28, 119, 34, 83, 36, 38, 11, 123, 30, 132, 80, 75, 75, 78, 75, 117, 26, - 26, 74, 130, 131, 10, 10, 16, 16, 20, 12, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 40, 42, 44, 46, - 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 86, 131, 135}; - } - - /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ - private static final short yyr1_[] = yyr1_init(); - - private static final short[] yyr1_init() { - return new short[] {0, 87, 88, 88, 89, 90, 91, 92, 93, 93, 93, 93, 93, 93, 94, 95, 96, 96, 97, 97, 98, 99, 100, 100, - 101, 101, 101, 101, 102, 103, 104, 105, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, - 106, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 108, 108, 108, 108, 109, - 110, 111, 112, 113, 113, 113, 113, 113, 114, 115, 116, 116, 116, 116, 116, 117, 117, 118, 119, 119, 119, 120, - 120, 121, 122, 122, 123, 124, 125, 126, 126, 127, 127, 128, 128, 129, 130, 130, 131, 131, 132, 132, 133, 133, - 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, - 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 135, 135, - 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, - 135, 135, 135, 135, 135, 135, 136, 137, 138, 138, 139, 139, 139, 140, 140}; - } - - /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ - private static final byte yyr2_[] = yyr2_init(); - - private static final byte[] yyr2_init() { - return new byte[] {0, 2, 1, 1, 3, 2, 3, 2, 0, 2, 2, 2, 2, 2, 3, 2, 1, 2, 4, 4, 3, 2, 3, 3, 1, 1, 1, 1, 3, 2, 3, 2, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 2, 2, 2, 3, 2, - 3, 2, 0, 2, 2, 2, 2, 3, 2, 0, 2, 2, 2, 2, 0, 2, 1, 1, 1, 1, 3, 2, 3, 0, 2, 3, 3, 3, 1, 2, 1, 2, 3, 3, 4, 1, 2, - 4, 1, 0, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 3, 2, 0, 2, 3, 3, 3, 1, 2}; - } - - /* - * YYTOKEN_NUMBER[YYLEX-NUM] -- Internal symbol number corresponding - * to YYLEX-NUM. - */ - private static final short yytoken_number_[] = yytoken_number_init(); - - private static final short[] yytoken_number_init() { - return new short[] {0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, - 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, - 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, - 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, - 340, 341}; - } - - /* - * YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - * First, the terminals, then, starting at \a yyntokens_, nonterminals. - */ - private static final String yytname_[] = yytname_init(); - - private static final String[] yytname_init() { - return new String[] {"$end", "error", "$undefined", "DATASET_", "_DATASET", "GROUP_", "_GROUP", "ENUMERATION_", - "_ENUMERATION", "ENUMCONST_", "_ENUMCONST", "NAMESPACE_", "_NAMESPACE", "DIMENSION_", "_DIMENSION", "DIM_", - "_DIM", "ENUM_", "_ENUM", "MAP_", "_MAP", "STRUCTURE_", "_STRUCTURE", "SEQUENCE_", "_SEQUENCE", "VALUE_", - "_VALUE", "ATTRIBUTE_", "_ATTRIBUTE", "OTHERXML_", "_OTHERXML", "ERROR_", "_ERROR", "MESSAGE_", "_MESSAGE", - "CONTEXT_", "_CONTEXT", "OTHERINFO_", "_OTHERINFO", "CHAR_", "_CHAR", "BYTE_", "_BYTE", "INT8_", "_INT8", - "UINT8_", "_UINT8", "INT16_", "_INT16", "UINT16_", "_UINT16", "INT32_", "_INT32", "UINT32_", "_UINT32", - "INT64_", "_INT64", "UINT64_", "_UINT64", "FLOAT32_", "_FLOAT32", "FLOAT64_", "_FLOAT64", "STRING_", "_STRING", - "URL_", "_URL", "OPAQUE_", "_OPAQUE", "ATTR_BASE", "ATTR_BASETYPE", "ATTR_DAPVERSION", "ATTR_DMRVERSION", - "ATTR_ENUM", "ATTR_HREF", "ATTR_NAME", "ATTR_NAMESPACE", "ATTR_NS", "ATTR_SIZE", "ATTR_TYPE", "ATTR_VALUE", - "ATTR_HTTPCODE", "ATTR_SPECIAL", "TEXT", "UNKNOWN_ATTR", "UNKNOWN_ELEMENT_", "_UNKNOWN_ELEMENT", "$accept", - "response", "dataset", "datasetprefix", "group", "groupprefix", "groupbody", "enumdef", "enumdefprefix", - "enumconst_list", "enumconst", "dimdef", "dimdefprefix", "dimref", "variable", "atomicvariable", - "atomicvariableprefix", "enumvariable", "enumvariableprefix", "atomictype_", "_atomictype", "varbody", "mapref", - "maprefprefix", "structurevariable", "structurevariableprefix", "structbody", "sequencevariable", - "sequencevariableprefix", "sequencebody", "metadatalist", "metadata", "attribute", "atomicattribute", - "atomicattributeprefix", "namespace_list", "namespace", "containerattribute", "containerattributeprefix", - "attributelist", "valuelist", "value", "otherxml", "xml_body", "element_or_text", "xml_attribute_map", - "xml_attribute", "xml_open", "xml_close", "error_response", "error_responseprefix", "error_body", - "error_element", "textstring", null}; - } - - /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ - private static final short yyrline_[] = yyrline_init(); - - private static final short[] yyrline_init() { - return new short[] {0, 98, 98, 99, 103, 110, 116, 123, 134, 136, 137, 138, 139, 140, 144, 151, 157, 158, 162, 164, - 169, 176, 182, 184, 189, 190, 191, 192, 197, 205, 211, 219, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, - 236, 237, 238, 239, 240, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 262, - 264, 265, 266, 270, 277, 283, 290, 295, 297, 298, 299, 300, 304, 311, 316, 318, 319, 320, 321, 324, 326, 330, - 334, 335, 336, 342, 347, 353, 361, 362, 367, 374, 381, 389, 390, 395, 396, 400, 402, 407, 415, 416, 420, 425, - 434, 435, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 461, 462, 463, 464, 465, 466, - 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, - 489, 490, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, - 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 527, 534, 540, 542, 546, 548, 550, 555, 557}; - } - - - // Report on the debug stream that the rule yyrule is going to be reduced. - private void yy_reduce_print(int yyrule, YYStack yystack) { - if (yydebug == 0) - return; - - int yylno = yyrline_[yyrule]; - int yynrhs = yyr2_[yyrule]; - /* Print the symbols being reduced, and their result. */ - yycdebug("Reducing stack by rule " + (yyrule - 1) + " (line " + yylno + "), "); - - /* The symbols being reduced. */ - for (int yyi = 0; yyi < yynrhs; yyi++) - yy_symbol_print(" $" + (yyi + 1) + " =", yystos_[yystack.stateAt(yynrhs - (yyi + 1))], - ((yystack.valueAt(yynrhs - (yyi + 1))))); - } - - /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ - private static final byte yytranslate_table_[] = yytranslate_table_init(); - - private static final byte[] yytranslate_table_init() { - return new byte[] {0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86}; - } - - private static final byte yytranslate_(int t) { - if (t >= 0 && t <= yyuser_token_number_max_) - return yytranslate_table_[t]; - else - return yyundef_token_; - } - - private static final int yylast_ = 399; - private static final int yynnts_ = 54; - private static final int yyempty_ = -2; - private static final int yyfinal_ = 10; - private static final int yyterror_ = 1; - private static final int yyerrcode_ = 256; - private static final int yyntokens_ = 87; - - private static final int yyuser_token_number_max_ = 341; - private static final int yyundef_token_ = 2; - - /* User implementation code. */ - -} - diff --git a/dap4/d4core/src/main/java/dap4/core/dmr/parser/bison/Dap4EventHandler.java b/dap4/d4core/src/main/java/dap4/core/dmr/parser/bison/Dap4EventHandler.java deleted file mode 100644 index cc1416b024..0000000000 --- a/dap4/d4core/src/main/java/dap4/core/dmr/parser/bison/Dap4EventHandler.java +++ /dev/null @@ -1,196 +0,0 @@ -/* - * Copyright 2012, UCAR/Unidata. - * See the LICENSE file for more information. - */ - -package dap4.core.dmr.parser.bison; - -import org.xml.sax.Locator; -import org.xml.sax.SAXException; -import java.util.HashMap; -import java.util.Map; -import static dap4.core.dmr.parser.bison.Dap4BisonParser.Lexer.*; -import static dap4.core.dmr.parser.bison.Dap4BisonParser.YYABORT; -import static dap4.core.dmr.parser.bison.Dap4BisonParser.YYACCEPT; - -public class Dap4EventHandler extends SaxEventHandler { - ////////////////////////////////////////////////// - // Constants - - public static String SPECIALATTRPREFIX = "_"; - - ////////////////////////////////////////////////// - // static types - - ////////////////////////////////////////////////// - // static fields - - static Map elementmap; - static Map attributemap; - - static { - elementmap = new HashMap(); - attributemap = new HashMap(); - - elementmap.put("Dataset", - new Lexeme("Dataset", DATASET_, _DATASET, new String[] {"name", "dapVersion", "dmrVersion"})); // legal - // attributes - // (lower case) - elementmap.put("Group", new Lexeme("Group", GROUP_, _GROUP, new String[] {"name"})); - elementmap.put("Enumeration", - new Lexeme("Enumeration", ENUMERATION_, _ENUMERATION, new String[] {"name", "basetype"})); - elementmap.put("EnumConst", new Lexeme("EnumConst", ENUMCONST_, _ENUMCONST, new String[] {"name", "value"})); - elementmap.put("Namespace", new Lexeme("Namespace", NAMESPACE_, _NAMESPACE, new String[] {"href"})); - elementmap.put("Dimension", new Lexeme("Dimension", DIMENSION_, _DIMENSION, new String[] {"name", "size"})); - elementmap.put("Dim", new Lexeme("Dim", DIM_, _DIM, new String[] {"name", "size"})); - elementmap.put("Enum", new Lexeme("Enum", ENUM_, _ENUM, new String[] {"enum", "name"})); - elementmap.put("Map", new Lexeme("Map", MAP_, _MAP, new String[] {"name"})); - elementmap.put("Structure", new Lexeme("Structure", STRUCTURE_, _STRUCTURE, new String[] {"name"})); - elementmap.put("Sequence", new Lexeme("Sequence", SEQUENCE_, _SEQUENCE, new String[] {"name"})); - elementmap.put("Value", new Lexeme("Value", VALUE_, _VALUE, new String[] {"value"})); - elementmap.put("Attribute", new Lexeme("Attribute", ATTRIBUTE_, _ATTRIBUTE, new String[] {"name", "type"})); - - elementmap.put("Char", new Lexeme("Char", CHAR_, _CHAR, new String[] {"name"})); - elementmap.put("Byte", new Lexeme("Byte", BYTE_, _BYTE, new String[] {"name"})); - elementmap.put("Int8", new Lexeme("Int8", INT8_, _INT8, new String[] {"name"})); - elementmap.put("UInt8", new Lexeme("UInt8", UINT8_, _UINT8, new String[] {"name"})); - elementmap.put("Int16", new Lexeme("Int16", INT16_, _INT16, new String[] {"name"})); - elementmap.put("UInt16", new Lexeme("UInt16", UINT16_, _UINT16, new String[] {"name"})); - elementmap.put("Int32", new Lexeme("Int32", INT32_, _INT32, new String[] {"name"})); - elementmap.put("UInt32", new Lexeme("UInt32", UINT32_, _UINT32, new String[] {"name"})); - elementmap.put("Int64", new Lexeme("Int64", INT64_, _INT64, new String[] {"name"})); - elementmap.put("UInt64", new Lexeme("UInt64", UINT64_, _UINT64, new String[] {"name"})); - elementmap.put("Float32", new Lexeme("Float32", FLOAT32_, _FLOAT32, new String[] {"name"})); - elementmap.put("Float64", new Lexeme("Float64", FLOAT64_, _FLOAT64, new String[] {"name"})); - elementmap.put("String", new Lexeme("String", STRING_, _STRING, new String[] {"name"})); - elementmap.put("URL", new Lexeme("URL", URL_, _URL, new String[] {"name"})); - elementmap.put("Opaque", new Lexeme("Opaque", OPAQUE_, _OPAQUE, new String[] {"name"})); - - // related elements - elementmap.put("Error", new Lexeme("Error", ERROR_, _ERROR, new String[] {"httpcode"})); - elementmap.put("Message", new Lexeme("Message", MESSAGE_, _MESSAGE, null)); - elementmap.put("Context", new Lexeme("Context", CONTEXT_, _CONTEXT, null)); - elementmap.put("OtherInfo", new Lexeme("OtherInfo", OTHERINFO_, _OTHERINFO, null)); - - // Always insert the lowercase name - attributemap.put("base", new Lexeme("base", ATTR_BASE)); - attributemap.put("basetype", new Lexeme("basetype", ATTR_BASETYPE)); - attributemap.put("dapversion", new Lexeme("dapversion", ATTR_DAPVERSION)); - attributemap.put("dmrversion", new Lexeme("dmrversion", ATTR_DMRVERSION)); - attributemap.put("enum", new Lexeme("enum", ATTR_ENUM)); - attributemap.put("href", new Lexeme("href", ATTR_HREF)); - attributemap.put("name", new Lexeme("name", ATTR_NAME)); - attributemap.put("namespace", new Lexeme("namespace", ATTR_NAMESPACE)); - attributemap.put("size", new Lexeme("size", ATTR_SIZE)); - attributemap.put("type", new Lexeme("type", ATTR_TYPE)); - attributemap.put("value", new Lexeme("value", ATTR_VALUE)); - attributemap.put("ns", new Lexeme("ns", ATTR_NS)); - // related xml attributes - attributemap.put("httpcode", new Lexeme("httpcode", ATTR_HTTPCODE)); - } - - ; - - ////////////////////////////////////////////////// - // Instance variables - - boolean textok = false; - boolean accepted = false; - boolean otherxml = false; - - ////////////////////////////////////////////////// - // Constructor(s) - - public Dap4EventHandler() {} - - ////////////////////////////////////////////////// - // Abstract method overrides - - // Push the token to the parser - // @throws SAXException if parser return YYABORT - - public void yyevent(SaxEvent saxtoken) throws SAXException { - if (accepted) { - throw new SAXException("yyevent called after parser has accepted"); - } - - SaxEventType event = saxtoken.eventtype; - String name = saxtoken.name; - int yytoken = 0; - Lexeme element = null; - Lexeme attr = null; - - element = elementmap.get(name); - - switch (event) { - - case STARTELEMENT: - if (element == null) {// undefined - yytoken = UNKNOWN_ELEMENT_; - break; - } - yytoken = element.open; - if (yytoken == OTHERXML_) { - otherxml = true; - textok = true; - } else if (!otherxml && yytoken == VALUE_) - textok = true; - break; - - case ATTRIBUTE: - String lcname = name.toLowerCase(); - attr = attributemap.get(lcname); - if (attr == null) { - if (lcname.startsWith(SPECIALATTRPREFIX)) - yytoken = ATTR_SPECIAL; - else - yytoken = UNKNOWN_ATTR; - } else - yytoken = attr.atoken; - break; - - case ENDELEMENT: - if (element == null) {// undefined - yytoken = _UNKNOWN_ELEMENT; - break; - } - yytoken = element.close; - if (yytoken == _OTHERXML) { - otherxml = false; - textok = false; - } else if (!otherxml && yytoken == _VALUE) - textok = false; - break; - - case CHARACTERS: - if (!textok) - return; // ignore - yytoken = TEXT; - break; - - case ENDDOCUMENT: - yytoken = EOF; - break; - - default: - return; // ignore - - } // switch - - int status = 0; - try { - Locator loc = getLocator(); - Dap4BisonParser parser = (Dap4BisonParser) this; - // Bison.Position pos = new Bison.Position(loc); - // Dap4BisonParser.Location yyloc = parser.new Location(pos); - status = parser.push_parse(yytoken, saxtoken); - } catch (Exception e) { - throw new SAXException(e); - } - if (status == YYABORT) - throw new SAXException("YYABORT"); - else if (status == YYACCEPT) - accepted = true; - } - -} // class Dap4EventHandler diff --git a/dap4/d4core/src/main/java/dap4/core/dmr/parser/bison/Dap4ParserImpl.java b/dap4/d4core/src/main/java/dap4/core/dmr/parser/bison/Dap4ParserImpl.java deleted file mode 100644 index eb5fa09979..0000000000 --- a/dap4/d4core/src/main/java/dap4/core/dmr/parser/bison/Dap4ParserImpl.java +++ /dev/null @@ -1,1056 +0,0 @@ -/* - * Copyright 2012, UCAR/Unidata. - * See the LICENSE file for more information. - */ - -package dap4.core.dmr.parser.bison; - -import dap4.core.dmr.*; -import dap4.core.dmr.parser.Dap4Parser; -import dap4.core.dmr.parser.ParseException; -import dap4.core.dmr.parser.ParseUtil; -import dap4.core.util.DapException; -import dap4.core.util.DapSort; -import dap4.core.util.DapUtil; -import dap4.core.util.Escape; -import org.xml.sax.SAXException; -import java.math.BigInteger; -import java.util.*; - -/** - * Implement the Dap4 Parse Actions - */ - -public class Dap4ParserImpl extends Dap4BisonParser implements Dap4Parser { - - ////////////////////////////////////////////////// - // Constants - - ////////////////////////////////////////////////// - // static variables - - protected static int globaldebuglevel = 0; - - ////////////////////////////////////////////////// - // Static methods - - public static void setGlobalDebugLevel(int level) { - globaldebuglevel = level; - } - - ////////////////////////////////////////////////// - // Instance variables - - protected DMRFactory factory = null; - - protected ErrorResponse errorresponse = null; - - protected Deque scopestack = new ArrayDeque(); - - protected DapDataset root = null; // of the parse - - protected boolean debug = false; - - ////////////////////////////////////////////////// - // Constructors - - public Dap4ParserImpl(DMRFactory factory) { - super(); - this.factory = (factory == null ? new DMRFactory() : factory); // see Dap4Actions - if (globaldebuglevel > 0) - setDebugLevel(globaldebuglevel); - } - - ////////////////////////////////////////////////// - // Accessors - - public ErrorResponse getErrorResponse() { - return errorresponse; - } - - public DapDataset getDMR() { - return this.root; - } - - ////////////////////////////////////////////////// - // Parser API - - public boolean parse(String input) throws SAXException { - return super.parse(input); - } - - ////////////////////////////////////////////////// - // Parser specific methods - - DapGroup getGroupScope() throws DapException { - DapGroup gscope = (DapGroup) searchScope(DapSort.GROUP, DapSort.DATASET); - if (gscope == null) - throw new DapException("Undefined Group Scope"); - return gscope; - } - - DapNode getMetadataScope() throws DapException { - // Search up the stack for first match. - DapNode match = searchScope(METADATASCOPES); - if (match == null) - throw new ParseException("No enclosing metadata capable scope"); - return match; - } - - DapNode getParentScope() throws DapException { - DapNode parent = searchScope(DapSort.VARIABLE, DapSort.GROUP, DapSort.DATASET); - if (parent == null) - throw new DapException("Undefined parent scope"); - return parent; - } - - DapVariable getVariableScope() throws DapException { - DapNode match = searchScope(DapSort.VARIABLE); - if (match == null) - throw new ParseException("No enclosing variable scope"); - return (DapVariable) match; - } - - DapNode getScope(DapSort... sort) throws DapException { - DapNode node = searchScope(sort); - if (node == null) // return exception if not found - throw new ParseException("No enclosing scope of specified type"); - return node; - } - - DapNode searchScope(DapSort... sort) { - Iterator it = scopestack.iterator(); - while (it.hasNext()) { - DapNode node = (DapNode) it.next(); - for (int j = 0; j < sort.length; j++) { - if (node.getSort() == sort[j]) - return node; - } - } - return null; - } - - DapVariable findVariable(DapNode parent, String name) { - DapVariable var = null; - switch (parent.getSort()) { - case DATASET: - case GROUP: - var = ((DapGroup) parent).findVariable(name); - break; - case VARIABLE: - DapVariable v = (DapVariable) parent; - DapType t = v.getBaseType(); - switch (t.getTypeSort()) { - case Structure: - var = (DapVariable) ((DapStructure) t).findByName(name); - break; - case Sequence: - var = (DapVariable) ((DapSequence) t).findByName(name); - break; - default: - assert false : "Container cannot be atomic variable"; - } - default: - break; - } - return var; - } - - // Attribute map utilities - SaxEvent pull(XMLAttributeMap map, String name) { - SaxEvent event = map.remove(name.toLowerCase()); - return event; - } - - /** - * add any reserved xml attributes to a node unchanged - */ - void passReserved(XMLAttributeMap map, DapNode node) throws ParseException { - try { - DapAttribute attr = null; - for (Map.Entry entry : map.entrySet()) { - SaxEvent event = entry.getValue(); - String key = entry.getKey(); - String value = event.value; - if (isReserved(key)) - node.addXMLAttribute(key, value); - } - } catch (DapException de) { - throw new ParseException(de); - } - } - - // Attribute map utilities - SaxEvent peek(XMLAttributeMap map, String name) { - SaxEvent event = map.get(name.toLowerCase()); - return event; - } - - ////////////////////////////////////////////////// - // Attribute construction - - DapAttribute makeAttribute(DapSort sort, String name, DapType basetype, List nslist, DapNode parent) - throws DapException { - DapAttribute attr = new DapAttribute(name, basetype); - if (sort == DapSort.ATTRIBUTE) { - attr.setBaseType(basetype); - } - parent.addAttribute(attr); - attr.setNamespaceList(nslist); - return attr; - } - - boolean isempty(SaxEvent token) { - return token == null || isempty(token.value); - } - - boolean isempty(String text) { - return (text == null || text.length() == 0); - } - - List convertNamespaceList(NamespaceList nslist) { - return nslist; - } - - boolean islegalenumtype(DapType kind) { - return kind.isIntegerType(); - } - - boolean islegalattributetype(DapType kind) { - return kind.isLegalAttrType(); - } - - DapAttribute lookupAttribute(DapNode parent, XMLAttributeMap attrs) throws DapException { - SaxEvent name = pull(attrs, "name"); - if (isempty(name)) - throw new ParseException("Attribute: Empty attribute name"); - String attrname = name.value; - return parent.findAttribute(attrname); - } - - void changeAttribute(DapAttribute attr, XMLAttributeMap description) throws DapException { - SaxEvent name = pull(description, "name"); - if (isempty(name)) - throw new ParseException("Attribute: Empty attribute name"); - String attrname = name.value; - if (!attr.getShortName().equals(attrname)) - throw new ParseException("Attribute: DATA DMR: Attribute name mismatch:" + name.name); - switch (attr.getSort()) { - case ATTRIBUTE: - SaxEvent atype = pull(description, "type"); - String typename = (atype == null ? "Int32" : atype.value); - if ("Byte".equalsIgnoreCase(typename)) - typename = "UInt8"; - DapType basetype = (DapType) root.lookup(typename, DapSort.ENUMERATION, DapSort.ATOMICTYPE); - if (basetype != attr.getBaseType()) - throw new ParseException("Attribute: DATA DMR: Attempt to change attribute type: " + typename); - attr.clearValues(); - SaxEvent value = pull(description, "value"); - if (value != null) - attr.setValues(new String[] {value.value}); - break; - case ATTRIBUTESET: - // clear the contained attributes - attr.setAttributes(new HashMap()); - break; - case OTHERXML: - throw new ParseException("Attribute: DATA DMR: OtherXML attributes not supported"); - } - } - - DapAttribute createatomicattribute(XMLAttributeMap attrs, NamespaceList nslist, DapNode parent) throws DapException { - SaxEvent name = pull(attrs, "name"); - if (isempty(name)) - throw new ParseException("Attribute: Empty attribute name"); - String attrname = name.value; - SaxEvent atype = pull(attrs, "type"); - String typename = (atype == null ? "Int32" : atype.value); - if ("Byte".equalsIgnoreCase(typename)) - typename = "UInt8"; - DapType basetype = (DapType) root.lookup(typename, DapSort.ENUMERATION, DapSort.ATOMICTYPE); - if (basetype == null || !islegalattributetype(basetype)) - throw new ParseException("Attribute: Invalid attribute type: " + typename); - List hreflist = convertNamespaceList(nslist); - DapAttribute attr = makeAttribute(DapSort.ATTRIBUTE, name.value, basetype, hreflist, parent); - return attr; - } - - DapAttribute createcontainerattribute(XMLAttributeMap attrs, NamespaceList nslist, DapNode parent) - throws DapException { - SaxEvent name = pull(attrs, "name"); - if (isempty(name)) - throw new ParseException("ContainerAttribute: Empty attribute name"); - List hreflist = convertNamespaceList(nslist); - DapAttribute attr = makeAttribute(DapSort.ATTRIBUTESET, name.value, null, hreflist, parent); - return attr; - } - - void createvalue(String value, DapAttribute parent) throws DapException { - // Since this came from ... - // Clean it up - value = cleanup(value); - if (parent != null) - parent.setValues(new String[] {value}); - } - - protected String cleanup(String value) { - value = value.trim(); - int first = -1; - for (int i = 0; i < value.length(); i++) { - if (first < 0 && value.charAt(i) > ' ') { - first = i; - break; - } - } - int last = -1; - for (int i = value.length() - 1; i >= 0; i--) { - if (last < 0 && value.charAt(i) > ' ') { - last = i; - break; - } - } - if (last < 0) - last = value.length() - 1; - if (first < 0) - first = 0; - value = value.substring(first, last + 1); - return value; - } - - void createvalue(SaxEvent value, DapAttribute parent) throws DapException { - List textlist = null; - if (value.eventtype == SaxEventType.CHARACTERS) { - textlist = ParseUtil.collectValues(value.text); - } else if (value.eventtype == SaxEventType.ATTRIBUTE) { - textlist = new ArrayList(); - textlist.add(value.value); - } - if (textlist != null) - parent.setValues(textlist.toArray(new String[textlist.size()])); - } - - DapOtherXML createotherxml(XMLAttributeMap attrs, DapNode parent) throws DapException { - SaxEvent name = pull(attrs, "name"); - SaxEvent href = pull(attrs, "href"); - if (isempty(name)) - throw new ParseException("OtherXML: Empty name"); - List nslist = new ArrayList(); - if (!isempty(href)) - nslist.add(href.value); - DapOtherXML other = (DapOtherXML) makeAttribute(DapSort.OTHERXML, name.value, null, nslist, parent); - parent.setAttribute(other); - return other; - } - - ////////////////////////////////////////////////// - // Abstract action definitions - @Override - void enterdataset(XMLAttributeMap attrs) throws ParseException { - this.debug = getDebugLevel() > 0; // make sure we have the latest value - if (debug) - report("enterdataset"); - SaxEvent name = pull(attrs, "name"); - SaxEvent dapversion = pull(attrs, "dapversion"); - SaxEvent dmrversion = pull(attrs, "dmrversion"); - if (isempty(name)) - throw new ParseException("Empty dataset name attribute"); - // convert and test version numbers - float ndapversion = DAPVERSION; - if (dapversion != null) - try { - ndapversion = Float.parseFloat(dapversion.value); - } catch (NumberFormatException nfe) { - ndapversion = DAPVERSION; - } - if (ndapversion != DAPVERSION) - throw new ParseException("Dataset dapVersion mismatch: " + dapversion.value); - float ndmrversion = DMRVERSION; - if (dmrversion != null) - try { - ndmrversion = Float.parseFloat(dmrversion.value); - } catch (NumberFormatException nfe) { - ndmrversion = DMRVERSION; - } - if (ndmrversion != DMRVERSION) - throw new ParseException("Dataset dmrVersion mismatch: " + dmrversion.value); - this.root = new DapDataset(name.value); - this.root.setDapVersion(Float.toString(ndapversion)); - this.root.setDMRVersion(Float.toString(ndmrversion)); - this.root.setDataset(this.root); - passReserved(attrs, this.root); - scopestack.push(this.root); - } - - @Override - void leavedataset() throws ParseException { - if (debug) - report("leavedataset"); - assert (scopestack.peek() != null && scopestack.peek().getSort() == DapSort.DATASET); - this.root.sort(); - scopestack.pop(); - if (!scopestack.isEmpty()) - throw new ParseException("Dataset: nested dataset"); - this.root.finish(); - } - - @Override - void entergroup(XMLAttributeMap attrs) throws ParseException { - if (debug) - report("entergroup"); - SaxEvent name = pull(attrs, "name"); - if (isempty(name)) - throw new ParseException("Empty group name"); - try { - DapGroup parent = getGroupScope(); - DapGroup group; - group = new DapGroup(name.value); - passReserved(attrs, group); - parent.addDecl(group); - scopestack.push(group); - } catch (DapException de) { - throw new ParseException(de); - } - } - - @Override - void leavegroup() throws ParseException { - if (debug) - report("leavegroup"); - scopestack.pop(); - } - - @Override - void enterenumdef(XMLAttributeMap attrs) throws ParseException { - if (debug) - report("enterenumdef"); - try { - SaxEvent name = pull(attrs, "name"); - if (isempty(name)) - throw new ParseException("Enumdef: Empty Enum Declaration name"); - - SaxEvent basetype = pull(attrs, "basetype"); - DapType basedaptype = null; - if (basetype == null) { - basedaptype = DapEnumeration.DEFAULTBASETYPE; - } else { - String typename = basetype.value; - if ("Byte".equalsIgnoreCase(typename)) - typename = "UInt8"; - basedaptype = (DapType) this.root.lookup(typename, DapSort.ATOMICTYPE); - if (basedaptype == null || !islegalenumtype(basedaptype)) - throw new ParseException("Enumdef: Invalid Enum Declaration Type name: " + basetype.value); - } - DapEnumeration dapenum = null; - dapenum = new DapEnumeration(name.value, basedaptype); - passReserved(attrs, dapenum); - DapGroup parent = getGroupScope(); - parent.addDecl(dapenum); - scopestack.push(dapenum); - } catch (DapException de) { - throw new ParseException(de); - } - } - - - @Override - void leaveenumdef() throws ParseException { - if (debug) - report("leaveenumdef"); - DapEnumeration eparent = (DapEnumeration) scopestack.pop(); - List econsts = eparent.getNames(); - if (econsts.size() == 0) - throw new ParseException("Enumdef: no enum constants specified"); - } - - @Override - void enumconst(SaxEvent name, SaxEvent value) throws ParseException { - if (debug) - report("enumconst"); - if (isempty(name)) - throw new ParseException("Enumconst: Empty enum constant name"); - if (isempty(value)) - throw new ParseException("Enumdef: Invalid enum constant value: " + value.value); - long lvalue = 0; - try { - BigInteger bivalue = new BigInteger(value.value); - bivalue = DapUtil.BIG_UMASK64.and(bivalue); - lvalue = bivalue.longValue(); - } catch (NumberFormatException nfe) { - throw new ParseException("Enumconst: illegal value: " + value.value); - } - try { - DapEnumeration parent = (DapEnumeration) getScope(DapSort.ENUMERATION); - // Verify that the name is a legal enum constant name, which is restricted - // vis-a-vis other names - if (!ParseUtil.isLegalEnumConstName(name.value)) - throw new ParseException("Enumconst: illegal enumeration constant name: " + name.value); - parent.addEnumConst(new DapEnumConst(name.value, lvalue)); - } catch (DapException de) { - throw new ParseException(de); - } - } - - @Override - void enterdimdef(XMLAttributeMap attrs) throws ParseException { - if (debug) - report("enterdimdef"); - SaxEvent name = pull(attrs, "name"); - SaxEvent size = pull(attrs, "size"); - long lvalue = 0; - if (isempty(name)) - throw new ParseException("Dimdef: Empty dimension declaration name"); - if (isempty(size)) - throw new ParseException("Dimdef: Empty dimension declaration size"); - try { - lvalue = Long.parseLong(size.value); - if (lvalue <= 0) - throw new ParseException("Dimdef: value <= 0: " + lvalue); - } catch (NumberFormatException nfe) { - throw new ParseException("Dimdef: non-integer value: " + size.value); - } - DapDimension dim = null; - try { - dim = new DapDimension(name.value, lvalue); - passReserved(attrs, dim); - dim.setShared(true); - DapGroup parent = getGroupScope(); - parent.addDecl(dim); - scopestack.push(dim); - } catch (DapException de) { - throw new ParseException(de); - } - } - - @Override - void leavedimdef() throws ParseException { - if (debug) - report("leavedimdef"); - scopestack.pop(); - } - - @Override - void dimref(SaxEvent nameorsize) throws ParseException { - if (debug) - report("dimref"); - try { - DapDimension dim = null; - DapVariable var = getVariableScope(); - assert var != null : "Internal error"; - - boolean isname = nameorsize.name.equals("name"); - if (isname && isempty(nameorsize)) - throw new ParseException("Dimref: Empty dimension reference name"); - else if (isempty(nameorsize)) - throw new ParseException("Dimref: Empty dimension size"); - if (isname) { - DapGroup dg = var.getGroup(); - if (dg == null) - throw new ParseException("Internal error: variable has no containing group"); - DapGroup grp = var.getGroup(); - if (grp == null) - throw new ParseException("Variable has no group"); - dim = (DapDimension) grp.findByFQN(nameorsize.value, DapSort.DIMENSION); - } else {// Size only is given; presume a number; create unique anonymous dimension - String ssize = nameorsize.value.trim(); - { - // Note that we create it in the root group - assert (root != null); - long anonsize; - try { - anonsize = Long.parseLong(nameorsize.value.trim()); - } catch (NumberFormatException nfe) { - throw new ParseException("Dimref: Illegal dimension size"); - } - dim = root.createAnonymous(anonsize); - } - } - if (dim == null) - throw new ParseException("Unknown dimension: " + nameorsize.value); - var.addDimension(dim); - } catch (DapException de) { - throw new ParseException(de.getMessage(), de.getCause()); - } - } - - @Override - void enteratomicvariable(SaxEvent open, XMLAttributeMap attrs) throws ParseException { - if (debug) - report("enteratomicvariable"); - try { - SaxEvent name = pull(attrs, "name"); - if (isempty(name)) - throw new ParseException("Atomicvariable: Empty dimension reference name"); - String typename = open.name; - if ("Byte".equals(typename)) - typename = "UInt8"; // special case - DapType basetype = (DapType) this.root.lookup(typename, DapSort.ENUMERATION, DapSort.ATOMICTYPE); - if (basetype == null) - throw new ParseException("AtomicVariable: Illegal type: " + open.name); - DapVariable var = null; - // Do type substitutions - var = new DapVariable(name.value, basetype); - passReserved(attrs, var); - // Look at the parent scope - DapNode parent = scopestack.peek(); - if (parent == null) - throw new ParseException("Variable has no parent"); - switch (parent.getSort()) { - case DATASET: - case GROUP: - ((DapGroup) parent).addDecl(var); - break; - case VARIABLE: - addField((DapVariable) parent, var); - break; - default: - assert false : "Atomic variable in illegal scope"; - } - scopestack.push(var); - } catch (DapException de) { - throw new ParseException(de); - } - } - - void openclosematch(SaxEvent close, DapSort sort) throws ParseException { - String typename = close.name; - if ("Byte".equals(typename)) - typename = "UInt8"; // special case - switch (sort) { - case VARIABLE: - TypeSort atype = TypeSort.getTypeSort(typename); - DapVariable var = (DapVariable) searchScope(sort); - assert var != null; - TypeSort vartype = var.getBaseType().getTypeSort(); - if (atype == null) - throw new ParseException("Variable: Illegal type: " + typename); - if (atype != vartype) - throw new ParseException(String.format("variable: open/close type mismatch: <%s> ", vartype, atype)); - break; - default: - throw new ParseException("Variable: Illegal type: " + typename); - } - } - - void leavevariable() throws ParseException { - scopestack.pop(); - } - - void leaveatomicvariable(SaxEvent close) throws ParseException { - openclosematch(close, DapSort.VARIABLE); - leavevariable(); - } - - @Override - void enterenumvariable(XMLAttributeMap attrs) throws ParseException { - if (debug) - report("enterenumvariable"); - try { - SaxEvent name = pull(attrs, "name"); - SaxEvent enumtype = pull(attrs, "enum"); - if (isempty(name)) - throw new ParseException("Enumvariable: Empty variable name"); - if (isempty(enumtype)) - throw new ParseException("Enumvariable: Empty enum type name"); - DapEnumeration target = (DapEnumeration) root.findByFQN(enumtype.value, DapSort.ENUMERATION); - if (target == null) - throw new ParseException("EnumVariable: no such enum: " + name.value); - DapVariable var = null; - var = new DapVariable(name.value, target); - passReserved(attrs, var); - // Look at the parent scope - DapNode parent = scopestack.peek(); - if (parent == null) - throw new ParseException("Variable has no parent"); - switch (parent.getSort()) { - case DATASET: - case GROUP: - ((DapGroup) parent).addDecl(var); - break; - case VARIABLE: - addField((DapVariable) parent, var); - break; - default: - assert false : "Atomic variable in illegal scope"; - } - scopestack.push(var); - } catch (DapException de) { - throw new ParseException(de); - } - } - - @Override - void leaveenumvariable(SaxEvent close) throws ParseException { - if (debug) - report("leaveenumvariable"); - openclosematch(close, DapSort.VARIABLE); - leavevariable(); - } - - @Override - void entermap(SaxEvent name) throws ParseException { - if (debug) - report("entermap"); - if (isempty(name)) - throw new ParseException("Mapref: Empty map name"); - DapVariable var; - try { - var = (DapVariable) root.findByFQN(name.value, DapSort.VARIABLE); - } catch (DapException de) { - throw new ParseException(de); - } - if (var == null) - throw new ParseException("Mapref: undefined variable: " + name.name); - // Verify that this is a legal map => - // 1. it is outside the scope of its parent if the parent - // is a structure. - DapNode container = var.getContainer(); - DapNode scope; - try { - scope = getParentScope(); - } catch (DapException de) { - throw new ParseException(de); - } - if ((container.getSort() == DapSort.STRUCTURE || container.getSort() == DapSort.SEQUENCE) && container == scope) - throw new ParseException("Mapref: map variable not in outer scope: " + name.name); - DapMap map = new DapMap(var); - try { - // Pull the top variable scope - DapVariable parent = (DapVariable) searchScope(DapSort.VARIABLE); - if (parent == null) - throw new ParseException("Variable has no parent: " + var); - parent.addMap(map); - } catch (DapException de) { - throw new ParseException(de); - } - scopestack.push(map); - } - - @Override - void leavemap() throws ParseException { - if (debug) - report("leavemap"); - scopestack.pop(); - } - - @Override - void enterstructurevariable(XMLAttributeMap attrs) throws ParseException { - if (debug) - report("enterstructurevariable"); - SaxEvent name = pull(attrs, "name"); - if (isempty(name)) - throw new ParseException("Structure: Empty structure name"); - try { - DapStructure type = null; - DapVariable var = null; - type = new DapStructure(name.value); - passReserved(attrs, type); - var = new DapVariable(name.value, type); - // Look at the parent scope - DapNode parent = scopestack.peek(); - if (parent == null) - throw new ParseException("Variable has no parent"); - switch (parent.getSort()) { - case DATASET: - case GROUP: - ((DapGroup) parent).addDecl(var); - var.getGroup().addDecl(type); - break; - case VARIABLE: - addField((DapVariable) parent, var); - var.getGroup().addDecl(type); - break; - default: - assert false : "Structure variable in illegal scope"; - } - scopestack.push(var); - } catch (DapException de) { - throw new ParseException(de); - } - } - - @Override - void leavestructurevariable(SaxEvent close) throws ParseException { - if (debug) - report("leavestructurevariable"); - openclosematch(close, DapSort.VARIABLE); - leavevariable(); - } - - @Override - void entersequencevariable(XMLAttributeMap attrs) throws ParseException { - if (debug) - report("entersequencevariable"); - SaxEvent name = pull(attrs, "name"); - if (isempty(name)) - throw new ParseException("Sequence: Empty sequence name"); - try { - DapVariable var = null; - DapType type = null; - type = new DapSequence(name.value); - passReserved(attrs, type); - var = new DapVariable(name.value, type); - // Look at the parent scope - DapNode parent = scopestack.peek(); - if (parent == null) - throw new ParseException("Variable has no parent"); - switch (parent.getSort()) { - case DATASET: - case GROUP: - ((DapGroup) parent).addDecl(var); - var.getGroup().addDecl(type); - break; - case VARIABLE: - addField((DapVariable) parent, var); - var.getGroup().addDecl(type); - break; - default: - assert false : "Structure variable in illegal scope"; - } - scopestack.push(var); - } catch (DapException de) { - throw new ParseException(de); - } - } - - @Override - void leavesequencevariable(SaxEvent close) throws ParseException { - if (debug) - report("leavesequencevariable"); - openclosematch(close, DapSort.VARIABLE); - leavevariable(); - } - - @Override - void enteratomicattribute(XMLAttributeMap attrs, NamespaceList nslist) throws ParseException { - if (debug) - report("enteratomicattribute"); - try { - DapNode parent = getMetadataScope(); - DapAttribute attr = null; - attr = createatomicattribute(attrs, nslist, parent); - scopestack.push(attr); - } catch (DapException de) { - throw new ParseException(de); - } - } - - @Override - void leaveatomicattribute() throws ParseException { - if (debug) - report("leaveatomicattribute"); - DapAttribute attr = (DapAttribute) scopestack.pop(); - // Ensure that the attribute has at least one value - if (java.lang.reflect.Array.getLength(attr.getValues()) == 0) - throw new ParseException("AtomicAttribute: attribute has no values"); - } - - @Override - void entercontainerattribute(XMLAttributeMap attrs, NamespaceList nslist) throws ParseException { - if (debug) - report("entercontainerattribute"); - try { - DapNode parent = getMetadataScope(); - DapAttribute attr = null; - attr = createcontainerattribute(attrs, nslist, parent); - scopestack.push(attr); - } catch (DapException de) { - throw new ParseException(de); - } - } - - @Override - void leavecontainerattribute() throws ParseException { - if (debug) - report("leavecontainerattribute"); - scopestack.pop(); - } - - /** - * This is called for ... - * - * @param value - * @throws ParseException - */ - @Override - void value(String value) throws ParseException { - if (debug) - report("value"); - try { - DapAttribute parent = (DapAttribute) getScope(DapSort.ATTRIBUTE); - createvalue(value, parent); - } catch (DapException de) { - throw new ParseException(de); - } - } - - /** - * This is called for - * - * @param value - * @throws ParseException - */ - @Override - void value(SaxEvent value) throws ParseException { - if (debug) - report("value"); - try { - DapAttribute parent = (DapAttribute) getScope(DapSort.ATTRIBUTE); - createvalue(value, parent); - } catch (DapException de) { - throw new ParseException(de); - } - } - - @Override - void otherxml(XMLAttributeMap attrs, DapXML root) throws ParseException { - if (debug) - report("enterotherxml"); - try { - DapNode parent = getMetadataScope(); - DapOtherXML other = createotherxml(attrs, parent); - parent.setAttribute(other); - other.setRoot(root); - if (debug) - report("leaveotherxml"); - } catch (DapException de) { - throw new ParseException(de); - } - } - - @Override - DapXML.XMLList xml_body(DapXML.XMLList body, DapXML elemortext) throws ParseException { - if (debug) - report("xml_body.enter"); - if (body == null) - body = new DapXML.XMLList(); - if (elemortext != null) - body.add(elemortext); - if (debug) - report("xml_body.exit"); - return body; - } - - @Override - DapXML element_or_text(SaxEvent open, XMLAttributeMap map, DapXML.XMLList body, SaxEvent close) - throws ParseException { - try { - if (debug) - report("element_or_text.enter"); - if (!open.name.equalsIgnoreCase(close.name)) - throw new ParseException(String.format("OtherXML: mismatch: <%s> vs ", open.name, close.name)); - DapXML thisxml = createxmlelement(open, map); - for (DapXML xml : body) { - thisxml.addElement(xml); - } - if (debug) - report("element_or_text.exit"); - return thisxml; - } catch (DapException e) { - throw new ParseException(e); - } - } - - @Override - DapXML xmltext(SaxEvent text) throws ParseException { - try { - if (debug) - report("xmltext"); - DapXML txt = createxmltext(text.text); - return txt; - } catch (DapException e) { - throw new ParseException(e); - } - } - - @Override - void entererror(XMLAttributeMap attrs) throws ParseException { - if (debug) - report("entererror"); - SaxEvent xhttpcode = pull(attrs, "httpcode"); - String shttpcode = (xhttpcode == null ? "400" : xhttpcode.value); - int httpcode = 0; - try { - httpcode = Integer.parseInt(shttpcode); - } catch (NumberFormatException nfe) { - throw new ParseException("Error Response; illegal http code: " + shttpcode); - } - this.errorresponse = new ErrorResponse(); - this.errorresponse.setCode(httpcode); - } - - @Override - void leaveerror() throws ParseException { - if (debug) - report("leaveerror"); - assert (this.errorresponse != null) : "Internal Error"; - } - - @Override - void errormessage(String value) throws ParseException { - if (debug) - report("errormessage"); - assert (this.errorresponse != null) : "Internal Error"; - String message = value; - message = Escape.entityUnescape(message); // Remove XML encodings - this.errorresponse.setMessage(message); - } - - @Override - void errorcontext(String value) throws ParseException { - if (debug) - report("errorcontext"); - assert (this.errorresponse != null) : "Internal Error"; - String context = value; - context = Escape.entityUnescape(context); // Remove XML encodings - this.errorresponse.setContext(context); - } - - @Override - void errorotherinfo(String value) throws ParseException { - if (debug) - report("errorotherinfo"); - assert (this.errorresponse != null) : "Internal Error"; - String other = value; - other = Escape.entityUnescape(other); // Remove XML encodings - this.errorresponse.setOtherInfo(other); - } - - @Override - String textstring(String prefix, SaxEvent text) throws ParseException { - if (debug) - report("text"); - if (prefix == null) - return text.text; - else - return prefix + text.text; - } - - ////////////////////////////////////////////////// - // Utilities - - void addField(DapVariable instance, DapVariable field) throws DapException { - DapType t = instance.getBaseType(); - switch (t.getTypeSort()) { - case Structure: - case Sequence: - ((DapStructure) t).addField(field); - field.setParent(instance); - break; - default: - assert false : "Container cannot be atomic variable"; - } - } - - void report(String action) { - getDebugStream().println("ACTION: " + action); - getDebugStream().flush(); - } - - static boolean isReserved(String name) { - for (String tag : RESERVEDTAGS) { - if (name.startsWith(tag)) - return true; - } - return false; - } -} diff --git a/dap4/d4core/src/main/java/dap4/core/dmr/parser/bison/Dap4Token.java b/dap4/d4core/src/main/java/dap4/core/dmr/parser/bison/Dap4Token.java deleted file mode 100644 index 5fb23a9334..0000000000 --- a/dap4/d4core/src/main/java/dap4/core/dmr/parser/bison/Dap4Token.java +++ /dev/null @@ -1,13 +0,0 @@ -/* - * Copyright 2012, UCAR/Unidata. - * See the LICENSE file for more information. - */ - -package dap4.core.dmr.parser.bison; - -public class Dap4Token extends SaxEvent { - - public Dap4Token() {} - -} // class Dap4Token - diff --git a/dap4/d4core/src/main/java/dap4/core/dmr/parser/bison/Debug.java b/dap4/d4core/src/main/java/dap4/core/dmr/parser/bison/Debug.java deleted file mode 100644 index e3346eab08..0000000000 --- a/dap4/d4core/src/main/java/dap4/core/dmr/parser/bison/Debug.java +++ /dev/null @@ -1,140 +0,0 @@ -/* - * Copyright 2012, UCAR/Unidata. - * See the LICENSE file for more information. - */ - -package dap4.core.dmr.parser.bison; - -import dap4.core.dmr.parser.ParseUtil; -import dap4.core.util.Escape; -import java.util.Map; - -public abstract class Debug { - - static void addtext(StringBuilder dst, String txt, int flags) { - int len; - int pos; - boolean shortened = false; - - if (txt == null) { - dst.append("null"); - return; - } - if ((flags & ParseUtil.FLAG_TRIMTEXT) != 0) { - txt = txt.trim(); - } - len = txt.length(); - if ((flags & ParseUtil.FLAG_ELIDETEXT) != 0 && len > ParseUtil.MAXTEXT) { - len = ParseUtil.MAXTEXT; - shortened = true; - } - dst.append('|'); - for (int i = 0; i < txt.length(); i++) { - char c = txt.charAt(i); - if (len-- <= 0) - continue; - if ((flags & ParseUtil.FLAG_ESCAPE) != 0 && c < ' ') { - dst.append('\\'); - switch (c) { - case '\n': - dst.append('n'); - break; - case '\r': - dst.append('r'); - break; - case '\f': - dst.append('f'); - break; - case '\t': - dst.append('t'); - break; - default: {// convert to octal - int uc = c; - int oct; - oct = ((uc >> 6) & 077); - dst.append((char) ('0' + oct)); - oct = ((uc >> 3) & 077); - dst.append((char) ('0' + oct)); - oct = ((uc) & 077); - dst.append((char) ('0' + oct)); - } - break; - } - } else if ((flags & ParseUtil.FLAG_NOCR) != 0 && c == '\r') { - continue; - } else { - dst.append((char) c); - } - } - if (shortened) { - dst.append("..."); - } - dst.append('|'); - } - - // Trace a SAX Token - public static String trace(SaxEvent token) { - return trace(token, ParseUtil.DEFAULTFLAGS); - } - - public static String trace(SaxEvent token, int flags) { - StringBuilder result = new StringBuilder(); - String name = "UNDEFINED"; - String value = ""; - String text = ""; - SaxEventType event = null; - - name = token.name; - value = token.value; - text = token.text; - event = token.eventtype; - - result.append("[" + event.name() + "] "); - - switch (event) { - case STARTELEMENT: - case ENDELEMENT: - result.append(": element=|"); - result.append(name); - result.append("|"); - break; - case CHARACTERS: - result.append(" text="); - addtext(result, text, flags); - String trans = Escape.entityUnescape(text); - result.append(" translation="); - addtext(result, trans, flags); - break; - case ATTRIBUTE: - result.append(": name="); - addtext(result, name, flags); - result.append(" value="); - addtext(result, value, flags); - break; - case STARTDOCUMENT: - break; - case ENDDOCUMENT: - break; - default: - assert (false) : "Unexpected tokentype"; - } - result.append(" eventtype=" + event.name()); - return result.toString(); - } - - static String traceList(Dap4Actions.XMLAttributeMap map) { - StringBuilder result = new StringBuilder(); - for (Map.Entry entry : map.entrySet()) { - SaxEvent event = entry.getValue(); - String trace = trace(event); - if (result.length() != 0) - result.append("\n"); - result.append(entry.getKey()); - result.append(": "); - result.append(trace); - } - return result.toString(); - } - - -}// Debug diff --git a/dap4/d4core/src/main/java/dap4/core/dmr/parser/bison/LexException.java b/dap4/d4core/src/main/java/dap4/core/dmr/parser/bison/LexException.java deleted file mode 100644 index 714dd2acc4..0000000000 --- a/dap4/d4core/src/main/java/dap4/core/dmr/parser/bison/LexException.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 1998 - 2010. University Corporation for Atmospheric Research/Unidata - * Portions of this software were developed by the Unidata Program at the - * University Corporation for Atmospheric Research. - * - * Access and use of this software shall impose the following obligations - * and understandings on the user. The user is granted the right, without - * any fee or cost, to use, copy, modify, alter, enhance and distribute - * this software, and any derivative works thereof, and its supporting - * documentation for any purpose whatsoever, provided that this entire - * notice appears in all copies of the software, derivative works and - * supporting documentation. Further, UCAR requests that the user credit - * UCAR/Unidata in any publications that result from the use of this - * software or in any product that includes this software. The names UCAR - * and/or Unidata, however, may not be used in any advertising or publicity - * to endorse or promote any products or commercial entity unless specific - * written permission is obtained from UCAR/Unidata. The user also - * understands that UCAR/Unidata is not obligated to provide the user with - * any support, consulting, training or assistance of any kind with regard - * to the use, operation and performance of this software nor to provide - * the user with any updates, revisions, new versions or "bug fixes." - * - * THIS SOFTWARE IS PROVIDED BY UCAR/UNIDATA "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL UCAR/UNIDATA BE LIABLE FOR ANY SPECIAL, - * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING - * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION - * WITH THE ACCESS, USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -////////////////////////////////////////////////// - -package dap4.core.dmr.parser.bison; - -public class LexException extends java.lang.Exception { - public LexException(String msg) { - super(msg); - } - - public LexException(Throwable e) { - super(e); - } - - public LexException(String msg, Throwable e) { - super(msg, e); - } -} diff --git a/dap4/d4core/src/main/java/dap4/core/dmr/parser/bison/Lexeme.java b/dap4/d4core/src/main/java/dap4/core/dmr/parser/bison/Lexeme.java deleted file mode 100644 index 985b99dbc1..0000000000 --- a/dap4/d4core/src/main/java/dap4/core/dmr/parser/bison/Lexeme.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2012, UCAR/Unidata. - * See the LICENSE file for more information. - */ - -package dap4.core.dmr.parser.bison; - -public class Lexeme { - public String name; // element or attribute name - public int open; // Bison token for element open - public int close; // Bison token for element close - public int atoken; // Bison token if this is an attribute - public String[] legalAttributes; /* not currently used */ - - public Lexeme(String name, int atoken) { - this(name, 0, 0, atoken, null); - } - - public Lexeme(String name, int open, int close) { - this(name, open, close, 0, null); - } - - public Lexeme(String name, int open, int close, String[] alist) { - this(name, open, close, 0, alist); - } - - public Lexeme(String name, int open, int close, int atoken, String[] alist) { - this.name = name; - this.open = open; - this.close = close; - this.atoken = atoken; - legalAttributes = alist; - } - - public void attribute(String[] alist) { - legalAttributes = alist; - // check for duplicates - for (int i = 0; i < legalAttributes.length; i++) { - for (int j = i + 1; j < legalAttributes.length; j++) - assert (!legalAttributes[i].equals(legalAttributes[j])); - } - } - - public String toString() { - StringBuilder text = new StringBuilder(); - text.append(String.format("%s open=%d close=%d a=%d", name, open, close, atoken)); - if (legalAttributes != null && legalAttributes.length > 0) { - text.append(" attributes="); - for (String s : legalAttributes) { - text.append(" "); - text.append(s); - } - } - return text.toString(); - } -} // class Lexeme diff --git a/dap4/d4core/src/main/java/dap4/core/dmr/parser/bison/SaxEvent.java b/dap4/d4core/src/main/java/dap4/core/dmr/parser/bison/SaxEvent.java deleted file mode 100644 index 3d5e139a21..0000000000 --- a/dap4/d4core/src/main/java/dap4/core/dmr/parser/bison/SaxEvent.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright 2012, UCAR/Unidata. - * See the LICENSE file for more information. - */ - -package dap4.core.dmr.parser.bison; - -import org.xml.sax.Locator; - -/** - * Define a class to hold information provided to each kind of eventtype - */ -public class SaxEvent { - public SaxEventType eventtype = null; - public String name = null; - public String fullname = null; - public String namespace = null; - - public String value = null; // for attributes - public String text = null; // for text - - // public String publicid = null; - // public String systemid = null; - - // Coverity[FB.URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD] - public Locator locator = null; - - public SaxEvent() {} - - public SaxEvent(SaxEventType eventtype, Locator locator) { - this.eventtype = eventtype; - this.locator = locator; - } - - public SaxEvent(SaxEventType eventtype, Locator locator, String name) { - this(eventtype, locator); - this.name = name; - } - - public SaxEvent(SaxEventType eventtype, Locator locator, String name, String fullname, String uri) { - this(eventtype, locator, name); - this.fullname = fullname; - this.namespace = uri; - } - - public String toString() { - StringBuilder text = new StringBuilder(); - if (eventtype == null) - text.append("notype"); - else - text.append(eventtype.toString()); - text.append(" "); - if (fullname != null) - text.append(fullname); - else if (name != null) - text.append(name); - else - text.append("noname"); - if (value != null) { - text.append(" = "); - text.append(value); - } - if (this.text != null) { - text.append(" = "); - text.append(this.text); - } - return text.toString(); - } - -} // class SaxEvent - diff --git a/dap4/d4core/src/main/java/dap4/core/dmr/parser/bison/SaxEventHandler.java b/dap4/d4core/src/main/java/dap4/core/dmr/parser/bison/SaxEventHandler.java deleted file mode 100644 index 418837c52c..0000000000 --- a/dap4/d4core/src/main/java/dap4/core/dmr/parser/bison/SaxEventHandler.java +++ /dev/null @@ -1,278 +0,0 @@ -/* - * Copyright 2012, UCAR/Unidata. - * See the LICENSE file for more information. - */ - -package dap4.core.dmr.parser.bison; - -import javax.xml.XMLConstants; -import org.xml.sax.*; -import org.xml.sax.helpers.DefaultHandler; -import javax.xml.parsers.SAXParser; -import javax.xml.parsers.SAXParserFactory; -import java.io.ByteArrayInputStream; -import java.nio.charset.Charset; - -public abstract class SaxEventHandler extends DefaultHandler { - ////////////////////////////////////////////////// - // Constants - - static boolean TRACE = false; - - static Charset UTF8 = Charset.forName("UTF-8"); - - static final String LOAD_EXTERNAL_DTD = "http://apache.org/xml/features/nonvalidating/load-external-dtd"; - - ////////////////////////////////////////////////// - // static types - - ////////////////////////////////////////////////// - // static fields - - ////////////////////////////////////////////////// - // Instance variables - - protected String document = null; - - // Sax parser state - protected Locator locator = null; - protected SAXParserFactory spf = null; - protected SAXParser saxparser = null; - protected ByteArrayInputStream input = null; - - ////////////////////////////////////////////////// - // Constructor(s) - - public SaxEventHandler() { - - } - - ////////////////////////////////////////////////// - // Abstract method(s) - - // Send the lexeme to the the subclass to process - public abstract void yyevent(SaxEvent token) throws SAXException; - - ////////////////////////////////////////////////// - // Get/Set - public Locator getLocator() { - return this.locator; - } - ////////////////////////////////////////////////// - // Public API - - public boolean parse(String document) throws SAXException { - // Trim and strip any leading - StringBuilder doc = new StringBuilder(document.trim()); - int index = doc.indexOf(""); - if (index < 0) - throw new SAXException("Document has malformed prefix"); - doc.delete(0, index + 2); - // remove any leading crlf - while (doc.length() > 0 && "\r\n".indexOf(doc.charAt(0)) >= 0) - doc.deleteCharAt(0); - document = doc.toString(); - } - this.document = document; - // Create the sax parser that will drive us with events - try { - spf = SAXParserFactory.newInstance(); - spf.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); - spf.setValidating(false); - spf.setNamespaceAware(true); - spf.setFeature(LOAD_EXTERNAL_DTD, false); - saxparser = spf.newSAXParser(); - // Set up for the parse - input = new ByteArrayInputStream(document.getBytes(UTF8)); - saxparser.parse(input, this); // 'this' is link to subclass parser - return true; - } catch (Exception e) { - throw new SAXException(e); - } - } - - ////////////////////////////////////////////////// - // DefaultHandler Overrides - - // We feed only a subset of the possible events into - // the subclass handler. This can be changed by - // overriding the suppressing eventtype handlers below. - - @Override - public void setDocumentLocator(Locator locator) { - this.locator = locator; - } - - @Override - public void startDocument() throws SAXException { - SaxEvent token = new SaxEvent(SaxEventType.STARTDOCUMENT, locator); - if (TRACE) - trace("eventtype.%s: %s%n", token.eventtype.name(), token.toString()); - locatedEvent(token); - } - - @Override - public void endDocument() throws SAXException { - SaxEvent token = new SaxEvent(SaxEventType.ENDDOCUMENT, locator); - if (TRACE) - trace("eventtype.%s: %s%n", token.eventtype.name(), token.toString()); - locatedEvent(token); - } - - @Override - public void startElement(String nsuri, String name, String qualname, Attributes attributes) throws SAXException { - SaxEvent token = new SaxEvent(SaxEventType.STARTELEMENT, locator, name, qualname, nsuri); - if (TRACE) - trace("eventtype.%s: %s%n", token.eventtype.name(), token.toString()); - locatedEvent(token); - // Now pass the attributes as tokens - int nattr = attributes.getLength(); - for (int i = 0; i < nattr; i++) { - String aname = attributes.getLocalName(i); - if ("".equals(aname)) - aname = attributes.getQName(i); - String value = attributes.getValue(i); - token = new SaxEvent(SaxEventType.ATTRIBUTE, locator, aname); - token.value = value; - if (TRACE) - trace("eventtype.%s: %s%n", token.eventtype.name(), token.toString()); - locatedEvent(token); - } - } - - @Override - public void endElement(String nsuri, String name, String qualname) throws SAXException { - SaxEvent token = new SaxEvent(SaxEventType.ENDELEMENT, locator, name, qualname, nsuri); - if (TRACE) - trace("eventtype.%s: %s%n", token.eventtype.name(), token.toString()); - locatedEvent(token); - } - - @Override - public void characters(char[] ch, int start, int length) throws SAXException { - SaxEvent token = new SaxEvent(SaxEventType.CHARACTERS, locator); - token.text = new String(ch, start, length); - if (TRACE) - trace("eventtype.%s: %s%n", token.eventtype.name(), token.toString()); - locatedEvent(token); - } - - // Following events are suppressed - - @Override - public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException { - // should never see this since not validating - return; - } - - @Override - public void endPrefixMapping(String prefix) throws SAXException { - return; - } - - @Override - public void notationDecl(String name, String publicId, String systemId) throws SAXException { - return; - } - - @Override - public void processingInstruction(String target, String data) throws SAXException { - return; - } - - @Override - public void skippedEntity(String name) throws SAXException { - return; - } - - @Override - public void startPrefixMapping(String prefix, String uri) throws SAXException { - return; - } - - @Override - public void unparsedEntityDecl(String name, String publicId, String systemId, String notationName) - throws SAXException { - return; - } - - ////////////////////////////////////////////////// - // Entity resolution (Ignored) - - @Override - public InputSource resolveEntity(String publicId, String systemId) { - if (TRACE) - trace("eventtype.RESOLVEENTITY: %s.%s%n", publicId, systemId); - return null; - } - - ////////////////////////////////////////////////// - // Error handling Events - - @Override - public void fatalError(SAXParseException e) throws SAXException { - throw new SAXParseException(String.format("Sax fatal error: %s; %s%n", e, report(this.locator)), this.locator); - } - - @Override - public void error(SAXParseException e) throws SAXException { - System.err.printf("Sax error: %s; %s%n", e, report(this.locator)); - } - - @Override - public void warning(SAXParseException e) throws SAXException { - System.err.printf("Sax warning: %s; %s%n", e, report(this.locator)); - } - - protected String report(Locator locator) { - int lineno = locator.getLineNumber(); - int colno = locator.getColumnNumber(); - String text = this.document; - String[] lines = text.split("[\n]"); - for (int i = lines.length; i <= lineno + 1; i++) { - // Coverity[FB.SBSC_USE_STRINGBUFFER_CONCATENATION] - text = text + " \n"; - } - lines = text.split("[\n]"); - String msg; - try { - msg = lines[lineno]; - while (msg.length() <= colno) { - msg = msg + ' '; - } - msg = msg.substring(0, colno) + '^' + msg.substring(colno, msg.length()); - msg = locator.toString() + '|' + msg + '|'; - } catch (ArrayIndexOutOfBoundsException t) { - msg = locator.toString(); - } - return msg; - } - - - ////////////////////////////////////////////////// - // Location printing - - protected void locatedEvent(SaxEvent token) throws SAXException { - try { - yyevent(token); - } catch (SAXException se) { - throw new SAXException(locatedError(se.getMessage())); - } - } - - - protected String locatedError(String msg) { - String locmsg = - msg + String.format("; near %d::%d%n", this.locator.getLineNumber(), this.locator.getColumnNumber()); - return locmsg; - } - - - protected void trace(String msg, Object... args) { - if (TRACE) - System.err.printf(locatedError(String.format(msg, args))); - } - -} // class SaxEventHandler diff --git a/dap4/d4core/src/main/java/dap4/core/dmr/parser/bison/SaxEventType.java b/dap4/d4core/src/main/java/dap4/core/dmr/parser/bison/SaxEventType.java deleted file mode 100644 index 8d4eb953d1..0000000000 --- a/dap4/d4core/src/main/java/dap4/core/dmr/parser/bison/SaxEventType.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2012, UCAR/Unidata. - * See the LICENSE file for more information. - */ - -package dap4.core.dmr.parser.bison; - -/** - * Provide an enumeration to mark all the possible Sax Parser - * generated events (except error events) - */ - -/** - * This should be essentially 1-1 for all the handler callbacks. - * Exceptions: TBD - */ - -public enum SaxEventType { - CHARACTERS, ENDDOCUMENT, ENDELEMENT, ENDPREFIXMAPPING, IGNORABLEWHITESPACE, NOTATIONDECL, PROCESSINGINSTRUCTION, SETDOCUMENTLOCATOR, SKIPPEDENTITY, STARTDOCUMENT, STARTELEMENT, STARTPREFIXMAPPING, UNPARSEDENTITYDECL, - // Following is added to support each attribute as an eventtype - ATTRIBUTE; -}; // enum SaxEventType diff --git a/dap4/d4core/src/main/java/dap4/core/util/Index.java b/dap4/d4core/src/main/java/dap4/core/util/Index.java deleted file mode 100644 index 9a1049e527..0000000000 --- a/dap4/d4core/src/main/java/dap4/core/util/Index.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright 2012, UCAR/Unidata. - * See the LICENSE file for more information. - */ - -package dap4.core.util; - -import java.util.Arrays; - -public class Index { - public static final Index SCALAR = new Index(0); - - public int rank; - public long[] indices; // allow direct access - public long[] dimsizes; // allow direct access - - ////////////////////////////////////////////////// - // Constructor(s) - - public Index(int rank) { - this.rank = rank; - this.dimsizes = new long[rank]; - indices = new long[rank]; - if (this.rank > 0) { - Arrays.fill(indices, 0); - Arrays.fill(dimsizes, 0); - } - } - - public Index(Index index) { - this(index.getRank()); - if (this.rank > 0) { - System.arraycopy(index.indices, 0, this.indices, 0, this.rank); - System.arraycopy(index.dimsizes, 0, this.dimsizes, 0, this.rank); - } - } - - public Index(long[] indices, long[] dimsizes) { - this(dimsizes.length); - if (this.rank > 0) { - System.arraycopy(indices, 0, this.indices, 0, this.rank); - System.arraycopy(dimsizes, 0, this.dimsizes, 0, this.rank); - } - } - - public String toString() { - StringBuilder buf = new StringBuilder(); - buf.append('['); - for (int i = 0; i < this.rank; i++) { - if (i > 0) - buf.append(','); - buf.append(indices[i]); - buf.append('/'); - buf.append(dimsizes[i]); - } - buf.append("]("); - buf.append(this.index()); - buf.append(")"); - return buf.toString(); - } - - - /** - * Compute the linear index - * from the current odometer indices. - */ - public long index() { - long offset = 0; - for (int i = 0; i < this.indices.length; i++) { - offset *= this.dimsizes[i]; - offset += this.indices[i]; - } - return offset; - } - - public int getRank() { - return this.rank; - } - - public long get(int i) { - if (i < 0 || i >= this.rank) - throw new IllegalArgumentException(); - return this.indices[i]; - } - - public long getSize(int i) { - if (i < 0 || i >= this.rank) - throw new IllegalArgumentException(); - return this.dimsizes[i]; - } - - public boolean isScalar() { - return (rank == 0 && indices.length == 1 && index() == 1); - } - - -} diff --git a/dap4/d4core/src/main/java/dap4/core/util/MultiOdometer.java b/dap4/d4core/src/main/java/dap4/core/util/MultiOdometer.java deleted file mode 100644 index 99c82ada73..0000000000 --- a/dap4/d4core/src/main/java/dap4/core/util/MultiOdometer.java +++ /dev/null @@ -1,146 +0,0 @@ -/* - * Copyright 2012, UCAR/Unidata. - * See the LICENSE file for more information. - */ - -package dap4.core.util; - -import dap4.core.dmr.DapDimension; -import java.util.ArrayList; -import java.util.List; -import java.util.NoSuchElementException; - -/** - * An odometer capable of dealing with a Multi-slices. - */ - -public class MultiOdometer extends Odometer { - - protected static boolean DEBUG = false; - - ////////////////////////////////////////////////// - // Instance variables - - protected int current; // pointers into multslice list - protected long[] sizes; // # of subslices in each slice - protected List> slicesets; // Set of all combinations of slices - protected List odomset; // Odometers created from slicesets - - ////////////////////////////////////////////////// - // Constructor(s) - - public MultiOdometer() {} - - public MultiOdometer(List set) throws DapException { - this(set, null); - } - - public MultiOdometer(List set, List dimset) throws DapException { - super(set, dimset); - super.ismulti = true; - this.sizes = new long[this.rank]; - this.odomset = new ArrayList<>(); - for (int i = 0; i < this.rank; i++) { - Slice sl = set.get(i); - List subslices = sl.getSubSlices(); - this.sizes[i] = subslices.size(); - } - int truerank = this.rank; - if (truerank == 0) { - this.slicesets = null; - this.odomset = null; - } else { - PowerSet ps = new PowerSet(this.sizes); - long pssize = ps.getTotalSize(); - long[][] setindices = ps.getPowerSet(); - assert setindices.length == pssize; - this.slicesets = new ArrayList<>(); - if (DEBUG) { - System.err.printf("Multi: |slicesets| = %d%n", setindices.length); - System.err.println(ps.toString()); - } - // Create set of slicsets comprising this MultiOdometer - for (int i = 0; i < pssize; i++) { - long[] indexset = setindices[i]; - assert indexset.length == truerank; - // Pick out the desired set of slices - List subset = new ArrayList<>(); - for (int j = 0; j < this.rank; j++) { - Slice s0 = set.get(j); - Slice ss = s0.getSubSlice((int) indexset[j]); - subset.add(ss); - } - this.slicesets.add(subset); - } - assert this.slicesets.size() == pssize; - // Create set of odometers comprising this MultiOdometer - for (int i = 0; i < pssize; i++) { - Odometer sslodom = Odometer.factory(this.slicesets.get(i), dimset); - this.odomset.add(sslodom); - } - } - this.current = 0; - } - - ////////////////////////////////////////////////// - - @Override - public String toString() { - StringBuilder buf = new StringBuilder(); - for (int i = 0; i < rank; i++) { - Slice s = slice(i); - if (i == current) - buf.append("*"); - buf.append(s.toString()); - buf.append(String.format("(%d)", s.getCount())); - } - return buf.toString(); - } - - ////////////////////////////////////////////////// - // Iterator API Overrides - - @Override - public boolean hasNext() { - if (this.current >= odomset.size()) - return false; - Odometer ocurrent = odomset.get(this.current); - if (ocurrent.hasNext()) - return true; - // Try to move to next odometer - this.current++; - return hasNext(); - } - - @Override - public Index next() { - if (this.current >= odomset.size()) - throw new NoSuchElementException(); - Odometer ocurrent = odomset.get(this.current); - assert ocurrent.hasNext(); - return ocurrent.next(); - } - - @Override - public void remove() { - throw new UnsupportedOperationException(); - } - - /** - * Compute the total number of elements. - */ - @Override - public long totalSize() { - long size = 1; - for (int i = 0; i < this.rank; i++) { - size *= slice(i).getCount(); - } - return size; - } - - @Override - public List getSubOdometers() { - return this.odomset; - } - -} diff --git a/dap4/d4core/src/main/java/dap4/core/util/Odometer.java b/dap4/d4core/src/main/java/dap4/core/util/Odometer.java deleted file mode 100644 index bccd69e1f5..0000000000 --- a/dap4/d4core/src/main/java/dap4/core/util/Odometer.java +++ /dev/null @@ -1,269 +0,0 @@ -/* - * Copyright 2012, UCAR/Unidata. - * See the LICENSE file for more information. - */ - -package dap4.core.util; - -import dap4.core.dmr.DapDimension; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import java.util.NoSuchElementException; - -/** - * A classic implementation of an odometer - * taken from the netcdf-c code. - * Extended to provide iterator interface - */ - -public class Odometer implements Iterator { - - ////////////////////////////////////////////////// - // Constants - - // Mnemonic - - protected static enum STATE { - INITIAL, STARTED, DONE; - } - - ////////////////////////////////////////////////// - // factories - - public static Odometer factoryScalar() { - return new ScalarOdometer(); - } - - public static Odometer factory(List slices) throws DapException { - return factory(slices, null); - } - - public static Odometer factory(List slices, List dimset) throws DapException { - // check for scalar case - if (dimset != null && dimset.size() == 0) { - if (!DapUtil.isScalarSlices(slices)) - throw new DapException("Cannot build scalar odometer with non-scalar slices"); - return factoryScalar(); - } - boolean multi = false; - if (slices != null) { - for (int i = 0; i < slices.size(); i++) { - if (slices.get(i).getSort() == Slice.Sort.Multi) { - multi = true; - break; - } - } - } - if (slices == null || slices.size() == 0) - return factoryScalar(); - else if (multi) - return new MultiOdometer(slices, dimset); - else - return new Odometer(slices, dimset); - } - - ////////////////////////////////////////////////// - // Instance variables - - protected STATE state = STATE.INITIAL; - - protected boolean ismulti = false; - - protected int rank = 0; - protected List slices = null; - protected List dimset = null; - - // The current odometer indices - protected Index index; - - // precompute this.slices[i].getLast() - this.slices[i].getStride() - protected long[] endpoint; - - ////////////////////////////////////////////////// - // Constructor(s) - - public Odometer() {} - - public Odometer(List set) throws DapException { - this(set, null); - } - - public Odometer(List set, List dimset) throws DapException { - if (set == null) - throw new DapException("Null slice list"); - if (dimset != null && set.size() != dimset.size()) - throw new DapException("Rank mismatch"); - this.rank = set.size(); - if (this.rank == 0) - throw new DapException("Rank == 0; use Scalar Odometer"); - this.slices = new ArrayList<>(); - this.slices.addAll(set); - if (dimset != null) { - this.dimset = new ArrayList<>(); - this.dimset.addAll(dimset); - } - this.endpoint = new long[this.rank]; - this.index = new Index(rank); - for (int i = 0; i < this.rank; i++) { - this.index.dimsizes[i] = slices.get(i).getMax(); - } - reset(); - } - - protected void reset() { - for (int i = 0; i < this.rank; i++) { - try { - slices.get(i).finish(); - this.index.indices[i] = this.slices.get(i).getFirst(); - this.endpoint[i] = this.slices.get(i).getLast() - this.slices.get(i).getStride(); - } catch (DapException de) { - throw new IllegalArgumentException(de); - } - } - } - - public String toString() { - StringBuilder buf = new StringBuilder(); - for (int i = 0; i < rank; i++) { - if (i > 0) - buf.append(","); - if (dimset != null) - buf.append(dimset.get(i) != null ? dimset.get(i).getShortName() : "null"); - buf.append(this.slices.get(i).toString()); - buf.append(String.format("(%d)", this.slices.get(i).getCount())); - if (this.index != null) - buf.append(String.format("@%d", this.index.indices[i])); - } - return buf.toString(); - } - - ////////////////////////////////////////////////// - // Odometer API - - /** - * Return odometer rank - */ - public int rank() { - return this.rank; - } - - /** - * Return ith slice - */ - public Slice slice(int i) { - if (i < 0 || i >= this.rank) - throw new IllegalArgumentException(); - return this.slices.get(i); - } - - - public List getSlices() { - return this.slices; - } - - /** - * Compute the linear index - * from the current odometer indices. - */ - public long index() { - return index.index(); - } - - /** - * Return current set of indices - */ - public Index indices() { - return this.index; - } - - /** - * Compute the total number of elements. - */ - public long totalSize() { - long size = 1; - for (int i = 0; i < this.rank; i++) { - size *= this.slices.get(i).getCount(); - } - return size; - } - - ////////////////////////////////////////////////// - // Iterator API - - @Override - public boolean hasNext() { - int stop = this.rank; - switch (this.state) { - case INITIAL: - return true; - case STARTED: - int i; - for (i = stop - 1; i >= 0; i--) { // walk backwards - if (this.index.indices[i] <= this.endpoint[i]) - return true; - } - this.state = STATE.DONE; - break; - case DONE: - } - return false; - } - - @Override - public Index next() { - int i; - int lastpos = this.rank; - int firstpos = 0; - switch (this.state) { - case INITIAL: - this.state = STATE.STARTED; - break; - case STARTED: - i = step(firstpos, lastpos); - if (i < 0) - this.state = STATE.DONE; - break; - case DONE: - break; - } - if (this.state == STATE.DONE) - throw new NoSuchElementException(); - return indices(); - } - - @Override - public void remove() { - throw new UnsupportedOperationException(); - } - - ////////////////////////////////////////////////// - - // on entry: indices are the last index set - // on exit, the indices are the next value - // return index of place where we have room to step; - // return -1 if we have completed. - public int step(int firstpos, int lastpos) { - for (int i = lastpos - 1; i >= firstpos; i--) { // walk backwards - if (this.index.indices[i] > this.endpoint[i]) - this.index.indices[i] = this.slices.get(i).getFirst(); // reset this position - else { - this.index.indices[i] += this.slices.get(i).getStride(); // move to next indices - return i; - } - } - return -1; - } - - public List getSubOdometers() { - List list = new ArrayList<>(); - list.add(this); - return list; - } - - public boolean isMulti() { - return this.ismulti; - } - - -} diff --git a/dap4/d4core/src/main/java/dap4/core/util/ScalarOdometer.java b/dap4/d4core/src/main/java/dap4/core/util/ScalarOdometer.java deleted file mode 100644 index bafc9a5436..0000000000 --- a/dap4/d4core/src/main/java/dap4/core/util/ScalarOdometer.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2012, UCAR/Unidata. - * See the LICENSE file for more information. - */ - -package dap4.core.util; - -import java.util.NoSuchElementException; - -/** - * A implementation of an odometer for scalar variables. - */ - -public class ScalarOdometer extends Odometer { - ////////////////////////////////////////////////// - // Constants - - public ScalarOdometer() { - this.state = STATE.INITIAL; - this.index = new Index(0); - this.slices = Slice.SCALARSLICES; - } - - public long index() { - return 0; - } - - public long totalSize() { - return 1; - } - - public boolean hasNext() { - return this.state != STATE.DONE; - } - - public Index next() { - if (this.state == STATE.DONE) - throw new NoSuchElementException(); - this.state = STATE.DONE; - return Index.SCALAR; - } - - public void remove() { - throw new UnsupportedOperationException(); - } - -} diff --git a/dap4/d4lib/build.gradle b/dap4/d4lib/build.gradle deleted file mode 100644 index 0c84380c55..0000000000 --- a/dap4/d4lib/build.gradle +++ /dev/null @@ -1,16 +0,0 @@ -apply from: "$rootDir/gradle/any/dependencies.gradle" -apply from: "$rootDir/gradle/any/java-library.gradle" - -dependencies { - api enforcedPlatform(project(':netcdf-java-platform')) - - compile project(':dap4:d4core') - compile project(':httpservices') - compile project(':netcdf4') - - compile 'org.apache.httpcomponents:httpclient' - compile 'org.apache.httpcomponents:httpcore' - compile 'net.java.dev.jna:jna' - compile 'com.beust:jcommander' - compile 'org.slf4j:slf4j-api' -} diff --git a/dap4/d4lib/src/main/java/dap4/dap4lib/AbstractCursor.java b/dap4/d4lib/src/main/java/dap4/dap4lib/AbstractCursor.java deleted file mode 100644 index c98c51c763..0000000000 --- a/dap4/d4lib/src/main/java/dap4/dap4lib/AbstractCursor.java +++ /dev/null @@ -1,239 +0,0 @@ -/* - * Copyright 2012, UCAR/Unidata. - * See the LICENSE file for more information. - */ - -package dap4.dap4lib; - -import dap4.core.data.DSP; -import dap4.core.data.DataCursor; -import dap4.core.dmr.DapNode; -import dap4.core.dmr.DapStructure; -import dap4.core.dmr.DapType; -import dap4.core.dmr.DapVariable; -import dap4.core.util.DapException; -import dap4.core.util.DapSort; -import dap4.core.util.Index; -import dap4.core.util.Slice; -import java.util.List; - -public abstract class AbstractCursor implements DataCursor { - ////////////////////////////////////////////////// - // Constants - - ////////////////////////////////////////////////// - // Instance Variables - - protected Scheme scheme; - - protected DSP dsp; - protected DapNode template; - - protected Index arrayindex = null; - protected long recordindex = -1; // scheme == record - - protected AbstractCursor container = null; - - protected long recordcount = -1; - - ////////////////////////////////////////////////// - // Constructor(s) - - public AbstractCursor(Scheme scheme, DSP dsp, DapNode template, AbstractCursor container) { - setScheme(scheme); - setDSP(dsp); - setTemplate(template); - setContainer(container); - } - - public AbstractCursor(AbstractCursor orig) { - this(orig.getScheme(), orig.getDSP(), orig.getTemplate(), (AbstractCursor) orig.getContainer()); - } - - - public String toString() { - StringBuilder buf = new StringBuilder(); - buf.append(getScheme().toString()); - if (getScheme() == Scheme.STRUCTARRAY || getScheme() == Scheme.SEQARRAY) - buf.append("[]"); - buf.append(":"); - buf.append(getTemplate().toString()); - if (this.arrayindex != null) { - buf.append("::"); - buf.append(this.arrayindex.toString()); - } - if (this.recordindex >= 0) { - buf.append("*"); - buf.append(this.recordindex); - } - return buf.toString(); - } - - ////////////////////////////////////////////////// - // Unimplemented DataCursor API methods - - @Override - public abstract Object read(List slices) throws DapException; - - @Override - public abstract Object read(Index index) throws DapException; - - @Override - public abstract AbstractCursor readRecord(long i) throws DapException; - - @Override - public abstract AbstractCursor readField(int fieldindex) throws DapException; - - ////////////////////////////////////////////////// - // Selected DataCursor API overrides - - @Override - public int fieldIndex(String name) throws DapException { - DapStructure ds; - if (getTemplate().getSort().isCompound()) - ds = (DapStructure) getTemplate(); - else if (getTemplate().getSort().isVar() && (((DapVariable) getTemplate()).getBaseType().getSort().isCompound())) - ds = (DapStructure) ((DapVariable) getTemplate()).getBaseType(); - else - throw new DapException("Attempt to get field name on non-compound object"); - int i = ds.indexByName(name); - if (i < 0) - throw new DapException("Unknown field name: " + name); - return i; - } - - @Override - public Scheme getScheme() { - return this.scheme; - } - - @Override - public DSP getDSP() { - return this.dsp; - } - - @Override - public DapNode getTemplate() { - return this.template; - } - - @Override - public Index getIndex() throws DapException { - if (this.scheme != Scheme.STRUCTURE && this.scheme != Scheme.SEQUENCE) - throw new DapException("Not a Sequence|Structure instance"); - return this.arrayindex; - } - - @Override - public long getRecordIndex() throws DapException { - if (this.scheme != Scheme.RECORD) - throw new DapException("Not a Record instance"); - return this.recordindex; - } - - @Override - public long getRecordCount() throws DapException { - if (this.scheme != Scheme.SEQUENCE) - throw new DapException("Not a SEQUENCE instance"); - return this.recordcount; - } - - - @Override - public AbstractCursor getContainer() { - return this.container; - } - - @Override - public boolean isScalar() { - if (getTemplate().getSort().isVar()) { - return ((DapVariable) getTemplate()).getRank() == 0; - } else - return false; - } - - public boolean isField() { - return getTemplate().getContainer() != null; - } - - public boolean isAtomic() { - boolean is = this.scheme == Scheme.ATOMIC; - assert !is || getTemplate().getSort() == DapSort.ATOMICTYPE || (getTemplate().getSort() == DapSort.VARIABLE - && ((DapVariable) getTemplate()).getBaseType().getTypeSort().isAtomic()); - return is; - } - - public boolean isCompound() { - boolean is = (this.scheme == Scheme.SEQUENCE || this.scheme == Scheme.STRUCTURE); - assert !is || getTemplate().getSort() == DapSort.SEQUENCE || getTemplate().getSort() == DapSort.STRUCTURE - || (getTemplate().getSort() == DapSort.VARIABLE - && ((DapVariable) getTemplate()).getBaseType().getTypeSort().isCompoundType()); - return is; - } - - public boolean isCompoundArray() { - boolean is = (this.scheme == Scheme.SEQARRAY || this.scheme == Scheme.STRUCTARRAY); - assert !is || getTemplate().getSort() == DapSort.SEQUENCE || getTemplate().getSort() == DapSort.STRUCTURE - || (getTemplate().getSort() == DapSort.VARIABLE - && ((DapVariable) getTemplate()).getBaseType().getTypeSort().isCompoundType()); - return is; - } - - ////////////////////////////////////////////////// - // AbstractCursor extensions - - public AbstractCursor setIndex(Index index) { - this.arrayindex = index; - return this; - } - - public AbstractCursor setRecordIndex(long index) { - this.recordindex = index; - return this; - } - - public AbstractCursor setRecordCount(long count) { - this.recordcount = count; - return this; - } - - public AbstractCursor setContainer(AbstractCursor container) { - this.container = container; - return this; - } - - public AbstractCursor setScheme(Scheme scheme) { - this.scheme = scheme; - return this; - } - - - public AbstractCursor setDSP(DSP dsp) { - this.dsp = dsp; - return this; - } - - public AbstractCursor setTemplate(DapNode template) { - this.template = template; - return this; - } - - - ////////////////////////////////////////////////// - // Utilities - - public static Scheme schemeFor(DapVariable field) { - DapType ftype = field.getBaseType(); - Scheme scheme = null; - boolean isscalar = field.getRank() == 0; - if (ftype.getTypeSort().isAtomic()) - scheme = Scheme.ATOMIC; - else { - if (ftype.getTypeSort().isStructType()) - scheme = Scheme.STRUCTARRAY; - else if (ftype.getTypeSort().isSeqType()) - scheme = Scheme.SEQARRAY; - } - return scheme; - } -} diff --git a/dap4/d4lib/src/main/java/dap4/dap4lib/AbstractDSP.java b/dap4/d4lib/src/main/java/dap4/dap4lib/AbstractDSP.java deleted file mode 100644 index ce17c50a3d..0000000000 --- a/dap4/d4lib/src/main/java/dap4/dap4lib/AbstractDSP.java +++ /dev/null @@ -1,294 +0,0 @@ -/* - * Copyright 2012, UCAR/Unidata. - * See the LICENSE file for more information. - */ - -package dap4.dap4lib; - -import dap4.core.data.ChecksumMode; -import dap4.core.data.DSP; -import dap4.core.data.DataCursor; -import dap4.core.dmr.DapAttribute; -import dap4.core.dmr.DapDataset; -import dap4.core.dmr.DapNode; -import dap4.core.dmr.DapVariable; -import dap4.core.dmr.parser.DOM4Parser; -import dap4.core.dmr.parser.Dap4Parser; -import dap4.core.util.DapContext; -import dap4.core.util.DapException; -import dap4.core.util.DapUtil; -import org.xml.sax.SAXException; -import java.io.IOException; -import java.io.PrintWriter; -import java.io.StringWriter; -import java.nio.ByteOrder; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * Provide a superclass for DSPs. - */ - -public abstract class AbstractDSP implements DSP { - public static boolean TESTING = false; /* Turned on by test programs */ - - ////////////////////////////////////////////////// - // constants - - protected static final boolean DEBUG = false; - protected static final boolean PARSEDEBUG = false; - - public static final boolean USEDOM = false; - - protected static final String DAPVERSION = "4.0"; - protected static final String DMRVERSION = "1.0"; - protected static final String DMRNS = "http://xml.opendap.org/ns/DAP/4.0#"; - - // Define reserved attributes - public static final String UCARTAGVLEN = "_edu.ucar.isvlen"; - public static final String UCARTAGOPAQUE = "_edu.ucar.opaque.size"; - public static final String UCARTAGORIGTYPE = "_edu.ucar.orig.type"; - public static final String UCARTAGUNLIMITED = "_edu.ucar.isunlimited"; - - - protected DapContext context = null; - protected DapDataset dmr = null; - protected String location = null; - private ByteOrder order = null; - private ChecksumMode checksummode = ChecksumMode.DAP; - - protected Map variables = new HashMap<>(); - protected DataCursor rootcursor = null; - - ////////////////////////////////////////////////// - // Constructor(s) - - public AbstractDSP() /* must have a parameterless constructor */ - {} - - ////////////////////////////////////////////////// - // DSP Interface - - // Subclass defined - - /** - * "open" a reference to a data source and return the DSP wrapper. - * - * @param location - Object that defines the data source - * @return = wrapping dsp - * @throws DapException - */ - @Override - public abstract AbstractDSP open(String location) throws DapException; - - /** - * @throws IOException - */ - public abstract void close() throws IOException; - - ////////////////////////////////////////////////// - // Implemented - - @Override - public DataCursor getVariableData(DapVariable var) throws DapException { - return this.variables.get(var); - } - - @Override - public DapContext getContext() { - return this.context; - } - - @Override - public String getLocation() { - return this.location; - } - - @Override - public AbstractDSP setLocation(String loc) { - this.location = loc; - return this; - } - - @Override - public DapDataset getDMR() { - return this.dmr; - } - - // DSP Extensions - - @Override - public void setContext(DapContext context) { - this.context = context; - // Extract some things from the context - Object o = this.context.get(Dap4Util.DAP4ENDIANTAG); - if (o != null) - setOrder((ByteOrder) o); - o = this.context.get(Dap4Util.DAP4CSUMTAG); - if (o != null) - setChecksumMode(ChecksumMode.modeFor(o.toString())); - } - - public void setDMR(DapDataset dmr) { - this.dmr = dmr; - if (getDMR() != null) { - // Add some canonical attributes to the - getDMR().setDataset(getDMR()); - getDMR().setDapVersion(DAPVERSION); - getDMR().setDMRVersion(DMRVERSION); - getDMR().setNS(DMRNS); - } - } - - protected void setDataset(DapDataset dataset) throws DapException { - this.dmr = dataset; - } - - public ByteOrder getOrder() { - return this.order; - } - - public AbstractDSP setOrder(ByteOrder order) { - this.order = order; - return this; - } - - public ChecksumMode getChecksumMode() { - return this.checksummode; - } - - public AbstractDSP setChecksumMode(ChecksumMode mode) { - if (mode != null) - this.checksummode = mode; - return this; - } - - public void addVariableData(DapVariable var, DataCursor cursor) { - this.variables.put(var, cursor); - } - - ////////////////////////////////////////////////// - // Utilities - - /** - * It is common to want to parse a DMR text to a DapDataset, - * so provide this utility. - * - * @param document the dmr to parse - * @return the parsed dmr - * @throws DapException on parse errors - */ - - protected DapDataset parseDMR(String document) throws DapException { - // Parse the dmr - Dap4Parser parser; - // if(USEDOM) - parser = new DOM4Parser(null); - // else - // parser = new DOM4Parser(new DefaultDMRFactory()); - if (PARSEDEBUG) - parser.setDebugLevel(1); - try { - if (!parser.parse(document)) - throw new DapException("DMR Parse failed"); - } catch (SAXException se) { - throw new DapException(se); - } - if (parser.getErrorResponse() != null) - throw new DapException("Error Response Document not supported"); - DapDataset result = parser.getDMR(); - processAttributes(result); - return result; - } - - /** - * Walk the dataset tree and remove selected attributes - * such as _Unsigned - * - * @param dataset - */ - protected void processAttributes(DapDataset dataset) throws DapException { - List nodes = dataset.getNodeList(); - for (DapNode node : nodes) { - switch (node.getSort()) { - case GROUP: - case DATASET: - case VARIABLE: - Map attrs = node.getAttributes(); - if (attrs.size() > 0) { - List suppressed = new ArrayList<>(); - for (DapAttribute dattr : attrs.values()) { - if (suppress(dattr.getShortName())) - suppressed.add(dattr); - } - for (DapAttribute dattr : suppressed) { - node.removeAttribute(dattr); - } - } - break; - default: - break; /* ignore */ - } - } - // Try to extract the byte order - getEndianAttribute(dataset); - } - - /** - * Some attributes that are added by the NetcdfDataset - * need to be kept out of the DMR. This function - * defines that set. - * - * @param attrname A non-escaped attribute name to be tested for suppression - * @return true if the attribute should be suppressed, false otherwise. - */ - - protected boolean suppress(String attrname) { - if (attrname.startsWith("_Coord")) - return true; - if (attrname.equals("_Unsigned")) - return true; - return false; - } - - void getEndianAttribute(DapDataset dataset) { - DapAttribute a = dataset.findAttribute(DapUtil.LITTLEENDIANATTRNAME); - if (a == null) - this.order = (ByteOrder.LITTLE_ENDIAN); - else { - Object v = a.getValues(); - int len = java.lang.reflect.Array.getLength(v); - if (len == 0) - this.order = (ByteOrder.nativeOrder()); - else { - String onezero = java.lang.reflect.Array.get(v, 0).toString(); - int islittle = 1; - try { - islittle = Integer.parseInt(onezero); - } catch (NumberFormatException e) { - islittle = 1; - } - if (islittle == 0) - this.order = (ByteOrder.BIG_ENDIAN); - else - this.order = (ByteOrder.LITTLE_ENDIAN); - } - } - } - - public static String printDMR(DapDataset dmr) { - StringWriter sw = new StringWriter(); - PrintWriter pw = new PrintWriter(sw); - DMRPrinter printer = new DMRPrinter(dmr, pw); - try { - printer.print(); - pw.close(); - sw.close(); - } catch (IOException e) { - } - return sw.toString(); - } - -} diff --git a/dap4/d4lib/src/main/java/dap4/dap4lib/ChunkInputStream.java b/dap4/d4lib/src/main/java/dap4/dap4lib/ChunkInputStream.java deleted file mode 100644 index bb03247809..0000000000 --- a/dap4/d4lib/src/main/java/dap4/dap4lib/ChunkInputStream.java +++ /dev/null @@ -1,336 +0,0 @@ -/* - * Copyright 2012, UCAR/Unidata. - * See the LICENSE file for more information. - */ - -package dap4.dap4lib; - -import dap4.core.util.DapException; -import dap4.core.util.DapUtil; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.nio.ByteBuffer; -import java.nio.ByteOrder; - -/** - * This class wraps a chunked source of databuffer - * as an InputStream. It is mostly pass-thru - * in the sense that reads on this class are - * turned into a series of reads of the underlying stream. - */ - -public class ChunkInputStream extends InputStream { - ////////////////////////////////////////////////// - // Constants - - static final int DFALTCHUNKSIZE = 0x00FFFFFF; - - static final byte CR8 = DapUtil.extract(DapUtil.UTF8.encode("\r"))[0]; - static final byte LF8 = DapUtil.extract(DapUtil.UTF8.encode("\n"))[0]; - - ////////////////////////////////////////////////// - // Type Decls - - ////////////////////////////////////////////////// - // static variables - - ////////////////////////////////////////////////// - // static methods - - ////////////////////////////////////////////////// - // Type declarations - - enum State { - ERROR, // after error chunk - END, // after last databuffer chunk - DATA, // when at start of a databuffer chunk - INDATA, // when reading a databuffer chunk - INITIAL; // before anything is written - } - - ////////////////////////////////////////////////// - // Instance variable - - protected InputStream input = null; - protected State state = State.INITIAL; - protected RequestMode requestmode = null; - - protected ByteOrder localorder = null; - protected ByteOrder remoteorder = null; - protected boolean nochecksum = false; - - // State info for current chunk - protected int flags = 0; - protected int chunksize = 0; - protected int avail = 0; - - - ////////////////////////////////////////////////// - // Constructor(s) - - public ChunkInputStream(InputStream input, RequestMode requestmode) { - this(input, requestmode, ByteOrder.nativeOrder()); - } - - public ChunkInputStream(InputStream input, RequestMode requestmode, ByteOrder order) { - this.input = input; - this.requestmode = requestmode; - this.localorder = order; - } - - ////////////////////////////////////////////////// - // Accessors - - public ByteOrder getHostByteOrder() { - return this.localorder; - } - - public ByteOrder getRemoteByteOrder() { - return this.remoteorder; - } - - public boolean getNoChecksum() { - return this.nochecksum; - } - - ////////////////////////////////////////////////// - - /** - * Read the DMR, trimmed. - * - * @return the DMR as a Java String - */ - - public String readDMR() throws DapException { - try { - if (state != State.INITIAL) - throw new DapException("Attempt to read DMR twice"); - - byte[] dmr8 = null; - - if (requestmode == RequestMode.DMR) { - // The whole buffer is the dmr; - // but we do not know the length - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - int c; - while ((c = input.read()) >= 0) { - baos.write(c); - } - baos.close(); - dmr8 = baos.toByteArray(); - } else if (requestmode == RequestMode.DAP) { - // Pull in the DMR chunk header - if (!readHeader(input)) - throw new DapException("Malformed chunk count"); - // Read the DMR databuffer - dmr8 = new byte[this.chunksize]; - int red = read(dmr8, 0, this.chunksize); - if (red < this.chunksize) - throw new DapException("Short chunk"); - } else - assert false : "Internal error"; - - // Convert DMR to a string - String dmr = new String(dmr8, DapUtil.UTF8); - // Clean it up - dmr = dmr.trim(); - // Make sure it has trailing \r\n" - if (dmr.endsWith("\r\n")) { - // do nothing - } else if (dmr.endsWith("\n")) - dmr = dmr.substring(0, dmr.length() - 2) + "\r\n"; - else - dmr = dmr + "\r\n"; - - // Figure out the endian-ness of the response - this.remoteorder = (flags & DapUtil.CHUNK_LITTLE_ENDIAN) == 0 ? ByteOrder.BIG_ENDIAN : ByteOrder.LITTLE_ENDIAN; - this.nochecksum = (flags & DapUtil.CHUNK_NOCHECKSUM) != 0; - - // Set the state - if ((flags & DapUtil.CHUNK_ERROR) != 0) - state = State.ERROR; - else if ((flags & DapUtil.CHUNK_END) != 0) - state = State.END; - else - state = State.DATA; - return dmr; // return the DMR - - } catch (IOException ioe) { - throw new DapException(ioe.getMessage()); - } - } - - /** - * Convert an error chunk to an exception - * - * @param document XML representation of the error - * @throws DapException containing the contents of the error chunk - */ - public void throwError(String document) throws ErrorException { - throw new ErrorException("Error chunk encountered").setDocument(document); - } - - /** - * Read an error chunk - * - * @return the error document as a string - */ - public String readError() throws IOException { - state = State.ERROR; - // Read the error body databuffer - byte[] bytes = new byte[this.chunksize]; - try { - if (read(bytes, 0, this.chunksize) < this.chunksize) - throw new ErrorException("Short chunk"); - } catch (IOException ioe) { - throw new ErrorException(ioe); - } - String document = new String(bytes, DapUtil.UTF8); - return document; - } - - ////////////////////////////////////////////////// - // InputStream abstract methods - - /** - * Reads the next byte of databuffer from the input stream. The value byte is - * returned as an int in the range 0 to - * 255. If no byte is available because the end of the stream - * has been reached, the value -1 is returned. This method - * blocks until input databuffer is available, the end of the stream is detected, - * or an exception is thrown. - *

- * Operates by loading chunk by chunk. If an error chunk is detected, - * then return ErrorException (which is a subclass of IOException). - * - * @return the next byte of databuffer, or -1 if the end of the - * stream is reached. - * @throws IOException if an I/O error occurs. - */ - public int read() throws IOException { - if (requestmode == RequestMode.DMR) - throw new UnsupportedOperationException("Attempt to read databuffer when DMR only"); // Runtime - if (avail <= 0) { - if ((flags & DapUtil.CHUNK_END) != 0) - return -1; // Treat as EOF - if (!readHeader(input)) - return -1; // EOF - // See if we have an error chunk, - // and if so, turn it into an exception - if ((flags & DapUtil.CHUNK_ERROR) != 0) { - String document = readError(); - throwError(document); - } - } - avail--; - return input.read(); - } - - ////////////////////////////////////////////////// - // InputStream method overrides - - /** - * Reads up to len databuffer of databuffer from the input stream into an - * array of databuffer. An attempt is made to read as many as len - * databuffer, but a smaller number may be read. The number of databuffer - * actually read is returned as an integer. - * - * @param buf the byte array into which databuffer is read - * @param off the offset in the byte array at which to write - * @param len the amount to read - * @return the actual number of databuffer read - * @throws IOException - */ - - public int read(byte[] buf, int off, int len) throws IOException { - // Sanity check - if (off < 0 || len < 0) - throw new IndexOutOfBoundsException();// Runtime - if (off >= buf.length || buf.length < (off + len)) - throw new IndexOutOfBoundsException(); // Runtime - if (requestmode == RequestMode.DMR) - throw new UnsupportedOperationException("Attempt to read databuffer when DMR only"); // Runtime - - // Attempt to read len bytes out of a sequence of chunks - int count = len; - int pos = off; - while (count > 0) { - if (avail <= 0) { - if ((flags & DapUtil.CHUNK_END) != 0 || !readHeader(input)) - return (len - count); // return # databuffer read - // See if we have an error chunk, - // and if so, turn it into an exception - if ((flags & DapUtil.CHUNK_ERROR) != 0) { - String document = readError(); - throwError(document); - } - } else { - int actual = (this.avail < count ? this.avail : count); - int red = input.read(buf, pos, actual); - if (red < 0) - throw new IOException("Unexpected EOF"); - pos += red; - count -= red; - this.avail -= red; - } - } - return len; - } - - /** - * Returns an estimate of the number of databuffer that can be read - * (or skipped over) from this input stream without - * blocking by the next invocation of a method for this - * input stream. - *

- * Repurposed here to do equivalent of peek(). - * - * @return 0 if at eof, some number > 0 otherwise. - */ - - public int available() { - if (this.avail > 0) - return this.avail; - if ((flags & DapUtil.CHUNK_END) != 0) - return 0; - return 1; // should be some unknown amount left. - } - - /** - * Closes this output stream and releases any system resources - * associated with this stream. The underlying servlet stream is - * not closed; that is left to the level above. - */ - - public void close() throws IOException { - state = State.END; - } - - ////////////////////////////////////////////////// - // Utilities - - /** - * Read the size+flags header from the input stream and use it to - * initialize the chunk state - * - * @param input The input streamfrom which to read - * @return true if header read false if immediate eof encountered - */ - - boolean readHeader(InputStream input) throws IOException { - byte[] bytehdr = new byte[4]; - int red = input.read(bytehdr); - if (red == -1) - return false; - if (red < 4) - throw new IOException("Short binary chunk count"); - this.flags = ((int) bytehdr[0]) & 0xFF; // Keep unsigned - bytehdr[0] = 0; - ByteBuffer buf = ByteBuffer.wrap(bytehdr).order(ByteOrder.BIG_ENDIAN); - this.chunksize = buf.getInt(); - this.avail = this.chunksize; - return true; - } - -} diff --git a/dap4/d4lib/src/main/java/dap4/dap4lib/DSPPrinter.java b/dap4/d4lib/src/main/java/dap4/dap4lib/DSPPrinter.java deleted file mode 100644 index daa41e15a8..0000000000 --- a/dap4/d4lib/src/main/java/dap4/dap4lib/DSPPrinter.java +++ /dev/null @@ -1,382 +0,0 @@ -/* - * Copyright 2012, UCAR/Unidata. - * See the LICENSE file for more information. - */ -package dap4.dap4lib; - -import dap4.core.ce.CEConstraint; -import dap4.core.data.DSP; -import dap4.core.data.DataCursor; -import dap4.core.dmr.*; -import dap4.core.util.*; -import java.io.PrintWriter; -import java.io.Writer; -import java.lang.reflect.Array; -import java.math.BigInteger; -import java.nio.ByteBuffer; -import java.util.EnumSet; -import java.util.List; - -/** - * DAP DSP Printer. - * Given a constraint and a DSP print the constrained - * subset of the data in text form. - */ - -public class DSPPrinter { - ////////////////////////////////////////////////// - // Printer Control flags - - public enum Flags { - CONTROLCHAR; - } - - ////////////////////////////////////////////////// - // Constants - - protected static final int COLUMNS = 8; - - protected static final char LPAREN = '('; - protected static final char RPAREN = ')'; - protected static final char LBRACE = '{'; - protected static final char RBRACE = '}'; - protected static final char LBRACKET = '['; - protected static final char RBRACKET = ']'; - - // Could use enumset, but it is so ugly, - // so use good old OR'able flags - protected static final int NILFLAGS = 0; - protected static final int PERLINE = 1; // print xml attributes 1 per line - protected static final int NONAME = 2; // do not print name xml attribute - protected static final int NONNIL = 4; // print empty xml attributes - - ////////////////////////////////////////////////// - // Instance variables - - protected PrintWriter writer = null; - protected IndentWriter printer = null; - - protected DSP dsp = null; - protected CEConstraint ce = null; - - protected EnumSet flags = EnumSet.noneOf(Flags.class); - - ////////////////////////////////////////////////// - // Constructor(s) - - protected DSPPrinter() {} - - public DSPPrinter(DSP dsp, Writer writer) { - this(dsp, null, writer); - } - - public DSPPrinter(DSP dsp, CEConstraint ce, Writer writer) { - this.dsp = dsp; - this.ce = ce; - this.writer = new PrintWriter(writer); - this.printer = new IndentWriter(this.writer); - } - - ////////////////////////////////////////////////// - // External API - - public DSPPrinter flag(Flags flag) { - this.flags.add(flag); - return this; - } - - public DSPPrinter flush() { - this.printer.flush(); - return this; - } - - public DSPPrinter close() { - this.flush(); - return this; - } - - /** - * Print data from a DSP - * - optionally constrained - * - * @throws DapException - */ - - public DSPPrinter print() throws DapException { - DapDataset dmr = this.dsp.getDMR(); - if (this.ce == null) - this.ce = CEConstraint.getUniversal(dmr); - this.printer.setIndent(0); - List topvars = dmr.getTopVariables(); - for (int i = 0; i < topvars.size(); i++) { - DapVariable top = topvars.get(i); - List slices = this.ce.getConstrainedSlices(top); - if (this.ce.references(top)) { - DataCursor data = dsp.getVariableData(top); - printVariable(data, slices); - } - } - printer.eol(); - return this; - } - - ////////////////////////////////////////////////// - - /** - * Print an arbitrary DataVariable using a constraint. - *

- * Handling newlines is a bit tricky - * so the rule is that the - * last newline is elided and left - * for the caller to print. - * Exceptions: ? - * - * @param data - the cursor to print - * @throws DapException Note that the PrintWriter and CEConstraint are global. - */ - - protected void printVariable(DataCursor data, List slices) throws DapException { - DapVariable dapv = (DapVariable) data.getTemplate(); - if (data.isScalar()) { - assert slices == Slice.SCALARSLICES; - printScalar(data); - } else {// not scalar - printArray(data, slices); - } - } - - protected void printScalar(DataCursor data) throws DapException { - DapVariable dapv = (DapVariable) data.getTemplate(); - printer.marginPrint(dapv.getFQN() + " = "); - switch (data.getScheme()) { - case ATOMIC: - printAtomicInstance(data, Index.SCALAR); - break; - case STRUCTARRAY: - case SEQARRAY: // remember that scalars are treated as 1-element arrays - DataCursor[] scalar = (DataCursor[]) data.read(Index.SCALAR); - assert scalar.length == 1; - data = scalar[0]; // fall thru - case STRUCTURE: - case SEQUENCE: - case RECORD: - printer.marginPrint("{"); - printer.eol(); - printer.indent(); - printCompoundInstance(data); - printer.outdent(); - printer.marginPrint("}"); - printer.eol(); - break; - default: - throw new DapException("Unexpected data cursor type: " + data.getScheme()); - } - } - - protected void printArray(DataCursor data, List slices) throws DapException { - DapVariable dapv = (DapVariable) data.getTemplate(); - Odometer odom = Odometer.factory(slices); - switch (data.getScheme()) { - case ATOMIC: - if (DapUtil.isContiguous(slices)) - printAtomicVector(data, slices, odom); - else { - while (odom.hasNext()) { - Index pos = odom.next(); - String s = indicesToString(pos); - printer.marginPrint(dapv.getFQN() + s + " = "); - printAtomicInstance(data, pos); - } - } - break; - case STRUCTARRAY: - case SEQARRAY: - DapStructure ds = (DapStructure) ((DapVariable) data.getTemplate()).getBaseType(); - DataCursor[] instances = (DataCursor[]) data.read(slices); - while (odom.hasNext()) { - Index pos = odom.next(); - String s = indicesToString(pos); - printer.marginPrint(ds.getFQN() + s + " = {"); - printer.eol(); - printer.indent(); - printCompoundInstance(instances[(int) pos.index()]); - printer.outdent(); - printer.marginPrint("}"); - printer.eol(); - } - break; - default: - throw new DapException("Unexpected data cursor type: " + data.getScheme()); - } - } - - protected void printAtomicVector(DataCursor data, List slices, Odometer odom) throws DapException { - assert data.getScheme() == DataCursor.Scheme.ATOMIC; - Object values = data.read(slices); - DapVariable atom = (DapVariable) data.getTemplate(); - String name = atom.getFQN(); - if (Array.getLength(values) == 0) {// zero length case - printer.marginPrint(name + " = "); - printer.eol(); - } else - for (int i = 0; odom.hasNext(); i++) { - Index index = odom.next(); - String prefix = (odom.rank() == 0 ? name : name + indicesToString(index)); - printer.marginPrint(prefix + " = "); - printer.print(valueString(values, i, atom.getBaseType())); - printer.eol(); - } - } - - protected void printAtomicInstance(DataCursor datav, Index pos) throws DapException { - assert datav.getScheme() == DataCursor.Scheme.ATOMIC; - Object value = datav.read(pos); - DapVariable av = (DapVariable) datav.getTemplate(); - printer.print(valueString(value, 0, av.getBaseType())); - printer.eol(); - } - - /** - * Print a single structure or sequence or record instance - * - * @param datav - * @throws DapException - */ - protected void printCompoundInstance(DataCursor datav) throws DapException { - // Index index = datav.getIndex(); - DapStructure dstruct = (DapStructure) ((DapVariable) datav.getTemplate()).getBaseType(); - switch (datav.getScheme()) { - case STRUCTURE: - case RECORD: - List dfields = dstruct.getFields(); - for (int f = 0; f < dfields.size(); f++) { - DapVariable field = dfields.get(f); - List fieldslices = this.ce.getConstrainedSlices(field); - DataCursor fdata = datav.readField(f); - printVariable(fdata, fieldslices); - } - break; - - case SEQUENCE: - DapSequence dseq = (DapSequence) dstruct; - long count = datav.getRecordCount(); - for (long r = 0; r < count; r++) { - DataCursor dr = datav.readRecord(r); - printer.marginPrint("["); - printer.eol(); - printer.indent(); - printCompoundInstance(dr); - printer.outdent(); - printer.marginPrint("]"); - } - break; - default: - throw new DapException("Unexpected data cursor scheme:" + datav.getScheme()); - } - } - - protected String indicesToString(Index indices) throws DapException { - StringBuilder buf = new StringBuilder(); - if (indices != null && indices.getRank() > 0) { - for (int i = 0; i < indices.getRank(); i++) { - buf.append(i == 0 ? LBRACKET : ","); - buf.append(String.format("%d", indices.get(i))); - } - buf.append(RBRACKET); - } - return buf.toString(); - } - - protected String valueString(Object vector, long pos, DapType basetype) throws DapException { - if (vector == null) - return "null"; - TypeSort atype = basetype.getTypeSort(); - boolean unsigned = atype.isUnsigned(); - int ipos = (int) pos; - switch (atype) { - case Int8: - case UInt8: - long lvalue = ((byte[]) vector)[ipos]; - if (unsigned) - lvalue &= 0xFFL; - return String.format("%d", lvalue); - case Int16: - case UInt16: - lvalue = ((short[]) vector)[ipos]; - if (unsigned) - lvalue &= 0xFFFFL; - return String.format("%d", lvalue); - case Int32: - case UInt32: - lvalue = ((int[]) vector)[ipos]; - if (unsigned) - lvalue &= 0xFFFFFFFFL; - return String.format("%d", lvalue); - case Int64: - case UInt64: - lvalue = ((long[]) vector)[ipos]; - if (unsigned) { - BigInteger b = BigInteger.valueOf(lvalue); - b = b.and(DapUtil.BIG_UMASK64); - return b.toString(); - } else - return String.format("%d", lvalue); - case Float32: - return String.format("%f", ((float[]) vector)[ipos]); - case Float64: - return String.format("%f", ((double[]) vector)[ipos]); - case Char: - return String.format("'%c'", ((char[]) vector)[ipos]); - case String: - case URL: - String s = (((String[]) vector)[ipos]); - if (flags.contains(Flags.CONTROLCHAR)) { - s = s.replace("\r", "\\r"); - s = s.replace("\n", "\\n"); - s = s.replace("\t", "\\t"); - } - return "\"" + s + "\""; - case Opaque: - ByteBuffer opaque = ((ByteBuffer[]) vector)[ipos]; - StringBuilder buf = new StringBuilder(); - buf.append("0x"); - for (int i = 0; i < opaque.limit(); i++) { - byte b = opaque.get(i); - char c = hexchar((b >> 4) & 0xF); - buf.append(c); - c = hexchar((b) & 0xF); - buf.append(c); - } - return buf.toString(); - case Enum: - DapEnumeration de = (DapEnumeration) basetype; - Object newvec = CoreTypeFcns.createVector(de.getBaseType().getTypeSort(), 1); - Object v = java.lang.reflect.Array.get(vector, ipos); - java.lang.reflect.Array.set(newvec, 0, v); - long[] lv = (long[]) Convert.convert(DapType.INT64, de, newvec); - DapEnumConst dec = de.lookup(lv[0]); - return dec.getShortName(); - default: - break; - } - throw new DapException("Unknown type: " + basetype); - } - - - ////////////////////////////////////////////////// - // Misc. Utilities - - protected static char hexchar(int i) { - return "0123456789ABCDEF".charAt((i & 0xF)); - } - - - protected static String getPrintValue(Object value) { - if (value instanceof String) { - return Escape.entityEscape((String) value, null); - } else - return value.toString(); - } - -} - diff --git a/dap4/d4lib/src/main/java/dap4/dap4lib/Dap4Util.java b/dap4/d4lib/src/main/java/dap4/dap4lib/Dap4Util.java deleted file mode 100644 index 557a1ba76b..0000000000 --- a/dap4/d4lib/src/main/java/dap4/dap4lib/Dap4Util.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2012, UCAR/Unidata. - * See the LICENSE file for more information. - */ - -package dap4.dap4lib; - -/** - * Constants and utilities - * either top-level or for a member. - */ - -public abstract class Dap4Util { - ///////////////////////////////////////////////////// - // Constants - - public static final String DAP4ENDIANTAG = "ucar.littleendian"; // value = 1 | 0 - public static final String DAP4CSUMTAG = "ucar.checksummode"; // value = NONE|DAP|DMR|ALL - public static final String DAP4TESTTAG = "ucar.testing"; // value = NONE|DAP|DMR|ALL - - ////////////////////////////////////////////////// - // Static utility methods - - -} diff --git a/dap4/d4lib/src/main/java/dap4/dap4lib/DapProtocol.java b/dap4/d4lib/src/main/java/dap4/dap4lib/DapProtocol.java deleted file mode 100644 index 8436fa464d..0000000000 --- a/dap4/d4lib/src/main/java/dap4/dap4lib/DapProtocol.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright 2012, UCAR/Unidata. - * See the LICENSE file for more information. - */ - -package dap4.dap4lib; - -import dap4.core.util.DapException; -import dap4.core.util.ResponseFormat; -import java.util.HashMap; -import java.util.Map; - -/** - * Store protocol related constants - */ - -public abstract class DapProtocol implements DapCodes { - public static final String X_DAP_SERVER = "TDS-4"; - public static final String X_DAP_VERSION = "4.0"; - - public static final String CONSTRAINTTAG = "dap4.ce"; - - public static Map contenttypes; - - static { - contenttypes = new HashMap(); - contenttypes.put(RequestMode.DMR, new ContentType(RequestMode.DMR, - "application/vnd.opendap.dap4.dataset-metadata+xml", "text/xml", "text/plain", "text/html")); - contenttypes.put(RequestMode.DAP, - new ContentType(RequestMode.DAP, "application/vnd.opendap.dap4.data", "text/xml", "text/plain", "text/html")); - contenttypes.put(RequestMode.DSR, new ContentType(RequestMode.DSR, - "application/vnd.opendap.dap4.dataset-services+xml", "text/xml", "text/plain", "text/html")); - contenttypes.put(RequestMode.CAPABILITIES, - new ContentType(RequestMode.CAPABILITIES, "text/xml", "text/xml", "text/plain", "text/html")); - contenttypes.put(RequestMode.ERROR, new ContentType(RequestMode.ERROR, "application/vnd.opendap.dap4.error+xml", - "text/xml", "text/plain", "text/html")); - } - - ////////////////////////////////////////////////// - - public static class ContentType { - public RequestMode mode; - public String contenttype; - public String xmltype; - public String texttype; - public String htmltype; - - public ContentType(RequestMode mode, String contenttype, String xmltype, String texttype, String htmltype) { - this.mode = mode; - this.contenttype = contenttype; - this.xmltype = xmltype; - this.texttype = texttype; - this.htmltype = htmltype; - } - - public String getFormat(ResponseFormat format) throws DapException { - if (format == null) - format = ResponseFormat.NONE; - switch (format) { - case XML: - return xmltype; - case TEXT: - return texttype; - case HTML: - return htmltype; - case NONE: - return contenttype; - } - throw new DapException(String.format("Unsupported format request: %s for Mode %s", format, this.mode)) - .setCode(org.apache.http.HttpStatus.SC_BAD_REQUEST); - } - } - -} diff --git a/dap4/d4lib/src/main/java/dap4/dap4lib/FileDSP.java b/dap4/d4lib/src/main/java/dap4/dap4lib/FileDSP.java deleted file mode 100644 index 26f0bf061b..0000000000 --- a/dap4/d4lib/src/main/java/dap4/dap4lib/FileDSP.java +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Copyright 2012, UCAR/Unidata. - * See the LICENSE file for more information. - */ - -package dap4.dap4lib; - -import dap4.core.util.DapContext; -import dap4.core.util.DapException; -import dap4.core.util.DapUtil; -import dap4.dap4lib.serial.D4DSP; -import java.io.ByteArrayInputStream; -import java.io.FileInputStream; -import java.io.IOException; -import java.net.URISyntaxException; - -/** - * Provide a DSP interface to raw data - */ - -public class FileDSP extends D4DSP { - ////////////////////////////////////////////////// - // Constants - - protected static final String[] EXTENSIONS = new String[] {".dap", ".raw"}; - - ////////////////////////////////////////////////// - // Instance variables - - // Coverity[FB.URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD] - protected byte[] raw = null; // Complete serialized binary databuffer - - ////////////////////////////////////////////////// - // Constructor(s) - - public FileDSP() { - super(); - } - - ////////////////////////////////////////////////// - // DSP API - - /** - * A path is file if it has no base protocol or is file: - * - * @param location file:/ or possibly an absolute path - * @param context Any parameters that may help to decide. - * @return true if this path appears to be processible by this DSP - */ - public boolean dspMatch(String location, DapContext context) { - try { - XURI xuri = new XURI(location); - if (xuri.isFile()) { - String path = xuri.getPath(); - for (String ext : EXTENSIONS) { - if (path.endsWith(ext)) - return true; - } - } - } catch (URISyntaxException use) { - return false; - } - return false; - } - - @Override - public void close() {} - - @Override - public FileDSP open(String filepath) throws DapException { - try { - if (filepath.startsWith("file:")) - try { - XURI xuri = new XURI(filepath); - filepath = xuri.getPath(); - } catch (URISyntaxException use) { - throw new DapException("Malformed filepath: " + filepath).setCode(DapCodes.SC_NOT_FOUND); - } - try (FileInputStream stream = new FileInputStream(filepath)) { - this.raw = DapUtil.readbinaryfile(stream); - } - try (FileInputStream stream = new FileInputStream(filepath)) { // == rewind - ChunkInputStream rdr = new ChunkInputStream(stream, RequestMode.DAP); - String document = rdr.readDMR(); - byte[] serialdata = DapUtil.readbinaryfile(rdr); - super.build(document, serialdata, rdr.getRemoteByteOrder()); - } - return this; - } catch (IOException ioe) { - throw new DapException(ioe).setCode(DapCodes.SC_INTERNAL_SERVER_ERROR); - } - } - - ////////////////////////////////////////////////// - // Extension to access a raw byte stream - - public FileDSP open(byte[] rawdata) throws DapException { - try { - this.raw = rawdata; - ByteArrayInputStream stream = new ByteArrayInputStream(this.raw); - ChunkInputStream rdr = new ChunkInputStream(stream, RequestMode.DAP); - String document = rdr.readDMR(); - byte[] serialdata = DapUtil.readbinaryfile(rdr); - super.build(document, serialdata, rdr.getRemoteByteOrder()); - return this; - } catch (IOException ioe) { - throw new DapException(ioe).setCode(DapCodes.SC_INTERNAL_SERVER_ERROR); - } - } - -} diff --git a/dap4/d4lib/src/main/java/dap4/dap4lib/HttpDSP.java b/dap4/d4lib/src/main/java/dap4/dap4lib/HttpDSP.java deleted file mode 100644 index 1d27ca8e86..0000000000 --- a/dap4/d4lib/src/main/java/dap4/dap4lib/HttpDSP.java +++ /dev/null @@ -1,315 +0,0 @@ -/* - * Copyright 2012, UCAR/Unidata. - * See the LICENSE file for more information. - */ - -package dap4.dap4lib; - -import dap4.core.dmr.DapDataset; -import dap4.core.util.DapContext; -import dap4.core.util.DapDump; -import dap4.core.util.DapException; -import dap4.core.util.DapUtil; -import dap4.dap4lib.serial.D4DSP; -import org.apache.http.HttpStatus; -import ucar.httpservices.HTTPException; -import ucar.httpservices.HTTPFactory; -import ucar.httpservices.HTTPMethod; -import ucar.httpservices.HTTPUtil; -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.net.URI; -import java.net.URISyntaxException; - -/** - * Make a request to a server and convert the reply - * to a DapDataset from the returned bytes. - */ - -public class HttpDSP extends D4DSP { - - ////////////////////////////////////////////////// - // Constants - - protected static final boolean DEBUG = false; - - protected static final String DAPVERSION = "4.0"; - protected static final String DMRVERSION = "1.0"; - - protected static final String DAP4PROTO = "dap4"; - protected static final String FILEPROTO = "file"; - - protected static final String DMRSUFFIX = "dmr"; - protected static final String DATASUFFIX = "dap"; - protected static final String DSRSUFFIX = "dsr"; - - protected static final String QUERYSTART = "?"; - protected static final String CONSTRAINTTAG = "dap4.ce"; - protected static final String PROTOTAG = "protocol"; - - protected static final int DFALTPRELOADSIZE = 50000; // databuffer - - protected static final String[] DAPEXTENSIONS = new String[] {"dmr", "dap", "dds", "das", "ddx", "dods"}; - - protected static final String[] DAP4EXTENSIONS = new String[] {"dmr", "dap"}; - - protected static final String[][] DAP4QUERYMARKERS = new String[][] {{"proto", "dap4"}, {"dap4.ce", null},}; - protected static final String[][] DAP4FRAGMARKERS = new String[][] {{"protocol", "dap4"}, {"dap4", null},}; - - protected static final String[] DAP4SCHEMES = {"dap4", "http", "https"}; - - ////////////////////////////////////////////////// - // Instance variables - - protected boolean allowCompression = true; - protected String basece = null; // the constraint(s) from the original url - - protected int status = HttpStatus.SC_OK; // response - protected XURI xuri = null; - - protected Object context = null; - - ////////////////////////////////////////////////// - // Constructor(s) - - public HttpDSP() { - super(); - } - - ////////////////////////////////////////////////// - // DSP API - - /** - * A path is a DAP4 path if at least one of the following is true. - * 1. it has "dap4:" as its leading protocol - * 2. it has #protocol=dap4 in its fragment - * - * @param url - * @param context Any parameters that may help to decide. - * @return true if this url appears to be processible by this DSP - */ - public boolean dspMatch(String url, DapContext context) { - try { - XURI xuri = new XURI(url); - if (true) { - boolean found = false; - for (String scheme : DAP4SCHEMES) { - if (scheme.equalsIgnoreCase(xuri.getBaseProtocol()) || scheme.equalsIgnoreCase(xuri.getFormatProtocol())) { - found = true; - break; - } - } - if (!found) - return false; - // Might still be a non-dap4 url - String formatproto = xuri.getFormatProtocol(); - if (DAP4PROTO.equalsIgnoreCase(formatproto)) - return true; - for (String[] pair : DAP4QUERYMARKERS) { - String tag = xuri.getQueryFields().get(pair[0]); - if (tag != null && (pair[1] == null || pair[1].equalsIgnoreCase(tag))) - return true; - } - for (String[] pair : DAP4FRAGMARKERS) { - String tag = xuri.getFragFields().get(pair[0]); - if (tag != null && (pair[1] == null || pair[1].equalsIgnoreCase(tag))) - return true; - } - } else - return true; - } catch (URISyntaxException use) { - return false; - } - return false; - } - - @Override - public HttpDSP open(String url) throws DapException { - setLocation(url); - parseURL(url); - - /* - * Take from the incoming data - * String s = xuri.getFragFields().get(Dap4Util.DAP4CSUMTAG); - * ChecksumMode mode = ChecksumMode.modeFor(s); - * if(mode == null) - * throw new DapException(String.format("Illegal %s: %s",Dap4Util.DAP4CSUMTAG,s)); - * setChecksumMode(mode); - * s = xuri.getFragFields().get(Dap4Util.DAP4ENDIANTAG); - * Integer oz = DapUtil.stringToInteger(s); - * if(oz == null) - * throw new DapException(String.format("Illegal %s: %s",Dap4Util.DAP4ENDIANTAG,s)); - * ByteOrder order = (oz != 0 ? ByteOrder.LITTLE_ENDIAN : ByteOrder.BIG_ENDIAN); - * setOrder(order); - */ - - // See if this is a local vs remote request - this.basece = this.xuri.getQueryFields().get(CONSTRAINTTAG); - build(); - return this; - } - - @Override - public void close() {} - - ///////////////////////////////////////// - // AbstractDSP extensions - - /* - * @Override - * public String getPath() - * { - * return this.originalurl; - * } - */ - - ////////////////////////////////////////////////// - // Request/Response methods - - /** - * Open a connection and make a request for the (possibly constrained) DMR. - * - * @throws DapException - */ - - protected void build() throws DapException { - String methodurl = buildURL(this.xuri.assemble(XURI.URLONLY), DATASUFFIX, this.dmr, this.basece); - - InputStream stream; - // Make the request and return an input stream for accessing the databuffer - // Should fill in bigendian and stream fields - stream = callServer(methodurl); - - try { - ChunkInputStream reader; - if (DEBUG) { - byte[] raw = DapUtil.readbinaryfile(stream); - ByteArrayInputStream bis = new ByteArrayInputStream(raw); - DapDump.dumpbytestream(raw, getOrder(), "httpdsp.build"); - reader = new ChunkInputStream(bis, RequestMode.DAP, getOrder()); - } else { - // Wrap the input stream as a ChunkInputStream - reader = new ChunkInputStream(stream, RequestMode.DAP, getOrder()); - } - - // Extract and "compile" the server response - String document = reader.readDMR(); - // Extract all the remaining bytes - byte[] bytes = DapUtil.readbinaryfile(reader); - // use super.build to compile - super.build(document, bytes, getOrder()); - } catch (Throwable t) { - t.printStackTrace(); - throw new DapException(t); - } finally { - try { - stream.close(); - } catch (IOException ioe) { - /* ignore */} - } - } - - protected InputStream callServer(String methodurl) throws DapException { - URI uri; - - try { - uri = HTTPUtil.parseToURI(methodurl); - } catch (URISyntaxException mue) { - throw new DapException("Malformed url: " + methodurl); - } - - long start = System.currentTimeMillis(); - long stop = 0; - this.status = 0; - if (false) { - HTTPMethod method = null; // Implicitly passed out to caller via stream - try { // Note that we cannot use try with resources because we export the method stream, so method - // must not be closed. - method = HTTPFactory.Get(methodurl); - if (allowCompression) - method.setCompression("deflate,gzip"); - this.status = method.execute(); - if (this.status != HttpStatus.SC_OK) { - String msg = method.getResponseAsString(); - throw new DapException("Request failure: " + status + ": " + methodurl).setCode(status); - } - // Get the response body stream => do not close the method - return method.getResponseAsStream(); - } catch (HTTPException e) { - if (method != null) - method.close(); - throw new DapException(e); - } - } else {// read whole input - try { - try (HTTPMethod method = HTTPFactory.Get(methodurl)) { - if (allowCompression) - method.setCompression("deflate,gzip"); - this.status = method.execute(); - if (this.status != HttpStatus.SC_OK) { - String msg = method.getResponseAsString(); - throw new DapException("Request failure: " + status + ": " + methodurl).setCode(status); - } - byte[] body = method.getResponseAsBytes(); - return new ByteArrayInputStream(body); - } - } catch (HTTPException e) { - throw new DapException(e); - } - } - } - - /** - * Provide a method for getting the capabilities document. - * - * @param url for accessing the document - * @throws DapException - */ - - public String getCapabilities(String url) throws IOException { - // Save the original url - String saveurl = this.xuri.getOriginal(); - parseURL(url); - String fdsurl = buildURL(this.xuri.assemble(XURI.URLALL), DSRSUFFIX, null, null); - try { - // Make the request and return an input stream for accessing the databuffer - // Should fill in context bigendian and stream fields - InputStream stream = callServer(fdsurl); - // read the result, convert to string and return. - byte[] bytes = DapUtil.readbinaryfile(stream); - String document = new String(bytes, DapUtil.UTF8); - return document; - } finally { - parseURL(saveurl); - } - } - - ////////////////////////////////////////////////// - // Utilities - - protected static String buildURL(String baseurl, String suffix, DapDataset template, String ce) { - StringBuilder methodurl = new StringBuilder(); - methodurl.append(baseurl); - if (suffix != null) { - methodurl.append('.'); - methodurl.append(suffix); - } - if (ce != null && ce.length() > 0) { - methodurl.append(QUERYSTART); - methodurl.append(CONSTRAINTTAG); - methodurl.append('='); - methodurl.append(ce); - } - return methodurl.toString(); - } - - protected void parseURL(String url) throws DapException { - try { - this.xuri = new XURI(url); - } catch (URISyntaxException use) { - throw new DapException(use); - } - } - -} diff --git a/dap4/d4lib/src/main/java/dap4/dap4lib/XURI.java b/dap4/d4lib/src/main/java/dap4/dap4lib/XURI.java deleted file mode 100644 index 1fce4061d2..0000000000 --- a/dap4/d4lib/src/main/java/dap4/dap4lib/XURI.java +++ /dev/null @@ -1,319 +0,0 @@ -/* - * Copyright 2012, UCAR/Unidata. - * See the LICENSE file for more information. - */ - -package dap4.dap4lib; - -import dap4.core.util.DapUtil; -import dap4.core.util.Escape; -import java.net.URI; -import java.net.URISyntaxException; -import java.util.EnumSet; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * Provide an extended form of URI parser that can handle - * multiple protocols and can parse the query and fragment parts. - */ - -public class XURI { - - ////////////////////////////////////////////////// - // Constants - static final String QUERYSEP = "&"; - static final String FRAGMENTSEP = "&"; - - // Define assembly flags - - public static enum Parts { - FORMAT, // format protocol - BASE, // base protocol - PWD, // including user - HOST, // including port - PATH, QUERY, FRAG; - } - - // Mnemonics - public static final EnumSet URLONLY = EnumSet.of(Parts.BASE, Parts.PWD, Parts.HOST, Parts.PATH); - public static final EnumSet URLALL = - EnumSet.of(Parts.FORMAT, Parts.BASE, Parts.PWD, Parts.HOST, Parts.PATH, Parts.QUERY, Parts.FRAG); - public static final EnumSet URLBASE = - EnumSet.of(Parts.BASE, Parts.PWD, Parts.HOST, Parts.PATH, Parts.QUERY, Parts.FRAG); - public static final EnumSet URLPATH = EnumSet.of(Parts.PATH, Parts.QUERY, Parts.FRAG); - - ////////////////////////////////////////////////// - // Instance variables - - protected String originaluri = null; - protected boolean isfile = false; - - protected String baseprotocol = null; // rightmost protocol - protected String formatprotocol = null; // leftmost protocol - protected String userinfo = null; - protected String host = null; - protected String path = null; - protected String query = null; - protected String frag = null; - - // Following are url decoded - protected Map queryfields // decomposed query - = new HashMap(); - protected Map fragfields // decomposed fragment - = new HashMap(); - - ////////////////////////////////////////////////// - // Constructor - - public XURI(String xurl) throws URISyntaxException { - if (xurl == null) - throw new URISyntaxException(xurl, "Null URI"); - // save the original uri - this.originaluri = xurl; - // The uri may be multi-protocol: e.g. dap4:file:... - // Additionally, this may be a windows path, so it - // will look like it has a single character protocol - // that is really the drive letter. - - int[] breakpoint = new int[1]; - List protocols = DapUtil.getProtocols(xurl, breakpoint); // should handle drive letters also - String remainder = xurl.substring(breakpoint[0], xurl.length()); - switch (protocols.size()) { - case 0: // pretend it is a file - this.formatprotocol = "file"; - this.baseprotocol = "file"; - break; - case 1: - this.formatprotocol = protocols.get(0); - if ("file".equalsIgnoreCase(this.formatprotocol)) - this.baseprotocol = "file"; // default conversion - else - this.baseprotocol = "http"; // default conversion - break; - case 2: - this.baseprotocol = protocols.get(0); - this.formatprotocol = protocols.get(1); - break; - default: - throw new URISyntaxException(xurl, "Too many protocols: at most 2 allowed"); - } - this.isfile = "file".equals(this.baseprotocol); - // The standard URI parser does not handle 'file:' very well, - // so handle specially - URI uri; - if (this.isfile) - parsefile(remainder); - else - parsenonfile(remainder); // not a file: url - if (this.query != null) - parseQuery(this.query); - if (this.frag != null) - parseFragment(this.frag); - } - - protected void parsenonfile(String remainder) throws URISyntaxException { - // Construct a usable url and parse it - URI uri = new URI(baseprotocol + ":" + remainder); - // Extract the parts of the uri so they can - // be modified and later reassembled - this.userinfo = canonical(uri.getUserInfo()); - this.host = canonical(uri.getHost()); - if (uri.getPort() > 0) - this.host += (":" + uri.getPort()); - this.path = canonical(uri.getPath()); - // Parse the raw query (before decoding) - this.query = uri.getRawQuery(); - // Parse the raw fragment (before decoding) - this.frag = canonical(uri.getFragment()); - } - - protected void parsefile(String remainder) { - // Pull off the query and fragment parts, if any. - String query = null; - String fragment = null; - int qindex = remainder.indexOf("?"); - int findex = remainder.lastIndexOf("#"); - if (qindex >= 0) { // query and maybe fragment - if (findex >= 0 && findex > qindex) {// both - fragment = remainder.substring(findex + 1, remainder.length()); - remainder = remainder.substring(0, findex); - } - query = remainder.substring(qindex + 1, remainder.length()); - remainder = remainder.substring(0, qindex); - } else if (findex >= 0) { // fragment, no query - fragment = remainder.substring(findex + 1, remainder.length()); - remainder = remainder.substring(0, findex); - } - - // Standardize path part to be absolute - // => single leading '/' or windows drive letter - StringBuilder buf = new StringBuilder(remainder); - for (int i = 0; i < remainder.length(); i++) { // remove all leading '/' - if (buf.charAt(i) != '/') - break; - buf.deleteCharAt(i); - } - // check for drive letter - if (DapUtil.DRIVELETTERS.indexOf(buf.charAt(0)) < 0 || buf.charAt(1) != ':') { // no drive letter, prepend '/' - buf.insert(0, '/'); - } - - remainder = buf.toString(); - this.path = remainder; - this.frag = fragment; - this.query = query; - } - - ////////////////////////////////////////////////// - // Accessors - - public String getOriginal() { - return originaluri; - } - - public String getBaseProtocol() { - return baseprotocol; - } - - public String getFormatProtocol() { - return this.formatprotocol; - } - - public void setBaseProtocol(String base) { - this.baseprotocol = base; - } - - public boolean isFile() { - return this.isfile; - } - - public String getUserinfo() { - return this.userinfo; - } - - public String getHost() { - return this.host; - } - - public String getPath() { - return this.path; - } - - public String getQuery() { - return this.query; - } - - public String getFrag() { - return this.frag; - } - - public Map getQueryFields() { - return this.queryfields; - } - - public Map getFragFields() { - return this.fragfields; - } - - public XURI parseQuery(String q) { - if (q == null || q.length() == 0) - return this; - String[] params = q.split(QUERYSEP); - this.query = q; - for (String param : params) { - String[] pair = param.split("[=]"); - String name = Escape.urlDecode(pair[0]); - name = name.toLowerCase(); // for consistent lookup - String value = ""; - if (pair.length > 1) { - value = Escape.urlDecode(pair[1]); - this.queryfields.put(name, value); - } - } - return this; - } - - public XURI parseFragment(String f) { - if (f == null || f.length() == 0) - return this; - String[] params = f.split(FRAGMENTSEP); - if (params != null && params.length > 0) { - this.frag = f; - for (String param : params) { - String[] pair = param.split("="); - String name = Escape.urlDecode(pair[0]); - name = name.toLowerCase(); // for consistent lookup - String value = (pair.length == 2 ? Escape.urlDecode(pair[1]) : ""); - this.fragfields.put(name, value); - } - } - return this; - } - - ////////////////////////////////////////////////// - // API - - /** - * Reassemble the url using the specified parts - * - * @param parts to include - * @return the assembled uri - */ - - public String assemble(EnumSet parts) { - StringBuilder uri = new StringBuilder(); - // Note that format and base may be same, so case it out - int useformat = (parts.contains(Parts.FORMAT) ? 1 : 0); - int usebase = (parts.contains(Parts.BASE) ? 2 : 0); - switch (useformat + usebase) { - case 0 + 0: // neither - break; - case 1 + 0: // FORMAT only - uri.append(this.formatprotocol + ":"); - break; - case 2 + 0: // BASE only - uri.append(this.baseprotocol + ":"); - break; - case 2 + 1: // both - uri.append(this.formatprotocol + ":"); - if (!this.baseprotocol.equals(this.formatprotocol)) - uri.append(this.formatprotocol + ":"); - break; - } - uri.append(this.baseprotocol.equals("file") ? "/" : "//"); - - if (userinfo != null && parts.contains(Parts.PWD)) - uri.append(this.userinfo + ":"); - if (this.host != null && parts.contains(Parts.HOST)) - uri.append(this.host); - if (this.path != null && parts.contains(Parts.PATH)) - uri.append(this.path); - if (this.query != null && parts.contains(Parts.QUERY)) - uri.append("?" + this.query); - if (this.frag != null && parts.contains(Parts.FRAG)) - uri.append("#" + this.frag); - return uri.toString(); - } - - - /** - * Canonicalize a part of a URL - * - * @param s part of the url - */ - public static String canonical(String s) { - if (s != null) { - s = s.trim(); - if (s.length() == 0) - s = null; - } - return s; - } - - public String toString() { - return originaluri; - } -} - diff --git a/dap4/d4lib/src/main/java/dap4/dap4lib/keep.jar b/dap4/d4lib/src/main/java/dap4/dap4lib/keep.jar deleted file mode 100644 index deb03e6d004d5c720a81e2a8f3ecc23fc4603c98..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 38155 zcma&NW0WXcvn5)#ZQHhO+qUgpwzTuKW`-R?e6a zGZdtOL7)HtAOHY@9E&9Y{tyq-utuNhVF zP&SyQw(1Plg1Ni>JIKS>q2 zY6(+Zg&<{{w*n?e^`hyVs0C`nW?r>FEZ-xH(DjD#nzrp6WYqt=3fs0!9c707OlS%X z9ieN`!B9dB@7?X|_yt0zU0-^za@LANv->pb)yR2f?267a-c&zk zZO(D2#3$n;dyv$w>a(WkB(i6brgR4M1skP(|%e}{@RW!2H}Nfni6A7 z_JVH%;DzemNlc zi&`_sI@vD)n|{cjq8Yx`*ligWLz z@>AC6A0zAFK-Sz(J7(;XdI%o*rI>{!=(grR*-?^rk$EfM(X7y_d#2~Wi-FZtmHYK6 zgwq^?i#1gJ0qRp25HGFFmtZtfA*@nNbJ^YGwNbDoKi$t}3~8aik03UA;TMV7v=E&J z2HqsOFG@Ch{B0_!I2Iihf%1<>A##^@#^{t%bL==Nd6^EC&BD?#VNoKl*UDX^*tEXR znNfd^*IbTW2TFla4L^Z5hS@k$uM1Bq?6d}MSg>BGI$Om~skqXDJ4|rAn`$R%t!SaH zjIXf`DFQmRiHl>0B}uT#mlsse!*@YN(y9R&Hp%yp&f@djp?Js@A(7I&r*-j*yH1xg zsde+f4D)g+$;$T8JuAM9Wyc zdBP%6Uv|^pjL^s=UmroI_>3&f%S=)PUt!o0la%Ha^j7QG`z=SiyO_A`Prrcw$*3Kh zBrMp!8MXf(GYb3vmQiYkPL_s7Hl}}nR0_QI0}Ke;U(|LaWl~y8F_3`3O2Z0LFN1vH z%R?>4ZG-d^~_2qkW#(CZG%&P{ONQp9{ zteg>ZNKW(`~UO$mhW9DT-7a`5ArGO34yj?9eJ+oikNOfy4cm$PB;hDpD(lBt7hXcC70B`*i%>Yob>EJcL*aizmCSQ zwFWxb?RQ}f81bea3}n=+3zan)&VP)ezlik#v~$C8oh%2uAfwfMg&cHhY4wLPHIiz2P3 zm?ZHxaNKc{!op9eL`mTfTlWXaU_m`0P7C>Y!A9?6Y$Sh^((w2uKQ(Do^Zc@IqKwNV zv2`Ef^z4!dw#j$x>LKCeV&LJq>L=83Zjm*D0uf12#w!+qh~XBA7BHczODK-V34-&i zmq~(vSsd#T6%)Xw+@6zxB3=EcL4X}Z*H?ofN`;hE(3bD*H;*uLo*{`LiK*vcN*qY6 zPfmoX5pR4uvT^Eog&D0QDi`=%I*ML(%?FK?p~nW|zrAmF<0z;j@^`rG_X! zKL21e5sm!4Y1kwR6ut;o!ilEk2F;mp2^R~ckO$>qiP!1L+J{i@NWSVJTga_wLsu_E z*uc+rG3pqDmJ?Isj;`7Qe=TQ|n_a9P`l||H5PBIMXudU{-SWi%>nY(4fh{Dyj!YZW z>k7z3nDqEJqoITO62%@hE!c#7t*Zj+IHy^5t%OK6({FTXWobrHmxVQijN=j$O}WNC z>GwQPdEYGoj!txiThVGNYhHZ2@+UvAuR<-5uPsfv59Tv(MkVyphCR&pgz!1(#{_(l zO4rFm3=v&jSkih6EBgx3CjxcZx6<=er&!qP7XMU$XX$FON4dQX^^)b^ASO>c(n52$ z{I_E+Z?Kbsp!LZc$bDni9G(5l(DU{R>#XmK#gcFDz=#!Iu@iU4Howf+yGj-gydMZG z$rxO?yJwF#syjeCZOd!kO{^)bE@THwoy2}9%lb0M<`K2DNA>!lg4%b>?!J}E+At_R zZbo|>tC3%!9IT?;=+`9Mn$@2@!mz%K?Q_!8IiEl5mRQ{4S6n)}i)&h_NhgUUjnR{T zi-us)gVl)$|N4pvb4ve zVnB)qqfs_CEDYE;>#oHwpr?S$fLd12z7El#M>hY8ZQaSJj4a|VCyA$QWuBcA_H(aH zx_YOhzuxV7u--Nul~!Q{tXb1&&c&dvk=rvg>t>D*s~uPAG5XxhTwHo1tw~P<5L%(4j~GA;3=iHP$2Bbq@uiB(Jd4u33$useE*90e6#}H#2#T z{d_2yTbWc}vtbFrXjn~2yAOn>apyp;udS|YFg0QM-43Eg1WWWy>CVXIPsC*PSWpai z6s9(-0eNNL)Rn7qX#G&?uiwy5l^f~xU^)BoC3tu9)wsTk(v`QIx@WqsFqV%DD%vo* zXszfj(u;f5%V-;?OufsC$v>KN8y3j#Mq0H()m`NAED`p!1fO_Jh zV`H62*ay#`^UkVFLEJ%VGdGU;lxcXDIw#2&|Gp-o+wyLs?`7&EftURyDC4*3syN^KZv$5$&#o4#G4cc#*i#&Adk=NFd9^t@l!$SKL@FhQ^xcbO8Hy+e!RKXx%B41_+1ypqr=5`^JL@yHDbTJEdv` zY^U4v;|ArVaR13BhqRu7=nAk825|~&---!Ke|Dr!Mk%;hr7i)AaQy64?6-)Sp}oV( z58XpFF}VZnVc|s^il~(zazcWYy9fokRAKYe_saKGJhe<>Xpom+h3adYq%bYs z;QF1sePPOwd_AgRC|Q;~d84k`(4iqqRdh3tiqusNk}cOtY}YrL(}Nou#*+a+tCU?5 zhM+&4lZql$Q_EXV*0z-q2)QOrlOhVlSd?gn$X;;hu{ILOL&5fu?=WD!==_iiZ+HLjB5WA ztV?h3?Zc@l-C5Ed09y!K9h&wDV1ky-TwZ~$bsCg;XnUWUj$5uCbi5~X{#bc&cpVd1 zqtX5uDzPc1ackYIz)A|ISpa(5Vrc5;;x|uV%G!ZUnpe%kH zJX*6j;h&lX<_*B)K~Ytyt5KtFlxr&=tRV)9@8l+MFs4>x)t-@ahGv9Tsm@IV!9+c; z#41rNz1|pmSTb~jrV(;kIHeYHRg779w$Wd_q1Zha%_4%*?G^-wFI%&jY#s2`%1XHm z8=h-|$r9#_t!>O|vT|6Up}UXvmmx~+mu7&qwLXWHoAm{|KU$)=Ku|BZp!y-12d{l7 zEe2xbd1~bmAd#yH?@pO3;=b`xiCZM+8jnW@faR`jry%XIKt2!PzGG3`_F5+tEC)@8 zr)043jyw*m?I$kDp;(WjteZkcTQ-5v~OjU%X#NBzf<}Wj8;@0pd zGlxJ$`Ng)Mv}390>*DdXuxf*pMl1TjOWWlczT!3T9*8zG6xGUmo{NZ_KpXFGAMgKI zeC8XU+i~GzA@WZpOZ(4R-F^_^j45b#=b6VSX`Y$%X3IJj*-?r$xopP_BDc z!99n_(u0?7#H4}Kvn>lB8=(qie@-tu0@^>b_v8Z4qNf4OCt}xKYW`t8KNL-4r>Aa4 zoheXE#tt*4UI@&`6IKkY;Q?3MG_#ep>?}#haDm58{$VK-MjV|PK&+Fe-xM-_<9uaf zuA#CnS{mTxxap03gQ5R$aQa7Ck5HaKPz2gFm#UNpTc}qgt0@-n`5S}P0kI92s5Vb`-olKR#NU*ln@mr= zFz3o537T!b$fc!(T~^|+GJDJ{xIWmp&~-)4(qvz$i?aO%g^)IUYAE!qp;($X$u5eAPbLU}OoRWQIi)5};7 z#$2j_47(2+5_l`=t{~W3DXS_HZeajty8f79z@|ZCKngGaULmvs2mkfeTabA)ZR^L{YlCj%Qz{F2!$YPE5=;BLr)E7N%9^FPHZZMaXe+q#CZUS)I$f?DllekC{j{EYVG{#W)@Z=`!iAT@-omW^+3z1-aZMf4xp#NtM{7r+8Q*j3S4}kE-xyih(CRPL_9NDqiozHARGw)^x%aT8)kJAmc^3w0Gb~PI z;W-$-7bbx!Vz>!w5B;IW`Z;pvk$G@1zUm&|TMjEm!mn7D8N0DRWg3yU*2c!Rwh7Xm zPD&J|q?dN1_f%w>Dez3$j{KeCNlM)RfGMmi6G2ws05GveLQUmbUbGh#FN*@q6xF42 zo`@=7qdaXI(kCf4K`p9QfYol~kC;X?`toNXj}SyHWy)ZmM49tW5h^_#X_cLVnMl=? zK%hgW0bA|j7!VazUv`m%2?SmdEKHOPFL}&A{L${3zpdNmayU&8cyU~6m|3-E9=lDw zua9QjBa*4EFezxUa!|i^_S=i|?SpaCxG-$~EV#xId;-NS3|FrUSfFvA(1F&o2G5yYxst2_@ zMB$OgkCio%8H}@?WS1R8RE>6xw2I_R5gS8q6dnB(T{vjUTuOqhD40NKrUi(bnxIK=0qH7XC`YT%tQtN=2NNsUMmfkfL(_8#w=ms;_88=!cnU?)95V2%*A z1n`s4XC+ecI|LozMcxPKj`jfT9alyJOPoi>qAfczwE`vD-9lJ1leHRSp@Lro6(wkJ z!ZKMEgpo&j@n^|U*@6yjy@ct5{X94TC!yq@(bXH&VL?q%sx(1P2CIenHq5Y~l@{2K zCB8ddh(^&oMx4BTsb)j49FNl5pnij^js44ZM>L}*Z`kMX-Z?CyFZ_>PpD3psEQcJ% zV=nDq$Z1^RM2e~HG`!hWLmh|}eh?W4k^$rE^-rrz#rJg({no%wGsY9Q;`oFLROvKm zL~zsU&`*tqgMEsW1K&U;Fg?VCFqmz$@EKJ_b`T0&+UKlgc+@Xcth-$scTqnf%1b+_JqxHPC5vqD<^E1c|rry zo(o9z@YF6%jF#|>hKIbLfk1#=7gJ_5>+jCy!@&oRd1;4xf%KYxAS`x>keLp=6P{2a zir`B7T6Pl#Q%pola{t=K>*+?znaSV&j`A z_$RcOBgOL)Hg{R_5sq=}v3%Q+=y$uzk4z4Bi_vC|VB0O|mgkcQLTyxDr5G|9)?tv!27qEwnkYjnqMLDCyfydll z{Y~R&K`4c_^m$`w4Nbr5YeNOIw#Mc0soR;b6UVPzF7}60MV0Y|0uM)2nMSw@`iN5b zmtu|T zDu;>1Sh_~s(`=TloBAxE5=FK(>l7h1_a@iO%xaYVmfN2omV98G$$Xb&Nt*Ws5!F1^ z5`*AaMLuHfHQM?m4mkjyp?KUq6TM8nP#uPX4Nwj~bLr3A$c#vAMTa{eL96~nl;2|& z!zkah1_|W^NL>2qFENW;gUUrzeR>zD**FFd7~uqV{Uo*h&Niv{;HX`Cy8=EV zp;ISxW4MXUl<@uq-wyw02u|HG#|<-}i_o&iOcSBXc>Sl8=Dy^_Bg)4x(cam+MtVLm^VLmbP-37UdGjfH~Z%9A#Bv_WV1eP4fc|wc@)SB zbovB4={g+Mwqa(KwMGC!${xWn5p=b<<3cj!y_FJCAhXKq9K@ja z*j5QeXcYli8%&_(@xuQD6wApiWmi%Q$r@5-l|%_$B2`G<~B*GDkHL{ zN#iB3dQpgh$y}N8XxVb32d{IEzH+M?rdmk}eTVc)80%0h(E!1l>5SF(D?TzE$~*c5 zLEcNMyPY#zdVPCXfK-%GL$N@!;KdIsc?tP3$ih~PEE4bts4sC0f9?~-{ zQk7H_xgVL0%QbRzgCQyLbtGmb%+8(2)CUS|y<3#S+T>*GqH@&2?f2(}6OKEJqNMmW zZ-5lVKIOMu09nP-1h?~x8Eu7p_Z9y&d%7Zk`berFeerx?-={gvLDUD zu(Uj}L{MSrvaScNzXMgH#7Mvp#w*{Zrr}7^X~Smh*Y3S6(H}GER8sP9gw3UUkJ-O( zcH-F)L^rHDJ7PLLl8f8>)fGm%z5b7%5!g^O(j*39a1DdlI8b3+n*HvN+aEm7q0upD z;wBj4XbAxPG&P}tJ`CLKXff)^H>+tzr|RW)!Cynr)B`szEJTy47^I(pz|OEOL)@?T z-eOV#*p;NntVKlVAw7l+_B<^s;--rE! zM=~=(dNsZAy4komxv&T?iU{PY2qF?t+rsH&kphjqAdwy9f)gG7ERC+NiSJ=v;6l^h zFN`3*#&--i9FjC-fmE-w$m1Nns^JjV{bT`Qe2MeM$Zd2DO-+r=mlZRWpHl^VxqwVz z_a)E>v7>2~3!g=Cnzn0^^KcnG(DQ{_2)HQQp7a<~VtC1bJkzyn8a}~xWe4x&VTcbs zjQ67LdJ+0YhKH>LMDZdStRf6PT*y;XH>8e94Uj57gHxE{8z2H{W9@TDni6MK73NLw z5sny+;xw+|&JBr$jH@$veu94q5R2CE8WQ=O{*JUKaYVDo(o?VDREwV1=76Lx4*BF&18gh}x^i{?2^`<%gG_VKG z-_)cidhV%sKI|E>FhHPO5lbbdZz4sgR@Iz)X5FTfU9MVm;kkBmjj z*cb(U#oyMlX<#Itu1cWL{DV|V{&&f2ArdU=3f5Vu0}j^Ju_{u6L5}<2ExvW?o^p%+ z!Q#Zbd5krR*=Kjk!opU6EW=_+_QCz2^zNwh*jk_ODo3Q@)qWA#sKelbi14lp5GZN9 zG?0mCf~znm4Ga@sXUivRET%dTZ5Kd94_($3_V&Ym#Bdr!oK7({w6<)#ZGG*E&0w;PTNroHgkTD53NP%%W z&A#^|4G(Vd?&1+#B<&*c_SVvC=#=<{5VSs zpAc!urV(XZb03_(*K(&%O8e>f!Z&}%X_)m50`oA;uFG$zGlKaM4X7MKee5Gomrx#C z6_P}=>v+W)ZBe z&yj&Ln(7t0MrS&#^xuHQiW4=3LD-)F;T0?0<@ce`q!K@`K+n@t>c0D|+JYu1@!EgW z%tjAC0r9eOcL$v3>2q)o#Gl|s{TcS;^g~d-*Uwtre_{Qk;k~{A(02w<-3S4fvNpqw zDb3%Pbam&*0SmLdhLP_vS-o$=!s`d^1a@K-(7BEcmy))BH$n|Ce`DN{n!PR)6OitB z;vI!;*#nbXP1!PVABGK1SJ(r4pLm{|e~zDDx#2#u;Fd@+`!K&vH0D@zFv$EJD*dOQ z1+|JO9<5n`wR(y1jn}4b<rvRVcBm>ilx?VPgX9h zoZb4I;qk=pye|3u`B1)hZ#J%zL#4s`LTSYL<7mT4ui9lLk3~x`T{ikUj&Lz`kOv^P zsP*oKRNToRlOs_Yb}S*A;KY+qR7Y9|^MEg+62&CyhH6+tnjCXP?_A^*Iii8&+CJfk zGdLizt49}ngG;qVvfB2xS@J+L(sxV|pfe?-BpeILAW+v;YAIT{5D=`+Rm~@#ptGv| zEe$FiloGeMdfyyoo5si%mRdF5&?e!I*(Os9HKOK4uNX^rbXv;&I@001#80%t#Xrxiup#_2gxv_wL#Z-$_OQ1hKBSzN`pv z!SGf{mIDKcz_!!unB5#j!S@1PD9FTbf#|;Uy2fA4TU`#2ea^O>4Z(9@mSE+?8`MZn zPP{D*tN>}7@CANJ7r0*P&;lb-I0IwT{v}=&LfAR9Y2QFX7=eGi-El3FXUcmTuS5+0 zC6QMqhR>@Pa2fxX%Q)eJ-b@kfP?I`3g0+1IC4%>ltD>=kloz@ieDe0D zCZ7V6y^&2Xt&rQI%iWbNp4{zU(2UVU7qk-ohn$=H>11Nw87hvNl6XZH~X*!U9q1(tQVYmP32pJTd0%GjTatK zStH#}x7=b#rXmaPhw{YS6z+?Ak>`jUA%jnHW;Ws%frAb z4y5hUZCs1I=%`Ug6gohUqnbARSV^1eUb|_j<1guwD5`gEFD+-GKsC$Kc71=N4Mtl{%*JmOYSqq40m*D}LT_csmq$i0l_VVWuLy z!4K3X>8Y>gP>+Y51AEzv|NQH&Yg40J-hl)FsL=WUTOA7j9Yr|**DOL+);^N~qvw&@ zCzh;1wNsS4?T$=?l#Q9p(oL``A65$s!I4~c@%uy1V$sm1K|1)s=gyBgHzCi?uX%Y< zFex)G*N!iqCeJA+yTUggdY3r3$W-zvpM(+Gzf=IP(pVDjGL>i5RGgS06P?_btb=U1oe!`j+6YBUjq@I(Q~Hm!Ct49iBqhB*Kyv-6xg>ko{B`Ra9Y z!9|I(7vM0?&j3#OMDfobLhP+CZZ5as{kVCA&924=~hwsgImPS}Bk>+99^^xecGhSZ}V!ZAs|CI=9%cs<3d-swe0 zwuf&Ko%sNQ;Jo8U>esjq8Yx$>^;dItMxI5P4I7zs^*?k+pET#_UsITLjpJInZgp$c zutZKaoPqVD=^l~zSz6A3Fs@Se+(x!@!KlG{l;&N`h<#Lu``E*(X5Az;ud1Sl9ao5x zXw-#{>h~(g3t%J*&*d9I)S+s*V@1X+YTP2SyE9KB!66eLP@jksjrbQyonz;Iy@s-H zk+)quX|>x#?)TjVOUI7#fVKms2PF^m_{pUm7IKSVPfch_f{$jMs_%|ZWA2BtDN&8rqgbl1_K2o&*4dPlL*K@|{41P#UO!wyw=Ybc%NS-g*P85=0OCpGHFV~Wm%}(#wh&gMcUQj!HecVP1-Z2&9Z5x4@uI*-*sPZw-VA=7E&06~rU}bc0Bhili7X ze;4vtu_qk<;yl8joglY?Kxr8@^?F5RD!1f0PZg7n2kQ=Vwkee8Dv1(mcJ>`JKs*2= zsY+m_gY`^+|D3bctYw_5&9dZnfNEhjdzanwrdGeI@*`|kt<6@OQwZNMN-hnXD|gW~ zsqMFEx-P{c;9p0l2s-S+fiW)RkdWrWkZpXuj^i18cfv7p)1d(>wZHn2Y=-4W)o(}% z3fqP45^V8yY8;MTduqImm`39^LZ$6AlfT)!hx9|f{YUM#*M8}{{~fx)g8V1YQ2sBV z{p-6)l(z=@Z{So-)TQV}y%3re5VWZl9)D-+E|!cljZI>}%EGz7G-b)&ggIE7PyrZ-g7`_-wPnwwRdS+8 zA)}=34>JWY?LUHcH;|zQ$%NZ5AjCzhE?H=&P9!TViM0@yrPzxI%_Q7IHQV($rE}@( z@D)cf$ZVm{4CDwD0G3D_Dx=^?FBb(1q0rDsRU7 zh1@nWMyp+@N6BB|u6C@D2)|K;U)nimTTT?Am#z7;W?vcfX|kL5l$zPZ3=>ndT2sD? zFMhut$Fu!zgk#i_RmIbae)TQs3d4`4-%y+##tqvg&SvgZI2^I|T$~#bgGO%Tys>ng zzBO}*?1S(xZgsVO-fn+!gZhuS{V(V7-!6rMlf8?*vHgEFDyG$S?Kc=ud}nLhgepLy zGiolBHOUpn)QTSJNo0J5?HnXq;yqdx;Z;9hbWeeS2x)nm{lX#mPW5t~V|*>y^U?3o z_vv{+PtEmbwHdBmtDjk(PE{0*0Q{#hDB}9B^UPyyknukK`-MpiFd@PG!tv8o-V`OG z%{Cc0Tz?iogE)`TMfi)vK{MT92K65#%3KCS=^|3_xfteY}rfin!KyUpl`P}>y&0zp;kIomLF<`pD|@<6=kQ~rt= zyj}1fXgh&o5S=p;a-&p#T1=*=)ozQKqWg+zpy``A)=_E#4FxLTHSAp8Z^5G#dIkyKb5_*}Z*!DT z^HLyXiZhBj4V;^C`&lAcAr`>n&m{$k<%^`sD!;xTx?rr1Y2L~xpQ|>)3_JwB?sSt& z8B`7pfIE_iVFd;N!F=@kpX*Uu;cMDV4(8p{KbKH%UCFmE`>*>je?L3Q*)YZ_+$&1S zPGaF}UL`-swWlK_ypCbjE)+KSKCQV6m8L25$AdI-{$keXC+*5Rt!jiGs|gbltspp? z&|cKK)qdQFbn!!1P+T_YUIsg)sQp6lC^9MO%K9w#Y-M4Mijre0D z2od<4Y7#T8LQtcU#!9Bo7dWx3S@;k_Y^7X?Q%|Kzoz!VSW!rnPxs6furC)gT`$6O> z`APipyJmp$CqD-)fZ7JIn{WFGo|V4nXC)@G{(hraFvI)I#IoyU5)#X=xkC_qlGswEukcB#cD}@bh}+r z{h#S*wDZ|JBsr6XP4eDRWKGAN;-VF^DE5it)u27w%FIJA613n0e&D$M8|AF6y}^+~ z+SH+&>6*^3bkpyQjFv@;o1rJms_378{*`{Y;=GK1%?YJ{yMzBT!Tm2U%0DY#!uGZf zmNuqN|I%EymbUX|8>-)GZQna#F;1$aGQW$OVrc`7J#TZ8N@6SX_P7ZFQbYX-EeXly z^lR@6j*bLCk&iv6u_TED+{`gIy1!qme2J*1_I;GJAYa$dVp#lNAK;_=DW`l{-n>6T zgF$q-w3wWHNuzuersiXEf~#UeRT;)U=jT+}o+uvd^DZn{P~wRCQ(!`HDmbFwQd*PI zxCO(WrlyJz?2rJ?IP0@GFRr+lR+Ezo;gfz?6|x zxW4~JZz8k8QjO`*pMIO;W69*84L5mIfVU=H<0+@y$S@0&V8XRo# zn4%Itm$5_|^_I~XTxD0B7DuKJccdJ4E2P5HOHdm2IF6!u{k4YuCweyXzO!2~&cJKq z>9+BlAMMmU>DcMp(uoYRXMbR~B#ox0f_=U9+~@rizMH2=Eh9kfN`NXfKG}qx^*W-- zW@;=|EvrVU#8yWw#GoEPJAd}R)=X%FdA@g)WVh(NjJvzZ+}&&-!~7{SL8Cu>?!qXE z@s74#A_`TO*Ns+$*4zz^wSH2@%`^wD`E)C6OHX6;rJAz zyH6;;NFX1e3K3W+S_C`jnx?sQat|uLJOHM$_<*3WToo$<`yH3A+AtcQJ68he!?}aV zG`a^xAbe_n4_uEfAyo-lHFw>)W`t!xgySo%(}TV|HkZAve!4y^JZ(z;yLEV1v?Yqe zK-F-6BWSF`piC|yDmAq#u-5?drkAfRArm4-JC_se^~OsP6wEk9 z&FVZ;h5>*|`05sonc33GM^AIYJZ7qPwaWw}!pq|lBfyQWc5Ex@-~|&x&)YZrV{aDg zbkCgX6_~kr>UFVB=RhbJZsMl=2Q1Hgo3-;JfL3kHFG2G;e-o2MdVA^i zj=tOaeDPO2A-W;O&SFbdCD|Nhoh5%&ZI;Hln(Go|fW9W1MW7BbMTiWqS){eFi58`^ z8%WShv`ifkJHju?N`UyR<4l?H7}GT@juUnoO@YRFXf+gUZ#*b(x~+;36JoZt|xE=Lc4*wm;ts)ls2IKforL0HyU`MD2ZtC;RNmk~c|&qXe`u z$UAJ?x@8x!)s-@l@)HBkxwt#&U>A>?Vuw0gaXi z6bH@JcNlOT!aB2ax`bZ1x}z$i64ThIH`9_7aG0oTU96IHuUWmb0l8)Sd?81Ws@P`@ zoFf6JAla1e{>&GIeYDztc+IOdkV$!Sp*6c%Od=rN4Cm4ku#`6@?`ujLyzZ!%(JX*X z#Pv7qcVo|N>`a0qZetxZ&u=;0h&BWTsU6gTXN=sO9q|~l&jNNfF9|AjhTEAk39vP= zP#;!Q^S zP4LKYekGe&O<4cTAGtwKYJfddm&`pTBXsqs?(^TJZK>RT;x)pS_9K#i4( z#Cg>znXrR5aQ)o1G~LrnV-F16d+V%Rr?X$j?mQlGUUlU5!cZw<%u zD6Y`n-lHfb9<6p-yx&l#`pCN;^7=zG%AcIL{_^bu^L0-zV;^do1}8Uyy;f625Z6TK zK1du^+PpJ7;eU2LgPTd6wP`x4F%~zR?K&E)RV-8;sE`!cH~USIDZQ=;>Tda`%iQp7 z-<}~yy)hX^zDir{&U}fkOJE*+0$tDD4^I%w7HRKJ0LZhr@W;7dc}>A}_qe1~dW z_+GD)hn3HP-L7{kLL>HBHjuNR4((xm{z&?)>%^b7U2ThZH91VS&ag^D%o8qCbZzCA z%TD0)7`gjlOL+gz0n)B{<_qjY@z*TLp=(U1CGl9!ar_M@5>tx&^>X!BH)rk{H^)Lp zI^t;KNw()<+R1kCR*Bb*Lb|kBe7?CSr9dO2`)%k^HCe|mTOWE80K!FCdaMmr(^#dq zD&Blf+Bx~^XEPoJ{+;+2_R;r?4GG)fAo(3tVg&cjp{V%*ElS0Xi7Zv zS5=tYul#4tvEi(YrbWMcBt-avBgSC&rISp>8R1|hUj%bp<1%N~9|}2WC?9x+K4Mt{ z^duQP2No{5*jI4DoprUfpNwVoJV4U1ojEbeN%|qvT|s=uT~VH6jVYXnarWTr^fh1G z0wHDnuyAC2UyN0XXY8Mfrz_5FVIDq}ntLTP4{p03Mbl9Zrzb3>pI4~TC$uE=+_iKM z3wU!t1^1vIpnnRwd*yDRdQiMVT~vP~#PC2PyDsK>lr?p13 zGQ+pn=`w)3#3XEJ90~CaD7|6O+0RtAOEGQ?4-4^~Pw8&;1mu zgOa;Ivl=u`JLCgD=>}o z6&%U~CW`Rm$R^d<3SnV!J}>O>s>}hSV6poy@lT(QFLji$(8bX1NsbHxC|qD7P`DA1(Nrpkv<)RYI^Zo}P6_BoBt#4$1~JHuqMlEE zn2Wfc19=5VykBDosbXlr!8V)l!jk^AKLp?ly;cggWP&SytUH@QsfxKt(3NF@n`Hr) zPha={;q08YM2WU7o3?G+nLBOUwr$(SPTRI^+qP}nwa=+`?_)jGH$=o-v#mb*2qaXs z%Hz>tV|Lx?)Kq1=%5_5)y(wN9(Oj~_*y!e**QXWAoTRFnFK{hr@O4GsA({nxxkF--Ua9(lj0@&e)>?^5HW5v?ScGjWmc&j z>XE^iT^f!PlPDaSHB20~x%a0q_z(n2%XXc2JXfmuPrc{lMZPRKY79DNT^$TTI&G+h zlxcc40^Fj3z=gV!kw=mXbu)gW`~*)m%2kY8Cxf9C;N}*~fv^hz-!LRInrWPUeQLNk z!xSeSatx(mG58HI9Rn1E_8rpH1e4p+F(;J2{5u}IhE1x9%L>g&hT4my(wJN-z9^>;$QEMJ zIbTYS$G^wv8>C*tXU>4WV{CkVD--z(jjheIbP5Ys{2&fJ5-1qnz6}nSB37cMzpwF4 zew*Q9Pr#}*3%XKXC9laN$d6eDI1M5;6sg$?D-Q6vKIPcbST3A{yvh@h{S`FJ?56vq z4XN5*6pnS^(U<|}I^Z)*Pup<{p#f!76NNdlrBib0mCsah{hiams!7)w5RUu%U6vh4}~5z zOcvYdT;BTr`6Nh%Uw4co*4H30Gc`NC&rDxFhs1oerZ2dbO<1MZ>&8pSyf=67OcW(d zUb;mTO!!%Khv`UfQiI8bt3rDK6f~#_M~; zMWyb(aw#G)60$@OwD-J>bUJz2C{%0i3inHIPSC!FUy^|G>qyoqj%0A`jEuq*8E-hH zG=76$$WEVd6~CJJ>2G2lCT4EC=l7lwRV~-A&2@5HH1#ESSD&Pe<{_a7qFk2Bf!wOl z=lHv5>9Wl%&bCaN$c4u%P=wmR+`FK4A-45fmugJ{vMsk*6(>cBAv2R9yy)RIdfX}G zO_}&JZMgAn-!4bm?H2qZD<|uD6s)~K|5u)9%?@;uG#X3p!K>9H&51)VvQW#ijFzfG1JBq%e`^sl` z7^Q%0t`8=wcq?-%b87u-f|@wEyS5E3g2_p%p}evXffxr-o!r>fNghH~e=% zd-vRLzx!i!zx=?HeMHCen@umD-zK_NEU+9X&_7;_il`$dJs?<8=a35S7!#FV_%A1# zgZBzSlfA%U+HSN*0%Xc5KtBJ!f|!gW(Hks(#1u9n1=68W06xp zaxl>vD0GO*inLywU#8#tDQk4)34Ug)J72Ip^4E~?iE0*zlS{pQ=!%fzcG+ig19cR2 zF@sD~866OqFE8NdI;fzov9vp|jWl>aRX`es!pm~RAQ!k=WF{iaWGFZE= ziM~&%%8HPKH6vjv(c8xzvynP5^RRNqe<#pUvl%>sAtGdmUK-HFYkJ4cNdxYhl ze3j0NkBV0kxNw#V(0Ku`c;bKN4d@#&;VHjq6aO&$G}qU#-R0*7blfDXILjNgtm6A2 zO#10yA+_!AG*avkPAVJ+fV5d1G-uK%9$D{M-{gOpI zE2V&{LHed5x9ZuRU?zr6Hfk@c&Mo@lBJ4MM!l#EkMn>Z#i!#CkwAwnYDFT%leu}&G zXAW2G^ES&z#9hpI?h_e0nDfX}@4@|cgdfZ~;jQ(7Nq}|ZHJ;MO=G8}g%viENX|L6r zA2!u>R1aUot?JkET9>oc@trC_BP3I+yzLeN#H`IW+QSi)m-H`m%ZzcKZ`DO$qaHb~ zYEIVYT>27gJm1YSNlyww{U$If+9Kkdy)8k`bl=^mvBb zFyu_1s5Rz-3zZh)S-SC?F*`37rwg~x%D9J@Gqbj)+Fu?vLR0jE1I}1D=mV{cw zW5Zyne-|P7r^BhfOw`UGKo1MgHoV{p|ILtm7B0_@anL_NfszT{3Y8lMhE*O1nj}tK zq~>Bu<}7rfn+Y=9I2uK?Tn0e6Zsh4 zCiM=MUb4bS)0D}VX{>k)Ld5zo7r52;aq8MHjAJ<}T|2ZswfM#gL9DG20$X#im9$*7 zf>*tWGoCU1Lf~Ce)SjIW_ z3JUE5AIP(IRfqBZk`wrY3e*gduU?)p$*Uwmd!ga^V%eIveWZ&Dg=+r|APSi^o7{0S zRJ<~}Ims_M76g;&0SCu(~j-OY|;;W_>yId^b& zqQix+CEi$%RV;L{9u4!H0Zya-qC!2Sjk6zaogbSUV9_VU{MHZ%+gL(bL3JV6LT+_g z*3V*lV#igu%&Uy@R^nkkQar!L(M60nigx!zvQeU4m$(QH4)bhQ_`^)RB#>ij<6&zv z(1T^!UszYXY3t>AKIk0Zh&l?lHQc?D!j-XGq|duT0@(@jH`Z}gAT+>?|F=Owc=CS3Ljm^zOU1GjxcE9; zGLZVpd-=%){12~;5}k@6!MF|xG1(CdJxCHoS}jmyt$*BhrIO~9Tx0NXT2?0cw6zoz zMF<7%2s3I>z8*29ii>Q+cdYzH=TrnbO5RDksF(c0R8I!3BvUPZgN!sOw(T#riBBs= z3#=7MofjI4BB`trbn1`DXI^0?|AzBe>oODoY0EgyaYkNxiDu^wzxEnhqUappA2t+) zrWNy$#YF(!r_B5f4#R_D8+5~dQOIh+dHY8e5Glr)Zy2=cXGuRDC!?tC!Dw!dmihUd=xMDSbC0jPLj*_YlP1l^w8 znKi175gv;%ZxuU9HrMlrj+p1H$eyx&X}2)eEVSlXtIS0l+z#BZ?G{i?>3>(aw^D6R zU*(@vIx4l@;tDPaj`+d!Zx2qiAlFe9TkWx|jpL4n2|v@8IidFfH|w#IE@w{w+-cuv zVQS}UFhT3u!)PToH^7+-FDYV-LG&%TB38Q8@UmQB!9&k62lKf^Hurt5C=PI@oL7uX z3C)v?aiq>@t#X01fQUK3iFjmIWTj3*hoAXRBcc!+As-LT7Ur!(iOav+P0NT3)}#+y zq3?e&cB`r{h_iUWc}$ZAD|wt(#JFs7Toa?FYh@ORLPwgvRFVpDmO3}|yNU2ub=+ng zu6uevAcy}{HzvC^cD#ALzL%N!bsVw;7ztkMH~2nNB2ZN<9QVPC%lanopMPZ($nw~5 z@;eK^3ca$Kp8@XPIq(ih`%WmQ3*yR>EBAazU;jdAiTyhUF=g`5qIlR0c8~ zY@x;6{n%ywS|*xD((+}v1g)a!*!2d^d^Sq4y|<6`meb{J_kMP|P}0QV47%P~?j(0Z zZJGqoZ6*pmN?6@&UCC3%TS{;90SdxTkJ>;`EjZZECCG8O(X*Vdi4b3xZ3^4@{Rgwa zA&5pV5?cNxH@HduUrX=*7SYL?I2#$8{?FR`pDe&N&$r#?NCIE(Z)9~qmtwgfxsQOt zki;!VOX5d=yiZHA8@$L&-q63@mq^8T%>n!OmhI1H|MszB0_m$i5P4p-@XgfB%+$=P zulw!!%<}sDdSx~`VWwCv2lZuOBZZ7c%4nCdLO;4l&z^|qXaUV+W!b^~%wl(Tc6aF& zgWeYExU*{gZEo*d&unNIIJ(y$O++CTlpBUoYF4A=$ol#C{{7xVnoL4cql9jq2V6G^ zrgyg3KV_FNUt9Qac0Q?*U9$`3-tQRZBlgwJHQ}9zo{Dwm)Ih^*zg7bU4&W~I_ER_e zR6_NB;L}zCbzefYySsA_S@+I*D=*J>lwU&}m_6`!-;cD`TjoUMZRxSACIN*XJ&Ysn zZWz2=6UPtp5fsi>B2&t}>*yKbr&%wxt4+cqgkJ8^Vz6DWFq1<1;SN_^f7dfjbe);z zjpX={ikl+xY{pm4=Nl)v5q^H)F*K)Ql(bBY$@MsF2*#ZyhJ1hT&eQ&-HY&05&}S*H zlDnUW#z5)4=v;hBIOS_)Aue||tM zP&_jv4641mCsg=RB7)xyJuoV>b}tuux3DRXUg`ZZDC5g;57v*ZYUw$h)B&ncH!nxR z6OY&YwBNd`y{oqap}69ApYsq~Rfm>+27{7r61(1=K!j70*>jgRD+vGnhcN%kI;wv@ z;ztC+ltlw}ogvn~SPz&blka3v_uZa=1P8-@K@HHPXxI1avIB6?%g3loADka=8$%yl z|3?+D>-*#SaPszc6#fbzHzvEj->)xjom;6HIN4q&bL)G-0@c3RgAk|bBNcZmgf(e1JnqxeVW|7TGYuuM&GJWdz@H%BeTVIrcs&F1gF03XMRz+_^9cw)_U#ciFb^c6gq)HnV5 zZl5!s8oZ}o_uebE5JDB~Bh4tf8T^N8qE?n;KcJ6fy|lPTE*e*WskMN+Ialw#ejIvv z?;K+T)N-w~dARyC&m*(bH90#Ieaw{b#c#8WP@v`IvLR%K?lHNg*6NYmbSH^rvecm) zf&wBAVZZ#LL)s<@c~FCVP`b+^U#(p7$zq3|G3D-J8r4I8`G7#K*U^a6K@#Kq0Ffs0Mt@$| zSRqFhTmd=c=9~~GULsEr0zWKRfa`MC9(5~8eVrH0>;1LK`KiM5Q@s&U6_U~6ICu%* zm)|f23}4oLy?Ymb$UwKqK43x0uJ|Mx{j)!OlA(FQWBhEI;7~!DV?Yp1>cw&T*!G3e zNn=!iFsRBrU=_hu*+Z{@oK1(w)vf#)ATeO6=yStre2Fqo%3@cSvKQ>*`zK_P(#x5z z_up9*NdJkE-I6p_=Q41zz$2u|F9cBz4dByTr8}P^AmmRqwwJcU!7^lS0k#|BP|9T% z6q*|wMtSE91Qo?6Qj7VX#%^oONw}O9*8~xa^ zsr!Cgon&H0-y^%!zDMp-@V}o^#3o+mim^rbidfCJF)|;_AvMINnn;J?kXKW{7=**T zKm8H+xtY>-usuBJ^*VY@u7_Vc6&FZ2@>xUct*F%K z-Y}9QL~?J-myHTKl%Edn`#@2YL+MGI?7x^G!)zK5ShS7BqWaGs(KW9*Vr<`sM^7bGBIiNa7M0*M!36O8T??UiQ|@ z?jwPf8u7b|zG@z3pM#(wkb8on;ZnuTvpGrm$Of7CY6<#db5p(uP43{7q+Zyllfm^R z#vTgX(hX#Nl8U!nG{)4zK;>>B+-f+1sY8+WSRDL!1w;PxacO+i2iB1KAtbKP2207X zZ&lUgCU+XDdZvWLb#_xjBl?oiMNuMQ9$?6z>V3YaB0ti>=?oZ(R@xWC&H;L}_0R_lMHNOH!fiY_F45 zzF^Hjf7jN~obLnXm^Io_zSb&WH00|H=ao6Qt^*Q9xX_wQj6$F za6g&QfP$@5y?VBKdA;?zsu%BkGk(mt=X5y_F{fAukM$hbQy6hvP|IHr$X?r=E(xv*Z+FZVGiATfqVM<;}Wt} zHP~>UI*}o)O58prb-ZK|zY48J%9^d#B(1(At_`rb!`$oX!&GNOUgN%#GNn!6$}Tr7 z#$h<#9EvK-X>*dzOpU*VjX}kr-`_x7kTNrdVmh^O@Y7v?>`>w9lgUHNBc*iBJd{hFC?<>0(#~r_vw$ zLx}9g(KZY@1IT$EU0y$}RwcJN zh3vjD^cx+lbv}4rXV~vuSj5N#^DMrZ=6ipyx7NbpitFVd(QjrG%}A35p->%%bgSg$ zykGh{oj5cyD8rqV5ev3P(he47_7ewh6CDRjtP@rueRzFo$erQ48QMeB9 zG+-7b+b}O8Q5-bSgh1hjtJ(@PS@4k1)>P8J%0#}+xv0?OMe^mu6VteE1c@S~pv7mt zc=Zw@LAWL_Trq;5jgl$AqZq(vh=Mr-ExprODInQa1mx&nJ6>tZT(|$-Gu&N=k>&ES z(>OW_rmFCEwd317^pKK!L-_7Bt5f{#3qk$=2bF6pFZd%wLgoiG`vF7P1X7CXDLa1 zc~)GJ-KPhopgg%l95(&fSgZP;u@Qa$3&Fo(5yi{xP#oM5vF?pA_7q)j zm6N2M{R-BGGpvZg;mxeMI8+IWL=1u?$+vhf;iY;0#C z5}2S5;nHtE2iESk;MPz}un{SdxO_zBsN5l#Pd`sr*Zt)hk_Q&!opC*SA?fOC7Iw%YISdM?g_S7v@u7iN67l-ChNQ+^2InHS_veJ#9Wn6E7XSV8HG%nu%)$B z=XiSB+Ww=0dK44#B_>Zsx$!A+|Rd}vaUxB=_ODAVqm zs*RKJnq&@(vH5p|bRFZj!m&D0UkIqV4xk;XghiwL7j7?(R$+mOXU7i>YODQe^4N+? zY{ChP5#1z0Lu*{Zw=yT@ul*NIky#muzL;rZ<4=ZW?o4e=a%Bi$TVZP2O??lynQ{{AZ zLhfg_Ee|yhR~Dc9Rb3X}FW$NlQ(6NEE4Ooj#krPLg__5v$ROno9k~_*qaIP9pn;Xn zp{ml}zfIMBwhihx4gIAfTCCk25&X^D7)fVy)Zyrr0z7?hABkHBG+b@MrpxKdl!Kh^|jSd|4t zsqX7vUJpwgysY%g#or8HE`XJH@7&3$|iN7uq~;3l+L zyCpsUdsBOw4Cx32jHh+W>_>yEP<>3-SF5+qc7S-){(!likS3OGgW7c7Pel@37c3I9HU6V~d=_ zK0g3^po>fUrYIuN$`%d=)&*WY@O?&uwa<&VB_F5!r{A9?QR--|c`qVACL)Fc$UHKj|Ibh6&}z6&bjG2~VFTJPFS2RQ`NQ zUiX_Uu4s+(GY!*{H@$CZgW!y`#~S5%Az|FqlO}jy4ooM}nu4u&e^`e_X#JoZRo@x* z1#Dbhse4q>uO`C3CG_(ZL1O0xR`>b%tQ*uW$j}<3!MwT~%AO=<&izuMpZ{i|R|;SuqQRO{2ZDk672u4>4b2(V@)_g}sKMhOUh>mRD(B&G6f# zvbMXTJ0UPvGYYe_J0~d$!V;Fm73r@H zi|vn=jI4>x(nI)#GL75n1`BVwwIpbS%}s;G?G)O6TQVLcg! zt^WgDOE{&u|2e zw*oLf_l5q_Ny>|Q5~K=$wrCTv6~i@7oWZOePa_Yc#39obkAIJUvUjRohUbdm(LRwz z2BKN!(FVLDpjj>Uas2ZcFJsRJ?HP26b5nnUI(t~j>dJ-vWRvrCFwRk{kAtW(iq*X! z3`$B{2YkVhIaE1W=dg3)OTCb>{)XtV_2&AX|MRe#S@4939rdih)TJ@UB#YYIcD24{ zYB`tO-3AS#LDX`TbitcVHIoK<@V=Pgg|_uTkTs8hg4pug4*fwW*7|S@wl3Fe=Z<>o z?s}%qzD_O&wvO5xrAm)(`uQ%mDy97c09&XUgF`4f!U1ZUIS;Ywgt~|{=o{=(Im8r5 z65GU?M?b|GYB4~X9_bHu#NZ%MI~9f0w-Td5=TTl@F}B`t|4drWE9xPZ(OZ`byoggg znNA?o2nXh(8+WKMn1OVv)xr2$co_?%4cWwnL|_!gcZ|zgw5oxW)+hG#?FyHc+4Z)V zk6F~1kjhlsSp>+pWPyWqj!5Ih`Z`b@)l{SXn^=E_mMq{Deu zu5rLhSS$3^b1DxCKKet4bxfK>=8_Hy=HV(`eb$CMvJE5U=54N2=Gails!+;^@1Shb zdo7D$uXscwkuWBu`sD8;r&eWThq9_ZFi!zen^%j44?R6j;e>nnSDDd8k@QoMnd2)ItD;=DjC4+%R_;__=!*#+CmfkUIr031z!T{roMCMTwT z7e6PRbL4Y%NxiNqDJtq^=1+QEuTkWE9i9C00vGEEDBhn$&KxuMi0-x>-ri-mzHyEc zPDWGIngJG{*26=VNfA$7jz(GOKg$7(_JnHrIu8qi7&ju$mr!kxs72B;BItj+vjAAEvts`FLQ<}$Er^{ z;6XvFrljequ})%ad=GMq)+&)yO2M4}_PK8iloU2%%n}`u8cR#mN>b}9{2_Z+ zY$ zaLeu(H#0a?3K^U2<8net`Ll#X=<{HwE-%?QkGmTIgV=*Gi_d-GNG`f0%^A}R$){XE zJ0l%8#lOxd)2Y5k0rxY8pGm|@wK*n0}8sLN?QC0z8!bsJjpL(pnc zS`YEew+QQaF7SsFjg~ZCk(7ro80s2zv(xhyqM#a4d_!0x`S=I!{;<7x`(hLs#%=|X zDH&_A+79Xl(`P-4Th9BOG-oxnb& z8ODV`9lWkTd>stN18|PWAA@xNI&-0&G^6IC%DW17Y$+h zM?J(q7cQS%bJw0`Lb%5{nKX&i$Ior3rG8spm0hU;bg0Imwb~%%WvdCzaU0B%(^BfrUI`%J2?1%^IG6PznE~v^DsCGqPU+@_w`*F6BNwF9H(4 zkO4T4Gv^BV-TQ^s{RpLbxNATCsE|HkaPde0gu?gvvmD+Si`*mJQ-$dSo4UG%*WZhJ z=o@`gz%V}0O5jg?dB81cW-wFg#7jA-n(XToQ~hqFywww% zlEdY!qC>|Yln_B}IMg;fDZvf4qi4f6c^kftpEv$UT7%FxS81$dWVokm#X|B3%{UCxF8p4ZVVm zZh|Kx+1Bz3Zppy4_CZ`4;8MhIt%>I4EP_Obm_}y7Y<5VK`AA_>YGx;TyT+I)`UrGn z6g}IBBs^&3s&m5sIon&;=m*!IF$4Z>m6q_}<#QVQ&5(WN_By!f{&D*mi-eHpIAOp8 zcSY^)3!YbiWcpW)lpad~nPI#rtlN!GC+pdu{`+_To=RJ$fLl7UlSA$`Ruc$A`{l>V z*)(V@W!{b&4{iLmizQ3p_u#8LYMd&YJnB1gE5}|ruaqVlZQ#&6b)^mA4DK?w3uyio zywq%L)8|l5pNirQk{^Oo1_{Z&D9WI0tS}1NpSU*o?R37Q94I8SwL8k{XgP{CC`@f= zHB~I~$dK}V0`?}l$(C;=1wr6 zWoB`?KwS*T-`$7K)O8)9Bwy(>0Dxx90>deU<3MaDWrF@Y1{@A*A|07d%|!n_gY6e9 zN5yIG_qTewDG}dGZKMhL&d{br=a;<=Yh$wet7m%XvFFcq?QV1W%ZuUMAM&1TGlj|W z(xCaws6TEuueBRfxE$KJ%_f&)CUa#hVWO;2qSYQCk3D`Se_BbCZ>AJ3%U1_0AAh)v zD()N|FN}ix6kIp)6E+H>pehLHUI=WJ!IPF&W`p?=?d!sP+*0)sML?Y! zMvbQe^Iu+7u435xXu=pEunBgNy zi!@jy2M)F_i1%)XKwRe)(yNUnBJGfgg57W# z`(n`*KDas&6`Ag4J^KklT-^Hn6L@w=JyHT2lEc3?l#v!@TD#|m>-<=`{|T}e2VXM1 zuQ`s)@f^3Cfa<5YFU%4V$zhs~8+>Ca#{tqK@cwJxHBP^*T6aP24qEsSB*{2za7n$H ziDY3T=2&AtfUb$#=x}!`@%R9#b^tp8+V2iNk+575XGq5T$)#LqeJ_lo+%Haz7R78# zk8+X7ls{5aGXj>D3i%Ojzx}gLtW-m~oF|LsEcBR`&?Z{%z(2rR3MW*FSrr6dJg3K0 zat0$%II~IHk1maHD+#pq2ot{-g3_sUWk|gkU#7`ZMt4>a-Z?16#k3D4>6HQA)5iYl2tu{*OcRAnleo^_iQMXkW-wg4@Gr-s-5+d}dz=fS zaqW%21k*sS7oR3%Z#ZiaVfij)1Z6HH;S|xsp-_g%x=EXN5gP_!mMey!ilKAt0Xpbs zQ)zPbJHYS63|Pv#y6`&R!mPCN_;%(T#rp-q1n3e+a5Y%)t9B675uo{JDu(+qw@eUN z{He+tx>$wv;K|pE7dnG|kX@CVo*D*q<4=ThLevrgP%6N~;#yuX46ty*(M#UtXv(Qq zpp^lR0%FZP{x$eeca8gh|E0gLsqukO)i`mXXzUWZC_0a9ps=P=97&*icuW>Om@k9z zlD(;T5$1sY97#BTd=(CjM7X2W~x`4u+P6HP-xXr~C#4fuIE>%@e9B>Sm+iF-oB z|91XEFqzEdVoY$9(VUJJiHtGAJ){wo&Xg)S_G* z_zc}MJaG}G4@5xqNswH9WN$<#tj@pyR)9R(L|)28K)8*27+-*io@&TM~xwT7_Fc zkh2Q3;E#|D0=l4r3H*xzCwq#WUOn;e4{mT4dZ7!;w+dZo#!uK-dYp0}FhvYPO zC9p60I?YglFM-0{Um%}<1^lxR;a~<3>lHAm{@xsNs{oHOX-L^b#Jv&=y9~FThaLh= z{8#PDo<3hy?kPYP{}2q`|3xr|gd$}|`kQ;iAT5rLlY#p-IopdrHBXwKFM$KFdy1yv zR>dwuIjH%G|3xr+V{_9z=xy#1NeSJt4=w}dlo~mwn-VKob%@KOVDK7J@%$Gul(TU{ z4+-j+vZUbRx=9!e*hnvpgtIBgRY^lNyni!YfqCsN*O}h9EA7k(|J2n^MMw81Z6uMQ zWgAmsK-Kww&pcjf#hU^#7Okv#0G|CE)gag^#AaoD(Mk$0ZS#}_PtXeoDD zqQ8U7oM`kPmMEyZ_h%%R{ZK~&KwHjFR3!0eyOUo4Vhlc7=W|zM?4`Gl8R|Cwu`FP8 zEYkUFsY2Vu-7T7XEj65A7U zC@E_??LH=yzTu-g9Ee}i2v4=%)3Q@~wC=%8QwhoUL&=3!3kYF`K;5#Z4^4nsB(z;j> zwltyl(RT)A&0Op20woXA_@d3FAD1;~MR3yDv@hhc45W#rN##bOonzb&#SQ{#alMw@AKGXjt(VDgp6aVCn zcfoGgmA9wSoTlK3@W3Q}1acM1&Jb~-98gKU77|7=Q)%7kF>xug($d0Yod#x%5vEci z6NQF5Y^qUT8jr)4#^z%}&(laV{zaKqL-VwGVO`j$oiu+i2-ocg%Ij5Nu?Rh#>JzB* zYGSkYFi=6HZHtH|>Ry`?kD^!6MT(mg1?q%aGOZ=w>XP(6Vy5?NaSf(mbPf_5dO9?_ zj}L~|n`iNS6&4%_gaBp(hS$F#IaL_9@M9VlgfQJ&Dk`eeydQ^XVoC_<)4&V^?W}m7 z`rroe2}1^k9T3e6zY(qlI^+;v=JhhF#;vF^)z4}^xAgX3?0)Zxb*lc(aa8v=f;Lmm zUMZXeSZY(=G{oeJEj4|~(Z)dYbMuuH!DqHJmI4L>gSQ8Zwidr6*{k07?B~svow7MY z%Ar8b0CJy4|J$_J&{?&jF(MZQK)`KV40#xq@cRY5{FQ8#C$-`b_1f*XBX9SJ{qlg` zJHJV1ltPbKaAt#St@O#v_-E4@q+Gnox-vXnhiIt|pCjlnp8+ORA>n~L%|pieBppIy z0JoNm)dI9Q4V6R;gv%c9O*#{Li#!jp{96c7JWg!pEO|@0Zx1nNUJ9VvrI8_GJ`>lK zLd|IqhDlurGD&cLtwwzT+Z9C8u(C8x@w3fT`RM0SUgn9gu+LokXr&Po+FF@{M8C7w z)CUW4G77V2*`P-^O_T*x2MSCg64d4ugu>U^&ku}E!HLwDho>pV1ZA{&a~sMZ7heU3 z$MglWxqta{=T5YxTN?_{j{A8sa+!VdkYspFG=A{r5xQjoc3OSG6@G!t>ljAAF5|LN zPt{jCkwTQM#Tf6KOv1c^faKn*Lnjhv>0eaL>Ce%T6^*@OrLmK0^NQMp5dU~XrEGV` z4bw0&C#*&yN+t?cfq&{ki|mHFI>0>%VNRJobWa>~ z6m)>g(H)1B79oMQ8!4Xu#DlAL9h|U=3Rf){1tNu2k0BP>kAYlpPT(vX8QK6hEq)u8^3|wKA#~@?`?ECy zOzGcQz&@>zmV*Paa&uaVYbm<;Oy3KYbK+W382k$Isj1 zfu9BS>#6u%Ak9ll{Af}zxPTfbRWk0ETv{%>|M8^en14L!rRdmgV6^7BC-wn;4NR+? zd-IUsndg&PFz7!#=^VPYCg@K-V^P^?a6)7F_85`z74T9lnUnLIex(N{2MdqSABJ51 zWivoQh@_K58xX)*2c*$R02O_PA5`o8Q@tOEJBcbd=#i({Niie5IpmDtB!2*&;@-Sm z_5m{B!7ytRqW}qx!vu_qy_lNnS~fkM(+5qvb|;qCaj?#2z3pYg?6EKzb7^KaaDFo) z-2E-?%1~2InKy2_oD=Q4Cn%Hcf#IZ%5nAhBt@!0-Xjjq+Jn*AeKGQym8)QpdD1=Zu zMp~~xSRX0ZgY}ii57L!N@iP49f^W|7P}}2-g!N-19Ex)SutNBMCA_I z4o(@8Ve^}hcz%aGtFS>pLn5#1q_lbHr_i9+Q*yRJKb@TQe;oiY4CnE9h`dOk)RA!K zAXu7-ya1tH5Kr%ai1=roP^u@u$S;|O_>J6b%fzBEc_RI)az$zoS_-2uPPimAvr8FL zpNxsMA`Q;I~3~4o0LJsj4rqZla`glvEX%aE^OdeggFAjf1p_6OIt{hgNTzeU6Tlb=PF)92x1o;-hsl$OuD4h6Vve2F4_Qmv zRrMjOifE`K$quui1RRu{hZ%_5c)cY(4UMDSAiSJd_qS@GxO**{>-TZZQF-eJi5PK5 z28ppIJg73{9ls!Pxc>8)%8UyBKm~YJt4}g+iYUax0Ezh?6qLr}=?`6s=b7SE*vPGR z!cec-I%9`yVa)GqBZj)&V_R*5q(q3L-)p0&jKk!daRmqus~*p`yG)lT)wSU|8XQc@ zjx#)0xGLEZ!u-Q_eL@ecE3+C0l{VZxFwCV(@ z=}2_90@>;R4dO>@E@@4R8AHUd%a;rs=iqgXDpfL*0a!%|zJB%MM!#&f-S-Cc_0Z(+ zs1`|LLCN58&jdw+^v6}hHs2z+1h&$F-31J^J*HJaM;A`jiensSIBH69_KQPgw|4bl z)p1@VlH}qos=2J2<>5IoOMtmp#%0k#vtL}(82%BK@qO|i;teE*pa_;(mH;&QEWq;hrLUV4jp2f z+E5;rF_h(L!+#RbpSIEFJ^?HU_R^xVH-|u%EYB}b%R09D)jD1GZbuy{T`e$qI>;u7 zw%&S>nAq8(KI*xYJ=M4$@CYWPZ5E7WBE9)Hvc7KGMovHjEOd0W3p0&<@@4qdESFJk zw;gAV3E0uhAnb~g$EcNuOv$zJ%Z!{{r@drx%_cGU4JnSKW+9fm2roB?pEKu()OK;7 z1RV1?WEm^kw=Ms#X@_LrhAZL*hkJ{t%8~3 z1&ZA4Q3-3>{f@wgq-ex;75MTHtRSTDIZuB8h21`+B*)E$=ibw(dufsD8tSEUlI6UE zaG~ttV>G;f@!+SOVY&>`E2!hkSxf(4td6i7hGt zWKAvLSM*@t4^Vr#v-qdHsY3Td{(U98_QAleqYrm?y&J0Iq)V*CQ-GnH6f4V#DgXA3 z0E;6SvYQzr*E$wL3weG*o)sJNMIDQ4nCm41dJ}-^*iMy4%jOzcQRft6vPILB+f}lG zH%T9-)oi~?)is9FS`v*G!Ep#rZdJ{J>kYPD{S zrFMWk>{|ibn5;$DW)tn3=3CV{t1^#B*HfnUd_ERu(pCMMLH1biplm$oA7VO@if;T% z7_;)6Nw!X9qcW#MO>G~9rvSNzyV=>3cnecR<@2vl)-)Nf;wu}=99-`l<50YM!JVvJ zaMC#`eqU!8NG3*cUm%r-;vZs)_UABIuI?H>-EKs3)`v8`!EImDv;qhObh{dkMAK$b zcMFsd6M0iX3pB&C&4YgMM%|HI40AKXtsPB z*o@7?SqI9~F`CWAgSzN{QQNDStR=Woy>tLiw1z4ND}tuLFuJUQg6{D3M%5H&{&fxQ zkLyF&cKUV*dbyuqv<|sX5B!ef$7;Z%-}u!GJD>-2!|`)4;8~|`x(2yR52XGBH0n9V zY|b{98OJ-Vdieg5LDO}dKUh>51xqE~*rGADNmHIx>YUo`-7b@A5R?y5t=QW#vj2HtO}zq7XB z83lwF8O?Zh36@|28NOQP)?hf+vM;k?)h^YN$^J!x#w*5WuD=3DdUwwwp#V#sx|yv= zn^sa*aKrhZ^k8wbq21|%y|(gXH4(zTD57S?Gk`2RK+YCn+oEAemADAP9*3n!|D}u- zaU-}y+t|VD?%SJ3dA|Wfm0``2u;XDq{pFh7&76NUUUfmCVB5@6EEn)uZ0@2I&nf$$ zf4j283;U2-usR)kp&rq)lrqE%cy(H`lqtAxwusj>k%?8XmhoyKg@dg~`8@DgVMQya z^LJax6de4(oJ05>wEJq5H>{ee2p!e%we`)4{$Rw4H6AtdJ-~3IL#WAB3)$@{el8}pgDlqe<7K;jUks=-Ymg))jyOD4a1Ui+^ z+gU4Pzb8ePR|BG`7_+5I~Z4?fWNCYWfkP@2GqzVKn zQWZsz8hY;p=@N>7NbenKa%qZa=tU4j5R@jN2Qc(1A}E3&B1Os|gu)s)uWtl9YaIB4HX%&UVQ0I>D?e~*KH(H1q~2oJcM`>zl}4^7ou zL6<4(zm%oj5i}=zrm8N&%rzQv&4_57xET5lSu?$CIhwy;Usnu?x=n5^GwCC_7Bm%H z&gBp693;tRW`3|OND(~zz%5l%UYZbak~LqXiJheFOFNw|pMw4wLebF6=Eivph5C)s z{c9)BahUk^ojUhquJWdgt11XdB)4N4ALG(mbLN_D6QP_Kuxy+3O=h)|aX=ocsryXUj#<4!*`M5<(_A=|PS z(-V|2>gc7Q282gi<`5vK5Fe$BSU@#hhGT@q@Obf2dQ#S;gIi*L3m zxHdcK48Lco6bb)_GIDS6rm;7cGQ#?QV+G0orHtt7Xx{jVcIh_wht_AhOHwS+4XaMA z5caK@b!0LskYD$!*&GF4w>>tYc6jY|#U`TU&FP#a>M)9$pkDFWn6H z-3eHGu$XrL8L5!qf+TkPO&H&1DX-0c={Y}3yQ=iLeYH@42dPE^;Yh7jfaG%R5>Ee z2hx#@t!&bruCJ^4!xvOir@c$#}(N z*g2GJ;MBqxxHq-SbXUlFTC5=9Vv3w}K-ph(#a>EOuH2;AlZj@f^R%x_dhWjuh?$Dn z@Y(QvDZbM-va?h86a&3vQ%)7b2^WD zb}|TivV<_a`7`QRCRbN5yj@?&inzh!BDm)`7oH?Z|iOfb^`T&eSLP_86nuavsatg7pS z5K3&sA5_-d+SI0Gw58*?}1E|e0sd>==XImzBtbBb9Yntfbq)|(zE zqy3Ce+%_fkM#a=kKYbaXsv^iH1- z2cHG7+P$#sCcG+7x*{i%5Jht4(kSiLEp9VUFM`|>GGH1n3m{( zK7X$v2`X1F1+^<%jZCBF!A8m4OXQ2hES2o-%LsaC0@SGM(J9ulQNYYd=I7*LDpN#i z3!xq2JkXthkNU@_K|-qA>MBrMBH#z;R{1&R0kWiG+u5;*U00g@ShPv@! zBob6V;N3H+FRnV75EqTE?*z}EH7@BR5+6ZhPg-})-FAs>W{Vl8e5H8lm+U?kbfS?I zvuU}>7jH1kT=ZaG-P9B^q{W#up18 zn9u5B0D`=9uDT~8NXe0kX~1-J)#V>SlF{A6aHZ0f)b=O7#pLD{Wie#;cp_Cn?*xI3 zRQE*G$6Coj`(mV=UOSRWVMcTwUxO^>g0D~862U*EMvJ>#j0+Z8wyzC#)n^iZJ38qo z$~jg-c9Njft*WKHu3D{% z^z+)%Qnmc5)x+m0D@;BsC&lNyZb=FCgZO_)N#87iC5y=!$e=Uto^T%haz;(s+`4U| zm#c+OgNDbY!1?OM`@O;*X9N{R#+8X{Y{mtJvi=LVSR^4Y8aT4GV4 zmz94W^tP^Q*kbVKJX>yLwzH(Ta#SCRO5X?mjX}9{AWCUaKb6+K`Rtkx%0DZ(^pZIk z^kmeP$I$HUTG41xw%bN3rt9&;4P+JAd6*>Wg+0Y<2L}TqCdH&)Q2joLMU1F!a&Ig8 z!uLg)Rbneh>{@O~oPW7H=C*7w>~j2hB1ss+cK{86xvTF!?uptPZT@tT*;CjG0|Zcx z2nRGU4#U!Dc@T|iY|EQ#jrVWQ43^uGOi=dx^)`UQLq@mTAVBefXM-1*473-Fu0$;x zAb_;8XgF^iJKKWeL#wt`+QD)7WZMoo1oT0pp@Lfgq7$m_wxdt|io8ySiDzw5S2)BT zdN~vcag2~-8Lk!ugas146pAWVo=c@w7pOgjSt#F^vF-DyTzcilLKYzw!lSgf$Ddp4 z3Gjr-+IJD3-{;kn-t_m>ZsW*#?v7Bu@qS8V=Y2}>EX;qppa}IU-`SzAn4>_ z7vP~ToTsmQyX2`OODH%?G>E<>!taSHc=hmM0GHMz^QM-tQwAFrYyPpIzG1?KQ@tOP zx6Ne(ie7@N4c0f$et|Mm^$|LDZH*2$Xp;DEmoFB)Q{aj^(fZb7puA@Y31t9Q%#8^q zUr;__t{p4{&QXrYAu6dIkpU;YAQsdXXF1WRFA))_(N8>+A;b>4#`7j-uyRAG7Y(sWH?NC;jam z+gv!;F^G}m!n{uFn;k6nar_iH!SKxVA(xDkmR&6chq|ThLRS&k_GRXLpd>{J!>x5g z(jQmW2|HCdLZhb8iq|(O4Ht`x!xL+*lUYL;*}2u_XPJ6hlH(_I?iS_h5+l{rkN|nP z^m)Em-`q&1F$l)q`%c0YjXHy63}3hxSLlQJnUGG=y#dnLy*8F9_%}5@45hPFM(hM( zvAy4fT280Omcv+$(-YqO>Za-*Et3hiyDPEN!ZDO>L}lBrZem`0X7p}8PWSel&bm-S zYvy6Kd+Lp>-fl5A6AZEp&ozzw?zW}e3hINXs4O(qucslSnwIG9SUY&H@X4jHizhwW z>=|Mamal3Dnw;mXy_Lj}^VAullD^n-wLETN@pQTL>p+I7XKe+FI;w{2uj}1BmbBmrPwNe2S}!H6e{*ekSO1p;9C zOvlOr4tEjQ>-a}T4WI^q!Qh`V#viAK$gzaE3T%ov)iKF=?AA}&6-zgFR|_lm17h<9 z`-AVrHJEfvf{_)WnL+dD}1KB_=$=MFvokn@f2gB#0o5Y2Z~VAeyQV?llR zdfe=a<9beP4B*dpVD(2)F8F%f7=?p`i=(y<+nToxq09G7HqTuyTRP>zdi!l1*95*4e{|^)BZ(|1T z%=P#|Wehnq!N1dh-wxdI^k9m6RKuZ%7QZIEFl7*S1UVR0&H!AnV_j(c!Pfr(spg}_ diff --git a/dap4/d4lib/src/main/java/dap4/dap4lib/netcdf/Nc4Cursor.java b/dap4/d4lib/src/main/java/dap4/dap4lib/netcdf/Nc4Cursor.java deleted file mode 100644 index ef41bbb618..0000000000 --- a/dap4/d4lib/src/main/java/dap4/dap4lib/netcdf/Nc4Cursor.java +++ /dev/null @@ -1,655 +0,0 @@ -/* - * Copyright 2012, UCAR/Unidata. - * See the LICENSE file for more information. - */ - -package dap4.dap4lib.netcdf; - -import com.sun.jna.Native; -import dap4.core.data.DataCursor; -import dap4.core.dmr.*; -import dap4.core.util.*; -import dap4.dap4lib.AbstractCursor; -import dap4.dap4lib.LibTypeFcns; -import ucar.nc2.jni.netcdf.Nc4prototypes; -import ucar.nc2.jni.netcdf.SizeT; -import java.lang.reflect.Array; -import java.nio.ByteBuffer; -import java.nio.charset.Charset; -import java.nio.charset.StandardCharsets; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import static dap4.dap4lib.netcdf.Nc4DSP.Nc4Pointer; -import static dap4.dap4lib.netcdf.Nc4Notes.*; - - -public class Nc4Cursor extends AbstractCursor { - - ////////////////////////////////////////////////// - - public static boolean DEBUG = false; - - // if the default charset being used by java isn't UTF-8, then we will - // need to transcode any string read into netCDf-Java via netCDF-C - private static final boolean transcodeStrings = Charset.defaultCharset() != StandardCharsets.UTF_8; - - ////////////////////////////////////////////////// - // Instance variables - - protected Nc4Pointer memory = null; - - ////////////////////////////////////////////////// - // Constructor(s) - - public Nc4Cursor(Scheme scheme, Nc4DSP dsp, DapVariable template, Nc4Cursor container) throws DapException { - super(scheme, dsp, template, container); - if (DEBUG) - debug(); - } - - public Nc4Cursor(Nc4Cursor c) { - super(c); - assert false; - this.memory = c.getMemory(); - } - - ////////////////////////////////////////////////// - // AbstractCursor Interface API Implementations - - @Override - public Object read(Index index) throws DapException { - return read(DapUtil.indexToSlices(index)); - } - - @Override - public Object read(List slices) throws DapException { - switch (this.scheme) { - case ATOMIC: - return readAtomic(slices); - case STRUCTURE: - case SEQUENCE: - if (((DapVariable) this.getTemplate()).getRank() > 0 || DapUtil.isScalarSlices(slices)) - throw new DapException("Cannot slice a scalar variable"); - return this; - case STRUCTARRAY: - Odometer odom = Odometer.factory(slices); - DataCursor[] instances = new DataCursor[(int) odom.totalSize()]; - for (int i = 0; odom.hasNext(); i++) { - instances[i] = readStructure(odom.next()); - } - return instances; - case SEQARRAY: - odom = Odometer.factory(slices); - instances = new DataCursor[(int) odom.totalSize()]; - for (int i = 0; odom.hasNext(); i++) { - instances[i] = readSequence(odom.next()); - } - return instances; - default: - throw new DapException("Attempt to slice a scalar object"); - } - } - - @Override - public Nc4Cursor readField(int findex) throws DapException { - // Preliminaries - DapVariable template = (DapVariable) getTemplate(); - DapStructure struct = (DapStructure) template.getBaseType(); - if (findex < 0 || findex >= struct.getFields().size()) - throw new DapException("Field index out of range: " + findex); - DapVariable field = struct.getField(findex); - // Get VarNotes and TypeNotes - VarNotes fi = (VarNotes) ((Nc4DSP) getDSP()).find(field); - TypeNotes ti = fi.getBaseType(); - Nc4Cursor cursor = new Nc4Cursor(schemeFor(field), (Nc4DSP) this.dsp, field, this); - Nc4Pointer mem = getMemory(); - // Handle records and structures somewhat differently - if (this.scheme == scheme.STRUCTURE) { - // do nothing - } else if (this.getScheme() == Scheme.RECORD) { - if (findex != 0) // need to use the first field of the sequence - throw new DapException("Field index out of range: " + findex); - // For fields, the record memory and the field memory are the same - // because the record contains only 1 rank-0 field. - } else // Error - throw new DapException("readfield expected STRUCTURE or RECORD cursor"); - cursor.setMemory(mem); - return cursor; - } - - @Override - public long getRecordCount() { - assert (this.scheme == scheme.SEQUENCE); - if (this.recordcount < 0) - throw new IllegalStateException("Sequence has no record count"); - return this.recordcount; - } - - @Override - public Nc4Cursor readRecord(long recno) throws DapException { - assert (this.scheme == scheme.SEQUENCE); - DapVariable template = (DapVariable) getTemplate(); - if (recno < 0 || recno >= getRecordCount()) - throw new ArrayIndexOutOfBoundsException("Illegal record id: " + recno); - VarNotes vn = (VarNotes) ((Nc4DSP) getDSP()).find(template); - TypeNotes ti = vn.getBaseType(); - assert (ti.isVlen()); - DapStructure ds = (DapStructure) template.getBaseType(); - DapVariable field = ds.getField(0); - DapType ftype = field.getBaseType(); - TypeNotes fnotes = (TypeNotes) ((Nc4DSP) getDSP()).find(ftype); - // The memory is a vector of objects, where the object type - // is the type of the first field of the sequence - // We need to extract the recno'th object from our memory - Nc4Pointer record = getMemory(); // should be the vector of records - long recsize = getElementSize(fnotes); - // point to the recno element in the vector - record = record.share(recno * recsize, recsize); - Nc4Cursor rec = new Nc4Cursor(Scheme.RECORD, (Nc4DSP) getDSP(), (DapVariable) getTemplate(), this); - /* - * Nc4Pointer seqvlen = getMemory(); - * long vlensize = Nc4prototypes.Vlen_t.VLENSIZE; - * Nc4Pointer recnovlen = seqvlen.share(vlensize*recno,vlensize); // recno'th vlen - * Nc4prototypes.Vlen_t vleninstance = new Nc4prototypes.Vlen_t(recnovlen.p); - * vleninstance.read(); // get the actual vlen contents for this sequence - * Pointer vlenmem = vleninstance.p; - * int vlencount = vleninstance.len; - * TypeNotes fvtype = getVlenType(field); - * long elemsize = fvtype.getSize(); // vlen.p is vector of objects of this size - * Nc4Pointer objectvec = new Nc4Pointer(vlenmem, elemsize * vlencount); - * // Now, we want the recno'th object in the vector - * Nc4Pointer record = objectvec.share(elemsize * recno, elemsize); - */ - rec.setMemory(record).setRecordIndex(recno); - return rec; - } - - - @Override - public Index getIndex() throws DapException { - if (this.scheme != Scheme.STRUCTURE && this.scheme != Scheme.SEQUENCE) - throw new DapException("Not a Sequence|Structure instance"); - return this.arrayindex; - } - - ////////////////////////////////////////////////// - // Support Methods - - protected Object readAtomic(List slices) throws DapException { - if (slices == null) - throw new DapException("DataCursor.read: null set of slices"); - assert (this.scheme == scheme.ATOMIC); - DapVariable atomvar = (DapVariable) getTemplate(); - int rank = atomvar.getRank(); - assert slices != null && ((rank == 0 && slices.size() == 1) || (slices.size() == rank)); - // Get VarNotes and TypeNotes - Notes n = ((Nc4DSP) this.dsp).find(this.template); - Object result = null; - long count = DapUtil.sliceProduct(slices); - VarNotes vn = (VarNotes) n; - TypeNotes ti = vn.getBaseType(); - if (getContainer() == null) { - if (rank == 0) { // scalar - result = readAtomicScalar(vn, ti); - } else { - result = readAtomicVector(vn, ti, count, slices); - } - } else {// field of a structure instance or record - long elemsize = ((DapType) ti.get()).getSize(); - assert (this.container != null); - long trueoffset = computeTrueOffset(this); - Nc4Pointer varmem = getMemory(); - Nc4Pointer mem = varmem.share(trueoffset, count * elemsize); - result = getatomicdata(ti.getType(), count, elemsize, mem); - } - return result; - } - - /** - * Read a top-level scalar atomic variable - * - * @param vi - * @param ti - * @return Object scalar - * @throws DapException - */ - protected Object readAtomicScalar(VarNotes vi, TypeNotes ti) throws DapException { - DapVariable atomvar = (DapVariable) getTemplate(); - // Get into memory - Nc4prototypes nc4 = ((Nc4DSP) this.dsp).getJNI(); - int ret; - DapType basetype = ti.getType(); - Object result = null; - if (basetype.isFixedSize()) { - long memsize = ((DapType) ti.get()).getSize(); - Nc4Pointer mem = Nc4Pointer.allocate(memsize); - readcheck(nc4, ret = nc4.nc_get_var(vi.gid, vi.id, mem.p)); - setMemory(mem); - result = getatomicdata(ti.getType(), 1, mem.size, mem); - } else if (basetype.isStringType()) { - String[] s = new String[1]; - readcheck(nc4, ret = nc4.nc_get_var_string(vi.gid, vi.id, s)); - if (transcodeStrings) { - s = transcodeString(s); - } - result = s; - } else if (basetype.isOpaqueType()) { - Nc4Pointer mem = Nc4Pointer.allocate(ti.getSize()); - readcheck(nc4, ret = nc4.nc_get_var(vi.gid, vi.id, mem.p)); - setMemory(mem); - ByteBuffer[] buf = new ByteBuffer[1]; - buf[0] = mem.p.getByteBuffer(0, ti.getSize()); - result = buf; - } else - throw new DapException("Unexpected atomic type: " + basetype); - return result; - } - - protected Object readAtomicVector(VarNotes vi, TypeNotes ti, long count, List slices) throws DapException { - DapVariable atomvar = (DapVariable) getTemplate(); - DapType basetype = ti.getType(); - if (atomvar.getCount() == 0) - return LibTypeFcns.newVector(basetype, 0); - // Convert slices to (start,count,stride); - int rank = atomvar.getRank(); - List dimset = atomvar.getDimensions(); - Odometer odom = Odometer.factory(slices, dimset); - List subodoms = odom.getSubOdometers(); - // Compute the total size of returned objects - long totalsize = 0; - for (int i = 0; i < subodoms.size(); i++) { - Odometer ithodom = subodoms.get(i); - totalsize += ithodom.totalSize(); - } - Nc4prototypes nc4 = ((Nc4DSP) this.dsp).getJNI(); - SizeT[] startp = new SizeT[rank]; - SizeT[] countp = new SizeT[rank]; - SizeT[] stridep = new SizeT[rank]; - int ret; - long edgecount; - Odometer ithodom; - Object partialresult; - Object result = LibTypeFcns.newVector(basetype, totalsize); - int pos = 0; - for (int i = 0; i < subodoms.size(); i++) { - ithodom = subodoms.get(i); - edgecount = odomToEdges(ithodom, startp, countp, stridep); - if (basetype.isFixedSize()) { - long elemsize = ti.getSize(); - long memsize = edgecount * elemsize; - Nc4Pointer mem = Nc4Pointer.allocate(memsize); - readcheck(nc4, ret = nc4.nc_get_vars(vi.gid, vi.id, startp, countp, stridep, mem.p)); - partialresult = getatomicdata(ti.getType(), edgecount, elemsize, mem); - } else if (basetype.isStringType()) { - String[] ss = new String[(int) edgecount]; - readcheck(nc4, ret = nc4.nc_get_vars_string(vi.gid, vi.id, startp, countp, stridep, ss)); - if (transcodeStrings) { - ss = transcodeString(ss); - } - partialresult = ss; - } else if (basetype.isOpaqueType()) { - long elemsize = ti.getSize(); - edgecount = odomToEdges(ithodom, startp, countp, stridep); - long memsize = edgecount * elemsize; - Nc4Pointer mem = Nc4Pointer.allocate(memsize); - readcheck(nc4, ret = nc4.nc_get_vars(vi.gid, vi.id, startp, countp, stridep, mem.p)); - partialresult = new ByteBuffer[(int) edgecount]; - for (int ec = 0; ec < edgecount; ec++) { - byte[] buf = mem.p.getByteArray(ec * ti.getSize(), (int) ti.getSize()); - ((ByteBuffer[]) partialresult)[ec] = ByteBuffer.wrap(buf); - } - } else - throw new DapException("Unexpected atomic type: " + basetype); - int len = Array.getLength(partialresult); - System.arraycopy(partialresult, 0, result, pos, len); - pos += len; - } - return result; - } - - protected Nc4Cursor readStructure(Index index) throws DapException { - assert (index != null); - assert this.scheme == Scheme.STRUCTARRAY; - DapVariable template = (DapVariable) getTemplate(); - VarNotes vi = (VarNotes) ((Nc4DSP) this.dsp).find(template); - TypeNotes ti = vi.basetype; - Nc4Pointer mem; - Nc4Cursor cursor = null; - if (template.isTopLevel()) { - int ret; - mem = Nc4Pointer.allocate(ti.getSize()); - Nc4prototypes nc4 = ((Nc4DSP) this.dsp).getJNI(); - if (index.getRank() == 0) { - readcheck(nc4, ret = nc4.nc_get_var(vi.gid, vi.id, mem.p)); - } else { - SizeT[] sizes = indexToSizes(index); - readcheck(nc4, ret = nc4.nc_get_var1(vi.gid, vi.id, sizes, mem.p)); - } - cursor = new Nc4Cursor(Scheme.STRUCTURE, (Nc4DSP) this.dsp, template, this); - } else {// field of a structure instance or record - long pos = index.index(); - if (pos < 0 || pos >= template.getCount()) - throw new IndexOutOfBoundsException("read: " + index); - cursor = new Nc4Cursor(Scheme.STRUCTURE, (Nc4DSP) this.dsp, template, this); - // Ok, we need to operate relative to the parent's memory - // move to the appropriate offset - mem = ((Nc4Cursor) getContainer()).getMemory().share(pos * ti.getSize(), ti.getSize()); - } - cursor.setIndex(index); - cursor.setMemory(mem); - return cursor; - } - - protected Nc4Cursor readSequence(Index index) throws DapException { - assert (index != null); - assert this.scheme == Scheme.SEQARRAY; - DapVariable template = (DapVariable) getTemplate(); - VarNotes vi = (VarNotes) ((Nc4DSP) this.dsp).find(template); - TypeNotes ti = vi.basetype; - Nc4Pointer mem; - Nc4Cursor cursor = null; - Nc4prototypes.Vlen_t[] vlen = new Nc4prototypes.Vlen_t[1]; - // Given a seq var e.g v(d1,d2), where we have an index argument, - // get that object, which will be a vlen - if (template.isTopLevel()) { - int ret; - Nc4prototypes nc4 = ((Nc4DSP) this.dsp).getJNI(); - SizeT[] extents = indexToSizes(index); - // read te index't vlen - readcheck(nc4, ret = nc4.nc_get_var1(vi.gid, vi.id, extents, vlen)); - } else {// field of a structure instance or record - long pos = index.index(); - if (pos < 0 || pos >= template.getCount()) - throw new IndexOutOfBoundsException("read: " + index); - // The memory for a sequence field is the vector of vlen objects. - // We need to extract the index'th vlen for this field - Nc4Pointer pp = getMemory(); // should be the vector - int vlensize = Nc4prototypes.Vlen_t.VLENSIZE; - // point to the index'th element in the vector - pp = pp.share(pos * vlensize, vlensize); - // convert to a Vlen_T object - vlen[0] = new Nc4prototypes.Vlen_t(pp.p); - vlen[0].read(); - } - // At this point, vlen[0] is the index'th vlen - // Construct a sequence cursor whose memory is the memory of the vlen - // (which is the vector of records) - cursor = new Nc4Cursor(Scheme.SEQUENCE, (Nc4DSP) this.dsp, template, this); - cursor.setRecordCount(vlen[0].len); - long memsize = ti.getSize() * cursor.getRecordCount(); - mem = new Nc4Pointer(vlen[0].p, memsize); - cursor.setMemory(mem); - cursor.setIndex(index); - return cursor; - } - - ////////////////////////////////////////////////// - // Nc4Cursor Extensions - - public long getOffset() { - DapVariable dv = (DapVariable) getTemplate(); - Notes n = ((Nc4DSP) this.dsp).find(dv); - return n.getOffset(); - } - - public long getElementSize() { - DapVariable dv = (DapVariable) getTemplate(); - Notes n = ((Nc4DSP) this.dsp).find(dv); - return n.getSize(); - } - - public Nc4Pointer getMemory() { - return this.memory; - } - - public Nc4Cursor setMemory(Nc4Pointer p) { - this.memory = p; - return this; - } - - ////////////////////////////////////////////////// - // Utilities - - protected long getElementSize(TypeNotes ti) { - DapType type = ti.getType(); - switch (type.getTypeSort()) { - case Structure: - case Sequence: - return ti.getSize(); - case String: - case URL: - // 8/16/2019 jlcaron upgrade to jna 5.4.0 - // com.sun.jna.Pointer#SIZE is removed. Its use is replaced by - // com.sun.jna.Native#POINTER_SIZE to prevent a class loading deadlock, when JNA is initialized from multiple - // threads - return Native.POINTER_SIZE; - case Enum: - return getElementSize((TypeNotes) ((Nc4DSP) getDSP()).find(ti.enumbase, NoteSort.TYPE)); - case Opaque: - return ti.getSize(); - default: - return type.getSize(); - } - } - - protected Object getatomicdata(DapType basetype, long lcount, long elemsize, Nc4Pointer mem) { - Object result = null; - TypeSort sort = basetype.getTypeSort(); - int icount = (int) lcount; - switch (sort) { - case Char: - // need to extract and convert utf8(really ascii) -> utf16 - byte[] bresult = mem.p.getByteArray(0, icount); - char[] cresult = new char[bresult.length]; - for (int i = 0; i < icount; i++) { - int ascii = bresult[i]; - ascii = ascii & 0x7F; - cresult[i] = (char) ascii; - } - result = cresult; - break; - case UInt8: - case Int8: - result = mem.p.getByteArray(0, icount); - break; - case Int16: - case UInt16: - result = mem.p.getShortArray(0, icount); - break; - case Int32: - case UInt32: - result = mem.p.getIntArray(0, icount); - break; - case Int64: - case UInt64: - result = mem.p.getLongArray(0, icount); - break; - case Float32: - result = mem.p.getFloatArray(0, icount); - break; - case Float64: - result = mem.p.getDoubleArray(0, icount); - break; - case String: - case URL: - // TODO: properly free underlying strings - result = mem.p.getStringArray(0, icount); - break; - case Opaque: - ByteBuffer[] ops = new ByteBuffer[icount]; - result = ops; - for (int i = 0; i < icount; i++) { - ops[i] = mem.p.getByteBuffer(i * elemsize, elemsize); - } - break; - case Enum: - DapEnumeration de = (DapEnumeration) basetype; - result = getatomicdata((DapType) de.getBaseType(), lcount, elemsize, mem); - break; - } - return result; - } - - static long odomToEdges(Odometer odom, SizeT[] startp, SizeT[] countp, SizeT[] stridep) { - assert !odom.isMulti(); - int rank = odom.rank(); - List slices = odom.getSlices(); - for (int i = 0; i < rank; i++) { - Slice slice = slices.get(i); - startp[i] = new SizeT(slice.getFirst()); - countp[i] = new SizeT(slice.getCount()); - stridep[i] = new SizeT(slice.getStride()); - } - return DapUtil.sliceProduct(slices); - } - - public static void errcheck(Nc4prototypes nc4, int ret) throws DapException { - if (ret != 0) { - String msg = String.format("Netcdf: errno=%d; %s", ret, nc4.nc_strerror(ret)); - throw new DapException(msg); - } - } - - public static void readcheck(Nc4prototypes nc4, int ret) throws DapException { - try { - errcheck(nc4, ret); - } catch (DapException de) { - throw new DapException(de); - } - } - - static SizeT[] indexToSizes(Index index) { - SizeT[] sizes = new SizeT[index.getRank()]; - for (int i = 0; i < sizes.length; i++) { - sizes[i] = new SizeT(index.get(i)); - } - return sizes; - } - - /** - * Given a field ref, compute the true offset with respect to - * it top-level containing structure/record - * - * @param f field cursor - * @return - * @throws DapException - */ - long computeTrueOffset(Nc4Cursor f) throws DapException { - List path = getCursorPath(f); - long totaloffset = 0; - Nc4Cursor current; - - // First element is presumed to be a structure ore record variable, - // and that its memory covers only it's instance. - // Walk intermediate nodes - for (int i = 1; i < (path.size() - 1); i++) { - current = path.get(i); - DapVariable template = (DapVariable) current.getTemplate(); - VarNotes vi = (VarNotes) ((Nc4DSP) getDSP()).find(template); - - long size = vi.getSize(); - long offset = current.getOffset(); - long pos = 0; - switch (current.getScheme()) { - case SEQUENCE: - case STRUCTURE: - pos = current.getIndex().index(); - break; - case RECORD: - // readrecord will have set our memory to the start of the record - pos = 0; - break; - default: - throw new DapException("Illegal cursor type: " + current.getScheme()); - } - long delta = size * pos + offset; - totaloffset += delta; - } - assert path.get(path.size() - 1) == f; - totaloffset += f.getOffset(); - return totaloffset; - } - - /** - * Given a cursor, get a list of "containing" cursors - * with the following constraints. - * 1. the first element in the path is a top-level variable. - * 2. the remaining elements are the enclosing compound variables - * 3. the last element is the incoming cursor. - * - * @param cursor - * @return - */ - static List getCursorPath(Nc4Cursor cursor) { - List path = new ArrayList<>(); - for (;;) { - if (!cursor.getScheme().isCompoundArray()) // suppress - path.add(0, cursor); - if (cursor.getScheme() == Scheme.SEQUENCE) { - // Stop here because the sequence has the vlen mem as its mem - break; - } - Nc4Cursor next = (Nc4Cursor) cursor.getContainer(); - if (next == null) { - assert cursor.getTemplate().isTopLevel(); - break; - } - assert next.getTemplate().getSort() == DapSort.VARIABLE; - cursor = next; - } - return path; - } - - - static Nc4Pointer getVarMemory(Nc4Cursor cursor) { - while (cursor.getContainer() != null) { - cursor = (Nc4Cursor) cursor.getContainer(); - } - return cursor.getMemory(); - } - - /** - * If the basetype is sequence (=> isVlen()), - * then return the type of the first field of this sequence. - * Otherwise return null. - * - * @return the type of the first field - */ - public TypeNotes getVlenType(DapVariable v) { - DapType t = v.getBaseType(); - if (t.getSort() != DapSort.SEQUENCE || ((DapSequence) t).getFields().size() != 1) - throw new IllegalArgumentException(t.getFQN()); - DapSequence ds = (DapSequence) t; - DapVariable f0 = ds.getField(0); - DapType f0type = f0.getBaseType(); - return (TypeNotes) ((Nc4DSP) this.dsp).find(f0type); - } - - /** - * By default, JNA assumes strings coming into java from the C side are using - * the system encoding. However, netCDF-C encodes using UTF-8. Because of this, - * if we are on a platform where java is not using UTF-8 as the default encoding, - * we will need to transcode the incoming strings fix the incorrect assumption - * made by JNA. - * - * Note, we could set the system property jna.encode=UTF-8, but would impact the - * behavior of other libraries that use JNA, and would not be very nice of us to - * set globally (and often times isn't the right thing to set anyways, since the - * default in C to use the system encoding). - * - * @param systemStrings String array encoded using the default charset - * @return String array encoded using the UTF-8 charset - */ - private String[] transcodeString(String[] systemStrings) { - return Arrays.stream(systemStrings).map(systemString -> { - byte[] byteArray = systemString.getBytes(Charset.defaultCharset()); - return new String(byteArray, StandardCharsets.UTF_8); - }).toArray(String[]::new); - } - - protected void debug() { - System.err.printf("CURSOR: %s%n", this.toString()); - } - -} diff --git a/dap4/d4lib/src/main/java/dap4/dap4lib/netcdf/Nc4DMR.java b/dap4/d4lib/src/main/java/dap4/dap4lib/netcdf/Nc4DMR.java deleted file mode 100644 index 3534f35845..0000000000 --- a/dap4/d4lib/src/main/java/dap4/dap4lib/netcdf/Nc4DMR.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright 2012, UCAR/Unidata. - * See the LICENSE file for more information. - */ - -package dap4.dap4lib.netcdf; - -import dap4.core.dmr.*; - -public abstract class Nc4DMR { - ////////////////////////////////////////////////// - - public static class Nc4Attribute extends DapAttribute { - public Nc4Attribute(String name, DapType basetype) { - super(name, basetype); - } - } - - public static class Nc4AttributeSet extends DapAttributeSet { - public Nc4AttributeSet(String name) { - super(name); - } - } - - public static class Nc4Dimension extends DapDimension { - public Nc4Dimension(String name, long size) { - super(name, size); - } - } - - public static class Nc4Map extends DapMap { - public Nc4Map(DapVariable target) { - super(target); - } - } - - public static class Nc4Variable extends DapVariable { - public Nc4Variable(String name, DapType t) { - super(name, t); - } - } - - public static class Nc4Group extends DapGroup { - public Nc4Group(String name) { - super(name); - } - } - - public static class Nc4Dataset extends DapDataset { - public Nc4Dataset(String name) { - super(name); - } - } - - public static class Nc4Enumeration extends DapEnumeration { - public Nc4Enumeration(String name, DapType basetype) { - super(name, basetype); - } - } - - public static class Nc4EnumConst extends DapEnumConst { - public Nc4EnumConst(String name, long value) { - super(name, value); - } - } - - public static class Nc4Structure extends DapStructure { - public Nc4Structure(String name) { - super(name); - } - } - - public static class Nc4Sequence extends DapSequence { - public Nc4Sequence(String name) { - super(name); - } - } - - public static class Nc4OtherXML extends DapOtherXML { - public Nc4OtherXML(String name) { - super(name); - } - } -} diff --git a/dap4/d4lib/src/main/java/dap4/dap4lib/netcdf/Nc4DMRCompiler.java b/dap4/d4lib/src/main/java/dap4/dap4lib/netcdf/Nc4DMRCompiler.java deleted file mode 100644 index cb8a546e59..0000000000 --- a/dap4/d4lib/src/main/java/dap4/dap4lib/netcdf/Nc4DMRCompiler.java +++ /dev/null @@ -1,740 +0,0 @@ -/* - * Copyright 2012, UCAR/Unidata. - * See the LICENSE file for more information. - */ - -package dap4.dap4lib.netcdf; - -import com.sun.jna.Native; -import com.sun.jna.ptr.IntByReference; -import dap4.core.dmr.*; -import dap4.core.util.Convert; -import dap4.core.util.DapContext; -import dap4.core.util.DapException; -import dap4.core.util.DapUtil; -import ucar.nc2.ffi.netcdf.NetcdfClibrary; -import ucar.nc2.jni.netcdf.Nc4prototypes; -import ucar.nc2.jni.netcdf.SizeTByReference; -import static ucar.nc2.jni.netcdf.Nc4prototypes.*; -import static dap4.dap4lib.netcdf.Nc4DSP.*; -import static dap4.dap4lib.netcdf.Nc4Notes.*; - - -/** - * Compile netcdf file info into DMR - */ -public class Nc4DMRCompiler { - ////////////////////////////////////////////////// - // Constants - - public static final boolean DEBUG = false; - - // Define reserved attributes - public static final String UCARTAGVLEN = Nc4DSP.UCARTAGVLEN; - public static final String UCARTAGOPAQUE = Nc4DSP.UCARTAGOPAQUE; - - static final int NC_FALSE = 0; - static final int NC_TRUE = 1; - // "null" id(s) - public static final int NC_GRPNULL = 0; - public static final int NC_IDNULL = -1; - public static final int NC_NOERR = 0; - - static int NC_INT_BYTES = (java.lang.Integer.SIZE / java.lang.Byte.SIZE); - static int NC_LONG_BYTES = (Native.LONG_SIZE); - static int NC_POINTER_BYTES = (Native.POINTER_SIZE); - static int NC_SIZET_BYTES = (Native.SIZE_T_SIZE); - - protected static Nc4prototypes nc4 = NetcdfClibrary.getForeignFunctionInterface(); - - ////////////////////////////////////////////////// - // Static methods - - /** - * A path is file if it has no base protocol or is file: - * - * @param path - * @param context Any parameters that may help to decide. - * @return true if this path appears to be processible by this DSP - */ - public static boolean dspMatch(String path, DapContext context) { - for (String s : EXTENSIONS) { - if (path.endsWith(s)) - return true; - } - return false; - } - - ////////////////////////////////////////////////// - // Instance Variables - - protected boolean trace = false; - protected boolean closed = false; - - protected int ncid = -1; // file id - protected int format = 0; // from nc_inq_format - protected int mode = 0; - protected String path = null; - - protected String pathprefix = null; - - protected DMRFactory factory = null; - protected Nc4DSP dsp = null; - protected DapDataset dmr = null; - - ////////////////////////////////////////////////// - // Constructor(s) - - public Nc4DMRCompiler(Nc4DSP dsp, int ncid, DMRFactory factory) throws DapException { - this.dsp = dsp; - this.path = dsp.getLocation(); - this.ncid = ncid; - this.factory = factory; - } - - - ////////////////////////////////////////////////// - // Main entry point - - public DapDataset compile() throws DapException { - // create and fill the root group - buildrootgroup(this.ncid); - if (this.dmr != null) - dmr.finish(); - return this.dmr; - } - - ////////////////////////////////////////////////// - - protected void buildrootgroup(int ncid) throws DapException { - int ret; - byte[] namep = new byte[NC_MAX_NAME + 1]; - errcheck(ret = nc4.nc_inq_grpname(ncid, namep)); - String[] pieces = DapUtil.canonicalpath(this.path).split("[/]"); - DapDataset g = factory.newDataset(pieces[pieces.length - 1]); - GroupNotes gi = (GroupNotes) Nc4Notes.factory(NoteSort.GROUP, ncid, ncid, this.dsp); - gi.set(g); - this.dsp.note(gi); - this.dmr = g; - fillgroup(ncid); - } - - protected void fillgroup(int gid) throws DapException { - int ret, mode; - int[] dims = getDimensions(gid); - int[] udims = getUnlimitedDimensions(gid); - for (int dimid : dims) { - builddim(gid, dimid, udims); - } - int[] typeids = getUserTypes(gid); - for (int i = 0; i < typeids.length; i++) { - for (int j = 0; j < i; j++) { - if (typeids[i] == typeids[j]) - assert false; - } - } - - for (int typeid : typeids) { - buildusertype(gid, typeid); - } - int[] varids = getVars(gid); - for (int varid : varids) { - buildvar(gid, varid); - } - // globalattributes - String[] gattnames = getAttributes(gid, NC_GLOBAL); - for (String ga : gattnames) { - buildattr(gid, NC_GLOBAL, ga); - } - int[] groupids = getGroups(gid); - for (int groupid : groupids) { - buildgroup(gid, groupid); - } - } - - protected void buildgroup(int parent, int gid) throws DapException { - int ret; - byte[] namep = new byte[NC_MAX_NAME + 1]; - errcheck(ret = nc4.nc_inq_grpname(gid, namep)); - DapGroup g = factory.newGroup(Nc4DSP.makeString(namep)); - GroupNotes gi = (GroupNotes) Nc4Notes.factory(NoteSort.GROUP, parent, gid, this.dsp); - gi.set(g); - this.dsp.note(gi); - GroupNotes gp = (GroupNotes) this.dsp.find(parent, NoteSort.GROUP); - gp.get().addDecl(g); - fillgroup(gid); - } - - protected void builddim(int gid, int did, int[] udims) throws DapException { - int ret = NC_NOERR; - byte[] namep = new byte[NC_MAX_NAME + 1]; - SizeTByReference lenp = new SizeTByReference(); - errcheck(ret = nc4.nc_inq_dim(gid, did, namep, lenp)); - String name = Nc4DSP.makeString(namep); - int len = lenp.intValue(); - boolean isunlimited = contains(udims, did); - DapDimension dim = factory.newDimension(name, lenp.longValue()); - dim.setUnlimited(isunlimited); - DimNotes di = (DimNotes) Nc4Notes.factory(NoteSort.DIM, gid, did, this.dsp); - di.set(dim); - this.dsp.note(di); - GroupNotes gp = (GroupNotes) this.dsp.find(gid, NoteSort.GROUP); - gp.get().addDecl(dim); - if (trace) - System.out.printf("Nc4DSP: dimension: %s size=%d%n", name, dim.getSize()); - } - - protected void buildusertype(int gid, int tid) throws DapException { - int ret = NC_NOERR; - byte[] namep = new byte[NC_MAX_NAME + 1]; - SizeTByReference lenp = new SizeTByReference(); - IntByReference basetypep = new IntByReference(); - IntByReference classp = new IntByReference(); - SizeTByReference nfieldsp = new SizeTByReference(); - errcheck(ret = nc4.nc_inq_user_type(gid, tid, namep, lenp, basetypep, nfieldsp, classp)); - String name = Nc4DSP.makeString(namep); - int basetype = basetypep.getValue(); - long len = lenp.longValue(); - long nfields = nfieldsp.longValue(); - TypeNotes ti = (TypeNotes) Nc4Notes.factory(NoteSort.TYPE, gid, tid, this.dsp); - switch (classp.getValue()) { - case NC_OPAQUE: - buildopaquetype(ti, name, len); - break; - case NC_ENUM: - buildenumtype(ti, name, basetype); - break; - case NC_COMPOUND: - buildcompoundtype(ti, name, nfields, len); - break; - case NC_VLEN: - buildvlentype(ti, name, basetype, len); - break; - default: - throw new DapException("Unknown class: " + classp.getValue()); - } - } - - protected void buildopaquetype(TypeNotes ti, String name, long len) throws DapException { - int ret; - ti.setOpaque(len); - DapType dt = DapType.lookup(TypeSort.Opaque); - ti.set(dt); - this.dsp.note(ti); - } - - protected void buildenumtype(TypeNotes ti, String name, int basetype) throws DapException { - int ret; - SizeTByReference nmembersp = new SizeTByReference(); - SizeTByReference sizep = new SizeTByReference(); - byte[] namep = new byte[NC_MAX_NAME + 1]; - IntByReference basetypep = new IntByReference(); - IntByReference valuep = new IntByReference(); - TypeNotes base = (TypeNotes) this.dsp.find(basetype, NoteSort.TYPE); - if (!isintegertype(base)) - throw new DapException("Enum base type must be integer type"); - errcheck(ret = nc4.nc_inq_enum(ti.gid, ti.id, namep, basetypep, sizep, nmembersp)); - DapEnumeration de = factory.newEnumeration(name, DapType.lookup(base.getType().getTypeSort())); - ti.set(de); - this.dsp.note(ti); - ti.setEnumBaseType(basetype); - ti.group().addDecl(de); - // build list of enum consts - int nconsts = nmembersp.intValue(); - for (int i = 0; i < nconsts; i++) { - // Get info about the ith const - errcheck(ret = nc4.nc_inq_enum_member(ti.gid, ti.id, i, namep, valuep)); - String ecname = Nc4DSP.makeString(namep); - long ecval = (long) valuep.getValue(); - DapEnumConst dec = factory.newEnumConst(ecname, ecval); - de.addEnumConst(dec); - } - } - - protected void buildcompoundtype(TypeNotes ti, String name, long nfields, long len) throws DapException { - DapStructure ds = factory.newStructure(name); - ti.set(ds); - this.dsp.note(ti); - ti.group().addDecl(ds); - for (int i = 0; i < nfields; i++) { - buildfield(ti, i, ds); - } - // Finally, extract the size of the structure - int ret; - SizeTByReference sizep = new SizeTByReference(); - SizeTByReference nfieldsp = new SizeTByReference(); - byte[] namep = new byte[NC_MAX_NAME + 1]; - errcheck(ret = nc4.nc_inq_compound(ti.gid, ti.id, namep, sizep, nfieldsp)); - ti.setSize(sizep.longValue()); - assert len == sizep.longValue(); - assert name.equals(Nc4DSP.makeString(namep)); - // Add the netcdf4 name as an xml attribute. - ds.addXMLAttribute(UCARTAGORIGTYPE, name); - } - - protected void buildfield(TypeNotes ti, int fid, DapStructure container) throws DapException { - int ret; - byte[] namep = new byte[NC_MAX_NAME + 1]; - SizeTByReference offsetp = new SizeTByReference(); - IntByReference fieldtypep = new IntByReference(); - IntByReference ndimsp = new IntByReference(); - - // Get everything but actual dims - errcheck(ret = nc4.nc_inq_compound_field(ti.gid, ti.id, fid, namep, offsetp, fieldtypep, ndimsp, null)); - int fieldtype = fieldtypep.getValue(); - TypeNotes baset = (TypeNotes) this.dsp.find(fieldtype, NoteSort.TYPE); - if (baset == null) - throw new DapException("Undefined field base type: " + fieldtype); - int[] dimsizes = getFieldDimsizes(ti.gid, ti.id, fid, ndimsp.getValue()); - VarNotes fieldnotes = makeField(ti, fid, Nc4DSP.makeString(namep), baset, offsetp.intValue(), dimsizes); - assert baset.getSize() > 0; - } - - protected VarNotes makeField(TypeNotes container, int fieldid, String name, TypeNotes baset, int offset, - int[] dimsizes) throws DapException { - DapVariable field; - DapStructure ds = (DapStructure) container.getType(); - field = factory.newVariable(name, baset.getType()); - field.setParent(ds); - field.setFieldIndex(fieldid); - VarNotes notes = (VarNotes) Nc4Notes.factory(NoteSort.VAR, container.gid, container.id, this.dsp); - notes.setOffset(offset).setBaseType(baset).setContainer(container); - notes.set(field); - this.dsp.note(notes); - // set dimsizes - if (dimsizes.length > 0) { - for (int i = 0; i < dimsizes.length; i++) { - DapDimension dim = factory.newDimension(null, dimsizes[i]); - field.addDimension(dim); - } - } - ds.addField(field); - return notes; - } - - protected DapVariable buildvar(int gid, int vid) throws DapException { - int ret; - byte[] namep = new byte[NC_MAX_NAME + 1]; - IntByReference ndimsp = new IntByReference(); - IntByReference xtypep = new IntByReference(); - IntByReference nattsp = new IntByReference(); - errcheck(ret = nc4.nc_inq_var(gid, vid, namep, xtypep, ndimsp, null, nattsp)); - String name = Nc4DSP.makeString(namep); - TypeNotes xtype = (TypeNotes) this.dsp.find(xtypep.getValue(), NoteSort.TYPE); - if (DEBUG) { - System.err.printf("NC4: inqvar: name=%s gid=%d vid=%d xtype=%d ndims=%d natts=%d%n", name, gid, vid, xtype.id, - ndimsp.getValue(), nattsp.getValue()); - } - if (xtype == null) - throw new DapException("Unknown type id: " + xtype.id); - DapVariable var; - switch (((DapType) xtype.node).getTypeSort()) { - default: /* atomic */ - var = factory.newVariable(name, xtype.getType()); - break; - case Enum: - var = factory.newVariable(name, xtype.getType()); - break; - case Structure: - DapStructure st = (DapStructure) xtype.get(); - var = factory.newVariable(name, xtype.getType()); - break; - case Sequence: - DapSequence seq = (DapSequence) xtype.get(); - var = factory.newVariable(name, xtype.getType()); - break; - } - VarNotes vi = (VarNotes) Nc4Notes.factory(NoteSort.VAR, gid, vid, this.dsp); - vi.set(var); - this.dsp.note(vi); - vi.setBaseType(xtype); - vi.group().addDecl(var); - int[] dimids = getVardims(gid, vid, ndimsp.getValue()); - for (int i = 0; i < dimids.length; i++) { - DimNotes di = (DimNotes) this.dsp.find(dimids[i], NoteSort.DIM); - if (di == null) - throw new DapException("Undefined variable dimension id: " + dimids[i]); - var.addDimension(di.get()); - } - // Now, if this is of type opaque, tag it with the size - if (xtype.isOpaque()) { - var.addXMLAttribute(UCARTAGOPAQUE, Long.toString(xtype.getSize())); - } - // fill in any attributes - String[] attnames = getAttributes(gid, vid); - for (String a : attnames) { - buildattr(gid, vid, a); - } - return var; - } - - protected void buildvlentype(TypeNotes ti, String vname, int basetypeid, long len) throws DapException { - int ref; - // We map vlen to a sequence with a single field of the - // basetype of the vlen. Field name is same as the vlen type. - // So we need to build two things: - // 1. a Sequence object - // 2. a Field - DapSequence ds = factory.newSequence(vname); - ti.set(ds); - this.dsp.note(ti); - ti.group().addDecl(ds); - ti.markVlen(); - TypeNotes fieldtype = (TypeNotes) this.dsp.find(basetypeid, NoteSort.TYPE); - if (fieldtype == null) - throw new DapException("Undefined vlen basetype: " + basetypeid); - VarNotes fieldnotes = makeField(ti, 0, vname, fieldtype, 0, new int[0]); - // Annotate to indicate that this came from a vlen - ds.addXMLAttribute(UCARTAGVLEN, "1"); - - // Annotate to indicate that the original type name - ds.addXMLAttribute(UCARTAGORIGTYPE, ds.getFQN()); - - // Finally, extract the size of the structure, which is the same - // as the size of the singleton field - ti.setRecordSize(fieldtype.getSize()); - ti.setSize(Nc4prototypes.Vlen_t.VLENSIZE); - } - - protected void buildattr(int gid, int vid, String name) throws DapException { - int ret; - boolean isglobal = (vid == NC_GLOBAL); - IntByReference basetypep = new IntByReference(); - errcheck(ret = nc4.nc_inq_atttype(gid, vid, name, basetypep)); - int basetype = basetypep.getValue(); - TypeNotes base = (TypeNotes) this.dsp.find(basetype, NoteSort.TYPE); - if (!islegalattrtype(base)) - throw new DapException("Non-atomic attribute types not supported: " + name); - SizeTByReference countp = new SizeTByReference(); - errcheck(ret = nc4.nc_inq_attlen(gid, vid, name, countp)); - // Get the values of the attribute - String[] values = getAttributeValues(gid, vid, name, base, countp.intValue()); - DapAttribute da = factory.newAttribute(name, (DapType) base.getType()); - da.setValues(values); - if (isglobal) { - GroupNotes gi = (GroupNotes) this.dsp.find(gid, NoteSort.GROUP); - gi.get().addAttribute(da); - } else { - VarNotes vi = this.dsp.findVar(gid, vid); - vi.get().addAttribute(da); - } - } - - ////////////////////////////////////////////////// - - int[] getGroups(int gid) throws DapException { - int ret, n; - IntByReference ip = new IntByReference(); - errcheck(ret = nc4.nc_inq_grps(gid, ip, null)); - n = ip.getValue(); - int[] grpids = null; - if (n > 0) { - grpids = new int[n]; - errcheck(ret = nc4.nc_inq_grps(gid, ip, grpids)); - } else - grpids = new int[0]; - return grpids; - } - - int[] getDimensions(int gid) throws DapException { - int ret, n; - IntByReference ip = new IntByReference(); - errcheck(ret = nc4.nc_inq_ndims(gid, ip)); - n = ip.getValue(); - int[] dimids = new int[n]; - if (n > 0) - errcheck(ret = nc4.nc_inq_dimids(gid, ip, dimids, NC_FALSE)); - return dimids; - } - - int[] getUnlimitedDimensions(int gid) throws DapException { - int ret, n; - IntByReference ip = new IntByReference(); - errcheck(ret = nc4.nc_inq_unlimdims(gid, ip, null)); - n = ip.getValue(); - int[] dimids = new int[n]; - if (n > 0) - errcheck(ret = nc4.nc_inq_unlimdims(gid, ip, dimids)); - return dimids; - } - - int[] getUserTypes(int gid) throws DapException { - int ret, n; - IntByReference ip = new IntByReference(); - errcheck(ret = nc4.nc_inq_typeids(gid, ip, null)); - n = ip.getValue(); - int[] typeids = new int[n]; - if (n > 0) - errcheck(ret = nc4.nc_inq_typeids(gid, ip, typeids)); - return typeids; - } - - int[] getVars(int gid) throws DapException { - int ret, n; - IntByReference ip = new IntByReference(); - errcheck(ret = nc4.nc_inq_nvars(gid, ip)); - n = ip.getValue(); - int[] ids = new int[n]; - if (n > 0) - errcheck(ret = nc4.nc_inq_varids(gid, ip, ids)); - return ids; - } - - int[] getVardims(int gid, int vid, int ndims) throws DapException { - int ret; - int[] dimids = new int[ndims]; - - if (ndims > 0) { - byte[] namep = new byte[NC_MAX_NAME + 1]; - IntByReference ndimsp = new IntByReference(); - errcheck(ret = nc4.nc_inq_var(gid, vid, null, null, ndimsp, dimids, null)); - } - return dimids; - } - - int[] getFieldDimsizes(int gid, int tid, int fid, int ndims) throws DapException { - int ret; - int[] dimsizes = new int[ndims]; - if (ndims > 0) { - IntByReference ndimsp = new IntByReference(); - errcheck(ret = nc4.nc_inq_compound_field(gid, tid, fid, null, null, null, ndimsp, dimsizes)); - } - return dimsizes; - } - - String[] getAttributes(int gid, int vid) throws DapException { - int ret, n; - boolean isglobal = (vid == NC_GLOBAL); - IntByReference nattsp = new IntByReference(); - byte[] namep = new byte[NC_MAX_NAME + 1]; - IntByReference ndimsp = new IntByReference(); - IntByReference xtypep = new IntByReference(); - if (isglobal) - errcheck(ret = nc4.nc_inq_natts(gid, nattsp)); - else { - errcheck(ret = nc4.nc_inq_var(gid, vid, namep, xtypep, ndimsp, null, nattsp)); - } - n = nattsp.getValue(); - String[] names = new String[n]; - for (int i = 0; i < n; i++) { - errcheck(ret = nc4.nc_inq_attname(gid, vid, i, namep)); - names[i] = Nc4DSP.makeString(namep); - } - return names; - } - - String[] getAttributeValues(int gid, int vid, String name, TypeNotes tn, int count) throws DapException { - int ret; - // Currently certain types only are allowed. - if (!islegalattrtype(tn)) - throw new DapException("Unsupported attribute type: " + tn.getType().getShortName()); - if (isenumtype(tn)) - tn = enumbasetype(tn); - Object vector = getRawAttributeValues(tn, count, gid, vid, name); - DapType basetype = tn.getType(); - // basetype == Char requires special pre-conversion - // since the nc file data is coming back as utf-8, not utf-16. - if (basetype.isCharType()) { - byte[] data = (byte[]) vector; // raw utf-8 - String sdata = new String(data, DapUtil.UTF8); - char[] cdata = sdata.toCharArray(); - count = cdata.length; - vector = cdata; - } - String[] values = (String[]) Convert.convert(DapType.STRING, basetype, vector); - return values; - } - - Object getRawAttributeValues(TypeNotes base, int count, int gid, int vid, String name) throws DapException { - int nativetypesize = base.getType().getSize(); - if (isstringtype(base)) - nativetypesize = NC_POINTER_BYTES; - else if (nativetypesize == 0) - throw new DapException("Illegal Type Sort:" + base.get().getShortName()); - Object values = null; - if (count > 0) { - int ret; - long totalsize = nativetypesize * count; - Nc4Pointer mem = Nc4Pointer.allocate(totalsize); - errcheck(ret = nc4.nc_get_att(gid, vid, name, mem.p)); - switch (base.getType().getTypeSort()) { - case Char: - values = mem.p.getByteArray(0, count); - break; - case Int8: - values = mem.p.getByteArray(0, count); - break; - case UInt8: - values = mem.p.getByteArray(0, count); - break; - case Int16: - values = mem.p.getShortArray(0, count); - break; - case UInt16: - values = mem.p.getShortArray(0, count); - break; - case Int32: - values = mem.p.getIntArray(0, count); - break; - case UInt32: - values = mem.p.getIntArray(0, count); - break; - case Int64: - values = mem.p.getLongArray(0, count); - break; - case UInt64: - values = mem.p.getLongArray(0, count); - break; - case Float32: - values = mem.p.getFloatArray(0, count); - break; - case Float64: - values = mem.p.getDoubleArray(0, count); - break; - case String: - values = mem.p.getStringArray(0, count); - break; - case Opaque: - values = mem.p.getByteArray(0, (int) totalsize); - break; - case Enum: - break; - default: - throw new IllegalArgumentException("Unexpected sort: " + base.getType().getShortName()); - } - } - return values; - } - - /* - * Object[] - * convert(int count, Object src, TypeNotes basetype) - * throws DapException - * { - * boolean isenum = isenumtype(basetype); - * boolean isopaque = basetype.isOpaque(); - * TypeNotes truetype = basetype; - * if(isenum) - * truetype = enumbasetype(basetype); - * - * Object[] dst; - * if(ischartype(basetype)) - * dst = new Character[count]; - * else - * dst = new Object[count]; - * try { - * for(int i = 0; i < dst.length; i++) { - * switch (basetype.getType().getTypeSort()) { - * case Char: - * if(src instanceof char[]) - * dst[i] = ((char[]) src)[i]; - * else - * dst[i] = (char) (((byte[]) src)[i]); - * break; - * case Int8: - * case UInt8: - * dst[i] = ((byte[]) src)[i]; - * break; - * case Int16: - * case UInt16: - * dst[i] = ((short[]) src)[i]; - * break; - * case Int32: - * case UInt32: - * dst[i] = ((int[]) src)[i]; - * break; - * case Int64: - * case UInt64: - * dst[i] = ((long[]) src)[i]; - * break; - * case Float32: - * dst[i] = ((float[]) src)[i]; - * break; - * case Float64: - * dst[i] = ((double[]) src)[i]; - * break; - * case String: - * dst[i] = ((String[]) src)[i]; - * break; - * case Opaque: - * byte[] alldata = (byte[]) src; - * int oplen = alldata.length / count; - * for(i = 0; i < count; i++) { - * dst[i] = new byte[oplen]; - * System.arraycopy(alldata, oplen * i, dst[i], 0, oplen); - * } - * break; - * case Enum: - * dst = convert(count, src, truetype); - * break; - * default: - * throw new IllegalArgumentException("Unexpected sort: " + basetype.getType().getShortName()); - * } - * } - * return dst; - * } catch (IllegalArgumentException | - * ArrayIndexOutOfBoundsException e - * ) { - * throw new DapException(e); - * } - * } - */ - - protected void errcheck(int ret) throws DapException { - if (ret != 0) { - String msg = String.format("TestNetcdf: errno=%d; %s", ret, nc4.nc_strerror(ret)); - if (DEBUG) - System.err.println(msg); - throw new DapException(msg); - } - } - - boolean contains(int[] list, int value) { - for (int i = 0; i < list.length; i++) { - if (list[i] == value) - return true; - } - return false; - } - - boolean islegalattrtype(TypeNotes nctype) { - return isatomictype(nctype) || isenumtype(nctype) || nctype.isOpaque(); - } - - boolean isatomictype(TypeNotes t) { - return (t.id <= NC_MAX_ATOMIC_TYPE); - } - - boolean isstringtype(TypeNotes nctype) { - return (nctype.id == NC_STRING); - } - - boolean ischartype(TypeNotes t) { - return (t.id == NC_CHAR); - } - - boolean isintegertype(TypeNotes t) { - return (t.id <= NC_UINT64 && t.id != NC_CHAR); - } - - boolean isenumtype(TypeNotes nctype) { - return (nctype == null ? false : nctype.getType().isEnumType()); - } - - TypeNotes enumbasetype(TypeNotes etype) { - if (etype == null || !etype.getType().isEnumType()) - return null; - DapType dt = ((DapEnumeration) etype.getType()).getBaseType(); - return (TypeNotes) this.dsp.find(dt); - } - - protected String Nc4FQN(TypeNotes t) throws DapException { - int ret = 0; - // get enclosing ncid fqn - SizeTByReference lenp = new SizeTByReference(); - errcheck(ret = nc4.nc_inq_grpname_len(t.gid, lenp)); - byte[] namep = new byte[lenp.intValue() + 1]; - errcheck(ret = nc4.nc_inq_grpname_full(t.gid, lenp, namep)); - return Nc4DSP.makeString(namep); - } -} diff --git a/dap4/d4lib/src/main/java/dap4/dap4lib/netcdf/Nc4DSP.java b/dap4/d4lib/src/main/java/dap4/dap4lib/netcdf/Nc4DSP.java deleted file mode 100644 index 6c05c40251..0000000000 --- a/dap4/d4lib/src/main/java/dap4/dap4lib/netcdf/Nc4DSP.java +++ /dev/null @@ -1,405 +0,0 @@ -/* - * Copyright 2012, UCAR/Unidata. - * See the LICENSE file for more information. - */ - -/* - * TODO: - * 1. make sure all nodes areproperly annotated - */ - - -package dap4.dap4lib.netcdf; - -import com.sun.jna.Memory; -import com.sun.jna.Native; -import com.sun.jna.Pointer; -import com.sun.jna.ptr.IntByReference; -import dap4.core.data.DataCursor; -import dap4.core.dmr.DMRFactory; -import dap4.core.dmr.DapNode; -import dap4.core.dmr.DapType; -import dap4.core.dmr.DapVariable; -import dap4.core.util.DapContext; -import dap4.core.util.DapException; -import dap4.core.util.DapUtil; -import dap4.dap4lib.AbstractDSP; -import dap4.dap4lib.DapCodes; -import dap4.dap4lib.XURI; -import ucar.nc2.ffi.netcdf.NetcdfClibrary; -import ucar.nc2.jni.netcdf.Nc4prototypes; -import ucar.nc2.jni.netcdf.SizeTByReference; -import java.net.URISyntaxException; -import java.util.HashMap; -import java.util.Map; -import static dap4.dap4lib.netcdf.Nc4Notes.*; -import static ucar.nc2.jni.netcdf.Nc4prototypes.*; - -/** - * DSP for reading netcdf files through jni interface to netcdf4 library - */ -public class Nc4DSP extends AbstractDSP { - ////////////////////////////////////////////////// - // Constants - - public static final boolean DEBUG = false; - public static final boolean DUMPDMR = false; - - static String PATHSUFFIX = "/src/data"; - - public static String[] EXTENSIONS = new String[] {".nc", ".hdf5"}; - - static final Pointer NC_NULL = Pointer.NULL; - static final int NC_FALSE = 0; - static final int NC_TRUE = 1; - // "null" id(s) - public static final int NC_GRPNULL = 0; - public static final int NC_IDNULL = -1; - public static final int NC_NOERR = 0; - - static int NC_INT_BYTES = (java.lang.Integer.SIZE / java.lang.Byte.SIZE); - static int NC_LONG_BYTES = (Native.LONG_SIZE); - static int NC_POINTER_BYTES = (Native.POINTER_SIZE); - static int NC_SIZET_BYTES = (Native.SIZE_T_SIZE); - - protected static Nc4prototypes nc4 = NetcdfClibrary.getForeignFunctionInterface(); - - ////////////////////////////////////////////////// - // com.sun.jna.Memory control - - /** - * Provide a wrapper for pointers that tracks the size. - * Also allows for allocation. - */ - public static class Nc4Pointer { - public static Nc4Pointer allocate(long size) { - if (size == 0) - throw new IllegalArgumentException("Attempt to allocate zero bytes"); - Memory m = new Memory(size); - return new Nc4Pointer(m, size); - } - - public Pointer p; // alow direct access - public long size; // allow direct access - - public Nc4Pointer(Pointer p, long size) { - this.p = p; - this.size = size; - } - - public Nc4Pointer share(long offset, long size) { - try { - Pointer ps = p.share(offset, size); - Nc4Pointer newp = new Nc4Pointer(ps, size); - return newp; - } catch (IndexOutOfBoundsException e) { - return null; - } - } - - public String toString() { - return String.format("0x%016x/%d", Pointer.nativeValue(this.p), this.size); - } - - public static boolean validate(Nc4Pointer mem, long require) { - if (mem == null || mem.p == null || mem.size == 0) - return false; - return (mem.size > require); - } - } - - ////////////////////////////////////////////////// - // DSP Match API - - /** - * A path is file if it has no base protocol or is file: - * - * @param path - * @param context Any parameters that may help to decide. - * @return true if this path appears to be processible by this DSP - */ - public boolean dspMatch(String path, DapContext context) { - for (String s : EXTENSIONS) { - if (path.endsWith(s)) - return true; - } - return false; - } - - ////////////////////////////////////////////////// - // Notes Management - - protected Map> allnotes = null; - - /* package */ void note(Notes note) { - assert (this.allnotes != null); - int gid = note.gid; - int id = note.id; - NoteSort sort = note.getSort(); - Map sortnotes = this.allnotes.get(sort); - assert sortnotes != null; - switch (sort) { - case TYPE: - case GROUP: - case DIM: - assert sortnotes.get(id) == null; - sortnotes.put((long) id, note); - break; - case VAR: - long gv = Nc4Notes.getVarId((VarNotes) note); - assert sortnotes.get(gv) == null; - sortnotes.put(gv, note); - break; - } - } - - /* package */ VarNotes findVar(int gid, int varid) { - long gv = Nc4Notes.getVarId(gid, varid, -1); - return (VarNotes) find(gv, NoteSort.VAR); - } - - /* package */ VarNotes findField(int gid, int varid, int fid) { - long gv = Nc4Notes.getVarId(gid, varid, fid); - return (VarNotes) find(gv, NoteSort.VAR); - } - - public Notes find(long id, NoteSort sort) { - assert (this.allnotes != null); - Map sortnotes = this.allnotes.get(sort); - assert sortnotes != null; - return sortnotes.get((long) id); - } - - /* package */Notes find(DapNode node) { - NoteSort sort = noteSortFor(node); - assert (this.allnotes != null); - Map sortnotes = this.allnotes.get(sort); - assert sortnotes != null; - for (Map.Entry entries : sortnotes.entrySet()) { - Notes note = entries.getValue(); - if (note.get() == node) - return note; - } - return null; - } - - protected NoteSort noteSortFor(DapNode node) { - switch (node.getSort()) { - case ATOMICTYPE: - case STRUCTURE: - case SEQUENCE: - return NoteSort.TYPE; - case VARIABLE: - return NoteSort.VAR; - case GROUP: - case DATASET: - return NoteSort.GROUP; - case DIMENSION: - return NoteSort.DIM; - default: - break; - } - return null; - } - - protected void allnotesInit() { - this.allnotes = new HashMap<>(); - for (NoteSort s : NoteSort.values()) { - this.allnotes.put(s, new HashMap()); - } - Notes n; - n = Nc4Notes.factory(NoteSort.TYPE, 0, NC_BYTE, this); - n.set(DapType.INT8); - this.note(n); - n = Nc4Notes.factory(NoteSort.TYPE, 0, NC_CHAR, this); - n.set(DapType.CHAR); - this.note(n); - n = Nc4Notes.factory(NoteSort.TYPE, 0, NC_SHORT, this); - n.set(DapType.INT16); - this.note(n); - n = Nc4Notes.factory(NoteSort.TYPE, 0, NC_INT, this); - n.set(DapType.INT32); - this.note(n); - n = Nc4Notes.factory(NoteSort.TYPE, 0, NC_FLOAT, this); - n.set(DapType.FLOAT32); - this.note(n); - n = Nc4Notes.factory(NoteSort.TYPE, 0, NC_DOUBLE, this); - n.set(DapType.FLOAT64); - this.note(n); - n = Nc4Notes.factory(NoteSort.TYPE, 0, NC_UBYTE, this); - n.set(DapType.UINT8); - this.note(n); - n = Nc4Notes.factory(NoteSort.TYPE, 0, NC_USHORT, this); - n.set(DapType.UINT16); - this.note(n); - n = Nc4Notes.factory(NoteSort.TYPE, 0, NC_UINT, this); - n.set(DapType.UINT32); - this.note(n); - n = Nc4Notes.factory(NoteSort.TYPE, 0, NC_INT64, this); - n.set(DapType.INT64); - this.note(n); - n = Nc4Notes.factory(NoteSort.TYPE, 0, NC_UINT64, this); - n.set(DapType.UINT64); - this.note(n); - n = Nc4Notes.factory(NoteSort.TYPE, 0, NC_STRING, this); - n.set(DapType.STRING); - this.note(n); - - for (int i = NC_BYTE; i <= NC_MAX_ATOMIC_TYPE; i++) { - Nc4Notes.TypeNotes tn = (Nc4Notes.TypeNotes) find(i, NoteSort.TYPE); - assert tn != null; - int ret = 0; - byte[] namep = new byte[NC_MAX_NAME + 1]; - if (i == NC_STRING) { - // There is a bug in some versions of netcdf that does not - // handle NC_STRING correctly when the gid is invalid. - // Handle specially ; this is a temporary hack - // - // 8/16/2019 jlcaron upgrade to jna 5.4.0 - // com.sun.jna.Pointer#SIZE is removed. Its use is replaced by - // com.sun.jna.Native#POINTER_SIZE to prevent a class loading deadlock, when JNA is initialized from multiple - // threads - tn.setSize(Native.POINTER_SIZE); - } else { - SizeTByReference sizep = new SizeTByReference(); - try { - Nc4Cursor.errcheck(getJNI(), ret = nc4.nc_inq_type(0, i, namep, sizep)); - } catch (DapException e) { - e.printStackTrace(); - assert false; // should never happen - } - tn.setSize(sizep.intValue()); - } - } - } - - ////////////////////////////////////////////////// - // Instance Variables - - protected boolean trace = false; - protected boolean closed = false; - - protected int ncid = -1; // file id ; also set as DSP.source - protected int format = 0; // from nc_inq_format - protected int mode = 0; - protected String filepath = null; // real path to the dataset - - protected DMRFactory dmrfactory = null; - - ////////////////////////////////////////////////// - // Constructor(s) - - public Nc4DSP() throws DapException { - super(); - if (nc4 == null) { - throw new DapException("Could not load libnetcdf"); - } - dmrfactory = new DMRFactory(); - allnotesInit(); - } - - ////////////////////////////////////////////////// - // DSP API - - @Override - public Nc4DSP open(String filepath) throws DapException { - if (filepath.startsWith("file:")) - try { - XURI xuri = new XURI(filepath); - filepath = xuri.getPath(); - } catch (URISyntaxException use) { - throw new DapException("Malformed filepath: " + filepath).setCode(DapCodes.SC_NOT_FOUND); - } - int ret, mode; - IntByReference ncidp = new IntByReference(); - this.filepath = filepath; - try { - mode = NC_NOWRITE; - Nc4Cursor.errcheck(nc4, ret = nc4.nc_open(this.filepath, mode, ncidp)); - this.ncid = ncidp.getValue(); - // Figure out what kind of file - IntByReference formatp = new IntByReference(); - Nc4Cursor.errcheck(nc4, ret = nc4.nc_inq_format(ncid, formatp)); - this.format = formatp.getValue(); - if (DEBUG) - System.out.printf("TestNetcdf: open: %s; ncid=%d; format=%d%n", this.filepath, ncid, this.format); - // Compile the DMR - Nc4DMRCompiler dmrcompiler = new Nc4DMRCompiler(this, ncid, dmrfactory); - setDMR(dmrcompiler.compile()); - if (DEBUG || DUMPDMR) { - System.err.println("+++++++++++++++++++++"); - System.err.println(printDMR(getDMR())); - System.err.println("+++++++++++++++++++++"); - } - return this; - } catch (Exception t) { - t.printStackTrace(); - } - return null; - } - - @Override - public void close() throws DapException { - if (this.closed) - return; - if (this.ncid < 0) - return; - int ret = nc4.nc_close(ncid); - Nc4Cursor.errcheck(nc4, ret); - closed = true; - if (trace) - System.out.printf("Nc4DSP: closed: %s%n", this.filepath); - } - - @Override - public Nc4Cursor getVariableData(DapVariable var) throws DapException { - assert (var.isTopLevel()); - DapType type = var.getBaseType(); - Nc4Cursor vardata = (Nc4Cursor) super.getVariableData(var); - if (vardata == null) { - switch (type.getTypeSort()) { - case Structure: - vardata = new Nc4Cursor(DataCursor.Scheme.STRUCTARRAY, this, var, null); - break; - case Sequence: - vardata = new Nc4Cursor(DataCursor.Scheme.SEQARRAY, this, var, null); - break; - default: - if (!type.isAtomic()) - throw new DapException("Unexpected cursor type: " + type); - vardata = new Nc4Cursor(DataCursor.Scheme.ATOMIC, this, var, null); - break; - } - super.addVariableData(var, vardata); - } - assert var.isTopLevel(); - return vardata; - } - - ////////////////////////////////////////////////// - // Accessors - - - public Nc4prototypes getJNI() { - return nc4; - } - - @Override - public String getLocation() { - return this.filepath; - } - - ////////////////////////////////////////////////// - // Utilities - - public static String makeString(byte[] b) { - // null terminates - int count; - for (count = 0; (count < b.length && b[count] != 0); count++) { - ; - } - return new String(b, 0, count, DapUtil.UTF8); - } - - -} diff --git a/dap4/d4lib/src/main/java/dap4/dap4lib/netcdf/Nc4Notes.java b/dap4/d4lib/src/main/java/dap4/dap4lib/netcdf/Nc4Notes.java deleted file mode 100644 index a2f571a07a..0000000000 --- a/dap4/d4lib/src/main/java/dap4/dap4lib/netcdf/Nc4Notes.java +++ /dev/null @@ -1,316 +0,0 @@ -/* - * Copyright 2012, UCAR/Unidata. - * See the LICENSE file for more information. - */ - -package dap4.dap4lib.netcdf; - -import dap4.core.dmr.*; -import dap4.core.util.DapSort; -import dap4.core.util.DapUtil; - -/** - * Note that ideally, this info should be part of the - * Nc4DMR classes, but that would require multiple inheritance. - * Hence, we isolate that info here and add it to the instances - * via annotation - */ - -public abstract class Nc4Notes { - ////////////////////////////////////////////////// - // Constants - - // Mnemonics - public static final int NOGROUP = -1; - public static final int NOID = -1; - public static final int NOFIELDID = -1; - - ////////////////////////////////////////////////// - // Use a factory so we can debug constructor calls - - static Notes factory(NoteSort ns, int g, int id, Nc4DSP dsp) { - Notes note = null; - switch (ns) { - case TYPE: - note = new TypeNotes(g, id, dsp); - break; - case VAR: - note = new VarNotes(g, id, dsp); - break; - case DIM: - note = new DimNotes(g, id, dsp); - break; - case GROUP: - note = new GroupNotes(g, id, dsp); - break; - } - return note; - } - - ////////////////////////////////////////////////// - // Manage the compound id for variables - - public static long getVarId(VarNotes note) { - return getVarId(note.gid, note.id, note.getFieldIndex()); - } - - public static long getVarId(int gid, int varid, int ifid) { - long gv = ((long) gid) << 32; - assert varid < 0x100000; - gv = gv | ((long) varid) << 20; - long fid = (long) ifid; - if (fid >= 0) - gv |= fid; - return gv; - } - - ////////////////////////////////////////////////// - // Type Decls - - public static enum NoteSort { - TYPE, VAR, GROUP, DIM; - } - - public static class Notes implements Cloneable { - Nc4DSP dsp; // Need a place to store global state - NoteSort sort; - int gid; - int id; - DapNode node = null; - protected String name = null; - protected Notes parent = null; - protected TypeNotes basetype = null; - protected long offset = 0; - // For most types, there is only one size, - // but for vlen/sequence, there are two sizes: - // (1) the record size and (2) the instance size (= |vlen_t|); - protected long size = 0; - protected long recordsize = 0; - - protected Notes(NoteSort sort, int gid, int id, Nc4DSP dsp) { - this.sort = sort; - this.dsp = dsp; - this.gid = gid; - this.id = id; - } - - public NoteSort getSort() { - return this.sort; - } - - public Notes setName(String name) { - this.name = name; - return this; - } - - public Notes set(DapNode node) { - this.node = node; - if (this.name == null) - setName(node.getShortName()); - return this; - } - - public DapNode get() { - return this.node; - } - - public Notes setContainer(Notes parent) { - this.parent = parent; - return this; - } - - public Notes getContainer() { - return this.parent; - } - - public long getOffset() { - return this.offset; - } - - public Notes setOffset(long offset) { - this.offset = offset; - return this; - } - - public long getSize() { - return this.size; - } - - public Notes setSize(long size) { - this.size = size; - return this; - } - - public long getRecordSize() { - return this.recordsize; - } - - public Notes setRecordSize(long size) { - this.recordsize = size; - return this; - } - - public Notes setBaseType(TypeNotes t) { - this.basetype = t; - return this; - } - - public TypeNotes getBaseType() { - return this.basetype; - } - - DapGroup group() { - GroupNotes g = (GroupNotes) dsp.find(gid, NoteSort.GROUP); - return (g == null ? null : g.get()); - } - - public String toString() { - StringBuilder buf = new StringBuilder(); - buf.append(this.getClass().getName()); - buf.append("{"); - if (name != null) { - buf.append("name="); - buf.append(name); - } - buf.append(" node="); - buf.append(this.node != null ? this.node.getShortName() : "null"); - if (this.basetype != null) { - buf.append(" type="); - buf.append(this.node.getShortName()); - } - buf.append("}"); - return buf.toString(); - } - } - - public static class GroupNotes extends Notes { - protected GroupNotes(int p, int g, Nc4DSP dsp) { - super(NoteSort.GROUP, p, g, dsp); - } - - public DapGroup get() { - return (DapGroup) super.get(); - } - - public GroupNotes set(DapNode node) { - return (GroupNotes) super.set(node); - } - - } - - public static class DimNotes extends Notes { - protected DimNotes(int g, int id, Nc4DSP dsp) { - super(NoteSort.DIM, g, id, dsp); - } - - public DapDimension get() { - return (DapDimension) super.get(); - } - - public DimNotes set(DapNode node) { - return (DimNotes) super.set(node); - } - - } - - public static class TypeNotes extends Notes { - public int enumbase = -1; - public boolean isvlen = false; - - protected TypeNotes(int g, int id, Nc4DSP dsp) { - super(NoteSort.TYPE, g, id, dsp); - } - - public DapType getType() { - DapSort sort = this.node.getSort(); - switch (sort) { - case ATOMICTYPE: - case STRUCTURE: - case SEQUENCE: - return (DapType) super.get(); - case ENUMERATION: - return (DapEnumeration) super.get(); - case VARIABLE: - return ((DapVariable) super.get()).getBaseType(); - default: - break; - } - return null; - } - - public TypeNotes setOpaque(long len) { - super.setSize(len); - return this; - } - - public TypeNotes setEnumBaseType(int bt) { - this.enumbase = bt; - TypeNotes btt = (TypeNotes) this.dsp.find(bt, NoteSort.TYPE); - setSize(btt.getSize()); - return this; - } - - public boolean isOpaque() { - return getType().getTypeSort().isOpaqueType(); - } - - public boolean isEnum() { - return getType().getTypeSort().isEnumType(); - } - - public boolean isSeq() { - return getType().getTypeSort().isSeqType(); - } - - public boolean isCompound() { - return getType().getTypeSort().isCompoundType(); - } - - public boolean isVlen() { - return this.isvlen; - } - - public TypeNotes markVlen() { - this.isvlen = true; - return this; - } - - public DapType get() { - return (DapType) super.get(); - } - - public TypeNotes set(DapNode node) { - return (TypeNotes) super.set(node); - } - - } - - public static class VarNotes extends Notes { - protected VarNotes(int g, int v, Nc4DSP dsp) { - super(NoteSort.VAR, g, v, dsp); - } - - public VarNotes setBaseType(TypeNotes ti) { - return (VarNotes) super.setBaseType(ti); - } - - public DapVariable get() { - return (DapVariable) super.get(); - } - - public VarNotes set(DapNode node) { - return (VarNotes) super.set(node); - } - - public int getFieldIndex() { - assert this.get() != null; - return this.get().getFieldIndex(); - } - - @Override - public long getSize() { - return this.getBaseType().getSize() * DapUtil.dimProduct(get().getDimensions()); - } - - } -} diff --git a/dap4/d4lib/src/main/java/dap4/dap4lib/serial/D4Cursor.java b/dap4/d4lib/src/main/java/dap4/dap4lib/serial/D4Cursor.java deleted file mode 100644 index 82979ab524..0000000000 --- a/dap4/d4lib/src/main/java/dap4/dap4lib/serial/D4Cursor.java +++ /dev/null @@ -1,374 +0,0 @@ -/* - * Copyright 2012, UCAR/Unidata. - * See the LICENSE file for more information. - */ - -package dap4.dap4lib.serial; - -import dap4.core.dmr.*; -import dap4.core.util.*; -import dap4.dap4lib.AbstractCursor; -import dap4.dap4lib.LibTypeFcns; -import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.List; - - -public class D4Cursor extends AbstractCursor { - ////////////////////////////////////////////////// - // Mnemonics - static final long NULLOFFSET = -1; - - static final int D4LENSIZE = 8; - - ////////////////////////////////////////////////// - // Instance Variables - - protected long offset = NULLOFFSET; - - protected long[] bytestrings = null; - - // For debugging purposes, we keep these separate, - // but some merging could be done . - - // Track the array elements for a structure array - protected D4Cursor[] elements = null; // scheme == STRUCTARRAY|SEQARRAY - - // Track the fields of a structure instance - protected D4Cursor[] fieldcursors = null; // scheme == STRUCTURE|SEQUENCE - - // Track the records of a sequence instance - protected List records = null; // scheme == SEQUENCE - - ////////////////////////////////////////////////// - // Constructor(s) - - public D4Cursor(Scheme scheme, D4DSP dsp, DapNode template, D4Cursor container) { - super(scheme, dsp, template, container); - } - - /** - * Effectively a clone of c - * - * @param c cursor to clone - */ - public D4Cursor(D4Cursor c) { - super(c); - assert false; - this.offset = c.offset; - this.bytestrings = c.bytestrings; - this.fieldcursors = new D4Cursor[c.fieldcursors.length]; - for (int i = 0; i < c.fieldcursors.length; i++) { - D4Cursor dc = c.fieldcursors[i]; - this.fieldcursors[i] = new D4Cursor(dc); - this.fieldcursors[i].setContainer(this); // Change the parent in the clone - } - this.elements = new D4Cursor[c.elements.length]; - for (int i = 0; i < c.elements.length; i++) { - D4Cursor dc = c.elements[i]; - this.elements[i] = new D4Cursor(dc); - this.elements[i].setContainer(this); // Change the parent in the clone - } - this.records = new ArrayList<>(); - for (int i = 0; i < c.records.size(); i++) { - D4Cursor dc = c.records.get(i); - this.records.add(new D4Cursor(dc)); - this.records.get(i).setContainer(this); // Change the parent in the clone - } - } - - ////////////////////////////////////////////////// - // DataCursor API (Except as Implemented in AbstractCursor) - - - @Override - public Object read(Index index) throws DapException { - return read(DapUtil.indexToSlices(index)); - } - - @Override - public Object read(List slices) throws DapException { - switch (this.scheme) { - case ATOMIC: - return readAtomic(slices); - case STRUCTURE: - case SEQUENCE: - if (((DapVariable) this.getTemplate()).getRank() == 0 || DapUtil.isScalarSlices(slices)) - throw new DapException("Cannot slice a scalar variable"); - return new D4Cursor(this); - case STRUCTARRAY: - // Read the structures specified by slices - Odometer odom = Odometer.factory(slices); - D4Cursor[] instances = new D4Cursor[(int) odom.totalSize()]; - for (int i = 0; odom.hasNext(); i++) { - instances[i] = readStructure(odom.next()); - } - return instances; - case SEQARRAY: - odom = Odometer.factory(slices); - instances = new D4Cursor[(int) odom.totalSize()]; - for (int i = 0; odom.hasNext(); i++) { - instances[i] = readSequence(odom.next()); - } - return instances; - default: - throw new DapException("Attempt to slice a scalar object"); - } - } - - @Override - public D4Cursor readField(int findex) throws DapException { - assert (this.scheme == scheme.RECORD || this.scheme == scheme.STRUCTURE); - DapStructure basetype = (DapStructure) ((DapVariable) getTemplate()).getBaseType(); - if (findex < 0 || findex >= basetype.getFields().size()) - throw new DapException("Field index out of range: " + findex); - D4Cursor field = this.fieldcursors[findex]; - return field; - } - - @Override - public D4Cursor readRecord(long i) { - assert (this.scheme == Scheme.SEQUENCE); - if (this.records == null || i < 0 || i > this.records.size()) - throw new IndexOutOfBoundsException("No such record: " + i); - return this.records.get((int) i); - } - - @Override - public long getRecordCount() { - assert (this.scheme == Scheme.SEQUENCE); - return this.records == null ? 0 : this.records.size(); - } - - ////////////////////////////////////////////////// - // Support methods - - protected Object readAtomic(List slices) throws DapException { - if (slices == null) - throw new DapException("DataCursor.read: null set of slices"); - assert this.scheme == Scheme.ATOMIC; - DapVariable atomvar = (DapVariable) getTemplate(); - int rank = atomvar.getRank(); - assert slices != null && ((rank == 0 && slices.size() == 1) || (slices.size() == rank)); - DapType basetype = atomvar.getBaseType(); - return readAs(atomvar, basetype, slices); - } - - /** - * Allow specification of basetype to use; used for enumerations - * - * @param atomvar - * @param basetype - * @param slices - * @return Object of basetype - * @throws DapException - */ - protected Object readAs(DapVariable atomvar, DapType basetype, List slices) throws DapException { - if (basetype.getTypeSort() == TypeSort.Enum) {// short circuit this case - basetype = ((DapEnumeration) basetype).getBaseType(); - return readAs(atomvar, basetype, slices); - } - long count = DapUtil.sliceProduct(slices); - Object result = LibTypeFcns.newVector(basetype, count); - Odometer odom = Odometer.factory(slices); - if (DapUtil.isContiguous(slices) && basetype.isFixedSize()) - readContig(slices, basetype, count, odom, result); - else - readOdom(slices, basetype, odom, result); - return result; - } - - protected void readContig(List slices, DapType basetype, long count, Odometer odom, Object result) - throws DapException { - ByteBuffer alldata = ((D4DSP) this.dsp).getBuffer(); - long off = this.offset; - long ix = odom.indices().index(); - int elemsize = basetype.getSize(); - alldata.position((int) (off + (ix * elemsize))); - int icount = (int) count; - long totalsize = count * basetype.getSize(); - switch (basetype.getTypeSort()) { - case Int8: - case UInt8: - alldata.get((byte[]) result); - break; - case Char: // remember, we are reading 7-bit ascii, not utf-8 or utf-16 - byte[] ascii = new byte[icount]; - alldata.get(ascii); - for (int i = 0; i < icount; i++) { - ((char[]) result)[i] = (char) (ascii[i] & 0x7f); - } - break; - case Int16: - case UInt16: - alldata.asShortBuffer().get((short[]) result); - skip(totalsize, alldata); - break; - case Int32: - case UInt32: - alldata.asIntBuffer().get((int[]) result); - skip(totalsize, alldata); - break; - case Int64: - case UInt64: - alldata.asLongBuffer().get((long[]) result); - skip(totalsize, alldata); - break; - case Float32: - alldata.asFloatBuffer().get((float[]) result); - skip(totalsize, alldata); - break; - case Float64: - alldata.asDoubleBuffer().get((double[]) result); - skip(totalsize, alldata); - break; - default: - throw new DapException("Contiguous read not supported for type: " + basetype.getTypeSort()); - } - } - - protected Object readOdom(List slices, DapType basetype, Odometer odom, Object result) throws DapException { - ByteBuffer alldata = ((D4DSP) this.dsp).getBuffer(); - alldata.position((int) this.offset); - ByteBuffer slice = alldata.slice(); - slice.order(alldata.order()); - for (int i = 0; odom.hasNext(); i++) { - Index index = odom.next(); - int ipos = (int) index.index(); - switch (basetype.getTypeSort()) { - case Int8: - case UInt8: - ((byte[]) result)[i] = slice.get(ipos); - break; - case Char: // remember, we are reading 7-bit ascii, not utf-8 or utf-16 - byte ascii = slice.get(ipos); - ((char[]) result)[i] = (char) ascii; - break; - case Int16: - case UInt16: - ((short[]) result)[i] = slice.getShort(ipos); - break; - case Int32: - case UInt32: - ((int[]) result)[i] = slice.getInt(ipos); - break; - case Int64: - case UInt64: - ((long[]) result)[i] = slice.getLong(ipos); - break; - case Float32: - ((float[]) result)[i] = slice.getFloat(ipos); - break; - case Float64: - ((double[]) result)[i] = slice.getDouble(ipos); - break; - case String: - case URL: - int savepos = alldata.position(); - long pos = bytestrings[i]; - alldata.position((int) pos); // bytestring offsets are absolute - long n = getLength(alldata); - byte[] data = new byte[(int) n]; - alldata.get(data); - ((String[]) result)[i] = new String(data, DapUtil.UTF8); - alldata.position(savepos); - break; - case Opaque: - savepos = alldata.position(); - pos = bytestrings[i]; - alldata.position((int) pos); // bytestring offsets are absolute - n = getLength(alldata); - data = new byte[(int) n]; - alldata.get(data); - ByteBuffer buf = ByteBuffer.wrap(data); - ((ByteBuffer[]) result)[i] = buf; - alldata.position(savepos); - break; - default: - throw new DapException("Attempt to read non-atomic value of type: " + basetype.getTypeSort()); - } - } - return result; - } - - protected D4Cursor readStructure(Index index) throws DapException { - assert (this.scheme == Scheme.STRUCTARRAY); - long pos = index.index(); - long avail = (this.elements == null ? 0 : this.elements.length); - if (pos < 0 || pos > avail) - throw new IndexOutOfBoundsException("read: " + index); - return this.elements[(int) pos]; - } - - public D4Cursor readSequence(Index index) throws DapException { - assert (this.scheme == Scheme.SEQARRAY); - long pos = index.index(); - long avail = (this.elements == null ? 0 : this.elements.length); - if (pos < 0 || pos > avail) - throw new IndexOutOfBoundsException("read: " + index); - return this.elements[(int) pos]; - } - - ////////////////////////////////////////////////// - // D4Cursor Extensions - - public D4Cursor setElements(D4Cursor[] instances) { - if (!(getScheme() == Scheme.SEQARRAY || getScheme() == Scheme.STRUCTARRAY)) - throw new IllegalStateException("Adding element to !(structure|sequence array) object"); - DapVariable var = (DapVariable) getTemplate(); - this.elements = instances; - return this; - } - - public D4Cursor setOffset(long pos) { - this.offset = pos; - return this; - } - - public D4Cursor setByteStringOffsets(long total, long[] positions) { - this.bytestrings = positions; - return this; - } - - public D4Cursor addField(int m, D4Cursor field) { - if (getScheme() != Scheme.RECORD && getScheme() != Scheme.STRUCTURE) - throw new IllegalStateException("Adding field to non-(structure|record) object"); - if (this.fieldcursors == null) { - DapStructure ds = (DapStructure) ((DapVariable) getTemplate()).getBaseType(); - List fields = ds.getFields(); - this.fieldcursors = new D4Cursor[fields.size()]; - } - if (this.fieldcursors[m] != null) - throw new IndexOutOfBoundsException("Adding duplicate fields at position:" + m); - this.fieldcursors[m] = field; - return this; - } - - public D4Cursor addRecord(D4Cursor rec) { - if (getScheme() != Scheme.SEQUENCE) - throw new IllegalStateException("Adding record to non-sequence object"); - if (this.records == null) - this.records = new ArrayList<>(); - this.records.add(rec); - return this; - } - - public long getElementSize(DapVariable v) { - return v.getBaseType().isFixedSize() ? v.getBaseType().getSize() : 0; - } - - static ByteBuffer skip(long n, ByteBuffer b) { - if (b.position() + ((int) n) > b.limit()) - throw new IllegalArgumentException(); - b.position(b.position() + ((int) n)); - return b; - } - - public static long getLength(ByteBuffer b) { - if (b.position() + D4LENSIZE > b.limit()) - throw new IllegalArgumentException(); - long n = b.getLong(); - return n; - } - -} diff --git a/dap4/d4lib/src/main/java/dap4/dap4lib/serial/D4DSP.java b/dap4/d4lib/src/main/java/dap4/dap4lib/serial/D4DSP.java deleted file mode 100644 index a841cc9e6b..0000000000 --- a/dap4/d4lib/src/main/java/dap4/dap4lib/serial/D4DSP.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright 2012, UCAR/Unidata. - * See the LICENSE file for more information. - */ - -package dap4.dap4lib.serial; - -import dap4.core.dmr.DapDataset; -import dap4.core.util.DapDump; -import dap4.core.util.DapException; -import dap4.dap4lib.AbstractDSP; -import java.nio.ByteBuffer; -import java.nio.ByteOrder; - -/** - * DAP4 Serial to DSP interface - * This code should be completely independent of thredds. - * Its goal is to provide a DSP interface to - * a sequence of bytes representing serialized data, possibly - * including a leading DMR. - */ - -public abstract class D4DSP extends AbstractDSP { - ////////////////////////////////////////////////// - // Constants - - public static boolean DEBUG = false; - public static boolean DUMPDMR = false; - public static boolean DUMPDAP = false; - - protected static final String DAPVERSION = "4.0"; - protected static final String DMRVERSION = "1.0"; - - ////////////////////////////////////////////////// - // Instance variables - - protected ByteBuffer databuffer = null; // local copy of AbstractDSP.getSource - - ////////////////////////////////////////////////// - // Constructor(s) - - public D4DSP() { - super(); - } - - ////////////////////////////////////////////////// - // DSP API - // Most is left to be subclass defined; - - ////////////////////////////////////////////////// - // (Other) Accessors - - /* packge */ ByteBuffer getBuffer() { - return databuffer; - } - - ////////////////////////////////////////////////// - // Compilation - - protected void build(String document, byte[] serialdata, ByteOrder order) throws DapException { - DapDataset dmr = parseDMR(document); - - if (DEBUG || DUMPDMR) { - System.err.println("\n+++++++++++++++++++++"); - System.err.println(dmr); - System.err.println("+++++++++++++++++++++\n"); - } - if (DEBUG || DUMPDAP) { - ByteBuffer data = ByteBuffer.wrap(serialdata); - System.err.println("+++++++++++++++++++++"); - System.err.println("\n---------------------"); - DapDump.dumpbytes(data, false); - System.err.println("\n---------------------\n"); - } - build(dmr, serialdata, order); - } - - /** - * Build the data from the incoming serial data - * Note that some DSP's will not use - * - * @param dmr - * @param serialdata - * @param order - * @throws DapException - */ - protected void build(DapDataset dmr, byte[] serialdata, ByteOrder order) throws DapException { - setDMR(dmr); - // "Compile" the databuffer section of the server response - this.databuffer = ByteBuffer.wrap(serialdata).order(order); - D4DataCompiler compiler = new D4DataCompiler(this, getChecksumMode(), getOrder(), this.databuffer); - compiler.compile(); - } - -} diff --git a/dap4/d4lib/src/main/java/dap4/dap4lib/serial/D4DataCompiler.java b/dap4/d4lib/src/main/java/dap4/dap4lib/serial/D4DataCompiler.java deleted file mode 100644 index c3c9bdb3ca..0000000000 --- a/dap4/d4lib/src/main/java/dap4/dap4lib/serial/D4DataCompiler.java +++ /dev/null @@ -1,282 +0,0 @@ -/* - * Copyright 2012, UCAR/Unidata. - * See the LICENSE file for more information. - */ - - -package dap4.dap4lib.serial; - -import dap4.core.data.ChecksumMode; -import dap4.core.dmr.*; -import dap4.core.util.*; -import dap4.dap4lib.LibTypeFcns; -import java.nio.ByteBuffer; -import java.nio.ByteOrder; -import java.util.List; -import static dap4.core.data.DataCursor.Scheme; - -public class D4DataCompiler { - public static boolean DEBUG = false; - - ////////////////////////////////////////////////// - // Constants - - public static final int COUNTSIZE = 8; // databuffer as specified by the DAP4 spec - - static String LBRACE = "{"; - static String RBRACE = "}"; - - - ////////////////////////////////////////////////// - // Instance variables - - protected DapDataset dataset = null; - - // Make compile arguments global - protected ByteBuffer databuffer; - - protected ChecksumMode checksummode = null; - protected ByteOrder order = null; - - protected D4DSP dsp; - - ////////////////////////////////////////////////// - // Constructor(s) - - /** - * Constructor - * - * @param dsp the D4DSP - * @param checksummode - * @param databuffer the source of serialized databuffer - */ - - public D4DataCompiler(D4DSP dsp, ChecksumMode checksummode, ByteOrder order, ByteBuffer databuffer) - throws DapException { - this.dsp = dsp; - this.dataset = this.dsp.getDMR(); - this.databuffer = databuffer; - this.checksummode = checksummode; - this.order = order; - } - - ////////////////////////////////////////////////// - // DataCompiler API - - /** - * The goal here is to process the serialized - * databuffer and locate top-level variable positions - * in the serialized databuffer. Access to non-top-level - * variables is accomplished on the fly. - * - * @throws DapException - */ - public void compile() throws DapException { - assert (this.dataset != null && this.databuffer != null); - // iterate over the variables represented in the databuffer - for (DapVariable vv : this.dataset.getTopVariables()) { - D4Cursor data = compileVar(vv, null); - this.dsp.addVariableData(vv, data); - } - } - - protected D4Cursor compileVar(DapVariable dapvar, D4Cursor container) throws DapException { - boolean isscalar = dapvar.getRank() == 0; - D4Cursor array = null; - DapType type = dapvar.getBaseType(); - if (type.isAtomic()) - array = compileAtomicVar(dapvar, container); - else if (type.isStructType()) { - array = compileStructureArray(dapvar, container); - } else if (type.isSeqType()) { - array = compileSequenceArray(dapvar, container); - } - if (dapvar.isTopLevel() && this.checksummode.enabled(ChecksumMode.DAP)) { - // extract the checksum from databuffer src, - // attach to the array, and make into an attribute - int checksum = extractChecksum(databuffer); - dapvar.setChecksum(checksum); - } - return array; - } - - /** - * @param var - * @param container - * @return data - * @throws DapException - */ - - protected D4Cursor compileAtomicVar(DapVariable var, D4Cursor container) throws DapException { - DapType daptype = var.getBaseType(); - D4Cursor data = new D4Cursor(Scheme.ATOMIC, (D4DSP) this.dsp, var, container); - data.setOffset(getPos(this.databuffer)); - long total = 0; - long dimproduct = var.getCount(); - if (!daptype.isEnumType() && !daptype.isFixedSize()) { - // this is a string, url, or opaque - long[] positions = new long[(int) dimproduct]; - int savepos = databuffer.position(); - // Walk the bytestring and return the instance count (in databuffer) - total = walkByteStrings(positions, databuffer); - databuffer.position(savepos);// leave position unchanged - data.setByteStringOffsets(total, positions); - } else { - total = dimproduct * daptype.getSize(); - } - skip(databuffer, (int) total); - return data; - } - - /** - * Compile a structure array. - * - * @param var the template - * @param container if inside a compound object - * @return A DataCompoundArray for the databuffer for this struct. - * @throws DapException - */ - protected D4Cursor compileStructureArray(DapVariable var, D4Cursor container) throws DapException { - DapStructure dapstruct = (DapStructure) var.getBaseType(); - D4Cursor structarray = - new D4Cursor(Scheme.STRUCTARRAY, this.dsp, var, container).setOffset(getPos(this.databuffer)); - List dimset = var.getDimensions(); - long dimproduct = DapUtil.dimProduct(dimset); - D4Cursor[] instances = new D4Cursor[(int) dimproduct]; - Odometer odom = Odometer.factory(DapUtil.dimsetToSlices(dimset), dimset); - while (odom.hasNext()) { - Index index = odom.next(); - D4Cursor instance = compileStructure(var, dapstruct, structarray); - instance.setIndex(index); - instances[(int) index.index()] = instance; - } - structarray.setElements(instances); - return structarray; - } - - /** - * Compile a structure instance. - * - * @param dapstruct The template - * @param container - * @return A DataStructure for the databuffer for this struct. - * @throws DapException - */ - protected D4Cursor compileStructure(DapVariable var, DapStructure dapstruct, D4Cursor container) throws DapException { - int pos = getPos(this.databuffer); - D4Cursor d4ds = new D4Cursor(Scheme.STRUCTURE, (D4DSP) this.dsp, var, container).setOffset(pos); - List dfields = dapstruct.getFields(); - for (int m = 0; m < dfields.size(); m++) { - DapVariable dfield = dfields.get(m); - D4Cursor dvfield = compileVar(dfield, d4ds); - d4ds.addField(m, dvfield); - assert dfield.getParent() != null; - } - return d4ds; - } - - /** - * Compile a sequence array. - * - * @param var the template - * @return A DataCompoundArray for the databuffer for this sequence. - * @throws DapException - */ - protected D4Cursor compileSequenceArray(DapVariable var, D4Cursor container) throws DapException { - DapSequence dapseq = (DapSequence) var.getBaseType(); - D4Cursor seqarray = new D4Cursor(Scheme.SEQARRAY, this.dsp, var, container).setOffset(getPos(this.databuffer)); - List dimset = var.getDimensions(); - long dimproduct = DapUtil.dimProduct(dimset); - D4Cursor[] instances = new D4Cursor[(int) dimproduct]; - Odometer odom = Odometer.factory(DapUtil.dimsetToSlices(dimset), dimset); - while (odom.hasNext()) { - Index index = odom.next(); - D4Cursor instance = compileSequence(var, dapseq, seqarray); - instance.setIndex(index); - instances[(int) index.index()] = instance; - } - seqarray.setElements(instances); - return seqarray; - } - - /** - * Compile a sequence as a set of records. - * - * @param dapseq - * @param container - * @return sequence - * @throws DapException - */ - public D4Cursor compileSequence(DapVariable var, DapSequence dapseq, D4Cursor container) throws DapException { - int pos = getPos(this.databuffer); - D4Cursor seq = new D4Cursor(Scheme.SEQUENCE, this.dsp, var, container).setOffset(pos); - List dfields = dapseq.getFields(); - // Get the count of the number of records - long nrecs = getCount(this.databuffer); - for (int r = 0; r < nrecs; r++) { - pos = getPos(this.databuffer); - D4Cursor rec = - (D4Cursor) new D4Cursor(D4Cursor.Scheme.RECORD, this.dsp, var, container).setOffset(pos).setRecordIndex(r); - for (int m = 0; m < dfields.size(); m++) { - DapVariable dfield = dfields.get(m); - D4Cursor dvfield = compileVar(dfield, rec); - rec.addField(m, dvfield); - assert dfield.getParent() != null; - } - seq.addRecord(rec); - } - return seq; - } - - ////////////////////////////////////////////////// - // Utilities - - protected int extractChecksum(ByteBuffer data) throws DapException { - assert ChecksumMode.DAP.enabled(this.checksummode); - if (data.remaining() < DapUtil.CHECKSUMSIZE) - throw new DapException("Short serialization: missing checksum"); - return data.getInt(); - } - - protected static void skip(ByteBuffer data, int count) { - data.position(data.position() + count); - } - - protected static int getCount(ByteBuffer data) { - long count = data.getLong(); - count = (count & 0xFFFFFFFF); - return (int) count; - } - - protected static int getPos(ByteBuffer data) { - return data.position(); - } - - /** - * Compute the size in databuffer of the serialized form - * - * @param daptype - * @return type's serialized form size - */ - protected static int computeTypeSize(DapType daptype) { - return LibTypeFcns.size(daptype); - } - - protected static long walkByteStrings(long[] positions, ByteBuffer databuffer) { - int count = positions.length; - long total = 0; - int savepos = databuffer.position(); - // Walk each bytestring - for (int i = 0; i < count; i++) { - int pos = databuffer.position(); - positions[i] = pos; - int size = getCount(databuffer); - total += COUNTSIZE; - total += size; - skip(databuffer, size); - } - databuffer.position(savepos);// leave position unchanged - return total; - } - -} diff --git a/dap4/d4tests/build.gradle b/dap4/d4tests/build.gradle deleted file mode 100644 index d86da229a8..0000000000 --- a/dap4/d4tests/build.gradle +++ /dev/null @@ -1,44 +0,0 @@ -apply from: "$rootDir/gradle/any/dependencies.gradle" -apply from: "$rootDir/gradle/any/test-only-projects.gradle" -apply from: "$rootDir/gradle/any/gretty.gradle" - -dependencies { - // I bet some of these dependencies could be in the testRuntimeOnly config, not testImplementation. - compile enforcedPlatform(project(':netcdf-java-platform')) - testImplementation enforcedPlatform(project(':netcdf-java-testing-platform')) - - testImplementation project(':dap4:d4core') - testImplementation project(':dap4:d4lib') - testImplementation project(':dap4:d4cdm') - testImplementation project(':cdm:cdm-core') - testImplementation project(':cdm-test-utils') - testImplementation project(':httpservices') - - testImplementation 'junit:junit' - testImplementation 'org.slf4j:slf4j-api' - - testRuntimeOnly 'ch.qos.logback:logback-classic' -} - -test { - systemProperties['testargs'] = System.getProperty('testargs', '') - - include 'dap4/test/TestCDMClient.class' - include 'dap4/test/TestConstraints.class' - include 'dap4/test/TestDSP.class' - include 'dap4/test/TestDSR.class' - include 'dap4/test/TestNc4Iosp.class' - include 'dap4/test/TestParserCE.class' - include 'dap4/test/TestParserDMR.class' - include 'dap4/test/TestServlet.class' - include 'dap4/test/TestServletConstraints.class' - include 'dap4/test/TestFrontPage.class' - //include 'dap4/test/TestFilters.class' - //include 'dap4/test/TestH5Iosp.class' - //include 'dap4/test/TestHyrax.class' - //include 'dap4/test/TestPrinter.class' - //include 'dap4/test/TestSerial.class' - - dependsOn('farmBeforeIntegrationTest') - finalizedBy('farmAfterIntegrationTest') -} diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_anon_dim.syn.2.raw.txt b/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_anon_dim.syn.2.raw.txt deleted file mode 100644 index 3aec08b1c9..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_anon_dim.syn.2.raw.txt +++ /dev/null @@ -1,12 +0,0 @@ -netcdf test_anon_dim.syn.2 { - variables: - int vu32(4); - string vu32:_DAP4_Checksum_CRC32 = "0x417bc794"; - - // global attributes: - string :_dap4.ce = "/vu32[0:3]"; - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -vu32 = - {-1169720286, -920699049, -2088732436, 1060190036} -} diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_anon_dim.syn.raw.txt b/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_anon_dim.syn.raw.txt deleted file mode 100644 index 0819467d8f..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_anon_dim.syn.raw.txt +++ /dev/null @@ -1,11 +0,0 @@ -netcdf test_anon_dim.syn { - variables: - int vu32(6); - string vu32:_DAP4_Checksum_CRC32 = "0x1aca2718"; - - // global attributes: - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -vu32 = - {-1169720286, -920699049, -2088732436, 1060190036, -1123468835, 922940053} -} diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_atomic_array.nc.5.raw.txt b/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_atomic_array.nc.5.raw.txt deleted file mode 100644 index bfc1a9a698..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_atomic_array.nc.5.raw.txt +++ /dev/null @@ -1,30 +0,0 @@ -netcdf test_atomic_array.nc.5 { - variables: - ubyte vu8(1, 2); - string vu8:_DAP4_Checksum_CRC32 = "0x1a9eb5b3"; - - double vd(1); - string vd:_DAP4_Checksum_CRC32 = "0x74c1a1f1"; - - string vs(1, 1); - string vs:_DAP4_Checksum_CRC32 = "0x15293f21"; - - opaque vo(1, 1); - string vo:_DAP4_Checksum_CRC32 = "0x225778dc"; - - // global attributes: - string :_dap4.ce = "/vu8[1][0:2:2];/vd[1];/vs[1][0];/vo[0][1]"; - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -vu8 = - { - {3, 5} - } -vd = - {1024.8} -vs = - { "Καλημέα" - } -vo = 0xabcdef0000000000; - -} diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_atomic_array.nc.raw.txt b/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_atomic_array.nc.raw.txt deleted file mode 100644 index 4aafbcac3b..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_atomic_array.nc.raw.txt +++ /dev/null @@ -1,63 +0,0 @@ -netcdf test_atomic_array { - types: - byte enum cloud_class_t { Clear = 0, Cumulonimbus = 1, Stratus = 2, Stratocumulus = 3, Cumulus = 4, Altostratus = 5, Nimbostratus = 6, Altocumulus = 7, Cirrostratus = 8, Cirrocumulus = 9, Cirrus = 10, Missing = 127}; - - dimensions: - d1 = 1; - d2 = 2; - d3 = 3; - d4 = 4; - d5 = 5; - variables: - ubyte vu8(d2, d3); - string vu8:_DAP4_Checksum_CRC32 = "0xd42f6486"; - - short v16(d4); - string v16:_DAP4_Checksum_CRC32 = "0x92991416"; - - uint vu32(d2, d3); - string vu32:_DAP4_Checksum_CRC32 = "0x0c56f0f2"; - - double vd(d2); - string vd:_DAP4_Checksum_CRC32 = "0x7c09cbae"; - - char vc(d2); - string vc:_DAP4_Checksum_CRC32 = "0x63add807"; - - string vs(d2, d2); - string vs:_DAP4_Checksum_CRC32 = "0x672f70c4"; - - opaque vo(d1, d2); - string vo:_DAP4_Checksum_CRC32 = "0x2757560d"; - - enum cloud_class_t primary_cloud(d5); - string primary_cloud:_FillValue = "Missing"; - string primary_cloud:_DAP4_Checksum_CRC32 = "0xb58a627a"; - - // global attributes: - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -vu8 = - { - {255, 1, 2}, - {3, 4, 5} - } -v16 = - {1, 2, 3, 4} -vu32 = - { - {5, 4, 3}, - {2, 1, 0} - } -vd = - {17.9, 1024.8} -vc = "@&" -vs = - { "hello world", "hello world", "hello world", "hello world" - } -vo = 0x0123456789abcdef, - 0x0123456789abcdef; - -primary_cloud = - {0, 2, 0, 1, 127} -} diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_atomic_array.syn.raw.txt b/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_atomic_array.syn.raw.txt deleted file mode 100644 index e1388d3f78..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_atomic_array.syn.raw.txt +++ /dev/null @@ -1,63 +0,0 @@ -netcdf test_atomic_array.syn { - types: - byte enum cloud_class_t { Clear = 0, Cumulonimbus = 1, Stratus = 2, Stratocumulus = 3, Cumulus = 4, Altostratus = 5, Nimbostratus = 6, Altocumulus = 7, Cirrostratus = 8, Cirrocumulus = 9, Cirrus = 10, Missing = 127}; - - dimensions: - d1 = 1; - d2 = 2; - d3 = 3; - d4 = 4; - d5 = 5; - variables: - ubyte vu8(d2, d3); - string vu8:_DAP4_Checksum_CRC32 = "0xd79bd598"; - - short v16(d4); - string v16:_DAP4_Checksum_CRC32 = "0xa40ee271"; - - uint vu32(d2, d3); - string vu32:_DAP4_Checksum_CRC32 = "0xa06ca308"; - - double vd(d2); - string vd:_DAP4_Checksum_CRC32 = "0x7ee0fb67"; - - char vc(d2); - string vc:_DAP4_Checksum_CRC32 = "0x7cee5238"; - - string vs(d2, d2); - string vs:_DAP4_Checksum_CRC32 = "0x9d474c4c"; - - opaque vo(d1, d2); - string vo:_DAP4_Checksum_CRC32 = "0xd4809521"; - - enum cloud_class_t primary_cloud(d5); - string primary_cloud:_FillValue = "Missing"; - string primary_cloud:_DAP4_Checksum_CRC32 = "0x94b74cf7"; - - // global attributes: - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -vu8 = - { - {186, 201, 131}, - {63, 189, 55} - } -v16 = - {-341, -21899, -13413, -22144} -vu32 = - { - {2367803413, 3586730583, 511843988}, - {3754752863, 2950934681, 2366232135} - } -vd = - {0.21787008119279183, 0.6024507919967678} -vc = "CO" -vs = - { "{S", "{S", "{S", "{S" - } -vo = 0xa2177aa7287c04fa8bb57bcdf76ec80f, - 0xa2177aa7287c04fa8bb57bcdf76ec80f; - -primary_cloud = - {2, 9, 6, 8, 3} -} diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_atomic_types.nc.raw.txt b/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_atomic_types.nc.raw.txt deleted file mode 100644 index a6cd1e1933..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_atomic_types.nc.raw.txt +++ /dev/null @@ -1,72 +0,0 @@ -netcdf test_atomic_types { - types: - byte enum cloud_class_t { Clear = 0, Cumulonimbus = 1, Stratus = 2, Stratocumulus = 3, Cumulus = 4, Altostratus = 5, Nimbostratus = 6, Altocumulus = 7, Cirrostratus = 8, Cirrocumulus = 9, Cirrus = 10, Missing = 127}; - - variables: - byte v8; - string v8:_DAP4_Checksum_CRC32 = "0x3fba6cad"; - - ubyte vu8; - string vu8:_DAP4_Checksum_CRC32 = "0xff000000"; - - short v16; - string v16:_DAP4_Checksum_CRC32 = "0xac6191df"; - - ushort vu16; - string vu16:_DAP4_Checksum_CRC32 = "0xffff0000"; - - int v32; - string v32:_DAP4_Checksum_CRC32 = "0x12477cdf"; - - uint vu32; - string vu32:_DAP4_Checksum_CRC32 = "0xffffffff"; - - long v64; - string v64:_DAP4_Checksum_CRC32 = "0xccfc5c3c"; - - ulong vu64; - string vu64:_DAP4_Checksum_CRC32 = "0x2144df1c"; - - float vf; - string vf:_DAP4_Checksum_CRC32 = "0x8c2a1365"; - - double vd; - string vd:_DAP4_Checksum_CRC32 = "0xf2bacb72"; - - char vc; - string vc:_DAP4_Checksum_CRC32 = "0xa4deae1d"; - - string vs; - string vs:_DAP4_Checksum_CRC32 = "0x3691a6d4"; - - opaque vo; - string vo:_DAP4_Checksum_CRC32 = "0xd24ddadd"; - - enum cloud_class_t primary_cloud; - string primary_cloud:_FillValue = "Missing"; - string primary_cloud:_DAP4_Checksum_CRC32 = "0x3c0c8ea1"; - - enum cloud_class_t secondary_cloud; - string secondary_cloud:_FillValue = "Missing"; - string secondary_cloud:_DAP4_Checksum_CRC32 = "0x12b88320"; - - // global attributes: - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -v8 =-128 -vu8 =255 -v16 =-32768 -vu16 =65535 -v32 =2147483647 -vu32 =4294967295 -v64 =9223372036854775807 -vu64 =18446744073709551615 -vf =3.1415927 -vd =3.141592653589793 -vc =@ -vs = "hello world" -vo = 0x0123456789abcdef; - -primary_cloud =2 -secondary_cloud =127 -} diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_atomic_types.syn.raw.txt b/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_atomic_types.syn.raw.txt deleted file mode 100644 index 3c302ef4a6..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_atomic_types.syn.raw.txt +++ /dev/null @@ -1,72 +0,0 @@ -netcdf test_atomic_types.syn { - types: - byte enum cloud_class_t { Clear = 0, Cumulonimbus = 1, Stratus = 2, Stratocumulus = 3, Cumulus = 4, Altostratus = 5, Nimbostratus = 6, Altocumulus = 7, Cirrostratus = 8, Cirrocumulus = 9, Cirrus = 10, Missing = 127}; - - variables: - byte v8; - string v8:_DAP4_Checksum_CRC32 = "0x140e363f"; - - ubyte vu8; - string vu8:_DAP4_Checksum_CRC32 = "0x30ba9599"; - - short v16; - string v16:_DAP4_Checksum_CRC32 = "0xe353db0e"; - - ushort vu16; - string vu16:_DAP4_Checksum_CRC32 = "0x31e23870"; - - int v32; - string v32:_DAP4_Checksum_CRC32 = "0xbad2143f"; - - uint vu32; - string vu32:_DAP4_Checksum_CRC32 = "0x32e54381"; - - long v64; - string v64:_DAP4_Checksum_CRC32 = "0x915dfe6e"; - - ulong vu64; - string vu64:_DAP4_Checksum_CRC32 = "0x9233006a"; - - float vf; - string vf:_DAP4_Checksum_CRC32 = "0x3d571922"; - - double vd; - string vd:_DAP4_Checksum_CRC32 = "0xffd91cad"; - - char vc; - string vc:_DAP4_Checksum_CRC32 = "0x09b9265b"; - - string vs; - string vs:_DAP4_Checksum_CRC32 = "0x81827ad8"; - - opaque vo; - string vo:_DAP4_Checksum_CRC32 = "0x2d29db8e"; - - enum cloud_class_t primary_cloud; - string primary_cloud:_FillValue = "Missing"; - string primary_cloud:_DAP4_Checksum_CRC32 = "0x4c667a2e"; - - enum cloud_class_t secondary_cloud; - string secondary_cloud:_FillValue = "Missing"; - string secondary_cloud:_DAP4_Checksum_CRC32 = "0x4b0bbe37"; - - // global attributes: - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -v8 =58 -vu8 =201 -v16 =896 -vu16 =16177 -v32 =-1123468835 -vu32 =2125143125 -v64 =3059391736915381031 -vu64 =11577488182652895291 -vf =0.5512972 -vd =0.7902673011288164 -vc =* -vs = "O,L?c8A%V" -vo = 0x46f169ef23cbaf9b1febd99e4e16cec9; - -primary_cloud =7 -secondary_cloud =3 -} diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_fill.nc.raw.txt b/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_fill.nc.raw.txt deleted file mode 100644 index 839f800bfe..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_fill.nc.raw.txt +++ /dev/null @@ -1,19 +0,0 @@ -netcdf test_fill { - variables: - ubyte uv8; - string uv8:_DAP4_Checksum_CRC32 = "0x6fbf1d91"; - - short v16; - string v16:_DAP4_Checksum_CRC32 = "0xc9139fe6"; - - uint uv32; - uv32:_FillValue = 17; - string uv32:_DAP4_Checksum_CRC32 = "0x8437b331"; - - // global attributes: - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -uv8 =240 -v16 =32700 -uv32 =111000 -} diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_one_var.nc.raw.txt b/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_one_var.nc.raw.txt deleted file mode 100644 index 2b376e08ab..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_one_var.nc.raw.txt +++ /dev/null @@ -1,10 +0,0 @@ -netcdf test_one_var { - variables: - int t; - string t:_DAP4_Checksum_CRC32 = "0xc9e1efe6"; - - // global attributes: - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -t =17 -} diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_one_vararray.nc.3.raw.txt b/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_one_vararray.nc.3.raw.txt deleted file mode 100644 index 7e65c1a454..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_one_vararray.nc.3.raw.txt +++ /dev/null @@ -1,14 +0,0 @@ -netcdf test_one_vararray.nc.3 { - dimensions: - d2 = 2; - variables: - int t(d2); - string t:_DAP4_Checksum_CRC32 = "0x42dfb1d0"; - - // global attributes: - string :_dap4.ce = "/t[0:1]"; - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -t = - {17, 37} -} diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_sequence_1.syn.raw.txt b/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_sequence_1.syn.raw.txt deleted file mode 100644 index 8fd1eb64bf..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_sequence_1.syn.raw.txt +++ /dev/null @@ -1,23 +0,0 @@ -netcdf test_sequence_1.syn { - variables: - - Sequence { - int i1; - short sh1; - } s(*); - string s:_DAP4_Checksum_CRC32 = "0x4ac0ac5e"; - - - // global attributes: - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: - s = - { - i1 = - {-920699049 - } - sh1 = - {896 - } - } s -} diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_struct_array.nc.6.raw.txt b/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_struct_array.nc.6.raw.txt deleted file mode 100644 index 5ca77032b5..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_struct_array.nc.6.raw.txt +++ /dev/null @@ -1,34 +0,0 @@ -netcdf test_struct_array.nc.6 { - variables: - - Structure { - int x; - string x:_CoordinateAxisType = "GeoX"; - int y; - string y:_CoordinateAxisType = "GeoY"; - } s(2, 2); - string s:_DAP4_Checksum_CRC32 = "0x324d0ea6"; - - - // global attributes: - string :_dap4.ce = "/s[0:2:3][0:1]"; - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -s = - { - x =1 - y =-1 - } s(0) - { - x =17 - y =37 - } s(1) - { - x =-4 - y =12 - } s(2) - { - x =-8 - y =8 - } s(3) -} diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_struct_array.syn.raw.txt b/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_struct_array.syn.raw.txt deleted file mode 100644 index 76531f1451..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_struct_array.syn.raw.txt +++ /dev/null @@ -1,78 +0,0 @@ -netcdf test_struct_array.syn { - dimensions: - dx = 4; - dy = 3; - variables: - float z(dx); - string z:_DAP4_Checksum_CRC32 = "0xbef06d05"; - - float t(dy); - string t:_DAP4_Checksum_CRC32 = "0x165934f0"; - - - Structure { - int x; - string x:_CoordinateAxisType = "GeoX"; - int y; - string y:_CoordinateAxisType = "GeoY"; - } s(dx, dy); - string s:_DAP4_Checksum_CRC32 = "0xd91a250e"; - - - // global attributes: - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -z = - {0.72765326, 0.785633, 0.513679, 0.24684471} -t = - {0.738422, 0.21488869, 0.49479842} -s = - { - x =712320147 - y =1268468519 - } s(0) - { - x =696298400 - y =989876086 - } s(1) - { - x =-1927163883 - y =-900795134 - } s(2) - { - x =-708236713 - y =1377500019 - } s(3) - { - x =511843988 - y =1699265896 - } s(4) - { - x =-540214433 - y =-914532520 - } s(5) - { - x =-1344032615 - y =-871416961 - } s(6) - { - x =-1928735161 - y =935744880 - } s(7) - { - x =-1509955773 - y =-1707460853 - } s(8) - { - x =1145911788 - y =-415231529 - } s(9) - { - x =-278269626 - y =-1682978013 - } s(10) - { - x =-1629885665 - y =-909240754 - } s(11) -} diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_anon_dim.syn.raw b/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_anon_dim.syn.raw deleted file mode 100644 index 90cf83423e4621405fda80a12e5817d4d219b9bf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 481 zcma)3%}T>S5KhI5f!;*~m-XPuto^~(k~9>mB6#r7)?--BQWug*$WBTl9t5Akml65^ z`VPK`0+p5f5e;P+@qB5fs@OaHR;Y`7O5^5NGd^or`ZgXZ( zLMWpIl*bEYxZkzizC>vhR&7>3kTKz?3{te?Uw-LQv-y z(CzD(8U09Wo^r7QT(O{(T@NwScR8w+MnK`3!L>$=RB#TVmcSVnDQOIe*#4zIl2NYM zWM1hn$YNpbinS;mUaT%ph84@&=TDb!xBkKV*Yx>i(5m^LXFIdk@2%GE(Z}8o>!ydH diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_atomic_types.syn.raw b/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_atomic_types.syn.raw deleted file mode 100644 index 906759bc74655efacc98fb00f3cbc036f191f49f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1904 zcmdUw&ui2`6vtO8N-HfMiXaq>Q-9E6H_h(4-PYZPW!r_)+KRRHAQGn8w2dT_n3-AJ z9;EdT5UhBRf_U;$)UyS>7eT~>Sc)DL58^@m2h_=KCYkPH>ebwKzVDOw-ZyXF9!wm1 zpI2|$mQ*!7Y&xg_l;j|g45T|16D<|M+?Db`4oH|lRDqU*i~^_`7^tHi`7uZ!Hb`fO z#2*B0rV|4b4HCyTb&b?q11E6}0U@jc-Fcoa!_tY8?S+zGi6F5m5iWpbLfjEqX1|h- zYp|l+q~k5g2+L!|OEP<1ZwoZSg8m5{ZKTVOBWfESB+L-0(UWdDw4&)2#8@LhTJRfZ ztrfroA~_Inz72J@3WlBxanb_!}MI78z)A?9pnzh@4WMdIONpllJu|&!Ayp|-n{gLJ@!}}tF zuS)#azG!01?pXApQ(+HzSr|b+mHwy&Lsj)l4~BJ4Jg0)d&Xp_&6yH&Sh!iSHj7g_B zllF&6U?PQz5@WI%&Sd@Z5SU1zqExmVC}diUpt=%Kl}ITqLyxD?qhodhn2TJ%kuc-J zo7CWf6A8Yz!LjR^HuP%jX0!Y4?>%Z4fV}s%2kq2vcagAc3zYEJYGu>1=KZ@3q{c${ zJ6wN3J(h0+J^|uRki!&>MbQ`qZmCc@Hgt!rzyGNCu(QB?jcx3VHf0iG8QM6im=JLn z>qEU~ukJA}+=+S7uDl%lB{8=SBogZ*YPPF;`{9GF!PT~|-PtdS>gGNxABWpts@?Cl z=6W`7ua&;0&Q5Mj-akeA(XZ?GE+l5EeXE;~ZzR&|Z%=lr;P}S5Z;2Pq6gn#S@CFAV-KYyEtMz;J$SIaE^D*Yg=7+Tr@{DEzKL%j_#{r+ zBt*QpunRli_susyCv5Z`E#C5sSH^i;KrC*8Yrzd{i`2p{7VGDStEu1~HKaN#z{H|9 zUM%M0DAB0B!Lu>%4(Ob4G#(W(Ri&MFPS*i!#ekLSa?`m@$ZZJau7{dJ1`rhqJ{GTt znboOPBrll$>f1*|vF*E8OQma95tV=RolW_XWVWYFX j;Z^g}!pP#Vf=KpBX*;rA4;hXaJ3VKNUDEyh_`3T6a#@O5 diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_opaque.nc.raw b/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_opaque.nc.raw deleted file mode 100644 index 983427b98695498518a0017a43b933d5db437d61..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 430 zcma)&!AiqG5QY=*AO&wez%o6Xwa`N;NlT#>1Vsc=a`W7B3zJ zpTSpf(j+C|#XT%6-~RLe^PhPBTR49ya#88hWdS6-Ik-|jf z26Y5`?O;9|giA%rX*wH-?w~4|lXesvtDbi{z%BH6qU@&g8M99x73C4t5qgN@p^M;& z$WEo?S75B>G&V40D$&X1;$HH&;UCeIKmAKMYwW_iLu%3NQJE3Qjx31E>~TlBg)y6s z7ysn;BT PxJqB&KYqTyZa;qktIv7} diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_sequence_1.syn.raw b/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_sequence_1.syn.raw deleted file mode 100644 index 6b83150005f083d141feb991f99ef16455386a54..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 506 zcma)3!AiqG5KYlj!HYlOvYyQvEmBI-P^g09LD1HlVKqa$kW6BBQq0W{@*}+Z7k-M9 zHmOlB4(!76X5M?VZ`bL4`r%8Oh!qspWEe=#J(dFSDT@s*0y(?8I2uY}Nn@;&3?Yye zSQ(D{{#28;Kzn`B7V4C70!xvF=aN|<@?2Y?>@>wXpSNNI7VAQ3v4v_M9f&=m4djw2 zA1TEzH_L%7adu z@2s6#euKVhDO-sNQDGiSf~GrS_k-x#5G4?uV{9}^K~>JbIb+4)4-0dhlpt31&2h1X fbpXEFl5#ex35NxHjH%DN z01x3wMDVpuO063QX5jI?@8``cT7@s(ybl91l!;N1c4@`lr9|r6$XB}W((cvqPK^=+ zLi-|!v~=l68rp1>cw2xl63Qi#A1y+}K^pLkyh~9H&YqnX@>{y)qfz0!Y+N3Nn-NaImU(rT_xz9cf<) zO$m%*l<8uW+OKRq5u}m~CogUiU8b=)n~UPwShhDbELfIEnK}Rf diff --git a/dap4/d4tests/src/test/data/resources/TestConstraints/baseline/test_anon_dim.syn.2.raw.txt b/dap4/d4tests/src/test/data/resources/TestConstraints/baseline/test_anon_dim.syn.2.raw.txt deleted file mode 100644 index 3aec08b1c9..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestConstraints/baseline/test_anon_dim.syn.2.raw.txt +++ /dev/null @@ -1,12 +0,0 @@ -netcdf test_anon_dim.syn.2 { - variables: - int vu32(4); - string vu32:_DAP4_Checksum_CRC32 = "0x417bc794"; - - // global attributes: - string :_dap4.ce = "/vu32[0:3]"; - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -vu32 = - {-1169720286, -920699049, -2088732436, 1060190036} -} diff --git a/dap4/d4tests/src/test/data/resources/TestConstraints/baseline/test_atomic_array.nc.5.raw.txt b/dap4/d4tests/src/test/data/resources/TestConstraints/baseline/test_atomic_array.nc.5.raw.txt deleted file mode 100644 index bfc1a9a698..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestConstraints/baseline/test_atomic_array.nc.5.raw.txt +++ /dev/null @@ -1,30 +0,0 @@ -netcdf test_atomic_array.nc.5 { - variables: - ubyte vu8(1, 2); - string vu8:_DAP4_Checksum_CRC32 = "0x1a9eb5b3"; - - double vd(1); - string vd:_DAP4_Checksum_CRC32 = "0x74c1a1f1"; - - string vs(1, 1); - string vs:_DAP4_Checksum_CRC32 = "0x15293f21"; - - opaque vo(1, 1); - string vo:_DAP4_Checksum_CRC32 = "0x225778dc"; - - // global attributes: - string :_dap4.ce = "/vu8[1][0:2:2];/vd[1];/vs[1][0];/vo[0][1]"; - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -vu8 = - { - {3, 5} - } -vd = - {1024.8} -vs = - { "Καλημέα" - } -vo = 0xabcdef0000000000; - -} diff --git a/dap4/d4tests/src/test/data/resources/TestConstraints/baseline/test_atomic_array.nc.8.raw.txt b/dap4/d4tests/src/test/data/resources/TestConstraints/baseline/test_atomic_array.nc.8.raw.txt deleted file mode 100644 index 6c79c85f94..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestConstraints/baseline/test_atomic_array.nc.8.raw.txt +++ /dev/null @@ -1,12 +0,0 @@ -netcdf test_atomic_array.nc.8 { - variables: - short v16(3); - string v16:_DAP4_Checksum_CRC32 = "0xc592fc85"; - - // global attributes: - string :_dap4.ce = "/v16[1:2,2]"; - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -v16 = - {2, 3, 3} -} diff --git a/dap4/d4tests/src/test/data/resources/TestConstraints/baseline/test_atomic_array.nc.9.raw.txt b/dap4/d4tests/src/test/data/resources/TestConstraints/baseline/test_atomic_array.nc.9.raw.txt deleted file mode 100644 index b367f16522..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestConstraints/baseline/test_atomic_array.nc.9.raw.txt +++ /dev/null @@ -1,12 +0,0 @@ -netcdf test_atomic_array.nc.9 { - variables: - short v16(3); - string v16:_DAP4_Checksum_CRC32 = "0xb6724845"; - - // global attributes: - string :_dap4.ce = "/v16[2,1:2]"; - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -v16 = - {3, 2, 3} -} diff --git a/dap4/d4tests/src/test/data/resources/TestConstraints/baseline/test_enum_array.nc.4.raw.txt b/dap4/d4tests/src/test/data/resources/TestConstraints/baseline/test_enum_array.nc.4.raw.txt deleted file mode 100644 index 82933a50d3..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestConstraints/baseline/test_enum_array.nc.4.raw.txt +++ /dev/null @@ -1,16 +0,0 @@ -netcdf test_enum_array.nc.4 { - types: - byte enum cloud_class_t { Clear = 0, Cumulonimbus = 1, Stratus = 2, Stratocumulus = 3, Cumulus = 4, Altostratus = 5, Nimbostratus = 6, Altocumulus = 7, Cirrostratus = 8, Cirrocumulus = 9, Cirrus = 10, Missing = 127}; - - variables: - enum cloud_class_t primary_cloud(2); - string primary_cloud:_FillValue = "Missing"; - string primary_cloud:_DAP4_Checksum_CRC32 = "0x04e840eb"; - - // global attributes: - string :_dap4.ce = "/primary_cloud[1:2:4]"; - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -primary_cloud = - {2, 1} -} diff --git a/dap4/d4tests/src/test/data/resources/TestConstraints/baseline/test_one_vararray.nc.1.raw.txt b/dap4/d4tests/src/test/data/resources/TestConstraints/baseline/test_one_vararray.nc.1.raw.txt deleted file mode 100644 index 4b380edb65..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestConstraints/baseline/test_one_vararray.nc.1.raw.txt +++ /dev/null @@ -1,12 +0,0 @@ -netcdf test_one_vararray.nc.1 { - variables: - int t(1); - string t:_DAP4_Checksum_CRC32 = "0xb6a88010"; - - // global attributes: - string :_dap4.ce = "/t[1]"; - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -t = - {37} -} diff --git a/dap4/d4tests/src/test/data/resources/TestConstraints/baseline/test_one_vararray.nc.3.raw.txt b/dap4/d4tests/src/test/data/resources/TestConstraints/baseline/test_one_vararray.nc.3.raw.txt deleted file mode 100644 index 7e65c1a454..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestConstraints/baseline/test_one_vararray.nc.3.raw.txt +++ /dev/null @@ -1,14 +0,0 @@ -netcdf test_one_vararray.nc.3 { - dimensions: - d2 = 2; - variables: - int t(d2); - string t:_DAP4_Checksum_CRC32 = "0x42dfb1d0"; - - // global attributes: - string :_dap4.ce = "/t[0:1]"; - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -t = - {17, 37} -} diff --git a/dap4/d4tests/src/test/data/resources/TestConstraints/baseline/test_opaque_array.nc.7.raw.txt b/dap4/d4tests/src/test/data/resources/TestConstraints/baseline/test_opaque_array.nc.7.raw.txt deleted file mode 100644 index f7e6996969..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestConstraints/baseline/test_opaque_array.nc.7.raw.txt +++ /dev/null @@ -1,13 +0,0 @@ -netcdf test_opaque_array.nc.7 { - variables: - opaque vo2(1, 2); - string vo2:_DAP4_Checksum_CRC32 = "0x3f3fa5d4"; - - // global attributes: - string :_dap4.ce = "/vo2[1][0,0]"; - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -vo2 = 0xfedcba9876543210, - 0xfedcba9876543210; - -} diff --git a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_anon_dim.syn.2.raw.txt b/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_anon_dim.syn.2.raw.txt deleted file mode 100644 index 25034c5a30..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_anon_dim.syn.2.raw.txt +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - -/vu32[0] = -1169720286 -/vu32[1] = -920699049 -/vu32[2] = -2088732436 -/vu32[3] = 1060190036 - diff --git a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_anon_dim.syn.raw.txt b/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_anon_dim.syn.raw.txt deleted file mode 100644 index f6dd09784a..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_anon_dim.syn.raw.txt +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - -/vu32[0] = -1169720286 -/vu32[1] = -920699049 -/vu32[2] = -2088732436 -/vu32[3] = 1060190036 -/vu32[4] = -1123468835 -/vu32[5] = 922940053 - diff --git a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_atomic_array.nc.5.raw.txt b/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_atomic_array.nc.5.raw.txt deleted file mode 100644 index b4d1d6ce75..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_atomic_array.nc.5.raw.txt +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - -/vu8[0,0] = 3 -/vu8[0,1] = 5 -/vd[0] = 1024.800000 -/vs[0,0] = "Καλημέα" -/vo[0,0] = 0xABCDEF0000000000 - diff --git a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_atomic_array.nc.8.raw.txt b/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_atomic_array.nc.8.raw.txt deleted file mode 100644 index 447e729347..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_atomic_array.nc.8.raw.txt +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - -/v16[0] = 1 -/v16[1] = 2 -/v16[2] = 4 - diff --git a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_atomic_array.nc.9.raw.txt b/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_atomic_array.nc.9.raw.txt deleted file mode 100644 index 769a4618ee..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_atomic_array.nc.9.raw.txt +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - -/v16[0] = 4 -/v16[1] = 1 -/v16[2] = 2 - diff --git a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_atomic_array.nc.raw.txt b/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_atomic_array.nc.raw.txt deleted file mode 100644 index 2e2bea3dd0..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_atomic_array.nc.raw.txt +++ /dev/null @@ -1,89 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -/vu8[0,0] = 255 -/vu8[0,1] = 1 -/vu8[0,2] = 2 -/vu8[1,0] = 3 -/vu8[1,1] = 4 -/vu8[1,2] = 5 -/v16[0] = 1 -/v16[1] = 2 -/v16[2] = 3 -/v16[3] = 4 -/vu32[0,0] = 5 -/vu32[0,1] = 4 -/vu32[0,2] = 3 -/vu32[1,0] = 2 -/vu32[1,1] = 1 -/vu32[1,2] = 0 -/vd[0] = 17.900000 -/vd[1] = 1024.800000 -/vc[0] = '@' -/vc[1] = '&' -/vs[0,0] = "hello\tworld" -/vs[0,1] = "\r\n" -/vs[1,0] = "Καλημέα" -/vs[1,1] = "abc" -/vo[0,0] = 0x0123456789ABCDEF -/vo[0,1] = 0xABCDEF0000000000 -/primary_cloud[0] = Clear -/primary_cloud[1] = Stratus -/primary_cloud[2] = Clear -/primary_cloud[3] = Cumulonimbus -/primary_cloud[4] = Missing - diff --git a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_atomic_array.syn.raw.txt b/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_atomic_array.syn.raw.txt deleted file mode 100644 index 04ad7521e5..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_atomic_array.syn.raw.txt +++ /dev/null @@ -1,89 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -/vu8[0,0] = 186 -/vu8[0,1] = 201 -/vu8[0,2] = 131 -/vu8[1,0] = 63 -/vu8[1,1] = 189 -/vu8[1,2] = 55 -/v16[0] = -341 -/v16[1] = -21899 -/v16[2] = -13413 -/v16[3] = -22144 -/vu32[0,0] = 2367803413 -/vu32[0,1] = 3586730583 -/vu32[0,2] = 511843988 -/vu32[1,0] = 3754752863 -/vu32[1,1] = 2950934681 -/vu32[1,2] = 2366232135 -/vd[0] = 0.217870 -/vd[1] = 0.602451 -/vc[0] = 'C' -/vc[1] = 'O' -/vs[0,0] = "{S" -/vs[0,1] = "gb8^OE$" -/vs[1,0] = "4a/q%n9;5Y" -/vs[1,1] = "{fIl?T"\A[" -/vo[0,0] = 0xA2177AA7287C04FA8BB57BCDF76EC80F -/vo[0,1] = 0x34FA472AA9404DD543143CADED303A75 -/primary_cloud[0] = Stratus -/primary_cloud[1] = Cirrocumulus -/primary_cloud[2] = Nimbostratus -/primary_cloud[3] = Cirrostratus -/primary_cloud[4] = Stratocumulus - diff --git a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_atomic_types.nc.raw.txt b/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_atomic_types.nc.raw.txt deleted file mode 100644 index cff7ae5f4d..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_atomic_types.nc.raw.txt +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -/v8 = -128 -/vu8 = 255 -/v16 = -32768 -/vu16 = 65535 -/v32 = 2147483647 -/vu32 = 4294967295 -/v64 = 9223372036854775807 -/vu64 = 18446744073709551615 -/vf = 3.141593 -/vd = 3.141593 -/vc = '@' -/vs = "hello\tworld" -/vo = 0x0123456789ABCDEF -/primary_cloud = Stratus -/secondary_cloud = Missing - diff --git a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_atomic_types.syn.raw.txt b/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_atomic_types.syn.raw.txt deleted file mode 100644 index 6a7adb4fd4..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_atomic_types.syn.raw.txt +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -/v8 = 58 -/vu8 = 201 -/v16 = 896 -/vu16 = 16177 -/v32 = -1123468835 -/vu32 = 2125143125 -/v64 = 3059391736915381031 -/vu64 = 11577488182652895291 -/vf = 0.551297 -/vd = 0.790267 -/vc = '*' -/vs = "O,L?c8A%V" -/vo = 0x46F169EF23CBAF9B1FEBD99E4E16CEC9 -/primary_cloud = Altocumulus -/secondary_cloud = Stratocumulus - diff --git a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_enum.nc.raw.txt b/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_enum.nc.raw.txt deleted file mode 100644 index 8c8ce9ebb4..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_enum.nc.raw.txt +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - -/primary_cloud = Stratus - diff --git a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_enum_2.nc.raw.txt b/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_enum_2.nc.raw.txt deleted file mode 100644 index f0402352be..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_enum_2.nc.raw.txt +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - -/h/primary_cloud = Stratus - diff --git a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_enum_array.nc.4.raw.txt b/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_enum_array.nc.4.raw.txt deleted file mode 100644 index 0217409df8..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_enum_array.nc.4.raw.txt +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - -/primary_cloud[0] = Stratus -/primary_cloud[1] = Cumulonimbus - diff --git a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_enum_array.nc.raw.txt b/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_enum_array.nc.raw.txt deleted file mode 100644 index c23486baff..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_enum_array.nc.raw.txt +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - -/primary_cloud[0] = Clear -/primary_cloud[1] = Stratus -/primary_cloud[2] = Clear -/primary_cloud[3] = Cumulonimbus -/primary_cloud[4] = Missing - diff --git a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_fill.nc.raw.txt b/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_fill.nc.raw.txt deleted file mode 100644 index dd457986b4..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_fill.nc.raw.txt +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - -/uv8 = 240 -/v16 = 32700 -/uv32 = 111000 - diff --git a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_groups1.nc.raw.txt b/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_groups1.nc.raw.txt deleted file mode 100644 index 431c26d8ea..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_groups1.nc.raw.txt +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - -/g/h/v1[0] = -876354855 -/g/h/v1[1] = -1761252264 -/g/h/v1[2] = 1723477387 -/g/h/v1[3] = -46827465 -/g/h/v1[4] = 1475147969 -/g/h/v2[0] = 12.000000 -/g/h/v2[1] = -100.000000 -/g/h/v2[2] = 9969209968386869000000000000000000000.000000 -/g/i/v1[0] = 2 -/g/i/v1[1] = 3 -/g/i/v1[2] = 5 -/g/i/v1[3] = 7 -/g/i/v1[4] = 11 -/g/i/v3[0] = 23.000000 -/g/i/v3[1] = 29.000000 -/g/i/v3[2] = 19.000000 -/g/i/v3[3] = 31.000000 -/g/i/v3[4] = 17.000000 -/g/i/v3[5] = 37.000000 -/g/i/v3[6] = 13.000000 - diff --git a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_one_var.nc.raw.txt b/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_one_var.nc.raw.txt deleted file mode 100644 index c74172bddb..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_one_var.nc.raw.txt +++ /dev/null @@ -1,10 +0,0 @@ - - - -/t = 17 - diff --git a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_one_vararray.nc.1.raw.txt b/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_one_vararray.nc.1.raw.txt deleted file mode 100644 index 18bedc8d51..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_one_vararray.nc.1.raw.txt +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - -/t[0] = 37 - diff --git a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_one_vararray.nc.raw.txt b/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_one_vararray.nc.raw.txt deleted file mode 100644 index 1d2f858e48..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_one_vararray.nc.raw.txt +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - -/t[0] = 17 -/t[1] = 37 - diff --git a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_opaque.nc.raw.txt b/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_opaque.nc.raw.txt deleted file mode 100644 index a0dbfd2e55..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_opaque.nc.raw.txt +++ /dev/null @@ -1,10 +0,0 @@ - - - -/vo1 = 0x0123456789ABCDEF - diff --git a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_opaque_array.nc.7.raw.txt b/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_opaque_array.nc.7.raw.txt deleted file mode 100644 index 157a621f2a..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_opaque_array.nc.7.raw.txt +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - -/vo2[0,0] = 0xFEDCBA9876543210 -/vo2[0,1] = 0xFEDCBA9999999999 - diff --git a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_opaque_array.nc.raw.txt b/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_opaque_array.nc.raw.txt deleted file mode 100644 index 91da77c407..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_opaque_array.nc.raw.txt +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - -/vo2[0,0] = 0x0123456789ABCDEF -/vo2[0,1] = 0xABCDEF0000000000 -/vo2[1,0] = 0xFEDCBA9876543210 -/vo2[1,1] = 0xFEDCBA9999999999 - diff --git a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_sequence_1.syn.raw.txt b/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_sequence_1.syn.raw.txt deleted file mode 100644 index 0e347626ef..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_sequence_1.syn.raw.txt +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - -/s = { - [ - /s.i1 = -920699049 - /s.sh1 = 896 - ]} - diff --git a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_sequence_2.syn.raw.txt b/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_sequence_2.syn.raw.txt deleted file mode 100644 index bc5c5110e6..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_sequence_2.syn.raw.txt +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - -/s[0] = { - [ - /s.i1 = -920699049 - /s.sh1 = 896 - ]} -/s[1] = { - [ - /s.i1 = -1123468835 - /s.sh1 = -18686 - ] [ - /s.i1 = 2125143125 - /s.sh1 = -21899 - ] [ - /s.i1 = 1268468519 - /s.sh1 = -22144 - ] [ - /s.i1 = 989876086 - /s.sh1 = 3361 - ]} - diff --git a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_struct_array.nc.6.raw.txt b/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_struct_array.nc.6.raw.txt deleted file mode 100644 index e142a33713..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_struct_array.nc.6.raw.txt +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - -/s[0,0] = { - /s.x = 1 - /s.y = -1 -} -/s[0,1] = { - /s.x = 17 - /s.y = 37 -} -/s[1,0] = { - /s.x = -4 - /s.y = 12 -} -/s[1,1] = { - /s.x = -8 - /s.y = 8 -} - diff --git a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_struct_array.syn.raw.txt b/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_struct_array.syn.raw.txt deleted file mode 100644 index 0b856f51d9..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_struct_array.syn.raw.txt +++ /dev/null @@ -1,77 +0,0 @@ - - - - - - - - - - - - - - - - -/z[0] = 0.727653 -/z[1] = 0.785633 -/z[2] = 0.513679 -/z[3] = 0.246845 -/t[0] = 0.738422 -/t[1] = 0.214889 -/t[2] = 0.494798 -/s[0,0] = { - /s.x = 712320147 - /s.y = 1268468519 -} -/s[0,1] = { - /s.x = 696298400 - /s.y = 989876086 -} -/s[0,2] = { - /s.x = -1927163883 - /s.y = -900795134 -} -/s[1,0] = { - /s.x = -708236713 - /s.y = 1377500019 -} -/s[1,1] = { - /s.x = 511843988 - /s.y = 1699265896 -} -/s[1,2] = { - /s.x = -540214433 - /s.y = -914532520 -} -/s[2,0] = { - /s.x = -1344032615 - /s.y = -871416961 -} -/s[2,1] = { - /s.x = -1928735161 - /s.y = 935744880 -} -/s[2,2] = { - /s.x = -1509955773 - /s.y = -1707460853 -} -/s[3,0] = { - /s.x = 1145911788 - /s.y = -415231529 -} -/s[3,1] = { - /s.x = -278269626 - /s.y = -1682978013 -} -/s[3,2] = { - /s.x = -1629885665 - /s.y = -909240754 -} - diff --git a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_struct_nested.hdf5.raw.txt b/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_struct_nested.hdf5.raw.txt deleted file mode 100644 index 57c8557ac2..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_struct_nested.hdf5.raw.txt +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - -/x = { - /x.field1 = { - /x.field1.x = 1 - /x.field1.y = -2 - } - /x.field2 = { - /x.field2.x = 255 - /x.field2.y = 90 - } -} - diff --git a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_struct_nested3.hdf5.raw.txt b/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_struct_nested3.hdf5.raw.txt deleted file mode 100644 index ed42456ce6..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_struct_nested3.hdf5.raw.txt +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - -/x = { - /x.field3 = { - /x.field3.field2 = { - /x.field3.field2.field1 = 17 - } - } -} - diff --git a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_struct_type.nc.raw.txt b/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_struct_type.nc.raw.txt deleted file mode 100644 index f15f61d6b3..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_struct_type.nc.raw.txt +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - -/s = { - /s.x = 1 - /s.y = -2 -} - diff --git a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_utf8.nc.raw.txt b/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_utf8.nc.raw.txt deleted file mode 100644 index 4df9309d37..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_utf8.nc.raw.txt +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - -/vs[0] = "Καλημέα" -/vs[1] = "abc" - diff --git a/dap4/d4tests/src/test/data/resources/TestDSR/baseline/test1.dsr b/dap4/d4tests/src/test/data/resources/TestDSR/baseline/test1.dsr deleted file mode 100644 index 125939c27c..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestDSR/baseline/test1.dsr +++ /dev/null @@ -1,29 +0,0 @@ - - - 4.0 - TDS-4 - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestFilters/baseline/test_sequence_1.syn.1.dap b/dap4/d4tests/src/test/data/resources/TestFilters/baseline/test_sequence_1.syn.1.dap deleted file mode 100644 index f36a08093f..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestFilters/baseline/test_sequence_1.syn.1.dap +++ /dev/null @@ -1,3 +0,0 @@ -count=5 - -1169720286 18719 -2088732436 -16591 -1123468835 -18686 2125143125 -21899 1268468519 -22144 - checksum = 4aad97d4 diff --git a/dap4/d4tests/src/test/data/resources/TestFilters/baseline/test_sequence_1.syn.1.dmr b/dap4/d4tests/src/test/data/resources/TestFilters/baseline/test_sequence_1.syn.1.dmr deleted file mode 100644 index 29109a2c04..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestFilters/baseline/test_sequence_1.syn.1.dmr +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestFilters/baseline/test_sequence_1.syn.2.dap b/dap4/d4tests/src/test/data/resources/TestFilters/baseline/test_sequence_1.syn.2.dap deleted file mode 100644 index 7d7d18b90f..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestFilters/baseline/test_sequence_1.syn.2.dap +++ /dev/null @@ -1,3 +0,0 @@ -count=3 - -1169720286 18719 -2088732436 -16591 -1123468835 -18686 - checksum = 6a9c6608 diff --git a/dap4/d4tests/src/test/data/resources/TestFrontPage/baseline/test_frontpage.html b/dap4/d4tests/src/test/data/resources/TestFrontPage/baseline/test_frontpage.html deleted file mode 100644 index 51e228d2dd..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestFrontPage/baseline/test_frontpage.html +++ /dev/null @@ -1,296 +0,0 @@ - - -DAP4 Test Files - - - -

DAP4 Test Files

-

http://remotetest.unidata.ucar.edu/d4ts/{testfiles}

-
-

netCDF Based Test Files

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
test_atomic_array.nc: DMR.XML DAP DSR.XML
test_atomic_types.nc: DMR.XML DAP DSR.XML
test_enum.nc: DMR.XML DAP DSR.XML
test_enum1.nc: DMR.XML DAP DSR.XML
test_enum_2.nc: DMR.XML DAP DSR.XML
test_enum_array.nc: DMR.XML DAP DSR.XML
test_fill.nc: DMR.XML DAP DSR.XML
test_groups1.nc: DMR.XML DAP DSR.XML
test_misc1.nc: DMR.XML DAP DSR.XML
test_one_var.nc: DMR.XML DAP DSR.XML
test_one_vararray.nc: DMR.XML DAP DSR.XML
test_opaque.nc: DMR.XML DAP DSR.XML
test_opaque_array.nc: DMR.XML DAP DSR.XML
test_struct1.nc: DMR.XML DAP DSR.XML
test_struct_array.nc: DMR.XML DAP DSR.XML
test_struct_nested.nc: DMR.XML DAP DSR.XML
test_struct_nested3.nc: DMR.XML DAP DSR.XML
test_struct_type.nc: DMR.XML DAP DSR.XML
test_test.nc: DMR.XML DAP DSR.XML
test_unlim.nc: DMR.XML DAP DSR.XML
test_unlim1.nc: DMR.XML DAP DSR.XML
test_utf8.nc: DMR.XML DAP DSR.XML
test_vlen1.nc: DMR.XML DAP DSR.XML
test_vlen10.nc: DMR.XML DAP DSR.XML
test_vlen11.nc: DMR.XML DAP DSR.XML
test_vlen2.nc: DMR.XML DAP DSR.XML
test_vlen3.nc: DMR.XML DAP DSR.XML
test_vlen4.nc: DMR.XML DAP DSR.XML
test_vlen5.nc: DMR.XML DAP DSR.XML
test_vlen6.nc: DMR.XML DAP DSR.XML
test_vlen7.nc: DMR.XML DAP DSR.XML
test_vlen8.nc: DMR.XML DAP DSR.XML
test_vlen9.nc: DMR.XML DAP DSR.XML
test_zerodim.nc: DMR.XML DAP DSR.XML
tst_fills.nc: DMR.XML DAP DSR.XML
-

HDF5 Based Test Files

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
test_struct_nested.hdf5: DMR.XML DAP DSR.XML
test_struct_nested3.hdf5: DMR.XML DAP DSR.XML
test_vlen3.hdf5: DMR.XML DAP DSR.XML
test_vlen4.hdf5: DMR.XML DAP DSR.XML
test_vlen5.hdf5: DMR.XML DAP DSR.XML
-

Synthetic Based Test Files

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
test_anon_dim.syn: DMR.XML DAP DSR.XML
test_atomic_array.syn: DMR.XML DAP DSR.XML
test_atomic_types.syn: DMR.XML DAP DSR.XML
test_sequence_1.syn: DMR.XML DAP DSR.XML
test_sequence_2.syn: DMR.XML DAP DSR.XML
test_struct_array.syn: DMR.XML DAP DSR.XML
-
- diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_0.1.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_0.1.xml deleted file mode 100644 index 24f33b55bd..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_0.1.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - 1 - 2 - 3 - - - - some_large_hex_value - - - red - green - blue - - - 98.6 - - - barf - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_0.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_0.xml deleted file mode 100644 index e3d90ac6e0..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_0.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - 1 - 2 - 3 - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_1.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_1.xml deleted file mode 100644 index eb2ba2bd26..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_1.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_2.1.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_2.1.xml deleted file mode 100644 index 14d9b2b378..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_2.1.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_2.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_2.xml deleted file mode 100644 index de25771186..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_2.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_3.1.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_3.1.xml deleted file mode 100644 index e2912f2f3c..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_3.1.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - 1 - 2 - 3 - - - - some_large_hex_value - - - red - green - blue - - - 98.6 - - - barf - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_3.2.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_3.2.xml deleted file mode 100644 index e4bd6ea48c..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_3.2.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_3.3.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_3.3.xml deleted file mode 100644 index b2e99a4064..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_3.3.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - 1 - 2 - 3 - - - - some_large_hex_value - - - red - green - blue - - - 98.6 - - - barf - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_3.4.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_3.4.xml deleted file mode 100644 index 98354ea298..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_3.4.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_3.5.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_3.5.xml deleted file mode 100644 index 822345c2e6..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_3.5.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_3.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_3.xml deleted file mode 100644 index 7675f27e56..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_3.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_4.1.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_4.1.xml deleted file mode 100644 index e43ec4f81f..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_4.1.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_4.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_4.xml deleted file mode 100644 index 7728abca32..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_4.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_5.1.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_5.1.xml deleted file mode 100644 index 8ae88fff55..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_5.1.xml +++ /dev/null @@ -1,53 +0,0 @@ - - dapVersion="4.0" dmrVersion="1.0"> - - - - - - - - - - - - 1 - 2 - 3 - - - - some_large_hex_value - - - - - - - - - - - - - - - 1 - 2 - 3 - - - - some_large_hex_value - - - red - green - blue - - - 98.6 - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_5.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_5.xml deleted file mode 100644 index 7900313c64..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_5.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_6.1.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_6.1.xml deleted file mode 100644 index 0585fd7a24..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_6.1.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - 1 - 2 - 3 - - - - - - - - - - - - - 1 - 2 - 3 - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_6.2.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_6.2.xml deleted file mode 100644 index 92960908f8..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_6.2.xml +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - - - - - 1 - 2 - 3 - - - - - - - - - - - - - - - - - - - 1 - 2 - 3 - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_6.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_6.xml deleted file mode 100644 index a88b5bf47d..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_6.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_7.1.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_7.1.xml deleted file mode 100644 index 588a1ee931..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_7.1.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_7.2.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_7.2.xml deleted file mode 100644 index 25b9b59c51..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_7.2.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_7.3.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_7.3.xml deleted file mode 100644 index 5d04405d3d..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_7.3.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_7.4.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_7.4.xml deleted file mode 100644 index aef2e07583..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_7.4.xml +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_7.5.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_7.5.xml deleted file mode 100644 index 2e5bcacfee..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_7.5.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_7.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_7.xml deleted file mode 100644 index d2e55307d7..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_7.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_8.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_8.xml deleted file mode 100644 index 29a93fe87f..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/DMR_8.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_array_1.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_array_1.xml deleted file mode 100644 index da6d955ac4..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_array_1.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - xmlns="http://xml.opendap.org/ns/DAP/4.0#" - xmlns:dap="http://xml.opendap.org/ns/DAP/4.0#"> - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_array_10.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_array_10.xml deleted file mode 100644 index aac65a7955..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_array_10.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_array_11.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_array_11.xml deleted file mode 100644 index f661ce3517..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_array_11.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_array_2.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_array_2.xml deleted file mode 100644 index 45ab981649..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_array_2.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - xmlns="http://xml.opendap.org/ns/DAP/4.0#" - xmlns:dap="http://xml.opendap.org/ns/DAP/4.0#"> - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_array_3.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_array_3.xml deleted file mode 100644 index 356785c0e4..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_array_3.xml +++ /dev/null @@ -1,12 +0,0 @@ - - xmlns="http://xml.opendap.org/ns/DAP/4.0#" - xmlns:dap="http://xml.opendap.org/ns/DAP/4.0#"> - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_array_4.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_array_4.xml deleted file mode 100644 index e04b11ed9b..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_array_4.xml +++ /dev/null @@ -1,64 +0,0 @@ - - - xmlns="http://xml.opendap.org/ns/DAP/4.0#" - xmlns:dap="http://xml.opendap.org/ns/DAP/4.0#"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_array_5.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_array_5.xml deleted file mode 100644 index de24f7fdfa..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_array_5.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - xmlns="http://xml.opendap.org/ns/DAP/4.0#" - xmlns:dap="http://xml.opendap.org/ns/DAP/4.0#"> - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_array_6.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_array_6.xml deleted file mode 100644 index 88a4209425..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_array_6.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - xmlns="http://xml.opendap.org/ns/DAP/4.0#" - xmlns:dap="http://xml.opendap.org/ns/DAP/4.0#"> - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_array_7.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_array_7.xml deleted file mode 100644 index 00a22b0c81..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_array_7.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - xmlns="http://xml.opendap.org/ns/DAP/4.0#" - xmlns:dap="http://xml.opendap.org/ns/DAP/4.0#"> - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_array_8.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_array_8.xml deleted file mode 100644 index 61919cb9d3..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_array_8.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - xmlns="http://xml.opendap.org/ns/DAP/4.0#" xmlns:dap="http://xml.opendap.org/ns/DAP/4.0#"> - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_escaped_paths.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_escaped_paths.xml deleted file mode 100644 index afd82e7bf2..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_escaped_paths.xml +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - 10 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_1.dmr b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_1.dmr deleted file mode 100644 index 503b89e031..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_1.dmr +++ /dev/null @@ -1,10 +0,0 @@ - - - - - xmlns="http://xml.opendap.org/ns/DAP/4.0#" - xmlns:dap="http://xml.opendap.org/ns/DAP/4.0#"> - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_1.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_1.xml deleted file mode 100644 index 503b89e031..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_1.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - xmlns="http://xml.opendap.org/ns/DAP/4.0#" - xmlns:dap="http://xml.opendap.org/ns/DAP/4.0#"> - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_10.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_10.xml deleted file mode 100644 index e87a967368..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_10.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - xmlns="http://xml.opendap.org/ns/DAP/4.0#" - xmlns:dap="http://xml.opendap.org/ns/DAP/4.0#"> - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_2.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_2.xml deleted file mode 100644 index 78e6928d1e..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_2.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - xmlns="http://xml.opendap.org/ns/DAP/4.0#"> - - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_3.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_3.xml deleted file mode 100644 index 5068261867..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_3.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_3_error_1.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_3_error_1.xml deleted file mode 100644 index 5686798376..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_3_error_1.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_3_error_2.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_3_error_2.xml deleted file mode 100644 index 6f28cd48ae..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_3_error_2.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_3_error_3.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_3_error_3.xml deleted file mode 100644 index c8d6f24d51..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_3_error_3.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_4.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_4.xml deleted file mode 100644 index 416f4597e5..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_4.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - xmlns="http://xml.opendap.org/ns/DAP/4.0#" - xmlns:dap="http://xml.opendap.org/ns/DAP/4.0#"> - - - - x_axis_value - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_5.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_5.xml deleted file mode 100644 index 5c844638ef..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_5.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - xmlns="http://xml.opendap.org/ns/DAP/4.0#" - xmlns:dap="http://xml.opendap.org/ns/DAP/4.0#"> - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_6.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_6.xml deleted file mode 100644 index 20e14a6f6a..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_6.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - xmlns="http://xml.opendap.org/ns/DAP/4.0#" - xmlns:dap="http://xml.opendap.org/ns/DAP/4.0#"> - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_7.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_7.xml deleted file mode 100644 index d163b92912..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_7.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - xmlns="http://xml.opendap.org/ns/DAP/4.0#" - xmlns:dap="http://xml.opendap.org/ns/DAP/4.0#"> - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_8.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_8.xml deleted file mode 100644 index 4db2522603..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_8.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - xmlns="http://xml.opendap.org/ns/DAP/4.0#" - xmlns:dap="http://xml.opendap.org/ns/DAP/4.0#"> - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_9.1.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_9.1.xml deleted file mode 100644 index 0dacc20a66..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_9.1.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - xmlns="http://xml.opendap.org/ns/DAP/4.0#" - xmlns:dap="http://xml.opendap.org/ns/DAP/4.0#"> - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_9.xml b/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_9.xml deleted file mode 100644 index fd38d284d6..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/dmr/test_simple_9.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - xmlns="http://xml.opendap.org/ns/DAP/4.0#" - xmlns:dap="http://xml.opendap.org/ns/DAP/4.0#"> - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestHyrax/hyrax.html b/dap4/d4tests/src/test/data/resources/TestHyrax/hyrax.html deleted file mode 100644 index e92d923650..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestHyrax/hyrax.html +++ /dev/null @@ -1,380 +0,0 @@ - - -DAP4 Test Files - - - -

DAP4 Test Files

-

http://amazon.com/dap/reader/dap4/dap4.html

-
-

netCDF Based Test Files

- -
-

HDF5 Based Test Files

- -
-

Synthetic Based Test Files

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
test_simple_1.dmr: DMR (XML) DAP DSR
dmr-testsuite/test_array_10.xml: DMR (XML) DAP DSR
dmr-testsuite/test_array_11.xml: DMR (XML) DAP DSR
dmr-testsuite/test_array_1.xml: DMR (XML) DAP DSR
dmr-testsuite/test_array_2.xml: DMR (XML) DAP DSR
dmr-testsuite/test_array_3.xml: DMR (XML) DAP DSR
dmr-testsuite/test_array_4.xml: DMR (XML) DAP DSR
dmr-testsuite/test_array_5.xml: DMR (XML) DAP DSR
dmr-testsuite/test_array_6.xml: DMR (XML) DAP DSR
dmr-testsuite/test_array_7.xml: DMR (XML) DAP DSR
dmr-testsuite/test_array_8.xml: DMR (XML) DAP DSR
dmr-testsuite/test_simple_10.xml: DMR (XML) DAP DSR
dmr-testsuite/test_simple_1.xml: DMR (XML) DAP DSR
dmr-testsuite/test_simple_2.xml: DMR (XML) DAP DSR
dmr-testsuite/test_simple_3_error_1.xml: DMR (XML) DAP DSR
dmr-testsuite/test_simple_3_error_2.xml: DMR (XML) DAP DSR
dmr-testsuite/test_simple_3_error_3.xml: DMR (XML) DAP DSR
dmr-testsuite/test_simple_3.xml: DMR (XML) DAP DSR
dmr-testsuite/test_simple_4.xml: DMR (XML) DAP DSR
dmr-testsuite/test_simple_5.xml: DMR (XML) DAP DSR
dmr-testsuite/test_simple_6.xml: DMR (XML) DAP DSR
dmr-testsuite/test_simple_7.xml: DMR (XML) DAP DSR
dmr-testsuite/test_simple_8.xml: DMR (XML) DAP DSR
dmr-testsuite/test_simple_9.1.xml: DMR (XML) DAP DSR
dmr-testsuite/test_simple_9.xml: DMR (XML) DAP DSR
dmr-testsuite/test_escaped_paths.xml: DMR (XML) DAP DSR
D4-xml/DMR_0.1.xml: DMR (XML) DAP DSR
D4-xml/DMR_0.xml: DMR (XML) DAP DSR
D4-xml/DMR_1.xml: DMR (XML) DAP DSR
D4-xml/DMR_2.1.xml: DMR (XML) DAP DSR
D4-xml/DMR_2.xml: DMR (XML) DAP DSR
D4-xml/DMR_3.1.xml: DMR (XML) DAP DSR
D4-xml/DMR_3.2.xml: DMR (XML) DAP DSR
D4-xml/DMR_3.3.xml: DMR (XML) DAP DSR
D4-xml/DMR_3.4.xml: DMR (XML) DAP DSR
D4-xml/DMR_3.5.xml: DMR (XML) DAP DSR
D4-xml/DMR_3.xml: DMR (XML) DAP DSR
D4-xml/DMR_4.1.xml: DMR (XML) DAP DSR
D4-xml/DMR_4.xml: DMR (XML) DAP DSR
D4-xml/DMR_5.1.xml: DMR (XML) DAP DSR
D4-xml/DMR_5.xml: DMR (XML) DAP DSR
D4-xml/DMR_6.1.xml: DMR (XML) DAP DSR
D4-xml/DMR_6.2.xml: DMR (XML) DAP DSR
D4-xml/DMR_6.xml: DMR (XML) DAP DSR
D4-xml/DMR_7.1.xml: DMR (XML) DAP DSR
D4-xml/DMR_7.2.xml: DMR (XML) DAP DSR
D4-xml/DMR_7.3.xml: DMR (XML) DAP DSR
D4-xml/DMR_7.4.xml: DMR (XML) DAP DSR
D4-xml/DMR_7.5.xml: DMR (XML) DAP DSR
D4-xml/DMR_7.xml: DMR (XML) DAP DSR
D4-xml/DMR_8.xml: DMR (XML) DAP DSR
-
- diff --git a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_struct_array.nc.nc4.dap b/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_struct_array.nc.nc4.dap deleted file mode 100644 index b62c9b8688..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_struct_array.nc.nc4.dap +++ /dev/null @@ -1,67 +0,0 @@ -netcdf test_struct_array { - dimensions: - dx = 4; - dy = 3; - variables: - - Structure { - int x; - string x:_CoordinateAxisType = "GeoX"; - int y; - string y:_CoordinateAxisType = "GeoY"; - } s(dx, dy); - - - // global attributes: - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -s = - { - x =1 - y =-1 - } s(0) - { - x =17 - y =37 - } s(1) - { - x =-32767 - y =32767 - } s(2) - { - x =-1 - y =3 - } s(3) - { - x =-2 - y =2 - } s(4) - { - x =-3 - y =1 - } s(5) - { - x =-4 - y =12 - } s(6) - { - x =-8 - y =8 - } s(7) - { - x =-12 - y =4 - } s(8) - { - x =-5 - y =15 - } s(9) - { - x =-10 - y =10 - } s(10) - { - x =-15 - y =5 - } s(11) -} diff --git a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_struct_nested.nc.nc4.dmr b/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_struct_nested.nc.nc4.dmr deleted file mode 100644 index 8cb6375d5a..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_struct_nested.nc.nc4.dmr +++ /dev/null @@ -1,24 +0,0 @@ -netcdf test_struct_nested { - variables: - - Structure { - - Structure { - int x; - string x:_CoordinateAxisType = "GeoX"; - int y; - string y:_CoordinateAxisType = "GeoY"; - } field1; - - - Structure { - int x; - int y; - } field2; - - } x; - - - // global attributes: - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; -} diff --git a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_vlen1.nc.nc4.dap b/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_vlen1.nc.nc4.dap deleted file mode 100644 index 3c411cc3c6..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_vlen1.nc.nc4.dap +++ /dev/null @@ -1,11 +0,0 @@ -netcdf test_vlen1 { - variables: - int x(*); - string x:_CoordinateAxisType = "GeoX"; - - // global attributes: - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -x = - {1, 3, 5, 7} -} diff --git a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_vlen1.nc.nc4.dmr b/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_vlen1.nc.nc4.dmr deleted file mode 100644 index 66e15af40f..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_vlen1.nc.nc4.dmr +++ /dev/null @@ -1,8 +0,0 @@ -netcdf test_vlen1 { - variables: - int x(*); - string x:_CoordinateAxisType = "GeoX"; - - // global attributes: - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; -} diff --git a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_vlen2.nc.nc4.dap b/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_vlen2.nc.nc4.dap deleted file mode 100644 index 8628cb9931..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_vlen2.nc.nc4.dap +++ /dev/null @@ -1,21 +0,0 @@ -netcdf test_vlen2 { - dimensions: - d3 = 3; - d2 = 2; - variables: - int x(d3, d2, *); - string x:_CoordinateAxisType = "GeoX"; - - // global attributes: - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: - x = - { - {1, 3, 5, 7}, - {100, 200}, - {-1, -2}, - {1, 3, 5, 7}, - {100, 200}, - {-1, -2} - } -} diff --git a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_vlen3.nc.nc4.dap b/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_vlen3.nc.nc4.dap deleted file mode 100644 index aaef5daf73..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_vlen3.nc.nc4.dap +++ /dev/null @@ -1,17 +0,0 @@ -netcdf test_vlen3 { - variables: - - Structure { - int f1(*); - } v1; - - - // global attributes: - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: - v1 = - { - f1 = - {1, 3, 5, 7} - } v1(0) -} diff --git a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_vlen4.nc.nc4.dap b/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_vlen4.nc.nc4.dap deleted file mode 100644 index 0c62ce086b..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_vlen4.nc.nc4.dap +++ /dev/null @@ -1,20 +0,0 @@ -netcdf test_vlen4 { - variables: - - Structure { - int f1(2, *); - } v1; - - - // global attributes: - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: - v1 = - { - f1 = - { - {1, 3, 5, 7}, - {100, 200} - } - } v1(0) -} diff --git a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_vlen5.nc.nc4.dap b/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_vlen5.nc.nc4.dap deleted file mode 100644 index 8e92721907..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_vlen5.nc.nc4.dap +++ /dev/null @@ -1,23 +0,0 @@ -netcdf test_vlen5 { - dimensions: - d2 = 2; - variables: - - Structure { - int v(*); - } v1(d2); - - - // global attributes: - string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -v1 = - { - v = - {1, 3, 5, 7} - } v1(0) - { - v = - {100, 200} - } v1(1) -} diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_anon_dim.syn.dmp b/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_anon_dim.syn.dmp deleted file mode 100644 index 8bfb4671ca..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_anon_dim.syn.dmp +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_atomic_array.nc.dmp b/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_atomic_array.nc.dmp deleted file mode 100644 index 52f093929b..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_atomic_array.nc.dmp +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_atomic_array.syn.dmp b/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_atomic_array.syn.dmp deleted file mode 100644 index 3519a327b0..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_atomic_array.syn.dmp +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_atomic_types.nc.dmp b/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_atomic_types.nc.dmp deleted file mode 100644 index aef3b9eda0..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_atomic_types.nc.dmp +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_atomic_types.syn.dmp b/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_atomic_types.syn.dmp deleted file mode 100644 index f7a05c2e72..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_atomic_types.syn.dmp +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_enum.nc.dmp b/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_enum.nc.dmp deleted file mode 100644 index 10841fbc27..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_enum.nc.dmp +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_enum_2.nc.dmp b/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_enum_2.nc.dmp deleted file mode 100644 index e29149a244..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_enum_2.nc.dmp +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_enum_array.nc.dmp b/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_enum_array.nc.dmp deleted file mode 100644 index bfa1765093..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_enum_array.nc.dmp +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_fill.nc.dmp b/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_fill.nc.dmp deleted file mode 100644 index 2d1ba264b4..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_fill.nc.dmp +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_groups1.nc.dmp b/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_groups1.nc.dmp deleted file mode 100644 index 80f918edc6..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_groups1.nc.dmp +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_one_var.nc.dmp b/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_one_var.nc.dmp deleted file mode 100644 index 89016b1816..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_one_var.nc.dmp +++ /dev/null @@ -1,8 +0,0 @@ - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_one_vararray.nc.dmp b/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_one_vararray.nc.dmp deleted file mode 100644 index 8f199d1cb1..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_one_vararray.nc.dmp +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_opaque.nc.dmp b/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_opaque.nc.dmp deleted file mode 100644 index 1214eb28eb..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_opaque.nc.dmp +++ /dev/null @@ -1,8 +0,0 @@ - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_opaque_array.nc.dmp b/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_opaque_array.nc.dmp deleted file mode 100644 index b79939de67..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_opaque_array.nc.dmp +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_sequence_1.syn.dmp b/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_sequence_1.syn.dmp deleted file mode 100644 index 29109a2c04..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_sequence_1.syn.dmp +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_sequence_2.syn.dmp b/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_sequence_2.syn.dmp deleted file mode 100644 index 4194cf19d4..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_sequence_2.syn.dmp +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_struct_array.nc.dmp b/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_struct_array.nc.dmp deleted file mode 100644 index 8dabe14882..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_struct_array.nc.dmp +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_struct_array.syn.dmp b/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_struct_array.syn.dmp deleted file mode 100644 index 909d78befa..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_struct_array.syn.dmp +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_struct_nested.hdf5.dmp b/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_struct_nested.hdf5.dmp deleted file mode 100644 index 376824981e..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_struct_nested.hdf5.dmp +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_struct_nested3.hdf5.dmp b/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_struct_nested3.hdf5.dmp deleted file mode 100644 index 03ac53d23c..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_struct_nested3.hdf5.dmp +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_struct_type.nc.dmp b/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_struct_type.nc.dmp deleted file mode 100644 index 4e2adb0c1d..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_struct_type.nc.dmp +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_utf8.nc.dmp b/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_utf8.nc.dmp deleted file mode 100644 index 74115be967..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_utf8.nc.dmp +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_vlen1.nc.dmp b/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_vlen1.nc.dmp deleted file mode 100644 index b30754e1b2..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_vlen1.nc.dmp +++ /dev/null @@ -1,10 +0,0 @@ - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_vlen2.nc.dmp b/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_vlen2.nc.dmp deleted file mode 100644 index cea92859ec..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_vlen2.nc.dmp +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_vlen3.hdf5.dmp b/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_vlen3.hdf5.dmp deleted file mode 100644 index dbad545664..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/test_vlen3.hdf5.dmp +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/testall.dmp b/dap4/d4tests/src/test/data/resources/TestParsers/baseline/testall.dmp deleted file mode 100644 index 9b57107614..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/baseline/testall.dmp +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_atomic_array.nc.dmr b/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_atomic_array.nc.dmr deleted file mode 100644 index 29a61e7c8b..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_atomic_array.nc.dmr +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_atomic_array.syn.dmr b/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_atomic_array.syn.dmr deleted file mode 100644 index 3519a327b0..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_atomic_array.syn.dmr +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_atomic_types.nc.dmr b/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_atomic_types.nc.dmr deleted file mode 100644 index aef3b9eda0..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_atomic_types.nc.dmr +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_atomic_types.syn.dmr b/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_atomic_types.syn.dmr deleted file mode 100644 index ec5ed7d9f7..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_atomic_types.syn.dmr +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_enum.nc.dmr b/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_enum.nc.dmr deleted file mode 100644 index 10841fbc27..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_enum.nc.dmr +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_enum_array.nc.dmr b/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_enum_array.nc.dmr deleted file mode 100644 index bfa1765093..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_enum_array.nc.dmr +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_groups1.nc.dmr b/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_groups1.nc.dmr deleted file mode 100644 index 80f918edc6..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_groups1.nc.dmr +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_one_var.nc.dmr b/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_one_var.nc.dmr deleted file mode 100644 index 89016b1816..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_one_var.nc.dmr +++ /dev/null @@ -1,8 +0,0 @@ - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_one_vararray.nc.dmr b/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_one_vararray.nc.dmr deleted file mode 100644 index 8f199d1cb1..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_one_vararray.nc.dmr +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_struct_array.nc.dmr b/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_struct_array.nc.dmr deleted file mode 100644 index 8dabe14882..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_struct_array.nc.dmr +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_struct_nested.hdf5.dmr b/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_struct_nested.hdf5.dmr deleted file mode 100644 index 376824981e..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_struct_nested.hdf5.dmr +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_struct_nested3.hdf5.dmr b/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_struct_nested3.hdf5.dmr deleted file mode 100644 index 03ac53d23c..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_struct_nested3.hdf5.dmr +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_struct_type.nc.dmr b/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_struct_type.nc.dmr deleted file mode 100644 index 4e2adb0c1d..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_struct_type.nc.dmr +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_utf8.nc.dmr b/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_utf8.nc.dmr deleted file mode 100644 index 74115be967..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_utf8.nc.dmr +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_vlen1.nc.dmr b/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_vlen1.nc.dmr deleted file mode 100644 index b30754e1b2..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_vlen1.nc.dmr +++ /dev/null @@ -1,10 +0,0 @@ - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_vlen3.hdf5.dmr b/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_vlen3.hdf5.dmr deleted file mode 100644 index dbad545664..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_vlen3.hdf5.dmr +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_vlen5.hdf5.dmr b/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_vlen5.hdf5.dmr deleted file mode 100644 index 20cc09a17b..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_vlen5.hdf5.dmr +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/testall.dmr b/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/testall.dmr deleted file mode 100644 index 0e2bf5de38..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/testall.dmr +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - 10 - - - abcd "hello" "quoted" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/testinput/ce1.txt b/dap4/d4tests/src/test/data/resources/TestParsers/testinput/ce1.txt deleted file mode 100644 index 73b06f4c1f..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/testinput/ce1.txt +++ /dev/null @@ -1,8 +0,0 @@ -# Constraint tests for ce1_dmr.txt -/a[1] -/b[10:16] -/c[8:2:15] -/a[1];/b[10:16];/c[8:2:15] -/d[1][0:2:2];/a[1];/e[1][0];/f[0][1] -/s[0:3][0:2].x;/s[0:3][0:2].y - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/testinput/ce1_dmr.txt b/dap4/d4tests/src/test/data/resources/TestParsers/testinput/ce1_dmr.txt deleted file mode 100644 index e3b4d952be..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/testinput/ce1_dmr.txt +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/testinput/test_misc1.xml b/dap4/d4tests/src/test/data/resources/TestParsers/testinput/test_misc1.xml deleted file mode 100644 index 16d8b476e3..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/testinput/test_misc1.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/testinput/test_misc2.xml b/dap4/d4tests/src/test/data/resources/TestParsers/testinput/test_misc2.xml deleted file mode 100644 index e92d76698d..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/testinput/test_misc2.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/testinput/test_simple_1.xml b/dap4/d4tests/src/test/data/resources/TestParsers/testinput/test_simple_1.xml deleted file mode 100644 index 985fb24ba0..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/testinput/test_simple_1.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/testinput/test_simple_2.xml b/dap4/d4tests/src/test/data/resources/TestParsers/testinput/test_simple_2.xml deleted file mode 100644 index 60a1956ff4..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/testinput/test_simple_2.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/testinput/testall.xml b/dap4/d4tests/src/test/data/resources/TestParsers/testinput/testall.xml deleted file mode 100644 index dfe668a95c..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestParsers/testinput/testall.xml +++ /dev/null @@ -1,77 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - 10 - - - abcd \"hello\" "quoted" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_aaa.nc.dmp b/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_aaa.nc.dmp deleted file mode 100644 index 54fdf0828f..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_aaa.nc.dmp +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - -vs(0) = "Καλημέα" ; -vs(1) = "abc" ; diff --git a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_atomic_array.nc.0.dmp b/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_atomic_array.nc.0.dmp deleted file mode 100644 index 9ee80fe4bb..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_atomic_array.nc.0.dmp +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - -vu8(0,0) = 3 ; -vu8(0,1) = 5 ; -vd(0) = 1024.800000 ; -vs(0,0) = " -" ; -vo(0,0) = 0xABCDEF0000000000 ; diff --git a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_atomic_array.nc.1.dmp b/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_atomic_array.nc.1.dmp deleted file mode 100644 index e076c6ee23..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_atomic_array.nc.1.dmp +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_atomic_array.nc.dmp b/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_atomic_array.nc.dmp deleted file mode 100644 index bdea13973c..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_atomic_array.nc.dmp +++ /dev/null @@ -1,83 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -vu8(0,0) = 255 ; -vu8(0,1) = 1 ; -vu8(0,2) = 2 ; -vu8(1,0) = 3 ; -vu8(1,1) = 4 ; -vu8(1,2) = 5 ; -v16(0) = 1 ; -v16(1) = 2 ; -v16(2) = 3 ; -v16(3) = 4 ; -vu32(0,0) = 5 ; -vu32(0,1) = 4 ; -vu32(0,2) = 3 ; -vu32(1,0) = 2 ; -vu32(1,1) = 1 ; -vu32(1,2) = 0 ; -vd(0) = 17.900000 ; -vd(1) = 1024.800000 ; -vc(0) = '@' ; -vc(1) = '&' ; -vs(0,0) = "hello world" ; -vs(0,1) = "abc" ; -vs(1,0) = " -" ; -vs(1,1) = "Καλημέα" ; -vo(0,0) = 0x0123456789ABCDEF ; -vo(0,1) = 0xABCDEF0000000000 ; -primary_cloud(0) = Clear ; -primary_cloud(1) = Stratus ; -primary_cloud(2) = Clear ; -primary_cloud(3) = Cumulonimbus ; -primary_cloud(4) = Missing ; diff --git a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_atomic_array.nc.ncdump b/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_atomic_array.nc.ncdump deleted file mode 100644 index b9507deedf..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_atomic_array.nc.ncdump +++ /dev/null @@ -1,57 +0,0 @@ -netcdf null { - types: - enum cloud_class_t { 'Clear' = 0, 'Cumulonimbus' = 1, 'Stratus' = 2, 'Stratocumulus' = 3, 'Cumulus' = 4, 'Altostratus' = 5, 'Nimbostratus' = 6, 'Altocumulus' = 7, 'Missing' = 127, 'Cirrostratus' = 8, 'Cirrocumulus' = 9, 'Cirrus' = 10}; - - dimensions: - d1 = 1; - d2 = 2; - d3 = 3; - d4 = 4; - d5 = 5; - variables: - byte vu8(d2=2, d3=3); - :_Unsigned = "true"; - - short v16(d4=4); - - int vu32(d2=2, d3=3); - :_Unsigned = "true"; - - double vd(d2=2); - - char vc(d2=2); - - String vs(d2=2, d2=2); - - opaque vo(d1=1, d2=2); - - String primary_cloud(d5=5); - :_FillValue = "Missing"; - - // global attributes: - :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -vu8 = - { - {-1, 1, 2}, - {3, 4, 5} - } -v16 = - {1, 2, 3, 4} -vu32 = - { - {5, 4, 3}, - {2, 1, 0} - } -vd = - {17.9, 1024.8} -vc = "@&" -vs = - { "hello world", "abc", " -", "Καλημέρα" - } -vo = 0x0123456789abcdef, - 0xabcdef0000000000, - -primary_cloud = "Clear", "Clear", "Clear", "Clear", "Clear" -} diff --git a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_atomic_types.nc.dmp b/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_atomic_types.nc.dmp deleted file mode 100644 index e26e76d516..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_atomic_types.nc.dmp +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -v8 = -128 ; -vu8 = 255 ; -v16 = -32768 ; -vu16 = 65535 ; -v32 = 2147483647 ; -vu32 = 4294967295 ; -v64 = 9223372036854775807 ; -vu64 = 18446744073709551615 ; -vf = 3.141593 ; -vd = 3.141593 ; -vc = '@' ; -vs = "hello world" ; -vo = 0x0123456789ABCDEF ; -primary_cloud = Stratus ; -secondary_cloud = Missing ; diff --git a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_atomic_types.nc.ncdump b/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_atomic_types.nc.ncdump deleted file mode 100644 index 62a82936ef..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_atomic_types.nc.ncdump +++ /dev/null @@ -1,61 +0,0 @@ -netcdf null { - types: - enum cloud_class_t { 'Clear' = 0, 'Cumulonimbus' = 1, 'Stratus' = 2, 'Stratocumulus' = 3, 'Cumulus' = 4, 'Altostratus' = 5, 'Nimbostratus' = 6, 'Altocumulus' = 7, 'Missing' = 127, 'Cirrostratus' = 8, 'Cirrocumulus' = 9, 'Cirrus' = 10}; - - variables: - byte v8; - - byte vu8; - :_Unsigned = "true"; - - short v16; - - short vu16; - :_Unsigned = "true"; - - int v32; - - int vu32; - :_Unsigned = "true"; - - long v64; - - long vu64; - :_Unsigned = "true"; - - float vf; - - double vd; - - char vc; - - String vs; - - opaque vo; - - String primary_cloud; - :_FillValue = "Missing"; - - String secondary_cloud; - :_FillValue = "Missing"; - - // global attributes: - :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -v8 =-128 -vu8 =-1 -v16 =-32768 -vu16 =-1 -v32 =2147483647 -vu32 =-1 -v64 =9223372036854775807 -vu64 =-1 -vf =3.1415927 -vd =3.141592653589793 -vc =@ -vs = "hello world" -vo = 0x0123456789abcdef, - -primary_cloud = "Stratus" -secondary_cloud = "Unknown enum value=60" -} diff --git a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_enum.nc.dmp b/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_enum.nc.dmp deleted file mode 100644 index 5708512c59..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_enum.nc.dmp +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - - -primary_cloud = Stratus ; diff --git a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_enum_array.nc.0.dmp b/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_enum_array.nc.0.dmp deleted file mode 100644 index c08e20fe0f..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_enum_array.nc.0.dmp +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - -primary_cloud(0) = Clear ; -primary_cloud(1) = Stratus ; -primary_cloud(2) = Clear ; -primary_cloud(3) = Cumulonimbus ; -primary_cloud(4) = Missing ; diff --git a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_enum_array.nc.1.dmp b/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_enum_array.nc.1.dmp deleted file mode 100644 index 02fa4ec7e5..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_enum_array.nc.1.dmp +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - -primary_cloud(0) = Stratus ; -primary_cloud(1) = Cumulonimbus ; diff --git a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_enum_array.nc.dmp b/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_enum_array.nc.dmp deleted file mode 100644 index b82a1e1091..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_enum_array.nc.dmp +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - -primary_cloud(0) = Clear ; -primary_cloud(1) = Stratus ; -primary_cloud(2) = Clear ; -primary_cloud(3) = Cumulonimbus ; -primary_cloud(4) = Missing ; diff --git a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_groups1.nc.dmp b/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_groups1.nc.dmp deleted file mode 100644 index 2458e100dd..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_groups1.nc.dmp +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_groups1.nc.ncdump b/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_groups1.nc.ncdump deleted file mode 100644 index d0ff04ed22..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_groups1.nc.ncdump +++ /dev/null @@ -1,7 +0,0 @@ -netcdf null { - dimensions: - dim1 = 5; - // global attributes: - :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -} diff --git a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_one_var.nc.dmp b/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_one_var.nc.dmp deleted file mode 100644 index 07327c9df8..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_one_var.nc.dmp +++ /dev/null @@ -1,5 +0,0 @@ - - - - -t = 17 ; diff --git a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_one_var.nc.ncdump b/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_one_var.nc.ncdump deleted file mode 100644 index f9b96a90ca..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_one_var.nc.ncdump +++ /dev/null @@ -1,9 +0,0 @@ -netcdf null { - variables: - int t; - - // global attributes: - :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -t =17 -} diff --git a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_one_vararray.nc.0.dmp b/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_one_vararray.nc.0.dmp deleted file mode 100644 index b42a52d67e..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_one_vararray.nc.0.dmp +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - -t(0) = 17 ; -t(1) = 37 ; diff --git a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_one_vararray.nc.1.dmp b/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_one_vararray.nc.1.dmp deleted file mode 100644 index 5cd368ebb4..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_one_vararray.nc.1.dmp +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - -t(0) = 37 ; diff --git a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_one_vararray.nc.dmp b/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_one_vararray.nc.dmp deleted file mode 100644 index b42a52d67e..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_one_vararray.nc.dmp +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - -t(0) = 17 ; -t(1) = 37 ; diff --git a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_struct_array.nc.0.dmp b/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_struct_array.nc.0.dmp deleted file mode 100644 index d9cf704dcf..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_struct_array.nc.0.dmp +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - -Struct { -s.x = 1 ; -s.y = -1 ; -} s(0); -Struct { -s.x = 17 ; -s.y = 37 ; -} s(1); -Struct { -s.x = -4 ; -s.y = 12 ; -} s(2); -Struct { -s.x = -8 ; -s.y = 8 ; -} s(3); diff --git a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_struct_array.nc.dmp b/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_struct_array.nc.dmp deleted file mode 100644 index 13448edf44..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_struct_array.nc.dmp +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - - - -Struct { -s.x = 1 ; -s.y = -1 ; -} s(0); -Struct { -s.x = 17 ; -s.y = 37 ; -} s(1); -Struct { -s.x = -32767 ; -s.y = 32767 ; -} s(2); -Struct { -s.x = -1 ; -s.y = 3 ; -} s(3); -Struct { -s.x = -2 ; -s.y = 2 ; -} s(4); -Struct { -s.x = -3 ; -s.y = 1 ; -} s(5); -Struct { -s.x = -4 ; -s.y = 12 ; -} s(6); -Struct { -s.x = -8 ; -s.y = 8 ; -} s(7); -Struct { -s.x = -12 ; -s.y = 4 ; -} s(8); -Struct { -s.x = -5 ; -s.y = 15 ; -} s(9); -Struct { -s.x = -10 ; -s.y = 10 ; -} s(10); -Struct { -s.x = -15 ; -s.y = 5 ; -} s(11); diff --git a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_struct_array.nc.ncdump b/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_struct_array.nc.ncdump deleted file mode 100644 index 296e936377..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_struct_array.nc.ncdump +++ /dev/null @@ -1,26 +0,0 @@ -netcdf null { - dimensions: - dx = 2; - variables: - - Structure { - int x; - :_CoordinateAxisType = "GeoX"; - int y; - :_CoordinateAxisType = "GeoY"; - } x(dx=2); - - - // global attributes: - :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -x = - { - x =1 - y =-2 - } x(0) - { - x =17 - y =37 - } x(1) -} diff --git a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_struct_nested.hdf5.dmp b/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_struct_nested.hdf5.dmp deleted file mode 100644 index ab0a96abaa..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_struct_nested.hdf5.dmp +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - -Struct { -Struct { -x.field1.x = 1 ; -x.field1.y = -2 ; -} x.field1; -Struct { -x.field2.x = 255 ; -x.field2.y = 90 ; -} x.field2; -} x; diff --git a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_struct_type.nc.dmp b/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_struct_type.nc.dmp deleted file mode 100644 index 9bf70f993e..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_struct_type.nc.dmp +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - -Struct { -s.x = 1 ; -s.y = -2 ; -} s; diff --git a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_struct_type.nc.ncdump b/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_struct_type.nc.ncdump deleted file mode 100644 index a7a7e096a9..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_struct_type.nc.ncdump +++ /dev/null @@ -1,18 +0,0 @@ -netcdf null { - variables: - - Structure { - int x; - :_CoordinateAxisType = "GeoX"; - int y; - :_CoordinateAxisType = "GeoY"; - } x; - - - // global attributes: - :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -x = x =1 - y =-2 - -} diff --git a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_utf8.nc.dmp b/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_utf8.nc.dmp deleted file mode 100644 index 54fdf0828f..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_utf8.nc.dmp +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - -vs(0) = "Καλημέα" ; -vs(1) = "abc" ; diff --git a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_vlen1.nc.dmp b/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_vlen1.nc.dmp deleted file mode 100644 index d341f2cefc..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_vlen1.nc.dmp +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - -x(0) = 1 ; -x(1) = 3 ; -x(2) = 5 ; -x(3) = 7 ; diff --git a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_vlen2.nc.dmp b/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_vlen2.nc.dmp deleted file mode 100644 index f530233504..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_vlen2.nc.dmp +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - -x(0,0) = 1,3,5,7 ; -x(0,1) = 100,200 ; -x(1,0) = -1,-2 ; -x(1,1) = 1,3,5,7 ; -x(2,0) = 100,200 ; -x(2,1) = -1,-2 ; diff --git a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_vlen3.hdf5.dmp b/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_vlen3.hdf5.dmp deleted file mode 100644 index 1197da6c2f..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_vlen3.hdf5.dmp +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - -Struct { -v1.f1(0) = 1 ; -v1.f1(1) = 3 ; -v1.f1(2) = 5 ; -v1.f1(3) = 7 ; -} v1; diff --git a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_vlen5.hdf5.dmp b/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_vlen5.hdf5.dmp deleted file mode 100644 index 341c6ecfe9..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestSerial/baseline/test_vlen5.hdf5.dmp +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - -Struct { -v1.v(0) = 1 ; -v1.v(1) = 3 ; -v1.v(2) = 5 ; -v1.v(3) = 7 ; -} v1(0); -Struct { -v1.v(0) = 100 ; -v1.v(1) = 200 ; -} v1(1); diff --git a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_anon_dim.syn.dap b/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_anon_dim.syn.dap deleted file mode 100644 index 82d8047804..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_anon_dim.syn.dap +++ /dev/null @@ -1 +0,0 @@ - [0] -1169720286 [1] -920699049 [2] -2088732436 [3] 1060190036 [4] -1123468835 [5] 922940053 diff --git a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_anon_dim.syn.dmr b/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_anon_dim.syn.dmr deleted file mode 100644 index acfbb02341..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_anon_dim.syn.dmr +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_atomic_array.nc.dap b/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_atomic_array.nc.dap deleted file mode 100644 index 59a60fbd3b..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_atomic_array.nc.dap +++ /dev/null @@ -1,8 +0,0 @@ - [0] 255 [1] 1 [2] 2 [3] 3 [4] 4 [5] 5 - [0] 1 [1] 2 [2] 3 [3] 4 - [0] 5 [1] 4 [2] 3 [3] 2 [4] 1 [5] 0 - [0] 17.9000 [1] 1024.80 - [0] '@' [1] '&' - [0] "hello\tworld" [1] "\r\n" [2] "Καλημέα" [3] "abc" - [0] 0x0123456789ABCDEF [1] 0xABCDEF0000000000 - [0] 0 [1] 2 [2] 0 [3] 1 [4] 127 diff --git a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_atomic_array.syn.dap b/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_atomic_array.syn.dap deleted file mode 100644 index 8bc6508fd1..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_atomic_array.syn.dap +++ /dev/null @@ -1,8 +0,0 @@ - [0] 186 [1] 201 [2] 131 [3] 63 [4] 189 [5] 55 - [0] -341 [1] -21899 [2] -13413 [3] -22144 - [0] 2367803413 [1] 3586730583 [2] 511843988 [3] 3754752863 [4] 2950934681 [5] 2366232135 - [0] 0.217870 [1] 0.602451 - [0] 'C' [1] 'O' - [0] "{S" [1] "gb8^OE$" [2] "4a/q%n9;5Y" [3] "{fIl?T\"\\A[" - [0] 0xA2177AA7287C04FA8BB57BCDF76EC80F [1] 0x34FA472AA9404DD543143CADED303A75 - [0] 2 [1] 9 [2] 6 [3] 8 [4] 3 diff --git a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_atomic_types.nc.dap b/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_atomic_types.nc.dap deleted file mode 100644 index 0b6fb8911a..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_atomic_types.nc.dap +++ /dev/null @@ -1,15 +0,0 @@ - -128 - 255 - -32768 - 65535 - 2147483647 - 4294967295 - 9223372036854775807 - 18446744073709551615 - 3.14159 - 3.14159 - '@' - "hello\tworld" - 0x0123456789ABCDEF - 2 - 127 diff --git a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_atomic_types.syn.dap b/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_atomic_types.syn.dap deleted file mode 100644 index 4fe0dfa020..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_atomic_types.syn.dap +++ /dev/null @@ -1,15 +0,0 @@ - 58 - 201 - 896 - 16177 - -1123468835 - 2125143125 - 3059391736915381031 - 11577488182652895291 - 0.551297 - 0.790267 - '*' - "O,L?c8A%V" - 0x46F169EF23CBAF9B1FEBD99E4E16CEC9 - 7 - 3 diff --git a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_atomic_types.syn.dmr b/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_atomic_types.syn.dmr deleted file mode 100644 index ad57f898be..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_atomic_types.syn.dmr +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_enum.nc.dap b/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_enum.nc.dap deleted file mode 100644 index 671900d5f1..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_enum.nc.dap +++ /dev/null @@ -1 +0,0 @@ - 2 diff --git a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_enum_2.nc.dap b/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_enum_2.nc.dap deleted file mode 100644 index 671900d5f1..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_enum_2.nc.dap +++ /dev/null @@ -1 +0,0 @@ - 2 diff --git a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_enum_array.nc.dap b/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_enum_array.nc.dap deleted file mode 100644 index d13e008917..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_enum_array.nc.dap +++ /dev/null @@ -1 +0,0 @@ - [0] 0 [1] 2 [2] 0 [3] 1 [4] 127 diff --git a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_fill.nc.dap b/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_fill.nc.dap deleted file mode 100644 index 3bf1930073..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_fill.nc.dap +++ /dev/null @@ -1,3 +0,0 @@ - 240 - 32700 - 111000 diff --git a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_groups1.nc.dap b/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_groups1.nc.dap deleted file mode 100644 index 0af89ec492..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_groups1.nc.dap +++ /dev/null @@ -1,4 +0,0 @@ - [0] -876354855 [1] -1761252264 [2] 1723477387 [3] -46827465 [4] 1475147969 - [0] 12.0000 [1] -100.000 [2] 9.96921e+36 - [0] 2 [1] 3 [2] 5 [3] 7 [4] 11 - [0] 23.0000 [1] 29.0000 [2] 19.0000 [3] 31.0000 [4] 17.0000 [5] 37.0000 [6] 13.0000 diff --git a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_one_var.nc.dap b/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_one_var.nc.dap deleted file mode 100644 index d193859153..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_one_var.nc.dap +++ /dev/null @@ -1 +0,0 @@ - 17 diff --git a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_one_vararray.nc.dap b/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_one_vararray.nc.dap deleted file mode 100644 index cef7e62967..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_one_vararray.nc.dap +++ /dev/null @@ -1 +0,0 @@ - 17 37 diff --git a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_one_vararray.nc.dmr b/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_one_vararray.nc.dmr deleted file mode 100644 index 4e2b7d2430..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_one_vararray.nc.dmr +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_opaque.nc.dap b/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_opaque.nc.dap deleted file mode 100644 index 8fc9b352ad..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_opaque.nc.dap +++ /dev/null @@ -1 +0,0 @@ - 0x0123456789ABCDEF diff --git a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_opaque_array.nc.dap b/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_opaque_array.nc.dap deleted file mode 100644 index 41b22527f4..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_opaque_array.nc.dap +++ /dev/null @@ -1 +0,0 @@ - [0] 0x0123456789ABCDEF [1] 0xABCDEF0000000000 [2] 0xFEDCBA9876543210 [3] 0xFEDCBA9999999999 diff --git a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_sequence_1.syn.dap b/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_sequence_1.syn.dap deleted file mode 100644 index c8e824f78e..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_sequence_1.syn.dap +++ /dev/null @@ -1,2 +0,0 @@ -count=1 - -920699049 896 diff --git a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_sequence_1.syn.dmr b/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_sequence_1.syn.dmr deleted file mode 100644 index bf34e35c7d..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_sequence_1.syn.dmr +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_sequence_2.syn.dap b/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_sequence_2.syn.dap deleted file mode 100644 index 3d99a97450..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_sequence_2.syn.dap +++ /dev/null @@ -1,5 +0,0 @@ -count=1 - -920699049 896 -count=4 - -1123468835 -18686 2125143125 -21899 1268468519 -22144 989876086 3361 - diff --git a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_sequence_2.syn.dmr b/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_sequence_2.syn.dmr deleted file mode 100644 index c9d9a09ad3..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_sequence_2.syn.dmr +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_struct_array.syn.dap b/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_struct_array.syn.dap deleted file mode 100644 index 9518dd1bd8..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_struct_array.syn.dap +++ /dev/null @@ -1,15 +0,0 @@ - [0] 0.727653 [1] 0.785633 [2] 0.513679 [3] 0.246845 - [0] 0.738422 [1] 0.214889 [2] 0.494798 - [0] 712320147 1268468519 - [0] 696298400 989876086 - [0] -1927163883 -900795134 - [1] -708236713 1377500019 - [1] 511843988 1699265896 - [1] -540214433 -914532520 - [2] -1344032615 -871416961 - [2] -1928735161 935744880 - [2] -1509955773 -1707460853 - [3] 1145911788 -415231529 - [3] -278269626 -1682978013 - [3] -1629885665 -909240754 - diff --git a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_struct_nested.hdf5.dap b/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_struct_nested.hdf5.dap deleted file mode 100644 index 2e043ab8fe..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_struct_nested.hdf5.dap +++ /dev/null @@ -1 +0,0 @@ - 1 -2 255 90 diff --git a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_struct_nested3.hdf5.dap b/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_struct_nested3.hdf5.dap deleted file mode 100644 index d193859153..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_struct_nested3.hdf5.dap +++ /dev/null @@ -1 +0,0 @@ - 17 diff --git a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_struct_type.nc.dap b/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_struct_type.nc.dap deleted file mode 100644 index 6e0cb49e1d..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_struct_type.nc.dap +++ /dev/null @@ -1 +0,0 @@ - 1 -2 diff --git a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_utf8.nc.dap b/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_utf8.nc.dap deleted file mode 100644 index eb9b6ef983..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_utf8.nc.dap +++ /dev/null @@ -1,3 +0,0 @@ - [0] "Καλημέα" - [1] "abc" - diff --git a/dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_anon_dim.syn.2.dap b/dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_anon_dim.syn.2.dap deleted file mode 100644 index a69de268a4..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_anon_dim.syn.2.dap +++ /dev/null @@ -1 +0,0 @@ - 3125247010 3374268247 2206234860 1060190036 diff --git a/dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_anon_dim.syn.2.dmr b/dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_anon_dim.syn.2.dmr deleted file mode 100644 index 058bb28134..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_anon_dim.syn.2.dmr +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_atomic_array.nc.5.dap b/dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_atomic_array.nc.5.dap deleted file mode 100644 index 7420b43453..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_atomic_array.nc.5.dap +++ /dev/null @@ -1,4 +0,0 @@ - [0] 3 [1] 5 - [0] 1024.80 - [0] "Καλημέα" - [0] 0xABCDEF0000000000 diff --git a/dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_atomic_array.nc.8.dap b/dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_atomic_array.nc.8.dap deleted file mode 100644 index 9c060c2015..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_atomic_array.nc.8.dap +++ /dev/null @@ -1 +0,0 @@ - [0] 1 [1] 2 [2] 4 diff --git a/dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_atomic_array.nc.9.dap b/dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_atomic_array.nc.9.dap deleted file mode 100644 index b7fc1fa5bd..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_atomic_array.nc.9.dap +++ /dev/null @@ -1 +0,0 @@ - [0] 4 [1] 1 [2] 2 diff --git a/dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_enum_array.nc.4.dap b/dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_enum_array.nc.4.dap deleted file mode 100644 index 8277a7de56..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_enum_array.nc.4.dap +++ /dev/null @@ -1 +0,0 @@ - [0] 2 [1] 1 diff --git a/dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_one_vararray.nc.1.dap b/dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_one_vararray.nc.1.dap deleted file mode 100644 index e9082c0001..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_one_vararray.nc.1.dap +++ /dev/null @@ -1 +0,0 @@ - 37 diff --git a/dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_one_vararray.nc.3.dap b/dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_one_vararray.nc.3.dap deleted file mode 100644 index cef7e62967..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_one_vararray.nc.3.dap +++ /dev/null @@ -1 +0,0 @@ - 17 37 diff --git a/dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_opaque_array.nc.7.dap b/dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_opaque_array.nc.7.dap deleted file mode 100644 index 2c0819195e..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_opaque_array.nc.7.dap +++ /dev/null @@ -1 +0,0 @@ - [0] 0xFEDCBA9876543210 [1] 0xFEDCBA9999999999 diff --git a/dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_struct_array.nc.6.dap b/dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_struct_array.nc.6.dap deleted file mode 100644 index af7758ecde..0000000000 --- a/dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_struct_array.nc.6.dap +++ /dev/null @@ -1 +0,0 @@ - 1 -1 17 37 -4 12 -8 8 diff --git a/dap4/d4tests/src/test/data/resources/favicon.ico b/dap4/d4tests/src/test/data/resources/favicon.ico deleted file mode 100644 index d63ed908885f26856b1b35b8365286f9fd89d470..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4286 zcmb7|&x##I6viu=aU$brR2)GC=Q1WL1etK#T?DgmCE~)pS@zNg5W)Kx_AU#NyoGly z?Mjyp2J!-T8HiYZzjNwTRgaSqZ>Usvb@loFoKsbuq;ySxR;$F{>Cvkxy_r(_P)$SW zz8d4t`{kU|m2IBaInV2P9`o*(pYl8nnd_{^b)MAE>bZ~cd9t}0e6ZW?h<|V;#=kjS z*L$aW=eA;~n;lzmD@Ne~cI9MToZI>Nxn9$I&+?aw^`3$p{SOX@bDq}db)BIxu;{_@ z`|u*T#JKx1XL0#K96r+vH~))6@$1aI&eDs=#cQ;iRvU8;hKc|9QF7sacy9E-{oC!H zDE1d>Z)o6!OL**S>~NOHIfEm8oyXyW_2@2KBL8-8euP)_G_Qq8u_nb7{@ZFtY8UJ7 zC5@Tqt+-zT>z-Su+r4*e;#e$kaQp%M@6@QR>zxPt`FHoJdS~1{4w_wOyElJ& zy~aV$#S0FBJrPIG#xdpL8+kB}d9&I4D(o8te@}egiurgJzB{JZyp5Mwz1MwhH0^NE zx{)U4!eJbeaS%56_;3#o)PJmY$KJL0o?Fi|o_k%nk0l41SMx4ywI+%O+}nJu+s!7K z_k;A`8wT@$e!Jb?S8d!8c2Ya*b-TBCP5l=RU>ZN=iJp7IbAEmuT)gJsK;Gdnj)Un3 zyWp?H;eE|{pg@MR;9yuSo_krarC)IzwQ}Yjp z@PPW{n&&poyy8Q-H?P<)m3!v#Zs1dU)L?L6Esm;1pQj$5>zZm94KJ{px7s7?`T|qH zj;$WwIdjlz9OOIK@PGr@+*|y}qiPLJp66a$V7sQs1>Q&NvEdTyeVn}RD{jeu@_>GL zlst%2)LW11^4$+xubNlu&+_eiKYMU^;Pp>j)^+$C`EdPymK1DwT)^)+a82|2ZS}{R z_gZh72RjRV{iA2L{Q_)o9lPxXJ|6Yvn5E{*yO9&H{k)U6iq(4`^+%5f{`^_@Utz|X7knZP&-k3 z7Y=RzYB57ce8-W;C2mKYE6Zr08x!U3z-AJ>c@shz0aZsUKP(}QBwnDq>AzB(`A=^2{w z#`bsoriS%xueh%$jr-&>e$U~Ng#V7(x8X6^G~yeNqRVhJ=I6=s8US9Y`z89=&#A9jjlDt*&HS5>`U=QJ z&-hhM*avDy!oDRAUk47_mOl7?Ug}#R=e6+pcTSDJ04_IqtCXjd|4!-CzfwBcrF4_F qO=+)hn=+sOO=!RVx{Y$R(ZsE{y~nF`gP2d%z!Bc}`LS?!d-)$ZMAm5l diff --git a/dap4/d4tests/src/test/data/resources/testfiles/Makefile b/dap4/d4tests/src/test/data/resources/testfiles/Makefile deleted file mode 100644 index fda8984011..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/Makefile +++ /dev/null @@ -1,75 +0,0 @@ -NC=\ -test_one_var \ -test_one_vararray \ -test_atomic_types \ -test_atomic_array \ -test_enum \ -test_enum_2 \ -test_enum_array \ -test_groups1 \ -test_struct_type \ -test_struct_array \ -test_misc1 \ -test_vlen1 \ -test_vlen2 \ -test_opaque \ -test_opaque_array \ -test_fill \ -test_utf8 - -HDF5=\ -test_struct_nested \ -test_struct_nested3 \ -test_vlen3 \ -test_vlen4 \ -test_vlen5 - -C=tst_fills tst_h5fill - -BUGS= - -all:: all2 all3 - -all1: - for x in ${C} ; do \ - gcc -g -O0 -o $$x.exe $$x.c -L/usr/local/lib -lnetcdf -lcurl -lhdf5 -lhdf5_hl ; \ - ./$$x ; \ - done - -all2: - for x in ${NC} ${HDF5} ; do ncgen -k3 $${x}.cdl ; done - -all3: - for x in ${HDF5} ; do cp $${x}.nc $${x}.hdf5 ; done - -clean:: - rm -f *.nc; rm -f *.hdf5; rm -f *.h5 - for x in ${C} ; do rm -f $$x.exe ; done - rm -fr dump - - -verify: - rm -fr dump - mkdir dump - for x in ${NC} ; do ncdump $${x}.nc > dump/$${x}.cdl ; done - for x in ${HDF5} ; do ncdump $${x}.hdf5 > dump/$${x}.cdl ; done - for x in ${NC} ${HDF5} ; do \ - echo $${x}.cdl ; \ - diff -wBb $${x}.cdl dump/$${x}.cdl ; \ - done - -UI=f:/git/thredds/ui/target/toolsUI-4.4.0-SNAPSHOT.jar -F=test_test - -# note -vall fails -x:: - rm -f ${F}.hdf5 ${F}.nc - ncgen -k3 -o ${F}.nc ${F}.cdl - cp ${F}.nc ${F}.hdf5 - java -cp ${UI} ucar.nc2.NCdumpW ${F}.hdf5 - -# ncdump ${F}.hdf5 - -t:: - ncgen -k3 -o ${F}.nc ${F}.cdl - ncdump ${F}.nc diff --git a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_aaa.nc.dmr b/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_aaa.nc.dmr deleted file mode 100644 index a8d498be14..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_aaa.nc.dmr +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_atomic_array.nc.dmr b/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_atomic_array.nc.dmr deleted file mode 100644 index 9e0dd4e355..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_atomic_array.nc.dmr +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_atomic_types.nc.dmr b/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_atomic_types.nc.dmr deleted file mode 100644 index 88340335c2..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_atomic_types.nc.dmr +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_enum.nc.dmr b/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_enum.nc.dmr deleted file mode 100644 index 7126f07378..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_enum.nc.dmr +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_enum1.nc.dmr b/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_enum1.nc.dmr deleted file mode 100644 index dca662dfc9..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_enum1.nc.dmr +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_enum2.nc.dmr b/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_enum2.nc.dmr deleted file mode 100644 index 6cfd3fa18c..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_enum2.nc.dmr +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_enum_array.nc.dmr b/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_enum_array.nc.dmr deleted file mode 100644 index dd8b966f98..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_enum_array.nc.dmr +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_groups1.nc.dmr b/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_groups1.nc.dmr deleted file mode 100644 index 80f918edc6..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_groups1.nc.dmr +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_numeric_types.nc.dmr b/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_numeric_types.nc.dmr deleted file mode 100644 index 57cb8ca453..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_numeric_types.nc.dmr +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_one_var.nc.dmr b/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_one_var.nc.dmr deleted file mode 100644 index 89016b1816..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_one_var.nc.dmr +++ /dev/null @@ -1,8 +0,0 @@ - - - diff --git a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_one_vararray.nc.dmr b/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_one_vararray.nc.dmr deleted file mode 100644 index 8f199d1cb1..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_one_vararray.nc.dmr +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_opaque_type.nc.dmr b/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_opaque_type.nc.dmr deleted file mode 100644 index 298d5f9c8e..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_opaque_type.nc.dmr +++ /dev/null @@ -1,8 +0,0 @@ - - - diff --git a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_string_type.nc.dmr b/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_string_type.nc.dmr deleted file mode 100644 index 4b7615450f..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_string_type.nc.dmr +++ /dev/null @@ -1,8 +0,0 @@ - - - diff --git a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_struct1.nc.dmr b/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_struct1.nc.dmr deleted file mode 100644 index 9612148ceb..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_struct1.nc.dmr +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_struct_array.nc.dmr b/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_struct_array.nc.dmr deleted file mode 100644 index 8dabe14882..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_struct_array.nc.dmr +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_struct_nested.hdf5.dmr b/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_struct_nested.hdf5.dmr deleted file mode 100644 index 376824981e..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_struct_nested.hdf5.dmr +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_struct_nested.nc.dmr b/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_struct_nested.nc.dmr deleted file mode 100644 index f42d82a6ba..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_struct_nested.nc.dmr +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_struct_type.nc.dmr b/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_struct_type.nc.dmr deleted file mode 100644 index 4e2adb0c1d..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_struct_type.nc.dmr +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_utf8.nc.dmr b/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_utf8.nc.dmr deleted file mode 100644 index 74115be967..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_utf8.nc.dmr +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_vlen1.nc.dmr b/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_vlen1.nc.dmr deleted file mode 100644 index b8086d06d1..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_vlen1.nc.dmr +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_vlen2.nc.dmr b/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_vlen2.nc.dmr deleted file mode 100644 index f5ebdb60b9..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_vlen2.nc.dmr +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_vlen3.hdf5.dmr b/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_vlen3.hdf5.dmr deleted file mode 100644 index 13041f5136..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_vlen3.hdf5.dmr +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_vlen3.nc.dmr b/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_vlen3.nc.dmr deleted file mode 100644 index b8729a4e15..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_vlen3.nc.dmr +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_vlen4.hdf5.dmr b/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_vlen4.hdf5.dmr deleted file mode 100644 index 09398765d6..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_vlen4.hdf5.dmr +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_vlen5.hdf5.dmr b/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_vlen5.hdf5.dmr deleted file mode 100644 index 2cd00c88d1..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/dmr/test_vlen5.hdf5.dmr +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/testfiles/doit b/dap4/d4tests/src/test/data/resources/testfiles/doit deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_anon_dim.syn b/dap4/d4tests/src/test/data/resources/testfiles/test_anon_dim.syn deleted file mode 100644 index 221f7ac725..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_anon_dim.syn +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_atomic_array.cdl b/dap4/d4tests/src/test/data/resources/testfiles/test_atomic_array.cdl deleted file mode 100644 index ea901a8db6..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_atomic_array.cdl +++ /dev/null @@ -1,39 +0,0 @@ -netcdf test_atomic_array { -types: - opaque(8) o_t; - byte enum cloud_class_t {Clear = 0, Cumulonimbus = 1, Stratus = 2, - Stratocumulus = 3, Cumulus = 4, Altostratus = 5, Nimbostratus = 6, - Altocumulus = 7, Cirrostratus = 8, Cirrocumulus = 9, Cirrus = 10, - Missing = 127} ; -dimensions: - d1 = 1; - d2 = 2; - d3 = 3; - d4 = 4; - d5 = 5; -variables: - ubyte vu8(d2,d3); - short v16(d4); - uint vu32(d2,d3); - double vd(d2); - char vc(d2); - string vs(d2,d2); - o_t vo(d1,d2); - cloud_class_t primary_cloud(d5) ; - cloud_class_t primary_cloud:_FillValue = Missing ; - -data: - vu8 = - 255, 1, 2, - 3, 4, 5 ; - v16 = 1, 2, 3, 4 ; - vu32 = - 5, 4, 3, - 2, 1, 0 ; - vd = 17.9, 1024.8 ; - vc = '@', '&' ; - vs = "hello\tworld", "\r\n", "Καλημέα", "abc" ; - vo = - 0X0123456789ABCDEF, 0XABCDEF0000000000 ; - primary_cloud = Clear, Stratus, Clear, Cumulonimbus, _ ; -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_atomic_array.nc b/dap4/d4tests/src/test/data/resources/testfiles/test_atomic_array.nc deleted file mode 100644 index 26cb578f8afe06fdcc560c4e6413ecfefb3ba07e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 14523 zcmeHOeQX@X6@PoXc5KH^oDzS8R^%`w4U`z{*si4(;^gd$BRjV1vryF{*=OGwU%A{l z_tg)jO4UDFpsf;BrD{(oS;wcHX?5o%y{t@6FDPAL#B3R#jYIL6XYK$f0U=i_5G@&$Vj~@+cp{ z%>uN)yK~T2dC}LP%I(cY?5kD!X7eUZTMe!7ktLj(k8w+gY>V*1Vp@5h$XT?B%J|=K zUtl1WoQ$S2v1pq4*YPi)%K5@67fq#O$;6#aM-$P^SY$jN8wIPSv8AzjcO;sN#*>qW zqlwJXiO6_soBiR^37gwh!uK`&E6aPz;#Ny1UobqI zrj=ZMrSylWnuQez{8S(w4X2nF$R5tdlZn{j(X4cjLYY)J!?%hi$D~vhC^^2{7tbWq zMn>fO_{n^Rl+QiI^~X}F{Bo7g6Og>T;7}}`jwSBp2KsELq;x}BdBriQe|3^FmMXF= z1)*hW6!aCCuu*Ikc(&ZQU6}}xpX$n}PMT3tCM7CB& zk+Z0jHNZOP-4_aRUTjJRhpL=u=fOi=eW8Q>eZ!%^zTPgXRwL)nHWzV9XkxfWckAqn zhD$IK9u%Cz6@DqFgu?3y;R5jeevi`g)uHr}Hb$$8V7Yx>Chq@IZ0pYofRl zGFCYiDsF$H=I#Vsiz=?}+~t1-L!mDEyzyt&Lqzw&Z_V^b=zQP& zdNUSGE?wb(V}GU+^yaLI-nuvFw-oAa>#dsmiYB!9fD2C!3_);Z^jhg{4}Ip+fmi0& z8yp!0MOgoI7%wlNEhnuu}^63(i~;`>#rF-uS{!1*Gg|KboKt>9rNqWI36_# zkbbOGZ(9urYpb_uJy$I9lM}b=moH6k+eYsXs)fOl_;NT|ZoE>VPg6nFx=Fs70Ik zP4#(`lHP+M_G#O=Oj;n5SBayTRH3b)(ukL2rpihDM}8i0fatNH|36A(s z7N~)aTdW&cO(hl5CV@^k*4La;l~?xwuf>2@JYiS_yaDOSa={aDB;`|prv~#4x_q%~ z;Ke(C9USZ)APHYSr6VJb`6^ExRKi@swKwR@l;fMqWEUiit^1^Ixu1K`cn2OhapAS6 z_78P;vL9l(jm(bhnlkg4&1_ye9T~lPT1l0PlyF%}ER55f)Xh^TXM-WGi_nXFthBVg zIy69EB0p!e#Gvtp*Bc?wtEXFE-9OYDq>_dU4cqA*F0P>)n(Oz{jr?E@O}u_?l77M5 zTDthHo(%Oc*H3RWeDq1GR08%>f#>NW3)E4h?VD%RXIU-1{KgN?&=cz~C9=YqvKj{yATT8JQ%CC^PFhBk5hc{iJtP<$C`|ZT@Q3thbq?TD86(!YDtzh8VH9dO3QOM+TfW?r(!npdSV6p14RSh|JpfM1fhHnr2 zXo*-T9bd;C5IhT~Vl+1uBlI|8dJHU=p#4?vvFhy2s-sJ|y!q{ui35TDUgZ*vqSSrf zv*-wfqv9TW_$isC){%PYa;X}cPJe(=`s2_Py$iuxB^P&D?J{)c_ zAD*|E4;Ng_hc5>II|eY!f51mO4a_b+kl$i3hkU|xsMheIhbq${tS;mIGY`+4nt5*K znVHiwQ!}UL)-Mpy!lPrVCYj(%LjNbC@p!WQi^)_xq6^IR-{^1w*UNYacnEk1cnEk1 zcnEk1cnEk1cnEk1cnGXl1l+ZdUDAW%H8Om47E`@Ww2il=jt0zEf>o4pvx?He(vseP6-A$;xpb?RPiR79^2oj)ZN29&PtK18Rz!e7ao$$z zM6$Rn-|qi+rijID>nF=!4I7abFL$R2Z3LCJ0)J=;d9^|TRmjWS^!!kNi^gKRukdUY zR&hY>Y0>t2J&9Jhrgv;^P4Aetsqx!1Bsqf&Y|*#y!IZZ|)Z*2ZY2I8N4#wi~yTkEp zR9CQGal$4rEFYB5&^`32^Sx?s{da8U%3L$t@xiWO*I-v)plev~D%Y|-ils%unQ%Iq z(P%7k#qP6vw9Lq2acrSS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_atomic_types.cdl b/dap4/d4tests/src/test/data/resources/testfiles/test_atomic_types.cdl deleted file mode 100644 index d43301a201..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_atomic_types.cdl +++ /dev/null @@ -1,42 +0,0 @@ -netcdf test_atomic_types { -types: - opaque(8) o_t; - byte enum cloud_class_t {Clear = 0, Cumulonimbus = 1, Stratus = 2, - Stratocumulus = 3, Cumulus = 4, Altostratus = 5, Nimbostratus = 6, - Altocumulus = 7, Cirrostratus = 8, Cirrocumulus = 9, Cirrus = 10, - Missing = 127} ; -variables: - byte v8; - ubyte vu8; - short v16; - ushort vu16; - int v32; - uint vu32; - int64 v64; - uint64 vu64; - float vf; - double vd; - char vc; - string vs; - o_t vo; - cloud_class_t primary_cloud; - cloud_class_t primary_cloud:_FillValue = Missing ; - cloud_class_t secondary_cloud; - cloud_class_t secondary_cloud:_FillValue = Missing ; -data: - v8 = -128; - vu8 = 255; - v16 = -32768; - vu16 = 65535; - v32 = 2147483647; - vu32 = 4294967295; - v64 = 9223372036854775807; - vu64 = 18446744073709551615; - vf = 3.1415926535897932384626433832795; - vd = 3.141592653589793238462643383279502884197169399375105820974944592; - vc = '@'; - vs = "hello\tworld"; - vo = 0x0123456789abcdef; - primary_cloud = Stratus; - secondary_cloud = _; -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_atomic_types.ncdump b/dap4/d4tests/src/test/data/resources/testfiles/test_atomic_types.ncdump deleted file mode 100644 index dd4d209c48..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_atomic_types.ncdump +++ /dev/null @@ -1,57 +0,0 @@ -netcdf test_atomic_types { -types: - opaque(8) o_t ; - byte enum cloud_class_t {Clear = 0, Cumulonimbus = 1, Stratus = 2, - Stratocumulus = 3, Cumulus = 4, Altostratus = 5, Nimbostratus = 6, - Altocumulus = 7, Cirrostratus = 8, Cirrocumulus = 9, Cirrus = 10, - Missing = 127} ; -variables: - byte v8 ; - ubyte vu8 ; - short v16 ; - ushort vu16 ; - int v32 ; - uint vu32 ; - int64 v64 ; - uint64 vu64 ; - float vf ; - double vd ; - char vc ; - string vs ; - o_t vo ; - cloud_class_t primary_cloud ; - cloud_class_t primary_cloud:_FillValue = Missing ; - cloud_class_t secondary_cloud ; - cloud_class_t secondary_cloud:_FillValue = Missing ; -data: - - v8 = -128 ; - - vu8 = 255 ; - - v16 = -32768 ; - - vu16 = _ ; - - v32 = 2147483647 ; - - vu32 = _ ; - - v64 = 9223372036854775807 ; - - vu64 = 18446744073709551615 ; - - vf = 3.141593 ; - - vd = 3.14159265358979 ; - - vc = "@" ; - - vs = "hello\tworld" ; - - vo = 0X0123456789ABCDEF ; - - primary_cloud = Stratus ; - - secondary_cloud = _ ; -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_atomic_types.syn b/dap4/d4tests/src/test/data/resources/testfiles/test_atomic_types.syn deleted file mode 100644 index d6f19ef663..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_atomic_types.syn +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_enum.cdl b/dap4/d4tests/src/test/data/resources/testfiles/test_enum.cdl deleted file mode 100644 index 6cd1ceb34b..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_enum.cdl +++ /dev/null @@ -1,12 +0,0 @@ -netcdf test_enum { -types: - byte enum cloud_class_t {Clear = 0, Cumulonimbus = 1, Stratus = 2, - Stratocumulus = 3, Cumulus = 4, Altostratus = 5, Nimbostratus = 6, - Altocumulus = 7, Cirrostratus = 8, Cirrocumulus = 9, Cirrus = 10, - Missing = 127} ; -variables: - cloud_class_t primary_cloud; - cloud_class_t primary_cloud:_FillValue = Missing ; -data: - primary_cloud = Stratus; -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_enum.nc b/dap4/d4tests/src/test/data/resources/testfiles/test_enum.nc deleted file mode 100644 index 39a1db3688e7f306da4ca9ba5f6c4a3e31b8f9ab..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1239 zcmdT@y-OTH6n`^&cUdoY;YbLGv5;Wv!ih?n6k$a!h#w@x_FQjA9Wu9j%wB{^cnD(cTXx^q@6Eig{nc4qYSt&}K;-*SftC^7=ho6i zrL;KR`8S>L2w&?ge&LOO{Jrse+``;34|$yfBS_0+@y#pY>oy8%P5@|pCz-)3@bT%c zhU+>V2%Srjq5TcMq4DDfX;0`(rpd?lej@T-yshMxGtC8a!R$;d_Jm3YeUaq*yYcq? z2%sH&2-*uarFXW1pgfl{AUZzvP8rIiosa>^gCnRSA8(YXmhaF$gi1sjePPirRGP^C zRzYdQ*IY+AiiW2>@*0Q1q4Y`RX=X8mU&Y8#1NrZx@O-KDsNd)#0MhA#6`5r+*}(+4 zSE<%s_+$0qTG&~xP0=mP4j-V|Q)v-*dn(GZZoXU=4_DX!56qyOz!+BP>ck!#QA?g{ z2dZO~J?ETJp~Fg*R3n!A`N!^On{1ZOt}bKh+}la~m#_g09`3l)U2k1*bD(8E(m$}f z*yGQ3(SA=Z{G{{z*L1VT&h0E*)YJDgZYVVdFL58op}QoN+K5yk%7mZmY?ztJ{ieBo K4F4Vm)BFy!MK~h> diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_enum.ncdump b/dap4/d4tests/src/test/data/resources/testfiles/test_enum.ncdump deleted file mode 100644 index 7a7ca86e1b..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_enum.ncdump +++ /dev/null @@ -1,13 +0,0 @@ -netcdf test_enum { -types: - byte enum cloud_class_t {Clear = 0, Cumulonimbus = 1, Stratus = 2, - Stratocumulus = 3, Cumulus = 4, Altostratus = 5, Nimbostratus = 6, - Altocumulus = 7, Cirrostratus = 8, Cirrocumulus = 9, Cirrus = 10, - Missing = 127} ; -variables: - cloud_class_t primary_cloud ; - cloud_class_t primary_cloud:_FillValue = Missing ; -data: - - primary_cloud = Stratus ; -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_enum1.cdl b/dap4/d4tests/src/test/data/resources/testfiles/test_enum1.cdl deleted file mode 100644 index da9c770a8b..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_enum1.cdl +++ /dev/null @@ -1,12 +0,0 @@ -netcdf test_enum1 { -types: - byte enum cloud_class_t {Clear = 0, Cumulonimbus = 1, Stratus = 2, - Stratocumulus = 3, Cumulus = 4, Altostratus = 5, Nimbostratus = 6, - Altocumulus = 7, Cirrostratus = 8, Cirrocumulus = 9, Cirrus = 10, - Missing = 127} ; -variables: - cloud_class_t primary_cloud; - cloud_class_t primary_cloud:_FillValue = Missing ; -data: - primary_cloud = Stratus; -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_enum1.nc b/dap4/d4tests/src/test/data/resources/testfiles/test_enum1.nc deleted file mode 100644 index 39a1db3688e7f306da4ca9ba5f6c4a3e31b8f9ab..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1239 zcmdT@y-OTH6n`^&cUdoY;YbLGv5;Wv!ih?n6k$a!h#w@x_FQjA9Wu9j%wB{^cnD(cTXx^q@6Eig{nc4qYSt&}K;-*SftC^7=ho6i zrL;KR`8S>L2w&?ge&LOO{Jrse+``;34|$yfBS_0+@y#pY>oy8%P5@|pCz-)3@bT%c zhU+>V2%Srjq5TcMq4DDfX;0`(rpd?lej@T-yshMxGtC8a!R$;d_Jm3YeUaq*yYcq? z2%sH&2-*uarFXW1pgfl{AUZzvP8rIiosa>^gCnRSA8(YXmhaF$gi1sjePPirRGP^C zRzYdQ*IY+AiiW2>@*0Q1q4Y`RX=X8mU&Y8#1NrZx@O-KDsNd)#0MhA#6`5r+*}(+4 zSE<%s_+$0qTG&~xP0=mP4j-V|Q)v-*dn(GZZoXU=4_DX!56qyOz!+BP>ck!#QA?g{ z2dZO~J?ETJp~Fg*R3n!A`N!^On{1ZOt}bKh+}la~m#_g09`3l)U2k1*bD(8E(m$}f z*yGQ3(SA=Z{G{{z*L1VT&h0E*)YJDgZYVVdFL58op}QoN+K5yk%7mZmY?ztJ{ieBo K4F4Vm)BFy!MK~h> diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_enum1.ncdump b/dap4/d4tests/src/test/data/resources/testfiles/test_enum1.ncdump deleted file mode 100644 index 7aea061a3b..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_enum1.ncdump +++ /dev/null @@ -1,13 +0,0 @@ -netcdf test_enum1 { -types: - byte enum cloud_class_t {Clear = 0, Cumulonimbus = 1, Stratus = 2, - Stratocumulus = 3, Cumulus = 4, Altostratus = 5, Nimbostratus = 6, - Altocumulus = 7, Cirrostratus = 8, Cirrocumulus = 9, Cirrus = 10, - Missing = 127} ; -variables: - cloud_class_t primary_cloud ; - cloud_class_t primary_cloud:_FillValue = Missing ; -data: - - primary_cloud = Stratus ; -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_enum_2.cdl b/dap4/d4tests/src/test/data/resources/testfiles/test_enum_2.cdl deleted file mode 100644 index ef6ab50d1d..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_enum_2.cdl +++ /dev/null @@ -1,15 +0,0 @@ -// Test cross group enum references -netcdf test_enum_2 { - types: - byte enum cloud_class_t {Clear = 0, Cumulonimbus = 1, Stratus = 2, - Stratocumulus = 3, Cumulus = 4, Altostratus = 5, Nimbostratus = 6, - Altocumulus = 7, Cirrostratus = 8, Cirrocumulus = 9, Cirrus = 10, - Missing = 127} ; - group: h { - variables: - /cloud_class_t primary_cloud; - /cloud_class_t primary_cloud:_FillValue = Missing ; - data: - primary_cloud = Stratus; - } -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_enum_2.ncdump b/dap4/d4tests/src/test/data/resources/testfiles/test_enum_2.ncdump deleted file mode 100644 index b651551733..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_enum_2.ncdump +++ /dev/null @@ -1,16 +0,0 @@ -netcdf test_enum_2 { -types: - byte enum cloud_class_t {Clear = 0, Cumulonimbus = 1, Stratus = 2, - Stratocumulus = 3, Cumulus = 4, Altostratus = 5, Nimbostratus = 6, - Altocumulus = 7, Cirrostratus = 8, Cirrocumulus = 9, Cirrus = 10, - Missing = 127} ; - -group: h { - variables: - cloud_class_t primary_cloud ; - cloud_class_t primary_cloud:_FillValue = Missing ; - data: - - primary_cloud = Stratus ; - } // group h -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_enum_array.cdl b/dap4/d4tests/src/test/data/resources/testfiles/test_enum_array.cdl deleted file mode 100644 index d395990b64..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_enum_array.cdl +++ /dev/null @@ -1,14 +0,0 @@ -netcdf test_enum_array { -types: - byte enum cloud_class_t {Clear = 0, Cumulonimbus = 1, Stratus = 2, - Stratocumulus = 3, Cumulus = 4, Altostratus = 5, Nimbostratus = 6, - Altocumulus = 7, Cirrostratus = 8, Cirrocumulus = 9, Cirrus = 10, - Missing = 127} ; -dimensions: - d5 = 5; -variables: - cloud_class_t primary_cloud(d5); - cloud_class_t primary_cloud:_FillValue = Missing ; -data: - primary_cloud = Clear, Stratus, Clear, Cumulonimbus, _ ; -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_enum_array.ncdump b/dap4/d4tests/src/test/data/resources/testfiles/test_enum_array.ncdump deleted file mode 100644 index 1c5944620a..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_enum_array.ncdump +++ /dev/null @@ -1,15 +0,0 @@ -netcdf test_enum_array { -types: - byte enum cloud_class_t {Clear = 0, Cumulonimbus = 1, Stratus = 2, - Stratocumulus = 3, Cumulus = 4, Altostratus = 5, Nimbostratus = 6, - Altocumulus = 7, Cirrostratus = 8, Cirrocumulus = 9, Cirrus = 10, - Missing = 127} ; -dimensions: - d5 = 5 ; -variables: - cloud_class_t primary_cloud(d5) ; - cloud_class_t primary_cloud:_FillValue = Missing ; -data: - - primary_cloud = Clear, Stratus, Clear, Cumulonimbus, _ ; -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_fill.cdl b/dap4/d4tests/src/test/data/resources/testfiles/test_fill.cdl deleted file mode 100644 index 7d2af998fc..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_fill.cdl +++ /dev/null @@ -1,11 +0,0 @@ -netcdf test_fill { -variables: - ubyte uv8; - short v16; - uint uv32; - uv32:_FillValue=17; -data: - uv8 = 240; - v16 = 32700; - uv32 = 111000; -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_fill.nc b/dap4/d4tests/src/test/data/resources/testfiles/test_fill.nc deleted file mode 100644 index 35e817fd5ae422791456a0d62ee34e54b4e34d03..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1271 zcmdT@PfG$(5TCcZ%4Ql?R1zH|p<9Ax<|QZ;5rm8mbqTC=BWY9d&z^+3_6<4)LD(sx zYsWr8U!b6KV0eg5_U64eP(l*j9NGEvn|ZTue$Jj}QfZ%O)&nS}2?qFuORA^j!;lEY zl;0!g7n{qZwlwdHHZStJuF9xQzx8Oquw-hE-vmHs&|g8Z_ZaIKjDg92`Hkdetx~mW zjgnR8_#}UlBF_~U$Ewv!mGWw&Rkj+1;-OtSASf1&g`a3&4Mo>tboMEsxwa@lIE;v7$7{m`Q4{?DAJ2TuO7Cy1@uGo-gct(s*0$KBo27&3$YZQY5)chs=W%loH+T=J8$X%Jju({Qg48OMx?Y*IvgcGWGE z`OCMK;>~!gQSd?l^68RoZ|~bp3sJe-vR6>VOzgE>X#{94yb;7v{ZE1^=pvWI7j@B_ hP9m#b;+{d28MG@#(^-mMsc&{S5PI%BoL<~9_yU*SrTqW^ diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_fill.ncdump b/dap4/d4tests/src/test/data/resources/testfiles/test_fill.ncdump deleted file mode 100644 index 5ca0494ef7..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_fill.ncdump +++ /dev/null @@ -1,14 +0,0 @@ -netcdf test_fill { -variables: - ubyte uv8 ; - short v16 ; - uint uv32 ; - uv32:_FillValue = 17U ; -data: - - uv8 = 240 ; - - v16 = 32700 ; - - uv32 = 111000 ; -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_groups1.cdl b/dap4/d4tests/src/test/data/resources/testfiles/test_groups1.cdl deleted file mode 100644 index bde2677083..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_groups1.cdl +++ /dev/null @@ -1,35 +0,0 @@ -netcdf test_groups1 { -dimensions: - dim1 = 5 ; - -group: g { - dimensions: - dim2 = 3 ; - - group: h { - dimensions: - dim3 = 7 ; - variables: - int v1(dim1); - float v2(dim2); - data: - - v1 = -876354855, -1761252264, 1723477387, -46827465, 1475147969; - - v2 = 12, -100, _ ; - } // group h - - group: i { - dimensions: - dim3 = 7 ; - variables: - int v1(dim1); - float v3(dim3); - data: - - v1 = 2, 3, 5, 7, 11 ; - - v3 = 23, 29, 19, 31, 17, 37, 13 ; - } // group i -} // group g -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_groups1.nc b/dap4/d4tests/src/test/data/resources/testfiles/test_groups1.nc deleted file mode 100644 index b4fe34704f05f75be200f4349af89875af9af649..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8469 zcmeHMO-xi*6h8O8ndyjwVugZA;6Yc7Vd8*@8zbW|2oVRu5V4B}2ItY476-#jCtZ-# zRnzK5<4;Yhaixh1S1vThg+H+|>B^0Xo2D@_617cZYl4fWo^$U#!|*br1cBD(UAXVO z`}^+s?m6d9zWaSoS9fK_#tNY1_k#zjvX=V9MK5 z+4N*)M`$`@=ME&tC(>hFwKcdk*xHh`^Y+B#p@ViNH=Rn3w-{W;bAyE$@Ib2 zyLxHxshVh+o|jht-nm#+^|E!HJ zHA)W!u%Oltwcp?fub)~B!;l00AJQzQV7r%Qjy3Gsp7O4}g+>bSN!O0_h2wE7lS`8e z%E?i7_3n+v;=TQ`k$5EB7uEhbte2U=9+Z^Vu4`1K2TA})4Y}Zyvq!EB_eXm6u>Wzp z_^!M#w6fl@aU6gOa)BGCAp3J8E)vr( zN))!uT;gq836$DUht$>Mo0Wk(ar!`O$a1j;u06Pbl<^)S)d8bVUtC;ZAPA5VS7D4+ zhHrsa)=&VT8f-l5ks*Og7!t736n8BJxiciZ;j|y15dzj?2&gM^{l4D#5Wog(qtHOd z3mq98y4c5xWsCZ$Lkj`WHcqdlQuEBs^QEyU_>>-|ZN@4Q6z5?A@W=EVCRAcf9$IRu zfS!@V94;>k{^&*PI7Z-j!w>#3`CvhXNF)^M%axe1CnHR@B2 z&njGk=!tyZ!P862aVjqOiKfs04_t5uV%6Ze(OjC><4X>f=At>y$ClcZf0N^seA`<% z&h8xzniqFo{4gKR^4&SkR~i#1Q@)ZMr{o&TaGZZNA3ZB?ZtfvV{hy5j%&xNJTT*3j z0DP6mfh*RXvC^BK&un7_kZy$fI<{2HE!w`%|Z diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_groups1.ncdump b/dap4/d4tests/src/test/data/resources/testfiles/test_groups1.ncdump deleted file mode 100644 index d351478dbe..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_groups1.ncdump +++ /dev/null @@ -1,35 +0,0 @@ -netcdf test_groups1 { -dimensions: - dim1 = 5 ; - -group: g { - dimensions: - dim2 = 3 ; - - group: h { - dimensions: - dim3 = 7 ; - variables: - int v1(dim1) ; - float v2(dim2) ; - data: - - v1 = -876354855, -1761252264, 1723477387, -46827465, 1475147969 ; - - v2 = 12, -100, _ ; - } // group h - - group: i { - dimensions: - dim3 = 7 ; - variables: - int v1(dim1) ; - float v3(dim3) ; - data: - - v1 = 2, 3, 5, 7, 11 ; - - v3 = 23, 29, 19, 31, 17, 37, 13 ; - } // group i - } // group g -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_misc1.nc b/dap4/d4tests/src/test/data/resources/testfiles/test_misc1.nc deleted file mode 100644 index 36fbab844d79b152c6fbdb66d2601061cc96bbd4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 22465 zcmeHNU1%It6uvXFn=WzkXWFJ(p_8V@wl-_hMvY)?;_l|Brb(I~@}h1h*@+q4%&s$& z7$i^;(Ta-rA}vDE2gN6!M5G8B9~9Jz??!zQ#0RzLgZLozoO|c&rpYeSS|};!Bs*vB zz32X%@0@#Q_Uw6SFx_8QdwZ=wN+d)~G|F4LT#jgUTGddQ+E39<6+Swc9@pzGSo&Tm zVAMo%G|om|s|yW98s#z$t6ri%>LsW`8Xr2ZJy% z0*nA7zz8q`i~u9R2rvSS03*N%FanGKBftnS0*nA7zz8q`i~u9R2rvSS03*N%FanIg z4Mo80##{gm5(qF`AaujL1M9&of$hL4OTbyS7m9hunk)F$(*^&@V7^dnpGv-_vKWM> z?Ls9qP03R-0&!zI4%B4rfh-CnOSB|J%W1fao7kf3x~5t#t;7;oLnW2%upDJOyefMO zvEvRYV8q47ED0)`ohV9LrH1<^CZOC5A54FM2_&V5PGm+VhDJxS6RE!8j4=0Mn`dNeio2(3)7x-z9v6U>CvE3b4}KJ?rej-q55 zj;i_}qGq%dCV|uoQ|5KZbdBz`yWr+PqA@|JSyG->iv_bo2m^X58!vipNSPpY&`Ody z=Lz3&f~;5Y!+9aH`9IE9HZOvKMEw7n_hbadD{9yqZQg>n$-LP!y?tfF{BoySXkWBm z#cFmU*J1>xkuP}hHr4h_^6#l~|6i|*VR0VwP&LDvxE3|JAj3L#0G@mLg^w>*wreC_ za$U0PF>p7eUeSGv=)P=F64JqT)#DAtL`-gGC5u((2NJku_i1109`R@PD!AowchnachN>S)RkX zq07lO84_!8|C1qOC9fe<6Th~jSRH}&`(X;8_Y{kg-@bZC6+e$^g|rYAHt@QaKe@kb zq0bJe=3`e#)u^Xe3_M#>e9_Ch3!g^r{ruja^EiTes+w>0LNBt(&H|fi)SlDlCaok{})2 zWFmS_Q@sNJ&AU~vvx?EP8azVDZG2WIcB7!7$7oob9EV16{E)90ReeQGtQ`blpi#wy z*`|Qs{P;q(NyYgwTh1aowVh0Vfi|N&x^gp>|ZkJABVS1F6wri3Y+2M93g&Nc7O4 zCkfS)L(<$-Px1s2)ze!A;Y0N_4sB#IX2b^3STm~EHjyWU12rvSS03*N% zFanGKBftnS0*nA7zz9@B0OJzzM*P~3VN?2+jd5`EBaFphge8Os%Xp?gGoBeqWwI*5 zvJ(OV7&6G&p&d97qW=$~NK7fR7|EAstUSP`pNOI$6vZisQyhjy`QXL(e?;99w_=T< zQQSyIvY=*bYDd~W*7a0i07Jd!w?G@tE3V#>_ i_5t<*_5t<*_5t<*_5t<*_5t<*_5t<*_JNzv2mS?u6iSf* diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_one_var.cdl b/dap4/d4tests/src/test/data/resources/testfiles/test_one_var.cdl deleted file mode 100644 index f5edd1268f..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_one_var.cdl +++ /dev/null @@ -1,6 +0,0 @@ -netcdf test_one_var { -variables: - int t; -data: - t = 17; -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_one_var.nc b/dap4/d4tests/src/test/data/resources/testfiles/test_one_var.nc deleted file mode 100644 index 4169d2d2966eebf8a0d68513a1bcbdc2fa6a0a0d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 603 zcmeD5aB<`1lHy_j0S*oZ76t(@6Gr@pf@mg)2#gPtPk=FS(Ec7SK}XkTOBfh{>d{re_&nJlqZk?Z7&w41-p@IpD8C@Js3bGB7$`0b#Li%O zAOQqrsYS(^`FXa6HF>Ee$th_$nMp7q6Fn0>Bi)qLvecaXg51=+lA4T^G*cu6hI$ry zhGqGnsxtJIjK`KRMfG%NRU}nUrk|!Iaj*)?nfddHR{hR}e@(WUnN-|T6f#SkI>uO#SC;8E08S;#2ipD5CskrUIs=+upmS~ z(5oCEqhM-T!8|4=Ca^Sz5J--haX-{@xM@3(j2&`JwuxN#{GC0#*~CCjX9UGJ7%=C@ hmv}>i1ttgOGBB6r8x})3HTPK97?oYqJ6E554**2IbWQ*O diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_opaque.ncdump b/dap4/d4tests/src/test/data/resources/testfiles/test_opaque.ncdump deleted file mode 100644 index 97de1aedbf..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_opaque.ncdump +++ /dev/null @@ -1,9 +0,0 @@ -netcdf test_opaque { -types: - opaque(8) o_t ; -variables: - o_t vo1 ; -data: - - vo1 = 0X0123456789ABCDEF ; -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_opaque_array.cdl b/dap4/d4tests/src/test/data/resources/testfiles/test_opaque_array.cdl deleted file mode 100644 index bd33119964..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_opaque_array.cdl +++ /dev/null @@ -1,12 +0,0 @@ -netcdf test_opaque_array { -types: - opaque(8) o_t; -dimensions: - d2 = 2; -variables: - o_t vo2(d2,d2); -data: - vo2 = - 0X0123456789ABCDEF, 0XABCDEF0000000000, - 0XFEDCBA9876543210, 0XFEDCBA9999999999; -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_opaque_array.ncdump b/dap4/d4tests/src/test/data/resources/testfiles/test_opaque_array.ncdump deleted file mode 100644 index 4a7e2f1825..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_opaque_array.ncdump +++ /dev/null @@ -1,13 +0,0 @@ -netcdf test_opaque_array { -types: - opaque(8) o_t ; -dimensions: - d2 = 2 ; -variables: - o_t vo2(d2, d2) ; -data: - - vo2 = - 0X0123456789ABCDEF, 0XABCDEF0000000000, - 0XFEDCBA9876543210, 0XFEDCBA9999999999 ; -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_sequence_1.syn b/dap4/d4tests/src/test/data/resources/testfiles/test_sequence_1.syn deleted file mode 100644 index 355f652977..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_sequence_1.syn +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_sequence_2.syn b/dap4/d4tests/src/test/data/resources/testfiles/test_sequence_2.syn deleted file mode 100644 index 4aa6576faf..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_sequence_2.syn +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_struct1.cdl b/dap4/d4tests/src/test/data/resources/testfiles/test_struct1.cdl deleted file mode 100644 index 005f897c52..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_struct1.cdl +++ /dev/null @@ -1,11 +0,0 @@ -netcdf test_struct_type { - types: - compound c_t { - int x ; - int y ; - }; // c_t -variables: - c_t s; -data: - s = {1,-2}; -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_struct1.nc b/dap4/d4tests/src/test/data/resources/testfiles/test_struct1.nc deleted file mode 100644 index 2a988dc2fec9bb1390d3c8d9628de04edf075119..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 805 zcmeD5aB<`1lHy_j0S*oZ76t(@6Gr@p0##;+2#gPtPk=FS(Ec7SK}kP=ZDpi3ASm>C(+RlxW>*&ua{415e6Kp5}m98i>BkXlrdnOY1K7Y1Ty zuso0eg0j@2;>`R!Tf>^X)RN?sw4BT&n2?E{iJp;eN@`hZPJTgdYF+O#z5WZ?~{=fNW)AVgdyW1BVcZ$IK`T zO-x`1f+PY!1hs+3Gs&C&&K}-uVjz%4J|I21X+oc(woP K05Sgo6C42TEP5#b diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_struct1.ncdump b/dap4/d4tests/src/test/data/resources/testfiles/test_struct1.ncdump deleted file mode 100644 index 1b2c36e6f7..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_struct1.ncdump +++ /dev/null @@ -1,12 +0,0 @@ -netcdf test_struct1 { -types: - compound c_t { - int x ; - int y ; - }; // c_t -variables: - c_t s ; -data: - - s = {1, -2} ; -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_struct_array.cdl b/dap4/d4tests/src/test/data/resources/testfiles/test_struct_array.cdl deleted file mode 100644 index bc5f723006..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_struct_array.cdl +++ /dev/null @@ -1,18 +0,0 @@ -netcdf test_struct_array { -types: - compound c_t { - int x ; - int y ; - }; // c_t -dimensions: - dx = 4; - dy = 3; -variables: - c_t s(dx,dy); -data: - s = -/*[0][0..2]*/ {1, -1}, {17, 37}, {-32767, 32767}, -/*[1][0..2]*/ {-1, 3}, {-2, 2}, {-3, 1}, -/*[2][0..2]*/ {-4, 12}, {-8, 8}, {-12, 4}, -/*[3][0..2]*/ {-5, 15}, {-10, 10}, {-15, 5} ; -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_struct_array.nc b/dap4/d4tests/src/test/data/resources/testfiles/test_struct_array.nc deleted file mode 100644 index 00be0b7551cc187c64813c264eff0fd585da322c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6534 zcmeHM&1+LZ5Z`?-jiIErwV!^VQCsn1u(gVZepp`8rZi1r(}M>gAI+-`)+8j)(n6tv zSQP42yogu-0YSWq`Ui+T33?VUiilwSnAzQlufd22wg@}Pd$T(`yF2@v*$GT;MM7gu zjr$rIlF!FHtVJ~G^voM z1P6lsCvx_py-+M&u?x=1d~WWvOQA1#HrRKDwFqEd8*;%B$cfu5(ORk3NvKCO5I0e|U(jwgIO>)l>kT)^TyHT5SX(6pZ+-yf|A?LLWVYYe=gY3r$RgW66nl zES0oIqhST}K@(Jf3X&;l+b-FCrld@qkUF(|DKRn|w<43?P8{KMaAwY?oJqC4bn0C- zHtb&F-eCVLobFGfu^e29ffgH`3ZoVt;~YG6jG6g-B>>+{00PVkjRkUfh$W159V6RdetBS z84{Y2Mg<_W!QDsQi~Elbir{$!8Bpxzz;4swvG8;_W`$F7H*^~AmdiMqitRw__e54z zbAnP=hSZ(x&g!T{r&3@F>rqY^VjF2{{lj6|+VS_e6^{yY5icMzosLd{L5?ChU1 - - - - - - - - - - - - - - - - - - - diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_struct_nested.cdl b/dap4/d4tests/src/test/data/resources/testfiles/test_struct_nested.cdl deleted file mode 100644 index 399d8954ef..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_struct_nested.cdl +++ /dev/null @@ -1,15 +0,0 @@ -netcdf test_struct_nested { - types: - compound s1_t { - int x ; - int y ; - }; // s1_t - compound s2_t { - s1_t field1 ; - s1_t field2 ; - }; // s2_t -variables: - s2_t x; -data: - x = {{1,-2}, {255, 90}}; -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_struct_nested.hdf5 b/dap4/d4tests/src/test/data/resources/testfiles/test_struct_nested.hdf5 deleted file mode 100644 index f49856fa34ac8f533cb526c5dbf6860dd63e4786..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 723 zcmeD5aB<`1lHy|G;9!7(|4?w52_j+ul{ox%PnN%jOAr&!7A7UI7&9|e3Z?~}=3-)C z1Sw$?2a${{AQA*viVfpS-b2`MNw7+=q)~i{36#es0#e1u0(A=mW5sruIxVPvBB@y2 z%n-2i6&6c3gd<}uW;F&@GoTHiFsNW)5CGB;rz$X1GO!?Xtyzkdup5%WoB}aK0BA^B zW@=7~Ap-+(hJsZaF>ny4`r!KBB(M{B85kiU3JM#b?Z9vWnLum%S;2A2%*7!DvXPnb eFf?jF_JTngj6r*PZ@_FWP;&SON_apz3Wx!a9$rfT diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_struct_nested.nc b/dap4/d4tests/src/test/data/resources/testfiles/test_struct_nested.nc deleted file mode 100644 index 42f2e6a7eaee2acb391213cdf1cc5b499ba8380d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1330 zcmeHH%}T>S5S~ra8fq&=tAcotdTt=0N-v_=B87q#k6tP@+ZwEGNkXa6qZd!!Jo_xZ zf%pP~@1f4@55&-3dvZc{_M827`F3V^pPG%cLT)DqWVQ_!6h&7zKgzs}jA*RKuXSgE zZ#Ns4M*h<%i*eIbG`&pP=L}#(+1y1X049SpL*x7%@ffUujbG=yei4qwJd6V#VSEGs zx){d>ZNkGS7!8ly*^tLKes2(Tb*So89k1f^2_KBc_k0-7ZvEatg5Wwe$329iNX)+4 z!KqxA6p%f3SKk=+2~9-=#lsjVYg-0pHW63D3tbV(w0VF%cu*{f6`13abF_{VDGhbh znASmi=mmV>yK@#vg_f;b=<;N)Qd0iFW$S9!n=M)VFI9$Ptw&}!yG@u`D&Js5UMK!g z=*2Jf#U&_&jL|U=XN0_2W5}W1{8xqYp-;W+&uf#XJY!QL4Z{$5w$}-ntgN0X{fNE4 rR{B&wT_U}z6}g?bC8h#oOB7}nRzet?a&^m}SK>aAzUkFLe}(@qUtf(6 diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_struct_nested.ncdump b/dap4/d4tests/src/test/data/resources/testfiles/test_struct_nested.ncdump deleted file mode 100644 index 16c71d22bf..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_struct_nested.ncdump +++ /dev/null @@ -1,16 +0,0 @@ -netcdf test_struct_nested { -types: - compound s1_t { - int x ; - int y ; - }; // s1_t - compound s2_t { - s1_t field1 ; - s1_t field2 ; - }; // s2_t -variables: - s2_t x ; -data: - - x = {{1, -2}, {255, 90}} ; -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_struct_nested3.cdl b/dap4/d4tests/src/test/data/resources/testfiles/test_struct_nested3.cdl deleted file mode 100644 index e52eba8179..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_struct_nested3.cdl +++ /dev/null @@ -1,16 +0,0 @@ -netcdf test_struct_nested3 { - types: - compound s1_t { - int field1 ; - }; // s1_t - compound s2_t { - s1_t field2 ; - }; // s2_t - compound s3_t { - s2_t field3 ; - }; // s2_t -variables: - s3_t x; -data: - x = {{{17}}} ; -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_struct_nested3.hdf5 b/dap4/d4tests/src/test/data/resources/testfiles/test_struct_nested3.hdf5 deleted file mode 100644 index 7e0173c94a421bf3d943a88e5a71b2726e816493..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 736 zcmeD5aB<`1lHy|G;9!7(|4{IN2_j+umG~g*-Q@4#62!!_g-Ho4#>@hhf@wjgxtJIj zK}y)fK_nwgIRi_vVSLGZkQflaB*7|ye3oLP_!2EB4<-q93sBNHzN8c;DFV{Z$ifVw zfPk^$0?ZIzhzJsS<>0a7VCO3=mTm|~#tO_b46J5Aognw6Wv1q&7&0&j00RW#UIm5; zm*&J^*J{A5gQnGpfdQXUYql(K!fuoUvkjV2#%M+nFxq>{Yi+R6ybO$xpaumR&{Uw$ oP@F`fxvbzwWai=!0-40jcn2C6@Yw7_3gtn<+~Picx**Uk0FHTVlK=n! diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_struct_nested3.nc b/dap4/d4tests/src/test/data/resources/testfiles/test_struct_nested3.nc deleted file mode 100644 index c8cc68e0d6f00b6381287f63b4bfebdda77e18d6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1206 zcmeD5aB<`1lHy_j0S*oZ76t(@6Gr@pf^94i5f~pPp8#Xvp#42uf|z(7Fe!oMnW3gI zz>GnsxtJIjK`KRMfG%NRU}nUrk|!Iaj*)?nfddHR{hR}e@(WUnN-|T6f#SkI>@4^W^M&k4>LmnrnyFV41`Ki>JEQr4{t~ys4_#0L<RE~n<4e53mM}1|iGYL|S)i$mfw3YT%6!HA_r4%d4gkY6m9+o> diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_struct_nested3.ncdump b/dap4/d4tests/src/test/data/resources/testfiles/test_struct_nested3.ncdump deleted file mode 100644 index a3a6cb40e2..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_struct_nested3.ncdump +++ /dev/null @@ -1,17 +0,0 @@ -netcdf test_struct_nested3 { -types: - compound s1_t { - int field1 ; - }; // s1_t - compound s2_t { - s1_t field2 ; - }; // s2_t - compound s3_t { - s2_t field3 ; - }; // s3_t -variables: - s3_t x ; -data: - - x = {{{17}}} ; -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_struct_type.cdl b/dap4/d4tests/src/test/data/resources/testfiles/test_struct_type.cdl deleted file mode 100644 index 005f897c52..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_struct_type.cdl +++ /dev/null @@ -1,11 +0,0 @@ -netcdf test_struct_type { - types: - compound c_t { - int x ; - int y ; - }; // c_t -variables: - c_t s; -data: - s = {1,-2}; -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_struct_type.nc b/dap4/d4tests/src/test/data/resources/testfiles/test_struct_type.nc deleted file mode 100644 index 2a988dc2fec9bb1390d3c8d9628de04edf075119..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 805 zcmeD5aB<`1lHy_j0S*oZ76t(@6Gr@p0##;+2#gPtPk=FS(Ec7SK}kP=ZDpi3ASm>C(+RlxW>*&ua{415e6Kp5}m98i>BkXlrdnOY1K7Y1Ty zuso0eg0j@2;>`R!Tf>^X)RN?sw4BT&n2?E{iJp;eN@`hZPJTgdYF+O#z5WZ?~{=fNW)AVgdyW1BVcZ$IK`T zO-x`1f+PY!1hs+3Gs&C&&K}-uVjz%4J|I21X+oc(woP K05Sgo6C42TEP5#b diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_struct_type.ncdump b/dap4/d4tests/src/test/data/resources/testfiles/test_struct_type.ncdump deleted file mode 100644 index 6fc0c77b50..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_struct_type.ncdump +++ /dev/null @@ -1,12 +0,0 @@ -netcdf test_struct_type { -types: - compound c_t { - int x ; - int y ; - }; // c_t -variables: - c_t s ; -data: - - s = {1, -2} ; -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_test.cdl b/dap4/d4tests/src/test/data/resources/testfiles/test_test.cdl deleted file mode 100644 index 684d1c5002..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_test.cdl +++ /dev/null @@ -1,11 +0,0 @@ -netcdf test_test { - -types: - byte enum enum_t {c1=1, c2=2, c3=3}; - -variables: - enum_t v1; - -data: - v1 = c1; -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_test.nc b/dap4/d4tests/src/test/data/resources/testfiles/test_test.nc deleted file mode 100644 index 56638925f8351da0529450a8eb091b2cee33c3c2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 777 zcmeD5aB<`1lHy_j0S*oZ76t(@6Gr@p0#0U#2#gPtPk=FS(Ec7SK}kP=ZDpi3ASm>C(+RlxW>*&ua{415e6Kp5}m98i>BkXlrdnOY1K7Y1Ty zuso0eg0j@2;>`R!Tf>^X)RN?sw4BT&n2?E{iJp;eN@`hZPJTgdYFAz)U2&2wgO!u*1A%_xs+PH^Z9`Gkc!Tt(g7^Kad#)cp%7K`S}oLj=32b z%kf?5{Gf$=Zbu8eXw!UL*F~9JreFOUFe(|J#7+Qo2K^N>4jfP&gCQ{RDQ;!An~fu@ zX;-Zl=11|(@^Sp2Iaae(ZPXVNow{Y0%9UDmPo`$$v+?9i*>bE}SJ zZzL3(>dlE55IMyf+0U7%*ReC|CyFoaWl((;viWrv=AAeWOQJ(pd|^`NamgY_r)WQk z;PpBB$d8l>j1g2$oK)|UJLtW64eCM@r`Q;wNN4Y2pS`P9KoL*`6ahs*5l{sFJAqFfyoZPY diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_vlen10.ncdump b/dap4/d4tests/src/test/data/resources/testfiles/test_vlen10.ncdump deleted file mode 100644 index 432a625790..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_vlen10.ncdump +++ /dev/null @@ -1,13 +0,0 @@ -netcdf test_vlen10 { -types: - compound c_t { - int x ; - float y ; - }; // c_t - c_t(*) v_t ; -variables: - v_t v ; -data: - - v = {{17, 30.7}, {19, 101.1}} ; -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_vlen11.cdl b/dap4/d4tests/src/test/data/resources/testfiles/test_vlen11.cdl deleted file mode 100644 index 98c0575603..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_vlen11.cdl +++ /dev/null @@ -1,13 +0,0 @@ -netcdf test_vlen11 { - -types: - int(*) v1_t; - v1_t(*) v2_t; - -variables: - v2_t v; - -data: - v = {{1, 3, 5, 7},{100,200}} ; -} - diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_vlen11.ncdump b/dap4/d4tests/src/test/data/resources/testfiles/test_vlen11.ncdump deleted file mode 100644 index 806ec725c1..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_vlen11.ncdump +++ /dev/null @@ -1,10 +0,0 @@ -netcdf test_vlen11 { -types: - int(*) v1_t ; - v1_t(*) v2_t ; -variables: - v2_t v ; -data: - - v = {{1, 3, 5, 7}, {100, 200}} ; -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_vlen2.cdl b/dap4/d4tests/src/test/data/resources/testfiles/test_vlen2.cdl deleted file mode 100644 index 8e3a578c18..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_vlen2.cdl +++ /dev/null @@ -1,15 +0,0 @@ -netcdf test_vlen2 { - -types: - int(*) vlen_t; - -dimensions: - d3=3; - d2=2; - -variables: - vlen_t x(d3,d2); - -data: - x = {1, 3, 5, 7}, {100,200}, {-1,-2},{1, 3, 5, 7}, {100,200}, {-1,-2}; -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_vlen2.nc b/dap4/d4tests/src/test/data/resources/testfiles/test_vlen2.nc deleted file mode 100644 index dd2d4a2f1ea532db9798c2f7693ab0536271aff5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6336 zcmeHL%}-N75Z`?d>azg><)eNiR*XSSY$%}df)QT}R7#62Hxt|9dqB0cqP4K{-FZBb5@RBX<_+wd{g|Dd`OVCd<<@v? zv^BUV$dC+!HL-TlrO&FO<&d1AF|FsR(}1VPV;QaGqt+|d^(G}oYS#0h#yE;}?E^~~ z(>Yr&LF1OoD970jX24G_WlmKqi+0s1+BKNp1vpNKxL}u^rFm=ixJMuwIT?wbVC@2!>%u(7`lMd80O{ad^eBfuj>0$r zq_Yrf2EH2_?rk@iaEc_-=J{K@v&2oeRj(E6Et(wF$lW_T&gc7C<~1r%YmjddV*5oC#%t zRDDS;pYkfa_B7a!8d~ybFNfe@>ZC>{<0yrmoQ6i8OwSi8T zXRbKma>ZF&su!xo!c57Igoy^(xi4dHH;$bGgAv#NFm{knf~Z*jPV62jD1VOKp>6W) z-;3SXhpTti(!E#3eOTEa=)w+fB0Mx}-~#0}uH0Vf_`Fqd8({acA5w1I4hzd<>9|!% zc9M%J)1T0z`4#!6PvE)o#4>fbO1s9};1E z2G@@;+5w|8@zHoDo-*S(X>>Q7h!==ea0)fs5j!{gkaKP|Dq$*yMtj%az61`rM4YTA zJqvH_`~R*NPrA%_o8D`+%p_3%=5BMhP&{_<*ViKfOf zW0}#je$Wb5>+5Sl7;UWh%jaVX*~~;HJI+!9m@PvZoRl4UfOPQUn{OP($k{jnWU?XF z4gGOwxHe@maVXLd&?Fh>0$R?cC1sycZyrOV{lll)Ytt4>Z-TvU3nhkOh=tY>m;%5E zAJ|L~A!&9-@*FC1mJmof`RP&#ctjArmR>QIn_Fc%e?Z^)6(XOafZPcnut3k#l8fA}4AH4q| zaCa4yKL>8-w*vQW=lOd?UIynY<~k4sCozB=@1jID{LwKJrxbb;jLp+je)p1dbJ*FJ?S z|L!U1RIj$)KBE);o&6Q3kQd%!G60e16jw?(sy3RZtAY}c=1HHDS(#;r!1ge-3(yvz zsmn-I46y7aZ150_sSB<>-w!hU8*u=YfXE*DiF>0RlEIKo^x;>NMnEH=5zq)|1T+E~ q0gZr0KqH_L&KZ!Ps+HN#`J=eW~Er>7G0q3E~JIcc}T+Ktof*R3HC%ck79N_pL{1Vz7!^C$6fr5ziTnqR3F%cW~WnSjz@Gdhq>g-)BjwHV{HmQV3KCR2c-aX(edzay)p52kg#OD*lI0hgBksLmG?d!JIYn1Wc&JAzo6)7 zPBEoL?jjYR^~g-S7{`Zqv9MCCI{2S=uzuXcq*EwjsZdEdi}wPjR1Wq`wS1+RUtIHJ z4$CmS%zQ~5@Z9S3(xc`mb3_54P~6ri)({sGW=QipYTsR|!r<85x+Bl6izY;v87m6g zx*O3JO%f2bReb@RUwFJqvB+9P$r3ru5J%^Z&dHq6j<4=*;9hb%v#^J14>}Rgxpw%J z8+A?>0?pmJedVF#$~&wZd~rJjn0?-x^ya;k>t$7Tx=)Dtg?x~&`T_R-FT9FfDrtAF zz-G~n_apf<+XZ9Bc?Ng3#<*|vAt7+nO(!L-h#4qMF+OCbJQsm>lNZp)$fpT4U%$bn zz;T_J>&5e*ahVjGt#~SvoV_&LEPSCZ_K5eyUV>d zQ6!+yC#Alql@_sm@Ik?sBI4hJBBChxAojrr|3G}LrY})Jsprhh+1)0)NLoZvW|F<< z&Y3ea=X~eP&z^m5a%{Y*@#aQ`B_3xcYvHf-xGak?Bsf&3_G9!?hh`?n=5_0D{UC2Q z8l)Hvvz<2TOhb_tu0^B^@p0LUQFo|Y$C0VAW)_FP+-zztD3;tH^4t*kZSYC)c6dNp zcZ1L?`ojYoz8fv&mkZt^v6B7C{=vSyyY3c>rB&CDHdgY>_f-iD^bhq9+|R5ePN#tm zIAP>P1s4Wx14Y|`a;<^7PdTflf@?1q1N+Hha6DWomfm`~Bf)WKVw%?ibxpKvZkTc8P)z{#p#F}IJ_b|ntU+}S!A7^h~wH}hOX1PgaGD){bw$|1I@0rf@7cv0TOwuxXCd# zd~xVv#V^fL^@n*IJsLXkO*27rUQF!Wi^DT@PQ`%l!i)_CbRhrhF zz;hN0Zof?>ag{NHnos}w%bBv*A$~w7gS5gLE8jC{11A^JIZb>4^AGz(uhW9iSq%{( z8$UY2_6Wk-YPZkGRW6u_N8a!pQOSPLR*}4&OiU0KJK~qZDI~ z7vxHT8-{Cvn{%RE=sLLqUci3)eY(5s84+vpri2DyA;@UUt+5`(O{qTmZHNSHwHM^- zKrpIN*UFR7WJIkwR6%3=;d0c)Dwm>}sqBKV5HC%*$Z$E*C692grfYcYK;bK=RlIL| zK6r+{8i$rM z@o5~npUKl4P$GshaP!|ErOT=36 zYd@w<>DxEv!L9c(7lRp=2r?}5>GAY@dN!5Li44mDNC;rcAn!y@=t7GAUkYVn%9%we zUzxG?06Tsnl1V7aQxK&*42^Q=#H**!w)l<6F*M2>@k|zQ_NH}YZRV@Z2Wwd;lQ?_S zI?6G<{pEMBp>^mZ{6S%FL?C7RC;~5Roj<)WpHAaXI~09H`O+c5Dr($SRl!%8Mx$)n zwpLYD2q**;0tx|zfI{H9LEu^VU3X-JvCR$jQ5dKgP%)rlK*fNH0Tlx(22>2F7*H{w OVnD@!ih=7d2L1uwHAtWU diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_zerodim.ncdump b/dap4/d4tests/src/test/data/resources/testfiles/test_zerodim.ncdump deleted file mode 100644 index e13baa0d39..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/test_zerodim.ncdump +++ /dev/null @@ -1,28 +0,0 @@ -netcdf test_zerodim { -dimensions: - lat = 6 ; - lon = 4 ; - time = UNLIMITED ; // (0 currently) - unlim = UNLIMITED ; // (3 currently) -variables: - float lat(lat) ; - lat:units = "degrees_north" ; - float lon(lon) ; - lon:units = "degrees_east" ; - double time(time) ; - time:units = "seconds since 2009-01-01" ; - float pr(time, lat, lon) ; - pr:standard_name = "air_pressure_at_sea_level" ; - pr:units = "hPa" ; - float var(unlim) ; - -// global attributes: - :title = "example for workshop" ; -data: - - lat = _, _, _, _, _, _ ; - - lon = _, _, _, _ ; - - var = 0, 1, 3 ; -} diff --git a/dap4/d4tests/src/test/data/resources/testfiles/tst_fills.c b/dap4/d4tests/src/test/data/resources/testfiles/tst_fills.c deleted file mode 100644 index dd7844a837..0000000000 --- a/dap4/d4tests/src/test/data/resources/testfiles/tst_fills.c +++ /dev/null @@ -1,51 +0,0 @@ -/* This is part of the netCDF package. Copyright 2008 University - Corporation for Atmospheric Research/Unidata See COPYRIGHT file for - conditions of use. See www.unidata.ucar.edu for more info. - - Create a test file with default fill values for variables of each type. - - $Id: tst_fills.c,v 1.12 2009/03/17 01:22:42 ed Exp $ -*/ - -#include -#include -#include - -#define FILE_NAME "tst_fills.nc" -#define VAR1 "uv8" -# define TYPE1 NC_UBYTE -# define DATA1 240 -#define VAR2 "v16" -# define TYPE2 NC_SHORT -# define DATA2 32700 -#define VAR3 "uv32" -# define TYPE3 NC_INT -# define FILL3 17 -# define DATA3 111000 - -#define ERR abort() - - -int -main(int argc, char **argv) -{ - int ncid; - int varid1, varid2, varid3; - int fill3 = FILL3; - - printf("\n*** Testing fill values.\n"); - - if (nc_create(FILE_NAME, NC_NETCDF4, &ncid)) ERR; - if (nc_def_var(ncid, VAR1, TYPE1, 0, NULL, &varid1)) ERR; - if (nc_def_var(ncid, VAR2, TYPE2, 0, NULL, &varid2)) ERR; - if (nc_def_var(ncid, VAR3, TYPE3, 0, NULL, &varid3)) ERR; - if (nc_def_var_fill(ncid, varid3, 0, &fill3)) ERR; - - if (nc_enddef(ncid)) ERR; - - {unsigned char data = DATA1; if (nc_put_var(ncid,varid1,&data)) ERR;} - {short data = DATA2; if (nc_put_var(ncid,varid2,&data)) ERR;} - {unsigned int data = DATA3; if (nc_put_var(ncid,varid3,&data)) ERR;} -} - - diff --git a/dap4/d4tests/src/test/data/resources/testfiles/tst_fills.nc b/dap4/d4tests/src/test/data/resources/testfiles/tst_fills.nc deleted file mode 100644 index f45e6600f6be1c4348e7a6ba6d31e21c788999ed..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1050 zcmeD5aB<`1lHy|G;9!7(|4<;s0ueEQO8j`qD(dgy62!!_g-Ho4#>@RAwHK3k85Ih?N`+tn45rvlfW|pF;@DVHAcs9ij**vlEDi zF1XzJ;cndJFazMfY#Aj@P1%?PTFkrF5uw&?k1OvlEsV*0MVFB^10s|`- zBrHIDK_G^Oh8Q$7pcI3s3 matches, String... extensions) { - File testdirf = new File(path); - assert (testdirf.canRead()); - TestFilter tf = new TestFilter(DEBUG, extensions); - File[] filelist = testdirf.listFiles(tf); - for (int i = 0; i < filelist.length; i++) { - File file = filelist[i]; - if (file.isDirectory()) - continue; - String fname = DapUtil.canonicalpath(file.getAbsolutePath()); - matches.add(fname); - } - } - } - - ////////////////////////////////////////////////// - // Static variables - - static protected String dap4root = null; - static protected String dap4testroot = null; - static protected String dap4resourcedir = null; - - static { - dap4root = locateDAP4Root(threddsroot); - if (dap4root == null) - System.err.println("Cannot locate /dap4 parent dir"); - dap4testroot = canonjoin(dap4root, D4TESTDIRNAME); - dap4resourcedir = canonjoin(dap4testroot, DFALTRESOURCEPATH); - } - - ////////////////////////////////////////////////// - // Static methods - - - static protected String getD4TestsRoot() { - return dap4testroot; - } - - static protected String getResourceRoot() { - return dap4resourcedir; - } - - static String locateDAP4Root(String threddsroot) { - String root = threddsroot; - if (root != null) - root = root + "/" + DEFAULTTREEROOT; - // See if it exists - File f = new File(root); - if (!f.exists() || !f.isDirectory()) - root = null; - return root; - } - - ////////////////////////////////////////////////// - // Instance variables - - - protected String d4tsserver = null; - - protected String title = "Dap4 Testing"; - - public DapTestCommon() { - this("DapTest"); - } - - public DapTestCommon(String name) { - super(name); - - this.d4tsserver = TestDir.dap4TestServer; - if (DEBUG) - System.err.println("DapTestCommon: d4tsServer=" + d4tsserver); - } - - /** - * Try to get the system properties - */ - protected void setSystemProperties() { - String testargs = System.getProperty("testargs"); - if (testargs != null && testargs.length() > 0) { - String[] pairs = testargs.split("[ ]*[,][ ]*"); - for (String pair : pairs) { - String[] tuple = pair.split("[ ]*[=][ ]*"); - String value = (tuple.length == 1 ? "" : tuple[1]); - if (tuple[0].length() > 0) - System.setProperty(tuple[0], value); - } - } - if (System.getProperty("nodiff") != null) - prop_diff = false; - if (System.getProperty("baseline") != null) - prop_baseline = true; - if (System.getProperty("nogenerate") != null) - prop_generate = false; - if (System.getProperty("debug") != null) - prop_debug = true; - if (System.getProperty("visual") != null) - prop_visual = true; - if (System.getProperty("ascii") != null) - prop_ascii = true; - if (System.getProperty("utf8") != null) - prop_ascii = false; - if (prop_baseline && prop_diff) - prop_diff = false; - prop_controls = System.getProperty("controls", ""); - } - - ////////////////////////////////////////////////// - // Overrideable methods - - ////////////////////////////////////////////////// - // Accessor - - public void setTitle(String title) { - this.title = title; - } - - public String getTitle() { - return this.title; - } - - ////////////////////////////////////////////////// - // Instance Utilities - - public void visual(String header, String captured) { - if (!captured.endsWith("\n")) - captured = captured + "\n"; - // Dump the output for visual comparison - System.err.println("\n" + header + ":"); - System.err.println("---------------"); - System.err.print(captured); - System.err.println("---------------"); - System.err.flush(); - } - - protected void findServer(String path) throws DapException { - String svc = "http://" + this.d4tsserver + "/d4ts"; - if (!checkServer(svc)) - System.err.println("D4TS Server not reachable: " + svc); - // Since we will be accessing it thru NetcdfDataset, we need to change the schema. - d4tsserver = "dap4://" + d4tsserver + "/d4ts"; - } - - ////////////////////////////////////////////////// - - public String getDAP4Root() { - return this.dap4root; - } - - @Override - public String getResourceDir() { - return this.dap4resourcedir; - } - - static protected void testSetup() { - try { - // Always prefer Nc4Iosp over HDF5 - NetcdfFile.iospDeRegister(NC4IOSP); - NetcdfFile.registerIOProviderPreferred(NC4IOSP, ucar.nc2.iosp.hdf5.H5iosp.class); - // Print out the library version - System.err.printf("Netcdf-c library version: %s%n", getCLibraryVersion()); - System.err.flush(); - } catch (Exception e) { - System.err.println("Cannot load ucar.nc2.jni.netcdf.Nc4Iosp"); - } - } - - static void printDir(String path) { - File testdirf = new File(path); - assert (testdirf.canRead()); - File[] filelist = testdirf.listFiles(); - System.err.println("\n*******************"); - System.err.printf("Contents of %s:%n", path); - for (int i = 0; i < filelist.length; i++) { - File file = filelist[i]; - String fname = file.getName(); - System.err.printf("\t%s%s%n", fname, (file.isDirectory() ? "/" : "")); - } - System.err.println("*******************"); - System.err.flush(); - } - - static public String getCLibraryVersion() { - Nc4prototypes nc4 = getCLibrary(); - return (nc4 == null ? "Unknown" : nc4.nc_inq_libvers()); - } - - static public Nc4prototypes getCLibrary() { - try { - Method getclib = NC4IOSP.getMethod("getCLibrary"); - return (Nc4prototypes) getclib.invoke(null); - } catch (NoSuchMethodException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) { - return null; - } - } -} - diff --git a/dap4/d4tests/src/test/java/dap4/test/Diff.j b/dap4/d4tests/src/test/java/dap4/test/Diff.j deleted file mode 100644 index 4c516837a1..0000000000 --- a/dap4/d4tests/src/test/java/dap4/test/Diff.j +++ /dev/null @@ -1,794 +0,0 @@ -// Diff -- text file difference utility. -// See full docu-comment at beginning of Diff class. - -/* Copyright (c) Ian F. Darwin, http://www.darwinsys.com/, 1996-2002. - * All rights reserved. Software written by Ian F. Darwin and others. - * $Id: LICENSE,v 1.8 2004/02/09 03:33:38 ian Exp $ - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * Java, the Duke mascot, and all variants of Sun's Java 'steaming coffee cup' - logo are trademarks of Sun Microsystems. Sun's, and James Gosling's, - * pioneering role in inventing and promulgating (and standardizing) the Java - * language and environment is gratefully acknowledged. - * - * The pioneering role of Dennis Ritchie and Bjarne Stroustrup, of AT&T, for - * inventing predecessor languages C and C+is also gratefully acknowledged. - */ - -package dap4.test; - -import java.io.*; - - -/** - * This is the info kept per-file. - */ -class fileInfo { - - static final int MAXLINECOUNT = 20000; - - BufferedReader file; /* File handle that is open for read. */ - public int maxLine; /* After input done, # lines in file. */ - node symbol[]; /* The symtab handle of each line. */ - int other[]; /* Map of line# to line# in other file */ - /* ( -1 means don't-know ). */ - /* Allocated AFTER the lines are read. */ - - /** - * Normal constructor with one filename; file is opened and saved. - */ - public fileInfo(String filename) throws Exception { - symbol = new node[MAXLINECOUNT + 2]; - other = null; // allocated later! - file = new BufferedReader(new FileReader(filename)); - } - - public fileInfo(Reader rdr) throws Exception { - symbol = new node[MAXLINECOUNT + 2]; - other = null; // allocated later! - file = new BufferedReader(rdr); - } - - // This is done late, to be same size as # lines in input file. - - void alloc() { - other = new int[symbol.length + 2]; - } -}; - -/** - * diff Text file difference utility. - * ---- Copyright 1987, 1989 by Donald C. Lindsay, - * School of Computer Science, Carnegie Mellon University. - * Copyright 1982 by Symbionics. - * Use without fee is permitted when not for direct commercial - * advantage, and when credit to the source is given. Other uses - * require specific permission. - *

- * Converted from C to Java by Ian F. Darwin, http://www.darwinsys.com/, January, 1997. - * Copyright 1997, Ian F. Darwin. - *

- * Conversion is NOT FULLY TESTED. - *

- * USAGE: diff oldfile newfile - *

- * This program assumes that "oldfile" and "newfile" are text files. - * The program writes to stdout a description of the changes which would - * transform "oldfile" into "newfile". - *

- * The printout is in the form of commands, each followed by a block of - * text. The text is delimited by the commands, which are: - *

- * DELETE AT n - * ..deleted lines - *

- * INSERT BEFORE n - * ..inserted lines - *

- * n MOVED TO BEFORE n - * ..moved lines - *

- * n CHANGED FROM - * ..old lines - * CHANGED TO - * ..newer lines - *

- * The line numbers all refer to the lines of the oldfile, as they are - * numbered before any commands are applied. - * The text lines are printed as-is, without indentation or prefixing. The - * commands are printed in upper case, with a prefix of ">>>>", so that - * they will stand out. Other schemes may be preferred. - * Files which contain more than MAXLINECOUNT lines cannot be processed. - * This can be fixed by changing "symbol" to a Vector. - * The algorithm is taken from Communications of the ACM, Apr78 (21, 4, 264-), - * "A Technique for Isolating Differences Between Files." - * Ignoring I/O, and ignoring the symbol table, it should take O(N) time. - * This implementation takes fixed space, plus O(U) space for the symbol - * table (where U is the number of unique lines). Methods exist to change - * the fixed space to O(N) space. - * Note that this is not the only interesting file-difference algorithm. In - * general, different algorithms draw different conclusions about the - * changes that have been made to the oldfile. This algorithm is sometimes - * "more right", particularly since it does not consider a block move to be - * an insertion and a (separate) deletion. However, on some files it will be - * "less right". This is a consequence of the fact that files may contain - * many identical lines (particularly if they are program source). Each - * algorithm resolves the ambiguity in its own way, and the resolution - * is never guaranteed to be "right". However, it is often excellent. - * This program is intended to be pedagogic. Specifically, this program was - * the basis of the Literate Programming column which appeared in the - * Communications of the ACM (CACM), in the June 1989 issue (32, 6, - * 740-755). - * By "pedagogic", I do not mean that the program is gracefully worded, or - * that it showcases language features or its algorithm. I also do not mean - * that it is highly accessible to beginners, or that it is intended to be - * read in full, or in a particular order. Rather, this program is an - * example of one professional's style of keeping things organized and - * maintainable. - * The program would be better if the "print" variables were wrapped into - * a struct. In general, grouping related variables in this way improves - * documentation, and adds the ability to pass the group in argument lists. - * This program is a de-engineered version of a program which uses less - * memory and less time. The article points out that the "symbol" arrays - * can be implemented as arrays of pointers to arrays, with dynamic - * allocation of the subarrays. (In C, macros are very useful for hiding - * the two-level accesses.) In Java, a Vector would be used. This allows an - * extremely large value for MAXLINECOUNT, without dedicating fixed arrays. - * (The "other" array can be allocated after the input phase, when the exact - * sizes are known.) The only slow piece of code is the "strcmp" in the tree - * descent: it can be speeded up by keeping a hash in the tree node, and - * only using "strcmp" when two hashes happen to be equal. - *

- * Change Log - * ---------- - * 1Jan97 Ian F. Darwin: first working rewrite in Java, based entirely on - * D.C.Lindsay's reasonable C version. - * Changed comments from /***************** to /**, shortened, added - * whitespace, used tabs more, etc. - * 6jul89 D.C.Lindsay, CMU: fixed portability bug. Thanks, Gregg Wonderly. - * Just changed "char ch" to "int ch". - * Also added comment about way to improve code. - * 10jun89 D.C.Lindsay, CMU: posted version created. - * Copyright notice changed to ACM style, and Dept. is now School. - * ACM article referenced in docn. - * 26sep87 D.C.Lindsay, CMU: publication version created. - * Condensed all 1982/83 change log entries. - * Removed all command line options, and supporting code. This - * simplified the input code (no case reduction etc). It also - * simplified the symbol table, which was capable of remembering - * offsets into files (instead of strings), and trusting (!) hash - * values to be unique. - * Removed dynamic allocation of arrays: now fixed static arrays. - * Removed speed optimizations in symtab package. - * Removed string compression/decompression code. - * Recoded to Unix standards from old Lattice/MSDOS standards. - * (This affected only the #include's and the IO.) - * Some renaming of variables, and rewording of comments. - * 1982/83 D.C.Lindsay, Symbionics: created. - * - * @author Ian F. Darwin, Java version - * @author D. C. Lindsay, C version (1982-1987) - * @version Java version 0.9, 1997 - */ - -public class Diff { - - /** - * block len > any possible real block len - */ - final int UNREAL = Integer.MAX_VALUE; - - /** - * Keeps track of information about file1 and file2 - */ - fileInfo oldinfo, newinfo; - - PrintWriter printer = null; - - String identifier = ""; - - - /** - * blocklen is the info about found blocks. It will be set to 0, except - * at the line#s where blocks start in the old file. At these places it - * will be set to the # of lines in the block. During printout , - * this # will be reset to -1 if the block is printed as a MOVE block - * (because the printout phase will encounter the block twice, but - * must only print it once.) - * The array declarations are to MAXLINECOUNT+2 so that we can have two - * extra lines (pseudolines) at line# 0 and line# MAXLINECOUNT+1 - * (or less). - */ - int blocklen[]; - - /** - * main - entry point when used standalone. - * NOTE: no routines return error codes or throw any local - * exceptions. Instead, any routine may complain - * to stderr and then exit with error to the system. - */ - public static void main(String argstrings[]) throws Exception { - if (argstrings.length != 2) { - System.err.println("Usage: diff oldfile newfile"); - System.exit(1); - } - Diff d = new Diff("Diff"); - d.doDiff(argstrings[0], argstrings[1]); - return; - } - - /** - * Construct a Diff object. - */ - public Diff(String id) { - identifier = id; - } - - - /* Do comparison against two Reader streams */ - - public boolean doDiff(Reader oldFile, Reader newFile, Writer out) throws Exception { - this.printer = new PrintWriter(out); - oldinfo = new fileInfo(oldFile); - newinfo = new fileInfo(newFile); - return process(); - } - - public boolean doDiff(Reader oldFile, Reader newFile) throws Exception { - Writer w = new OutputStreamWriter(System.out); - return doDiff(oldFile, newFile, w); - } - - /* Do comparison against two string streams */ - - public boolean doDiff(String data1, String data2, Writer out) throws Exception { - if(data1 == null || data2 == null) return false; - return doDiff(new StringReader(data1), new StringReader(data2), out); - } - - public boolean doDiff(String data1, String data2) throws Exception { - return doDiff(data1, data2, new OutputStreamWriter(System.out)); - } - - boolean process() throws Exception { - /* we don't process until we know both files really do exist. */ - inputscan(oldinfo); - inputscan(newinfo); - - /* Now that we've read all the lines, allocate some arrays. - */ - blocklen = new int[(oldinfo.maxLine > newinfo.maxLine ? - oldinfo.maxLine : newinfo.maxLine) + 2]; - oldinfo.alloc(); - newinfo.alloc(); - - /* Now do the work, and print the results. */ - transform(); - return printout(); - } - - static boolean isBlankLine(String s) - { - int index = 0; - int len = s.length(); - for(index=len-1;index>=0;index--) { - if(" \t\r".indexOf(s.charAt(index)) < 0) return false; - } - return true; - } - - /** - * inputscan Reads the file specified by pinfo.file. - * --------- Places the lines of that file in the symbol table. - * Sets pinfo.maxLine to the number of lines found. - */ - void inputscan(fileInfo pinfo) throws IOException { - String linebuffer; - pinfo.maxLine = 0; - while ((linebuffer = pinfo.file.readLine()) != null) { - if(!isBlankLine(linebuffer)) - storeline(linebuffer, pinfo); - } - } - - /** - * storeline Places line into symbol table. - * --------- Expects pinfo.maxLine initted: increments. - * Places symbol table handle in pinfo.ymbol. - * Expects pinfo is either oldinfo or newinfo. - */ - void storeline(String linebuffer, fileInfo pinfo) { - int linenum = ++pinfo.maxLine; /* note, no line zero */ - if (linenum > fileInfo.MAXLINECOUNT) { - System.err.println("MAXLINECOUNT exceeded, must stop."); - System.exit(1); - } - pinfo.symbol[linenum] = node.addSymbol(this, linebuffer, pinfo == oldinfo, linenum); - } - - /* - * transform - * Analyzes the file differences and leaves its findings in - * the global arrays oldinfo.other, newinfo.other, and blocklen. - * Expects both files in symtab. - * Expects valid "maxLine" and "symbol" in oldinfo and newinfo. - */ - - void transform() { - int oldline, newline; - int oldmax = oldinfo.maxLine + 2; /* Count pseudolines at */ - int newmax = newinfo.maxLine + 2; /* ..front and rear of file */ - - for (oldline = 0; oldline < oldmax; oldline++) - oldinfo.other[oldline] = -1; - for (newline = 0; newline < newmax; newline++) - newinfo.other[newline] = -1; - - scanunique(); /* scan for lines used once in both files */ - scanafter(); /* scan past sure-matches for non-unique blocks */ - scanbefore(); /* scan backwards from sure-matches */ - scanblocks(); /* find the fronts and lengths of blocks */ - } - - /* - * scanunique - * Scans for lines which are used exactly once in each file. - * Expects both files in symtab, and oldinfo and newinfo valid. - * The appropriate "other" array entries are set to the line# in - * the other file. - * Claims pseudo-lines at 0 and XXXinfo.maxLine+1 are unique. - */ - - void scanunique() { - int oldline, newline; - node psymbol; - - for (newline = 1; newline <= newinfo.maxLine; newline++) { - psymbol = newinfo.symbol[newline]; - if (psymbol.symbolIsUnique()) { // 1 use in each file - oldline = psymbol.linenum; - newinfo.other[newline] = oldline; // record 1-1 map - oldinfo.other[oldline] = newline; - } - } - newinfo.other[0] = 0; - oldinfo.other[0] = 0; - newinfo.other[newinfo.maxLine + 1] = oldinfo.maxLine + 1; - oldinfo.other[oldinfo.maxLine + 1] = newinfo.maxLine + 1; - } - - /* - * scanafter - * Expects both files in symtab, and oldinfo and newinfo valid. - * Expects the "other" arrays contain positive #s to indicate - * lines that are unique in both files. - * For each such pair of places, scans past in each file. - * Contiguous groups of lines that match non-uniquely are - * taken to be good-enough matches, and so marked in "other". - * Assumes each other[0] is 0. - */ - - void scanafter() { - int oldline, newline; - - for (newline = 0; newline <= newinfo.maxLine; newline++) { - oldline = newinfo.other[newline]; - if (oldline >= 0) { /* is unique in old & new */ - for (; ;) { /* scan after there in both files */ - if (++oldline > oldinfo.maxLine) break; - if (oldinfo.other[oldline] >= 0) break; - if (++newline > newinfo.maxLine) break; - if (newinfo.other[newline] >= 0) break; - - /* oldline & newline exist, and - aren't already matched */ - - if (newinfo.symbol[newline] != - oldinfo.symbol[oldline]) break; // not same - - newinfo.other[newline] = oldline; // record a match - oldinfo.other[oldline] = newline; - } - } - } - } - - /** - * scanbefore - * As scanafter, except scans towards file fronts. - * Assumes the off-end lines have been marked as a match. - */ - void scanbefore() { - int oldline, newline; - - for (newline = newinfo.maxLine + 1; newline > 0; newline--) { - oldline = newinfo.other[newline]; - if (oldline >= 0) { /* unique in each */ - for (; ;) { - if (--oldline <= 0) break; - if (oldinfo.other[oldline] >= 0) break; - if (--newline <= 0) break; - if (newinfo.other[newline] >= 0) break; - - /* oldline and newline exist, - and aren't marked yet */ - - if (newinfo.symbol[newline] != - oldinfo.symbol[oldline]) break; // not same - - newinfo.other[newline] = oldline; // record a match - oldinfo.other[oldline] = newline; - } - } - } - } - - /** - * scanblocks - Finds the beginnings and lengths of blocks of matches. - * Sets the blocklen array (see definition). - * Expects oldinfo valid. - */ - void scanblocks() { - int oldline, newline; - int oldfront = 0; // line# of front of a block in old, or 0 - int newlast = -1; // newline's value during prev. iteration - - for (oldline = 1; oldline <= oldinfo.maxLine; oldline++) - blocklen[oldline] = 0; - blocklen[oldinfo.maxLine + 1] = UNREAL; // starts a mythical blk - - for (oldline = 1; oldline <= oldinfo.maxLine; oldline++) { - newline = oldinfo.other[oldline]; - if (newline < 0) oldfront = 0; /* no match: not in block */ - else { /* match. */ - if (oldfront == 0) oldfront = oldline; - if (newline != (newlast + 1)) oldfront = oldline; - ++blocklen[oldfront]; - } - newlast = newline; - } - } - - /* The following are global to printout's subsidiary routines */ - // enum{ idle, delete, insert, movenew, moveold, - // same, change } printstatus; - public static final int - idle = 0, delete = 1, insert = 2, movenew = 3, moveold = 4, - same = 5, change = 6; - int printstatus; - boolean anyprinted; - int printoldline, printnewline; // line numbers in old & new file - - /** - * printout - Prints summary to stdout. - * Expects all databuffer structures have been filled out. - * - * @return true if differences detected - */ - boolean printout() { - printstatus = idle; - anyprinted = false; - for (printoldline = printnewline = 1; ;) { - if (printoldline > oldinfo.maxLine) { - newconsume(); - break; - } - if (printnewline > newinfo.maxLine) { - oldconsume(); - break; - } - if (newinfo.other[printnewline] < 0) { - if (oldinfo.other[printoldline] < 0) - showchange(); - else - showinsert(); - } else if (oldinfo.other[printoldline] < 0) - showdelete(); - else if (blocklen[printoldline] < 0) - skipold(); - else if (oldinfo.other[printoldline] == printnewline) - showsame(); - else - showmove(); - } - if (anyprinted == true) println(">>>> "+identifier+": End of differences."); - else println(">>>> "+identifier+": Files are identical."); - return anyprinted; - } - - /* - * newconsume Part of printout. Have run out of old file. - * Print the rest of the new file, as inserts and/or moves. - */ - - void newconsume() { - for (; ;) { - if (printnewline > newinfo.maxLine) - break; /* end of file */ - if (newinfo.other[printnewline] < 0) showinsert(); - else showmove(); - } - } - - /** - * oldconsume Part of printout. Have run out of new file. - * Process the rest of the old file, printing any - * parts which were deletes or moves. - */ - void oldconsume() { - for (; ;) { - if (printoldline > oldinfo.maxLine) - break; /* end of file */ - printnewline = oldinfo.other[printoldline]; - if (printnewline < 0) showdelete(); - else if (blocklen[printoldline] < 0) skipold(); - else showmove(); - } - } - - /** - * showdelete Part of printout. - * Expects printoldline is at a deletion. - */ - void showdelete() { - if (printstatus != delete) - println(">>>> DELETE AT " + printoldline); - printstatus = delete; - oldinfo.symbol[printoldline].showSymbol(); - anyprinted = true; - printoldline++; - } - - /* - * showinsert Part of printout. - * Expects printnewline is at an insertion. - */ - - void showinsert() { - if (printstatus == change) println(">>>> CHANGED TO"); - else if (printstatus != insert) - println(">>>> INSERT BEFORE " + printoldline); - printstatus = insert; - newinfo.symbol[printnewline].showSymbol(); - anyprinted = true; - printnewline++; - } - - /** - * showchange Part of printout. - * Expects printnewline is an insertion. - * Expects printoldline is a deletion. - */ - void showchange() { - if (printstatus != change) - println(">>>> " + printoldline + " CHANGED FROM"); - printstatus = change; - oldinfo.symbol[printoldline].showSymbol(); - anyprinted = true; - printoldline++; - } - - /** - * skipold Part of printout. - * Expects printoldline at start of an old block that has - * already been announced as a move. - * Skips over the old block. - */ - void skipold() { - printstatus = idle; - for (; ;) { - if (++printoldline > oldinfo.maxLine) - break; /* end of file */ - if (oldinfo.other[printoldline] < 0) - break; /* end of block */ - if (blocklen[printoldline] != 0) - break; /* start of another */ - } - } - - /** - * skipnew Part of printout. - * Expects printnewline is at start of a new block that has - * already been announced as a move. - * Skips over the new block. - */ - void skipnew() { - int oldline; - printstatus = idle; - for (; ;) { - if (++printnewline > newinfo.maxLine) - break; /* end of file */ - oldline = newinfo.other[printnewline]; - if (oldline < 0) - break; /* end of block */ - if (blocklen[oldline] != 0) - break; /* start of another */ - } - } - - /** - * showsame Part of printout. - * Expects printnewline and printoldline at start of - * two blocks that aren't to be displayed. - */ - void showsame() { - int count; - printstatus = idle; - if (newinfo.other[printnewline] != printoldline) { - System.err.println("BUG IN LINE REFERENCING"); - System.exit(1); - } - count = blocklen[printoldline]; - printoldline += count; - printnewline += count; - } - - /** - * showmove Part of printout. - * Expects printoldline, printnewline at start of - * two different blocks ( a move was done). - */ - void showmove() { - int oldblock = blocklen[printoldline]; - int newother = newinfo.other[printnewline]; - int newblock = blocklen[newother]; - - if (newblock < 0) skipnew(); // already printed. - else if (oldblock >= newblock) { // assume new's blk moved. - blocklen[newother] = -1; // stamp block as "printed". - println(">>>> " + newother + - " THRU " + (newother + newblock - 1) + - " MOVED TO BEFORE " + printoldline); - for (; newblock > 0; newblock--, printnewline++) - newinfo.symbol[printnewline].showSymbol(); - anyprinted = true; - printstatus = idle; - - } else /* assume old's block moved */ - skipold(); /* target line# not known, display later */ - } - - /** - * Convenience wrapper for println - */ - public void println(String s) { - printer.println(s); - printer.flush(); - } - -}; // end of main class! - -/** - * Class "node". The symbol table routines in this class all - * understand the symbol table format, which is a binary tree. - * The methods are: addSymbol, symbolIsUnique, showSymbol. - */ -class node { /* the tree is made up of these nodes */ - - static Diff diff = null; - static node panchor = null; /* symtab is a tree hung from this */ - static final int freshnode = 0, - oldonce = 1, newonce = 2, bothonce = 3, other = 4; - - node pleft, pright; - int linenum; - int /* enum linestates */ linestate; - String line; - - /** - * Construct a new symbol table node and fill in its fields. - * - * @param pline string A line of the text file - */ - public node(String pline) { - pleft = pright = null; - linestate = freshnode; - /* linenum field is not always valid */ - line = pline; - } - - /** - * matchsymbol Searches tree for a match to the line. - * - * @param pline String pline, a line of text - * If node's linestate == freshnode, then created the node. - */ - static node matchsymbol(String pline) { - int comparison; - node pnode = panchor; - if (panchor == null) return panchor = new node(pline); - for (; ;) { - comparison = linecompare(pnode.line,pline); - if (comparison == 0) return pnode; /* found */ - - if (comparison < 0) { - if (pnode.pleft == null) { - pnode.pleft = new node(pline); - return pnode.pleft; - } - pnode = pnode.pleft; - } - if (comparison > 0) { - if (pnode.pright == null) { - pnode.pright = new node(pline); - return pnode.pright; - } - pnode = pnode.pright; - } - } - /* NOTE: There are return stmts, so control does not get here. */ - } - - /** - * addSymbol(String pline) - Saves line into the symbol table. - * Returns a handle to the symtab entry for that unique line. - * If inoldfile nonzero, then linenum is remembered. - */ - static node addSymbol(Diff diff, String pline, boolean inoldfile, int linenum) { - node.diff = diff; - node pnode; - pnode = matchsymbol(pline); /* find the node in the tree */ - if (pnode.linestate == freshnode) { - pnode.linestate = inoldfile ? oldonce : newonce; - } else { - if ((pnode.linestate == oldonce && !inoldfile) || - (pnode.linestate == newonce && inoldfile)) - pnode.linestate = bothonce; - else pnode.linestate = other; - } - if (inoldfile) pnode.linenum = linenum; - return pnode; - } - - /** - * symbolIsUnique Arg is a ptr previously returned by addSymbol. - * -------------- Returns true if the line was added to the - * symbol table exactly once with inoldfile true, - * and exactly once with inoldfile false. - */ - boolean symbolIsUnique() { - return (linestate == bothonce); - } - - /** - * showSymbol Prints the line to stdout. - */ - void showSymbol() { - diff.printer.println(line); - } - static String compact(String line){ - // trim and remove return characters - String[] pieces = line.trim().split("\r"); - line = ""; for(String s: pieces) line = line +s; - // Break line on whitespace and compact - pieces = line.split("[ \t\n][ \t\n]*"); - line = ""; for(String s: pieces) line = line + s; - return line; - } - - static int linecompare(String line1, String line2) - { - return compact(line1).compareToIgnoreCase(compact(line2)); - } - -} diff --git a/dap4/d4tests/src/test/java/dap4/test/TestCDMClient.java b/dap4/d4tests/src/test/java/dap4/test/TestCDMClient.java deleted file mode 100644 index 63fea6f332..0000000000 --- a/dap4/d4tests/src/test/java/dap4/test/TestCDMClient.java +++ /dev/null @@ -1,326 +0,0 @@ -/* - * Copyright 2016, University Corporation for Atmospheric Research - * See the LICENSE.txt file for more information. - */ - -package dap4.test; - -import dap4.core.util.DapUtil; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import ucar.nc2.dataset.NetcdfDataset; -import ucar.unidata.util.test.TestDir; -import java.io.File; -import java.io.IOException; -import java.io.StringWriter; -import java.lang.invoke.MethodHandles; -import java.net.MalformedURLException; -import java.net.URL; -import java.util.ArrayList; -import java.util.List; - -/** - * Test Client side access - */ - -public class TestCDMClient extends DapTestCommon { - private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); - - static final boolean DEBUG = false; - - ////////////////////////////////////////////////// - // Constants - - static final String BASEEXTENSION = ".txt"; - static final String INPUTEXTENSION = ".raw"; - - static final String DAP4TAG = "#protocol=dap4"; - - static final String DATADIR = "src/test/data/resources"; // relative to dap4 root - static final String BASELINEDIR = "TestCDMClient/baseline"; - static final String TESTCDMINPUT = "TestCDMClient/testinput"; - static final String TESTFILESINPUT = "testfiles"; - - static final String[] EXCLUDEDFILETESTS = new String[] {"test_sequence_2.syn.raw"}; - - ////////////////////////////////////////////////// - // Type Declarations - - static class TestCase { - static private String root = null; - - static void setRoot(String r) { - root = r; - } - - static String getRoot() { - return root; - } - - ///////////////////////// - - private String title; - private String dataset; - private String ext; - private boolean checksumming; - private String testpath; - private String baselinepath; - private String url; - - TestCase(String url) { - this(url, true); - } - - TestCase(String url, boolean csum) { - try { - URL u = new URL(url); - this.title = u.getPath(); - } catch (MalformedURLException e) { - this.title = "unknown"; - } - this.checksumming = csum; - this.url = url; - try { - URL u = new URL(url); - this.testpath = DapUtil.canonicalpath(u.getPath()); - int i = this.testpath.lastIndexOf('/'); - assert i > 0; - this.dataset = this.testpath.substring(i + 1, this.testpath.length()); - // strip off any raw extension - if (this.dataset.endsWith(INPUTEXTENSION)) - this.dataset = this.dataset.substring(0, this.dataset.length() - INPUTEXTENSION.length()); - this.baselinepath = root + "/" + BASELINEDIR + "/" + this.dataset + INPUTEXTENSION + BASEEXTENSION; - } catch (MalformedURLException e) { - throw new IllegalArgumentException(url); - } - } - - public String getURL() { - return this.url + DAP4TAG; - } - - public String getPath() { - return this.testpath; - } - - public String getDataset() { - return this.dataset; - } - - public String getBaseline() { - return this.baselinepath; - } - - public String getTitle() { - return this.title; - } - - public String toString() { - return this.url; - } - } - - ////////////////////////////////////////////////// - // Instance variables - - // Test cases - - protected List alltestcases = new ArrayList(); - protected List chosentests = new ArrayList(); - - protected String resourceroot = null; - - ////////////////////////////////////////////////// - - @Before - public void setup() throws Exception { - testSetup(); - this.resourceroot = getResourceRoot(); - TestCase.setRoot(resourceroot); - defineAllTestcases(); - chooseTestcases(); - } - - // convert an extension to a file or url prefix - String prefix(String scheme, String ext) { - if (ext.charAt(0) == '.') - ext = ext.substring(1); - if (scheme.startsWith("http")) { - return "http://" + TestDir.dap4TestServer + "/d4ts"; - } else if (scheme.equals("file")) { - if (ext.equals("raw")) - return "file:/" + this.resourceroot + "/" + TESTCDMINPUT; - } - throw new IllegalArgumentException(); - } - - ////////////////////////////////////////////////// - // Define test cases - - void chooseTestcases() { - if (false) { - chosentests = locate("file:", "test_atomic_array.nc.raw"); - prop_visual = true; - prop_baseline = false; - } else { - prop_baseline = false; - for (TestCase tc : alltestcases) { - chosentests.add(tc); - } - } - } - - void defineAllTestcases() { - System.err.printf("pwd=%s%n", System.getProperty("user.dir")); - List matches = new ArrayList<>(); - String dir = TestCase.getRoot() + "/" + TESTCDMINPUT; - TestFilter.filterfiles(dir, matches, "raw"); - for (String f : matches) { - boolean excluded = false; - for (String x : EXCLUDEDFILETESTS) { - if (f.endsWith(x)) { - excluded = true; - break; - } - } - if (!excluded) { - add(f); - } - } - } - - protected void add(String path) { - File f = new File(path); - if (!f.exists()) - System.err.println("Non existent file test case: " + path); - else if (!f.canRead()) - System.err.println("Unreadable file test case: " + path); - String ext = path.substring(path.lastIndexOf('.'), path.length()); - String url = "file://" + path; - try { - URL u = new URL(url); - System.err.printf("Testcase: add: %s path=%s%n", u.toString(), u.getPath()); - } catch (MalformedURLException e) { - System.err.println("Malformed file test case: " + url); - } - TestCase tc = new TestCase(url); - for (TestCase t : this.alltestcases) { - assert !t.getURL().equals(tc.getURL()) : "Duplicate TestCases: " + t; - } - this.alltestcases.add(tc); - } - - ////////////////////////////////////////////////// - // Junit test method - @Test - public void testCDMClient() throws Exception { - for (TestCase testcase : chosentests) { - doOneTest(testcase); - } - System.err.println("*** PASS"); - } - - ////////////////////////////////////////////////// - // Primary test method - void doOneTest(TestCase testcase) throws Exception { - System.err.println("Testcase: " + testcase.getURL()); - System.err.println("Baseline: " + testcase.getBaseline()); - - NetcdfDataset ncfile; - try { - ncfile = openDataset(testcase.getURL()); - } catch (Exception e) { - e.printStackTrace(); - throw new Exception("File open failed: " + testcase.getURL(), e); - } - assert ncfile != null; - - String datasetname = testcase.getDataset(); - String data = dumpdata(ncfile, datasetname); - - if (prop_visual) { - visual(testcase.getTitle() + ".dap", data); - } - String baselinefile = testcase.getBaseline(); - - if (prop_baseline) - writefile(baselinefile, data); - else if (prop_diff) { // compare with baseline - // Read the baseline file(s) - String baselinecontent = readfile(baselinefile); - System.err.println("Comparison: vs " + baselinefile); - Assert.assertTrue("*** FAIL", same(getTitle(), baselinecontent, data)); - } - } - - String dumpmetadata(NetcdfDataset ncfile, String datasetname) throws Exception { - StringWriter sw = new StringWriter(); - StringBuilder args = new StringBuilder("-strict"); - if (datasetname != null) { - args.append(" -datasetname "); - args.append(datasetname); - } - // Print the meta-databuffer using these args to NcdumpW - try { - if (!ucar.nc2.NCdumpW.print(ncfile, args.toString(), sw, null)) - throw new Exception("NcdumpW failed"); - } catch (IOException ioe) { - throw new Exception("NcdumpW failed", ioe); - } - sw.close(); - return sw.toString(); - } - - String dumpdata(NetcdfDataset ncfile, String datasetname) throws Exception { - StringBuilder args = new StringBuilder("-strict -vall"); - if (datasetname != null) { - args.append(" -datasetname "); - args.append(datasetname); - } - StringWriter sw = new StringWriter(); - // Dump the databuffer - sw = new StringWriter(); - try { - if (!ucar.nc2.NCdumpW.print(ncfile, args.toString(), sw, null)) - throw new Exception("NCdumpW failed"); - } catch (IOException ioe) { - ioe.printStackTrace(); - throw new Exception("NCdumpW failed", ioe); - } - sw.close(); - return sw.toString(); - } - - ////////////////////////////////////////////////// - // Utility methods - - // Locate the test cases with given prefix - List locate(String scheme, String s) { - return locate(scheme, s, null); - } - - List locate(String scheme, String s, List list) { - if (list == null) - list = new ArrayList<>(); - int matches = 0; - for (TestCase ct : this.alltestcases) { - if (!ct.getURL().startsWith(scheme)) - continue; - if (ct.getPath().endsWith(s)) { - matches++; - list.add(ct); - } - } - assert matches > 0 : "No such testcase: " + s; - return list; - } - - static boolean report(String msg) { - System.err.println(msg); - return false; - } - -} diff --git a/dap4/d4tests/src/test/java/dap4/test/TestDAP4Client.java b/dap4/d4tests/src/test/java/dap4/test/TestDAP4Client.java deleted file mode 100644 index 8ddca4ec20..0000000000 --- a/dap4/d4tests/src/test/java/dap4/test/TestDAP4Client.java +++ /dev/null @@ -1,406 +0,0 @@ -package dap4.test; - -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import ucar.httpservices.HTTPException; -import ucar.httpservices.HTTPFactory; -import ucar.httpservices.HTTPMethod; -import ucar.nc2.dataset.NetcdfDataset; -import ucar.unidata.util.test.UnitTestCommon; -import java.io.IOException; -import java.io.StringWriter; -import java.lang.invoke.MethodHandles; -import java.util.ArrayList; -import java.util.List; - -/** - * Test OpenDap Server at the NetcdfDataset level - */ -public class TestDAP4Client extends DapTestCommon { - private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); - - static final boolean DEBUG = false; - - static final boolean BROKEN = false; // on/off known broken tests - - static final boolean BUILDBASELINE = false; - - static final boolean NCDUMP = true; // Use NcDumpW instead of NCPrint - - static final String EXTENSION = (NCDUMP ? "ncdump" : "dmp"); - - static final String TESTEXTENSION = "dmr"; - - // Mnemonic - static final boolean HEADERONLY = false; - - ////////////////////////////////////////////////// - // Constants - - static final String SERVLETPATH = "d4ts/testfiles"; - - static final String DATADIR = "src/test/data"; // relative to dap4 root - static final String BASELINEDIR = "TestDAP4Client/baseline"; - - // Define the names of the xfail tests - static final String[] XFAIL_TESTS = {}; - - static boolean isXfailTest(String t) { - for (String s : XFAIL_TESTS) { - if (s.equals(t)) - return true; - } - return false; - } - - ////////////////////////////////////////////////// - // Type Declarations - - static class Server { - public static String SERVLET = "dts"; - public String ip; - public String port; - - public Server(String ip, String port) { - this.ip = ip; - this.port = port; - } - - public String getURL() { - StringBuilder buf = new StringBuilder(); - buf.append("http://"); - buf.append(this.ip); - if (port != null) { - buf.append(":"); - buf.append(this.port); - } - return buf.toString(); - } - - // Return a URL for testing if server is up/down - public String getTestURL() { - StringBuilder baseurl = new StringBuilder().append(getURL()); - baseurl.append("/"); - baseurl.append(SERVLET); - return baseurl.toString(); - } - - } - - static class ClientTest { - static String root = null; - static String server = null; - static String servlet = null; - static int counter = 0; - - boolean checksumming = true; - boolean xfail = false; - boolean headeronly = false; - - String title; - String dataset; // path minus the server url part. - String baselinepath; - String constraint; - int id; - - ClientTest(String dataset) { - this(0, dataset, null); - } - - ClientTest(int id, String datasetpath, String constraint) { - if (constraint == null) - constraint = ""; - // Break off the final file set name - int index = datasetpath.lastIndexOf('/'); - this.dataset = datasetpath.substring(index + 1, datasetpath.length()); - this.title = this.dataset; - this.id = id; - this.constraint = (constraint.length() == 0 ? null : constraint); - this.baselinepath = root + "/" + BASELINEDIR + "/" + dataset; - if (this.constraint != null) - this.baselinepath += ("." + String.valueOf(this.id)); - } - - public ClientTest nochecksum() { - this.checksumming = false; - return this; - } - - public ClientTest xfail() { - this.xfail = true; - return this; - } - - public ClientTest headeronly() { - this.headeronly = true; - return this; - } - - String makeurl() { - String url = this.server + "/" + this.servlet + "/" + this.dataset; - if (constraint != null) - url += ("?" + constraint); - url += "#dap4"; - return url; - } - - public String toString() { - return dataset; - } - } - - ////////////////////////////////////////////////// - // Class variables - - // Order is important; testing reachability is in the order listed - static List SERVERS; - - static { - SERVERS = new ArrayList<>(); - SERVERS.add(new Server("149.165.169.123", "8080")); - SERVERS.add(new Server("remotetest.unidata.ucar.edu", null)); - } - - ////////////////////////////////////////////////// - // Instance variables - - // Test cases - - List alltestcases = new ArrayList(); - List chosentests = new ArrayList(); - - String datasetpath = null; - - Server server = null; - - ////////////////////////////////////////////////// - - @Before - public void setup() throws Exception { - // Find the server to use - this.server = null; - for (Server svc : SERVERS) { - String url = svc.getTestURL(); - try (HTTPMethod method = HTTPFactory.Get(url)) { - try { - int code = method.execute(); - if (code == 200) { - this.server = svc; - System.out.println("Using server url " + url); - break; - } - } catch (HTTPException e) { - this.server = null; - } - } - } - if (this.server == null) - throw new Exception("Cannot locate server"); - defineAllTestcases(this.getResourceDir(), SERVLETPATH, this.server.getURL()); - chooseTestcases(); - if (BUILDBASELINE) - prop_baseline = true; - } - - ////////////////////////////////////////////////// - // Define test cases - - void chooseTestcases() { - if (false) { - chosentests = locate("test_atomic_types.nc"); - prop_baseline = true; - } else { - for (ClientTest tc : alltestcases) { - chosentests.add(tc); - } - } - } - - boolean defineAllTestcases(String root, String servlet, String server) { - boolean what = HEADERONLY; - ClientTest.root = root; - ClientTest.server = server; - ClientTest.servlet = servlet; - alltestcases.add(new ClientTest("test_atomic_array.nc")); - alltestcases.add(new ClientTest("test_atomic_types.nc")); - alltestcases.add(new ClientTest("test_enum.nc")); - alltestcases.add(new ClientTest("test_enum_2.nc")); - alltestcases.add(new ClientTest("test_enum_array.nc")); - alltestcases.add(new ClientTest("test_enum1.nc")); - alltestcases.add(new ClientTest("test_fill.nc")); - alltestcases.add(new ClientTest("test_groups1.nc")); - if (BROKEN) - alltestcases.add(new ClientTest("test_misc1.nc")); // 0 size unlimited - if (BROKEN) - alltestcases.add(new ClientTest("test_one_var.nc")); // 0 size unlimited - alltestcases.add(new ClientTest("test_one_vararray.nc")); - alltestcases.add(new ClientTest("test_opaque.nc")); - alltestcases.add(new ClientTest("test_opaque_array.nc")); - alltestcases.add(new ClientTest("test_struct_array.nc")); - alltestcases.add(new ClientTest("test_struct_nested.nc")); - alltestcases.add(new ClientTest("test_struct_nested3.nc")); - alltestcases.add(new ClientTest("test_struct_type.nc")); - alltestcases.add(new ClientTest("test_struct1.nc")); - alltestcases.add(new ClientTest("test_test.nc")); - if (BROKEN) - alltestcases.add(new ClientTest("test_unlim.nc")); // ? - if (BROKEN) - alltestcases.add(new ClientTest("test_unlim1.nc")); // ? - if (BROKEN) - alltestcases.add(new ClientTest("test_utf8.nc")); // ? - alltestcases.add(new ClientTest("test_vlen1.nc")); - if (BROKEN) - alltestcases.add(new ClientTest("test_vlen2.nc")); // non scalar vlen - if (BROKEN) - alltestcases.add(new ClientTest("test_vlen3.nc")); // non scalar vlen - if (BROKEN) - alltestcases.add(new ClientTest("test_vlen4.nc")); // non scalar vlen - alltestcases.add(new ClientTest("test_vlen5.nc")); - if (BROKEN) - alltestcases.add(new ClientTest("test_vlen6.nc")); // non-scalar vlen - if (BROKEN) - alltestcases.add(new ClientTest("test_vlen7.nc")); // non-scalar vlen - if (BROKEN) - alltestcases.add(new ClientTest("test_vlen8.nc")); // non-scalar vlen - if (BROKEN) - alltestcases.add(new ClientTest("test_vlen9.nc")); // non-scalar - if (BROKEN) - alltestcases.add(new ClientTest("test_vlen10.nc")); // non-scalar - if (BROKEN) - alltestcases.add(new ClientTest("test_vlen11.nc")); // unknown failure - if (BROKEN) - alltestcases.add(new ClientTest("test_zerodim.nc")); // non-scalar seq - alltestcases.add(new ClientTest("tst_fills.nc")); - for (ClientTest test : alltestcases) { - if (what == HEADERONLY) - test.headeronly(); - } - return true; - } - - ////////////////////////////////////////////////// - // Junit test method - - @Test - public void testDAP4Client() throws Exception { - boolean pass = true; - for (ClientTest testcase : chosentests) { - if (!doOneTest(testcase)) - pass = false; - } - Assert.assertTrue("*** Fail: TestDAP4Client", pass); - } - - ////////////////////////////////////////////////// - // Primary test method - - boolean doOneTest(ClientTest testcase) throws Exception { - boolean pass = true; - System.out.println("Testcase: " + testcase.dataset); - String url = testcase.makeurl(); - NetcdfDataset ncfile = null; - try { - ncfile = openDataset(url); - } catch (Exception e) { - System.err.println(testcase.xfail ? "XFail" : "Fail"); - e.printStackTrace(); - return testcase.xfail; - } - String usethisname = UnitTestCommon.extractDatasetname(url, null); - String metadata = (NCDUMP ? ncdumpmetadata(ncfile, usethisname) : null); - if (prop_visual) { - visual(testcase.title + ".dmr", metadata); - } - - String data = null; - if (!testcase.headeronly) { - data = (NCDUMP ? ncdumpdata(ncfile, usethisname) : null); - if (prop_visual) { - visual(testcase.title + ".dap", data); - } - } - - String testoutput = (testcase.headeronly ? metadata : (NCDUMP ? data : metadata + data)); - - String baselinefile = testcase.baselinepath + "." + EXTENSION; - - if (prop_baseline) - writefile(baselinefile, testoutput); - - if (prop_diff) { // compare with baseline - // Read the baseline file(s) - String baselinecontent = readfile(baselinefile); - System.out.println("Comparison: vs " + baselinefile); - pass = pass && same(getTitle(), baselinecontent, testoutput); - System.out.println(pass ? "Pass" : "Fail"); - } - return pass; - } - - - String ncdumpmetadata(NetcdfDataset ncfile, String datasetname) throws Exception { - StringWriter sw = new StringWriter(); - - StringBuilder args = new StringBuilder("-strict"); - if (datasetname != null) { - args.append(" -datasetname "); - args.append(datasetname); - } - // Print the meta-databuffer using these args to NcdumpW - try { - if (!ucar.nc2.NCdumpW.print(ncfile, args.toString(), sw, null)) - throw new Exception("NcdumpW failed"); - } catch (IOException ioe) { - throw new Exception("NcdumpW failed", ioe); - } - sw.close(); - return sw.toString(); - } - - String ncdumpdata(NetcdfDataset ncfile, String datasetname) throws Exception { - StringWriter sw = new StringWriter(); - - StringBuilder args = new StringBuilder("-strict -vall"); - if (datasetname != null) { - args.append(" -datasetname "); - args.append(datasetname); - } - - // Dump the databuffer - sw = new StringWriter(); - try { - if (!ucar.nc2.NCdumpW.print(ncfile, args.toString(), sw, null)) - throw new Exception("NCdumpW failed"); - } catch (IOException ioe) { - ioe.printStackTrace(); - throw new Exception("NCdumpW failed", ioe); - } - sw.close(); - return sw.toString(); - } - - ////////////////////////////////////////////////// - // Utility methods - - - // Locate the test cases with given prefix - List locate(String prefix) { - List results = new ArrayList(); - for (ClientTest ct : this.alltestcases) { - if (!ct.dataset.startsWith(prefix)) - continue; - results.add(ct); - } - return results; - } - - static boolean report(String msg) { - System.err.println(msg); - return false; - } - -} // class TestDAP4Client - diff --git a/dap4/d4tests/src/test/java/dap4/test/TestDSP.java b/dap4/d4tests/src/test/java/dap4/test/TestDSP.java deleted file mode 100644 index c1b1b07c83..0000000000 --- a/dap4/d4tests/src/test/java/dap4/test/TestDSP.java +++ /dev/null @@ -1,351 +0,0 @@ -package dap4.test; - -import dap4.core.data.DSP; -import dap4.core.util.DapContext; -import dap4.core.util.DapUtil; -import dap4.dap4lib.DMRPrinter; -import dap4.dap4lib.DSPPrinter; -import dap4.dap4lib.FileDSP; -import dap4.dap4lib.HttpDSP; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import ucar.unidata.util.test.TestDir; -import java.io.File; -import java.io.PrintWriter; -import java.io.StringWriter; -import java.lang.invoke.MethodHandles; -import java.net.MalformedURLException; -import java.net.URL; -import java.util.ArrayList; -import java.util.List; - -/** - * Test some of the DSP classes: - * AbstractDSP: tested by all the other DSPs - * CDMDSP: tested elsewhere (TestServlet) - * HttpDSP: tested elsewhere (TestCDMClient) - * FileDSP: tested here - * Nc4DSP: tested here - * SynDSP: tested here - * D4DSP: tested because superclass of FileDSP, HttpDSP, and SynDSP - * ThreddsDSP: not directly tested anywhere yet - */ -public class TestDSP extends DapTestCommon { - private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); - - static final boolean DEBUG = false; - static final boolean SHOWTESTCASES = true; - - static final String BASEEXTENSION = "txt"; - - static final String DAP4TAG = "#protocol=dap4"; - - ////////////////////////////////////////////////// - // Constants - - static final String DATADIR = "src/test/data/resources"; // relative to dap4 root - static final String BASELINEDIR = "TestDSP/baseline"; - static final String TESTCDMINPUT = "TestCDMClient/testinput"; - static final String TESTDSPINPUT = "TestDSP/testinput"; - static final String TESTFILESINPUT = "testfiles"; - - static final String[] EXCLUDEDFILETESTS = new String[] {}; - - ////////////////////////////////////////////////// - // Type Declarations - - static class TestCase { - static protected String root = null; - - static void setRoot(String r) { - root = r; - } - - static String getRoot() { - return root; - } - - ///////////////////////// - - private String title; - private String dataset; - private boolean checksumming; - private String testpath; - private String baselinepath; - private String url; - - TestCase(String url) { - this(url, true); - } - - TestCase(String url, boolean csum) { - this.title = dataset; - this.checksumming = csum; - this.url = url; - try { - URL u = new URL(url); - this.testpath = DapUtil.canonicalpath(u.getPath()); - int i = this.testpath.lastIndexOf('/'); - assert i > 0; - this.dataset = this.testpath.substring(i + 1, this.testpath.length()); - // strip off any raw extension - this.baselinepath = root + "/" + BASELINEDIR + "/" + this.dataset + "." + BASEEXTENSION; - } catch (MalformedURLException e) { - throw new IllegalArgumentException(url); - } - } - - public String getURL() { - return this.url + DAP4TAG; - } - - public String getPath() { - return this.testpath; - } - - public String getDataset() { - return this.dataset; - } - - public String getBaseline() { - return this.baselinepath; - } - - public String getTitle() { - return this.title; - } - - public String toString() { - return this.url; - } - } - - ////////////////////////////////////////////////// - // Static variables and methods - - protected DSP dspFor(String surl) { - URL url; - try { - url = new URL(surl); - } catch (MalformedURLException mue) { - throw new IllegalArgumentException("Malformed url: " + surl); - } - String proto = url.getProtocol(); - String path = url.getPath(); - int dot = path.lastIndexOf('.'); - if (dot < 0) - dot = path.length(); - String ext = path.substring(dot, path.length()); - DSP dsp = null; - if ("file".equals(proto)) { - // discriminate on the extensions - if (".raw".equals(ext)) { - dsp = new FileDSP(); - } - } else if ("http".equals(proto) || "https".equals(url.getProtocol())) { - dsp = new HttpDSP(); - } else - throw new IllegalArgumentException("Cannot determine DSP class for: " + surl); - if (DEBUG) - System.err.printf("DSP: %s%n", dsp.getClass().getName()); - return dsp; - } - ////////////////////////////////////////////////// - // Instance variables - - // Test cases - - protected List alltestcases = new ArrayList(); - protected List chosentests = new ArrayList(); - - protected String resourceroot = null; - - ////////////////////////////////////////////////// - - @Before - public void setup() throws Exception { - this.resourceroot = getResourceRoot(); - this.resourceroot = DapUtil.absolutize(this.resourceroot); // handle problem of windows paths - TestCase.setRoot(resourceroot); - defineAllTestcases(); - chooseTestcases(); - } - - // convert an extension to a file or url prefix - String prefix(String scheme, String ext) { - if (ext.charAt(0) == '.') - ext = ext.substring(1); - if (scheme.startsWith("http")) { - return "http://" + TestDir.dap4TestServer + "/d4ts"; - } else if (scheme.equals("file")) { - if (ext.equals("raw")) - return "file:/" + this.resourceroot + "/" + TESTCDMINPUT; - if (ext.equals("syn")) - return "file:/" + this.resourceroot + "/" + TESTDSPINPUT; - if (ext.equals("nc")) - return "file:/" + this.resourceroot + "/" + TESTFILESINPUT; - } - throw new IllegalArgumentException(); - } - - ////////////////////////////////////////////////// - // Define test cases - - void chooseTestcases() { - if (false) { - chosentests = locate("file:", "test_struct_nested3.hdf5.raw"); - prop_visual = true; - prop_baseline = false; - } else { - prop_baseline = false; - for (TestCase tc : alltestcases) { - if (DEBUG) - System.err.printf("Test case: %s%n", tc.dataset); - chosentests.add(tc); - } - } - } - - void defineAllTestcases() { - List matches = new ArrayList<>(); - String dir = TestCase.root + "/" + TESTCDMINPUT; - TestFilter.filterfiles(dir, matches, "raw"); - if (false) { - dir = TestCase.root + "/" + TESTFILESINPUT; - TestFilter.filterfiles(dir, matches, "nc", "syn"); - } - for (String f : matches) { - boolean excluded = false; - for (String x : EXCLUDEDFILETESTS) { - if (f.indexOf(x) >= 0) { - excluded = true; - break; - } - } - if (!excluded) - add("file:/" + f); - } - if (SHOWTESTCASES) { - for (int i = 0; i < this.alltestcases.size(); i++) { - TestCase tc = this.alltestcases.get(i); - System.err.printf("ALLTESTS: %s%n", tc.getURL()); - } - } - } - - protected void add(String url) { - try { - URL u = new URL(url); - File f = new File(u.getPath()); - if (!f.canRead()) { - System.err.println("Unreadable file test case: " + url); - } - } catch (MalformedURLException e) { - System.err.println("Malformed file test case: " + url); - } - String ext = url.substring(url.lastIndexOf('.'), url.length()); - TestCase tc = new TestCase(url); - for (TestCase t : this.alltestcases) { - assert !t.getURL().equals(tc.getURL()) : "Duplicate TestCases: " + t; - } - this.alltestcases.add(tc); - } - - ////////////////////////////////////////////////// - // Junit test method - @Test - public void testDSP() throws Exception { - for (TestCase testcase : chosentests) { - doOneTest(testcase); - } - System.err.println("*** PASS"); - } - - ////////////////////////////////////////////////// - // Primary test method - void doOneTest(TestCase testcase) throws Exception { - System.err.println("Testcase: " + testcase.getURL()); - System.err.println("Baseline: " + testcase.getBaseline()); - - DSP dsp = dspFor(testcase.getURL()); - - dsp.setContext(new DapContext()); - dsp.open(testcase.getURL()); - - String metadata = dumpmetadata(dsp); - if (prop_visual) - visual(testcase.getURL() + ".dmr", metadata); - String data = dumpdata(dsp); - if (prop_visual) - visual(testcase.getURL() + ".dap", data); - - String baselinefile = testcase.getBaseline(); - - String testoutput = metadata + data; - - if (prop_baseline) - writefile(baselinefile, testoutput); - else if (prop_diff) { // compare with baseline - // Read the baseline file(s) - String baselinecontent = readfile(baselinefile); - System.err.println("Comparison: vs " + baselinefile); - Assert.assertTrue("*** FAIL", same(getTitle(), baselinecontent, testoutput)); - } - } - - String dumpmetadata(DSP dsp) throws Exception { - StringWriter sw = new StringWriter(); - PrintWriter pw = new PrintWriter(sw); - // Print the meta-databuffer using these args to NcdumpW - DMRPrinter p = new DMRPrinter(dsp.getDMR(), pw); - p.testprint(); - pw.close(); - sw.close(); - return sw.toString(); - } - - String dumpdata(DSP dsp) throws Exception { - StringWriter sw = new StringWriter(); - PrintWriter pw = new PrintWriter(sw); - // Print the meta-databuffer using these args to NcdumpW - DSPPrinter p = new DSPPrinter(dsp, pw).flag(DSPPrinter.Flags.CONTROLCHAR); - p.print(); - pw.close(); - sw.close(); - return sw.toString(); - } - - ////////////////////////////////////////////////// - // Utility methods - - // Locate the test cases with given prefix - List locate(String scheme, String s) { - return locate(scheme, s, null); - } - - List locate(String scheme, String s, List list) { - if (list == null) - list = new ArrayList<>(); - int matches = 0; - for (TestCase ct : this.alltestcases) { - if (!ct.getURL().startsWith(scheme)) - continue; - if (ct.getPath().endsWith(s)) { - matches++; - list.add(ct); - } - } - assert matches > 0 : "No such testcase: " + s; - return list; - } - - static boolean report(String msg) { - System.err.println(msg); - return false; - } - - -} diff --git a/dap4/d4tests/src/test/java/dap4/test/TestH5Iosp.java b/dap4/d4tests/src/test/java/dap4/test/TestH5Iosp.java deleted file mode 100644 index 1f97677c3b..0000000000 --- a/dap4/d4tests/src/test/java/dap4/test/TestH5Iosp.java +++ /dev/null @@ -1,287 +0,0 @@ -package dap4.test; - -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.junit.experimental.categories.Category; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import ucar.nc2.dataset.NetcdfDataset; -import ucar.unidata.util.test.category.NotJenkins; -import java.io.File; -import java.io.IOException; -import java.io.StringWriter; -import java.lang.invoke.MethodHandles; -import java.math.BigInteger; -import java.nio.ByteOrder; -import java.util.ArrayList; -import java.util.List; - -@Category(NotJenkins.class) -public class TestH5Iosp extends DapTestCommon { - private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); - - static protected final boolean DEBUG = false; - - static protected final boolean NCDUMP = true; - - static protected final Mode mode = Mode.BOTH; - - ////////////////////////////////////////////////// - // Constants - - static protected String DATADIR = "src/test/data"; // relative to dap4 root - static protected String TESTDATADIR = DATADIR + "/resources/"; - static protected String BASELINEDIR = DATADIR + "/resources/TestIosp/baseline"; - static protected String TESTINPUTDIR = DATADIR + "/resources/testfiles"; - - static protected final BigInteger MASK = new BigInteger("FFFFFFFFFFFFFFFF", 16); - - ////////////////////////////////////////////////// - // Type Declarations - - static protected class H5IospTest { - static String root = null; - String title; - String dataset; - String testinputpath; - String baselinepath; - - H5IospTest(String dataset) { - this.title = dataset; - this.dataset = dataset; - this.testinputpath = root + "/" + TESTINPUTDIR + "/" + dataset; - this.baselinepath = root + "/" + BASELINEDIR + "/" + dataset + ".hdf5"; - } - - public String toString() { - return dataset; - } - } - - static protected enum Mode { - DMR, DATA, BOTH; - } - - ////////////////////////////////////////////////// - // Instance variables - - // Misc variables - protected boolean isbigendian = ByteOrder.nativeOrder() == ByteOrder.BIG_ENDIAN; - - // Test cases - - protected List alltestcases = new ArrayList(); - - protected List chosentests = new ArrayList(); - - protected String datasetpath = null; - - protected String testroot = null; - - ////////////////////////////////////////////////// - @Before - public void setup() throws Exception { - this.testroot = getTestFilesDir(); - File f = new File(testroot + "/" + BASELINEDIR); - if (!f.exists()) - f.mkdir(); - this.datasetpath = this.testroot + "/" + DATADIR; - defineAllTestcases(this.testroot); - chooseTestcases(); - } - - protected String getTestFilesDir() { - return TESTINPUTDIR; - } - - ////////////////////////////////////////////////// - // Define test cases - - void chooseTestcases() { - if (false) { - chosentests = locate("test_enum.nc"); - // chosentests.add(new H5IospTest("test_test.nc")); - } else { - for (H5IospTest tc : alltestcases) { - chosentests.add(tc); - } - } - } - - void defineAllTestcases(String root) { - H5IospTest.root = root; - this.alltestcases.add(new H5IospTest("test_one_var.nc")); - this.alltestcases.add(new H5IospTest("test_one_vararray.nc")); - this.alltestcases.add(new H5IospTest("test_atomic_types.nc")); - this.alltestcases.add(new H5IospTest("test_atomic_array.nc")); - this.alltestcases.add(new H5IospTest("test_enum.nc")); - this.alltestcases.add(new H5IospTest("test_enum_array.nc")); - this.alltestcases.add(new H5IospTest("test_struct_type.nc")); - this.alltestcases.add(new H5IospTest("test_struct_array.nc")); - this.alltestcases.add(new H5IospTest("test_struct_nested.nc")); - this.alltestcases.add(new H5IospTest("test_vlen1.nc")); - this.alltestcases.add(new H5IospTest("test_vlen2.nc")); - this.alltestcases.add(new H5IospTest("test_vlen3.nc")); - this.alltestcases.add(new H5IospTest("test_vlen4.nc")); - this.alltestcases.add(new H5IospTest("test_vlen5.nc")); - } - - - ////////////////////////////////////////////////// - // Junit test methods - - @Test - public void testH5Iosp() throws Exception { - for (H5IospTest testcase : chosentests) { - if (!doOneTest(testcase)) { - Assert.assertTrue(false); - } - } - } - - ////////////////////////////////////////////////// - // Primary test method - boolean doOneTest(H5IospTest testcase) throws Exception { - boolean pass = true; - - System.out.println("Testcase: " + testcase.testinputpath); - - NetcdfDataset ncfile = openDataset(testcase.testinputpath); - - String metadata = null; - String data = null; - if (mode == Mode.DMR || mode == Mode.BOTH) { - metadata = (NCDUMP ? ncdumpmetadata(ncfile, testcase.dataset) : null); - if (prop_visual) - visual("Meta Data: ", metadata); - } - if (mode == Mode.DATA || mode == Mode.BOTH) { - data = (NCDUMP ? ncdumpdata(ncfile, testcase.dataset) : null); - if (prop_visual) - visual("Data: ", data); - } - - String baselinefile = String.format("%s", testcase.baselinepath); - if (prop_baseline) { - if (mode == Mode.DMR || mode == Mode.BOTH) - writefile(baselinefile + ".dmr", metadata); - if (mode == Mode.DATA || mode == Mode.BOTH) - writefile(baselinefile + ".dap", data); - } else if (prop_diff) { // compare with baseline - String baselinecontent = null; - if (mode == Mode.DMR || mode == Mode.BOTH) { - // Read the baseline file(s) - System.out.println("DMR Comparison:"); - baselinecontent = readfile(baselinefile + ".dmr"); - pass = pass && same(getTitle(), baselinecontent, metadata); - System.out.println(pass ? "Pass" : "Fail"); - } - if (mode == Mode.DATA || mode == Mode.BOTH) { - System.out.println("DATA Comparison:"); - baselinecontent = readfile(baselinefile + ".dap"); - pass = pass && same(getTitle(), baselinecontent, data); - System.out.println(pass ? "Pass" : "Fail"); - } - } - return pass; - } - - ////////////////////////////////////////////////// - // Utility methods - - boolean report(String msg) { - System.err.println(msg); - prop_generate = false; - return false; - } - - - // Locate the test cases with given prefix - List locate(String prefix) { - List results = new ArrayList(); - for (H5IospTest ct : this.alltestcases) { - if (ct.dataset.startsWith(prefix)) - results.add(ct); - } - return results; - } - ////////////////////////////////////////////////// - // Stand alone - - static public void main(String[] argv) { - try { - new TestH5Iosp().testH5Iosp(); - } catch (Exception e) { - System.err.println("*** FAIL"); - e.printStackTrace(); - System.exit(1); - } - System.err.println("*** PASS"); - System.exit(0); - }// main - - ////////////////////////////////////////////////// - // Dump methods - - String ncdumpmetadata(NetcdfDataset ncfile, String datasetname) { - boolean ok = false; - String metadata = null; - StringWriter sw = new StringWriter(); - - StringBuilder args = new StringBuilder("-strict"); - if (datasetname != null) { - args.append(" -datasetname "); - args.append(datasetname); - } - - // Print the meta-databuffer using these args to NcdumpW - ok = false; - try { - ok = ucar.nc2.NCdumpW.print(ncfile, args.toString(), sw, null); - } catch (IOException ioe) { - ioe.printStackTrace(); - ok = false; - } - try { - sw.close(); - } catch (IOException e) { - } - if (!ok) { - System.err.println("NcdumpW failed"); - System.exit(1); - } - return shortenFileName(sw.toString(), ncfile.getLocation()); - } - - String ncdumpdata(NetcdfDataset ncfile, String datasetname) { - boolean ok = false; - StringWriter sw = new StringWriter(); - - StringBuilder args = new StringBuilder("-strict -vall"); - if (datasetname != null) { - args.append(" -datasetname "); - args.append(datasetname); - } - // Dump the databuffer - sw = new StringWriter(); - ok = false; - try { - ok = ucar.nc2.NCdumpW.print(ncfile, args.toString(), sw, null); - } catch (IOException ioe) { - ioe.printStackTrace(); - ok = false; - } - try { - sw.close(); - } catch (IOException e) { - } ; - if (!ok) { - System.err.println("NcdumpW failed"); - System.exit(1); - } - return shortenFileName(sw.toString(), ncfile.getLocation()); - } - -} - diff --git a/dap4/d4tests/src/test/java/dap4/test/TestHyrax.java b/dap4/d4tests/src/test/java/dap4/test/TestHyrax.java deleted file mode 100644 index 3dfa0006ce..0000000000 --- a/dap4/d4tests/src/test/java/dap4/test/TestHyrax.java +++ /dev/null @@ -1,393 +0,0 @@ -package dap4.test; - -import dap4.core.util.DapUtil; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Ignore; -import org.junit.Test; -import org.junit.experimental.categories.Category; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import ucar.nc2.dataset.NetcdfDataset; -import ucar.unidata.util.test.UnitTestCommon; -import ucar.unidata.util.test.category.NotJenkins; -import ucar.unidata.util.test.category.NotPullRequest; -import java.io.IOException; -import java.io.StringWriter; -import java.lang.invoke.MethodHandles; -import java.util.ArrayList; -import java.util.List; - -/** - * Test OpenDap Server at the NetcdfDataset level - */ -@Ignore -public class TestHyrax extends DapTestCommon { - private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); - - static final boolean DEBUG = false; - - static final boolean NCDUMP = true; // Use NcDumpW instead of NCPrint - - static final String EXTENSION = (NCDUMP ? "ncdump" : "dmp"); - - static final String TESTEXTENSION = "dmr"; - - // Mnemonic - static final boolean HEADERONLY = false; - - static final String IP = "ec2-54-204-231-163"; - ////////////////////////////////////////////////// - // Constants - - static final String DATADIR = "src/test/data"; // relative to dap4 root - static final String TESTDATADIR = DATADIR + "/resources/TestHyrax"; - static final String BASELINEDIR = TESTDATADIR + "/baseline"; - - // Define the names of the xfail tests - static final String[] XFAIL_TESTS = {"test_struct_array.nc"}; - - // Order is important; testing reachability is in the order - // listed - static final String[] SOURCES = - new String[] {"hyrax", "http://" + IP + ".compute-1.amazonaws.com:8080/opendap/data/reader/dap4/dap4.html", - "dap4://" + IP + ".compute-1.amazonaws.com:8080/opendap/data/reader/dap4"}; - - static boolean isXfailTest(String t) { - for (String s : XFAIL_TESTS) { - if (s.equals(t)) - return true; - } - return false; - } - - ////////////////////////////////////////////////// - // Type Declarations - - static class Source { - public String name; - public String testurl; - public String prefix; - - public Source(String name, String testurl, String prefix) { - this.name = name; - this.prefix = prefix; - this.testurl = testurl; - } - } - - static class ClientTest { - static String root = null; - static String server = null; - static int counter = 0; - - boolean checksumming = true; - boolean xfail = false; - boolean headeronly = false; - - String title; - String dataset; // path minus the server url part. - String datasetpath; // Hyrax test databuffer is segregated into multiple directories - String baselinepath; - String constraint; - int id; - - ClientTest(String dataset) { - this(0, dataset, null); - } - - ClientTest(int id, String datasetpath, String constraint) { - // Break off the final file set name - int index = datasetpath.lastIndexOf('/'); - this.dataset = datasetpath.substring(index + 1, datasetpath.length()); - this.datasetpath = datasetpath; - this.title = this.dataset; - this.id = id; - this.constraint = (constraint.length() == 0 ? null : constraint); - this.baselinepath = root + "/" + BASELINEDIR + "/" + dataset; - if (this.constraint != null) - this.baselinepath += ("." + String.valueOf(this.id)); - } - - public ClientTest nochecksum() { - this.checksumming = false; - return this; - } - - public ClientTest xfail() { - this.xfail = true; - return this; - } - - public ClientTest headeronly() { - this.headeronly = true; - return this; - } - - String makeurl() { - String url = url = server + "/" + datasetpath; - if (constraint != null) - url += ("?" + constraint); - return url; - } - - public String toString() { - return dataset; - } - } - - ////////////////////////////////////////////////// - // Instance variables - - // Test cases - - List alltestcases = new ArrayList(); - List chosentests = new ArrayList(); - - String resourceroot = null; - String datasetpath = null; - - String sourceurl = null; - - ////////////////////////////////////////////////// - - @Before - public void setup() throws Exception { - this.resourceroot = getResourceRoot(); - this.resourceroot = DapUtil.absolutize(this.resourceroot); // handle problem of windows paths - System.out.println("Using source url " + this.sourceurl); - defineAllTestcases(this.resourceroot, this.sourceurl); - chooseTestcases(); - } - - ////////////////////////////////////////////////// - // Define test cases - - void chooseTestcases() { - if (false) { - chosentests = locate("dmr-testsuite/test_array_7.xml"); - } else { - for (ClientTest tc : alltestcases) { - chosentests.add(tc); - } - } - } - - boolean defineAllTestcases(String root, String server) { - - boolean what = HEADERONLY; - - ClientTest.root = root; - ClientTest.server = server; - if (false) { - alltestcases.add(new ClientTest(1, "D4-xml/DMR_4.xml", "b1")); - } - if (false) { - alltestcases.add(new ClientTest("test_simple_1.dmr")); - // deleted: alltestcases.add(new TestCase("dmr-testsuite/testall.xml")); - } - if (false) { - alltestcases.add(new ClientTest("dmr-testsuite/test_array_1.xml")); - alltestcases.add(new ClientTest("dmr-testsuite/test_array_2.xml")); - strings: alltestcases.add(new ClientTest("dmr-testsuite/test_array_3.xml")); - alltestcases.add(new ClientTest("dmr-testsuite/test_array_4.xml")); - alltestcases.add(new ClientTest("dmr-testsuite/test_array_5.xml")); - alltestcases.add(new ClientTest("dmr-testsuite/test_array_6.xml")); - alltestcases.add(new ClientTest("dmr-testsuite/test_array_7.xml")); - alltestcases.add(new ClientTest("dmr-testsuite/test_array_8.xml")); - alltestcases.add(new ClientTest("dmr-testsuite/test_array_10.xml")); - alltestcases.add(new ClientTest("dmr-testsuite/test_array_11.xml")); - - } - if (false) { - alltestcases.add(new ClientTest("dmr-testsuite/test_simple_1.xml")); - alltestcases.add(new ClientTest("dmr-testsuite/test_simple_2.xml")); - alltestcases.add(new ClientTest("dmr-testsuite/test_simple_3.xml")); - alltestcases.add(new ClientTest("dmr-testsuite/test_simple_4.xml")); - alltestcases.add(new ClientTest("dmr-testsuite/test_simple_5.xml")); - alltestcases.add(new ClientTest("dmr-testsuite/test_simple_6.xml")); - // sequence: alltestcases.add(new TestCase("dmr-testsuite/test_simple_7.xml")); - // sequence: alltestcases.add(new TestCase("dmr-testsuite/test_simple_8.xml")); - alltestcases.add(new ClientTest("dmr-testsuite/test_simple_9.xml")); - alltestcases.add(new ClientTest("dmr-testsuite/test_simple_9.1.xml")); - alltestcases.add(new ClientTest("dmr-testsuite/test_simple_10.xml")); - } - if (false) { - // alltestcases.add(new TestCase("D4-xml/DMR_0.1.xml")); needs fixing - alltestcases.add(new ClientTest("D4-xml/DMR_0.xml")); - alltestcases.add(new ClientTest("D4-xml/DMR_1.xml")); - alltestcases.add(new ClientTest("D4-xml/DMR_2.xml")); - alltestcases.add(new ClientTest("D4-xml/DMR_2.1.xml")); - alltestcases.add(new ClientTest("D4-xml/DMR_3.xml")); - alltestcases.add(new ClientTest("D4-xml/DMR_3.1.xml")); - alltestcases.add(new ClientTest("D4-xml/DMR_3.2.xml")); - alltestcases.add(new ClientTest("D4-xml/DMR_3.3.xml")); - alltestcases.add(new ClientTest("D4-xml/DMR_3.4.xml")); - alltestcases.add(new ClientTest("D4-xml/DMR_3.5.xml")); - alltestcases.add(new ClientTest("D4-xml/DMR_4.xml")); - alltestcases.add(new ClientTest("D4-xml/DMR_4.1.xml")); - alltestcases.add(new ClientTest("D4-xml/DMR_5.xml")); - alltestcases.add(new ClientTest("D4-xml/DMR_5.1.xml")); - // serial: alltestcases.add(new TestCase("D4-xml/DMR_6.xml")); - // serial: alltestcases.add(new TestCase("D4-xml/DMR_6.1.xml")); - // serial: alltestcases.add(new TestCase("D4-xml/DMR_6.2.xml")); - alltestcases.add(new ClientTest("D4-xml/DMR_7.xml")); - alltestcases.add(new ClientTest("D4-xml/DMR_7.1.xml")); - alltestcases.add(new ClientTest("D4-xml/DMR_7.2.xml")); - alltestcases.add(new ClientTest("D4-xml/DMR_7.3.xml")); - alltestcases.add(new ClientTest("D4-xml/DMR_7.4.xml")); - alltestcases.add(new ClientTest("D4-xml/DMR_7.5.xml")); - alltestcases.add(new ClientTest("D4-xml/DMR_8.xml")); - } - - if (false) { - alltestcases.add(new ClientTest("dmr-testsuite/test_simple_3_error_1.xml").xfail()); - alltestcases.add(new ClientTest("dmr-testsuite/test_simple_3_error_2.xml").xfail()); - alltestcases.add(new ClientTest("dmr-testsuite/test_simple_3_error_3.xml").xfail()); - } - for (ClientTest test : alltestcases) { - if (what == HEADERONLY) - test.headeronly(); - } - return true; - } - - ////////////////////////////////////////////////// - // Junit test method - - @Test - @Category({NotJenkins.class, NotPullRequest.class}) - public void testHyrax() throws Exception { - boolean pass = true; - for (ClientTest testcase : chosentests) { - if (!doOneTest(testcase)) - pass = false; - } - Assert.assertTrue("*** Fail: TestHyrax", pass); - } - - ////////////////////////////////////////////////// - // Primary test method - boolean doOneTest(ClientTest testcase) throws Exception { - boolean pass = true; - System.out.println("Testcase: " + testcase.dataset); - String url = testcase.makeurl(); - NetcdfDataset ncfile = null; - try { - ncfile = openDataset(url); - } catch (Exception e) { - System.err.println(testcase.xfail ? "XFail" : "Fail"); - e.printStackTrace(); - return testcase.xfail; - } - String usethisname = UnitTestCommon.extractDatasetname(url, null); - String metadata = (NCDUMP ? ncdumpmetadata(ncfile, usethisname) : null); - if (prop_visual) { - visual(testcase.title + ".dmr", metadata); - } - - String data = null; - if (!testcase.headeronly) { - data = (NCDUMP ? ncdumpdata(ncfile, usethisname) : null); - if (prop_visual) { - visual(testcase.title + ".dap", data); - } - } - - String testoutput = (testcase.headeronly ? metadata : (NCDUMP ? data : metadata + data)); - - String baselinefile = testcase.baselinepath + "." + EXTENSION; - - if (prop_baseline) - writefile(baselinefile, testoutput); - - if (prop_diff) { // compare with baseline - // Read the baseline file(s) - String baselinecontent = readfile(baselinefile); - System.out.println("Comparison: vs " + baselinefile); - pass = pass && same(getTitle(), baselinecontent, testoutput); - System.out.println(pass ? "Pass" : "Fail"); - } - return pass; - } - - - String ncdumpmetadata(NetcdfDataset ncfile, String datasetname) throws Exception { - StringWriter sw = new StringWriter(); - - StringBuilder args = new StringBuilder("-strict"); - if (datasetname != null) { - args.append(" -datasetname "); - args.append(datasetname); - } - // Print the meta-databuffer using these args to NcdumpW - try { - if (!ucar.nc2.NCdumpW.print(ncfile, args.toString(), sw, null)) - throw new Exception("NcdumpW failed"); - } catch (IOException ioe) { - throw new Exception("NcdumpW failed", ioe); - } - sw.close(); - return sw.toString(); - } - - String ncdumpdata(NetcdfDataset ncfile, String datasetname) throws Exception { - StringWriter sw = new StringWriter(); - - StringBuilder args = new StringBuilder("-strict -vall"); - if (datasetname != null) { - args.append(" -datasetname "); - args.append(datasetname); - } - - // Dump the databuffer - sw = new StringWriter(); - try { - if (!ucar.nc2.NCdumpW.print(ncfile, args.toString(), sw, null)) - throw new Exception("NCdumpW failed"); - } catch (IOException ioe) { - ioe.printStackTrace(); - throw new Exception("NCdumpW failed", ioe); - } - sw.close(); - return sw.toString(); - } - - ////////////////////////////////////////////////// - // Utility methods - - - // Locate the test cases with given prefix - List locate(String prefix) { - List results = new ArrayList(); - for (ClientTest ct : this.alltestcases) { - if (!ct.datasetpath.startsWith(prefix)) - continue; - results.add(ct); - } - return results; - } - - static boolean report(String msg) { - System.err.println(msg); - return false; - } - - - ////////////////////////////////////////////////// - // Stand alone - - static public void main(String[] argv) { - try { - new TestHyrax().testHyrax(); - } catch (Exception e) { - System.err.println("*** FAIL"); - e.printStackTrace(); - System.exit(1); - } - System.err.println("*** PASS"); - System.exit(0); - }// main - -} // class TestHyrax - diff --git a/dap4/d4tests/src/test/java/dap4/test/TestNc4Iosp.java b/dap4/d4tests/src/test/java/dap4/test/TestNc4Iosp.java deleted file mode 100644 index 74172ef4df..0000000000 --- a/dap4/d4tests/src/test/java/dap4/test/TestNc4Iosp.java +++ /dev/null @@ -1,287 +0,0 @@ -package dap4.test; - -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.OutputStreamWriter; -import java.lang.invoke.MethodHandles; -import java.math.BigInteger; -import java.nio.ByteOrder; -import java.nio.charset.StandardCharsets; -import java.util.ArrayList; -import java.util.List; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.junit.experimental.categories.Category; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import ucar.nc2.dataset.NetcdfDataset; -import ucar.unidata.util.test.category.NotPullRequest; - -@Category(NotPullRequest.class) -public class TestNc4Iosp extends DapTestCommon { - private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); - - static protected final boolean DEBUG = false; - - static protected final boolean NCDUMP = true; - - static protected final Mode mode = Mode.BOTH; - - static String previousJnaEncoding = System.getProperty("jna.encoding"); - - ////////////////////////////////////////////////// - // Constants - - static protected final String RESOURCEPATH = "/src/test/data/resources"; // wrt getTestInputFilesDIr - static protected final String TESTINPUTDIR = "/testfiles"; - static protected final String BASELINEDIR = "/TestIosp/baseline"; - - static protected final BigInteger MASK = new BigInteger("FFFFFFFFFFFFFFFF", 16); - - ////////////////////////////////////////////////// - // Type Declarations - - static protected class Nc4IospTest { - static String inputroot = null; - static String baselineroot = null; - - static public void setRoots(String input, String baseline) { - inputroot = input; - baselineroot = baseline; - } - - String title; - String dataset; - String testinputpath; - String baselinepath; - - Nc4IospTest(String dataset) { - this.title = dataset; - this.dataset = dataset; - this.testinputpath = canonjoin(this.inputroot, dataset); - this.baselinepath = canonjoin(this.baselineroot, dataset) + ".nc4"; - } - - public String toString() { - return dataset; - } - } - - static protected enum Mode { - DMR, DATA, BOTH; - } - - ////////////////////////////////////////////////// - // Instance variables - - // Misc variables - protected boolean isbigendian = ByteOrder.nativeOrder() == ByteOrder.BIG_ENDIAN; - - // Test cases - - protected List alltestcases = new ArrayList(); - - protected List chosentests = new ArrayList(); - - protected String datasetpath = null; - - protected String root = null; - - ////////////////////////////////////////////////// - - @Before - public void setup() throws Exception { - this.root = getResourceRoot(); - testSetup(); - Nc4IospTest.setRoots(canonjoin(getResourceRoot(), TESTINPUTDIR), canonjoin(getResourceRoot(), BASELINEDIR)); - defineAllTestcases(); - chooseTestcases(); - } - - protected String getTestFilesDir() { - return ""; - } - - ////////////////////////////////////////////////// - // Define test cases - - void chooseTestcases() { - if (false) { - chosentests = locate("test_struct_array.nc"); - prop_visual = true; - prop_debug = true; - // chosentests.add(new Nc4IospTest("test_test.nc")); - } else { - prop_baseline = false; - for (Nc4IospTest tc : alltestcases) { - chosentests.add(tc); - } - } - } - - void defineAllTestcases() { - this.alltestcases.add(new Nc4IospTest("test_one_var.nc")); - this.alltestcases.add(new Nc4IospTest("test_one_vararray.nc")); - this.alltestcases.add(new Nc4IospTest("test_atomic_types.nc")); - this.alltestcases.add(new Nc4IospTest("test_atomic_array.nc")); - this.alltestcases.add(new Nc4IospTest("test_enum.nc")); - this.alltestcases.add(new Nc4IospTest("test_enum_array.nc")); - this.alltestcases.add(new Nc4IospTest("test_struct_type.nc")); - this.alltestcases.add(new Nc4IospTest("test_struct_array.nc")); - this.alltestcases.add(new Nc4IospTest("test_struct_nested.nc")); - this.alltestcases.add(new Nc4IospTest("test_vlen1.nc")); - this.alltestcases.add(new Nc4IospTest("test_vlen2.nc")); - this.alltestcases.add(new Nc4IospTest("test_vlen3.nc")); - this.alltestcases.add(new Nc4IospTest("test_vlen4.nc")); - this.alltestcases.add(new Nc4IospTest("test_vlen5.nc")); - } - - - ////////////////////////////////////////////////// - // Junit test methods - - @Test - public void testNc4Iosp() throws Exception { - for (Nc4IospTest testcase : chosentests) { - doOneTest(testcase); - } - } - - ////////////////////////////////////////////////// - // Primary test method - void doOneTest(Nc4IospTest testcase) throws Exception { - System.err.println("Testcase: " + testcase.testinputpath); - - NetcdfDataset ncfile = openDataset(testcase.testinputpath); - - String metadata = null; - String data = null; - if (mode == Mode.DMR || mode == Mode.BOTH) { - metadata = (NCDUMP ? ncdumpmetadata(ncfile, testcase.dataset) : null); - if (prop_visual) - visual("Meta Data: ", metadata); - } - if (mode == Mode.DATA || mode == Mode.BOTH) { - data = (NCDUMP ? ncdumpdata(ncfile, testcase.dataset) : null); - if (prop_visual) - visual("Data: ", data); - } - - String baselinefile = String.format("%s", testcase.baselinepath); - System.err.println("Testpath: " + testcase.testinputpath); - System.err.println("Baseline: " + baselinefile); - if (prop_baseline) { - if (mode == Mode.DMR || mode == Mode.BOTH) - writefile(baselinefile + ".dmr", metadata); - if (mode == Mode.DATA || mode == Mode.BOTH) - writefile(baselinefile + ".dap", data); - } else if (prop_diff) { // compare with baseline - String baselinecontent = null; - if (mode == Mode.DMR || mode == Mode.BOTH) { - // Read the baseline file(s) - System.err.println("DMR Comparison:"); - try { - baselinecontent = readfile(baselinefile + ".dmr"); - boolean pass = same(getTitle(), baselinecontent, metadata); - Assert.assertTrue("***Fail", pass); - } catch (IOException ioe) { - Assert.assertTrue("baselinefile" + ".dmr: " + ioe.getMessage(), false); - } - } - if (mode == Mode.DATA || mode == Mode.BOTH) { - System.err.println("DATA Comparison:"); - try { - baselinecontent = readfile(baselinefile + ".dap"); - Assert.assertTrue("***Data Fail", same(getTitle(), baselinecontent, data)); - - } catch (IOException ioe) { - Assert.assertTrue("baselinefile" + ".dap: " + ioe.getMessage(), false); - } - } - } - } - - ////////////////////////////////////////////////// - // Utility methods - - boolean report(String msg) { - System.err.println(msg); - prop_generate = false; - return false; - } - - - // Locate the test cases with given prefix - List locate(String prefix) { - List results = new ArrayList(); - for (Nc4IospTest ct : this.alltestcases) { - if (ct.dataset.startsWith(prefix)) - results.add(ct); - } - return results; - } - - ////////////////////////////////////////////////// - // Dump methods - - String ncdumpmetadata(NetcdfDataset ncfile, String datasetname) { - boolean ok = false; - String metadata = null; - String dump = ""; - - StringBuilder args = new StringBuilder("-strict"); - if (datasetname != null) { - args.append(" -datasetname "); - args.append(datasetname); - } - - // Print the meta-databuffer using these args to NcdumpW - ok = false; - try (ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); - OutputStreamWriter outputStreamWriter = new OutputStreamWriter(byteArrayOutputStream, StandardCharsets.UTF_8)) { - ok = ucar.nc2.NCdumpW.print(ncfile, args.toString(), outputStreamWriter, null); - dump = byteArrayOutputStream.toString(StandardCharsets.UTF_8.name()); - } catch (IOException ioe) { - ioe.printStackTrace(); - ok = false; - } - - if (!ok) { - System.err.println("NcdumpW failed"); - System.exit(1); - } - // return shortenFileName(sw.toString(), ncfile.getLocation()); - return dump; - } - - String ncdumpdata(NetcdfDataset ncfile, String datasetname) { - boolean ok = false; - String dump = ""; - StringBuilder args = new StringBuilder("-strict -vall"); - if (datasetname != null) { - args.append(" -datasetname "); - args.append(datasetname); - } - - // Dump the databuffer - - ok = false; - try (ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); - OutputStreamWriter outputStreamWriter = new OutputStreamWriter(byteArrayOutputStream, StandardCharsets.UTF_8)) { - ok = ucar.nc2.NCdumpW.print(ncfile, args.toString(), outputStreamWriter, null); - dump = byteArrayOutputStream.toString(StandardCharsets.UTF_8.name()); - } catch (IOException ioe) { - ioe.printStackTrace(); - ok = false; - } - - if (!ok) { - System.err.println("NcdumpW failed"); - System.exit(1); - } - // return shortenFileName(sw.toString(), ncfile.getLocation()); - return dump; - } -} - diff --git a/dap4/d4tests/src/test/java/dap4/test/TestParserCE.java b/dap4/d4tests/src/test/java/dap4/test/TestParserCE.java deleted file mode 100644 index 3acb391e0e..0000000000 --- a/dap4/d4tests/src/test/java/dap4/test/TestParserCE.java +++ /dev/null @@ -1,226 +0,0 @@ -/* - * Copyright 2012, UCAR/Unidata. - * See the LICENSE file for more information. - */ - -package dap4.test; - - -import dap4.core.ce.CECompiler; -import dap4.core.ce.CEConstraint; -import dap4.core.ce.parser.CEParserImpl; -import dap4.core.dmr.DMRFactory; -import dap4.core.dmr.DapDataset; -import dap4.core.dmr.parser.DOM4Parser; -import dap4.core.dmr.parser.Dap4Parser; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import java.io.IOException; -import java.lang.invoke.MethodHandles; -import java.util.ArrayList; -import java.util.List; - -public class TestParserCE extends DapTestCommon { - private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); - - ////////////////////////////////////////////////// - // Constants - static final boolean DUMPDMR = false; - static final boolean DMRPARSEDEBUG = false; - static final boolean CEPARSEDEBUG = false; - - static final String TESTCASEDIR = "src/test/data/resources/TestParsers"; // relative to dap4 root - - static final boolean USEDOM = false; - - ////////////////////////////////////////////////// - // Type decls - static class TestSet { - public String dmr; - public String constraint; - public String expected = null; - public String[] debug = null; - public int id = 0; - - public TestSet(int id, String cedmr, String ces, String expected) throws IOException { - this.id = id; - this.dmr = cedmr; - this.constraint = ces; - this.expected = expected; - } - - public TestSet setdebug(String[] debug) { - this.debug = debug; - return this; - } - - public TestSet setdebug(String debug) { - return setdebug(new String[] {debug}); - } - - public String toString() { - return constraint; - } - - } - - ////////////////////////////////////////////////// - // Instance methods - - // All test cases - List alltestsets = new ArrayList<>(); - List chosentests = new ArrayList<>(); - - DapDataset dmr = null; - - ////////////////////////////////////////////////// - @Before - public void setup() { - try { - defineAllTestCases(); - chooseTestcases(); - } catch (IOException ioe) { - ioe.printStackTrace(); - } - } - - ////////////////////////////////////////////////// - // Misc. methods - - protected void chooseTestcases() { - if (false) { - chosentests = locate(7); - assert chosentests.size() > 0 : "Not tests chosen"; - } else { - for (TestSet tc : alltestsets) { - chosentests.add(tc); - } - } - } - - // Locate the test cases - List locate(Object ce) { - List results = new ArrayList<>(); - for (TestSet ct : this.alltestsets) { - if (ce instanceof String) { - if (ct.constraint.equals(ce)) - results.add(ct); - } else if (ce instanceof Integer) { - if (ct.id == ((Integer) ce)) - results.add(ct); - } - } - return results; - } - - protected void defineAllTestCases() throws IOException { - alltestsets.add(new TestSet(1, CE1_DMR, "/a[1]", "/a[1]")); - alltestsets.add(new TestSet(2, CE1_DMR, "/b[10:16]", "/b[10:16]")); - alltestsets.add(new TestSet(3, CE1_DMR, "/c[8:2:15]", "/c[8:2:15]")); - alltestsets.add(new TestSet(4, CE1_DMR, "/a[1];/b[10:16];/c[8:2:15]", "/a[1];/b[10:16];/c[8:2:15]")); - alltestsets - .add(new TestSet(5, CE1_DMR, "/d[1][0:2:2];/a[1];/e[1][0];/f[0][1]", "/d[1][0:2:2];/a[1];/e[1][0];/f[0][1]")); - alltestsets.add(new TestSet(6, CE1_DMR, "/s[0:3][0:2].x;/s[0:3][0:2].y", "/s[0:3][0:2]")); - alltestsets.add(new TestSet(7, CE1_DMR, "/seq|i1<0", "/seq|i1<0")); - alltestsets.add(new TestSet(8, CE1_DMR, "/seq|00,i1<10")); - alltestsets.add(new TestSet(9, CE2_DMR, "vo[1:1][0,0]", "/vo[1][0,0]")); - } - - ////////////////////////////////////////////////// - // Junit test method - - @Test - public void testParserCE() throws Exception { - for (TestSet testset : chosentests) { - if (!doOneTest(testset)) { - Assert.assertTrue(false); - System.exit(1); - } - } - } - - boolean doOneTest(TestSet testset) throws Exception { - boolean pass = true; - - System.out.println("Test Set: " + testset.constraint); - - if (DUMPDMR) { - visual("DMR:", testset.dmr); - } - - // Create the DMR tree - System.out.println("Parsing DMR"); - Dap4Parser parser; - if (!USEDOM) - parser = new DOM4Parser(new DMRFactory()); - if (DMRPARSEDEBUG) - parser.setDebugLevel(1); - boolean parseok = parser.parse(testset.dmr); - if (parseok) - dmr = parser.getDMR(); - if (dmr == null) - parseok = false; - if (!parseok) - throw new Exception("DMR Parse failed"); - System.out.flush(); - System.err.flush(); - - // Iterate over the constraints - String results = ""; - CEConstraint ceroot = null; - System.out.println("constraint: " + testset.constraint); - System.out.flush(); - CEParserImpl ceparser = null; - try { - ceparser = new CEParserImpl(dmr); - if (CEPARSEDEBUG) - ceparser.setDebugLevel(1); - parseok = ceparser.parse(testset.constraint); - CECompiler compiler = new CECompiler(); - ceroot = compiler.compile(dmr, ceparser.getCEAST()); - } catch (Exception e) { - e.printStackTrace(); - parseok = false; - } - if (ceroot == null) - parseok = false; - if (!parseok) - throw new Exception("CE Parse failed"); - - // Dump the parsed CE for comparison purposes - String cedump = ceroot.toConstraintString(); - if (prop_visual) - visual("|" + testset.constraint + "|", cedump); - results += (cedump + "\n"); - if (prop_diff) { // compare with baseline - // Read the baseline file - String baselinecontent = testset.expected; - pass = same(getTitle(), baselinecontent, results); - } - return pass; - } - - - //////////////////////////////////// - // Data for the tests - - String CE1_DMR = "" + " " - + " " + " " + " " + " " - + " " + " " + " " + " " - + " " + " " + " " + " " - + " " + " " + " " + " " - + " " + " " + " " + " " - + " " + " " + " " + " " - + " " + " " + " " + " " - + " " + " " + " " + " " - + ""; - - - String CE2_DMR = "" + " " - + " " + " " + " " + " " + ""; -} diff --git a/dap4/d4tests/src/test/java/dap4/test/TestParserDMR.java b/dap4/d4tests/src/test/java/dap4/test/TestParserDMR.java deleted file mode 100644 index 39b0779c6e..0000000000 --- a/dap4/d4tests/src/test/java/dap4/test/TestParserDMR.java +++ /dev/null @@ -1,244 +0,0 @@ -/* - * Copyright 2012, UCAR/Unidata. - * See the LICENSE file for more information. - */ - -package dap4.test; - -import dap4.core.dmr.DMRFactory; -import dap4.core.dmr.DapDataset; -import dap4.core.dmr.ErrorResponse; -import dap4.core.dmr.parser.DOM4Parser; -import dap4.core.dmr.parser.Dap4Parser; -import dap4.core.dmr.parser.ParseUtil; -import dap4.dap4lib.DMRPrinter; -import org.junit.Assert; -import org.junit.Test; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import java.io.File; -import java.io.PrintWriter; -import java.io.StringWriter; -import java.lang.invoke.MethodHandles; -import java.util.ArrayList; -import java.util.List; - - -public class TestParserDMR extends DapTestCommon { - private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); - - static final boolean PARSEDEBUG = false; - - // Do a special test to compare the dmr parser print output - // to the original input. This will often fail in non-essential - // ways, so it must be verified by hand. - static final boolean BACKCOMPARE = false; - - ////////////////////////////////////////////////// - // Constants - // Define the input set(s) - static protected final String DIR1 = "/TestParsers/dmrset"; // relative to dap4 root - static protected final String DIR2 = "/TestServlet/baseline"; // relative to dap4 root - static protected final String BASELINE = "/TestParsers/baseline"; // relative to dap4 root - - ////////////////////////////////////////////////// - - static protected class TestCase { - static public String resourceroot = null; - - String name; - String dir; - String ext; - String input; - String baseline; - - public TestCase(String dir, String name, String ext) { - this.name = name; - this.dir = dir; - this.ext = ext; - this.input = resourceroot + dir + "/" + name + "." + ext; - this.baseline = resourceroot + BASELINE + "/" + name + "." + "dmp"; - } - } - ////////////////////////////////////////////////// - // Instance methods - - // Test cases - protected List alltestcases = new ArrayList(); - protected List chosentests = new ArrayList(); - protected int flags = ParseUtil.FLAG_NONE; - protected boolean debug = false; - - ////////////////////////////////////////////////// - - public TestParserDMR() { - super(); - setControls(); - defineTestCases(); - chooseTestcases(); - } - - ////////////////////////////////////////////////// - // Misc. methods - - protected void chooseTestcases() { - if (false) { - chosentests = locate("test_struct_nested.hdf5"); - prop_visual = true; - assert chosentests.size() > 0 : "No tests chosen"; - } else { - for (TestCase tc : alltestcases) { - chosentests.add(tc); - } - } - } - - // Locate the test cases with given prefix - List locate(String prefix) { - List results = new ArrayList(); - for (TestCase ct : this.alltestcases) { - if (ct.name.startsWith(prefix)) - results.add(ct); - } - return results; - } - - protected void defineTestCases() { - String root = getResourceRoot(); - TestCase.resourceroot = root; - loadDir(DIR1, "dmr"); - loadDir(DIR2, "dmr"); - } - - void loadDir(String dirsuffix, String... extensions) { - File dir = new File(TestCase.resourceroot + dirsuffix); - File[] filelist = dir.listFiles(); - for (int i = 0; i < filelist.length; i++) { - File file = filelist[i]; - String name = file.getName(); - // check the extension - String match = null; - for (String ext : extensions) { - if (name.endsWith(ext)) { - match = ext; - break; - } - } - if (match != null) { - String basename = name.substring(0, name.length() - (match.length() + 1)); - TestCase ct = new TestCase(dirsuffix, basename, match); - addtestcase(ct); - } - } - } - - protected void addtestcase(TestCase ct) { - if (DEBUG) { - System.err.printf("Adding Test: input=%s%n", ct.input); - if (!new File(ct.input).exists()) - System.err.printf(" +++%s does not exist%n", ct.input); - System.err.printf(" baseline=%s%n", ct.baseline); - if (!new File(ct.baseline).exists()) - System.err.printf(" ***%s does not exist%n", ct.baseline); - System.err.flush(); - } - this.alltestcases.add(ct); - } - - void setControls() { - if (prop_controls == null) - return; - flags = ParseUtil.FLAG_NOCR; // always - for (int i = 0; i < prop_controls.length(); i++) { - char c = prop_controls.charAt(i); - switch (c) { - case 'w': - flags |= ParseUtil.FLAG_TRIMTEXT; - break; - case 'l': - flags |= ParseUtil.FLAG_ELIDETEXT; - break; - case 'e': - flags |= ParseUtil.FLAG_ESCAPE; - break; - case 'T': - flags |= ParseUtil.FLAG_TRACE; - break; - case 'd': - debug = true; - break; - default: - System.err.println("unknown X option: " + c); - break; - } - } - } - - ////////////////////////////////////////////////// - // Junit test method - - @Test - public void testParser() throws Exception { - int ntests = 0; - for (TestCase testcase : chosentests) { - ntests++; - doOneTest(testcase); - } - Assert.assertTrue("***Pass ", true); - } - - void doOneTest(TestCase testcase) throws Exception { - String document; - int i, c; - - String testinput = testcase.input; - String baseline = testcase.baseline; - - System.err.println("Testcase: " + testinput); - System.err.println("Baseline: " + baseline); - System.err.flush(); - - document = readfile(testinput); - - Dap4Parser parser = new DOM4Parser(new DMRFactory()); - if (PARSEDEBUG || debug) - parser.setDebugLevel(1); - - if (!parser.parse(document)) - throw new Exception("DMR Parse failed: " + testinput); - DapDataset dmr = parser.getDMR(); - ErrorResponse err = parser.getErrorResponse(); - if (err != null) - System.err.println("Error response:\n" + err.buildXML()); - if (dmr == null) { - System.err.println("No dataset created"); - return; - } - - // Dump the parsed DMR for comparison purposes - StringWriter sw = new StringWriter(); - PrintWriter pw = new PrintWriter(sw); - DMRPrinter dapprinter = new DMRPrinter(dmr, pw); - dapprinter.testprint(); - pw.close(); - sw.close(); - String testresult = sw.toString(); - - // Read the baseline file - String baselinecontent; - if (BACKCOMPARE) - baselinecontent = document; - else - baselinecontent = readfile(baseline); - if (prop_visual) { - visual("Baseline", baselinecontent); - visual("Output", testresult); - } - - if (prop_baseline) { - writefile(baseline, testresult); - } else if (prop_diff) { // compare with baseline - Assert.assertTrue("Files are different", same(getTitle(), baselinecontent, testresult)); - } - } -} diff --git a/dap4/d4tests/src/test/java/dap4/test/TestPrinter.java b/dap4/d4tests/src/test/java/dap4/test/TestPrinter.java deleted file mode 100644 index d22ff1ac97..0000000000 --- a/dap4/d4tests/src/test/java/dap4/test/TestPrinter.java +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Copyright 2012, UCAR/Unidata. - * See the LICENSE file for more information. - */ - -package dap4.test; - -import dap4.cdm.nc2.DapNetcdfFile; -import dap4.core.dmr.DapDataset; -import dap4.core.util.*; -import dap4.core.data.DSP; -import dap4.dap4lib.DMRPrinter; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import ucar.nc2.*; -import java.io.IOException; -import java.io.PrintWriter; -import java.lang.invoke.MethodHandles; -import java.util.Map; - -/** - * Dump DMR and/or data part of a DSP - */ - -public class TestPrinter { - private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); - - ////////////////////////////////////////////////// - // Constants - - // Could use enumset, but it is so ugly, - // so use good old OR'able flags - static final int NILFLAGS = 0; - static final int PERLINE = 1; // print xml attributes 1 per line - static final int NONAME = 2; // do not print name xml attribute - static final int NONNIL = 4; // print empty xml attributes - - ////////////////////////////////////////////////// - // Instance Variables - - protected NetcdfFile ncfile = null; // dsp can be extracted from this - protected DSP dsp = null; - protected DapDataset dmr = null; - protected PrintWriter writer = null; - protected Map varmap = null; - protected IndentWriter printer = null; - - ////////////////////////////////////////////////// - // Constructor(s) - - public TestPrinter(NetcdfFile ncfile, PrintWriter writer) { - try { - setDataset(ncfile); - } catch (DapException de) { - System.err.println("Bad NetcdfFile"); - System.exit(1); - } - setWriter(writer); - setVarMap(null); - } - - public TestPrinter(DSP dsp, PrintWriter writer) { - try { - setDSP(dsp); - } catch (DapException de) { - System.err.println("Bad DSP"); - System.exit(1); - } - setWriter(writer); - setVarMap(null); - } - - ////////////////////////////////////////////////// - // Accessors - - public void setWriter(PrintWriter writer) { - this.writer = writer; - this.printer = new IndentWriter(writer); - } - - public void setDataset(NetcdfFile ncfile) throws DapException { - this.ncfile = ncfile; - setDSP(((DapNetcdfFile) this.ncfile).getDSP()); - } - - public void setDSP(DSP dsp) throws DapException { - this.dsp = dsp; - this.dmr = dsp.getDMR(); - } - - public void setVarMap(Map map) { - this.varmap = map; - } - - ////////////////////////////////////////////////// - // Print methods - - public void flush() throws IOException { - printer.flush(); - writer.flush(); - } - - /** - * Print the CDM metadata for a NetcdfFile object in DMR format - * - * @throws IOException - */ - - public void print() throws IOException { - printer.setIndent(0); - DMRPrinter dmrprinter = new DMRPrinter(this.dmr, writer); - dmrprinter.print(); - dmrprinter.flush(); - } - -} // class TestPrinter diff --git a/dap4/d4tests/src/test/java/dap4/test/TestSerial.java b/dap4/d4tests/src/test/java/dap4/test/TestSerial.java deleted file mode 100644 index 1bab343587..0000000000 --- a/dap4/d4tests/src/test/java/dap4/test/TestSerial.java +++ /dev/null @@ -1,302 +0,0 @@ -package dap4.test; - -import dap4.core.util.DapUtil; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import ucar.nc2.dataset.NetcdfDataset; -import ucar.unidata.util.test.TestDir; -import ucar.unidata.util.test.UnitTestCommon; -import java.io.IOException; -import java.io.StringWriter; -import java.lang.invoke.MethodHandles; -import java.util.ArrayList; -import java.util.List; - -/** - * Test at the NetcdfDataset level; access .ser files on server. - */ -public class TestSerial extends DapTestCommon { - private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); - - static protected final boolean DEBUG = false; - - static protected final String TESTINPUTDIR = "/testfiles"; - - static protected final boolean NCDUMP = true; // Use NcDumpW instead of D4Print - - static protected final String EXTENSION = (NCDUMP ? "ncdump" : "dmp"); - - static protected final String DAP4TAG = "#dap4"; - - static protected final String[] EMPTY = new String[] {""}; - - ////////////////////////////////////////////////// - // Constants - - static protected final String DATADIR = "src/test/data"; // relative to dap4 root - static protected final String TESTDATADIR = DATADIR + "/resources/TestCDMClient"; - static protected final String BASELINEDIR = TESTDATADIR + "/baseline"; - - static protected final String alpha = "abcdefghijklmnopqrstuvwxyz" + "abcdefghijklmnopqrstuvwxyz".toUpperCase(); - - ////////////////////////////////////////////////// - // Type Declarations - - static protected class ClientTest { - static protected String root = null; - static protected String server = null; - - String title; - String dataset; - String baselinepath; - String[] constraints; - - ClientTest(String dataset) { - this(dataset, EMPTY); - } - - ClientTest(String dataset, String[] constraints) { - this.title = dataset; - this.dataset = dataset; - this.baselinepath = root + "/" + BASELINEDIR + "/" + dataset; - assert constraints != null && constraints.length > 0; - this.constraints = constraints; - } - - String makeurl(String ce) { - StringBuilder url = new StringBuilder(); - url.append("http://"); - url.append(this.server); - url.append("/d4ts"); - url.append("/"); - url.append(TESTINPUTDIR); - url.append("/"); - url.append(this.dataset); - url.append("."); - url.append("nc"); - url.append(DAP4TAG); - if (ce != null && ce.length() > 0) { - url.append("?"); - url.append(DapTestCommon.CONSTRAINTTAG); - url.append("="); - url.append(ce); - } - return url.toString(); - } - - public String toString() { - StringBuilder buf = new StringBuilder(); - buf.append(dataset); - buf.append("{"); - if (constraints != null) - for (int i = 0; i < constraints.length; i++) { - if (i > 0) - buf.append(","); - String ce = constraints[i]; - buf.append(ce == null ? "all" : ce); - } - buf.append("}"); - return buf.toString(); - } - } - - ////////////////////////////////////////////////// - // Instance variables - - // Test cases - - protected List alltestcases = new ArrayList(); - protected List chosentests = new ArrayList(); - - protected String resourceroot = null; - protected String datasetpath = null; - - protected String sourceurl = null; - - ////////////////////////////////////////////////// - - @Before - public void setup() throws Exception { - this.resourceroot = getResourceRoot(); - this.resourceroot = DapUtil.absolutize(this.resourceroot); - this.datasetpath = this.resourceroot + "/" + BASELINEDIR; - // findServer(this.datasetpath); - // this.sourceurl = this.d4tsserver; - this.sourceurl = TestDir.dap4TestServer; - System.out.println("Using source url " + this.sourceurl); - defineAllTestcases(this.resourceroot, this.sourceurl); - chooseTestcases(); - } - - ////////////////////////////////////////////////// - // Define test cases - - void chooseTestcases() { - if (false) { - chosentests = locate("test_atomic_array"); - } else { - for (ClientTest tc : alltestcases) { - chosentests.add(tc); - } - } - } - - void defineAllTestcases(String root, String server) { - ClientTest.root = root; - ClientTest.server = server; - alltestcases.add(new ClientTest("test_one_var")); - alltestcases.add(new ClientTest("test_atomic_types")); - alltestcases.add(new ClientTest("test_atomic_array")); - - } - - ////////////////////////////////////////////////// - // Junit test method - - @Test - public void testSerial() throws Exception { - for (ClientTest testcase : chosentests) { - if (!doOneTest(testcase)) { - Assert.assertTrue(false); - } - } - } - - ////////////////////////////////////////////////// - // Primary test method - boolean doOneTest(ClientTest testcase) throws Exception { - boolean pass = true; - int testcounter = 0; - - System.out.println("Testcase: " + testcase.dataset); - - String[] constraints = testcase.constraints; - for (int i = 0; i < constraints.length; i++) { - String url = testcase.makeurl(constraints[i]); - NetcdfDataset ncfile = null; - try { - ncfile = openDataset(url); - } catch (Exception e) { - throw e; - } - - String usethisname = UnitTestCommon.extractDatasetname(url, null); - String metadata = (NCDUMP ? ncdumpmetadata(ncfile, usethisname) : null); - String data = (NCDUMP ? ncdumpdata(ncfile, usethisname) : null); - - if (prop_visual) { - visual("DMR: " + url, metadata); - visual("DAP: " + url, data); - } - - String testoutput = (NCDUMP ? data : metadata + data); - - String baselinefile = String.format("%s.nc.%s", testcase.baselinepath, EXTENSION); - if (prop_baseline) - writefile(baselinefile, testoutput); - - if (prop_diff) { // compare with baseline - // Read the baseline file(s) - String baselinecontent = readfile(baselinefile); - System.out.println("Comparison:"); - pass = pass && same(getTitle(), baselinecontent, testoutput); - System.out.println(pass ? "Pass" : "Fail"); - } - } - return pass; - } - - ////////////////////////////////////////////////// - // Dump methods - - String ncdumpmetadata(NetcdfDataset ncfile, String datasetname) { - boolean ok = false; - String metadata = null; - StringWriter sw = new StringWriter(); - - StringBuilder args = new StringBuilder("-strict"); - if (datasetname != null) { - args.append(" -datasetname "); - args.append(datasetname); - } - - // Print the meta-databuffer using these args to NcdumpW - ok = false; - try { - ok = ucar.nc2.NCdumpW.print(ncfile, args.toString(), sw, null); - } catch (IOException ioe) { - ioe.printStackTrace(); - ok = false; - } - try { - sw.close(); - } catch (IOException e) { - } ; - if (!ok) { - System.err.println("NcdumpW failed"); - System.exit(1); - } - return sw.toString(); - } - - String ncdumpdata(NetcdfDataset ncfile, String datasetname) { - boolean ok = false; - StringWriter sw = new StringWriter(); - - StringBuilder args = new StringBuilder("-strict -vall"); - if (datasetname != null) { - args.append(" -datasetname "); - args.append(datasetname); - } - - // Dump the databuffer - sw = new StringWriter(); - ok = false; - try { - ok = ucar.nc2.NCdumpW.print(ncfile, args.toString(), sw, null); - } catch (IOException ioe) { - ioe.printStackTrace(); - ok = false; - } - try { - sw.close(); - } catch (IOException e) { - } ; - if (!ok) { - System.err.println("NcdumpW failed"); - System.exit(1); - } - return sw.toString(); - } - - ////////////////////////////////////////////////// - // Utility methods - - - // Locate the test cases with given prefix - ClientTest locate1(String prefix) { - List tests = locate(prefix); - assert tests.size() > 0; - return tests.get(0); - } - - // Locate the test cases with given prefix and optional constraint - List locate(String prefix) { - List results = new ArrayList(); - for (ClientTest ct : this.alltestcases) { - if (!ct.dataset.startsWith(prefix)) - continue; - results.add(ct); - } - return results; - } - - static protected boolean report(String msg) { - System.err.println(msg); - return false; - } - -} // class TestConstraints diff --git a/dap4/grammars/Makefile b/dap4/grammars/Makefile index 8e2617365b..67d679ca09 100644 --- a/dap4/grammars/Makefile +++ b/dap4/grammars/Makefile @@ -1,26 +1,26 @@ -/* -Note: The bison parser has been replaced by a DOM parser+walker. -The bison code is left in the build tree in case it is useful -elsewhere. -*. +#Note: The bison parser has been replaced by a DOM parser+walker. +#The bison code is left in the build tree in case it is useful +#elsewhere. -DAP4TARGET=../d4core/src/main/java/dap4/core/dmr/parser/bison/Dap4BisonParser.java -CETARGET=../d4core/src/main/java/dap4/core/ce/parser/CEBisonParser.java +DAP4TARGET=../src/main/java/dap4/core/dmr/parser/bison/Dap4BisonParser.java + +CETARGET=../src/main/java/dap4/core/ce/parser/CEBisonParser.java .PHONEY: bison -all: bison +all: dap4 ce # Requires bison 3.0 or later -bison: +dap4:: bison -v dap4.y -o Dap4BisonParser.java +# if test -f ${DAP4TARGET} ; then rm ${DAP4TARGET}; fi +# cp Dap4BisonParser.java ${DAP4TARGET} + +ce:: bison -v ce.y -o CEBisonParser.java - if test -f ${DAP4TARGET} ; then rm ${DAP4TARGET}; fi if test -f ${CETARGET} ; then rm ${CETARGET}; fi - cp Dap4BisonParser.java ${DAP4TARGET} cp CEBisonParser.java ${CETARGET} - clean:: rm -fr Dap4BisonParser.java Dap4BisonParser.output diff --git a/dap4/grammars/ce.y b/dap4/grammars/ce.y index 721b333790..96db9cd9ed 100644 --- a/dap4/grammars/ce.y +++ b/dap4/grammars/ce.y @@ -3,15 +3,15 @@ %language "Java" %debug -%error-verbose +%define parse.error verbose /* Comment out in case we are using an older version of bison %define api.push-pull pull */ -%define abstract -%define package {dap4.core.ce.parser} -%define parser_class_name {CEBisonParser} +%define api.parser.abstract +%define api.package {dap4.core.ce.parser} +%define api.parser.class {CEBisonParser} %define throws {ParseException} %define lex_throws {ParseException} @@ -60,7 +60,7 @@ abstract CEAST.SliceList slicelist(CEAST.SliceList list, Slice slice); %type slice subslice %type filter predicate %type dimredef -%type index +%type extent %type relop eqop %type clauselist %type segmentforest @@ -180,19 +180,19 @@ subslicelist: ; subslice: - index /* case 1 */ + extent /* case 1 */ {$$=subslice(1,$1,null,null);} - | index ':' index /* case 2 */ + | extent ':' extent /* case 2 */ {$$=subslice(2,$1,$3,null);} - | index ':' index ':' index /*case 3*/ + | extent ':' extent ':' extent /*case 3*/ {$$=subslice(3,$1,$5,$3);} - | index ':' /* case 4 */ + | extent ':' /* case 4 */ {$$=subslice(4,$1,null,null);} - | index ':' index ':' /* case 5 */ + | extent ':' extent ':' /* case 5 */ {$$=subslice(5,$1,null,$3);} ; -index: LONG ; +extent: LONG ; /* Semantics: The projection in a selection currently cannot have any diff --git a/dap4/d4core/src/main/java/dap4/core/ce/CEAST.java b/dap4/src/main/java/dap4/core/ce/CEAST.java similarity index 100% rename from dap4/d4core/src/main/java/dap4/core/ce/CEAST.java rename to dap4/src/main/java/dap4/core/ce/CEAST.java diff --git a/dap4/d4core/src/main/java/dap4/core/ce/CECompiler.java b/dap4/src/main/java/dap4/core/ce/CECompiler.java similarity index 100% rename from dap4/d4core/src/main/java/dap4/core/ce/CECompiler.java rename to dap4/src/main/java/dap4/core/ce/CECompiler.java diff --git a/dap4/d4core/src/main/java/dap4/core/ce/CEConstraint.java b/dap4/src/main/java/dap4/core/ce/CEConstraint.java similarity index 94% rename from dap4/d4core/src/main/java/dap4/core/ce/CEConstraint.java rename to dap4/src/main/java/dap4/core/ce/CEConstraint.java index 667cded009..c1d92a0a52 100644 --- a/dap4/d4core/src/main/java/dap4/core/ce/CEConstraint.java +++ b/dap4/src/main/java/dap4/core/ce/CEConstraint.java @@ -6,10 +6,9 @@ package dap4.core.ce; import dap4.core.ce.parser.CEParserImpl; -import dap4.core.data.Constraint; -import dap4.core.data.DataCursor; import dap4.core.dmr.*; import dap4.core.dmr.parser.ParseException; +import dap4.core.interfaces.DataCursor; import dap4.core.util.*; import java.util.*; @@ -77,7 +76,7 @@ * inverse of iteration and that is fairly tricky. */ -public class CEConstraint implements Constraint { +public class CEConstraint { ////////////////////////////////////////////////// // Constants @@ -267,22 +266,24 @@ public static CEConstraint getUniversal(DapDataset dmr) { public static void release(DapDataset dmr) { universals.remove(dmr); } - - protected static DataCursor fieldValue(DapVariable sqvar, DapSequence seq, DataCursor record, String field) - throws DapException { - DapVariable dapv = seq.findByName(field); - if (dapv == null) - throw new DapException("Unknown variable in filter: " + field); - if (!dapv.isAtomic()) - throw new DapException("Non-atomic variable in filter: " + field); - if (dapv.getRank() > 0) - throw new DapException("Non-scalar variable in filter: " + field); - int fieldindex = seq.indexByName(field); - DataCursor da = (DataCursor) (record.readField(fieldindex)); - if (da == null) - throw new DapException("No such field: " + field); - return da; - } + /* + * protected static DataCursor fieldValue(DapVariable sqvar, DapSequence seq, DataCursor record, String field) + * throws DapException { + * DapVariable dapv = seq.findByName(field); + * if (dapv == null) + * throw new DapException("Unknown variable in filter: " + field); + * if (!dapv.isAtomic()) + * throw new DapException("Non-atomic variable in filter: " + field); + * if (dapv.getRank() > 0) + * throw new DapException("Non-scalar variable in filter: " + field); + * int fieldindex = seq.indexByName(field); + * DataCursor da = (DataCursor) (record.readField(fieldindex)); + * if (da == null) + * throw new DapException("No such field: " + field); + * return da; + * } + * + */ protected static int compare(Object lvalue, Object rvalue) throws DapException { if (lvalue instanceof String && rvalue instanceof String) @@ -319,7 +320,7 @@ protected Object eval(DapVariable var, DapSequence seq, DataCursor record, CEAST return expr.value; case SEGMENT: - return fieldValue(var, seq, record, expr.name); + return null; // ???return fieldValue(var, seq, record, expr.name); case EXPR: Object lhs = eval(var, seq, record, expr.lhs); @@ -638,36 +639,6 @@ public boolean references(DapNode node) { * } */ - ////////////////////////////////////////////////// - // Projection processing - - /** - * Projection X match - * This is actually rather difficult because it requires - * sort of the inverse of an odometer. For this reason, - * It's implementation is deferred. - */ - - /** - * Projection X Iterator - * This basically returns an odometer that - * will iterate over the appropriate values. - * - * @param var over whose dimensions to iterate - * @throws DapException - */ - /* - * public Odometer - * projectionIterator(DapVariable var) - * throws DapException - * { - * Segment seg = findSegment(var); - * if(seg == null) - * return null; - * return Odometer.factory(seg.slices, seg.dimset, false); - * } - */ - ////////////////////////////////////////////////// // Selection (Filter) processing @@ -947,7 +918,7 @@ protected void computedimensions() throws DapException { if (newdim == null) newdim = dim0; // fill in the undefined last value - slice.setMaxSize(newdim.getSize()); + slice.setMaxSize((int) newdim.getSize()); slice.finish(); Slice newslice = null; if (slice.isConstrained()) { diff --git a/dap4/d4core/src/main/java/dap4/core/ce/Universal.java b/dap4/src/main/java/dap4/core/ce/Universal.java similarity index 100% rename from dap4/d4core/src/main/java/dap4/core/ce/Universal.java rename to dap4/src/main/java/dap4/core/ce/Universal.java diff --git a/dap4/d4core/src/main/java/dap4/core/ce/parser/CEActions.java b/dap4/src/main/java/dap4/core/ce/parser/CEActions.java similarity index 100% rename from dap4/d4core/src/main/java/dap4/core/ce/parser/CEActions.java rename to dap4/src/main/java/dap4/core/ce/parser/CEActions.java diff --git a/dap4/d4core/src/main/java/dap4/core/ce/parser/CEBisonParser.java b/dap4/src/main/java/dap4/core/ce/parser/CEBisonParser.java similarity index 50% rename from dap4/d4core/src/main/java/dap4/core/ce/parser/CEBisonParser.java rename to dap4/src/main/java/dap4/core/ce/parser/CEBisonParser.java index 8a6e4be3d1..61cc21b4a1 100644 --- a/dap4/d4core/src/main/java/dap4/core/ce/parser/CEBisonParser.java +++ b/dap4/src/main/java/dap4/core/ce/parser/CEBisonParser.java @@ -1,9 +1,9 @@ -/* A Bison parser, made by GNU Bison 3.0.4. */ +/* A Bison parser, made by GNU Bison 3.8.2. */ /* * Skeleton implementation for Bison LALR(1) parsers in Java * - * Copyright (C) 2007-2015 Free Software Foundation, Inc. + * Copyright (C) 2007-2015, 2018-2021 Free Software Foundation, Inc. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . */ /* @@ -34,20 +34,26 @@ * version 2.2 of Bison. */ +/* + * DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, + * especially those whose name start with YY_ or yy_. They are + * private implementation details that can be changed or removed. + */ + package dap4.core.ce.parser; -/* First part of user declarations. */ -/* "CEBisonParser.java":37 */ /* lalr1.java:91 */ -/* "CEBisonParser.java":39 */ /* lalr1.java:92 */ + +import java.text.MessageFormat; +import java.util.ArrayList; /* "%code imports" blocks. */ -/* "ce.y":18 */ /* lalr1.java:93 */ +/* "ce.y":18 */ import dap4.core.util.Slice; import dap4.core.dmr.parser.ParseException; import dap4.core.ce.CEAST; -/* "CEBisonParser.java":47 */ /* lalr1.java:93 */ +/* "CEBisonParser.java":51 */ /** * A Bison parser, automatically generated from ce.y. @@ -56,19 +62,20 @@ */ abstract class CEBisonParser { /** Version number for the Bison executable that generated this parser. */ - public static final String bisonVersion = "3.0.4"; + public static final String bisonVersion = "3.8.2"; /** Name of the skeleton that generated this parser. */ public static final String bisonSkeleton = "lalr1.java"; + /** * True if verbose error messages are enabled. */ private boolean yyErrorVerbose = true; /** - * Return whether verbose error messages are enabled. + * Whether verbose error messages are enabled. */ public final boolean getErrorVerbose() { return yyErrorVerbose; @@ -85,28 +92,162 @@ public final void setErrorVerbose(boolean verbose) { + public enum SymbolKind { + S_YYEOF(0), /* "end of file" */ + S_YYerror(1), /* error */ + S_YYUNDEF(2), /* "invalid token" */ + S_NAME(3), /* NAME */ + S_STRING(4), /* STRING */ + S_LONG(5), /* LONG */ + S_DOUBLE(6), /* DOUBLE */ + S_BOOLEAN(7), /* BOOLEAN */ + S_8_(8), /* ',' */ + S_NOT(9), /* NOT */ + S_10_(10), /* ';' */ + S_11_(11), /* '.' */ + S_12_(12), /* '{' */ + S_13_(13), /* '}' */ + S_14_(14), /* '[' */ + S_15_(15), /* ']' */ + S_16_(16), /* ':' */ + S_17_(17), /* '|' */ + S_18_(18), /* '!' */ + S_19_(19), /* '<' */ + S_20_(20), /* '=' */ + S_21_(21), /* '>' */ + S_22_(22), /* '~' */ + S_23_(23), /* '(' */ + S_24_(24), /* ')' */ + S_YYACCEPT(25), /* $accept */ + S_constraint(26), /* constraint */ + S_dimredeflist(27), /* dimredeflist */ + S_clauselist(28), /* clauselist */ + S_clause(29), /* clause */ + S_projection(30), /* projection */ + S_segmenttree(31), /* segmenttree */ + S_segmentforest(32), /* segmentforest */ + S_segment(33), /* segment */ + S_slicelist(34), /* slicelist */ + S_slice(35), /* slice */ + S_subslicelist(36), /* subslicelist */ + S_subslice(37), /* subslice */ + S_extent(38), /* extent */ + S_selection(39), /* selection */ + S_filter(40), /* filter */ + S_predicate(41), /* predicate */ + S_relop(42), /* relop */ + S_eqop(43), /* eqop */ + S_primary(44), /* primary */ + S_dimredef(45), /* dimredef */ + S_fieldname(46), /* fieldname */ + S_constant(47); /* constant */ + + + private final int yycode_; + + SymbolKind(int n) { + this.yycode_ = n; + } + + private static final SymbolKind[] values_ = {SymbolKind.S_YYEOF, SymbolKind.S_YYerror, SymbolKind.S_YYUNDEF, + SymbolKind.S_NAME, SymbolKind.S_STRING, SymbolKind.S_LONG, SymbolKind.S_DOUBLE, SymbolKind.S_BOOLEAN, + SymbolKind.S_8_, SymbolKind.S_NOT, SymbolKind.S_10_, SymbolKind.S_11_, SymbolKind.S_12_, SymbolKind.S_13_, + SymbolKind.S_14_, SymbolKind.S_15_, SymbolKind.S_16_, SymbolKind.S_17_, SymbolKind.S_18_, SymbolKind.S_19_, + SymbolKind.S_20_, SymbolKind.S_21_, SymbolKind.S_22_, SymbolKind.S_23_, SymbolKind.S_24_, SymbolKind.S_YYACCEPT, + SymbolKind.S_constraint, SymbolKind.S_dimredeflist, SymbolKind.S_clauselist, SymbolKind.S_clause, + SymbolKind.S_projection, SymbolKind.S_segmenttree, SymbolKind.S_segmentforest, SymbolKind.S_segment, + SymbolKind.S_slicelist, SymbolKind.S_slice, SymbolKind.S_subslicelist, SymbolKind.S_subslice, + SymbolKind.S_extent, SymbolKind.S_selection, SymbolKind.S_filter, SymbolKind.S_predicate, SymbolKind.S_relop, + SymbolKind.S_eqop, SymbolKind.S_primary, SymbolKind.S_dimredef, SymbolKind.S_fieldname, SymbolKind.S_constant}; + + static final SymbolKind get(int code) { + return values_[code]; + } + + public final int getCode() { + return this.yycode_; + } + + /* + * Return YYSTR after stripping away unnecessary quotes and + * backslashes, so that it's suitable for yyerror. The heuristic is + * that double-quoting is unnecessary unless the string contains an + * apostrophe, a comma, or backslash (other than backslash-backslash). + * YYSTR is taken from yytname. + */ + private static String yytnamerr_(String yystr) { + if (yystr.charAt(0) == '"') { + StringBuffer yyr = new StringBuffer(); + strip_quotes: for (int i = 1; i < yystr.length(); i++) + switch (yystr.charAt(i)) { + case '\'': + case ',': + break strip_quotes; + + case '\\': + if (yystr.charAt(++i) != '\\') + break strip_quotes; + /* Fall through. */ + default: + yyr.append(yystr.charAt(i)); + break; + + case '"': + return yyr.toString(); + } + } + return yystr; + } + + /* + * YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. + * First, the terminals, then, starting at \a YYNTOKENS_, nonterminals. + */ + private static final String[] yytname_ = yytname_init(); + + private static final String[] yytname_init() { + return new String[] {"\"end of file\"", "error", "\"invalid token\"", "NAME", "STRING", "LONG", "DOUBLE", + "BOOLEAN", "','", "NOT", "';'", "'.'", "'{'", "'}'", "'['", "']'", "':'", "'|'", "'!'", "'<'", "'='", "'>'", + "'~'", "'('", "')'", "$accept", "constraint", "dimredeflist", "clauselist", "clause", "projection", + "segmenttree", "segmentforest", "segment", "slicelist", "slice", "subslicelist", "subslice", "extent", + "selection", "filter", "predicate", "relop", "eqop", "primary", "dimredef", "fieldname", "constant", null}; + } + + /* The user-facing name of this symbol. */ + public final String getName() { + return yytnamerr_(yytname_[yycode_]); + } + + }; + + /** * Communication interface between the scanner and the Bison-generated * parser CEBisonParser. */ public interface Lexer { - /** Token returned by the scanner to signal the end of its input. */ - public static final int EOF = 0; - - /* Tokens. */ - /** Token number,to be returned by the scanner. */ + /* Token kinds. */ + /** Token "end of file", to be returned by the scanner. */ + static final int YYEOF = 0; + /** Token error, to be returned by the scanner. */ + static final int YYerror = 256; + /** Token "invalid token", to be returned by the scanner. */ + static final int YYUNDEF = 257; + /** Token NAME, to be returned by the scanner. */ static final int NAME = 258; - /** Token number,to be returned by the scanner. */ + /** Token STRING, to be returned by the scanner. */ static final int STRING = 259; - /** Token number,to be returned by the scanner. */ + /** Token LONG, to be returned by the scanner. */ static final int LONG = 260; - /** Token number,to be returned by the scanner. */ + /** Token DOUBLE, to be returned by the scanner. */ static final int DOUBLE = 261; - /** Token number,to be returned by the scanner. */ + /** Token BOOLEAN, to be returned by the scanner. */ static final int BOOLEAN = 262; - /** Token number,to be returned by the scanner. */ + /** Token NOT, to be returned by the scanner. */ static final int NOT = 263; + /** Deprecated, use YYEOF instead. */ + public static final int EOF = YYEOF; /** @@ -126,15 +267,17 @@ public interface Lexer { int yylex() throws ParseException; /** - * Entry point for error reporting. Emits an error - * in a user-defined way. + * Emit an errorin a user-defined way. + * * - * * @param msg The string for the error message. */ void yyerror(String msg); + + } + /** * The object doing lexical analysis for us. */ @@ -153,11 +296,11 @@ public CEBisonParser(Lexer yylexer) { } + private java.io.PrintStream yyDebugStream = System.err; /** - * Return the PrintStream on which the debugging output is - * printed. + * The PrintStream on which the debugging output is printed. */ public final java.io.PrintStream getDebugStream() { return yyDebugStream; @@ -192,6 +335,16 @@ public final void setDebugLevel(int level) { yydebug = level; } + + private int yynerrs = 0; + + /** + * The number of syntax errors so far. + */ + public final int getNumberOfErrors() { + return yynerrs; + } + /** * Print an error message via the lexer. * @@ -202,14 +355,18 @@ public final void yyerror(String msg) { } + protected final void yycdebugNnl(String s) { + if (0 < yydebug) + yyDebugStream.print(s); + } + protected final void yycdebug(String s) { - if (yydebug > 0) + if (0 < yydebug) yyDebugStream.println(s); } private final class YYStack { private int[] stateStack = new int[16]; - private Object[] valueStack = new Object[16]; public int size = 16; @@ -222,7 +379,6 @@ public final void push(int state, Object value) { System.arraycopy(stateStack, 0, newStateStack, 0, height); stateStack = newStateStack; - Object[] newValueStack = new Object[size * 2]; System.arraycopy(valueStack, 0, newValueStack, 0, height); valueStack = newValueStack; @@ -231,7 +387,6 @@ public final void push(int state, Object value) { } stateStack[height] = state; - valueStack[height] = value; } @@ -241,9 +396,8 @@ public final void pop() { public final void pop(int num) { // Avoid memory leaks... garbage collection is a white lie! - if (num > 0) { + if (0 < num) { java.util.Arrays.fill(valueStack, height - num + 1, height + 1, null); - } height -= num; } @@ -304,7 +458,7 @@ public void print(java.io.PrintStream out) { /** - * Return whether error recovery is being done. In this state, the parser + * Whether error recovery is being done. In this state, the parser * reads token until it reaches a known state, and then restarts normal * operation. */ @@ -318,18 +472,15 @@ public final boolean recovering() { * @param yystate the current state * @param yysym the nonterminal to push on the stack */ - private int yy_lr_goto_state_(int yystate, int yysym) { - int yyr = yypgoto_[yysym - yyntokens_] + yystate; - if (0 <= yyr && yyr <= yylast_ && yycheck_[yyr] == yystate) + private int yyLRGotoState(int yystate, int yysym) { + int yyr = yypgoto_[yysym - YYNTOKENS_] + yystate; + if (0 <= yyr && yyr <= YYLAST_ && yycheck_[yyr] == yystate) return yytable_[yyr]; else - return yydefgoto_[yysym - yyntokens_]; + return yydefgoto_[yysym - YYNTOKENS_]; } private int yyaction(int yyn, YYStack yystack, int yylen) throws ParseException { - Object yyval; - - /* * If YYLEN is nonzero, implement the default value of the action: * '$$ = $1'. Otherwise, use the top of the stack. @@ -338,467 +489,430 @@ private int yyaction(int yyn, YYStack yystack, int yylen) throws ParseException * This behavior is undocumented and Bison * users should not rely upon it. */ - if (yylen > 0) - yyval = yystack.valueAt(yylen - 1); - else - yyval = yystack.valueAt(0); + Object yyval = (0 < yylen) ? yystack.valueAt(yylen - 1) : yystack.valueAt(0); - yy_reduce_print(yyn, yystack); + yyReducePrint(yyn, yystack); switch (yyn) { - case 2: + case 2: /* constraint: dimredeflist clauselist */ if (yyn == 2) - /* "ce.y":103 */ /* lalr1.java:489 */ + /* "ce.y":103 */ { - yyval = constraint(((CEAST.NodeList) (yystack.valueAt(2 - (2))))); + yyval = constraint(((CEAST.NodeList) (yystack.valueAt(0)))); } ; break; - case 5: + case 5: /* clauselist: clause */ if (yyn == 5) - /* "ce.y":113 */ /* lalr1.java:489 */ + /* "ce.y":113 */ { - yyval = nodelist(null, ((CEAST) (yystack.valueAt(1 - (1))))); + yyval = nodelist(null, ((CEAST) (yystack.valueAt(0)))); } ; break; - case 6: + case 6: /* clauselist: clauselist ';' clause */ if (yyn == 6) - /* "ce.y":115 */ /* lalr1.java:489 */ + /* "ce.y":115 */ { - yyval = nodelist(((CEAST.NodeList) (yystack.valueAt(3 - (1)))), ((CEAST) (yystack.valueAt(3 - (3))))); + yyval = nodelist(((CEAST.NodeList) (yystack.valueAt(2))), ((CEAST) (yystack.valueAt(0)))); } ; break; - case 9: + case 9: /* projection: segmenttree */ if (yyn == 9) - /* "ce.y":133 */ /* lalr1.java:489 */ + /* "ce.y":133 */ { - yyval = projection(((CEAST) (yystack.valueAt(1 - (1))))); + yyval = projection(((CEAST) (yystack.valueAt(0)))); } ; break; - case 10: + case 10: /* segmenttree: segment */ if (yyn == 10) - /* "ce.y":138 */ /* lalr1.java:489 */ + /* "ce.y":138 */ { - yyval = segmenttree(null, ((CEAST) (yystack.valueAt(1 - (1))))); + yyval = segmenttree(null, ((CEAST) (yystack.valueAt(0)))); } ; break; - case 11: + case 11: /* segmenttree: segmenttree '.' segment */ if (yyn == 11) - /* "ce.y":140 */ /* lalr1.java:489 */ + /* "ce.y":140 */ { - yyval = segmenttree(((CEAST) (yystack.valueAt(3 - (1)))), ((CEAST) (yystack.valueAt(3 - (3))))); + yyval = segmenttree(((CEAST) (yystack.valueAt(2))), ((CEAST) (yystack.valueAt(0)))); } ; break; - case 12: + case 12: /* segmenttree: segmenttree '.' '{' segmentforest '}' */ if (yyn == 12) - /* "ce.y":142 */ /* lalr1.java:489 */ + /* "ce.y":142 */ { - yyval = segmenttree(((CEAST) (yystack.valueAt(5 - (1)))), ((CEAST.NodeList) (yystack.valueAt(5 - (4))))); + yyval = segmenttree(((CEAST) (yystack.valueAt(4))), ((CEAST.NodeList) (yystack.valueAt(1)))); } ; break; - case 13: + case 13: /* segmenttree: segmenttree '{' segmentforest '}' */ if (yyn == 13) - /* "ce.y":144 */ /* lalr1.java:489 */ + /* "ce.y":144 */ { - yyval = segmenttree(((CEAST) (yystack.valueAt(4 - (1)))), ((CEAST.NodeList) (yystack.valueAt(4 - (3))))); + yyval = segmenttree(((CEAST) (yystack.valueAt(3))), ((CEAST.NodeList) (yystack.valueAt(1)))); } ; break; - case 14: + case 14: /* segmentforest: segmenttree */ if (yyn == 14) - /* "ce.y":149 */ /* lalr1.java:489 */ + /* "ce.y":149 */ { - yyval = nodelist(null, ((CEAST) (yystack.valueAt(1 - (1))))); + yyval = nodelist(null, ((CEAST) (yystack.valueAt(0)))); } ; break; - case 15: + case 15: /* segmentforest: segmentforest ',' segmenttree */ if (yyn == 15) - /* "ce.y":151 */ /* lalr1.java:489 */ + /* "ce.y":151 */ { - yyval = nodelist(((CEAST.NodeList) (yystack.valueAt(3 - (1)))), ((CEAST) (yystack.valueAt(3 - (3))))); + yyval = nodelist(((CEAST.NodeList) (yystack.valueAt(2))), ((CEAST) (yystack.valueAt(0)))); } ; break; - case 16: + case 16: /* segment: NAME */ if (yyn == 16) - /* "ce.y":156 */ /* lalr1.java:489 */ + /* "ce.y":156 */ { - yyval = segment(((String) (yystack.valueAt(1 - (1)))), null); + yyval = segment(((String) (yystack.valueAt(0))), null); } ; break; - case 17: + case 17: /* segment: NAME slicelist */ if (yyn == 17) - /* "ce.y":158 */ /* lalr1.java:489 */ + /* "ce.y":158 */ { - yyval = segment(((String) (yystack.valueAt(2 - (1)))), ((CEAST.SliceList) (yystack.valueAt(2 - (2))))); + yyval = segment(((String) (yystack.valueAt(1))), ((CEAST.SliceList) (yystack.valueAt(0)))); } ; break; - case 18: + case 18: /* slicelist: slice */ if (yyn == 18) - /* "ce.y":163 */ /* lalr1.java:489 */ + /* "ce.y":163 */ { - yyval = slicelist(null, ((Slice) (yystack.valueAt(1 - (1))))); + yyval = slicelist(null, ((Slice) (yystack.valueAt(0)))); } ; break; - case 19: + case 19: /* slicelist: slicelist slice */ if (yyn == 19) - /* "ce.y":165 */ /* lalr1.java:489 */ + /* "ce.y":165 */ { - yyval = slicelist(((CEAST.SliceList) (yystack.valueAt(2 - (1)))), ((Slice) (yystack.valueAt(2 - (2))))); + yyval = slicelist(((CEAST.SliceList) (yystack.valueAt(1))), ((Slice) (yystack.valueAt(0)))); } ; break; - case 20: + case 20: /* slice: '[' ']' */ if (yyn == 20) - /* "ce.y":170 */ /* lalr1.java:489 */ + /* "ce.y":170 */ { yyval = slice(null); } ; break; - case 21: + case 21: /* slice: '[' subslicelist ']' */ if (yyn == 21) - /* "ce.y":172 */ /* lalr1.java:489 */ + /* "ce.y":172 */ { - yyval = slice(((CEAST.SliceList) (yystack.valueAt(3 - (2))))); + yyval = slice(((CEAST.SliceList) (yystack.valueAt(1)))); } ; break; - case 22: + case 22: /* subslicelist: subslice */ if (yyn == 22) - /* "ce.y":177 */ /* lalr1.java:489 */ + /* "ce.y":177 */ { - yyval = slicelist(null, ((Slice) (yystack.valueAt(1 - (1))))); + yyval = slicelist(null, ((Slice) (yystack.valueAt(0)))); } ; break; - case 23: + case 23: /* subslicelist: subslicelist ',' subslice */ if (yyn == 23) - /* "ce.y":179 */ /* lalr1.java:489 */ + /* "ce.y":179 */ { - yyval = slicelist(((CEAST.SliceList) (yystack.valueAt(3 - (1)))), ((Slice) (yystack.valueAt(3 - (3))))); + yyval = slicelist(((CEAST.SliceList) (yystack.valueAt(2))), ((Slice) (yystack.valueAt(0)))); } ; break; - case 24: + case 24: /* subslice: extent */ if (yyn == 24) - /* "ce.y":184 */ /* lalr1.java:489 */ + /* "ce.y":184 */ { - yyval = subslice(1, ((String) (yystack.valueAt(1 - (1)))), null, null); + yyval = subslice(1, ((String) (yystack.valueAt(0))), null, null); } ; break; - case 25: + case 25: /* subslice: extent ':' extent */ if (yyn == 25) - /* "ce.y":186 */ /* lalr1.java:489 */ + /* "ce.y":186 */ { - yyval = subslice(2, ((String) (yystack.valueAt(3 - (1)))), ((String) (yystack.valueAt(3 - (3)))), null); + yyval = subslice(2, ((String) (yystack.valueAt(2))), ((String) (yystack.valueAt(0))), null); } ; break; - case 26: + case 26: /* subslice: extent ':' extent ':' extent */ if (yyn == 26) - /* "ce.y":188 */ /* lalr1.java:489 */ + /* "ce.y":188 */ { - yyval = subslice(3, ((String) (yystack.valueAt(5 - (1)))), ((String) (yystack.valueAt(5 - (5)))), - ((String) (yystack.valueAt(5 - (3))))); + yyval = subslice(3, ((String) (yystack.valueAt(4))), ((String) (yystack.valueAt(0))), + ((String) (yystack.valueAt(2)))); } ; break; - case 27: + case 27: /* subslice: extent ':' */ if (yyn == 27) - /* "ce.y":190 */ /* lalr1.java:489 */ + /* "ce.y":190 */ { - yyval = subslice(4, ((String) (yystack.valueAt(2 - (1)))), null, null); + yyval = subslice(4, ((String) (yystack.valueAt(1))), null, null); } ; break; - case 28: + case 28: /* subslice: extent ':' extent ':' */ if (yyn == 28) - /* "ce.y":192 */ /* lalr1.java:489 */ + /* "ce.y":192 */ { - yyval = subslice(5, ((String) (yystack.valueAt(4 - (1)))), null, ((String) (yystack.valueAt(4 - (3))))); + yyval = subslice(5, ((String) (yystack.valueAt(3))), null, ((String) (yystack.valueAt(1)))); } ; break; - case 30: + case 30: /* selection: segmenttree '|' filter */ if (yyn == 30) - /* "ce.y":203 */ /* lalr1.java:489 */ + /* "ce.y":203 */ { - yyval = selection(((CEAST) (yystack.valueAt(3 - (1)))), ((CEAST) (yystack.valueAt(3 - (3))))); + yyval = selection(((CEAST) (yystack.valueAt(2))), ((CEAST) (yystack.valueAt(0)))); } ; break; - case 32: + case 32: /* filter: predicate ',' predicate */ if (yyn == 32) - /* "ce.y":209 */ /* lalr1.java:489 */ + /* "ce.y":209 */ { - yyval = logicalAnd(((CEAST) (yystack.valueAt(3 - (1)))), ((CEAST) (yystack.valueAt(3 - (3))))); + yyval = logicalAnd(((CEAST) (yystack.valueAt(2))), ((CEAST) (yystack.valueAt(0)))); } ; break; - case 33: + case 33: /* filter: '!' predicate */ if (yyn == 33) - /* "ce.y":211 */ /* lalr1.java:489 */ + /* "ce.y":211 */ { - yyval = logicalNot(((CEAST) (yystack.valueAt(2 - (2))))); + yyval = logicalNot(((CEAST) (yystack.valueAt(0)))); } ; break; - case 34: + case 34: /* predicate: primary relop primary */ if (yyn == 34) - /* "ce.y":216 */ /* lalr1.java:489 */ + /* "ce.y":216 */ { - yyval = predicate(((CEAST.Operator) (yystack.valueAt(3 - (2)))), ((CEAST) (yystack.valueAt(3 - (1)))), - ((CEAST) (yystack.valueAt(3 - (3))))); + yyval = predicate(((CEAST.Operator) (yystack.valueAt(1))), ((CEAST) (yystack.valueAt(2))), + ((CEAST) (yystack.valueAt(0)))); } ; break; - case 35: + case 35: /* predicate: primary relop primary relop primary */ if (yyn == 35) - /* "ce.y":218 */ /* lalr1.java:489 */ + /* "ce.y":218 */ { - yyval = predicaterange(((CEAST.Operator) (yystack.valueAt(5 - (2)))), - ((CEAST.Operator) (yystack.valueAt(5 - (4)))), ((CEAST) (yystack.valueAt(5 - (1)))), - ((CEAST) (yystack.valueAt(5 - (3)))), ((CEAST) (yystack.valueAt(5 - (5))))); + yyval = predicaterange(((CEAST.Operator) (yystack.valueAt(3))), ((CEAST.Operator) (yystack.valueAt(1))), + ((CEAST) (yystack.valueAt(4))), ((CEAST) (yystack.valueAt(2))), ((CEAST) (yystack.valueAt(0)))); } ; break; - case 36: + case 36: /* predicate: primary eqop primary */ if (yyn == 36) - /* "ce.y":220 */ /* lalr1.java:489 */ + /* "ce.y":220 */ { - yyval = predicate(((CEAST.Operator) (yystack.valueAt(3 - (2)))), ((CEAST) (yystack.valueAt(3 - (1)))), - ((CEAST) (yystack.valueAt(3 - (3))))); + yyval = predicate(((CEAST.Operator) (yystack.valueAt(1))), ((CEAST) (yystack.valueAt(2))), + ((CEAST) (yystack.valueAt(0)))); } ; break; - case 37: + case 37: /* relop: '<' '=' */ if (yyn == 37) - /* "ce.y":224 */ /* lalr1.java:489 */ + /* "ce.y":224 */ { yyval = CEAST.Operator.LE; } ; break; - case 38: + case 38: /* relop: '>' '=' */ if (yyn == 38) - /* "ce.y":225 */ /* lalr1.java:489 */ + /* "ce.y":225 */ { yyval = CEAST.Operator.GE; } ; break; - case 39: + case 39: /* relop: '<' */ if (yyn == 39) - /* "ce.y":226 */ /* lalr1.java:489 */ + /* "ce.y":226 */ { yyval = CEAST.Operator.LT; } ; break; - case 40: + case 40: /* relop: '>' */ if (yyn == 40) - /* "ce.y":227 */ /* lalr1.java:489 */ + /* "ce.y":227 */ { yyval = CEAST.Operator.GT; } ; break; - case 41: + case 41: /* eqop: '=' '=' */ if (yyn == 41) - /* "ce.y":231 */ /* lalr1.java:489 */ + /* "ce.y":231 */ { yyval = CEAST.Operator.EQ; } ; break; - case 42: + case 42: /* eqop: '!' '=' */ if (yyn == 42) - /* "ce.y":232 */ /* lalr1.java:489 */ + /* "ce.y":232 */ { yyval = CEAST.Operator.NEQ; } ; break; - case 43: + case 43: /* eqop: '~' '=' */ if (yyn == 43) - /* "ce.y":233 */ /* lalr1.java:489 */ + /* "ce.y":233 */ { yyval = CEAST.Operator.REQ; } ; break; - case 46: + case 46: /* primary: '(' predicate ')' */ if (yyn == 46) - /* "ce.y":239 */ /* lalr1.java:489 */ + /* "ce.y":239 */ { - yyval = ((CEAST) (yystack.valueAt(3 - (2)))); + yyval = ((CEAST) (yystack.valueAt(1))); } ; break; - case 47: + case 47: /* dimredef: NAME '=' slice */ if (yyn == 47) - /* "ce.y":245 */ /* lalr1.java:489 */ + /* "ce.y":245 */ { yyval = null; - dimredef(((String) (yystack.valueAt(3 - (1)))), ((Slice) (yystack.valueAt(3 - (3))))); + dimredef(((String) (yystack.valueAt(2))), ((Slice) (yystack.valueAt(0)))); } ; break; - case 48: + case 48: /* fieldname: NAME */ if (yyn == 48) - /* "ce.y":249 */ /* lalr1.java:489 */ + /* "ce.y":249 */ { - yyval = fieldname(((String) (yystack.valueAt(1 - (1))))); + yyval = fieldname(((String) (yystack.valueAt(0)))); } ; break; - case 49: + case 49: /* constant: STRING */ if (yyn == 49) - /* "ce.y":253 */ /* lalr1.java:489 */ + /* "ce.y":253 */ { - yyval = constant(CEAST.Constant.STRING, ((String) (yystack.valueAt(1 - (1))))); + yyval = constant(CEAST.Constant.STRING, ((String) (yystack.valueAt(0)))); } ; break; - case 50: + case 50: /* constant: LONG */ if (yyn == 50) - /* "ce.y":254 */ /* lalr1.java:489 */ + /* "ce.y":254 */ { - yyval = constant(CEAST.Constant.LONG, ((String) (yystack.valueAt(1 - (1))))); + yyval = constant(CEAST.Constant.LONG, ((String) (yystack.valueAt(0)))); } ; break; - case 51: + case 51: /* constant: DOUBLE */ if (yyn == 51) - /* "ce.y":255 */ /* lalr1.java:489 */ + /* "ce.y":255 */ { - yyval = constant(CEAST.Constant.DOUBLE, ((String) (yystack.valueAt(1 - (1))))); + yyval = constant(CEAST.Constant.DOUBLE, ((String) (yystack.valueAt(0)))); } ; break; - case 52: + case 52: /* constant: BOOLEAN */ if (yyn == 52) - /* "ce.y":256 */ /* lalr1.java:489 */ + /* "ce.y":256 */ { - yyval = constant(CEAST.Constant.BOOLEAN, ((String) (yystack.valueAt(1 - (1))))); + yyval = constant(CEAST.Constant.BOOLEAN, ((String) (yystack.valueAt(0)))); } ; break; - /* "CEBisonParser.java":643 */ /* lalr1.java:489 */ + /* "CEBisonParser.java":825 */ + default: break; } - yy_symbol_print("-> $$ =", yyr1_[yyn], yyval); + yySymbolPrint("-> $$ =", SymbolKind.get(yyr1_[yyn]), yyval); yystack.pop(yylen); yylen = 0; - /* Shift the result of the reduction. */ - int yystate = yy_lr_goto_state_(yystack.stateAt(0), yyr1_[yyn]); + int yystate = yyLRGotoState(yystack.stateAt(0), yyr1_[yyn]); yystack.push(yystate, yyval); return YYNEWSTATE; } - /* - * Return YYSTR after stripping away unnecessary quotes and - * backslashes, so that it's suitable for yyerror. The heuristic is - * that double-quoting is unnecessary unless the string contains an - * apostrophe, a comma, or backslash (other than backslash-backslash). - * YYSTR is taken from yytname. - */ - private final String yytnamerr_(String yystr) { - if (yystr.charAt(0) == '"') { - StringBuffer yyr = new StringBuffer(); - strip_quotes: for (int i = 1; i < yystr.length(); i++) - switch (yystr.charAt(i)) { - case '\'': - case ',': - break strip_quotes; - - case '\\': - if (yystr.charAt(++i) != '\\') - break strip_quotes; - /* Fall through. */ - default: - yyr.append(yystr.charAt(i)); - break; - - case '"': - return yyr.toString(); - } - } else if (yystr.equals("$end")) - return "end of input"; - - return yystr; - } - - /*--------------------------------. | Print this symbol on YYOUTPUT. | `--------------------------------*/ - private void yy_symbol_print(String s, int yytype, Object yyvaluep) { - if (yydebug > 0) - yycdebug(s + (yytype < yyntokens_ ? " token " : " nterm ") + yytname_[yytype] + " (" - + (yyvaluep == null ? "(null)" : yyvaluep.toString()) + ")"); + private void yySymbolPrint(String s, SymbolKind yykind, Object yyvalue) { + if (0 < yydebug) { + yycdebug(s + (yykind.getCode() < YYNTOKENS_ ? " token " : " nterm ") + yykind.getName() + " (" + + (yyvalue == null ? "(null)" : yyvalue.toString()) + ")"); + } } @@ -814,10 +928,10 @@ public boolean parse() throws ParseException, ParseException { - - /* Lookahead and lookahead in internal form. */ - int yychar = yyempty_; - int yytoken = 0; + /* Lookahead token kind. */ + int yychar = YYEMPTY_; + /* Lookahead symbol kind. */ + SymbolKind yytoken = null; /* State. */ int yyn = 0; @@ -826,15 +940,16 @@ public boolean parse() throws ParseException, ParseException YYStack yystack = new YYStack(); int label = YYNEWSTATE; - /* Error handling. */ - int yynerrs_ = 0; /* Semantic value of the lookahead. */ Object yylval = null; - yycdebug("Starting parse\n"); + + + yycdebug("Starting parse"); yyerrstatus_ = 0; + yynerrs = 0; /* Initialize the stack. */ yystack.push(yystate, yylval); @@ -848,76 +963,81 @@ public boolean parse() throws ParseException, ParseException * pushed when we come here. */ case YYNEWSTATE: - yycdebug("Entering state " + yystate + "\n"); - if (yydebug > 0) + yycdebug("Entering state " + yystate); + if (0 < yydebug) yystack.print(yyDebugStream); /* Accept? */ - if (yystate == yyfinal_) + if (yystate == YYFINAL_) return true; /* Take a decision. First try without lookahead. */ yyn = yypact_[yystate]; - if (yy_pact_value_is_default_(yyn)) { + if (yyPactValueIsDefault(yyn)) { label = YYDEFAULT; break; } /* Read a lookahead token. */ - if (yychar == yyempty_) { + if (yychar == YYEMPTY_) { - - yycdebug("Reading a token: "); + yycdebug("Reading a token"); yychar = yylexer.yylex(); yylval = yylexer.getLVal(); } /* Convert token to internal form. */ - if (yychar <= Lexer.EOF) { - yychar = yytoken = Lexer.EOF; - yycdebug("Now at end of input.\n"); + yytoken = yytranslate_(yychar); + yySymbolPrint("Next token is", yytoken, yylval); + + if (yytoken == SymbolKind.S_YYerror) { + // The scanner already issued an error message, process directly + // to error recovery. But do not keep the error token as + // lookahead, it is too special and may lead us to an endless + // loop in error recovery. */ + yychar = Lexer.YYUNDEF; + yytoken = SymbolKind.S_YYUNDEF; + label = YYERRLAB1; } else { - yytoken = yytranslate_(yychar); - yy_symbol_print("Next token is", yytoken, yylval); - } + /* + * If the proper action on seeing token YYTOKEN is to reduce or to + * detect an error, take that action. + */ + yyn += yytoken.getCode(); + if (yyn < 0 || YYLAST_ < yyn || yycheck_[yyn] != yytoken.getCode()) { + label = YYDEFAULT; + } - /* - * If the proper action on seeing token YYTOKEN is to reduce or to - * detect an error, take that action. - */ - yyn += yytoken; - if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yytoken) - label = YYDEFAULT; + /* <= 0 means reduce or error. */ + else if ((yyn = yytable_[yyn]) <= 0) { + if (yyTableValueIsError(yyn)) { + label = YYERRLAB; + } else { + yyn = -yyn; + label = YYREDUCE; + } + } - /* <= 0 means reduce or error. */ - else if ((yyn = yytable_[yyn]) <= 0) { - if (yy_table_value_is_error_(yyn)) - label = YYERRLAB; else { - yyn = -yyn; - label = YYREDUCE; + /* Shift the lookahead token. */ + yySymbolPrint("Shifting", yytoken, yylval); + + /* Discard the token being shifted. */ + yychar = YYEMPTY_; + + /* + * Count tokens shifted since error; after three, turn off error + * status. + */ + if (yyerrstatus_ > 0) + --yyerrstatus_; + + yystate = yyn; + yystack.push(yystate, yylval); + label = YYNEWSTATE; } } - - else { - /* Shift the lookahead token. */ - yy_symbol_print("Shifting", yytoken, yylval); - - /* Discard the token being shifted. */ - yychar = yyempty_; - - /* - * Count tokens shifted since error; after three, turn off error - * status. - */ - if (yyerrstatus_ > 0) - --yyerrstatus_; - - yystate = yyn; - yystack.push(yystate, yylval); - label = YYNEWSTATE; - } break; /*-----------------------------------------------------------. @@ -946,25 +1066,24 @@ else if ((yyn = yytable_[yyn]) <= 0) { case YYERRLAB: /* If not already recovering from an error, report this error. */ if (yyerrstatus_ == 0) { - ++yynerrs_; - if (yychar == yyempty_) - yytoken = yyempty_; - yyerror(yysyntax_error(yystate, yytoken)); + ++yynerrs; + if (yychar == YYEMPTY_) + yytoken = null; + yyreportSyntaxError(new Context(this, yystack, yytoken)); } - if (yyerrstatus_ == 3) { /* * If just tried and failed to reuse lookahead token after an * error, discard it. */ - if (yychar <= Lexer.EOF) { + if (yychar <= Lexer.YYEOF) { /* Return failure if at end of input. */ - if (yychar == Lexer.EOF) + if (yychar == Lexer.YYEOF) return false; } else - yychar = yyempty_; + yychar = YYEMPTY_; } /* @@ -978,8 +1097,6 @@ else if ((yyn = yytable_[yyn]) <= 0) { | errorlab -- error raised explicitly by YYERROR. | `-------------------------------------------------*/ case YYERROR: - - /* * Do not reclaim the symbols of the rule which action triggered * this YYERROR. @@ -996,11 +1113,12 @@ else if ((yyn = yytable_[yyn]) <= 0) { case YYERRLAB1: yyerrstatus_ = 3; /* Each real token shifted decrements this. */ + // Pop stack until we find a state that shifts the error token. for (;;) { yyn = yypact_[yystate]; - if (!yy_pact_value_is_default_(yyn)) { - yyn += yyterror_; - if (0 <= yyn && yyn <= yylast_ && yycheck_[yyn] == yyterror_) { + if (!yyPactValueIsDefault(yyn)) { + yyn += SymbolKind.S_YYerror.getCode(); + if (0 <= yyn && yyn <= YYLAST_ && yycheck_[yyn] == SymbolKind.S_YYerror.getCode()) { yyn = yytable_[yyn]; if (0 < yyn) break; @@ -1017,7 +1135,7 @@ else if ((yyn = yytable_[yyn]) <= 0) { yystack.pop(); yystate = yystack.stateAt(0); - if (yydebug > 0) + if (0 < yydebug) yystack.print(yyDebugStream); } @@ -1028,7 +1146,7 @@ else if ((yyn = yytable_[yyn]) <= 0) { /* Shift the error token. */ - yy_symbol_print("Shifting", yystos_[yyn], yylval); + yySymbolPrint("Shifting", SymbolKind.get(yystos_[yyn]), yylval); yystate = yyn; yystack.push(yyn, yylval); @@ -1047,73 +1165,153 @@ else if ((yyn = yytable_[yyn]) <= 0) { - // Generate an error message. - private String yysyntax_error(int yystate, int tok) { - if (yyErrorVerbose) { - /* - * There are many possibilities here to consider: - * - If this state is a consistent state with a default action, - * then the only way this function was invoked is if the - * default action is an error action. In that case, don't - * check for expected tokens because there are none. - * - The only way there can be no lookahead present (in tok) is - * if this state is a consistent state with a default action. - * Thus, detecting the absence of a lookahead is sufficient to - * determine that there is no unexpected or expected token to - * report. In that case, just report a simple "syntax error". - * - Don't assume there isn't a lookahead just because this - * state is a consistent state with a default action. There - * might have been a previous inconsistent state, consistent - * state with a non-default action, or user semantic action - * that manipulated yychar. (However, yychar is currently out - * of scope during semantic actions.) - * - Of course, the expected token list depends on states to - * have correct lookahead information, and it depends on the - * parser not to perform extra reductions after fetching a - * lookahead from the scanner and before detecting a syntax - * error. Thus, state merging (from LALR or IELR) and default - * reductions corrupt the expected token list. However, the - * list is correct for canonical LR with one exception: it - * will still contain any token that will not be accepted due - * to an error action in a later state. - */ - if (tok != yyempty_) { + /** + * Information needed to get the list of expected tokens and to forge + * a syntax error diagnostic. + */ + public static final class Context { + Context(CEBisonParser parser, YYStack stack, SymbolKind token) { + yyparser = parser; + yystack = stack; + yytoken = token; + } + + private CEBisonParser yyparser; + private YYStack yystack; + + + /** + * The symbol kind of the lookahead token. + */ + public final SymbolKind getToken() { + return yytoken; + } + + private SymbolKind yytoken; + static final int NTOKENS = CEBisonParser.YYNTOKENS_; + + /** + * Put in YYARG at most YYARGN of the expected tokens given the + * current YYCTX, and return the number of tokens stored in YYARG. If + * YYARG is null, return the number of expected tokens (guaranteed to + * be less than YYNTOKENS). + */ + int getExpectedTokens(SymbolKind yyarg[], int yyargn) { + return getExpectedTokens(yyarg, 0, yyargn); + } + + int getExpectedTokens(SymbolKind yyarg[], int yyoffset, int yyargn) { + int yycount = yyoffset; + int yyn = yypact_[this.yystack.stateAt(0)]; + if (!yyPactValueIsDefault(yyn)) { /* - * FIXME: This method of building the message is not compatible - * with internationalization. + * Start YYX at -YYN if negative to avoid negative + * indexes in YYCHECK. In other words, skip the first + * -YYN actions for this state because they are default + * actions. */ - StringBuffer res = new StringBuffer("syntax error, unexpected "); - res.append(yytnamerr_(yytname_[tok])); - int yyn = yypact_[yystate]; - if (!yy_pact_value_is_default_(yyn)) { - /* - * Start YYX at -YYN if negative to avoid negative - * indexes in YYCHECK. In other words, skip the first - * -YYN actions for this state because they are default - * actions. - */ - int yyxbegin = yyn < 0 ? -yyn : 0; - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = yylast_ - yyn + 1; - int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_; - int count = 0; - for (int x = yyxbegin; x < yyxend; ++x) - if (yycheck_[x + yyn] == x && x != yyterror_ && !yy_table_value_is_error_(yytable_[x + yyn])) - ++count; - if (count < 5) { - count = 0; - for (int x = yyxbegin; x < yyxend; ++x) - if (yycheck_[x + yyn] == x && x != yyterror_ && !yy_table_value_is_error_(yytable_[x + yyn])) { - res.append(count++ == 0 ? ", expecting " : " or "); - res.append(yytnamerr_(yytname_[x])); - } + int yyxbegin = yyn < 0 ? -yyn : 0; + /* Stay within bounds of both yycheck and yytname. */ + int yychecklim = YYLAST_ - yyn + 1; + int yyxend = yychecklim < NTOKENS ? yychecklim : NTOKENS; + for (int yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck_[yyx + yyn] == yyx && yyx != SymbolKind.S_YYerror.getCode() + && !yyTableValueIsError(yytable_[yyx + yyn])) { + if (yyarg == null) + yycount += 1; + else if (yycount == yyargn) + return 0; // FIXME: this is incorrect. + else + yyarg[yycount++] = SymbolKind.get(yyx); } - } - return res.toString(); } + if (yyarg != null && yycount == yyoffset && yyoffset < yyargn) + yyarg[yycount] = null; + return yycount - yyoffset; } + } + + - return "syntax error"; + private int yysyntaxErrorArguments(Context yyctx, SymbolKind[] yyarg, int yyargn) { + /* + * There are many possibilities here to consider: + * - If this state is a consistent state with a default action, + * then the only way this function was invoked is if the + * default action is an error action. In that case, don't + * check for expected tokens because there are none. + * - The only way there can be no lookahead present (in tok) is + * if this state is a consistent state with a default action. + * Thus, detecting the absence of a lookahead is sufficient to + * determine that there is no unexpected or expected token to + * report. In that case, just report a simple "syntax error". + * - Don't assume there isn't a lookahead just because this + * state is a consistent state with a default action. There + * might have been a previous inconsistent state, consistent + * state with a non-default action, or user semantic action + * that manipulated yychar. (However, yychar is currently out + * of scope during semantic actions.) + * - Of course, the expected token list depends on states to + * have correct lookahead information, and it depends on the + * parser not to perform extra reductions after fetching a + * lookahead from the scanner and before detecting a syntax + * error. Thus, state merging (from LALR or IELR) and default + * reductions corrupt the expected token list. However, the + * list is correct for canonical LR with one exception: it + * will still contain any token that will not be accepted due + * to an error action in a later state. + */ + int yycount = 0; + if (yyctx.getToken() != null) { + if (yyarg != null) + yyarg[yycount] = yyctx.getToken(); + yycount += 1; + yycount += yyctx.getExpectedTokens(yyarg, 1, yyargn); + } + return yycount; + } + + + /** + * Build and emit a "syntax error" message in a user-defined way. + * + * @param ctx The context of the error. + */ + private void yyreportSyntaxError(Context yyctx) { + if (yyErrorVerbose) { + final int argmax = 5; + SymbolKind[] yyarg = new SymbolKind[argmax]; + int yycount = yysyntaxErrorArguments(yyctx, yyarg, argmax); + String[] yystr = new String[yycount]; + for (int yyi = 0; yyi < yycount; ++yyi) { + yystr[yyi] = yyarg[yyi].getName(); + } + String yyformat; + switch (yycount) { + default: + case 0: + yyformat = "syntax error"; + break; + case 1: + yyformat = "syntax error, unexpected {0}"; + break; + case 2: + yyformat = "syntax error, unexpected {0}, expecting {1}"; + break; + case 3: + yyformat = "syntax error, unexpected {0}, expecting {1} or {2}"; + break; + case 4: + yyformat = "syntax error, unexpected {0}, expecting {1} or {2} or {3}"; + break; + case 5: + yyformat = "syntax error, unexpected {0}, expecting {1} or {2} or {3} or {4}"; + break; + } + yyerror(new MessageFormat(yyformat).format(yystr)); + } else { + yyerror("syntax error"); + } } /** @@ -1121,7 +1319,7 @@ private String yysyntax_error(int yystate, int tok) { * * @param yyvalue the value to check */ - private static boolean yy_pact_value_is_default_(int yyvalue) { + private static boolean yyPactValueIsDefault(int yyvalue) { return yyvalue == yypact_ninf_; } @@ -1131,7 +1329,7 @@ private static boolean yy_pact_value_is_default_(int yyvalue) { * * @param yyvalue the value to check */ - private static boolean yy_table_value_is_error_(int yyvalue) { + private static boolean yyTableValueIsError(int yyvalue) { return yyvalue == yytable_ninf_; } @@ -1142,7 +1340,7 @@ private static boolean yy_table_value_is_error_(int yyvalue) { * YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing * STATE-NUM. */ - private static final byte yypact_[] = yypact_init(); + private static final byte[] yypact_ = yypact_init(); private static final byte[] yypact_init() { return new byte[] {-47, 40, 18, -47, -5, 23, 17, -47, -47, 26, -47, -47, 15, -5, -47, 35, -47, 50, 21, 50, -1, -47, @@ -1156,7 +1354,7 @@ private static final byte[] yypact_init() { * Performed when YYTABLE does not specify something else to do. Zero * means the default is an error. */ - private static final byte yydefact_[] = yydefact_init(); + private static final byte[] yydefact_ = yydefact_init(); private static final byte[] yydefact_init() { return new byte[] {3, 0, 0, 1, 16, 0, 2, 5, 7, 9, 10, 8, 0, 17, 18, 0, 4, 0, 0, 0, 0, 29, 20, 0, 22, 24, 19, 0, 6, @@ -1165,7 +1363,7 @@ private static final byte[] yydefact_init() { } /* YYPGOTO[NTERM-NUM]. */ - private static final byte yypgoto_[] = yypgoto_init(); + private static final byte[] yypgoto_ = yypgoto_init(); private static final byte[] yypgoto_init() { return new byte[] {-47, -47, -47, -47, 49, -47, -19, 32, 52, -47, -2, -47, 24, -46, -47, -47, -31, 0, -47, -42, -47, @@ -1173,10 +1371,10 @@ private static final byte[] yypgoto_init() { } /* YYDEFGOTO[NTERM-NUM]. */ - private static final byte yydefgoto_[] = yydefgoto_init(); + private static final byte[] yydefgoto_ = yydefgoto_init(); private static final byte[] yydefgoto_init() { - return new byte[] {-1, 1, 2, 6, 7, 8, 9, 32, 10, 13, 14, 23, 24, 25, 11, 40, 41, 60, 61, 42, 16, 43, 44}; + return new byte[] {0, 1, 2, 6, 7, 8, 9, 32, 10, 13, 14, 23, 24, 25, 11, 40, 41, 60, 61, 42, 16, 43, 44}; } /* @@ -1184,7 +1382,7 @@ private static final byte[] yydefgoto_init() { * positive, shift that token. If negative, reduce the rule whose * number is the opposite. If YYTABLE_NINF, syntax error. */ - private static final byte yytable_[] = yytable_init(); + private static final byte[] yytable_ = yytable_init(); private static final byte[] yytable_init() { return new byte[] {31, 63, 33, 34, 35, 36, 37, 52, 53, 12, 31, 26, 33, 34, 35, 36, 37, 38, 73, 74, 21, 4, 39, 67, 4, @@ -1192,7 +1390,7 @@ private static final byte[] yytable_init() { 58, 27, 54, 47, 21, 68, 66, 49, 69, 70, 71, 72, 28, 75, 0, 62, 30, 0, 0, 76}; } - private static final byte yycheck_[] = yycheck_init(); + private static final byte[] yycheck_ = yycheck_init(); private static final byte[] yycheck_init() { return new byte[] {19, 47, 3, 4, 5, 6, 7, 38, 39, 14, 29, 13, 3, 4, 5, 6, 7, 18, 60, 61, 5, 3, 23, 54, 3, 27, 3, 10, @@ -1201,10 +1399,10 @@ private static final byte[] yycheck_init() { } /* - * YYSTOS[STATE-NUM] -- The (internal number of the) accessing - * symbol of state STATE-NUM. + * YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of + * state STATE-NUM. */ - private static final byte yystos_[] = yystos_init(); + private static final byte[] yystos_ = yystos_init(); private static final byte[] yystos_init() { return new byte[] {0, 26, 27, 0, 3, 10, 28, 29, 30, 31, 33, 39, 14, 34, 35, 3, 45, 10, 11, 12, 17, 5, 15, 36, 37, @@ -1212,8 +1410,8 @@ private static final byte[] yystos_init() { 18, 19, 20, 21, 22, 42, 43, 37, 38, 13, 31, 24, 41, 20, 20, 20, 20, 20, 44, 44, 16, 42, 38, 44}; } - /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ - private static final byte yyr1_[] = yyr1_init(); + /* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */ + private static final byte[] yyr1_ = yyr1_init(); private static final byte[] yyr1_init() { return new byte[] {0, 25, 26, 27, 27, 28, 28, 29, 29, 30, 31, 31, 31, 31, 32, 32, 33, 33, 34, 34, 35, 35, 36, 36, @@ -1221,41 +1419,18 @@ private static final byte[] yyr1_init() { 47}; } - /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ - private static final byte yyr2_[] = yyr2_init(); + /* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */ + private static final byte[] yyr2_ = yyr2_init(); private static final byte[] yyr2_init() { return new byte[] {0, 2, 2, 0, 3, 1, 3, 1, 1, 1, 1, 3, 5, 4, 1, 3, 1, 2, 1, 2, 2, 3, 1, 3, 1, 3, 5, 2, 4, 1, 3, 1, 3, 2, 3, 5, 3, 2, 2, 1, 1, 2, 2, 2, 1, 1, 3, 3, 1, 1, 1, 1, 1}; } - /* - * YYTOKEN_NUMBER[YYLEX-NUM] -- Internal symbol number corresponding - * to YYLEX-NUM. - */ - private static final short yytoken_number_[] = yytoken_number_init(); - private static final short[] yytoken_number_init() { - return new short[] {0, 256, 257, 258, 259, 260, 261, 262, 44, 263, 59, 46, 123, 125, 91, 93, 58, 124, 33, 60, 61, - 62, 126, 40, 41}; - } - - /* - * YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - * First, the terminals, then, starting at \a yyntokens_, nonterminals. - */ - private static final String yytname_[] = yytname_init(); - - private static final String[] yytname_init() { - return new String[] {"$end", "error", "$undefined", "NAME", "STRING", "LONG", "DOUBLE", "BOOLEAN", "','", "NOT", - "';'", "'.'", "'{'", "'}'", "'['", "']'", "':'", "'|'", "'!'", "'<'", "'='", "'>'", "'~'", "'('", "')'", - "$accept", "constraint", "dimredeflist", "clauselist", "clause", "projection", "segmenttree", "segmentforest", - "segment", "slicelist", "slice", "subslicelist", "subslice", "index", "selection", "filter", "predicate", - "relop", "eqop", "primary", "dimredef", "fieldname", "constant", null}; - } /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ - private static final short yyrline_[] = yyrline_init(); + private static final short[] yyrline_ = yyrline_init(); private static final short[] yyrline_init() { return new short[] {0, 101, 101, 106, 108, 112, 114, 119, 120, 132, 137, 139, 141, 143, 148, 150, 155, 157, 162, @@ -1265,23 +1440,37 @@ private static final short[] yyrline_init() { // Report on the debug stream that the rule yyrule is going to be reduced. - private void yy_reduce_print(int yyrule, YYStack yystack) { + private void yyReducePrint(int yyrule, YYStack yystack) { if (yydebug == 0) return; int yylno = yyrline_[yyrule]; int yynrhs = yyr2_[yyrule]; /* Print the symbols being reduced, and their result. */ - yycdebug("Reducing stack by rule " + (yyrule - 1) + " (line " + yylno + "), "); + yycdebug("Reducing stack by rule " + (yyrule - 1) + " (line " + yylno + "):"); /* The symbols being reduced. */ for (int yyi = 0; yyi < yynrhs; yyi++) - yy_symbol_print(" $" + (yyi + 1) + " =", yystos_[yystack.stateAt(yynrhs - (yyi + 1))], - ((yystack.valueAt(yynrhs - (yyi + 1))))); + yySymbolPrint(" $" + (yyi + 1) + " =", SymbolKind.get(yystos_[yystack.stateAt(yynrhs - (yyi + 1))]), + yystack.valueAt((yynrhs) - (yyi + 1))); } - /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ - private static final byte yytranslate_table_[] = yytranslate_table_init(); + /* + * YYTRANSLATE_(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM + * as returned by yylex, with out-of-bounds checking. + */ + private static final SymbolKind yytranslate_(int t) { + // Last valid token kind. + int code_max = 263; + if (t <= 0) + return SymbolKind.S_YYEOF; + else if (t <= code_max) + return SymbolKind.get(yytranslate_table_[t]); + else + return SymbolKind.S_YYUNDEF; + } + + private static final byte[] yytranslate_table_ = yytranslate_table_init(); private static final byte[] yytranslate_table_init() { return new byte[] {0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -1294,27 +1483,14 @@ private static final byte[] yytranslate_table_init() { 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, 6, 7, 9}; } - private static final byte yytranslate_(int t) { - if (t >= 0 && t <= yyuser_token_number_max_) - return yytranslate_table_[t]; - else - return yyundef_token_; - } - private static final int yylast_ = 73; - private static final int yynnts_ = 23; - private static final int yyempty_ = -2; - private static final int yyfinal_ = 3; - private static final int yyterror_ = 1; - private static final int yyerrcode_ = 256; - private static final int yyntokens_ = 25; + private static final int YYLAST_ = 73; + private static final int YYEMPTY_ = -2; + private static final int YYFINAL_ = 3; + private static final int YYNTOKENS_ = 25; - private static final int yyuser_token_number_max_ = 263; - private static final int yyundef_token_ = 2; - - /* User implementation code. */ /* Unqualified %code blocks. */ - /* "ce.y":24 */ /* lalr1.java:1066 */ + /* "ce.y":24 */ // Provide accessors for the parser lexer @@ -1325,7 +1501,7 @@ Lexer getLexer() { void setLexer(Lexer lexer) { this.yylexer = lexer; } - /* "ce.y":31 */ /* lalr1.java:1066 */ + /* "ce.y":31 */ // Abstract Parser actions abstract CEAST constraint(CEAST.NodeList clauses) throws ParseException; @@ -1364,7 +1540,6 @@ abstract CEAST predicaterange(CEAST.Operator op1, CEAST.Operator op2, CEAST lhs, abstract CEAST.SliceList slicelist(CEAST.SliceList list, Slice slice); - /* "CEBisonParser.java":1350 */ /* lalr1.java:1066 */ + /* "CEBisonParser.java":1534 */ } - diff --git a/dap4/d4core/src/main/java/dap4/core/ce/parser/CELexer.java b/dap4/src/main/java/dap4/core/ce/parser/CELexer.java similarity index 100% rename from dap4/d4core/src/main/java/dap4/core/ce/parser/CELexer.java rename to dap4/src/main/java/dap4/core/ce/parser/CELexer.java diff --git a/dap4/d4core/src/main/java/dap4/core/ce/parser/CEParserImpl.java b/dap4/src/main/java/dap4/core/ce/parser/CEParserImpl.java similarity index 98% rename from dap4/d4core/src/main/java/dap4/core/ce/parser/CEParserImpl.java rename to dap4/src/main/java/dap4/core/ce/parser/CEParserImpl.java index 51e89238ad..429a776d7a 100644 --- a/dap4/d4core/src/main/java/dap4/core/ce/parser/CEParserImpl.java +++ b/dap4/src/main/java/dap4/core/ce/parser/CEParserImpl.java @@ -157,7 +157,7 @@ Slice subslice(int state, String sfirst, String send, String sstride) throws Par Slice x; try { - x = new Slice(first, stop, stride); + x = new Slice((int) first, (int) stop, (int) stride); } catch (DapException de) { throw new ParseException(de); } @@ -203,7 +203,7 @@ void dimredef(String name, Slice slice) throws ParseException { throw new ParseException("Attempt to redefine a non-existent shared dimension: " + name); // Verify that the slice is consistent with the shared dimension try { - slice.setMaxSize(dim.getSize()); + slice.setMaxSize((int) dim.getSize()); slice.finish(); } catch (DapException de) { throw new ParseException(de); diff --git a/dap4/d4core/src/main/java/dap4/core/dmr/DMRFactory.java b/dap4/src/main/java/dap4/core/dmr/DMRFactory.java similarity index 98% rename from dap4/d4core/src/main/java/dap4/core/dmr/DMRFactory.java rename to dap4/src/main/java/dap4/core/dmr/DMRFactory.java index b72dfcce3e..bb43efd184 100644 --- a/dap4/d4core/src/main/java/dap4/core/dmr/DMRFactory.java +++ b/dap4/src/main/java/dap4/core/dmr/DMRFactory.java @@ -43,7 +43,7 @@ public DapDimension newDimension(String name, long size) { return node; } - public DapMap newMap(DapVariable target) { + public DapMap newMap(String target) { DapMap node = new DapMap(target); if (DEBUG) debug(node); diff --git a/dap4/d4lib/src/main/java/dap4/dap4lib/DMRPrinter.java b/dap4/src/main/java/dap4/core/dmr/DMRPrinter.java similarity index 75% rename from dap4/d4lib/src/main/java/dap4/dap4lib/DMRPrinter.java rename to dap4/src/main/java/dap4/core/dmr/DMRPrinter.java index 57823889c2..c11bb910b2 100644 --- a/dap4/d4lib/src/main/java/dap4/dap4lib/DMRPrinter.java +++ b/dap4/src/main/java/dap4/core/dmr/DMRPrinter.java @@ -3,13 +3,17 @@ * See the LICENSE file for more information. */ -package dap4.dap4lib; +package dap4.core.dmr; import dap4.core.ce.CEConstraint; -import dap4.core.dmr.*; import dap4.core.util.*; + import java.io.IOException; +import java.io.PrintStream; import java.io.PrintWriter; +import java.io.StringWriter; +import java.nio.ByteOrder; +import java.util.EnumSet; import java.util.List; import java.util.Map; @@ -43,6 +47,41 @@ public class DMRPrinter { public static final boolean ALLOWFIELDMAPS = false; + static public final String XMLDOCUMENTHEADER = ""; + + ////////////////////////////////////////////////// + // Types + + public enum Controls { + RESERVED; // print reserved attributes + } + + ////////////////////////////////////////////////// + // Static Methods + static public void print(DapDataset dmr, PrintStream stream) { + try { + PrintWriter pw = new PrintWriter(stream); + new DMRPrinter(dmr, pw).print(); + pw.close(); + } catch (IOException ioe) { + } ; + } + + static public String printAsString(DapDataset dmr) { + String s = null; + try { + StringWriter sw = new StringWriter(); + PrintWriter pw = new PrintWriter(sw); + new DMRPrinter(dmr, pw).print(); + pw.close(); + s = sw.toString(); + sw.close(); + } catch (IOException ioe) { + s = null; + } ; + return s; + } + ////////////////////////////////////////////////// // Instance Variables @@ -51,7 +90,13 @@ public class DMRPrinter { protected DapDataset dmr = null; protected CEConstraint ce = null; protected ResponseFormat format = null; - protected boolean testing = false; + protected DapContext cxt = null; + // Following extracted from context + protected ByteOrder order = null; + protected Map localchecksummap = null; + protected Map remotechecksummap = null; + + protected EnumSet controls = EnumSet.noneOf(Controls.class); ////////////////////////////////////////////////// // Constructor(s) @@ -63,12 +108,20 @@ public DMRPrinter(DapDataset dmr, PrintWriter writer) { } public DMRPrinter(DapDataset dmr, CEConstraint ce, PrintWriter writer, ResponseFormat format) { + this(dmr, ce, writer, format, null); + } + + public DMRPrinter(DapDataset dmr, CEConstraint ce, PrintWriter writer, ResponseFormat format, DapContext cxt) { this(); this.dmr = dmr; - this.ce = ce; + this.ce = (ce == null ? CEConstraint.getUniversal(dmr) : ce); this.writer = writer; this.printer = new IndentWriter(writer); this.format = (format == null ? ResponseFormat.XML : format); + this.cxt = (cxt == null ? new DapContext() : cxt); + this.order = (ByteOrder) this.cxt.get(DapConstants.DAP4ENDIANTAG); + this.localchecksummap = (Map) this.cxt.get("localchecksummap"); + this.remotechecksummap = (Map) this.cxt.get("remotechecksummap"); } ////////////////////////////////////////////////// @@ -85,6 +138,10 @@ public void close() { ////////////////////////////////////////////////// // External API + public void setControl(Controls ctl) { + this.controls.add(ctl); + } + /** * Print a DapDataset: * - as DMR @@ -94,25 +151,11 @@ public void close() { */ public void print() throws IOException { - if (this.ce == null) - this.ce = CEConstraint.getUniversal(dmr); - assert (this.ce != null); this.printer.setIndent(0); - printNode(dmr); // start printing at the root - printer.eol(); - } - - - /** - * Same as print() except certain items of - * information are suppressed. - * - * @throws IOException - */ - - public void testprint() throws IOException { - this.testing = true; - print(); + // Print XML Document Header + this.printer.marginPrintln(XMLDOCUMENTHEADER); + if (printNode(dmr)) // start printing at the root + printer.eol(); } ////////////////////////////////////////////////// @@ -133,21 +176,34 @@ public void testprint() throws IOException { * printDimrefs, printMaps * * @param node - the node to print + * @return true if anything was printed -- needed to control eol output * @throws IOException Note that the PrintWriter is global. */ - public void printNode(DapNode node) throws IOException { + public boolean printNode(DapNode node) throws IOException { if (node == null) - return; + return false; + // Do first level suppression check DapSort sort = node.getSort(); + switch (sort) { + case DATASET: + case GROUP: + case DIMENSION: + case ENUMERATION: + case VARIABLE: + if (!this.ce.references(node)) + return false; + break; + default: + break; + } + String dmrname = sort.getName(); switch (sort) { case DATASET:// treat like group case GROUP: - if (!this.ce.references(node)) - break; DapGroup group = (DapGroup) node; printer.marginPrint("<" + dmrname); int flags = (sort == DapSort.DATASET ? PERLINE : NILFLAGS); @@ -159,47 +215,46 @@ public void printNode(DapNode node) throws IOException { for (DapNode subnode : group.getDimensions()) { if (!this.ce.references(subnode)) continue; - printNode(subnode); - printer.eol(); + if (printNode(subnode)) + printer.eol(); } } if (group.getEnums().size() > 0) { for (DapNode subnode : group.getEnums()) { if (!this.ce.references(subnode)) continue; - printNode(subnode); - printer.eol(); + if (printNode(subnode)) + printer.eol(); } } if (group.getVariables().size() > 0) for (DapNode subnode : group.getVariables()) { if (!this.ce.references(subnode)) continue; - printNode(subnode); - printer.eol(); + if (printNode(subnode)) + printer.eol(); } printMetadata(node); - if (group.getGroups().size() > 0) + if (group.getGroups().size() > 0) { for (DapNode subnode : group.getGroups()) { if (!this.ce.references(subnode)) continue; - printNode(subnode); - printer.eol(); + if (printNode(subnode)) + printer.eol(); } + } printer.outdent(); printer.marginPrint(""); break; case DIMENSION: - if (!this.ce.references(node)) - break; DapDimension dim = (DapDimension) node; if (!dim.isShared()) - break; // ignore, here, anonymous dimensions + return false; // ignore, here, anonymous dimensions printer.marginPrint("<" + dmrname); printXMLAttributes(node, ce, NILFLAGS); if (dim.isUnlimited()) - printXMLAttribute(AbstractDSP.UCARTAGUNLIMITED, "1", NILFLAGS); + printXMLAttribute(DapAttribute.UCARTAGUNLIMITED, "1", NILFLAGS); if (hasMetadata(node)) { printer.println(">"); printMetadata(node); @@ -210,8 +265,6 @@ public void printNode(DapNode node) throws IOException { break; case ENUMERATION: - if (!this.ce.references(node)) - break; DapEnumeration en = (DapEnumeration) node; printer.marginPrint("<" + dmrname); printXMLAttributes(en, ce, NILFLAGS); @@ -230,14 +283,14 @@ public void printNode(DapNode node) throws IOException { break; case VARIABLE: - if (!this.ce.references(node)) - break; DapVariable var = (DapVariable) node; + if (var.getCount() == 0) // Has zero-length dimension + return false; DapType type = var.getBaseType(); printer.marginPrint("<" + type.getTypeSort().name()); printXMLAttributes(node, ce, NILFLAGS); if (type.isAtomic()) { - if ((hasMetadata(node) || hasDimensions(var) || hasMaps(var))) { + if ((hasMetadata(node) || hasDimensions(var) || hasMaps(var) || hasRequestData(var))) { printer.println(">"); printer.indent(); if (hasDimensions(var)) @@ -246,6 +299,8 @@ public void printNode(DapNode node) throws IOException { printMetadata(var); if (hasMaps(var)) printMaps(var); + if (hasRequestData(var)) + printRequestData(var); printer.outdent(); printer.marginPrint(""); } else @@ -257,12 +312,14 @@ public void printNode(DapNode node) throws IOException { for (DapVariable field : struct.getFields()) { if (!this.ce.references(field)) continue; - printNode(field); - printer.eol(); + if (printNode(field)) + printer.eol(); } printDimrefs(var); printMetadata(var); printMaps(var); + if (hasRequestData(var)) + printRequestData(var); printer.outdent(); printer.marginPrint(""); } else @@ -273,7 +330,7 @@ public void printNode(DapNode node) throws IOException { assert (false) : "Unexpected sort: " + sort.name(); break; } - + return true; } /** @@ -299,8 +356,8 @@ void printXMLAttributes(DapNode node, CEConstraint ce, int flags) throws IOExcep printXMLAttribute("dapVersion", dataset.getDapVersion(), flags); printXMLAttribute("dmrVersion", dataset.getDMRVersion(), flags); // boilerplate - printXMLAttribute("xmlns", "http://xml.opendap.org/ns/DAP/4.0#", flags); - printXMLAttribute("xmlns:dap", "http://xml.opendap.org/ns/DAP/4.0#", flags); + printXMLAttribute("xmlns", DapConstants.X_DAP_NS, flags); + printXMLAttribute("xmlns:dap", DapConstants.X_DAP_NS, flags); break; case DIMENSION: @@ -340,7 +397,7 @@ void printXMLAttributes(DapNode node, CEConstraint ce, int flags) throws IOExcep default: break; // node either has no attributes or name only } // switch - if (!this.testing) + if (controls.contains(Controls.RESERVED)) printReserved(node); if ((flags & PERLINE) != 0) { printer.outdent(2); @@ -387,11 +444,10 @@ protected void printReserved(DapNode node) throws DapException { } protected void printMetadata(DapNode node) throws IOException { - + boolean isdataset = node.getSort() == DapSort.DATASET; Map attributes = node.getAttributes(); - if (attributes.size() == 0) { + if (!isdataset && attributes.size() == 0) return; - } for (Map.Entry entry : attributes.entrySet()) { DapAttribute attr = entry.getValue(); assert (attr != null); @@ -407,6 +463,8 @@ protected void printMetadata(DapNode node) throws IOException { break; } } + if (isdataset) + printRequestMetaData(node); } protected void printContainerAttribute(DapAttribute attr) {} @@ -447,8 +505,6 @@ static boolean isSpecial(DapAttribute attr) { } void printAttribute(DapAttribute attr) throws IOException { - if (this.testing && isSpecial(attr)) - return; printer.marginPrint(" maps = parent.getMaps(); if (maps.size() == 0) return; @@ -529,11 +583,11 @@ void printMaps(DapVariable parent) throws IOException { // Optionally suppress field maps if (!ALLOWFIELDMAPS) { DapVariable mapvar = map.getVariable(); - if (mapvar.getParent() != null && !mapvar.getParent().getSort().isGroup()) + if (mapvar != null && mapvar.getParent() != null && !mapvar.getParent().getSort().isGroup()) continue; // Supress maps with non-top-level vars } // Separate out name attribute so we can use FQN. - String name = map.getFQN(); + String name = map.getTargetName(); assert (name != null) : "Illegal reference"; printer.marginPrint("DAP + * translations. + */ + void printRequestMetaData(DapNode dataset) throws DapException { + try { + // Add dap4.ce attribute + if (!this.ce.isUniversal()) { + String sce = this.ce.toConstraintString(); + DapAttribute a = new DapAttribute(DapConstants.CEATTRNAME, DapType.STRING); + a.setValues(new String[] {sce}); + printAttribute(a); + } + // Add + DapAttribute a = new DapAttribute(DapConstants.LITTLEENDIANATTRNAME, DapType.UINT8); + String[] value = new String[1]; + value[0] = (this.order == ByteOrder.LITTLE_ENDIAN ? "1" : "0"); + a.setValues(value); + printAttribute(a); + } catch (IOException ioe) { + throw new DapException(ioe); + } + } + + /** + * Print request-specific per-variable data + * Like printRequestMetaData, this is nasty hack + * to avoid modifying the DMR. + * + * @param var + */ + protected void printRequestData(DapVariable var) throws DapException { + try {// Add per-variable checksum + Long csum = localchecksummap.get(var); + if (csum == null) + return; + DapAttribute a = var.getChecksumAttribute(); + if (a == null) { + a = new DapAttribute(DapConstants.CHECKSUMATTRNAME, DapType.INT32); + a.setValues(new String[] {csum.toString()}); + } + printAttribute(a); + } catch (IOException ioe) { + throw new DapException(ioe); + } + } + ////////////////////////////////////////////////// // Misc. Static Utilities @@ -606,13 +709,17 @@ protected boolean hasMetadata(DapNode node) { return node.getAttributes().size() > 0; } - protected static boolean hasMaps(DapVariable var) { + protected boolean hasMaps(DapVariable var) { return var.getMaps().size() > 0; } - protected static boolean hasDimensions(DapVariable var) { + protected boolean hasDimensions(DapVariable var) { return var.getDimensions().size() > 0; } + protected boolean hasRequestData(DapVariable var) { + return localchecksummap != null && localchecksummap.containsKey(var); + } + } // class DapPrint diff --git a/dap4/d4core/src/main/java/dap4/core/dmr/DapAttribute.java b/dap4/src/main/java/dap4/core/dmr/DapAttribute.java similarity index 78% rename from dap4/d4core/src/main/java/dap4/core/dmr/DapAttribute.java rename to dap4/src/main/java/dap4/core/dmr/DapAttribute.java index cebd220a4f..e890d32e0c 100644 --- a/dap4/d4core/src/main/java/dap4/core/dmr/DapAttribute.java +++ b/dap4/src/main/java/dap4/core/dmr/DapAttribute.java @@ -16,8 +16,17 @@ public class DapAttribute extends DapNode { ////////////////////////////////////////////////// - // Instance Variables + // Constants + + // Define reserved XML attributes + public static final String UCARTAGOPAQUE = "_edu.ucar.opaque.size"; + public static final String UCARTAGUNLIMITED = "_edu.ucar.isunlimited"; + // Not yet implemented + public static final String UCARTAGVLEN = "_edu.ucar.isvlen"; + public static final String UCARTAGORIGTYPE = "_edu.ucar.orig.type"; + ////////////////////////////////////////////////// + // Instance Variables protected List namespaceList = new ArrayList(); diff --git a/dap4/d4core/src/main/java/dap4/core/dmr/DapAttributeSet.java b/dap4/src/main/java/dap4/core/dmr/DapAttributeSet.java similarity index 100% rename from dap4/d4core/src/main/java/dap4/core/dmr/DapAttributeSet.java rename to dap4/src/main/java/dap4/core/dmr/DapAttributeSet.java diff --git a/dap4/d4core/src/main/java/dap4/core/dmr/DapDataset.java b/dap4/src/main/java/dap4/core/dmr/DapDataset.java similarity index 98% rename from dap4/d4core/src/main/java/dap4/core/dmr/DapDataset.java rename to dap4/src/main/java/dap4/core/dmr/DapDataset.java index f723fb38ce..ffe08cbc68 100644 --- a/dap4/d4core/src/main/java/dap4/core/dmr/DapDataset.java +++ b/dap4/src/main/java/dap4/core/dmr/DapDataset.java @@ -10,8 +10,7 @@ import java.util.*; /** - * This class defines a non-Gridd Grid: - * i.e. one with an atomic type. + * This is the root object of a DMR tree. */ public class DapDataset extends DapGroup { @@ -49,6 +48,8 @@ public class DapDataset extends DapGroup { protected boolean finished = false; + protected Map checksummap = null; + ////////////////////////////////////////////////// // Constructors @@ -131,9 +132,8 @@ public CEConstraint getConstraint() { return this.ce; } - public DapDataset setConstraint(CEConstraint ce) { + public void setConstraint(CEConstraint ce) { this.ce = ce; - return this; } public String getDapVersion() { diff --git a/dap4/d4core/src/main/java/dap4/core/dmr/DapDecl.java b/dap4/src/main/java/dap4/core/dmr/DapDecl.java similarity index 100% rename from dap4/d4core/src/main/java/dap4/core/dmr/DapDecl.java rename to dap4/src/main/java/dap4/core/dmr/DapDecl.java diff --git a/dap4/d4core/src/main/java/dap4/core/dmr/DapDimension.java b/dap4/src/main/java/dap4/core/dmr/DapDimension.java similarity index 100% rename from dap4/d4core/src/main/java/dap4/core/dmr/DapDimension.java rename to dap4/src/main/java/dap4/core/dmr/DapDimension.java diff --git a/dap4/d4core/src/main/java/dap4/core/dmr/DapEnumConst.java b/dap4/src/main/java/dap4/core/dmr/DapEnumConst.java similarity index 100% rename from dap4/d4core/src/main/java/dap4/core/dmr/DapEnumConst.java rename to dap4/src/main/java/dap4/core/dmr/DapEnumConst.java diff --git a/dap4/d4core/src/main/java/dap4/core/dmr/DapEnumeration.java b/dap4/src/main/java/dap4/core/dmr/DapEnumeration.java similarity index 81% rename from dap4/d4core/src/main/java/dap4/core/dmr/DapEnumeration.java rename to dap4/src/main/java/dap4/core/dmr/DapEnumeration.java index 4a869aa02f..fe611b3637 100644 --- a/dap4/d4core/src/main/java/dap4/core/dmr/DapEnumeration.java +++ b/dap4/src/main/java/dap4/core/dmr/DapEnumeration.java @@ -17,6 +17,33 @@ public class DapEnumeration extends DapType { public static final DapType DEFAULTBASETYPE = DapType.INT32; + ////////////////////////////////////////////////// + // Static Methods + + // See if two enumeration objects appear to be identical + static public boolean same(DapEnumeration enum1, DapEnumeration enum2) { + if (!enum1.getShortName().equals(enum2.getShortName())) + return false; + if (enum1.getBaseType() != enum2.getBaseType()) + return false; + List list1 = enum1.getEnumConsts(); + List list2 = enum2.getEnumConsts(); + if (list1.size() != list2.size()) + return false; + for (DapEnumConst ec1 : list1) { + boolean found = false; + for (DapEnumConst ec2 : list2) { + if (ec1.getShortName().equals(ec2.getShortName()) && ec1.getValue().equals(ec2.getValue())) { + found = true; + break; + } + } + if (!found) + return false; + } + return true; + } + ////////////////////////////////////////////////// // Instance Variables @@ -55,6 +82,10 @@ public DapType getBaseType() { return basetype; } + public List getEnumConsts() { + return constants; + } + public void setBaseType(DapType basetype) { // validate the base type if (!basetype.isIntegerType()) diff --git a/dap4/d4core/src/main/java/dap4/core/dmr/DapGroup.java b/dap4/src/main/java/dap4/core/dmr/DapGroup.java similarity index 92% rename from dap4/d4core/src/main/java/dap4/core/dmr/DapGroup.java rename to dap4/src/main/java/dap4/core/dmr/DapGroup.java index 6cc648183a..7f18408359 100644 --- a/dap4/d4core/src/main/java/dap4/core/dmr/DapGroup.java +++ b/dap4/src/main/java/dap4/core/dmr/DapGroup.java @@ -68,8 +68,14 @@ public void addDecl(DapNode newdecl) throws DapException { // Look for name conflicts (ignore anonymous dimensions) if (newsort != DapSort.DIMENSION || newname != null) { for (DapNode decl : decls) { - if (newsort == decl.getSort() && newname.equals(decl.getShortName())) - throw new DapException("DapGroup: attempt to add duplicate decl: " + newname); + if (newsort == decl.getSort() && newname.equals(decl.getShortName())) { + if (false) { + // If we have duplicate enums, then just use the first one + if (newsort != DapSort.ENUMERATION || !DapEnumeration.same((DapEnumeration) decl, (DapEnumeration) newdecl)) + throw new DapException("DapGroup: attempt to add duplicate decl: " + newname); + } + return; // Duplicate enumeration + } } } else { // Anonymous DapDimension anon = (DapDimension) newdecl; @@ -160,6 +166,15 @@ public List getVariables() { ////////////////////////////////////////////////// // Lookup Functions + // Test for specific decl + public boolean containsDecl(DapNode decl) { + for (DapNode d : getDecls()) { + if (d == decl) + return true; + } + return false; + } + public DapNode findByName(String name, DapSort... sortset) { return findInGroup(name, sortset); } diff --git a/dap4/d4core/src/main/java/dap4/core/dmr/DapMap.java b/dap4/src/main/java/dap4/core/dmr/DapMap.java similarity index 72% rename from dap4/d4core/src/main/java/dap4/core/dmr/DapMap.java rename to dap4/src/main/java/dap4/core/dmr/DapMap.java index af61d4e1f7..18aa008c3c 100644 --- a/dap4/d4core/src/main/java/dap4/core/dmr/DapMap.java +++ b/dap4/src/main/java/dap4/core/dmr/DapMap.java @@ -12,6 +12,8 @@ public class DapMap extends DapNode { DapVariable actualvar = null; + String target = null; + ////////////////////////////////////////////////// // Constructors @@ -19,16 +21,25 @@ public DapMap() { super(); } - public DapMap(DapVariable var) { - this(); - setVariable(var); + public DapMap(String target) { + super(); + this.target = target; + // Use for toString() + this.setShortName(this.target); } ////////////////////////////////////////////////// // Get/set + public String getTargetName() { + if (this.actualvar != null) + return this.actualvar.getFQN(); + else + return this.target; + } + public DapVariable getVariable() { - return actualvar; + return this.actualvar; } public void setVariable(DapVariable var) { diff --git a/dap4/d4core/src/main/java/dap4/core/dmr/DapNode.java b/dap4/src/main/java/dap4/core/dmr/DapNode.java similarity index 93% rename from dap4/d4core/src/main/java/dap4/core/dmr/DapNode.java rename to dap4/src/main/java/dap4/core/dmr/DapNode.java index 584e792383..c28e6ca005 100644 --- a/dap4/d4core/src/main/java/dap4/core/dmr/DapNode.java +++ b/dap4/src/main/java/dap4/core/dmr/DapNode.java @@ -102,8 +102,6 @@ else if (this instanceof DapType) // must follow enumeration this.sort = DapSort.ATOMICTYPE; else if (this instanceof DapEnumConst) this.sort = DapSort.ENUMCONST; - else if (this instanceof DapEnumeration) - this.sort = DapSort.ENUMERATION; else if (this instanceof DapMap) this.sort = DapSort.MAP; else @@ -240,7 +238,8 @@ public DapDataset getDataset() { assert curr != null; next = curr.getGroup(); } while (curr.getSort() != DapSort.DATASET); - setDataset((DapDataset) curr); + // setDataset((DapDataset) curr); + assert (curr != null); } return this.dataset; } @@ -311,7 +310,7 @@ public DapNode getParent() { /** * Set the parent DapNode; may sometimes be same as container, * but not always (think attributes or maps). - * Invariant: parent must be either a group or a variable. + * Invariant: parent must be either a group (including DapDataset) or a variable. * We can infer the container, so set that also. * * @param parent the proposed parent node @@ -319,9 +318,10 @@ public DapNode getParent() { public void setParent(DapNode parent) { assert this.parent == null; assert ((this.getSort() == DapSort.ENUMCONST && parent.getSort() == DapSort.ENUMERATION) - || parent.getSort().isa(DapSort.GROUP) || parent.getSort() == DapSort.VARIABLE - || parent.getSort() == DapSort.STRUCTURE || parent.getSort() == DapSort.SEQUENCE - || this.getSort() == DapSort.ATTRIBUTE || this.getSort() == DapSort.ATTRIBUTESET); + || parent.getSort().isa(DapSort.GROUP) || parent.getSort().isa(DapSort.DATASET) + || parent.getSort() == DapSort.VARIABLE || parent.getSort() == DapSort.STRUCTURE + || parent.getSort() == DapSort.SEQUENCE || this.getSort() == DapSort.ATTRIBUTE + || this.getSort() == DapSort.ATTRIBUTESET); this.parent = parent; } @@ -366,9 +366,8 @@ public String getFQN() { } /** - * Compute the path upto, and including - * some specified containing node (null=>root) - * The containing node is included as is this node. + * Compute the path upto, and including the root Dataset. + * This node is included as last element in path. * * @return ordered list of parent nodes */ @@ -430,8 +429,8 @@ public List getGroupPath() { * Compute the FQN of this node */ public String computefqn() { - List path = getPath(); // excludes root/wrt - StringBuilder fqn = new StringBuilder(); + List path = getPath(); // including root + StringBuilder sfqn = new StringBuilder(); DapNode parent = path.get(0); for (int i = 1; i < path.size(); i++) { // start at 1 to skip root DapNode current = path.get(i); @@ -440,23 +439,22 @@ public String computefqn() { case DATASET: case GROUP: case ENUMERATION: - fqn.append('/'); - fqn.append(Escape.backslashEscape(current.getShortName(), "/.")); + sfqn.append('/'); break; // These use '.' case STRUCTURE: case SEQUENCE: case ENUMCONST: case VARIABLE: - fqn.append('.'); - fqn.append(current.getEscapedShortName()); + sfqn.append('.'); break; default: // Others should never happen throw new IllegalArgumentException("Illegal FQN parent"); } + sfqn.append(current.getEscapedShortName()); parent = current; } - return fqn.toString(); + return sfqn.toString(); } ////////////////////////////////////////////////// @@ -471,10 +469,9 @@ public boolean isTopLevel() { public String toString() { String sortname = (sort == null ? "undefined" : sort.name()); - // String name = getFQN(); - String name = null; + String name = this.fqn; if (name == null) - name = getShortName(); + name = this.shortname; if (name == null) name = "?"; return sortname + "::" + name; diff --git a/dap4/d4core/src/main/java/dap4/core/dmr/DapOtherXML.java b/dap4/src/main/java/dap4/core/dmr/DapOtherXML.java similarity index 100% rename from dap4/d4core/src/main/java/dap4/core/dmr/DapOtherXML.java rename to dap4/src/main/java/dap4/core/dmr/DapOtherXML.java diff --git a/dap4/d4core/src/main/java/dap4/core/dmr/DapSequence.java b/dap4/src/main/java/dap4/core/dmr/DapSequence.java similarity index 100% rename from dap4/d4core/src/main/java/dap4/core/dmr/DapSequence.java rename to dap4/src/main/java/dap4/core/dmr/DapSequence.java diff --git a/dap4/d4core/src/main/java/dap4/core/dmr/DapStructure.java b/dap4/src/main/java/dap4/core/dmr/DapStructure.java similarity index 100% rename from dap4/d4core/src/main/java/dap4/core/dmr/DapStructure.java rename to dap4/src/main/java/dap4/core/dmr/DapStructure.java diff --git a/dap4/d4core/src/main/java/dap4/core/dmr/DapType.java b/dap4/src/main/java/dap4/core/dmr/DapType.java similarity index 100% rename from dap4/d4core/src/main/java/dap4/core/dmr/DapType.java rename to dap4/src/main/java/dap4/core/dmr/DapType.java diff --git a/dap4/d4core/src/main/java/dap4/core/dmr/DapVariable.java b/dap4/src/main/java/dap4/core/dmr/DapVariable.java similarity index 93% rename from dap4/d4core/src/main/java/dap4/core/dmr/DapVariable.java rename to dap4/src/main/java/dap4/core/dmr/DapVariable.java index 483a2de6bb..8c1ba6f9d9 100644 --- a/dap4/d4core/src/main/java/dap4/core/dmr/DapVariable.java +++ b/dap4/src/main/java/dap4/core/dmr/DapVariable.java @@ -22,7 +22,7 @@ public class DapVariable extends DapNode implements DapDecl { protected DapType basetype = null; protected List dimensions = new ArrayList(); protected List maps = new ArrayList(); // maps are ordered - protected int checksum = 0; + protected DapAttribute attributechecksum = null; protected int fieldindex = -1; ////////////////////////////////////////////////// @@ -86,12 +86,12 @@ public void addMap(DapMap map) throws DapException { maps.add(map); } - public int getChecksum() { - return this.checksum; + public DapAttribute getChecksumAttribute() { + return this.attributechecksum; } - public void setChecksum(int csum) { - this.checksum = csum; + public void setAttributeChecksum(DapAttribute csum) { + this.attributechecksum = csum; } public int getFieldIndex() { diff --git a/dap4/d4core/src/main/java/dap4/core/dmr/ErrorResponse.java b/dap4/src/main/java/dap4/core/dmr/ErrorResponse.java similarity index 100% rename from dap4/d4core/src/main/java/dap4/core/dmr/ErrorResponse.java rename to dap4/src/main/java/dap4/core/dmr/ErrorResponse.java diff --git a/dap4/d4core/src/main/java/dap4/core/dmr/TypeSort.java b/dap4/src/main/java/dap4/core/dmr/TypeSort.java similarity index 100% rename from dap4/d4core/src/main/java/dap4/core/dmr/TypeSort.java rename to dap4/src/main/java/dap4/core/dmr/TypeSort.java diff --git a/dap4/d4core/src/main/java/dap4/core/dmr/parser/DOM4Parser.java b/dap4/src/main/java/dap4/core/dmr/parser/DOM4Parser.java similarity index 94% rename from dap4/d4core/src/main/java/dap4/core/dmr/parser/DOM4Parser.java rename to dap4/src/main/java/dap4/core/dmr/parser/DOM4Parser.java index d0d3c900b3..8ba7d4203f 100644 --- a/dap4/d4core/src/main/java/dap4/core/dmr/parser/DOM4Parser.java +++ b/dap4/src/main/java/dap4/core/dmr/parser/DOM4Parser.java @@ -70,6 +70,7 @@ public class DOM4Parser implements Dap4Parser { sortmap.put("sequence", DapSort.SEQUENCE); sortmap.put("structure", DapSort.STRUCTURE); sortmap.put("char", DapSort.VARIABLE); + sortmap.put("byte", DapSort.VARIABLE); sortmap.put("int8", DapSort.VARIABLE); sortmap.put("uint8", DapSort.VARIABLE); sortmap.put("int16", DapSort.VARIABLE); @@ -88,6 +89,7 @@ public class DOM4Parser implements Dap4Parser { typemap = new HashMap(); // se lower cas enames typemap.put("char", TypeSort.Char); + typemap.put("byte", TypeSort.UInt8); // alias typemap.put("int8", TypeSort.Int8); typemap.put("uint8", TypeSort.UInt8); typemap.put("int16", TypeSort.Int16); @@ -280,6 +282,12 @@ protected String pull(Node n, String name) { return attr.getNodeValue(); } + protected boolean notexists(Node n, String name) { + NamedNodeMap map = n.getAttributes(); + Node attr = map.getNamedItem(name); + return (attr == null); + } + ////////////////////////////////////////////////// // Attribute construction @@ -407,6 +415,11 @@ protected void recordattr(DapAttribute attr, DapNode parent) throws ParseExcepti } } + protected boolean isattributeset(Node node) { + String type = pull(node, "type"); + return (nodesort(node) == DapSort.ATTRIBUTE && (isempty(type) || "container".equalsIgnoreCase(type))); + } + ////////////////////////////////////////////////// // Recursive descent parser @@ -545,11 +558,8 @@ else if (type.isAtomic()) recorddecl(v.getBaseType(), group); recorddecl(v, group); break; - case ATTRIBUTESET: - recordattr(parseattrset(n), group); - break; case ATTRIBUTE: - recordattr(parseattr(n), group); + parseattr(n, group, null); break; case OTHERXML: recordattr(parseotherxml(n), group); @@ -692,8 +702,8 @@ protected DapDimension parsedimdef(Node node) throws ParseException { throw new ParseException("Dimdef: Empty dimension declaration size"); try { lvalue = Long.parseLong(size); - if (lvalue <= 0) - throw new ParseException("Dimdef: value <= 0: " + lvalue); + // Allow zero length dimensions ; they will be elided later + // if (lvalue <= 0) throw new ParseException("Dimdef: value <= 0: " + lvalue); } catch (NumberFormatException nfe) { throw new ParseException("Dimdef: non-integer value: " + size); } @@ -855,10 +865,7 @@ protected void fillmetadata(Node node, DapVariable var) throws ParseException { var.addMap(parsemap(n)); break; case ATTRIBUTE: - recordattr(parseattr(n), var); - break; - case ATTRIBUTESET: - recordattr(parseattrset(n), var); + parseattr(n, var, null); break; case OTHERXML: recordattr(parseotherxml(n), var); @@ -916,43 +923,27 @@ protected DapMap parsemap(Node node) throws ParseException { String name = pull(node, "name"); if (isempty(name)) throw new ParseException("Mapref: Empty map name"); - DapVariable target; - try { - target = (DapVariable) this.root.findByFQN(name, DapSort.VARIABLE, DapSort.SEQUENCE, DapSort.STRUCTURE); - } catch (DapException de) { - throw new ParseException(de); - } - if (target == null) - throw new ParseException("Mapref: undefined target variable: " + name); - // Verify that this is a legal map => - // 1. it is outside the scope of its parent if the parent - // is a structure. - DapNode container = target.getContainer(); - DapNode scope; - try { - scope = getParentScope(); - } catch (DapException de) { - throw new ParseException(de); - } - if ((container.getSort() == DapSort.STRUCTURE || container.getSort() == DapSort.SEQUENCE) && container == scope) - throw new ParseException("Mapref: map target variable not in outer scope: " + name); - DapMap map = factory.newMap(target); + DapMap map = factory.newMap(name); if (trace) trace("map.exit"); return map; } - protected DapAttribute parseattr(Node node) throws ParseException { + protected void parseattr(Node node, DapNode parent, String prefix) throws ParseException { try { if (trace) trace("attribute.enter"); + if (isattributeset(node)) { + parseattrset(node, parent); + return; + } String name = pull(node, "name"); if (isempty(name)) throw new ParseException("Attribute: Empty attribute name"); + if (prefix != null) + name = prefix + "." + name; String type = pull(node, "type"); - if (isempty(type)) - type = DEFAULTATTRTYPE; - else if ("Byte".equalsIgnoreCase(type)) + if ("Byte".equalsIgnoreCase(type)) type = "UInt8"; // Convert type to basetype DapType basetype = (DapType) this.root.lookup(type, DapSort.ENUMERATION, DapSort.ATOMICTYPE); @@ -998,44 +989,47 @@ else if ("Byte".equalsIgnoreCase(type)) values.set(i, ds); } attr.setValues(values.toArray(new String[values.size()])); + recordattr(attr, parent); scopestack.pop(); if (trace) trace("attribute.exit"); - return attr; + return; } catch (DapException e) { throw new ParseException(e); } } - protected DapAttributeSet parseattrset(Node node) throws ParseException { + // Attributes in an attributeset are flattened + protected void parseattrset(Node node, DapNode parent) throws ParseException { + parseattrset(node, parent, null); + } + + protected void parseattrset(Node node, DapNode parent, String prefix) throws ParseException { try { if (trace) trace("attrset.enter"); - String name = pull(node, "name"); - if (isempty(name)) - throw new ParseException("AttributeSet: Empty attribute name"); List nslist = parsenamespaces(node); - DapAttributeSet attrset = (DapAttributeSet) makeAttribute(DapSort.ATTRIBUTESET, name, null, nslist); - scopestack.push(attrset); + String setname = pull(node, "name"); + if (isempty(setname)) + throw new ParseException("Attribute: Empty attribute set name"); + String nextprefix = (prefix == null ? setname : prefix + "." + setname); List nodes = getSubnodes(node); for (int i = 0; i < nodes.size(); i++) { Node n = nodes.get(i); DapSort sort = nodesort(n); switch (sort) { case ATTRIBUTE: - recordattr(parseattr(n), attrset); - break; - case ATTRIBUTESET: - recordattr(parseattrset(n), attrset); + if (isattributeset(n)) + parseattrset(node, parent, nextprefix); + else + parseattr(n, parent, nextprefix); break; default: throw new ParseException("Unexpected attribute set element: " + n); } } - scopestack.pop(); if (trace) trace("attributeset.exit"); - return attrset; } catch (DapException e) { throw new ParseException(e); } diff --git a/dap4/d4core/src/main/java/dap4/core/dmr/parser/Dap4Parser.java b/dap4/src/main/java/dap4/core/dmr/parser/Dap4Parser.java similarity index 100% rename from dap4/d4core/src/main/java/dap4/core/dmr/parser/Dap4Parser.java rename to dap4/src/main/java/dap4/core/dmr/parser/Dap4Parser.java diff --git a/dap4/d4core/src/main/java/dap4/core/dmr/parser/ParseException.java b/dap4/src/main/java/dap4/core/dmr/parser/ParseException.java similarity index 100% rename from dap4/d4core/src/main/java/dap4/core/dmr/parser/ParseException.java rename to dap4/src/main/java/dap4/core/dmr/parser/ParseException.java diff --git a/dap4/d4core/src/main/java/dap4/core/dmr/parser/ParseUtil.java b/dap4/src/main/java/dap4/core/dmr/parser/ParseUtil.java similarity index 100% rename from dap4/d4core/src/main/java/dap4/core/dmr/parser/ParseUtil.java rename to dap4/src/main/java/dap4/core/dmr/parser/ParseUtil.java diff --git a/dap4/src/main/java/dap4/core/interfaces/CEConstraintIF.java b/dap4/src/main/java/dap4/core/interfaces/CEConstraintIF.java new file mode 100644 index 0000000000..5e4621c89b --- /dev/null +++ b/dap4/src/main/java/dap4/core/interfaces/CEConstraintIF.java @@ -0,0 +1,24 @@ +/* + * Copyright 2012, UCAR/Unidata. + * See the LICENSE file for more information. + */ + +package dap4.core.interfaces; + +import dap4.core.dmr.DapNode; + +public interface CEConstraintIF { + + ////////////////////////////////////////////////// + // Reference processing + + /** + * Reference X match + * + * @param node to test + * @return true if node is referenced by this constraint + */ + + public boolean references(DapNode node); + +} diff --git a/dap4/src/main/java/dap4/core/interfaces/DataCursor.java b/dap4/src/main/java/dap4/core/interfaces/DataCursor.java new file mode 100644 index 0000000000..4e2e5fb67c --- /dev/null +++ b/dap4/src/main/java/dap4/core/interfaces/DataCursor.java @@ -0,0 +1,53 @@ +/* + * Copyright 2012, UCAR/Unidata. + * See the LICENSE file for more information. + */ + +package dap4.core.interfaces; + +import dap4.core.dmr.DapNode; +import dap4.core.util.DapException; +import dap4.core.util.Slice; +import ucar.ma2.Index; + +import java.util.List; + +/** + * For data access, we adopt a cursor model. + * This comes from database technology where a + * cursor object is used to walk over the + * results of a database query. Here the cursor + * walks the underlying data and stores enough + * state to extract data depending on its + * sort. The cursor may (or may not) contain + * internal subclasses to track various kinds of + * state. + */ + +/** + * This Interface it to allow references to Cursor functionality + * where the cursor object is defined in some non contained code tree. + * Note also this this Interface is shared by both client and server. + */ + +public interface DataCursor { + ////////////////////////////////////////////////// + // Kinds of Cursor + + public static enum Scheme { + ATOMIC, STRUCTARRAY, STRUCTURE, SEQARRAY, SEQUENCE, RECORD; + + public boolean isCompoundArray() { + return this == STRUCTARRAY || this == SEQARRAY; + } + } + + ////////////////////////////////////////////////// + // API + + public Scheme getScheme(); + + public DapNode getTemplate(); + + public boolean isScalar(); +} diff --git a/dap4/src/main/java/dap4/core/interfaces/DataIndex.java b/dap4/src/main/java/dap4/core/interfaces/DataIndex.java new file mode 100644 index 0000000000..f8f05408cb --- /dev/null +++ b/dap4/src/main/java/dap4/core/interfaces/DataIndex.java @@ -0,0 +1,23 @@ +/* + * Copyright 2012, UCAR/Unidata. + * See the LICENSE file for more information. + */ + +package dap4.core.interfaces; + +public interface DataIndex { + + public int getRank(); + + public int[] getCurrentCounter(); + + public int getCurrentCounter(int i); + + public int[] getShape(); + + public int getShape(int i); + + public int index(); + + public boolean isScalar(); +} diff --git a/dap4/src/main/java/dap4/core/util/ChecksumMode.java b/dap4/src/main/java/dap4/core/util/ChecksumMode.java new file mode 100644 index 0000000000..48f88f50dd --- /dev/null +++ b/dap4/src/main/java/dap4/core/util/ChecksumMode.java @@ -0,0 +1,62 @@ +/* + * Copyright 2012, UCAR/Unidata. + * See the LICENSE file for more information. + */ + +package dap4.core.util; + +/** + * Define possible checksum modes: + * + */ +public enum ChecksumMode { + NONE, // => dap4.checksum was not specified + FALSE, // => dap4.checksum=false + TRUE; // => dap4.checksum=true + + static public final ChecksumMode dfalt = TRUE; // Must be TRUE|FALSE + + static final String[] trues = new String[] {"true", "on", "yes", "1"}; + static final String[] falses = new String[] {"false", "off", "no", "0"}; + + static public String toString(ChecksumMode mode) { + if (mode == null) + mode = ChecksumMode.dfalt; + switch (mode) { + case NONE: + return toString(ChecksumMode.FALSE); + case FALSE: + return "false"; + case TRUE: + return "true"; + } + return ChecksumMode.toString(dfalt); + } + + static public ChecksumMode modeFor(String s) { + if (s == null || s.length() == 0) + return null; + for (String f : falses) { + if (f.equalsIgnoreCase(s)) + return FALSE; + } + for (String t : trues) { + if (t.equalsIgnoreCase(s)) + return TRUE; + } + return null; + } + + /** + * force mode to be TRUE or FALSE + * + * @param mode + * @return TRUE|FALSE + */ + static public ChecksumMode asTrueFalse(ChecksumMode mode) { + if (mode == null || mode == NONE) + mode = dfalt; + return mode; + } + +} diff --git a/dap4/d4core/src/main/java/dap4/core/util/ConversionException.java b/dap4/src/main/java/dap4/core/util/ConversionException.java similarity index 100% rename from dap4/d4core/src/main/java/dap4/core/util/ConversionException.java rename to dap4/src/main/java/dap4/core/util/ConversionException.java diff --git a/dap4/d4core/src/main/java/dap4/core/util/Convert.java b/dap4/src/main/java/dap4/core/util/Convert.java similarity index 99% rename from dap4/d4core/src/main/java/dap4/core/util/Convert.java rename to dap4/src/main/java/dap4/core/util/Convert.java index 8bbf6ef2ce..c0661008d5 100644 --- a/dap4/d4core/src/main/java/dap4/core/util/Convert.java +++ b/dap4/src/main/java/dap4/core/util/Convert.java @@ -304,6 +304,7 @@ else if (lvalues != null) for (int i = 0; i < count; i++) { fresult[i] = (float) dvalues[i]; } + result = fresult; break; case Float64: if (svalues != null) diff --git a/dap4/d4core/src/main/java/dap4/core/util/CoreTypeFcns.java b/dap4/src/main/java/dap4/core/util/CoreTypeFcns.java similarity index 100% rename from dap4/d4core/src/main/java/dap4/core/util/CoreTypeFcns.java rename to dap4/src/main/java/dap4/core/util/CoreTypeFcns.java diff --git a/dap4/src/main/java/dap4/core/util/DapConstants.java b/dap4/src/main/java/dap4/core/util/DapConstants.java new file mode 100644 index 0000000000..d0e88c89c3 --- /dev/null +++ b/dap4/src/main/java/dap4/core/util/DapConstants.java @@ -0,0 +1,72 @@ +/* + * Copyright 2012, UCAR/Unidata. + * See the LICENSE file for more information. + */ + +package dap4.core.util; + +import dap4.core.dmr.*; +import java.io.*; +import java.math.BigInteger; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.nio.charset.Charset; +import java.util.ArrayDeque; +import java.util.ArrayList; +import java.util.Deque; +import java.util.List; + +/** + * DAP4 Related Constants both client and server side. + */ + +public abstract class DapConstants { + ////////////////////////////////////////////////// + // Constants + + // Default http protocol + // Default http protocol + public static final String HTTPSCHEME = "http:"; + + // XML Tags for DAP4 + public static final String X_DAP_SERVER = "TDS-5"; + public static final String X_DAP_VERSION = "4.0"; + public static final String X_DMR_VERSION = "1.0"; + public static final String X_DAP_NS = "http://xml.opendap.org/ns/DAP/4.0#"; + + // Known dap4 specific query tags + public static final String CONSTRAINTTAG = "dap4.ce"; + public static final String CHECKSUMTAG = "dap4.checksum"; // May also be in fragment + + // Define the Serialization Constants common to servlet and client + + // Use Bit flags to avoid heavyweight enumset + public static final int CHUNK_DATA = 0; // bit 0 : value 0 + public static final int CHUNK_END = 1; // bit 0 : value 1 + public static final int CHUNK_ERROR = 2; // bit 1 : value 1 + public static final int CHUNK_LITTLE_ENDIAN = 4; // bit 2: value 1 + + // Construct the union of all flags + public static final int CHUNK_ALL = CHUNK_DATA | CHUNK_ERROR | CHUNK_END | CHUNK_LITTLE_ENDIAN; + public static final int COUNTSIZE = 8; // databuffer as specified by the DAP4 spec + public static final int CHECKSUMSIZE = 4; // bytes if CRC32 + public static final String DIGESTER = "CRC32"; + public static final String CHECKSUMATTRNAME = "_DAP4_Checksum_CRC32"; + public static final String LITTLEENDIANATTRNAME = "_DAP4_Little_Endian"; + public static final String CEATTRNAME = "_" + CONSTRAINTTAG; + + + ////////////////////////////////////////////////// + // Constants via Enumerations + + public enum ChecksumSource { + LOCAL, REMOTE + }; + + ////////////////////////////////////////////////// + // Dap4 Annotations + + public static final String DAP4ENDIANTAG = "ucar.littleendian"; // value = 1 | 0 + // public static final String DAP4TESTTAG = "ucar.testing"; // value = NONE|DAP|DMR|ALL + +} diff --git a/dap4/d4core/src/main/java/dap4/core/util/DapContext.java b/dap4/src/main/java/dap4/core/util/DapContext.java similarity index 67% rename from dap4/d4core/src/main/java/dap4/core/util/DapContext.java rename to dap4/src/main/java/dap4/core/util/DapContext.java index 0edcad7b16..98d89ada3f 100644 --- a/dap4/d4core/src/main/java/dap4/core/util/DapContext.java +++ b/dap4/src/main/java/dap4/core/util/DapContext.java @@ -5,6 +5,7 @@ package dap4.core.util; +import java.util.List; import java.util.Map; /** @@ -19,6 +20,14 @@ public DapContext() { super(); } + public DapContext insert(Map map, boolean override) { + for (Map.Entry entry : map.entrySet()) { + if (!super.containsKey(entry.getKey()) || override) + super.put(entry.getKey(), entry.getValue()); + } + return this; + } + public String toString() { StringBuilder buf = new StringBuilder("DapContext{"); boolean first = true; @@ -26,11 +35,11 @@ public String toString() { if (!first) buf.append(","); buf.append("|"); - buf.append(entry.getKey().toString()); + buf.append(DapUtil.stringable(entry.getKey()).toString()); buf.append("|"); buf.append("="); buf.append("|"); - buf.append(entry.getValue().toString()); + buf.append(DapUtil.stringable(entry.getValue()).toString()); buf.append("|"); first = false; } diff --git a/dap4/d4core/src/main/java/dap4/core/util/DapDump.java b/dap4/src/main/java/dap4/core/util/DapDump.java similarity index 74% rename from dap4/d4core/src/main/java/dap4/core/util/DapDump.java rename to dap4/src/main/java/dap4/core/util/DapDump.java index 4b08734729..5f0db41c57 100644 --- a/dap4/d4core/src/main/java/dap4/core/util/DapDump.java +++ b/dap4/src/main/java/dap4/core/util/DapDump.java @@ -23,7 +23,7 @@ public abstract class DapDump { ////////////////////////////////////////////////// // Provide a simple dump of binary data - public static void dumpbytes(ByteBuffer buf0, boolean skipdmr) { + static public void dumpbytesbuf(ByteBuffer buf0, boolean skipdmr) { int savepos = buf0.position(); int limit0 = buf0.limit(); int skipcount = 0; @@ -48,7 +48,7 @@ public static void dumpbytes(ByteBuffer buf0, boolean skipdmr) { System.err.println("order=" + buf0.order()); ByteBuffer buf = ByteBuffer.wrap(bytes).order(buf0.order()); - dumpbytes(buf); + dumpbytesbuf(buf); } /** @@ -56,7 +56,7 @@ public static void dumpbytes(ByteBuffer buf0, boolean skipdmr) { * * @param buf0 byte buffer to dump */ - public static void dumpbytes(ByteBuffer buf0) { + static public void dumpbytesbuf(ByteBuffer buf0) { int stop = buf0.limit(); int size = stop + 8; int savepos = buf0.position(); @@ -70,6 +70,8 @@ public static void dumpbytes(ByteBuffer buf0) { buf.limit(size); int i = 0; try { + System.err.printf("[pos] X U S C\t I UI XI Sh USh%n"); + System.err.println("-------------------------------------------------------------------------------------"); for (i = 0; buf.position() < stop; i++) { savepos = buf.position(); int iv = buf.getInt(); @@ -91,9 +93,9 @@ else if (c == '\n') s = "\\n"; else if (c < ' ' || c >= 0x7f) s = "?"; - System.err.printf("[%03d] %02x %03d %4d '%s'", i, ub, ub, ib, s); - System.err.printf("\t%12d 0x%08x", iv, uiv); - System.err.printf("\t%5d\t0x%04x", sv, usv); + System.err.printf("[%03d] 0x%02x %03d %04d '%s'", i, ub, ub, ib, s); + System.err.printf("\t%12d %12d 0x%08x", iv, uiv, uiv); + System.err.printf(" %8d %8d", sv, usv); System.err.println(); System.err.flush(); } @@ -107,27 +109,27 @@ else if (c < ' ' || c >= 0x7f) } } - public static void dumpbytestream(OutputStream stream, ByteOrder order, String tag) { + static public void dumpbytesstream(OutputStream stream, ByteOrder order, String tag) { if (stream instanceof ByteArrayOutputStream) { byte[] content = ((ByteArrayOutputStream) stream).toByteArray(); - dumpbytestream(content, order, tag); + dumpbytesraw(content, order, tag); } } - public static void dumpbytestream(ByteBuffer buf, ByteOrder order, String tag) { - dumpbytestream(buf.array(), 0, buf.position(), order, tag); + static public void dumpbytesrawbuf(ByteBuffer buf, ByteOrder order, String tag) { + dumpbytesraw(buf.array(), 0, buf.limit(), order, tag); } - public static void dumpbytestream(byte[] content, ByteOrder order, String tag) { - dumpbytestream(content, 0, content.length, order, tag); + static public void dumpbytesraw(byte[] content, ByteOrder order, String tag) { + dumpbytesraw(content, 0, content.length, order, tag); } - public static void dumpbytestream(byte[] content, int start, int len, ByteOrder order, String tag) { + static public void dumpbytesraw(byte[] content, int start, int len, ByteOrder order, String tag) { System.err.println("++++++++++ " + tag + " ++++++++++ "); ByteBuffer tmp = ByteBuffer.wrap(content).order(order); tmp.position(start); tmp.limit(len); - DapDump.dumpbytes(tmp); + DapDump.dumpbytesbuf(tmp); System.err.println("++++++++++ " + tag + " ++++++++++ "); System.err.flush(); } diff --git a/dap4/d4core/src/main/java/dap4/core/util/DapException.java b/dap4/src/main/java/dap4/core/util/DapException.java similarity index 100% rename from dap4/d4core/src/main/java/dap4/core/util/DapException.java rename to dap4/src/main/java/dap4/core/util/DapException.java diff --git a/dap4/d4core/src/main/java/dap4/core/util/DapIterator.java b/dap4/src/main/java/dap4/core/util/DapIterator.java similarity index 100% rename from dap4/d4core/src/main/java/dap4/core/util/DapIterator.java rename to dap4/src/main/java/dap4/core/util/DapIterator.java diff --git a/dap4/d4core/src/main/java/dap4/core/util/DapSort.java b/dap4/src/main/java/dap4/core/util/DapSort.java similarity index 100% rename from dap4/d4core/src/main/java/dap4/core/util/DapSort.java rename to dap4/src/main/java/dap4/core/util/DapSort.java diff --git a/dap4/d4core/src/main/java/dap4/core/util/DapUtil.java b/dap4/src/main/java/dap4/core/util/DapUtil.java similarity index 69% rename from dap4/d4core/src/main/java/dap4/core/util/DapUtil.java rename to dap4/src/main/java/dap4/core/util/DapUtil.java index 11f985b584..1ff9d7be11 100644 --- a/dap4/d4core/src/main/java/dap4/core/util/DapUtil.java +++ b/dap4/src/main/java/dap4/core/util/DapUtil.java @@ -6,6 +6,8 @@ package dap4.core.util; import dap4.core.dmr.*; +import dap4.core.interfaces.DataIndex; + import java.io.*; import java.math.BigInteger; import java.nio.ByteBuffer; @@ -15,6 +17,8 @@ import java.util.ArrayList; import java.util.Deque; import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; /** * Misc. Utility methods @@ -25,43 +29,24 @@ public abstract class DapUtil // Should only contain static methods ////////////////////////////////////////////////// // Constants - public static final BigInteger BIG_UMASK64 = new BigInteger("FFFFFFFFFFFFFFFF", 16); - public static final Charset UTF8 = Charset.forName("UTF-8"); + static public final BigInteger BIG_UMASK64 = new BigInteger("FFFFFFFFFFFFFFFF", 16); + static public final Charset UTF8 = Charset.forName("UTF-8"); // Define the Serialization Constants common to servlet and client - public static final ByteOrder NETWORK_ORDER = ByteOrder.BIG_ENDIAN; - public static final ByteOrder NATIVE_ORDER = ByteOrder.nativeOrder(); - - // Use Bit flags to avoid heavyweight enumset - public static final int CHUNK_DATA = 0; // bit 0 : value 0 - public static final int CHUNK_END = 1; // bit 0 : value 1 - public static final int CHUNK_ERROR = 2; // bit 1 : value 1 - public static final int CHUNK_LITTLE_ENDIAN = 4; // bit 2: value 1 - public static final int CHUNK_NOCHECKSUM = 8; // bit 2: value 1 - - // Construct the union of all flags - public static final int CHUNK_ALL = CHUNK_DATA | CHUNK_ERROR | CHUNK_END | CHUNK_LITTLE_ENDIAN; - - public static final String LF = "\n"; - public static final String CRLF = "\r\n"; - public static final int CRLFSIZE = 2; - - // static final public int CHECKSUMSIZE = 16; // bytes if MD5 - // static final public String DIGESTOR = "MD5"; + static public final ByteOrder NETWORK_ORDER = ByteOrder.BIG_ENDIAN; + static public final ByteOrder NATIVE_ORDER = ByteOrder.nativeOrder(); - public static final int CHECKSUMSIZE = 4; // bytes if CRC32 - public static final String DIGESTER = "CRC32"; - public static final String CHECKSUMATTRNAME = "_DAP4_Checksum_CRC32"; - public static final String LITTLEENDIANATTRNAME = "_DAP4_Little_Endian"; - public static final String CEATTRNAME = "_dap4.ce"; + static public final String LF = "\n"; + static public final String CRLF = "\r\n"; + static public final int CRLFSIZE = 2; - public static final String DRIVELETTERS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; + static public Pattern DAP4EXT_RE = Pattern.compile("^.*(.dmr|.dap|.dsr|.xml|.html)$"); ////////////////////////////////////////////////// // return last name part of an fqn; result will be escaped. - public static String fqnSuffix(String fqn) { + static public String fqnSuffix(String fqn) { int structindex = fqn.lastIndexOf('.'); int groupindex = fqn.lastIndexOf('/'); if (structindex >= 0) @@ -71,7 +56,7 @@ public static String fqnSuffix(String fqn) { } // return prefix name part of an fqn; result will be escaped. - public static String fqnPrefix(String fqn) { + static public String fqnPrefix(String fqn) { int structindex = fqn.lastIndexOf('.'); int groupindex = fqn.lastIndexOf('/'); if (structindex >= 0) @@ -89,7 +74,7 @@ public static String fqnPrefix(String fqn) { * @return a List of strings (all with escaping still intact) * representing s split at unescaped instances of sep. */ - public static List backslashSplit(String s, char sep) { + static public List backslashSplit(String s, char sep) { List path = new ArrayList(); int len = s.length(); StringBuilder piece = new StringBuilder(); @@ -109,7 +94,7 @@ public static List backslashSplit(String s, char sep) { return path; } - public static Integer stringToInteger(String s) { + static public Integer stringToInteger(String s) { try { return Integer.parseInt(s); } catch (NumberFormatException e) { @@ -117,7 +102,7 @@ public static Integer stringToInteger(String s) { } } - public static boolean hasSequence(DapNode node) { + static public boolean hasSequence(DapNode node) { switch (node.getSort()) { case SEQUENCE: return true; @@ -154,7 +139,7 @@ public static boolean hasSequence(DapNode node) { * false if we are looking for a file * @return absolute path of the file or null */ - public static String locateFile(String filename, String abspath, boolean wantdir) { + static public String locateFile(String filename, String abspath, boolean wantdir) { Deque q = new ArrayDeque(); // clean up the path and filename filename = filename.trim().replace('\\', '/'); @@ -201,7 +186,7 @@ public static String locateFile(String filename, String abspath, boolean wantdir * false if we are looking for a file * @return absolute path of the file|dir wrt to abspath */ - public static String locateRelative(String relpath, String abspath, boolean wantdir) { + static public String locateRelative(String relpath, String abspath, boolean wantdir) { // clean up the path and filename relpath = relpath.trim().replace('\\', '/'); if (relpath.charAt(0) == '/') @@ -231,7 +216,7 @@ public static String locateRelative(String relpath, String abspath, boolean want * @param path convert this path * @return canonicalized version */ - public static String canonicalpath(String path) { + static public String canonicalpath(String path) { if (path == null) return null; path = path.trim(); @@ -240,7 +225,7 @@ public static String canonicalpath(String path) { path = path.substring(0, path.length() - 1); boolean abs = (path.length() > 0 && path.charAt(0) == '/'); if (abs) - path = path.substring(1); // temporary + path = path.substring(1); // temporarily remove leading '/' if (DapUtil.hasDriveLetter(path)) { // As a last step, lowercase the drive letter, if any path = path.substring(0, 1).toLowerCase() + path.substring(1); @@ -249,8 +234,11 @@ public static String canonicalpath(String path) { return path; } - public static String relativize(String path) { - if (path != null) { + static public String relativize(String path) { + if (path == null) + return path; + path = path.replace('\\', '/'); + if (path.length() > 0) { if (path.startsWith("/")) path = path.substring(1); if (hasDriveLetter(path)) @@ -259,13 +247,13 @@ public static String relativize(String path) { return path; } - public static String absolutize(String path) { + static public String absolutize(String path) { if (path != null && !path.startsWith("/") && !hasDriveLetter(path)) path = "/" + path; return path; } - public static boolean checkFixedSize(DapVariable var) { + static public boolean checkFixedSize(DapVariable var) { DapType dt = var.getBaseType(); switch (dt.getTypeSort()) { case Structure: @@ -289,7 +277,7 @@ public static boolean checkFixedSize(DapVariable var) { * as defined by the buffer limit. * @return The byte array contents of the buffer */ - public static byte[] extract(ByteBuffer buf) { + static public byte[] extract(ByteBuffer buf) { int len = buf.limit(); byte[] bytes = new byte[len]; buf.rewind(); @@ -297,7 +285,7 @@ public static byte[] extract(ByteBuffer buf) { return bytes; } - public static byte[] readbinaryfile(InputStream stream) throws IOException { + static public byte[] readbinaryfile(InputStream stream) throws IOException { // Extract the stream into a bytebuffer ByteArrayOutputStream bytes = new ByteArrayOutputStream(); byte[] tmp = new byte[1 << 16]; @@ -315,7 +303,35 @@ public static byte[] readbinaryfile(InputStream stream) throws IOException { return bytes.toByteArray(); } - public static String readtextfile(InputStream stream) throws IOException { + /** + * Read a limited number of bytes from a stream + * + * @param stream + * @param buffer into which to read + * @parm offset place to start read into buffer + * @param count amount to read; <= |buffer| + * @return amount actually read + * @throws IOException + */ + static public int readbinaryfilepartial(InputStream stream, byte[] buffer, int count) throws IOException { + try { + // Extract the stream into a bytebuffer + int offset = 0; + int remainder = count; + while (remainder > 0) { + int red = stream.read(buffer, offset, remainder); + if (red <= 0) + break; + remainder -= red; + offset += red; + } + return offset; + } catch (IOException ioe) { + throw new dap4.core.util.DapException(ioe); + } + } + + static public String readtextfile(InputStream stream) throws IOException { StringBuilder buf = new StringBuilder(); InputStreamReader rdr = new InputStreamReader(stream, UTF8); for (;;) { @@ -332,7 +348,7 @@ public static String readtextfile(InputStream stream) throws IOException { * top-level variable to and including the given variable * such that all but the last element is a structure. */ - public static List getStructurePath(DapVariable var) { + static public List getStructurePath(DapVariable var) { List path = var.getPath(); List structpath = new ArrayList(); for (int i = 0; i < path.size(); i++) { @@ -357,21 +373,31 @@ public static List getStructurePath(DapVariable var) { * @param path * @return path or "" */ - public static String denullify(String path) { + static public String denullify(String path) { return (path == null ? "" : path); } + /** + * Convert null objects to "" + * + * @param obj + * @return obj or "" + */ + static public Object stringable(Object obj) { + return (obj == null ? "" : obj); + } + /** * Convert "" paths to null * * @param path * @return path or null */ - public static String nullify(String path) { + static public String nullify(String path) { return (path != null && path.length() == 0 ? null : path); } - public static long[] getDimSizes(List dims) { + static public long[] getDimSizes(List dims) { long[] sizes = new long[dims.size()]; for (int i = 0; i < dims.size(); i++) { sizes[i] = dims.get(i).getSize(); @@ -379,7 +405,7 @@ public static long[] getDimSizes(List dims) { return sizes; } - public static long dimProduct(List dimset) // dimension crossproduct + static public long dimProduct(List dimset) // dimension crossproduct { long count = 1; for (DapDimension dim : dimset) { @@ -421,7 +447,7 @@ public static long dimProduct(List dimset) // dimension crossprodu * @param dimset the list of DapDimension * @return true if slices is whole wrt dimset; false otherwise */ - public static boolean isWhole(List slices, List dimset) { + static public boolean isWhole(List slices, List dimset) { if (slices.size() != dimset.size()) return false; for (int i = 0; i < slices.size(); i++) { @@ -433,7 +459,7 @@ public static boolean isWhole(List slices, List dimset) { return true; } - public static long sliceProduct(List slices) // another crossproduct + static public long sliceProduct(List slices) // another crossproduct { long count = 1; if (slices != null) @@ -443,7 +469,7 @@ public static long sliceProduct(List slices) // another crossproduct return count; } - public static boolean hasStrideOne(List slices) { + static public boolean hasStrideOne(List slices) { for (Slice slice : slices) { if (slice.getStride() != 1) return false; @@ -462,7 +488,7 @@ public static boolean hasStrideOne(List slices) { * @param upto end point for join (exclusive) * @return the join */ - public static String join(String[] array, String sep, int from, int upto) { + static public String join(String[] array, String sep, int from, int upto) { if (sep == null) sep = ""; if (from < 0 || upto > array.length) @@ -485,22 +511,30 @@ public static String join(String[] array, String sep, int from, int upto) { * @param path * @return Relativized path */ - public static String xrelpath(String path) { + static public String xrelpath(String path) { return DapUtil.canonicalpath(path); } /** - * return true if this path appears to start with a windows drive letter + * Return true if this path appears to start with a windows drive letter + * This tests the patterns "/x:/" and "x:/" * * @param path * @return true, if path has drive letter */ - public static boolean hasDriveLetter(String path) { - boolean hasdr = false; - if (path != null && path.length() >= 2) { - hasdr = (DRIVELETTERS.indexOf(path.charAt(0)) >= 0 && path.charAt(1) == ':'); - } - return hasdr; + static public boolean hasDriveLetter(String path) { + return XURI.hasDriveLetter(path); + } + + /** + * Convert a path of the form "/x:/" to "x:/" to expose drive letter; + * otherwise leave unchanged + * + * @param path + * @return repaired path + */ + static public String repairPath(String path) { + return XURI.hideDriveLetter(path); } /** @@ -510,7 +544,7 @@ public static boolean hasDriveLetter(String path) { * @param breakpoint return the index past last protocol * @return list of leading protocols without the trailing : */ - public static List getProtocols(String url, int[] breakpoint) { + static public List getProtocols(String url, int[] breakpoint) { // break off any leading protocols; // there may be more than one. // Watch out for Windows paths starting with a drive letter. @@ -540,7 +574,7 @@ public static List getProtocols(String url, int[] breakpoint) { return allprotocols; } - public static String merge(String[] pieces, String sep) { + static public String merge(String[] pieces, String sep) { if (pieces == null) return ""; StringBuilder buf = new StringBuilder(); @@ -573,12 +607,12 @@ static String multiSliceString(List> slices) { /** * Re-throw run-time exceptions */ - public static void checkruntime(Exception e) { + static public void checkruntime(Exception e) { if (e instanceof RuntimeException) throw (RuntimeException) e; } - public static String canonjoin(String prefix, String suffix) { + static public String canonjoin(String prefix, String suffix) { StringBuilder result = new StringBuilder(); if (prefix == null) prefix = ""; @@ -587,13 +621,19 @@ public static String canonjoin(String prefix, String suffix) { prefix = DapUtil.canonicalpath(prefix); suffix = DapUtil.canonicalpath(suffix); result.append(prefix); - if (!prefix.endsWith("/")) - result.append("/"); - result.append(suffix.startsWith("/") ? suffix.substring(1) : suffix); + result.append("/"); + result.append(suffix); + // Remove // occurrences + while (true) { + int pos = result.indexOf("//"); + if (pos < 0) + break; + result.deleteCharAt(pos); + } return result.toString(); } - public static boolean hasWindowsDrive(final String path) { + static public boolean hasWindowsDrive(final String path) { if (path != null && path.length() >= 2 && path.charAt(1) == ':') { final char c = path.charAt(0); return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'); @@ -601,94 +641,35 @@ public static boolean hasWindowsDrive(final String path) { return false; } - public static boolean isAbsolutePath(final String path) { + static public boolean isAbsolutePath(final String path) { return path != null && (hasWindowsDrive(path) || path.charAt(0) == '/' || path.charAt(0) == '\\'); } - public static String canonFileURL(String url) { + static public String canonFileURL(String url) { if (url == null || url.startsWith("file:")) return url; return "file:" + absolutize(url); } - ////////////////////////////////////////////////// - - /** - * Helper functions for reading - */ - - /** - * Provide a helper function to convert an Index object to - * a slice list. - * - * @param indices indicate value to read - * @param template variable template - * @return corresponding List - * @throws DapException - */ - - public static List indexToSlices(Index indices, DapVariable template) throws dap4.core.util.DapException { - List dims = template.getDimensions(); - List slices = indexToSlices(indices, dims); - return slices; - } - - public static List indexToSlices(Index indices, List dimset) throws dap4.core.util.DapException { - List slices = indexToSlices(indices); - return slices; - } - - /** - * Provide a helper function to convert an offset to - * a slice list. - * - * @param offset offset - * @param template variable template - * - * @return slices - * @throws DapException - */ - public static List offsetToSlices(long offset, DapVariable template) throws DapException { - List dims = template.getDimensions(); - long[] dimsizes = DapUtil.getDimSizes(dims); - return indexToSlices(offsetToIndex(offset, dimsizes), template); + static public String stripDap4Extensions(String path) { + for (;;) { + Matcher m = DAP4EXT_RE.matcher(path); + if (!m.matches()) + break; + String match = m.group(1); + int pathlen = path.length(); + path = path.substring(0, pathlen - match.length()); + } + return path; } - /** - * Given an offset (single index) and a set of dimensions - * compute the set of dimension indices that correspond - * to the offset. - */ - public static Index offsetToIndex(long offset, long[] dimsizes) { - // offset = d3*(d2*(d1*(x1))+x2)+x3 - long[] indices = new long[dimsizes.length]; - for (int i = dimsizes.length - 1; i >= 0; i--) { - indices[i] = offset % dimsizes[i]; - offset = (offset - indices[i]) / dimsizes[i]; - } - return new Index(indices, dimsizes); - } + ////////////////////////////////////////////////// /** - * Given an offset (single index) and a set of dimensions - * compute the set of dimension indices that correspond - * to the offset. + * Helper functions for reading */ - public static List indexToSlices(Index indices) throws DapException { - // short circuit the scalar case - if (indices.getRank() == 0) - return Slice.SCALARSLICES; - // offset = d3*(d2*(d1*(x1))+x2)+x3 - List slices = new ArrayList<>(indices.rank); - for (int i = 0; i < indices.rank; i++) { - long isize = indices.indices[i]; - slices.add(new Slice(isize, isize + 1, 1, indices.dimsizes[i])); - } - return slices; - } - /** * Test if a set of slices represent a contiguous region * This is equivalent to saying all strides are one @@ -696,7 +677,7 @@ public static List indexToSlices(Index indices) throws DapException { * @param slices * @return true, if contiguous */ - public static boolean isContiguous(List slices) { + static public boolean isContiguous(List slices) { for (Slice sl : slices) { if (sl.getStride() != 1) return false; @@ -710,7 +691,7 @@ public static boolean isContiguous(List slices) { * @param slices * @return true, if single position */ - public static boolean isSinglePoint(List slices) { + static public boolean isSinglePoint(List slices) { for (Slice sl : slices) { if (sl.getCount() != 1) return false; @@ -718,29 +699,8 @@ public static boolean isSinglePoint(List slices) { return true; } - /** - * If a set of slices refers to a single position, - * then return the corresponding Index. Otherwise, - * throw Exception. - * - * @param slices - * @return Index corresponding to slices - * @throws DapException - */ - public static Index slicesToIndex(List slices) throws DapException { - long[] positions = new long[slices.size()]; - long[] dimsizes = new long[slices.size()]; - for (int i = 0; i < positions.length; i++) { - Slice s = slices.get(i); - if (s.getCount() != 1) - throw new DapException("Attempt to convert non-singleton sliceset to index"); - positions[i] = s.getFirst(); - dimsizes[i] = s.getMax(); - } - return new Index(positions, dimsizes); - } - public static List dimsetToSlices(List dimset) throws dap4.core.util.DapException { + static public List dimsetToSlices(List dimset) throws dap4.core.util.DapException { if (dimset == null || dimset.size() == 0) return Slice.SCALARSLICES; List slices = new ArrayList(dimset.size()); @@ -752,12 +712,25 @@ public static List dimsetToSlices(List dimset) throws dap4. return slices; } - public static boolean isScalarSlices(List slices) { + static public boolean isScalarSlices(List slices) { if (slices == null || slices.size() != 1) return false; Slice s = slices.get(0); return (s.getFirst() == 0 && s.getStop() == 1); } + static public long[] longvector(int[] iv) { + long[] lv = new long[iv.length]; + for (int i = 0; i < iv.length; i++) + lv[i] = (long) iv[i]; + return lv; + } + + static public int[] intvector(long[] lv) { + int[] iv = new int[lv.length]; + for (int i = 0; i < lv.length; i++) + iv[i] = (int) lv[i]; + return iv; + } } diff --git a/dap4/d4core/src/main/java/dap4/core/util/Escape.java b/dap4/src/main/java/dap4/core/util/Escape.java similarity index 99% rename from dap4/d4core/src/main/java/dap4/core/util/Escape.java rename to dap4/src/main/java/dap4/core/util/Escape.java index 80c3c470d0..872d0e0a34 100644 --- a/dap4/d4core/src/main/java/dap4/core/util/Escape.java +++ b/dap4/src/main/java/dap4/core/util/Escape.java @@ -57,6 +57,9 @@ public static String entityEscape(String s, String wrt) { StringBuilder escaped = new StringBuilder(); for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); + // XML cannot handle nul char so just suppress it altogether + if (c == 0) + continue; int index = wrt.indexOf(c); if (index < 0) escaped.append(c); @@ -82,9 +85,6 @@ public static String entityEscape(String s, String wrt) { case '\n': escaped.append(c); // These are the only legal control chars break; - case '\0': - // What to do about nul? currrently we suppress it - break; default: if (c >= ' ') escaped.append(c); diff --git a/dap4/d4core/src/main/java/dap4/core/util/IndentWriter.java b/dap4/src/main/java/dap4/core/util/IndentWriter.java similarity index 95% rename from dap4/d4core/src/main/java/dap4/core/util/IndentWriter.java rename to dap4/src/main/java/dap4/core/util/IndentWriter.java index ff3bec0ed9..42cc4c63f0 100644 --- a/dap4/d4core/src/main/java/dap4/core/util/IndentWriter.java +++ b/dap4/src/main/java/dap4/core/util/IndentWriter.java @@ -114,11 +114,17 @@ public void pop() { // Margin cognizant print functions public void eol() { - super.println(""); + super.print("\r\n"); + } + + @Override + public void println() { + eol(); } public void marginPrintln(String text) { - marginPrint(text + "\n"); + marginPrint(text); + println(); } public void marginPrintln() { diff --git a/dap4/d4core/src/main/java/dap4/core/util/MultiSlice.java b/dap4/src/main/java/dap4/core/util/MultiSlice.java similarity index 97% rename from dap4/d4core/src/main/java/dap4/core/util/MultiSlice.java rename to dap4/src/main/java/dap4/core/util/MultiSlice.java index 716c3895c6..f5916d01de 100644 --- a/dap4/d4core/src/main/java/dap4/core/util/MultiSlice.java +++ b/dap4/src/main/java/dap4/core/util/MultiSlice.java @@ -22,7 +22,7 @@ public class MultiSlice extends Slice { protected List subslices; // cache some values - protected long count = -1; + protected int count = -1; ////////////////////////////////////////////////// // Constructor(s) @@ -78,7 +78,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - long accum = 0; + int accum = 0; for (int i = 0; i < this.subslices.size(); i++) { Slice s = this.subslices.get(i); accum += s.hashCode() * i; @@ -166,12 +166,12 @@ public Slice getSubSlice(int i) { @Override - public long getCount() { + public int getCount() { return this.count; } @Override - public Slice setMaxSize(long size) throws DapException { + public Slice setMaxSize(int size) throws DapException { for (int i = 0; i < this.subslices.size(); i++) { this.subslices.get(i).setMaxSize(size); } diff --git a/dap4/d4core/src/main/java/dap4/core/util/PowerSet.java b/dap4/src/main/java/dap4/core/util/PowerSet.java similarity index 100% rename from dap4/d4core/src/main/java/dap4/core/util/PowerSet.java rename to dap4/src/main/java/dap4/core/util/PowerSet.java diff --git a/dap4/d4core/src/main/java/dap4/core/util/ResponseFormat.java b/dap4/src/main/java/dap4/core/util/ResponseFormat.java similarity index 57% rename from dap4/d4core/src/main/java/dap4/core/util/ResponseFormat.java rename to dap4/src/main/java/dap4/core/util/ResponseFormat.java index 740a528766..85ee220644 100644 --- a/dap4/d4core/src/main/java/dap4/core/util/ResponseFormat.java +++ b/dap4/src/main/java/dap4/core/util/ResponseFormat.java @@ -10,14 +10,20 @@ * Define the enum for the possible Response/Response modes */ public enum ResponseFormat { - TEXT("txt"), XML("xml"), HTML("html"), NONE(null); + TEXT("text", "txt"), XML("xml", "xml"), HTML("html", "html"), NONE("none", null); + private String id; private String format; - ResponseFormat(String format) { + ResponseFormat(String id, String format) { + this.id = id; this.format = format; } + public String id() { + return id; + } + public String format() { return format; } @@ -32,8 +38,18 @@ public static ResponseFormat formatFor(String s) { return null; } + public static ResponseFormat idFormat(String id) { + if (id == null) + return null; + for (ResponseFormat format : ResponseFormat.values()) { + if (id.equalsIgnoreCase(format.id)) + return format; + } + return null; + } + public String toString() { - return format; + return id; } } diff --git a/dap4/d4core/src/main/java/dap4/core/util/Slice.java b/dap4/src/main/java/dap4/core/util/Slice.java similarity index 84% rename from dap4/d4core/src/main/java/dap4/core/util/Slice.java rename to dap4/src/main/java/dap4/core/util/Slice.java index b0b5a2f558..1e72991983 100644 --- a/dap4/d4core/src/main/java/dap4/core/util/Slice.java +++ b/dap4/src/main/java/dap4/core/util/Slice.java @@ -20,6 +20,9 @@ * Note that first cannot be undefined because it always defaults to zero; * similarly stride defaults to one. * Slice Supports iteration. + * + * Note that a slice is quite similar to a scalar DataIndex. + * * Modifiied 10/15/2016 to support zero sized slices. */ @@ -32,20 +35,19 @@ public class Slice { // its "last" value is the UNDEFINED value). // This will primarily be used in the constraint expression parser - // static public final long UNDEFINED = 0x7FFFFFFFFFFFFFFFL; - public static final long UNDEFINED = -1L; + static public final int UNDEFINED = -1; // Define maximum legal dimension based on the spec - public static final long MAXLENGTH = 0x3FFFFFFFFFFFFFFFL; + static public final int MAXLENGTH = 0x3FFFFFFF; - public static enum Sort { + static public enum Sort { Single, Multi; } // Define a set of slices indicating the canonical scalar set - public static List SCALARSLICES; - public static Slice SCALARSLICE; + static public List SCALARSLICES; + static public Slice SCALARSLICE; static { try { @@ -66,22 +68,22 @@ public static enum Sort { /** * First index */ - long first = UNDEFINED; + int first = UNDEFINED; /** * Last+1 index; (stop - first) should be size of the slice. */ - long stop = UNDEFINED; + int stop = UNDEFINED; /** * Stride */ - long stride = UNDEFINED; + int stride = UNDEFINED; /** * Max size (typically the size of the underlying dimension) */ - long maxsize = MAXLENGTH; + int maxsize = MAXLENGTH; /** * Indicate if this is known to be a whole slice @@ -103,11 +105,11 @@ public static enum Sort { public Slice() {} - public Slice(long first, long stop, long stride) throws DapException { + public Slice(int first, int stop, int stride) throws DapException { this(first, stop, stride, UNDEFINED); } - public Slice(long first, long stop, long stride, long maxsize) throws DapException { + public Slice(int first, int stop, int stride, int maxsize) throws DapException { this(); setIndices(first, stop, stride, maxsize); } @@ -121,7 +123,7 @@ public Slice(Slice s) throws DapException { public Slice(DapDimension dim) throws DapException { this(); - setIndices(0, dim.getSize(), 1, dim.getSize()); + setIndices(0, (int) dim.getSize(), 1, (int) dim.getSize()); setWhole(true); setConstrained(false); } @@ -178,41 +180,41 @@ public Sort getSort() { return this.sort; } - public long getFirst() { + public int getFirst() { return this.first; } - public long getStop() { + public int getStop() { return this.stop; } - public long getLast() { + public int getLast() { return ((this.stop - this.first) == 0 ? 0 : this.stop - 1); } - public long getStride() { + public int getStride() { return this.stride; } - public long getSize() // not same as getcount and not same as maxsize + public int getSize() // not same as getcount and not same as maxsize { return (this.stop - this.first); } - public long getMax() // not same as getcount and not same as maxsize + public int getMax() // not same as getcount and not same as maxsize { return this.maxsize; } - public Slice setMaxSize(long size) throws DapException { + public Slice setMaxSize(int size) throws DapException { return setIndices(this.first, this.stop, this.stride, size); } - public Slice setIndices(long first, long stop, long stride) throws DapException { + public Slice setIndices(int first, int stop, int stride) throws DapException { return setIndices(first, stop, stride, UNDEFINED); } - public Slice setIndices(long first, long stop, long stride, long maxsize) throws DapException { + public Slice setIndices(int first, int stop, int stride, int maxsize) throws DapException { this.first = first; this.stop = stop; this.stride = stride; @@ -246,9 +248,9 @@ public Slice setConstrained(Boolean tf) { * the slice. Note that this is different from * getStop() because stride is taken into account. */ - public long getCount() { + public int getCount() { assert this.first != UNDEFINED && this.stride != UNDEFINED && this.stop != UNDEFINED; - long count = (this.stop) - this.first; + int count = (this.stop) - this.first; count = (count + this.stride - 1); count /= this.stride; return count; @@ -330,11 +332,11 @@ public String toConstraintString() throws DapException { * @return new, composed Range * @throws DapException */ - public static Slice compose(Slice target, Slice src) throws DapException { - long sr_stride = target.getStride() * src.getStride(); - long sr_first = MAP(target, src.getFirst()); - long lastx = MAP(target, src.getLast()); - long sr_last = (target.getLast() < lastx ? target.getLast() : lastx); // min(last(),lastx) + static public Slice compose(Slice target, Slice src) throws DapException { + int sr_stride = target.getStride() * src.getStride(); + int sr_first = MAP(target, src.getFirst()); + int lastx = MAP(target, src.getLast()); + int sr_last = (target.getLast() < lastx ? target.getLast() : lastx); // min(last(),lastx) return new Slice(sr_first, sr_last + 1, sr_stride, sr_last + 1).finish(); } @@ -346,7 +348,7 @@ public static Slice compose(Slice target, Slice src) throws DapException { * @return the i-th element of a range * @throws DapException if index is invalid */ - static long MAP(Slice target, long i) throws DapException { + static int MAP(Slice target, int i) throws DapException { if (i < 0) throw new DapException("Slice.compose: i must be >= 0"); if (i > target.getStop()) diff --git a/dap4/d4core/src/main/java/dap4/core/util/SliceConstraint.java b/dap4/src/main/java/dap4/core/util/SliceConstraint.java similarity index 100% rename from dap4/d4core/src/main/java/dap4/core/util/SliceConstraint.java rename to dap4/src/main/java/dap4/core/util/SliceConstraint.java diff --git a/dap4/d4core/src/main/java/dap4/core/util/SliceIterator.java b/dap4/src/main/java/dap4/core/util/SliceIterator.java similarity index 100% rename from dap4/d4core/src/main/java/dap4/core/util/SliceIterator.java rename to dap4/src/main/java/dap4/core/util/SliceIterator.java diff --git a/dap4/src/main/java/dap4/core/util/XURI.java b/dap4/src/main/java/dap4/core/util/XURI.java new file mode 100644 index 0000000000..039bcbdf85 --- /dev/null +++ b/dap4/src/main/java/dap4/core/util/XURI.java @@ -0,0 +1,554 @@ +/* + * Copyright 2012, UCAR/Unidata. + * See the LICENSE file for more information. + */ + +package dap4.core.util; + +import java.net.URI; +import java.net.URISyntaxException; +import java.net.URL; +import java.util.*; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * Provide an extended form of URI parser with the following features: + * 1. can parse the query and fragment parts. + * 2. supports multiple protocols + * 3. supports modification of the URI path. + * 4. supports url -> string as controlled by flags + */ + +public class XURI { + + ////////////////////////////////////////////////// + // Constants + static final char QUERYSEP = '&'; + static final char FRAGMENTSEP = QUERYSEP; + static final char ESCAPECHAR = '\\'; + static final char PAIRSEP = '='; + + // static final String DRIVELETTERS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; + static protected final Pattern drivelettertest = Pattern.compile("^([/]?)[a-zA-Z][:]"); + static protected final Pattern filedrivelettertest = Pattern.compile("^(file://)([a-zA-Z][:].*)"); + + // Define assembly flags + + public static enum Parts { + SCHEME, // base protocol(s) + PWD, // including user + HOST, // including port + PATH, QUERY, FRAG; + } + + // Mnemonics + public static final EnumSet URLONLY = EnumSet.of(Parts.SCHEME, Parts.PWD, Parts.HOST, Parts.PATH); + public static final EnumSet URLALL = + EnumSet.of(Parts.SCHEME, Parts.PWD, Parts.HOST, Parts.PATH, Parts.QUERY, Parts.FRAG); + public static final EnumSet URLQUERY = + EnumSet.of(Parts.SCHEME, Parts.PWD, Parts.HOST, Parts.PATH, Parts.QUERY); + + ////////////////////////////////////////////////// + // Instance variables + + // Unfortunately, URI is final and so cannot be used as super class + // Rather we use delegation. + URI parent; // Does the bulk of the parsing + + // protected String originaluri = null; + protected boolean isfile = false; + + protected List nonleadschemes = new ArrayList<>(); // all schemes after the first + + protected Map queryfields // decomposed query + = null; + protected Map fragfields // decomposed fragment + = null; + + ////////////////////////////////////////////////// + // Constructor(s) + + public XURI(String xu) throws URISyntaxException { + xu = XURI.canonical(xu); + if (xu == null) + throw new URISyntaxException("null", "null valued URI string"); + xu = fixURI(xu); + parent = new URI(xu); // this should be correct + this.isfile = "file".equalsIgnoreCase(getScheme()); + } + + /** + * This makes an incoming url parseable by URI + * Fix various issues such as: + * -- multiple schemes + * -- windows drive letters in path + */ + String fixURI(String xu) throws URISyntaxException { + // Extract all schemes + String[] schemes = allSchemes(xu); + if (schemes.length == 0) + return xu; // no schemes at all + int iremainder = xu.indexOf("//"); + xu = schemes[0] + ":" + xu.substring(iremainder); // remove all but lead scheme + nonleadschemes.addAll(Arrays.asList(schemes).subList(1, schemes.length)); + // Look for windows drive letter + Matcher m = filedrivelettertest.matcher(xu); + if (m.lookingAt()) { + String prefix = m.group(1); + String pathplus = m.group(2); + // rebuild + xu = prefix + hideDriveLetter(pathplus); + } + return xu; + } + + // Pull off all the schemes into schemelist + // return the uri string with just the leading scheme + String parseSchemes(String xu, List schemelist) throws URISyntaxException { + int iremainder = xu.indexOf("//"); + if (iremainder <= 0) + throw new URISyntaxException(xu, "URI has no scheme"); + String[] schemes = xu.substring(0, iremainder).split(":"); + String lead = schemes[0]; + xu = lead + ":" + xu.substring(iremainder, xu.length()); + schemelist.clear(); + for (int i = 1; i < schemes.length; i++) + schemelist.add(schemes[i]); + return xu; + } + + public XURI(URL xu) throws URISyntaxException { + this.parent = new URI(xu.getProtocol().toLowerCase(), xu.getUserInfo(), xu.getHost(), xu.getPort(), xu.getFile(), + xu.getQuery(), xu.getRef()); + // this.originaluri = this.toString(); // save the original uri + } + + public XURI(URI xu) throws URISyntaxException { + this.parent = new URI(xu.getScheme().toLowerCase(), xu.getUserInfo(), xu.getHost(), xu.getPort(), xu.getPath(), + xu.getQuery(), xu.getFragment()); + // this.originaluri = this.toString(); // save the original uri + } + + ////////////////////////////////////////////////// + // Delegation + + // Getters + public String getUserInfo() { + return parent.getUserInfo(); + } + + public String getHost() { + return parent.getHost(); + } + + public int getPort() { + return parent.getPort(); + } + + public String getPath() { + return parent.getPath(); + } + + /** + * Return a path that can be used to open a file + * + * @return + */ + public String getRealPath() { + return truePath(getPath()); + } + + public String getQuery() { + return parent.getQuery(); + } + + public String getFragment() { + return parent.getFragment(); + } + + public String getScheme() { + return parent.getScheme(); + } // return lead protocol + + public List getSchemes() { // return lead scheme + nonleadschemes + if (parent.getScheme() == null) + return null; + List allschemes = new ArrayList<>(); + allschemes.add(parent.getScheme()); + allschemes.addAll(nonleadschemes); + return allschemes; // return lead scheme + } + + // Setters + public void setScheme(String xscheme) { + try { + this.parent = new URI(xscheme.toLowerCase(), parent.getUserInfo(), parent.getHost(), parent.getPort(), + parent.getPath(), parent.getQuery(), parent.getFragment()); + } catch (URISyntaxException use) { + throw new AssertionError("URI.setScheme: Internal error: malformed URI", use); + } + } + + public void setUserInfo(String xuserinfo) { + try { + this.parent = new URI(parent.getScheme(), xuserinfo, parent.getHost(), parent.getPort(), parent.getPath(), + parent.getQuery(), parent.getFragment()); + } catch (URISyntaxException use) { + throw new AssertionError("URI.setUserInfo: Internal error: malformed URI", use); + } + } + + public void setHost(String xhost) { + try { + this.parent = new URI(parent.getScheme(), parent.getUserInfo(), xhost, parent.getPort(), parent.getPath(), + parent.getQuery(), parent.getFragment()); + } catch (URISyntaxException use) { + throw new AssertionError("URI.setHost: Internal error: malformed URI", use); + } + } + + public void setPort(int xport) { + try { + this.parent = new URI(parent.getScheme(), parent.getUserInfo(), parent.getHost(), xport, parent.getPath(), + parent.getQuery(), parent.getFragment()); + } catch (URISyntaxException use) { + throw new AssertionError("URI.setPort: Internal error: malformed URI", use); + } + } + + public void setPath(String xpath) { + try { + if (hasDriveLetter(xpath) && xpath.charAt(0) != '/') + xpath = "/" + xpath; // make it URI parseable + this.parent = new URI(parent.getScheme(), parent.getUserInfo(), parent.getHost(), parent.getPort(), xpath, + parent.getQuery(), parent.getFragment()); + } catch (URISyntaxException use) { + throw new AssertionError("URI.setPath: Internal error: malformed URI", use); + } + } + + public void setQuery(String xquery) { + try { + this.parent = new URI(parent.getScheme(), parent.getUserInfo(), parent.getHost(), parent.getPort(), + parent.getPath(), xquery, parent.getFragment()); + this.queryfields = null; + } catch (URISyntaxException use) { + throw new AssertionError("URI.setQuery: Internal error: malformed URI", use); + } + } + + public void setFragment(String xfragment) { + try { + this.parent = new URI(parent.getScheme(), parent.getUserInfo(), parent.getHost(), parent.getPort(), + parent.getPath(), parent.getQuery(), xfragment); + this.fragfields = null; + } catch (URISyntaxException use) { + throw new AssertionError("URI.setFragment: Internal error: malformed URI", use); + } + } + + public String toString() { + return assemble(URLALL); + } + + /** + * Allow queryfields to be inserted + * + * @param key + * @param newval + * @return previous value or this value if key not set + */ + public void insertQueryField(String key, String newval) { + // Watch out in case there is no query + this.queryfields = insertAmpField(key, newval, parent.getQuery()); + rebuildQuery(); + } + + /** + * Allow queryfields to be removed + * + * @param key + * @return previous value (may be null) + */ + public void removeQueryField(String key) { + // Watch out in case there is no query + this.queryfields = removeAmpField(key, parent.getQuery()); + rebuildQuery(); + } + + /** + * Rebuild query from current queryfields + */ + protected void rebuildQuery() { + if (queryfields == null) + return; + StringBuffer query = new StringBuffer(); + boolean first = true; + for (Map.Entry entry : queryfields.entrySet()) { + if (!first) + query.append("&"); + query.append(Escape.urlEncodeQuery((String) entry.getKey())); + query.append("="); + query.append(Escape.urlEncodeQuery((String) entry.getValue())); + first = false; + } + String newquery = null; + if (query.length() > 0) + newquery = query.toString(); + setQuery(newquery); + } + + ////////////////////////////////////////////////// + // Accessors (other than delegations) + + // public String getOriginal() { + // return originaluri; + // } + + public boolean isFile() { + return this.isfile; + } + + public Map getQueryFields() { + if (this.queryfields == null) + parseQuery(); + return this.queryfields; + } + + public Map getFragFields() { + if (this.fragfields == null) + parseFragment(); + return this.fragfields; + } + + protected void parseQuery() { + this.queryfields = parseAmpList(getQuery(), QUERYSEP, ESCAPECHAR); + } + + protected void parseFragment() { + this.fragfields = parseAmpList(getFragment(), FRAGMENTSEP, ESCAPECHAR); + } + + protected Map insertAmpField(String key, String value, String query) { + Map fields = parseAmpList(query, '&', '\\'); + fields.put(key, value); + return fields; + } + + protected Map removeAmpField(String key, String query) { + Map fields = parseAmpList(query, '&', '\\'); + fields.remove(key); + return fields; + } + + protected Map parseAmpList(String s, char sep, char escape) { + Map map = new HashMap<>(); + List pieces; + if (s == null) + s = ""; + pieces = escapedsplit(s, sep, escape); + for (String piece : pieces) { + int plen = piece.length(); + // Split on first '=' + int index = findunescaped(piece, 0, PAIRSEP, escape, plen); + if (index < 0) + index = plen; + String key = piece.substring(0, index); + String value = (index >= plen ? "" : piece.substring(index + 1, plen)); + key = Escape.urlDecode(key); + key = key.toLowerCase(); // for consistent lookup + value = Escape.urlDecode(value); + map.put(key, value); + } + return map; + } + + /* + * Split s into pieces as separated by separator and taking + * escape characters into account. + */ + protected List escapedsplit(String s, char sep, char escape) { + List pieces = new ArrayList<>(); + int len = s.length(); + int from = 0; + while (from < len) { + int index = findunescaped(s, from, sep, escape, len); + if (index < 0) + index = len; + pieces.add(s.substring(from, index)); + from = index + 1; + } + return pieces; + } + + /* + * It is probably possible to do this with regexp patterns, + * but I do not know how. + * + * The goal is to find next instance of unescaped separator character. + * Leave any escape characters in place. + * Return index of next separator starting at start. + * If not found, then return -1; + */ + protected int findunescaped(String s, int start, char sep, char escape, int len) { + int i; + for (i = start; i < len; i++) { + char c = s.charAt(i); + if (c == escape) { + i++; + } else if (c == sep) { + return i; + } + } + return -1; /* not found */ + } + + ////////////////////////////////////////////////// + // API + + /** + * Reassemble the url using the specified parts + * + * @param parts to include + * @return the assembled uri + */ + + public String assemble(EnumSet parts) { + StringBuilder uri = new StringBuilder(); + if (parts.contains(Parts.SCHEME) && this.getScheme() != null) { + uri.append(this.getScheme()); + for (int i = 0; i < nonleadschemes.size(); i++) { + uri.append(':'); + uri.append(nonleadschemes.get(i)); + } + uri.append("://"); + } + if (parts.contains(Parts.PWD) && this.getUserInfo() != null) { + uri.append(this.getUserInfo()); + uri.append("@"); + } + if (parts.contains(Parts.HOST) && this.getHost() != null) { + uri.append(this.getHost()); + if (this.getPort() > 0) { + uri.append(":"); + uri.append(this.getPort()); + } + } + if (parts.contains(Parts.PATH) && this.getPath() != null) { + uri.append(this.getPath()); + } + if (parts.contains(Parts.QUERY) && this.getQuery() != null) { + uri.append("?"); + uri.append(this.getQuery()); + } + if (parts.contains(Parts.FRAG) && this.getFragment() != null) { + uri.append("#"); + uri.append(this.getFragment()); + } + return uri.toString(); + } + + + // if the url is file:// and the path part has a windows drive letter, then the parent URL will not recognize this + // correctly. + public String fixdriveletter(URI uri) throws URISyntaxException { + if (!uri.getScheme().equalsIgnoreCase("file")) + return uri.toString(); + String tmp = uri.getHost(); // we use host because this is how URI parses such urls + if (!hasDriveLetter(tmp)) + return uri.toString(); // Original file url did not a have Windows drive letter + // rebuild the original URI (ugh!) + StringBuilder newxu = new StringBuilder(); + newxu.append(uri.getScheme()); + newxu.append("://"); + if (uri.getUserInfo() != null) { + newxu.append(uri.getUserInfo()); + newxu.append("@"); + } + newxu.append("/"); + newxu.append(uri.getHost()); // that's where the drive letter ends up + newxu.append(":"); + newxu.append(uri.getPath()); + if (uri.getQuery() != null) { + newxu.append("?"); + newxu.append(uri.getQuery()); + } + if (uri.getFragment() != null) { + newxu.append("#"); + newxu.append(uri.getFragment()); + } + return newxu.toString(); + } + + //////////////////////////////////////////////// + /** + * Canonicalize a part of a URL + * + * @param s part of the url + */ + static public String canonical(String s) { + if (s != null) { + s = s.trim(); + if (s.length() == 0) + s = null; + } + return s; + } + + /** + * return true if this path appears to start with a windows drive letter + * including those hidden by leading '/' + * + * @param path + * @return true, if path has drive letter + */ + static public boolean hasDriveLetter(String path) { + Matcher m = drivelettertest.matcher(path); + return m.lookingAt(); + } + + /** + * Return a path with possible windows drive letter hidden by '/'. + * Repair => convert "x:/" to "/x:/" where x is a drive letter + * + * @return repaired path + */ + static public String hideDriveLetter(String path) { + Matcher m = drivelettertest.matcher(path); + if (m.lookingAt()) { + if (m.group(1).equals("")) + path = "/" + path; + } + return path; + } + + /** + * Extract all schemes at front of a url. + * + * @parem xu url string + * @return vector of schemes + */ + static public String[] allSchemes(String xu) { + int endschemes = xu.indexOf("//"); + if (endschemes < 0) + return new String[0]; + String[] schemes = xu.substring(0, endschemes).split(":"); + return schemes; + } + + /** + * return repaired path; if this path appears to start with a windows drive letter + * hidden by leading '/', then the leading '/' is removed + * + * @param path + * @return repaired path + */ + static public String truePath(String path) { + // Check for a windows drive and repair + Matcher m = drivelettertest.matcher(path); + if (m.lookingAt() && m.group(1) != null) + path = path.substring(1); + return path; + } +} diff --git a/dap4/src/main/java/dap4/dap4lib/D4Cursor.java b/dap4/src/main/java/dap4/dap4lib/D4Cursor.java new file mode 100644 index 0000000000..d0736f86af --- /dev/null +++ b/dap4/src/main/java/dap4/dap4lib/D4Cursor.java @@ -0,0 +1,109 @@ +/* + * Copyright 2012, UCAR/Unidata. + * See the LICENSE file for more information. + */ + +package dap4.dap4lib; + +import dap4.core.dmr.*; +import dap4.core.interfaces.DataCursor; +import ucar.ma2.Array; + +/** + * Wrap an Array representing a variables' data, where the variable + * is top-level or a field. The wrapper contains some additional + * information beside the Array. + */ + +public class D4Cursor implements DataCursor { + + ////////////////////////////////////////////////// + // Mnemonics + static final long NULLOFFSET = -1; + + static final int D4LENSIZE = 8; + + ////////////////////////////////////////////////// + // Instance Variables + + protected D4DSP dsp; + protected Scheme scheme; // Roughly, what kind of array + protected DapNode template; + protected Array array = null; // the Array object for the variable + protected Object storage = null; // The storage underlying Array + + ////////////////////////////////////////////////// + // Constructor(s) + + public D4Cursor(Scheme scheme, D4DSP dsp, DapVariable template) { + this.scheme = scheme; + this.template = template; + this.dsp = dsp; + } + + public String toString() { + StringBuilder buf = new StringBuilder(); + buf.append(getScheme().toString()); + if (getScheme() == Scheme.STRUCTARRAY || getScheme() == Scheme.SEQARRAY) + buf.append("[]"); + buf.append(":"); + buf.append(getTemplate().toString()); + return buf.toString(); + } + + ////////////////////////////////////////////////// + // set/get + + public D4DSP getDSP() { + return this.dsp; + } + + public Scheme getScheme() { + return this.scheme; + } + + public DapNode getTemplate() { + return this.template; + } + + public Array getArray() { + return this.array; + } + + public Object getStorage() { + return this.storage; + } + + public boolean isScalar() { + return ((DapVariable) getTemplate()).getRank() == 0; + } + + public D4Cursor setArray(Array a) { + this.array = a; + return this; + } + + public D4Cursor setStorage(Object store) { + this.storage = store; + return this; + } + + + static public Scheme schemeFor(DapVariable field) { + DapType ftype = field.getBaseType(); + Scheme scheme = null; + boolean isscalar = field.getRank() == 0; + if (ftype.getTypeSort().isAtomic()) + scheme = Scheme.ATOMIC; + else { + if (ftype.getTypeSort().isStructType()) + scheme = Scheme.STRUCTARRAY; + else if (ftype.getTypeSort().isSeqType()) + scheme = Scheme.SEQARRAY; + } + return scheme; + } + +} + + diff --git a/dap4/src/main/java/dap4/dap4lib/D4DSP.java b/dap4/src/main/java/dap4/dap4lib/D4DSP.java new file mode 100644 index 0000000000..cc1baa7dcb --- /dev/null +++ b/dap4/src/main/java/dap4/dap4lib/D4DSP.java @@ -0,0 +1,401 @@ +/* + * Copyright 2012, UCAR/Unidata. + * See the LICENSE file for more information. + */ + +package dap4.dap4lib; + +import dap4.core.dmr.*; +import dap4.core.dmr.parser.DOM4Parser; +import dap4.core.dmr.parser.Dap4Parser; +import dap4.core.util.ChecksumMode; +import dap4.core.util.*; +import org.xml.sax.SAXException; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URISyntaxException; +import java.nio.ByteOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static dap4.core.util.DapConstants.*; + +/** + * This Class takes a DAP4 serialization (as chunked input) stream + * and exports access to a compiled DMR, a compiled DAP4 data stream, + * and various parameters such as byteorder of the data stream. + * + * Most of the work is done by this class. Its subclasses need + * only provide a raw byte stream to DAP4 chunked data taken + * from e.g. a raw data file or an HTTP connection. + * + * It cannot be used standalone. + */ + +public abstract class D4DSP { + + ////////////////////////////////////////////////// + // Constants + + public static boolean DEBUG = false; + protected static final boolean PARSEDEBUG = true; + + ////////////////////////////////////////////////// + // Instance variables + + protected String dmrtext = null; + protected DapDataset dmr = null; + protected String location = null; + + // Input stream + protected DeChunkedInputStream stream = null; + protected boolean streamclosed = false; + + protected XURI xuri = null; + + // Exported information + protected ByteOrder remoteorder = null; + protected ChecksumMode checksummode = null; + protected RequestMode mode = null; + + // DAP stream compilation + D4DataCompiler d4compiler = null; + + protected Map datamap = new HashMap<>(); + + ////////////////////////////////////////////////// + // Constructor(s) + + public D4DSP() {} + + ////////////////////////////////////////////////// + + /** + * "open" a reference to a data source and return the DSP wrapper. + * + * @param location - Object that defines the data source + * @param cmode + * @return = wrapping dsp + * @throws DapException + */ + public D4DSP open(String location, ChecksumMode cmode) throws DapException { + this.location = location; + this.checksummode = cmode; + parseURL(location); + return this; + } + + + ////////////////////////////////////////////////// + // Accessors + + public DeChunkedInputStream getStream() { + return this.stream; + } + + public ChecksumMode getChecksumMode() { + return this.checksummode; + } + + public Map getVariableDataMap() { + return this.datamap; + } + + public Map getChecksumMap(ChecksumSource src) { + if (src == ChecksumSource.LOCAL) + return this.d4compiler.localchecksummap; + else + return this.d4compiler.remotechecksummap; + } + + protected D4DSP setStream(InputStream input, RequestMode mode) throws IOException { + this.mode = mode; + this.stream = new DeChunkedInputStream(input, mode); // side effect: read DMR &/or error + this.streamclosed = false; + if (this.stream.getState() == DeChunkedInputStream.State.ERROR) + reportError(this.stream.getErrorText()); + this.dmrtext = this.stream.getDMRText(); + // This is the definitive remote byte order + this.remoteorder = this.stream.getRemoteOrder(); + return this; + } + + protected void addVariableData(DapVariable var, D4Cursor cursor) { + this.datamap.put(var, cursor); + } + + public DapDataset getDMR() { + return this.dmr; + } + + protected void setDMR(DapDataset dmr) { + this.dmr = dmr; + if (this.dmr != null) { + // Add some canonical attributes to the + this.dmr.setDataset(this.dmr); + this.dmr.setDapVersion(DapConstants.X_DAP_VERSION); + this.dmr.setDMRVersion(DapConstants.X_DMR_VERSION); + this.dmr.setNS(DapConstants.X_DAP_NS); + } + } + + /* + * public static String printDMR(DapDataset dmr) { + * StringWriter sw = new StringWriter(); + * PrintWriter pw = new PrintWriter(sw); + * DMRPrinter printer = new DMRPrinter(dmr, pw); + * try { + * printer.print(); + * pw.close(); + * sw.close(); + * } catch (IOException e) { + * } + * return sw.toString(); + * } + */ + + ////////////////////////////////////////////////// + // Subclass defined + + /** + * Determine if a path refers to an object processable by this DSP + * + * @param path + * @param context + * @return true if this path can be processed by an instance of this DSP + */ + abstract public boolean dspMatch(String path, DapContext context); + + ////////////////////////////////////////////////// + // Compilation + + /** + * Extract the DMR from available dechunked data + * + * @throws DapException + */ + public void loadDMR() throws IOException { + String document = readDMR(); + DapDataset dmr = parseDMR(document); + setDMR(dmr); + if (this.mode == RequestMode.DMR) { + assert !this.streamclosed; + this.stream.close(); // no longer needed + this.streamclosed = true; + } + } + + public void loadDAP() throws IOException { + try { + // "Compile" the databuffer section of the server response + d4compiler = new D4DataCompiler(this, this.checksummode, this.remoteorder); + d4compiler.compile(); + assert !this.streamclosed; + this.stream.close(); // no longer needed + this.streamclosed = true; + } catch (IOException ioe) { + throw new DapException(ioe); + } + } + + public void loadContext(DapContext cxt, RequestMode mode) { + switch (mode) { + case DMR: + break; + case DAP: + cxt.put(ChecksumSource.REMOTE, d4compiler.getChecksumMap(ChecksumSource.REMOTE)); + cxt.put(ChecksumSource.LOCAL, d4compiler.getChecksumMap(ChecksumSource.LOCAL)); + cxt.put(D4Cursor.class, getVariableDataMap()); + break; + } + } + + protected String readDMR() throws IOException { + // Get and clean up dmr + String dmrtext = this.stream.getDMRText(); + dmrtext = dmrtext.trim(); + if (dmrtext.length() == 0) + throw new DapException("Empty DMR"); + StringBuilder buf = new StringBuilder(dmrtext); + // remove any trailing '\n' + int len = buf.length(); + if (buf.charAt(len - 1) == '\n') + buf.setLength(--len); + // Make sure it has trailing \r" + if (buf.charAt(len - 1) != '\r') + buf.append('\r'); + // Make sure it has trailing \n" + buf.append('\n'); + return buf.toString(); + } + + ////////////////////////////////////////////////// + // Misc. Utilities + + protected void parseURL(String url) throws DapException { + try { + this.xuri = new XURI(url); + } catch (URISyntaxException use) { + throw new DapException(use); + } + } + + protected String getMethodUrl(RequestMode mode, ChecksumMode csum) throws DapException { + xuri.removeQueryField(DapConstants.CHECKSUMTAG); + csum = ChecksumMode.asTrueFalse(csum); + String scsum = ChecksumMode.toString(csum); + xuri.insertQueryField(DapConstants.CHECKSUMTAG, scsum); + String corepath = DapUtil.stripDap4Extensions(xuri.getPath()); + // modify url to read the dmr|dap + if (mode == RequestMode.DMR) + xuri.setPath(corepath + ".dmr.xml"); + else if (mode == RequestMode.DAP) + xuri.setPath(corepath + ".dap"); + else + throw new DapException("Unexpected mode: " + mode); + String methodurl = xuri.assemble(XURI.URLQUERY); + return methodurl; + } + + /** + * It is common to want to parse a DMR text to a DapDataset, + * so provide this utility. + * + * @param document the dmr to parse + * @return the parsed dmr + * @throws DapException on parse errors + */ + + protected DapDataset parseDMR(String document) throws DapException { + // Parse the dmr + Dap4Parser parser; + // if(USEDOM) + parser = new DOM4Parser(null); + // else + // parser = new DOM4Parser(new DefaultDMRFactory()); + if (PARSEDEBUG) + parser.setDebugLevel(1); + try { + if (!parser.parse(document)) + throw new DapException("DMR Parse failed"); + } catch (SAXException se) { + throw new DapException(se); + } + if (parser.getErrorResponse() != null) + throw new DapException("Error Response Document not supported"); + DapDataset result = parser.getDMR(); + processAttributes(result); + processMaps(result); + return result; + } + + /** + * Some attributes that are added by the NetcdfDataset + * need to be kept out of the DMR. This function + * defines that set. + * + * @param attrname + * @return true if the attribute should be suppressed, false otherwise. + */ + protected boolean suppressAttributes(String attrname) { + if (attrname.startsWith("_Coord")) + return true; + if (attrname.equals("_Unsigned")) + return true; + return false; + } + + void getEndianAttribute(DapDataset dataset) { + DapAttribute a = dataset.findAttribute(DapConstants.LITTLEENDIANATTRNAME); + if (a == null) + return; + Object v = a.getValues(); + int len = java.lang.reflect.Array.getLength(v); + if (len == 0) + this.remoteorder = ByteOrder.LITTLE_ENDIAN; + else { + String onezero = java.lang.reflect.Array.get(v, 0).toString(); + int islittle = 1; + try { + islittle = Integer.parseInt(onezero); + } catch (NumberFormatException e) { + islittle = 1; + } + if (islittle == 0) + this.remoteorder = ByteOrder.BIG_ENDIAN; + else + this.remoteorder = ByteOrder.LITTLE_ENDIAN; + } + } + + /** + * Walk the dataset tree and remove selected attributes + * such as _Unsigned + * + * @param dataset + */ + protected void processAttributes(DapDataset dataset) throws DapException { + List nodes = dataset.getNodeList(); + for (DapNode node : nodes) { + switch (node.getSort()) { + case GROUP: + case DATASET: + case VARIABLE: + Map attrs = node.getAttributes(); + if (attrs.size() > 0) { + List suppressed = new ArrayList<>(); + for (DapAttribute dattr : attrs.values()) { + if (suppressAttributes(dattr.getShortName())) + suppressed.add(dattr); + } + for (DapAttribute dattr : suppressed) { + node.removeAttribute(dattr); + } + } + break; + default: + break; /* ignore */ + } + } + // Try to extract the byte order + getEndianAttribute(dataset); + } + + /** + * Walk the dataset tree and link nodes = dataset.getNodeList(); + for (DapNode node : nodes) { + switch (node.getSort()) { + case MAP: + DapMap map = (DapMap) node; + String targetname = map.getTargetName(); + DapVariable target; + target = (DapVariable) dataset.findByFQN(targetname, DapSort.VARIABLE, DapSort.SEQUENCE, DapSort.STRUCTURE); + if (target == null) + throw new DapException("Mapref: undefined target variable: " + targetname); + // Verify that this is a legal map => + // 1. it is outside the scope of its parent if the parent + // is a structure. + DapNode container = target.getContainer(); + if ((container.getSort() == DapSort.STRUCTURE || container.getSort() == DapSort.SEQUENCE)) + throw new DapException("Mapref: map target variable not in outer scope: " + targetname); + map.setVariable(target); + break; + default: + break; /* ignore */ + } + } + } + + protected void reportError(String errmsg) throws IOException { + throw new DapException(errmsg); + } + +} diff --git a/dap4/src/main/java/dap4/dap4lib/D4DataCompiler.java b/dap4/src/main/java/dap4/dap4lib/D4DataCompiler.java new file mode 100644 index 0000000000..ca6a054771 --- /dev/null +++ b/dap4/src/main/java/dap4/dap4lib/D4DataCompiler.java @@ -0,0 +1,504 @@ +/* + * Copyright 2012, UCAR/Unidata. + * See the LICENSE file for more information. + */ + + +package dap4.dap4lib; + +import dap4.core.interfaces.DataIndex; +import dap4.core.util.ChecksumMode; +import dap4.core.dmr.*; +import dap4.core.util.*; +import dap4.dap4lib.cdm.CDMTypeFcns; +import dap4.dap4lib.cdm.CDMUtil; +import dap4.dap4lib.cdm.nc2.D4StructureDataIterator; +import ucar.ma2.*; + +import java.io.IOException; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.zip.Checksum; + +import static dap4.core.interfaces.DataCursor.Scheme.*; +import static dap4.dap4lib.D4Cursor.Scheme; +import static dap4.dap4lib.D4Cursor.schemeFor; + +public class D4DataCompiler { + + public static boolean DEBUG = false; + + ////////////////////////////////////////////////// + // Constants + + ////////////////////////////////////////////////// + // Instance variables + + protected DapDataset dmr = null; + + protected ChecksumMode checksummode = null; + protected ByteOrder remoteorder = null; + + protected D4DSP dsp; + protected DeChunkedInputStream stream = null; + + // Checksum information + // We have two checksum maps: one for the remotely calculated value + // and one for the locally calculated value. + protected Map localchecksummap = new HashMap<>(); + protected Map remotechecksummap = new HashMap<>(); + + ////////////////////////////////////////////////// + // Constructor(s) + + /** + * Constructor + * + * @param dsp the D4DSP + * @param checksummode + * @param remoteorder + */ + + public D4DataCompiler(D4DSP dsp, ChecksumMode checksummode, ByteOrder remoteorder) throws DapException { + this.dsp = dsp; + this.dmr = this.dsp.getDMR(); + this.stream = this.dsp.getStream(); + this.checksummode = ChecksumMode.asTrueFalse(checksummode); + this.remoteorder = remoteorder; + } + + ////////////////////////////////////////////////// + // Accessors + + public Map getChecksumMap(DapConstants.ChecksumSource src) { + switch (src) { + case LOCAL: + return this.localchecksummap; + case REMOTE: + return this.remotechecksummap; + } + return null; + } + + protected void setChecksum(DapConstants.ChecksumSource src, DapVariable dvar, Long csum) { + switch (src) { + case LOCAL: + this.localchecksummap.put(dvar, csum); + case REMOTE: + this.remotechecksummap.put(dvar, csum); + } + } + + ////////////////////////////////////////////////// + // DataCompiler API + + /** + * The goal here is to process the serialized + * databuffer and pull out top-level variable positions + * in the serialized databuffer. + * In some cases -- String, Sequence, Structure -- + * significant transforms are applied to the data + * to make it usable with ucar.ma2.Array. + * + * @throws DapException + */ + public void compile() throws IOException { + assert (this.dmr != null && this.stream != null); + // iterate over the variables represented in the databuffer + for (DapVariable vv : this.dmr.getTopVariables()) { + Object storage = compileVar(vv); + D4Cursor data = new D4Cursor(schemeFor(vv), this.dsp, vv).setStorage(storage); + assert data.getArray() == null; + data.setArray(createArray(vv, data.getStorage())); + this.dsp.addVariableData(vv, data); + } + } + + /** + * Return a compiled version of the data for this variable. + * Possible return values are: + * 1. String - String[] + * 2. Opaque - Bytebuffer[] + * 3. Fixed atomic - [] + * 4. Structure - Object[][nfields] + * 5. Sequence - Object[][nfields] + */ + protected Object compileVar(DapVariable dapvar) throws IOException { + Object data = null; + DapType type = dapvar.getBaseType(); + if (dapvar.isTopLevel() && this.checksummode == ChecksumMode.TRUE) + this.stream.startChecksum(); + if (type.isAtomic()) + data = compileAtomicVar(dapvar); + else if (type.isStructType()) { + data = compileStructureArray(dapvar); + } else if (type.isSeqType()) { + data = compileSequenceArray(dapvar); + } + if (dapvar.isTopLevel() && this.checksummode == ChecksumMode.TRUE) { + // Save the locally computed checksum + long localcrc32 = this.stream.endChecksum(); // extract the remotechecksum from databuffer src, + setChecksum(DapConstants.ChecksumSource.LOCAL, dapvar, localcrc32); + // Save the checksum sent by the server + long remotecrc32 = extractChecksum(); + setChecksum(DapConstants.ChecksumSource.REMOTE, dapvar, remotecrc32); + } + return data; + } + + /** + * Compile fixed-sized atomic types + * Storage = [] + * + * @param var + * @return data + * @throws DapException + */ + protected Object compileAtomicVar(DapVariable var) throws IOException { + DapType daptype = var.getBaseType(); + + // special cases + if (daptype.isStringType()) // string or URL + return compileStringVar(var); + if (daptype.isOpaqueType()) + return compileOpaqueVar(var); + + // All other fixed-size atomic types + long dimproduct = var.getCount(); + long total = dimproduct * daptype.getSize(); + byte[] bytes = new byte[(int) total]; // total space required + int red = this.stream.read(bytes); + if (red <= 0) + throw new IOException("D4DataCompiler: read failure"); + if (red < total) + throw new DapException("D4DataCompiler: short read"); + // Convert to vector of required type + Object storage = CDMTypeFcns.bytesAsTypeVec(daptype, bytes); + CDMTypeFcns.decodebytes(this.remoteorder, daptype, bytes, storage); + return storage; + } + + /** + * Read and convert a string typed array + * + * @param var + * @return cursor + * @throws DapException + */ + protected Object compileStringVar(DapVariable var) throws IOException { + DapType daptype = var.getBaseType(); + assert daptype.isStringType(); + long dimproduct = var.getCount(); // == # strings + String[] storage = new String[(int) dimproduct]; + int count = 0; + // read each string + for (int i = 0; i < dimproduct; i++) { + int strsize = getCount(); + byte[] sbytes = new byte[strsize]; + int red = this.stream.read(sbytes); + assert red == strsize; + storage[count] = new String(sbytes, DapUtil.UTF8); + count++; + } + return storage; + } + + /** + * Read and convert an opaque typed array + * + * @param var + * @return cursor + * @throws DapException + */ + protected Object compileOpaqueVar(DapVariable var) throws IOException { + DapType daptype = var.getBaseType(); + assert daptype.isOpaqueType(); + long dimproduct = var.getCount(); // == # opaque objects + ByteBuffer[] storage = new ByteBuffer[(int) dimproduct]; + int count = 0; + // read each string + for (int i = 0; i < dimproduct; i++) { + int osize = getCount(); + byte[] obytes = new byte[osize]; + int red = this.stream.read(obytes); + assert red == osize; + storage[count] = ByteBuffer.wrap(obytes); + count++; + } + return storage; + } + + /** + * Compile a structure array. + * Since we are using ArrayStructureMA, we need to capture + * Our storage is Object[dimproduct]; this will be + * converted properly when the D4Cursor Array is created. + * + * @param var the template + * @return a StructureData[dimproduct] for the data for this struct. + * @throws DapException + */ + protected Object compileStructureArray(DapVariable var) throws IOException { + DapStructure dapstruct = (DapStructure) var.getBaseType(); + long dimproduct = var.getCount(); + Object[] storage = new Object[(int) dimproduct]; + Index idx = Index.factory(CDMUtil.computeEffectiveShape(var.getDimensions())); + long idxsize = idx.getSize(); + for (int offset = 0; (offset < idxsize); offset++) { + Object instance = compileStructure(dapstruct); + storage[offset] = instance; + } + return storage; + } + + /** + * Compile a structure instance. + * Storage is Object[dapstruct.getFields().size()]; + * + * @param dapstruct The template + * @return A DataStructure for the databuffer for this struct. + * @throws DapException + */ + protected Object compileStructure(DapStructure dapstruct) throws IOException { + List dfields = dapstruct.getFields(); + Object[] storage = new Object[dfields.size()]; + for (int m = 0; m < dfields.size(); m++) { + DapVariable dfield = dfields.get(m); + Object dvfield = compileVar(dfield); + storage[m] = dvfield; + } + return storage; + } + + /** + * Compile a sequence array. + * Our storage is Object[dimproduct] + * + * @param var the template + * @return Object[recordcount] + * @throws DapException + */ + protected Object compileSequenceArray(DapVariable var) throws IOException { + DapSequence dapseq = (DapSequence) var.getBaseType(); + long dimproduct = var.getCount(); + Object[] storage = new Object[(int) dimproduct]; + Index idx = Index.factory(CDMUtil.computeEffectiveShape(var.getDimensions())); + long idxsize = idx.getSize(); + for (int offset = 0; (offset < idxsize); offset++) { + Object seq = compileSequence(dapseq); + storage[offset] = seq; + } + return storage; + } + + /** + * Compile a sequence as a set of records. + * Our storage is Object[] where |storage| == nrecords + * + * @param dapseq + * @return sequence + * @throws DapException + */ + public Object compileSequence(DapSequence dapseq) throws IOException { + List dfields = dapseq.getFields(); + // Get the count of the number of records + long nrecs = getCount(); + Object[] records = new Object[(int) nrecs]; + for (int r = 0; r < nrecs; r++) { + Object record = compileStructure((DapStructure) dapseq); + records[r] = record; + } + return records; + } + + ////////////////////////////////////////////////// + // Utilities + + protected long extractChecksum() throws IOException { + assert this.checksummode == ChecksumMode.TRUE; + byte[] bytes = new byte[4]; // 4 == sizeof(checksum) + int red = this.stream.read(bytes); + assert red == 4; + ByteBuffer bb = ByteBuffer.wrap(bytes).order(this.remoteorder); + long csum = (int) bb.getInt(); + csum = csum & 0x00000000FFFFFFFF; + csum = csum & 0x00000000FFFFFFFFL; /* crc is 32 bits unsigned */ + return csum; + } + + protected void skip(long count) throws IOException { + for (long i = 0; i < count; i++) { + int c = this.stream.read(); + if (c < 0) + break; + } + } + + protected int getCount() throws IOException { + byte[] bytes = new byte[8]; // 8 == sizeof(long) + int red = this.stream.read(bytes); + assert red == 8; + ByteBuffer bb = ByteBuffer.wrap(bytes).order(this.remoteorder); + long count = bb.getLong(); + count = (count & 0xFFFFFFFF); + return (int) count; + } + + /** + * Compute the size in databuffer of the serialized form + * + * @param daptype + * @return type's serialized form size + */ + protected int computeTypeSize(DapType daptype) { + return LibTypeFcns.size(daptype); + } + + protected long walkByteStrings(long[] positions, ByteBuffer databuffer) throws IOException { + int count = positions.length; + long total = 0; + int savepos = databuffer.position(); + // Walk each bytestring + for (int i = 0; i < count; i++) { + int pos = databuffer.position(); + positions[i] = pos; + int size = getCount(); + total += DapConstants.COUNTSIZE; + total += size; + skip(size); + } + databuffer.position(savepos);// leave position unchanged + return total; + } + + public Array createArray(DapVariable var, Object storage) { + Array array = null; + switch (schemeFor(var)) { + case ATOMIC: + array = createAtomicArray(var, storage); + break; + case STRUCTARRAY: + array = createStructureArray(var, storage); + break; + case SEQARRAY: + array = createSequenceArray(var, storage); + break; + case STRUCTURE: + case SEQUENCE: + default: + assert false; + } + return array; + } + + protected Array createAtomicArray(DapVariable var, Object storage) { + DapType dtype = var.getBaseType(); + if (dtype.isEnumType()) { + // Coverity[FB.BC_UNCONFIRMED_CAST] + dtype = ((DapEnumeration) (var.getBaseType())); + } + DataType cdmtype = CDMTypeFcns.daptype2cdmtype(dtype); + int[] shape = CDMUtil.computeEffectiveShape(var.getDimensions()); + Array array = Array.factory(cdmtype, shape, storage); + return array; + } + + protected Array createStructureArray(DapVariable var, Object storage) { + DapType dtype = var.getBaseType(); + StructureMembers members = computemembers(var); + int[] shape = CDMUtil.computeEffectiveShape(var.getDimensions()); + Object[] instances = (Object[]) storage; + StructureData[] structdata = new StructureData[instances.length]; + for (int i = 0; i < instances.length; i++) { + Object[] fields = (Object[]) instances[i]; + StructureDataW sdw = new StructureDataW(members); + for (int f = 0; f < members.getMembers().size(); f++) { + StructureMembers.Member fm = sdw.getMembers().get(f); + DapVariable d4field = ((DapStructure) dtype).getField(f); + Object fielddata = fields[f]; + Array fieldarray = createArray(d4field, fielddata); + sdw.setMemberData(fm, fieldarray); + } + structdata[i] = sdw; + } + ArrayStructureW array = new ArrayStructureW(members, shape, structdata); + return array; + } + + /** + * Create an Array object for a DAP4 Sequence. + * Unfortunately, the whole CDM Sequence/VLEN mechanism + * is completely hosed, with no hope of a simple fix. + * It appears that the only thing we can do is support scalar sequences. + * However in useless hope, the code is written as if arrays of sequences + * can be supported. + * + * @param var + * @param storage + * @return + */ + protected Array createSequenceArray(DapVariable var, Object storage) { + DapType dtype = var.getBaseType(); + StructureMembers members = computemembers(var); + int[] shape = CDMUtil.computeEffectiveShape(var.getDimensions()); + Object[] allinstancedata = (Object[]) storage; + int ninstances = allinstancedata.length; + if (ninstances != 1) // enforce scalar assumption + throw new IndexOutOfBoundsException("Non-scalar Dap4 Sequences not supported"); + Array[] allinstances = new Array[ninstances]; + for (int i = 0; i < ninstances; i++) { // iterate over all sequence instances array + Object[] ithelemdata = (Object[]) allinstancedata[i]; + int nrecords = ithelemdata.length; + StructureData[] allrecords = new StructureData[nrecords]; // for creating the record iterator + for (int r = 0; r < nrecords; r++) { // iterate over the records of one sequence + Object[] onerecorddata = (Object[]) ithelemdata[r]; + StructureDataW onerecord = new StructureDataW(members); + for (int f = 0; f < members.getMembers().size(); f++) { // iterate over fields in one record + StructureMembers.Member fm = members.getMember(f); + DapVariable d4field = ((DapStructure) dtype).getField(f); + Array fieldarray = createArray(d4field, onerecorddata[f]); + onerecord.setMemberData(fm, fieldarray); + } + allrecords[r] = onerecord; + } + D4StructureDataIterator onesequence = new D4StructureDataIterator().setList(allrecords); + ArraySequence oneseq = new ArraySequence(members, onesequence, nrecords); + allinstances[i] = oneseq; + } + return allinstances[0]; // enforce scalar assumption + } + + /** + * Compute the StructureMembers object + * from a DapStructure. May need to recurse + * if a field is itself a Structure + * + * @param var The DapVariable to use to construct + * a StructureMembers object. + * @return The StructureMembers object for the given DapStructure + */ + static StructureMembers computemembers(DapVariable var) { + DapStructure ds = (DapStructure) var.getBaseType(); + StructureMembers sm = new StructureMembers(ds.getShortName()); + List fields = ds.getFields(); + for (int i = 0; i < fields.size(); i++) { + DapVariable field = fields.get(i); + DapType dt = field.getBaseType(); + DataType cdmtype = CDMTypeFcns.daptype2cdmtype(dt); + StructureMembers.Member m = + sm.addMember(field.getShortName(), "", null, cdmtype, CDMUtil.computeEffectiveShape(field.getDimensions())); + m.setDataParam(i); // So we can index into various lists + // recurse if this field is itself a structure + if (dt.getTypeSort().isStructType()) { + StructureMembers subsm = computemembers(field); + m.setStructureMembers(subsm); + } + } + return sm; + } + +} + diff --git a/dap4/src/main/java/dap4/dap4lib/D4Index.java b/dap4/src/main/java/dap4/dap4lib/D4Index.java new file mode 100644 index 0000000000..d97479a70b --- /dev/null +++ b/dap4/src/main/java/dap4/dap4lib/D4Index.java @@ -0,0 +1,152 @@ +/* + * Copyright 2012, UCAR/Unidata. + * See the LICENSE file for more information. + */ + +package dap4.dap4lib; + +import dap4.core.interfaces.DataIndex; +import dap4.core.util.DapException; +import dap4.core.util.Slice; +import ucar.ma2.Index; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +public class D4Index extends ucar.ma2.Index implements DataIndex { + + public static final D4Index SCALAR = new D4Index(0); + + ////////////////////////////////////////////////// + // Static methods + + /** + * Given an offset (single index) and a set of dimensions + * compute the set of dimension indices that correspond + * to the offset. + */ + static public Index offsetToIndex(int offset, int[] shape) { + // offset = d3*(d2*(d1*(x1))+x2)+x3 + int[] indices = new int[shape.length]; + for (int i = shape.length - 1; i >= 0; i--) { + indices[i] = offset % shape[i]; + offset = (offset - indices[i]) / shape[i]; + } + return new Index(indices, shape); + } + + /** + * Convert DataIndex to list of slices + * + * @param indices to convert + * @return list of corresponding slices + */ + + static public List indexToSlices(DataIndex indices) throws DapException { + // short circuit the scalar case + int rank = indices.getRank(); + if (rank == 0) + return Slice.SCALARSLICES; + // offset = d3*(d2*(d1*(x1))+x2)+x3 + List slices = new ArrayList<>(rank); + for (int i = 0; i < rank; i++) { + int isize = indices.getCurrentCounter(i); + slices.add(new Slice(isize, isize + 1, 1, indices.getShape(i))); + } + return slices; + } + + /** + * If a set of slices refers to a single position, + * then return the corresponding Index. Otherwise, + * throw Exception. + * + * @param slices + * @return Index corresponding to slices + * @throws DapException + */ + static public DataIndex slicesToIndex(List slices) throws DapException { + int[] positions = new int[slices.size()]; + int[] dimsizes = new int[slices.size()]; + for (int i = 0; i < positions.length; i++) { + Slice s = slices.get(i); + if (s.getCount() != 1) + throw new DapException("Attempt to convert non-singleton sliceset to index"); + positions[i] = s.getFirst(); + dimsizes[i] = s.getMax(); + } + return new D4Index(positions, dimsizes); + } + + ////////////////////////////////////////////////// + // Constructor(s) + + public D4Index(int rank) { + super(rank); + } + + public D4Index(int[] _shape) { + super(_shape); + } + + public D4Index(D4Index index) { + this(index.getRank()); + if (this.rank > 0) { + System.arraycopy(index.getCurrentCounter(), 0, this.current, 0, this.rank); + System.arraycopy(index.getShape(), 0, this.getShape(), 0, this.rank); + } + } + + public D4Index(int[] indices, int[] dimsizes) { + super(dimsizes); + if (this.rank > 0) { + System.arraycopy(indices, 0, this.current, 0, this.rank); + } + } + + public String toString() { + StringBuilder buf = new StringBuilder(); + buf.append('['); + for (int i = 0; i < this.rank; i++) { + if (i > 0) + buf.append(','); + buf.append(this.current[i]); + buf.append('/'); + buf.append(this.shape[i]); + } + buf.append("]("); + buf.append(this.index()); + buf.append(")"); + return buf.toString(); + } + + /** + * Compute the linear index + * from the current odometer indices. + * Not quite the same as super.currentElement(), + * which does not use shape[], but does use the super's + * "unexpected" notion of stride, although result may be same. + */ + public int index() { + int offset = this.offset; + int[] cur = getCurrentCounter(); + int[] sh = getShape(); + for (int i = 0; i < cur.length; i++) { + offset *= sh[i]; + offset += cur[i]; + } + return offset; + } + + public int getCurrentCounter(int i) { + if (i < 0 || i >= this.rank) + throw new IllegalArgumentException(); + return getCurrentCounter()[i]; + } + + public boolean isScalar() { + return (rank == 0 && getCurrentCounter().length == 1 && index() == 1); + } + +} diff --git a/dap4/d4core/src/main/java/dap4/core/data/DSPRegistry.java b/dap4/src/main/java/dap4/dap4lib/DSPRegistry.java similarity index 85% rename from dap4/d4core/src/main/java/dap4/core/data/DSPRegistry.java rename to dap4/src/main/java/dap4/dap4lib/DSPRegistry.java index 24b228cc8d..bdc920a2e6 100644 --- a/dap4/d4core/src/main/java/dap4/core/data/DSPRegistry.java +++ b/dap4/src/main/java/dap4/dap4lib/DSPRegistry.java @@ -3,7 +3,7 @@ * See the LICENSE file for more information. */ -package dap4.core.data; +package dap4.dap4lib; import dap4.core.util.DapContext; import dap4.core.util.DapException; @@ -25,10 +25,10 @@ public class DSPRegistry { // Type Decls protected static class Registration { - Class dspclass; - DSP matcher; + Class dspclass; + D4DSP matcher; - public Registration(Class cl) { + public Registration(Class cl) { this.dspclass = cl; try { this.matcher = dspclass.newInstance(); @@ -83,7 +83,7 @@ public static void setLoader(ClassLoader ldr) { */ public synchronized void register(String className, boolean last) throws DapException { try { - Class klass = (Class) loader.loadClass(className); + Class klass = (Class) loader.loadClass(className); register(klass, last); } catch (ClassNotFoundException e) { throw new DapException(e); @@ -99,7 +99,7 @@ public synchronized void register(String className, boolean last) throws DapExce * @throws InstantiationException if class doesnt have a no-arg constructor. * @throws ClassCastException if class doesnt implement DSP interface. */ - public synchronized void register(Class klass, boolean last) { + public synchronized void register(Class klass, boolean last) { // is this already defined? if (registered(klass)) return; @@ -115,7 +115,7 @@ public synchronized void register(Class klass, boolean last) { * @param klass Class for which to search */ - public synchronized boolean registered(Class klass) { + public synchronized boolean registered(Class klass) { for (Registration r : registry) { if (r.dspclass == klass) return true; @@ -128,7 +128,7 @@ public synchronized boolean registered(Class klass) { * * @param klass Class for which to search */ - public synchronized void unregister(Class klass) { + public synchronized void unregister(Class klass) { for (int i = 0; i < registry.size(); i++) { if (registry.get(i).dspclass == klass) { registry.remove(i); @@ -143,13 +143,13 @@ public synchronized void unregister(Class klass) { * @throws DapException */ - public synchronized DSP findMatchingDSP(String path, DapContext cxt) throws DapException { + public synchronized D4DSP findMatchingDSP(String path, DapContext cxt) throws DapException { for (int i = 0; i < registry.size(); i++) { try { Registration tester = registry.get(i); boolean ismatch = (Boolean) tester.matcher.dspMatch(path, cxt); if (ismatch) { - DSP dsp = (DSP) tester.dspclass.newInstance(); + D4DSP dsp = (D4DSP) tester.dspclass.newInstance(); return dsp; } } catch (Exception e) { diff --git a/dap4/d4lib/src/main/java/dap4/dap4lib/DapCodes.java b/dap4/src/main/java/dap4/dap4lib/DapCodes.java similarity index 100% rename from dap4/d4lib/src/main/java/dap4/dap4lib/DapCodes.java rename to dap4/src/main/java/dap4/dap4lib/DapCodes.java diff --git a/dap4/d4lib/src/main/java/dap4/dap4lib/DapLog.java b/dap4/src/main/java/dap4/dap4lib/DapLog.java similarity index 100% rename from dap4/d4lib/src/main/java/dap4/dap4lib/DapLog.java rename to dap4/src/main/java/dap4/dap4lib/DapLog.java diff --git a/dap4/src/main/java/dap4/dap4lib/DapProtocol.java b/dap4/src/main/java/dap4/dap4lib/DapProtocol.java new file mode 100644 index 0000000000..b94bcb7250 --- /dev/null +++ b/dap4/src/main/java/dap4/dap4lib/DapProtocol.java @@ -0,0 +1,164 @@ +/* + * Copyright 2012, UCAR/Unidata. + * See the LICENSE file for more information. + */ + +package dap4.dap4lib; + +import dap4.core.util.ResponseFormat; +import dap4.core.util.XURI; + +import java.net.URISyntaxException; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + +/** + * Store protocol related constants + */ + +public abstract class DapProtocol implements DapCodes { + + ////////////////////////////////////////////////// + // Constants + + // protected static final String DAPVERSION = "4.0"; + // protected static final String DMRVERSION = "1.0"; + + protected static final String DAP4PROTO = "dap4"; + + ////////////////////////////////////////////////// + // Static variables + + static protected final Set DAP4EXTENSIONS; + static protected final Set DAP4QUERYMARKERS; + static protected final Set DAP4SCHEMES; + + static { + DAP4EXTENSIONS = new HashSet(); + DAP4EXTENSIONS.add("dmr"); + DAP4EXTENSIONS.add("dap"); + DAP4EXTENSIONS.add("dst"); + + DAP4QUERYMARKERS = new HashSet(); + DAP4QUERYMARKERS.add("dap4.checksum"); + DAP4QUERYMARKERS.add("dap4.ce"); + + DAP4SCHEMES = new HashSet(); + DAP4SCHEMES.add("dap4"); + DAP4SCHEMES.add("http"); + DAP4SCHEMES.add("https"); + // Note that file: is missing + }; + + + // Map RequestMode X ResponseFormat => ContentType + public static Map contenttypes; + + static public String contentKey(RequestMode mode, ResponseFormat format) { + return mode.id() + "." + format.id(); + } + + static { + // Map request x response -> (contentype,mimetype) + // If response is none, then this indicates the default + contenttypes = new HashMap(); + contenttypes.put(contentKey(RequestMode.NONE, ResponseFormat.NONE), new ContentType(RequestMode.DSR, + ResponseFormat.XML, "application/vnd.opendap.dap4.dataset-services+xml", "text/xml")); + contenttypes.put(contentKey(RequestMode.DMR, ResponseFormat.NONE), new ContentType(RequestMode.DMR, + ResponseFormat.XML, "application/vnd.opendap.dap4.dataset-metadata+xml", "text/xml")); + contenttypes.put(contentKey(RequestMode.DMR, ResponseFormat.XML), new ContentType(RequestMode.DMR, + ResponseFormat.XML, "application/vnd.opendap.dap4.dataset-metadata+xml", "text/xml")); + contenttypes.put(contentKey(RequestMode.DAP, ResponseFormat.NONE), new ContentType(RequestMode.DAP, + ResponseFormat.NONE, "application/vnd.opendap.dap4.data", "application/octet-stream")); + contenttypes.put(contentKey(RequestMode.DSR, ResponseFormat.NONE), new ContentType(RequestMode.DSR, + ResponseFormat.HTML, "application/vnd.opendap.dap4.dataset-services+html", "text/html")); + contenttypes.put(contentKey(RequestMode.DSR, ResponseFormat.XML), new ContentType(RequestMode.DSR, + ResponseFormat.XML, "application/vnd.opendap.dap4.dataset-services+xml", "text/xml")); + contenttypes.put(contentKey(RequestMode.DSR, ResponseFormat.HTML), new ContentType(RequestMode.DSR, + ResponseFormat.HTML, "application/vnd.opendap.dap4.dataset-services+html", "text/html")); + contenttypes.put(contentKey(RequestMode.CAPABILITIES, ResponseFormat.NONE), new ContentType( + RequestMode.CAPABILITIES, ResponseFormat.HTML, "application/vnd.opendap.dap4.capabilities+html", "text/html")); + contenttypes.put(contentKey(RequestMode.CAPABILITIES, ResponseFormat.XML), new ContentType(RequestMode.CAPABILITIES, + ResponseFormat.XML, "application/vnd.opendap.dap4.capabilities+xml", "text/xml")); + contenttypes.put(contentKey(RequestMode.CAPABILITIES, ResponseFormat.HTML), new ContentType( + RequestMode.CAPABILITIES, ResponseFormat.HTML, "application/vnd.opendap.dap4.capabilities+html", "text/html")); + contenttypes.put(contentKey(RequestMode.ERROR, ResponseFormat.NONE), + new ContentType(RequestMode.ERROR, ResponseFormat.XML, "application/vnd.opendap.dap4.error+xml", "text/xml")); + contenttypes.put(contentKey(RequestMode.ERROR, ResponseFormat.XML), + new ContentType(RequestMode.ERROR, ResponseFormat.XML, "application/vnd.opendap.dap4.error+xml", "text/xml")); + // Everything else is an error + } + + ////////////////////////////////////////////////// + + public static class ContentType { + public RequestMode mode; + public ResponseFormat format; + public String contenttype; + public String mimetype; + + public ContentType(RequestMode mode, ResponseFormat format, String contenttype, String mimetype) { + this.mode = mode; + this.format = format; + this.contenttype = contenttype; + this.mimetype = mimetype; + } + } + + ////////////////////////////////////////////////// + // Definitive test if a url looks like it is a DAP4 url + + /** + * A path is a DAP4 path if at least one of the following is true. + * 1. it has "dap4:" as its leading protocol + * 2. it has protocol=dap4 | mode=dap4 | dap4 in its fragment + * 3. it has dmr|dsr|dap as its request extension + * 4. it has dap4|d4ts in its path + * + * @param xuri parsed uri + * @return true if this uri appears to be processible by DAP4 + */ + static public boolean isDap4URI(XURI xuri) { + boolean found = false; + // This is definitive + if ("dap4".equalsIgnoreCase(xuri.getScheme())) + return true; + // Necessary but not sufficient + if (!DAP4SCHEMES.contains(xuri.getScheme().toLowerCase())) + return false; + for (Map.Entry entry : xuri.getQueryFields().entrySet()) { + if (DAP4QUERYMARKERS.contains(entry.getKey())) + return true; // definitive + } + // Fragment checking is a bit more complex + String d4 = xuri.getFragFields().get("dap4"); + if (d4 != null) + return true; // definitive + String p = xuri.getFragFields().get("protocol"); + if (p != null) { + if (p.equalsIgnoreCase("dap4")) + return true; // definitive + } + String modes = xuri.getFragFields().get("mode"); + if (modes != null) { + String[] modelist = modes.split("[,]"); + for (String mode : modelist) { + if (mode.equalsIgnoreCase("dap4")) + return true; // definitive + } + } + return false; + } + + static public boolean isDap4URI(String uri) { + try { + XURI xuri = new XURI(uri); + return isDap4URI(xuri); + } catch (URISyntaxException use) { + return false; + } + } + +} diff --git a/dap4/d4lib/src/main/java/dap4/dap4lib/DapStartLog.java b/dap4/src/main/java/dap4/dap4lib/DapStartLog.java similarity index 100% rename from dap4/d4lib/src/main/java/dap4/dap4lib/DapStartLog.java rename to dap4/src/main/java/dap4/dap4lib/DapStartLog.java diff --git a/dap4/src/main/java/dap4/dap4lib/DeChunkedInputStream.java b/dap4/src/main/java/dap4/dap4lib/DeChunkedInputStream.java new file mode 100644 index 0000000000..c11b509c06 --- /dev/null +++ b/dap4/src/main/java/dap4/dap4lib/DeChunkedInputStream.java @@ -0,0 +1,333 @@ +/* + * Copyright 2012, UCAR/Unidmodeata. + * See the LICENSE file for more information. + */ + +package dap4.dap4lib; + + +import dap4.core.util.DapConstants; +import dap4.core.util.DapException; +import dap4.core.util.DapUtil; + +import java.io.IOException; +import java.io.InputStream; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.util.zip.Checksum; + +/** + * This class transforms a chunked input stream to a de-chunked input stream. + * Given the input stream, produce a ByteBuffer with all chunking information removed. + * There are two special cases. + * 1. Error chunk -- cache the error chunk as text and provide accessors to obtain it. + * 2. DMR -- cache the DMR, whatever the mode, and provide accessors. + * + */ + +public class DeChunkedInputStream extends InputStream { + + ////////////////////////////////////////////////// + // Constants + + static final int DFALTCHUNKSIZE = 0x00FFFFFF; + + static final byte CR8 = DapUtil.extract(DapUtil.UTF8.encode("\r"))[0]; + static final byte LF8 = DapUtil.extract(DapUtil.UTF8.encode("\n"))[0]; + + static final int HDRSIZE = 4; // bytes + + ////////////////////////////////////////////////// + // Types + + static protected class Chunk { // Could we use ByteBuffer? + public byte[] chunk; + public int size; // note that chunk.length > size is possible + public int avail; + public int pos; + public int flags; // from last chunk header + + public Chunk() { + chunk = null; + size = 0; + avail = 0; + pos = 0; + flags = 0; + } + } + + static public enum State { + INITIAL, MORE, END, ERROR; + } + + ////////////////////////////////////////////////// + // Fields + + InputStream source = null; + + protected RequestMode mode = RequestMode.NONE; + + protected ByteOrder remoteorder = null; + protected State state = State.INITIAL; + protected Chunk chunk = null; // the whole current chunk + + protected Checksum crc32alg = new java.util.zip.CRC32(); + protected long crc32 = 0; + protected boolean checksumming = false; + + // Cache two special chunks + protected String errortext = null; + protected String dmrtext = null; + + ////////////////////////////////////////////////// + // Constructor(s) + + public DeChunkedInputStream(InputStream src, RequestMode mode) throws IOException { + this.source = src; + this.chunk = new Chunk(); + this.mode = mode; + readDMR(this.chunk); + if (state == State.ERROR) + throw new DapException("DeChunkedInputStream: cannot read DMR"); + } + + ////////////////////////////////////////////////// + // InputStream Defining Methods + + public int available() throws IOException { + throw new UnsupportedOperationException(); + } + + public void close() throws IOException { + this.source.close(); + } + + public void mark(int readlimit) { + throw new UnsupportedOperationException(); + } + + public void reset() throws IOException { + source.reset(); + } + + public boolean markSupported() { + return false; + } + + public int read() throws IOException { + if (this.chunk.avail == 0) { + int red = readChunk(this.chunk); // read next chunk + if (red <= 0) + return red; + } + assert this.chunk.avail > 0; + int c = this.chunk.chunk[this.chunk.pos]; + this.chunk.pos++; + this.chunk.avail--; + if (checksumming) + computeChecksum(c); + return c; + } + + // Reads some number of bytes from the input stream and stores them + // into the buffer array b. + public int read(byte[] b) throws IOException { + return read(b, 0, b.length); + } + + // Reads up to len bytes of data from the input stream into an array of bytes. + public int read(byte[] b, int off, int len) throws IOException { + if (b.length < off + len) + throw new DapException("DeChunkedInputStream: illegal arguments: len+offset > |b|"); // avoid overflow + int remainder = len; // track # of bytes to read + int pos = off; // read point in b + while (remainder > 0) { + if (this.chunk.avail == 0) { + int red = readChunk(this.chunk); // read next chunk + if (red <= 0) + throw new IOException("DeChunkedInputStream: IO error"); + assert this.chunk.avail == red; + } + assert this.chunk.avail > 0; + int avail = this.chunk.avail; + int toread = avail; // max readable + if (avail > remainder) + toread = remainder; // only read what we need + System.arraycopy(this.chunk.chunk, this.chunk.pos, b, pos, toread); // transfer what we can + this.chunk.pos += toread; // track source availability + this.chunk.avail -= toread; + pos += toread; // track dest availability + remainder -= toread; + } + if (checksumming) + computeChecksum(b, off, len); + return len; + } + + public long skip(long n) throws IOException { + long count = n; + while (count > 0) { + if (this.chunk.avail == 0) { + int red = readChunk(this.chunk); // read next chunk + if (red <= 0) + return (n - count); + assert this.chunk.avail == red; + } + assert this.chunk.avail > 0; + if (count <= this.chunk.avail) { + this.chunk.pos += count; + this.chunk.avail -= count; + count = n; // we read n bytes + break; + } else { + this.chunk.pos += this.chunk.avail; + this.chunk.avail -= this.chunk.avail; + count -= this.chunk.avail; + } + } + return count; + } + + ////////////////////////////////////////////////// + // Accessors + + public State getState() { + return this.state; + } + + public String getErrorText() { + return this.errortext; + } + + public String getDMRText() { + return this.dmrtext; + } + + // Primarily to access DMR and ERROR chunks + public byte[] getCurrentChunk() throws IOException { + if (this.state == State.INITIAL) + this.readChunk(this.chunk); // prime pump + byte[] truechunk = new byte[this.chunk.size]; + System.arraycopy(this.chunk.chunk, 0, truechunk, 0, this.chunk.size); + return truechunk; + }; + + public ByteOrder getRemoteOrder() { + return this.remoteorder; + } + + ////////////////////////////////////////////////// + // Methods + + protected int readChunk(Chunk chunk) throws IOException { + assert this.mode == RequestMode.DAP; + switch (state) { + case INITIAL: + case MORE: + if (!readHeader(this.chunk)) + throw new DapException("Malformed chunked source"); + if (state == State.INITIAL) + this.remoteorder = (this.chunk.flags & DapConstants.CHUNK_LITTLE_ENDIAN) == 0 ? ByteOrder.BIG_ENDIAN + : ByteOrder.LITTLE_ENDIAN; + // Figure out the next state + if ((this.chunk.flags & DapConstants.CHUNK_ERROR) == 1) + state = State.ERROR; + else if ((this.chunk.flags & DapConstants.CHUNK_END) == 1) + state = State.END; + else + state = State.MORE; + // Now read the chunk + if (this.chunk.chunk == null || this.chunk.size > this.chunk.chunk.length) + this.chunk.chunk = new byte[this.chunk.size]; // reallocate + this.chunk.pos = 0; + this.chunk.avail = this.chunk.size; + // read the whole chunk + int red = DapUtil.readbinaryfilepartial(source, this.chunk.chunk, this.chunk.size); + assert (red == this.chunk.size); + // If we are in an error state, then throw exception + if (this.state == State.ERROR) + throw new DapException("DeChunkedInputStream: Error chunk encountered"); + break; + case END: + case ERROR: + throw new DapException("Illegal chunk state"); + } + return this.chunk.size; + } + + protected int readDMR(Chunk chunk) throws IOException { + assert (this.state == State.INITIAL); + switch (this.mode) { + case DMR: + this.remoteorder = ByteOrder.nativeOrder(); // do not really know + this.chunk.chunk = DapUtil.readbinaryfile(source); // read whole input stream as DMR + this.chunk.size = this.chunk.chunk.length; + if (this.chunk.size > 0) { + this.dmrtext = new String(this.chunk.chunk, DapUtil.UTF8); + // Make sure the state looks correct + this.chunk.pos = this.chunk.size; + this.chunk.avail = 0; + this.state = State.END; + this.remoteorder = ByteOrder.nativeOrder(); // do not really know + } else { + this.state = State.ERROR; + throw new DapException("DeChunkedInputStream: Error chunk encountered when reading DMR"); + } + break; + case DAP: + this.remoteorder = ByteOrder.nativeOrder(); // do not really know + readChunk(this.chunk); + this.dmrtext = new String(this.chunk.chunk, DapUtil.UTF8); + this.skip(this.chunk.size); + break; + default: + throw new DapException("Illegal request mode"); + } + return this.chunk.size; + } + + /** + * Read the size+flags header from the input source and use it to + * initialize the chunk state + * + * @return true if header read false if immediate eof encountered or chunk is too short + */ + + protected boolean readHeader(Chunk chunk) throws IOException { + byte[] bytehdr = new byte[HDRSIZE]; + int red = this.source.read(bytehdr); + if (red < HDRSIZE) + return false; + int flags = ((int) bytehdr[0]) & 0xFF; // Keep unsigned + bytehdr[0] = 0; + ByteBuffer buf = ByteBuffer.wrap(bytehdr).order(ByteOrder.BIG_ENDIAN); + int size = buf.getInt(); + this.chunk.size = size; + this.chunk.flags = flags; + return true; + } + + public void startChecksum() { + this.checksumming = true; + crc32alg.reset(); + } + + public void computeChecksum(byte[] b, int offset, int extent) { + // Slice out the part on which to compute the CRC32 and compute CRC32 + crc32alg.update(b, offset, extent); + } + + public void computeChecksum(int b) { + // Slice out the part on which to compute the CRC32 and compute CRC32 + crc32alg.update(b); + } + + public long endChecksum() { + this.crc32 = crc32alg.getValue(); // get the digest value + this.crc32 = this.crc32 & 0x00000000FFFFFFFFL; /* crc is 32 bits unsigned */ + this.checksumming = false; + return this.crc32; + } + + +} diff --git a/dap4/d4lib/src/main/java/dap4/dap4lib/ErrorException.java b/dap4/src/main/java/dap4/dap4lib/ErrorException.java similarity index 100% rename from dap4/d4lib/src/main/java/dap4/dap4lib/ErrorException.java rename to dap4/src/main/java/dap4/dap4lib/ErrorException.java diff --git a/dap4/src/main/java/dap4/dap4lib/HttpDSP.java b/dap4/src/main/java/dap4/dap4lib/HttpDSP.java new file mode 100644 index 0000000000..b028eaebab --- /dev/null +++ b/dap4/src/main/java/dap4/dap4lib/HttpDSP.java @@ -0,0 +1,179 @@ +/* + * Copyright 2012, UCAR/Unidata. + * See the LICENSE file for more information. + */ + +package dap4.dap4lib; + +import dap4.core.util.ChecksumMode; +import dap4.core.dmr.DapDataset; +import dap4.core.util.*; +import dap4.dap4lib.D4DSP; +import dap4.dap4lib.D4DataCompiler; +import org.apache.http.HttpStatus; +import ucar.httpservices.*; +import ucar.nc2.NetcdfFile; + +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.URISyntaxException; +import java.nio.ByteBuffer; +import java.util.Map; + +/** + * Make a request to a server and convert the reply + * to a DapDataset from the returned bytes. + */ + +public class HttpDSP extends D4DSP { + + ////////////////////////////////////////////////// + // Constants + + protected static final boolean DEBUG = false; + + protected static final int DFALTPRELOADSIZE = 50000; // databuffer + + ////////////////////////////////////////////////// + // Static methods + + static public void setHttpDebug() { + HTTPIntercepts.setGlobalDebugInterceptors(true); + } + + ////////////////////////////////////////////////// + // Instance variables + + protected boolean allowCompression = true; + protected int status = HttpStatus.SC_OK; // response + + ////////////////////////////////////////////////// + // Constructor(s) + + public HttpDSP() { + super(); + } + + ////////////////////////////////////////////////// + // DSP API + + public D4DSP open(String fileurl, ChecksumMode cmode) throws DapException { + super.open(fileurl, cmode); + return this; + } + + /** + * @param url + * @param context Any parameters that may help to decide. + * @return true if this url appears to be processible by this DSP + */ + public boolean dspMatch(String url, DapContext context) { + return DapProtocol.isDap4URI(url); + } + + ///////////////////////////////////////// + // AbstractDSP extensions + + /* + * @Override + * public String getPath() + * { + * return this.originalurl; + * } + */ + + ////////////////////////////////////////////////// + // Load methods + + public void loadDMR() throws DapException { + String methodurl = getMethodUrl(RequestMode.DMR, this.checksummode); + try { + InputStream stream = makeRequest(methodurl); // close later + setStream(stream, RequestMode.DMR); + super.loadDMR(); + } catch (IOException e) { + throw new DapException(e); + } + } + + /** + * This will be called lazily when trying to read data. + * + * @throws DapException + */ + public void loadDAP() throws DapException { + String methodurl = getMethodUrl(RequestMode.DAP, this.checksummode); + try (InputStream stream = makeRequest(methodurl)) { + // Extract and "compile" the server response, ignoring the leading DMR + setStream(stream, RequestMode.DAP); + super.loadDAP(); + } catch (IOException ioe) { + throw new DapException(ioe); + } + } + + ////////////////////////////////////////////////// + // Request/Response methods + + /** + * Open a connection and make a request for the (possibly constrained) DMR|DAP + * (choice is made by url extension) + * + * @throws DapException + */ + + protected InputStream makeRequest(String methodurl) throws DapException { + // Assume mode is consistent with the url. + InputStream stream; + // Make the request and return the input stream for accessing the databuffer + URI uri; + try { + uri = HTTPUtil.parseToURI(methodurl); + } catch (URISyntaxException mue) { + throw new DapException("Malformed url: " + methodurl); + } + long start = System.currentTimeMillis(); + long stop = 0; + this.status = 0; + HTTPMethod method = null; // Implicitly passed out to caller via stream + try { // Note that we cannot use try with resources because we export the method stream, so method + // must not be closed. + method = HTTPFactory.Get(methodurl); + if (allowCompression) + method.setCompression("deflate,gzip"); + this.status = method.execute(); + if (this.status != HttpStatus.SC_OK) { + String msg = method.getResponseAsString(); + throw new DapException("Request failure: " + status + ": " + methodurl).setCode(status); + } + // Get the response body stream => do not close the method + return method.getResponseAsStream(); + } catch (HTTPException e) { + if (method != null) + method.close(); + throw new DapException(e); + } + } + + ////////////////////////////////////////////////// + // Utilities + + protected static String buildURL(String baseurl, String suffix, DapDataset template, String ce) { + StringBuilder methodurl = new StringBuilder(); + methodurl.append(baseurl); + if (suffix != null) { + methodurl.append('.'); + methodurl.append(suffix); + } + if (ce != null && ce.length() > 0) { + methodurl.append("?"); + methodurl.append(DapConstants.CONSTRAINTTAG); + methodurl.append('='); + methodurl.append(ce); + } + return methodurl.toString(); + } + +} diff --git a/dap4/d4lib/src/main/java/dap4/dap4lib/LibTypeFcns.java b/dap4/src/main/java/dap4/dap4lib/LibTypeFcns.java similarity index 100% rename from dap4/d4lib/src/main/java/dap4/dap4lib/LibTypeFcns.java rename to dap4/src/main/java/dap4/dap4lib/LibTypeFcns.java diff --git a/dap4/src/main/java/dap4/dap4lib/RawDSP.java b/dap4/src/main/java/dap4/dap4lib/RawDSP.java new file mode 100644 index 0000000000..70ffe9bb1b --- /dev/null +++ b/dap4/src/main/java/dap4/dap4lib/RawDSP.java @@ -0,0 +1,109 @@ +/* + * Copyright 2012, UCAR/Unidata. + * See the LICENSE file for more information. + */ + +package dap4.dap4lib; + +import dap4.core.dmr.parser.DOM4Parser; +import dap4.core.dmr.parser.Dap4Parser; +import dap4.core.util.*; + +import java.io.*; +import java.net.URISyntaxException; + +/** + * Provide a DSP interface to raw data + */ + +public class RawDSP extends D4DSP { + ////////////////////////////////////////////////// + // Constants + + protected static final String[] EXTENSIONS = new String[] {".dap", ".raw"}; + + ////////////////////////////////////////////////// + // Instance variables + + ////////////////////////////////////////////////// + // Constructor(s) + + public RawDSP() {} + + ////////////////////////////////////////////////// + // D4DSP API + + // Note that there is no point in delaying the compilation of the + // DMR and DAP since we are reading the whole DAP anyway + @Override + public D4DSP open(String fileurl, ChecksumMode cmode) throws DapException { + mode = RequestMode.DAP; // force it + super.open(fileurl, cmode); + String methodurl = getMethodUrl(mode, this.checksummode); + parseURL(methodurl); // reparse + String realpath = this.xuri.getRealPath(); + try { + FileInputStream stream = new FileInputStream(realpath); + setStream(stream, RequestMode.DAP); + } catch (IOException ioe) { + throw new DapException(ioe).setCode(DapCodes.SC_INTERNAL_SERVER_ERROR); + } + return this; + } + + /** + * A path is file if it has no base protocol or is file: + * + * @param location file:/ or possibly an absolute path + * @param context Any parameters that may help to decide. + * @return true if this path appears to be processible by this DSP + */ + public boolean dspMatch(String location, DapContext context) { + try { + XURI xuri = new XURI(location); + if (xuri.isFile()) { + String path = xuri.getPath(); + for (String ext : EXTENSIONS) { + if (path.endsWith(ext)) + return true; + } + } + } catch (URISyntaxException use) { + return false; + } + return false; + } + + ////////////////////////////////////////////////// + // Load Operations + + /** + * LoadDMR actually loads DAP since we know that we will need that eventually. + * + * @throws DapException + */ + + public void loadDMR() throws DapException { + String methodurl = getMethodUrl(mode, this.checksummode); + parseURL(methodurl); // reparse + String realpath = this.xuri.getRealPath(); + try { + FileInputStream stream = new FileInputStream(realpath); + setStream(stream, RequestMode.DAP); + super.loadDMR(); + } catch (IOException ioe) { + throw new DapException(ioe).setCode(DapCodes.SC_INTERNAL_SERVER_ERROR); + } + } + + /** + * loadDMR will have already loaded the DAP stream, + * so all that is left is to compile the data stream, + * + * @throws DapException + */ + public void loadDAP() throws IOException { + super.loadDAP(); + } + +} diff --git a/dap4/d4lib/src/main/java/dap4/dap4lib/RequestMode.java b/dap4/src/main/java/dap4/dap4lib/RequestMode.java similarity index 56% rename from dap4/d4lib/src/main/java/dap4/dap4lib/RequestMode.java rename to dap4/src/main/java/dap4/dap4lib/RequestMode.java index 7cb64b5051..a650d3b0f3 100644 --- a/dap4/d4lib/src/main/java/dap4/dap4lib/RequestMode.java +++ b/dap4/src/main/java/dap4/dap4lib/RequestMode.java @@ -10,14 +10,21 @@ * Define the enum for the possible Request/Response modes */ public enum RequestMode { - DMR("dmr"), DAP("dap"), DSR("dsr"), CAPABILITIES(null), ERROR(null); + DMR("dmr", "dmr"), DAP("dap", "dap"), DSR("dsr", "dsr"), CAPABILITIES("capabilities", ""), ERROR("error", + null), NONE("none", null); + private String id; private String extension; - RequestMode(String extension) { + RequestMode(String id, String extension) { + this.id = id; this.extension = extension; } + public String id() { + return id; + } + public String extension() { return extension; } @@ -30,8 +37,16 @@ public static RequestMode modeFor(String s) { return null; } + public static RequestMode idMode(String id) { + for (RequestMode mode : RequestMode.values()) { + if (mode.id() != null && id.equalsIgnoreCase(mode.id)) + return mode; + } + return null; + } + public String toString() { - return extension; + return id; } } diff --git a/dap4/d4cdm/src/main/java/dap4/cdm/CDMTypeFcns.java b/dap4/src/main/java/dap4/dap4lib/cdm/CDMTypeFcns.java similarity index 91% rename from dap4/d4cdm/src/main/java/dap4/cdm/CDMTypeFcns.java rename to dap4/src/main/java/dap4/dap4lib/cdm/CDMTypeFcns.java index 535fca567c..7e02d6ef3d 100644 --- a/dap4/d4cdm/src/main/java/dap4/cdm/CDMTypeFcns.java +++ b/dap4/src/main/java/dap4/dap4lib/cdm/CDMTypeFcns.java @@ -3,7 +3,7 @@ * See the LICENSE file for more information. */ -package dap4.cdm; +package dap4.dap4lib.cdm; import dap4.core.dmr.DapEnumeration; import dap4.core.dmr.DapType; @@ -16,9 +16,12 @@ import ucar.ma2.DataType; import ucar.ma2.ForbiddenConversionException; import ucar.nc2.EnumTypedef; +import ucar.nc2.Sequence; +import ucar.nc2.Structure; + import java.math.BigDecimal; import java.math.BigInteger; -import java.nio.ByteBuffer; +import java.nio.*; import java.util.ArrayList; import java.util.List; @@ -40,46 +43,46 @@ public abstract class CDMTypeFcns { // Static Methods /* Needed to implement Array.getElement() */ - public static Class cdmElementClass(DataType dt) { + static public Class cdmElementClass(DataType dt) { switch (dt) { case BOOLEAN: - return boolean.class; + return Boolean.class; case ENUM1: case BYTE: - return byte.class; + return Byte.class; case CHAR: - return char.class; + return Character.class; case ENUM2: case SHORT: - return short.class; + return Short.class; case ENUM4: case INT: - return int.class; + return Integer.class; case LONG: - return long.class; + return Long.class; case FLOAT: - return float.class; + return Float.class; case DOUBLE: - return double.class; + return Double.class; case STRING: return String.class; case OPAQUE: return ByteBuffer.class; case UBYTE: - return byte.class; + return Byte.class; case USHORT: - return short.class; + return Short.class; case UINT: - return int.class; + return Integer.class; case ULONG: - return long.class; + return Long.class; default: break; } return null; } - public static Object createVector(DataType type, long count) { + static public Object createVector(DataType type, long count) { int icount = (int) count; Object vector = null; switch (type) { @@ -126,13 +129,17 @@ public static Object createVector(DataType type, long count) { return vector; } - public static Object createVector(DapType type, long count) { + static public boolean signify(DapType type) { + return daptype2cdmtype(type).isUnsigned(); + } + + static public Object createVector(DapType type, long count) { if (type.getAtomicType() == TypeSort.Enum) return createVector(((DapEnumeration) type).getBaseType(), count); return CoreTypeFcns.createVector(type.getTypeSort(), count); } - public static DataType enumTypeFor(DapType type) { + static public DataType enumTypeFor(DapType type) { switch (type.getTypeSort()) { case Char: case Int8: @@ -157,7 +164,7 @@ public static DataType enumTypeFor(DapType type) { return null; } - public static DapType cdmtype2daptype(DataType datatype) { + static public DapType cdmtype2daptype(DataType datatype) { switch (datatype) { case CHAR: return DapType.CHAR; @@ -203,7 +210,7 @@ public static DapType cdmtype2daptype(DataType datatype) { return null; } - public static DataType daptype2cdmtype(DapType type) { + static public DataType daptype2cdmtype(DapType type) { assert (type != null); switch (type.getTypeSort()) { case Char: @@ -265,7 +272,6 @@ public static DataType daptype2cdmtype(DapType type) { return null; } - /** * Conmpute the size, in databuffer, * of the daptype wrt to a serialization; @@ -274,7 +280,7 @@ public static DataType daptype2cdmtype(DapType type) { * @param atomtype The type of interest * @return the size, in databuffer */ - public static int daptypeSize(TypeSort atomtype) { + static public int daptypeSize(TypeSort atomtype) { switch (atomtype) { case Char: // remember serial size is 1, not 2. case UInt8: @@ -297,7 +303,7 @@ public static int daptypeSize(TypeSort atomtype) { return 0; } - public static long extract(TypeSort sort, Object value) { + static public long extract(TypeSort sort, Object value) { long lvalue = 0; switch (sort) { case Int8: @@ -338,7 +344,7 @@ public static long extract(TypeSort sort, Object value) { return lvalue; } - public static Object convert(TypeSort dstsort, TypeSort srcsort, Object src) { + static public Object convert(TypeSort dstsort, TypeSort srcsort, Object src) { Object result = null; long lval; boolean ok = true; @@ -1121,7 +1127,7 @@ public static Object convert(TypeSort dstsort, TypeSort srcsort, Object src) { } - public static void vectorcopy(DapType datatype, Object src, Object dst, long srcoffset, long dstoffset) + static public void vectorcopy(DapType datatype, Object src, Object dst, long srcoffset, long dstoffset) throws DapException { switch (datatype.getTypeSort()) { case UInt8: @@ -1179,7 +1185,7 @@ public static void vectorcopy(DapType datatype, Object src, Object dst, long src * @param o * @return parsed attribute */ - public static Object attributeParse(DataType cdmtype, EnumTypedef en, Object o) { + static public Object attributeParse(DataType cdmtype, EnumTypedef en, Object o) { String so = o.toString(); if (en != null) { switch (cdmtype) { @@ -1287,7 +1293,7 @@ public static Object attributeParse(DataType cdmtype, EnumTypedef en, Object o) return o; } - public static boolean isPrimitiveVector(DataType type, Object o) { + static public boolean isPrimitiveVector(DataType type, Object o) { Class c = o.getClass(); if (!c.isArray()) return false; @@ -1326,7 +1332,7 @@ public static boolean isPrimitiveVector(DataType type, Object o) { return false; } - public static Array arrayify(DataType datatype, Object o) { + static public Array arrayify(DataType datatype, Object o) { // 1. o is a constant if (!o.getClass().isArray()) { Object ovec = createVector(datatype, 1); @@ -1337,13 +1343,13 @@ public static Array arrayify(DataType datatype, Object o) { return Array.factory(datatype, shape, o); } - public static Array arrayify(DapType type, Object o) { + static public Array arrayify(DapType type, Object o) { if (type.getAtomicType() == TypeSort.Enum) return arrayify(((DapEnumeration) type).getBaseType(), o); return arrayify(CDMTypeFcns.daptype2cdmtype(type), o); } - public static List listify(Object vector) { + static public List listify(Object vector) { List list = new ArrayList(); int icount = java.lang.reflect.Array.getLength(vector); for (int i = 0; i < icount; i++) { @@ -1352,24 +1358,87 @@ public static List listify(Object vector) { return list; } + static public Object bytesAsTypeVec(DapType daptype, byte[] bytes) { + TypeSort tsort = daptype.getTypeSort(); + int count = (bytes.length / daptype.getSize()); + switch (tsort) { + case Char: + return new char[count]; + case Int8: + case UInt8: + return new byte[count]; + case Int16: + case UInt16: + return new short[count]; + case Int32: + case UInt32: + return new int[count]; + case Int64: + case UInt64: + return new long[count]; + case Float32: + return new float[count]; + case Float64: + return new double[count]; + case Enum: + // Coverity[FB.BC_UNCONFIRMED_CAST] + return bytesAsTypeVec(((DapEnumeration) daptype).getBaseType(), bytes); + default: + break; + } + return null; + } + + static public void decodebytes(ByteOrder remoteorder, DapType daptype, byte[] bytes, Object vector) { + TypeSort tsort = daptype.getTypeSort(); + ByteBuffer bb = ByteBuffer.wrap(bytes).order(remoteorder); + switch (tsort) { + case Char: + String cb = new String(bytes, DapUtil.UTF8); + char[] cv = (char[]) vector; + for (int i = 0; i < cv.length; i++) + cv[i] = cb.charAt(i); + break; + case Int8: + case UInt8: + bb.get((byte[]) vector); + break; + case Int16: + case UInt16: + ShortBuffer sb = bb.asShortBuffer(); + short[] sv = (short[]) vector; + sb.get(sv); + break; + case Int32: + case UInt32: + IntBuffer ib = bb.asIntBuffer(); + int[] iv = (int[]) vector; + ib.get(iv); + break; + case Int64: + case UInt64: + LongBuffer lb = bb.asLongBuffer(); + long[] lv = (long[]) vector; + lb.get(lv); + break; + case Float32: + FloatBuffer fb = bb.asFloatBuffer(); + float[] fv = (float[]) vector; + fb.get(fv); + break; + case Float64: + DoubleBuffer db = bb.asDoubleBuffer(); + double[] dv = (double[]) vector; + db.get(dv); + break; + case Enum: + // Coverity[FB.BC_UNCONFIRMED_CAST] + decodebytes(remoteorder, ((DapEnumeration) daptype).getBaseType(), bytes, vector); + break; + default: + break; + } + + } - /* - * static public Array - * arraysection(Array a, List slices) - * { - * int rank = slices.size(); - * int[] origin = new int[rank]; - * int[] subshape = new int[rank]; - * for(int i = 0; i < rank; i++) { - * origin[i] = 0; - * subshape[i] = (int) index.get(i); - * } - * subshape[rank - 1] = 1; // remove vlen dimension - * Array records; - * try { - * records = seqarray.section(origin, subshape, null); - * } catch (InvalidRangeException e) { - * throw new DapException("Illegal index", e); - * } - */ } diff --git a/dap4/d4cdm/src/main/java/dap4/cdm/CDMUtil.java b/dap4/src/main/java/dap4/dap4lib/cdm/CDMUtil.java similarity index 75% rename from dap4/d4cdm/src/main/java/dap4/cdm/CDMUtil.java rename to dap4/src/main/java/dap4/dap4lib/cdm/CDMUtil.java index 9e3677ca64..0d997820aa 100644 --- a/dap4/d4cdm/src/main/java/dap4/cdm/CDMUtil.java +++ b/dap4/src/main/java/dap4/dap4lib/cdm/CDMUtil.java @@ -3,16 +3,17 @@ * See the LICENSE file for more information. */ -package dap4.cdm; +package dap4.dap4lib.cdm; -import dap4.core.data.DataCursor; +import dap4.core.interfaces.DataIndex; +import dap4.dap4lib.D4Cursor; import dap4.core.dmr.DapDimension; import dap4.core.dmr.DapType; import dap4.core.dmr.TypeSort; import dap4.core.util.DapException; -import dap4.core.util.Index; import dap4.core.util.Slice; import ucar.ma2.ForbiddenConversionException; +import ucar.ma2.Index; import ucar.ma2.InvalidRangeException; import ucar.ma2.Range; import ucar.nc2.CDMNode; @@ -32,6 +33,8 @@ public abstract class CDMUtil { static final String hexchars = "0123456789abcdef"; + static final public Index SCALAR = new Index(new int[0], new int[0]); + /** * Convert a list of ucar.ma2.Range to a list of Slice * More or less the inverst of create CDMRanges @@ -243,117 +246,6 @@ public static int[] computeEffectiveShape(List dimset) { return shape; } - /* - * static public int - * computeVariableSize(View view, DapVariable var, boolean scalar) - * { - * DapType dt = var.getBaseType(); - * ViewVariable annotation = view.getAnnotation(var); - * int dimproduct = (scalar ? 1 : computeDimProduct(annotation.getSlices())); - * int elementsize = 0; - * switch (dt.getTypeSort()) { - * default: // atomic variable - * // This does not work for String or Opaque. - * elementsize = CDMUtil.daptypeSize(dt.getTypeSort()); - * break; - * case STRUCTURE: - * case SEQUENCE: - * for(DapVariable field : ((DapStructure) dt).getFields()) { - * elementsize += computeVariableSize(dataset, field, false); - * } - * break; - * - * default: - * break; - * } - * return dimproduct * elementsize; - * } - */ - - /** - * Extract, as an object, value from a (presumably) - * atomic typed array of values; dataset position - * is presumed correct. - * - * @param atomtype type of object to extract ; must not be Enum - * @param dataset Data containing the objects - * @param index Which element of dataset to read - * @return resulting value as an Object; value does not necessarily conform - * to Convert.ValueClass. - */ - - /** - * Extract, as a long, value from a (presumably) - * atomic typed array of values; dataset position - * is presumed correct. - * - * @param atomtype type of object to extract - * @param dataset Data containing the objects - * @param index Which element of dataset to read - * @return resulting value as a long - * @throws ForbiddenConversionException if cannot convert to long - */ - - public static long extractLongValue(TypeSort atomtype, DataCursor dataset, Index index) throws DapException { - Object result; - result = dataset.read(index); - long lvalue = CDMTypeFcns.extract(atomtype, result); - return lvalue; - } - - /** - * Extract, as a double, value from a (presumably) - * atomic typed array of values; dataset position - * is presumed correct. - * - * @param atomtype type of object to extract - * @param dataset Data containing the objects - * @param index Which element of dataset to read - * @return resulting value as a double - * @throws ForbiddenConversionException if cannot convert to double - */ - - public static double extractDoubleValue(TypeSort atomtype, DataCursor dataset, Index index) throws DapException { - Object result; - result = dataset.read(index); - double dvalue = 0.0; - if (atomtype.isIntegerType() || atomtype.isEnumType()) { - long lvalue = extractLongValue(atomtype, dataset, index); - dvalue = (double) lvalue; - } else if (atomtype == TypeSort.Float32) { - dvalue = (double) ((Float) result).floatValue(); - } else if (atomtype == TypeSort.Float64) { - dvalue = ((Double) result).doubleValue(); - } else - throw new ForbiddenConversionException(); - return dvalue; - } - - /** - * Extract, as an object, n consecutive values - * of an atomic typed array of values - * - * @param dataset Data containing the objects - * @param index Starting element to read - * @param count Number of elements to read - * @return resulting array of values as an object - */ - - /* - * static public Object - * extractVector(DataAtomic dataset, long index, long count, long offset) - * throws DapException - * { - * Object vector = createVector(dataset.getType().getPrimitiveType(),count); - * try { - * dataset.read(index, count, vector, offset); - * } catch (IOException ioe) { - * throw new DapException(ioe); - * } - * return vector; - * } - */ - /** * Convert an array of one type of values to another type * @@ -521,27 +413,56 @@ public static List shapeToSlices(int[] shape) throws dap4.core.util.DapEx return slices; } - public static dap4.core.util.Index cdmIndexToIndex(ucar.ma2.Index cdmidx) { - int rank = cdmidx.getRank(); - int[] shape = cdmidx.getShape(); - long[] indices = new long[shape.length]; - for (int i = 0; i < rank; i++) { - indices[i] = shape[i]; - } - dap4.core.util.Index dapidx = new dap4.core.util.Index(indices, indices); + public static Index cdmIndexToIndex(ucar.ma2.Index cdmidx) { + Index dapidx = new Index(cdmidx.getCurrentCounter(), cdmidx.getShape()); return dapidx; } - public static ucar.ma2.Index indexToCcMIndex(dap4.core.util.Index d4) { - int rank = d4.getRank(); - int[] shape = new int[rank]; - int[] indices = new int[rank]; + public static ucar.ma2.Index indexToCcMIndex(Index d4) { + return (Index) d4; + } + + /** + * Convert DataIndex to list of slices + * + * @param indices to convert + * @return list of corresponding slices + */ + + static public List indexToSlices(Index indices) throws DapException { + // short circuit the scalar case + int rank = indices.getRank(); + if (rank == 0) + return Slice.SCALARSLICES; + // offset = d3*(d2*(d1*(x1))+x2)+x3 + List slices = new ArrayList<>(rank); for (int i = 0; i < rank; i++) { - indices[i] = (int) d4.get(i); - shape[i] = (int) d4.getSize(i); + int isize = indices.getCurrentCounter()[i]; + slices.add(new Slice(isize, isize + 1, 1, indices.getShape(i))); } - ucar.ma2.Index cdm = ucar.ma2.Index.factory(shape); - cdm.set(indices); - return cdm; + return slices; } + + /** + * If a set of slices refers to a single position, + * then return the corresponding Index. Otherwise, + * throw Exception. + * + * @param slices + * @return Index corresponding to slices + * @throws DapException + */ + static public Index slicesToIndex(List slices) throws DapException { + int[] positions = new int[slices.size()]; + int[] dimsizes = new int[slices.size()]; + for (int i = 0; i < positions.length; i++) { + Slice s = slices.get(i); + if (s.getCount() != 1) + throw new DapException("Attempt to convert non-singleton sliceset to index"); + positions[i] = s.getFirst(); + dimsizes[i] = s.getMax(); + } + return new Index(positions, dimsizes); + } + } diff --git a/dap4/d4cdm/src/main/java/dap4/cdm/NodeMap.java b/dap4/src/main/java/dap4/dap4lib/cdm/NodeMap.java similarity index 98% rename from dap4/d4cdm/src/main/java/dap4/cdm/NodeMap.java rename to dap4/src/main/java/dap4/dap4lib/cdm/NodeMap.java index a3c242cb5f..64a4aeed4a 100644 --- a/dap4/d4cdm/src/main/java/dap4/cdm/NodeMap.java +++ b/dap4/src/main/java/dap4/dap4lib/cdm/NodeMap.java @@ -3,7 +3,7 @@ * See the LICENSE file for more information. */ -package dap4.cdm; +package dap4.dap4lib.cdm; import dap4.core.dmr.DapNode; import ucar.nc2.CDMNode; diff --git a/dap4/d4cdm/src/main/java/dap4/cdm/nc2/CDMCompiler.java b/dap4/src/main/java/dap4/dap4lib/cdm/nc2/CDMCompiler.java similarity index 70% rename from dap4/d4cdm/src/main/java/dap4/cdm/nc2/CDMCompiler.java rename to dap4/src/main/java/dap4/dap4lib/cdm/nc2/CDMCompiler.java index e184710c24..04b6ecdbca 100644 --- a/dap4/d4cdm/src/main/java/dap4/cdm/nc2/CDMCompiler.java +++ b/dap4/src/main/java/dap4/dap4lib/cdm/nc2/CDMCompiler.java @@ -4,10 +4,13 @@ */ -package dap4.cdm.nc2; +package dap4.dap4lib.cdm.nc2; -import dap4.cdm.NodeMap; -import dap4.core.data.DSP; +import dap4.core.dmr.DapVariable; +import dap4.core.util.DapContext; +import dap4.dap4lib.D4Cursor; +import dap4.dap4lib.D4DSP; +import dap4.dap4lib.cdm.NodeMap; import dap4.core.dmr.DapDataset; import dap4.core.dmr.DapNode; import dap4.core.util.DapException; @@ -32,19 +35,21 @@ */ public class CDMCompiler { - public static boolean DEBUG = false; - ////////////////////////////////////////////////// - // Constants + public static boolean DEBUG = false; - ////////////////////////////////////////////////// - // Instance variables + /* + * //////////////////////////////////////////////// + * Constants + * + * //////////////////////////////////////////////// + * Instance variables + */ protected DapNetcdfFile ncfile = null; - protected DSP dsp = null; + protected D4DSP dsp = null; protected DapDataset dmr = null; - protected Group cdmroot = null; - protected NodeMap nodemap = null; + protected NodeMap nodemap = null; // Bi-directional protected Map arraymap = null; ////////////////////////////////////////////////// @@ -54,13 +59,13 @@ public class CDMCompiler { * Constructor * * @param ncfile the target NetcdfDataset (as yet empty) - * @param dsp the DSP to be wrapped + * @param dsp */ - public CDMCompiler(DapNetcdfFile ncfile, DSP dsp) throws DapException { + public CDMCompiler(DapNetcdfFile ncfile, D4DSP dsp) throws DapException { this.ncfile = ncfile; this.dsp = dsp; - this.dmr = dsp.getDMR(); + this.dmr = this.dsp.getDMR(); } ////////////////////////////////////////////////// @@ -78,15 +83,6 @@ public NetcdfFile getNetcdfFile() { return this.ncfile; } - ////////////////////////////////////////////////// - // Compile DMR and Data into a NetcdfDataset - - /* Package access */ - void compile() throws DapException { - compileDMR(); - compileData(); - } - ////////////////////////////////////////////////// // Compile DMR->set of CDM nodes @@ -97,7 +93,7 @@ void compile() throws DapException { * @throws DapException */ - protected void compileDMR() throws DapException { + public void compileDMR() throws DapException { // Convert the DMR to CDM metadata // and return a mapping from DapNode -> CDMNode this.nodemap = new DMRToCDM(this.ncfile, this.dsp).create(); @@ -113,10 +109,10 @@ protected void compileDMR() throws DapException { * @throws DapException */ - protected void compileData() throws DapException { - // Convert the DMR to CDM metadata + public void compileData() throws DapException { + // Convert the Data to CDM arrays // and return a mapping from Variable -> Array - this.arraymap = new DataToCDM(this.ncfile, this.dsp, this.nodemap).create(); + this.arraymap = DataToCDM.createDataMap(this.dsp, this.nodemap); } } diff --git a/dap4/src/main/java/dap4/dap4lib/cdm/nc2/D4StructureDataIterator.java b/dap4/src/main/java/dap4/dap4lib/cdm/nc2/D4StructureDataIterator.java new file mode 100644 index 0000000000..eceb0e796a --- /dev/null +++ b/dap4/src/main/java/dap4/dap4lib/cdm/nc2/D4StructureDataIterator.java @@ -0,0 +1,53 @@ +/* + * Copyright 2012, UCAR/Unidata. + * See the LICENSE file for more information. + */ + +package dap4.dap4lib.cdm.nc2; + +import ucar.ma2.StructureData; +import ucar.ma2.StructureDataIterator; + +import java.io.IOException; + +public class D4StructureDataIterator implements StructureDataIterator { + + protected StructureData[] list; + protected int position; + + public D4StructureDataIterator() { + this.list = null; + this.position = 0; + } + + ////////////////////////////////////////////////// + // Accessors + + public D4StructureDataIterator setList(StructureData[] list) { + this.list = list; + return this; + } + + ////////////////////////////////////////////////// + // StructureDataIterator Interface Implementation + + public boolean hasNext() throws IOException { + return position < list.length; + } + + public StructureData next() throws IOException { + if (position >= list.length) + throw new IOException("No next element"); + return list[position++]; + } + + public StructureDataIterator reset() { + position = 0; + return this; + } + + public int getCurrentRecno() { + return position; + } + +} diff --git a/dap4/d4cdm/src/main/java/dap4/cdm/nc2/DMRToCDM.java b/dap4/src/main/java/dap4/dap4lib/cdm/nc2/DMRToCDM.java similarity index 97% rename from dap4/d4cdm/src/main/java/dap4/cdm/nc2/DMRToCDM.java rename to dap4/src/main/java/dap4/dap4lib/cdm/nc2/DMRToCDM.java index 148ddd6297..16abf38398 100644 --- a/dap4/d4cdm/src/main/java/dap4/cdm/nc2/DMRToCDM.java +++ b/dap4/src/main/java/dap4/dap4lib/cdm/nc2/DMRToCDM.java @@ -3,11 +3,12 @@ * See the LICENSE file for more information. */ -package dap4.cdm.nc2; +package dap4.dap4lib.cdm.nc2; -import dap4.cdm.CDMTypeFcns; -import dap4.cdm.NodeMap; -import dap4.core.data.DSP; +import dap4.core.util.DapContext; +import dap4.dap4lib.D4DSP; +import dap4.dap4lib.cdm.CDMTypeFcns; +import dap4.dap4lib.cdm.NodeMap; import dap4.core.dmr.*; import dap4.core.util.Convert; import dap4.core.util.DapException; @@ -28,7 +29,7 @@ public class DMRToCDM { // Instance Variables protected DapNetcdfFile ncfile; - protected DSP dsp; + protected D4DSP dsp; protected DapDataset dmr; protected NodeMap nodemap; @@ -41,10 +42,10 @@ public class DMRToCDM { * @param dsp - the DSP being wrapped */ - public DMRToCDM(DapNetcdfFile ncfile, DSP dsp) throws DapException { + public DMRToCDM(DapNetcdfFile ncfile, D4DSP dsp) throws DapException { this.ncfile = ncfile; this.dsp = dsp; - this.dmr = dsp.getDMR(); + this.dmr = this.dsp.getDMR(); this.nodemap = new NodeMap<>(); } diff --git a/dap4/d4cdm/src/main/java/dap4/cdm/nc2/DapNetcdfFile.java b/dap4/src/main/java/dap4/dap4lib/cdm/nc2/DapNetcdfFile.java similarity index 54% rename from dap4/d4cdm/src/main/java/dap4/cdm/nc2/DapNetcdfFile.java rename to dap4/src/main/java/dap4/dap4lib/cdm/nc2/DapNetcdfFile.java index d6dca6ee9c..0ff7208086 100644 --- a/dap4/d4cdm/src/main/java/dap4/cdm/nc2/DapNetcdfFile.java +++ b/dap4/src/main/java/dap4/dap4lib/cdm/nc2/DapNetcdfFile.java @@ -3,17 +3,15 @@ * See the LICENSE file for more information. */ -package dap4.cdm.nc2; - -import dap4.cdm.CDMUtil; -import dap4.core.data.DSP; -import dap4.core.data.DSPRegistry; -import dap4.core.util.DapContext; -import dap4.core.util.DapUtil; -import dap4.dap4lib.FileDSP; -import dap4.dap4lib.HttpDSP; -import dap4.dap4lib.XURI; +package dap4.dap4lib.cdm.nc2; + +import dap4.core.dmr.*; +import dap4.core.util.*; +import dap4.dap4lib.*; +import dap4.dap4lib.cdm.CDMUtil; +import dap4.dap4lib.cdm.NodeMap; import ucar.ma2.*; +import ucar.nc2.CDMNode; import ucar.nc2.NetcdfFile; import ucar.nc2.ParsedSectionSpec; import ucar.nc2.Variable; @@ -25,7 +23,17 @@ import java.nio.channels.WritableByteChannel; import java.util.*; + +/** + * This class is the work-horse of the client side. + * It uses a D4DSP instance to obtain access to a DMR and + * (optionally) a compiled DAP4 data stream. + * + * Given that, it constructs a translation to CDM. + */ + public class DapNetcdfFile extends NetcdfFile { + static final boolean DEBUG = false; static final boolean PARSEDEBUG = false; static final boolean MERGE = false; @@ -35,8 +43,6 @@ public class DapNetcdfFile extends NetcdfFile { ////////////////////////////////////////////////// // Constants - static final String QUERYSTART = "?"; - static final String FRAGSTART = "#"; ////////////////////////////////////////////////// // Type Declarations @@ -55,7 +61,6 @@ public void setDone(boolean done) {} public void setError(String msg) {} public void setProgress(String msg, int progress) {} - } ////////////////////////////////////////////////// @@ -69,7 +74,7 @@ public void setProgress(String msg, int progress) {} protected static DSPRegistry dspregistry = new DSPRegistry(); static { - dspregistry.register(FileDSP.class, DSPRegistry.FIRST); + dspregistry.register(RawDSP.class, DSPRegistry.FIRST); dspregistry.register(HttpDSP.class, DSPRegistry.FIRST); } @@ -78,33 +83,38 @@ public void setProgress(String msg, int progress) {} protected boolean allowCompression = true; protected boolean closed = false; - protected String location = null; // original argument passed to open + protected CancelTask cancel = null; + protected String dsplocation = null; // what is passed to DSP protected XURI xuri = null; - protected DSP dsp = null; - protected CancelTask cancel = null; + protected DapContext cxt = null; + protected D4DSP dsp = null; + // Extractions from dsp + protected DapDataset dmr = null; - // protected NodeMap nodemap = null; unused? + protected CDMCompiler cdmCompiler = null; - /** - * Originally, the array for a variable was stored - * using var.setCacheData(). However, that is illegal - * for Structures and Sequences, so (for now) - * we maintain a map variable->array. - */ - protected Map arraymap = new HashMap<>(); + protected ChecksumMode checksummode = null; - ////////////////////////////////////////////////// + protected boolean daploaded = false; // avoid multiple loads + + // Variable map + protected Map arraymap = null; + + ///////////////////////////////////////////////// // Constructor(s) /** * Open a Dap4 connection or file via a D4DSP. + * Warning: we do not use a Builder because this object is mutable over time. * * @param location URL for the request. Note that if this is * intended to send to a file oriented * DSP, then if must be converted to an absolute path. + * Note also that the URL path should not have any .dap or .dmr + * extension since using those is the purview of this class. * @param cancelTask check if task is cancelled; may be null. * @throws IOException */ @@ -118,29 +128,33 @@ public DapNetcdfFile(String location, CancelTask cancelTask) throws IOException } catch (URISyntaxException use) { throw new IOException(use); } - boolean isfile = xuri.isFile(); - if (isfile) { - this.dsplocation = DapUtil.absolutize(xuri.getPath()); - } else { // Not a file url - this.dsplocation = xuri.assemble(XURI.URLBASE); - } - DapContext cxt = new DapContext(); + this.dsplocation = xuri.assemble(XURI.URLQUERY); cancel = (cancelTask == null ? nullcancel : cancelTask); - // 1. Get and parse the constrained DMR and Data v-a-v URL - this.dsp = dspregistry.findMatchingDSP(location, cxt); // will set dsp context + + // The DapContext object is the primary means of passing information + // between various parts of the DAP4 system. + this.cxt = new DapContext(); + // Insert fragment as (key,value) pairs into the context + cxt.insert(xuri.getFragFields(), true); + // Query takes precedence over fragment + cxt.insert(xuri.getQueryFields(), true); + String csummode = (String) cxt.get(DapConstants.CHECKSUMTAG); + this.checksummode = ChecksumMode.modeFor(csummode); + this.checksummode = ChecksumMode.asTrueFalse(this.checksummode); // Fix the checksum mode to be only TRUE or FALSE + this.cxt.put(ChecksumMode.class, this.checksummode); + + // Find the D4DSP class that can process this URL location. + this.dsp = dspregistry.findMatchingDSP(this.location, cxt); // find relevant D4DSP subclass if (this.dsp == null) throw new IOException("No matching DSP: " + this.location); - this.dsp.setContext(cxt); - this.dsp.open(this.dsplocation); - - // 2. Construct an equivalent CDM tree and populate - // this NetcdfFile object. - CDMCompiler compiler = new CDMCompiler(this, this.dsp); - compiler.compile(); + this.dsp.open(this.dsplocation, this.checksummode); // side effect: get DMR + ensuredmr(); + this.dmr = this.dsp.getDMR(); // get DMR + this.cxt.put(DapDataset.class, this.dmr); // set the pseudo-location, otherwise we get a name that is full path. - setLocation(this.dsp.getDMR().getDataset().getShortName()); + setLocation(this.dmr.getDataset().getShortName()); finish(); - this.arraymap = compiler.getArrayMap(); + this.dsp.loadContext(this.cxt, RequestMode.DMR); } /** @@ -168,7 +182,6 @@ public synchronized void close() throws java.io.IOException { return; closed = true; // avoid circular calls dsp = null; - // nodemap = null; unused? } ////////////////////////////////////////////////// @@ -185,7 +198,7 @@ public String getLocation() { return location; } - public DSP getDSP() { + public D4DSP getDSP() { return this.dsp; } @@ -241,7 +254,7 @@ public Array readSection(String variableSection) throws IOException, InvalidRang } /** - * Primary read entry point. + * b * Primary read entry point. * This is the primary implementor of Variable.read. * * @param cdmvar A top-level variable @@ -259,7 +272,9 @@ protected Array readData(Variable cdmvar, Section section) throws IOException, I // takes into account any constraint used in forming the dataDMR. // We use the Section to produce a view of the underlying variable array. - assert this.dsp != null; + // Read and compile the DAP4 data + // Ensure that the DSP has data + ensuredata(); Array result = arraymap.get(cdmvar); if (result == null) throw new IOException("No data for variable: " + cdmvar.getFullName()); @@ -276,4 +291,82 @@ protected Array readData(Variable cdmvar, Section section) throws IOException, I } return result; } + + protected void loadContext() { + this.cxt.put(DapConstants.ChecksumSource.REMOTE, this.dsp.getChecksumMap(DapConstants.ChecksumSource.REMOTE)); + this.cxt.put(DapConstants.ChecksumSource.LOCAL, this.dsp.getChecksumMap(DapConstants.ChecksumSource.LOCAL)); + this.cxt.put(D4Cursor.class, this.dsp.getVariableDataMap()); + } + + protected void verifyChecksums() throws DapException { + ChecksumMode cmode = (ChecksumMode) this.cxt.get(ChecksumMode.class); + Map remotechecksummap = (Map) cxt.get(DapConstants.ChecksumSource.REMOTE); + Map localchecksummap = (Map) cxt.get(DapConstants.ChecksumSource.LOCAL); + + if (cmode != ChecksumMode.TRUE) + return; + for (DapVariable dvar : dmr.getTopVariables()) { + // Verify the calculated checksums + Long remotechecksum = remotechecksummap.get(dvar); + Long localchecksum = localchecksummap.get(dvar); + assert ((localchecksum != null) && (remotechecksum != null)); + if (!cxt.containsKey("hyrax")) {// Suppress the check for Hyrax, for now + if (localchecksum.longValue() != remotechecksum.longValue()) + throw new DapException("Checksum mismatch: local=" + localchecksum + " remote=" + remotechecksum); + } + // Verify the checksum Attribute, if any + DapAttribute csumattr = dvar.getChecksumAttribute(); + if (csumattr != null) { + assert (csumattr.getValues().length == 1 && csumattr.getBaseType() == DapType.INT32); + Long attrcsum = (long) 0; + try { + attrcsum = Long.parseLong(csumattr.getValues()[0]); + } catch (NumberFormatException nfe) { + throw new DapException("Illegal Checksum attribute value", nfe); + } + if (!cxt.containsKey("hyrax")) { // Suppress the check for Hyrax, for now + if (localchecksum.longValue() != attrcsum.longValue()) + throw new DapException("Checksum mismatch: local=" + localchecksum + " attribute=" + attrcsum); + } + } + } + } + + /** + * Do what is necessary to ensure that DMR and DAP compilation will work + */ + public void ensuredmr() throws IOException { + if (this.dmr == null) { // do not call twice + this.dsp.loadDMR(); + this.dmr = this.dsp.getDMR(); + if (this.cdmCompiler == null) + this.cdmCompiler = new CDMCompiler(this, this.dsp); + this.cdmCompiler.compileDMR(); + } + } + + public void ensuredata() throws IOException { + if (!this.daploaded) { // do not call twice + this.daploaded = true; + this.dsp.loadDAP(); + loadContext(); + verifyChecksums(); + this.dsp.loadContext(this.cxt, RequestMode.DAP); + if (this.cdmCompiler == null) + this.cdmCompiler = new CDMCompiler(this, this.dsp); + this.cdmCompiler.compileData(); + // Prepare the array map + assert this.arraymap == null; + this.arraymap = new HashMap(); + Map datamap = this.dsp.getVariableDataMap(); + NodeMap nodemap = this.cdmCompiler.getNodeMap(); + for (Map.Entry entry : datamap.entrySet()) { + DapVariable dv = entry.getKey(); + D4Cursor dc = entry.getValue(); + Variable v = (Variable) nodemap.get(entry.getKey()); + assert (dc.getArray() != null); + arraymap.put(v, dc.getArray()); + } + } + } } diff --git a/dap4/d4cdm/src/main/java/dap4/cdm/nc2/DapNetcdfFileProvider.java b/dap4/src/main/java/dap4/dap4lib/cdm/nc2/DapNetcdfFileProvider.java similarity index 96% rename from dap4/d4cdm/src/main/java/dap4/cdm/nc2/DapNetcdfFileProvider.java rename to dap4/src/main/java/dap4/dap4lib/cdm/nc2/DapNetcdfFileProvider.java index 6aee9b8bf5..b1d304511f 100644 --- a/dap4/d4cdm/src/main/java/dap4/cdm/nc2/DapNetcdfFileProvider.java +++ b/dap4/src/main/java/dap4/dap4lib/cdm/nc2/DapNetcdfFileProvider.java @@ -1,4 +1,4 @@ -package dap4.cdm.nc2; +package dap4.dap4lib.cdm.nc2; import java.io.IOException; import org.slf4j.Logger; diff --git a/dap4/src/main/java/dap4/dap4lib/cdm/nc2/DataToCDM.java b/dap4/src/main/java/dap4/dap4lib/cdm/nc2/DataToCDM.java new file mode 100644 index 0000000000..781dc18bd0 --- /dev/null +++ b/dap4/src/main/java/dap4/dap4lib/cdm/nc2/DataToCDM.java @@ -0,0 +1,81 @@ +/* + * Copyright 2012, UCAR/Unidata. + * See the LICENSE file for more information. + */ + + +package dap4.dap4lib.cdm.nc2; + +import dap4.core.interfaces.DataIndex; +import dap4.dap4lib.D4Cursor; +import dap4.dap4lib.D4DSP; +import dap4.dap4lib.cdm.NodeMap; +import dap4.core.dmr.*; +import dap4.core.util.*; +import ucar.ma2.Array; +import ucar.nc2.Group; +import ucar.nc2.Variable; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static dap4.core.dmr.DapType.*; +import static dap4.core.util.DapConstants.*; + +/** + * Associate the Array objects created in D4DataCompiler + * with the corresponding CDM Variable. + * Class is not intended to be instantiated + * Note: this class is rather short, so could be eliminated. + */ + +abstract public class DataToCDM { + + public static boolean DEBUG = false; + + ////////////////////////////////////////////////// + // Constants + + protected static final int COUNTSIZE = 8; // databuffer as specified by the DAP4 spec + + protected static final String LBRACE = "{"; + protected static final String RBRACE = "}"; + + ////////////////////////////////////////////////// + // Instance variables + + protected DapNetcdfFile ncfile = null; + protected D4DSP dsp = null; + // Extractions from dsp + protected DapDataset dmr = null; + protected ChecksumMode checksummode = null; + protected Map localchecksummap = null; + + protected Group cdmroot = null; + protected Map datamap = null; + protected NodeMap nodemap = null; + + ////////////////////////////////////////////////// + // Constructor(s) + + ////////////////////////////////////////////////// + // Correlate CDM Variables with ucar.ma2.Array objects + + static public Map createDataMap(D4DSP dsp, NodeMap nodemap) throws DapException { + Map datamap = dsp.getVariableDataMap(); + DapDataset dmr = dsp.getDMR(); + Map arraymap = new HashMap<>(); + // iterate over the variables represented in the nodemap + List topvars = dmr.getTopVariables(); + Map map = null; + for (DapVariable var : topvars) { + D4Cursor cursor = datamap.get(var); + Variable v = (Variable) nodemap.get(var); + assert cursor != null && v != null; + Array array = cursor.getArray(); + assert array != null; + arraymap.put(v, array); + } + return arraymap; + } +} diff --git a/dap4/src/main/resources/META-INF/services/ucar.nc2.dataset.spi.NetcdfFileProvider b/dap4/src/main/resources/META-INF/services/ucar.nc2.dataset.spi.NetcdfFileProvider new file mode 100644 index 0000000000..d5a8e8dc1c --- /dev/null +++ b/dap4/src/main/resources/META-INF/services/ucar.nc2.dataset.spi.NetcdfFileProvider @@ -0,0 +1 @@ +dap4.dap4lib.cdm.nc2.DapNetcdfFileProvider diff --git a/dap4/src/test/data/resources/baselineconstraints/test_atomic_array.1.nc.ncdump b/dap4/src/test/data/resources/baselineconstraints/test_atomic_array.1.nc.ncdump new file mode 100644 index 0000000000..b1b145dcd5 --- /dev/null +++ b/dap4/src/test/data/resources/baselineconstraints/test_atomic_array.1.nc.ncdump @@ -0,0 +1,58 @@ +netcdf test_atomic_array.1 { + types: + byte enum cloud_class_t { Clear = 0, Cumulonimbus = 1, Stratus = 2, Stratocumulus = 3, Cumulus = 4, Altostratus = 5, Nimbostratus = 6, Altocumulus = 7, Cirrostratus = 8, Cirrocumulus = 9, Cirrus = 10, Missing = 127}; + + dimensions: + d1 = 1; + d2 = 2; + d3 = 3; + d4 = 4; + d5 = 5; + variables: + ubyte vu8(d2, d3); + + short v16(d4); + + uint vu32(d2, d3); + + double vd(d2); + + char vc(d2); + + string vs(d2, d2); + + opaque vo(d1, d2); + + enum cloud_class_t primary_cloud(d5); + string primary_cloud:_FillValue = "Missing"; + + // global attributes: + :_DAP4_Little_Endian = 1B; + string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; + + data: + vu8 = + { + {255, 1, 2}, + {3, 4, 5} + } + v16 = + {1, 2, 3, 4} + vu32 = + { + {5, 4, 3}, + {2, 1, 0} + } + vd = + {17.9, 1024.8} + vc = "@&" + vs = + { "hello world", " +", "Καλημέα", "abc" + } + vo = 0x0123456789abcdef, + 0xabcdef0000000000; + + primary_cloud = + {0, 2, 0, 1, 127} +} diff --git a/dap4/src/test/data/resources/baselineconstraints/test_atomic_array.2.nc.ncdump b/dap4/src/test/data/resources/baselineconstraints/test_atomic_array.2.nc.ncdump new file mode 100644 index 0000000000..0eec0bc2e2 --- /dev/null +++ b/dap4/src/test/data/resources/baselineconstraints/test_atomic_array.2.nc.ncdump @@ -0,0 +1,58 @@ +netcdf test_atomic_array.2 { + types: + byte enum cloud_class_t { Clear = 0, Cumulonimbus = 1, Stratus = 2, Stratocumulus = 3, Cumulus = 4, Altostratus = 5, Nimbostratus = 6, Altocumulus = 7, Cirrostratus = 8, Cirrocumulus = 9, Cirrus = 10, Missing = 127}; + + dimensions: + d1 = 1; + d2 = 2; + d3 = 3; + d4 = 4; + d5 = 5; + variables: + ubyte vu8(d2, d3); + + short v16(d4); + + uint vu32(d2, d3); + + double vd(d2); + + char vc(d2); + + string vs(d2, d2); + + opaque vo(d1, d2); + + enum cloud_class_t primary_cloud(d5); + string primary_cloud:_FillValue = "Missing"; + + // global attributes: + :_DAP4_Little_Endian = 1B; + string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; + + data: + vu8 = + { + {255, 1, 2}, + {3, 4, 5} + } + v16 = + {1, 2, 3, 4} + vu32 = + { + {5, 4, 3}, + {2, 1, 0} + } + vd = + {17.9, 1024.8} + vc = "@&" + vs = + { "hello world", " +", "Καλημέα", "abc" + } + vo = 0x0123456789abcdef, + 0xabcdef0000000000; + + primary_cloud = + {0, 2, 0, 1, 127} +} diff --git a/dap4/src/test/data/resources/baselineconstraints/test_atomic_array.3.nc.ncdump b/dap4/src/test/data/resources/baselineconstraints/test_atomic_array.3.nc.ncdump new file mode 100644 index 0000000000..6713fac454 --- /dev/null +++ b/dap4/src/test/data/resources/baselineconstraints/test_atomic_array.3.nc.ncdump @@ -0,0 +1,58 @@ +netcdf test_atomic_array.3 { + types: + byte enum cloud_class_t { Clear = 0, Cumulonimbus = 1, Stratus = 2, Stratocumulus = 3, Cumulus = 4, Altostratus = 5, Nimbostratus = 6, Altocumulus = 7, Cirrostratus = 8, Cirrocumulus = 9, Cirrus = 10, Missing = 127}; + + dimensions: + d1 = 1; + d2 = 2; + d3 = 3; + d4 = 4; + d5 = 5; + variables: + ubyte vu8(d2, d3); + + short v16(d4); + + uint vu32(d2, d3); + + double vd(d2); + + char vc(d2); + + string vs(d2, d2); + + opaque vo(d1, d2); + + enum cloud_class_t primary_cloud(d5); + string primary_cloud:_FillValue = "Missing"; + + // global attributes: + :_DAP4_Little_Endian = 1B; + string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; + + data: + vu8 = + { + {255, 1, 2}, + {3, 4, 5} + } + v16 = + {1, 2, 3, 4} + vu32 = + { + {5, 4, 3}, + {2, 1, 0} + } + vd = + {17.9, 1024.8} + vc = "@&" + vs = + { "hello world", " +", "Καλημέα", "abc" + } + vo = 0x0123456789abcdef, + 0xabcdef0000000000; + + primary_cloud = + {0, 2, 0, 1, 127} +} diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_enum_array.nc.raw.txt b/dap4/src/test/data/resources/baselineconstraints/test_enum_array.6.nc.ncdump similarity index 77% rename from dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_enum_array.nc.raw.txt rename to dap4/src/test/data/resources/baselineconstraints/test_enum_array.6.nc.ncdump index 0a2c146f56..57f2a0ce47 100644 --- a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_enum_array.nc.raw.txt +++ b/dap4/src/test/data/resources/baselineconstraints/test_enum_array.6.nc.ncdump @@ -1,4 +1,4 @@ -netcdf test_enum_array { +netcdf test_enum_array.6 { types: byte enum cloud_class_t { Clear = 0, Cumulonimbus = 1, Stratus = 2, Stratocumulus = 3, Cumulus = 4, Altostratus = 5, Nimbostratus = 6, Altocumulus = 7, Cirrostratus = 8, Cirrocumulus = 9, Cirrus = 10, Missing = 127}; @@ -7,11 +7,12 @@ netcdf test_enum_array { variables: enum cloud_class_t primary_cloud(d5); string primary_cloud:_FillValue = "Missing"; - string primary_cloud:_DAP4_Checksum_CRC32 = "0xb58a627a"; // global attributes: + :_DAP4_Little_Endian = 1B; string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -primary_cloud = - {0, 2, 0, 1, 127} + + data: + primary_cloud = + {0, 2, 0, 1, 127} } diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_one_vararray.nc.raw.txt b/dap4/src/test/data/resources/baselineconstraints/test_one_vararray.4.nc.ncdump similarity index 60% rename from dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_one_vararray.nc.raw.txt rename to dap4/src/test/data/resources/baselineconstraints/test_one_vararray.4.nc.ncdump index f76c579e38..f4bfee691f 100644 --- a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_one_vararray.nc.raw.txt +++ b/dap4/src/test/data/resources/baselineconstraints/test_one_vararray.4.nc.ncdump @@ -1,13 +1,14 @@ -netcdf test_one_vararray { +netcdf test_one_vararray.4 { dimensions: d2 = 2; variables: int t(d2); - string t:_DAP4_Checksum_CRC32 = "0x42dfb1d0"; // global attributes: + :_DAP4_Little_Endian = 1B; string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -t = - {17, 37} + + data: + t = + {17, 37} } diff --git a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_vlen5.nc.nc4.dmr b/dap4/src/test/data/resources/baselineconstraints/test_one_vararray.5.nc.ncdump similarity index 56% rename from dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_vlen5.nc.nc4.dmr rename to dap4/src/test/data/resources/baselineconstraints/test_one_vararray.5.nc.ncdump index 5785af6152..31eab0d90e 100644 --- a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_vlen5.nc.nc4.dmr +++ b/dap4/src/test/data/resources/baselineconstraints/test_one_vararray.5.nc.ncdump @@ -1,13 +1,14 @@ -netcdf test_vlen5 { +netcdf test_one_vararray.5 { dimensions: d2 = 2; variables: - - Structure { - int v(*); - } v1(d2); - + int t(d2); // global attributes: + :_DAP4_Little_Endian = 1B; string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; + + data: + t = + {17, 37} } diff --git a/dap4/src/test/data/resources/baselineconstraints/test_opaque_array.7.nc.ncdump b/dap4/src/test/data/resources/baselineconstraints/test_opaque_array.7.nc.ncdump new file mode 100644 index 0000000000..bcc6c0a624 --- /dev/null +++ b/dap4/src/test/data/resources/baselineconstraints/test_opaque_array.7.nc.ncdump @@ -0,0 +1,17 @@ +netcdf test_opaque_array.7 { + dimensions: + d2 = 2; + variables: + opaque vo2(d2, d2); + + // global attributes: + :_DAP4_Little_Endian = 1B; + string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; + + data: + vo2 = 0x0123456789abcdef, + 0xabcdef0000000000, + 0xfedcba9876543210, + 0xfedcba9999999999; + +} diff --git a/dap4/src/test/data/resources/baselineconstraints/test_struct_array.8.nc.ncdump b/dap4/src/test/data/resources/baselineconstraints/test_struct_array.8.nc.ncdump new file mode 100644 index 0000000000..6177ea4ee3 --- /dev/null +++ b/dap4/src/test/data/resources/baselineconstraints/test_struct_array.8.nc.ncdump @@ -0,0 +1,57 @@ +netcdf test_struct_array.8 { + dimensions: + dx = 4; + dy = 3; + variables: + + Structure { + int x; + string x:_CoordinateAxisType = "GeoX"; + int y; + string y:_CoordinateAxisType = "GeoY"; + } s(dx, dy); + + + // global attributes: + :_DAP4_Little_Endian = 1B; + string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; + + data: + s = + { x = 1 + y = -1 + } s(0) + { x = 17 + y = 37 + } s(1) + { x = -32767 + y = 32767 + } s(2) + { x = -1 + y = 3 + } s(3) + { x = -2 + y = 2 + } s(4) + { x = -3 + y = 1 + } s(5) + { x = -4 + y = 12 + } s(6) + { x = -8 + y = 8 + } s(7) + { x = -12 + y = 4 + } s(8) + { x = -5 + y = 15 + } s(9) + { x = -10 + y = 10 + } s(10) + { x = -15 + y = 5 + } s(11) +} diff --git a/dap4/src/test/data/resources/baselinehyrax/AIRS.2002.12.01.L3.RetStd_H031.v4.0.21.0.G06101132853.hdf.ncdump b/dap4/src/test/data/resources/baselinehyrax/AIRS.2002.12.01.L3.RetStd_H031.v4.0.21.0.G06101132853.hdf.ncdump new file mode 100644 index 0000000000..701d8f7096 --- /dev/null +++ b/dap4/src/test/data/resources/baselinehyrax/AIRS.2002.12.01.L3.RetStd_H031.v4.0.21.0.G06101132853.hdf.ncdump @@ -0,0 +1,213 @@ +netcdf AIRS.2002.12.01.L3.RetStd_H031.v4.0.21.0.G06101132853.hdf { + dimensions: + Latitude = 180; + Longitude = 360; + variables: + short TotalCounts_A(Latitude, Longitude); + TotalCounts_A:_FillValue = 0S; + string TotalCounts_A:coordinates = "Latitude Longitude"; + string TotalCounts_A:long_name = "ascending:TotalCounts_A"; + + // global attributes: + string :location.DescendingGridStartTimeUTC = "2002-11-30T13:30:00.000000Z"; + string :location.AscendingGridStartTimeUTC = "2002-12-01T01:30:00.000000Z"; + string :HDF_GLOBAL.HDFEOSVersion = "HDFEOS_V2.12"; + :location.TempPresLvlNum = 24; + :location.H2OPresLvls = 1000.0f, 925.0f, 850.0f, 700.0f, 600.0f, 500.0f, 400.0f, 300.0f, 250.0f, 200.0f, 150.0f, 100.0f; + :location.NumOfDays = 31; + string :location.AscendingGridEndTimeUTC = "2003-01-01T01:29:59.999999Z"; + :location.Month = 12; + :location.MWEmisFreqs = 23.8f, 50.3f, 89.0f; + string :location.DescendingGridEndTimeUTC = "2002-12-31T13:29:59.999999Z"; + :location.IREmisFreqs = 832.0f, 961.0f, 1203.0f, 2616.0f; + :location.Day = 1; + :location.TempPresLvls = 1000.0f, 925.0f, 850.0f, 700.0f, 600.0f, 500.0f, 400.0f, 300.0f, 250.0f, 200.0f, 150.0f, 100.0f, 70.0f, 50.0f, 30.0f, 20.0f, 15.0f, 10.0f, 7.0f, 5.0f, 3.0f, 2.0f, 1.5f, 1.0f; + :location.H2OPresLvlNum = 12; + :location.Year = 2002; + string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; + + data: + TotalCounts_A = + { + {2, 2, 4, 0, 4, 0, 2, 2, 0, 2, 4, 4, 2, 4, 4, 4, 8, 6, 4, 12, 6, 0, 6, 8, 12, 6, 8, 10, 8, 10, 8, 4, 6, 2, 6, 6, 4, 6, 4, 2, 0, 4, 2, 2, 2, 0, 6, 4, 2, 4, 0, 0, 2, 8, 0, 6, 14, 6, 2, 2, 2, 16, 8, 4, 12, 4, 2, 10, 10, 8, 8, 4, 2, 10, 4, 2, 6, 4, 8, 4, 2, 0, 0, 2, 4, 0, 0, 4, 6, 4, 2, 4, 4, 4, 2, 6, 4, 4, 4, 4, 6, 12, 8, 6, 2, 8, 10, 14, 4, 10, 10, 8, 2, 10, 2, 2, 6, 4, 4, 8, 2, 4, 2, 0, 2, 0, 4, 0, 4, 0, 4, 0, 6, 6, 4, 2, 4, 10, 2, 6, 4, 10, 2, 4, 8, 8, 14, 8, 12, 6, 4, 6, 4, 10, 2, 4, 4, 8, 6, 2, 4, 0, 0, 2, 4, 4, 0, 6, 2, 2, 4, 0, 6, 2, 6, 4, 2, 8, 2, 8, 6, 6, 10, 10, 14, 4, 4, 4, 2, 14, 10, 10, 4, 4, 4, 2, 6, 6, 8, 6, 2, 2, 2, 2, 0, 0, 4, 0, 4, 2, 4, 4, 8, 2, 4, 2, 0, 10, 6, 8, 6, 4, 2, 6, 14, 10, 16, 2, 6, 4, 8, 4, 4, 8, 8, 2, 8, 4, 2, 2, 4, 0, 0, 6, 4, 0, 0, 2, 0, 6, 2, 0, 6, 6, 2, 6, 14, 0, 0, 4, 10, 10, 10, 10, 4, 8, 8, 6, 6, 12, 10, 4, 2, 4, 6, 6, 4, 4, 6, 4, 0, 2, 2, 2, 4, 2, 6, 2, 0, 2, 4, 2, 2, 6, 6, 6, 6, 4, 4, 8, 4, 14, 8, 10, 4, 6, 6, 10, 8, 8, 8, 2, 8, 10, 4, 4, 4, 4, 2, 6, 2, 4, 2, 0, 0, 0, 6, 0, 2, 2, 8, 4, 4, 6, 0, 4, 4, 4, 4, 14, 6, 8, 4, 8, 4, 14, 8, 8, 2, 12, 10, 4, 4, 10, 0, 2, 2, 10, 6, 4}, + {16, 22, 12, 20, 10, 4, 16, 12, 4, 20, 14, 24, 14, 6, 8, 20, 14, 22, 14, 10, 14, 0, 10, 18, 14, 10, 14, 10, 18, 12, 14, 20, 14, 12, 10, 18, 0, 8, 20, 8, 16, 18, 14, 10, 6, 18, 20, 26, 6, 10, 8, 16, 10, 4, 22, 8, 24, 4, 16, 24, 12, 8, 14, 10, 8, 14, 16, 8, 12, 6, 10, 14, 10, 24, 12, 6, 24, 16, 8, 10, 18, 10, 8, 10, 2, 18, 22, 18, 16, 8, 8, 16, 12, 20, 18, 10, 8, 6, 10, 18, 4, 20, 12, 10, 22, 10, 8, 12, 16, 6, 18, 8, 14, 6, 18, 14, 8, 18, 10, 22, 10, 20, 8, 20, 8, 8, 18, 14, 8, 4, 14, 14, 18, 14, 24, 10, 6, 18, 6, 12, 20, 14, 8, 12, 6, 8, 16, 14, 20, 12, 10, 16, 18, 10, 10, 16, 8, 12, 10, 2, 10, 22, 10, 18, 12, 18, 20, 4, 14, 18, 10, 14, 6, 12, 20, 10, 8, 14, 22, 12, 18, 22, 16, 4, 10, 18, 6, 18, 8, 14, 14, 10, 2, 18, 24, 14, 16, 14, 10, 12, 18, 4, 14, 20, 8, 10, 6, 10, 22, 28, 20, 10, 6, 12, 8, 14, 18, 20, 8, 8, 6, 14, 12, 22, 8, 10, 20, 14, 14, 8, 18, 6, 10, 14, 4, 10, 18, 14, 12, 16, 10, 32, 6, 10, 10, 18, 8, 12, 22, 14, 10, 4, 8, 18, 12, 32, 16, 16, 4, 12, 8, 10, 18, 12, 8, 8, 14, 6, 12, 24, 16, 14, 18, 8, 16, 20, 6, 12, 18, 8, 10, 12, 10, 14, 26, 14, 16, 22, 2, 12, 12, 14, 8, 20, 10, 8, 16, 10, 12, 14, 14, 22, 10, 20, 8, 8, 16, 12, 14, 8, 12, 18, 8, 16, 8, 18, 22, 14, 16, 6, 12, 10, 14, 8, 20, 20, 6, 6, 14, 4, 28, 24, 22, 0, 12, 12, 6, 10, 20, 12, 12, 8, 8, 14, 28, 12, 14, 12, 8, 24, 4, 14, 14, 10, 6, 14, 10, 14, 14, 14}, + {30, 20, 28, 14, 18, 28, 24, 34, 36, 20, 22, 30, 26, 26, 22, 28, 22, 24, 20, 24, 30, 18, 34, 26, 26, 30, 20, 26, 38, 20, 20, 22, 16, 22, 26, 26, 34, 30, 16, 24, 20, 32, 28, 26, 20, 24, 22, 28, 22, 24, 20, 28, 18, 18, 38, 36, 16, 26, 26, 24, 30, 20, 22, 30, 32, 18, 30, 20, 26, 28, 22, 26, 24, 20, 24, 22, 26, 30, 8, 28, 16, 32, 28, 36, 24, 18, 26, 30, 16, 30, 26, 12, 32, 16, 22, 38, 10, 34, 24, 22, 24, 26, 30, 30, 18, 28, 18, 26, 24, 18, 30, 28, 28, 26, 18, 28, 32, 24, 28, 20, 14, 22, 28, 24, 20, 20, 24, 26, 24, 30, 28, 34, 20, 12, 34, 22, 28, 22, 14, 36, 16, 36, 16, 36, 24, 22, 34, 20, 16, 24, 32, 22, 26, 18, 24, 20, 16, 38, 28, 36, 22, 16, 28, 20, 34, 22, 16, 22, 20, 34, 24, 22, 28, 20, 32, 18, 28, 38, 34, 14, 22, 22, 32, 28, 16, 26, 30, 34, 24, 18, 38, 34, 26, 22, 18, 26, 16, 36, 22, 26, 18, 18, 22, 24, 30, 34, 40, 14, 14, 38, 16, 34, 18, 26, 20, 30, 24, 18, 32, 28, 26, 26, 22, 22, 24, 24, 30, 22, 28, 18, 28, 20, 22, 30, 36, 22, 16, 36, 20, 30, 18, 20, 26, 18, 38, 18, 24, 22, 30, 22, 26, 20, 50, 18, 22, 22, 20, 36, 18, 26, 20, 30, 32, 16, 36, 26, 34, 24, 18, 28, 14, 24, 26, 28, 28, 22, 16, 24, 16, 34, 36, 28, 24, 18, 32, 20, 28, 24, 18, 22, 24, 22, 28, 32, 26, 28, 18, 30, 30, 18, 26, 30, 14, 34, 26, 12, 38, 12, 42, 24, 30, 20, 28, 34, 26, 12, 30, 16, 22, 30, 32, 22, 22, 18, 24, 24, 30, 36, 18, 32, 12, 24, 38, 14, 34, 20, 22, 38, 24, 34, 26, 30, 26, 22, 26, 16, 16, 32, 22, 34, 20, 22, 26, 24, 26, 28, 34, 22, 24, 20}, + {44, 34, 42, 34, 36, 40, 36, 38, 36, 44, 34, 42, 34, 50, 42, 38, 38, 46, 40, 36, 36, 46, 50, 32, 42, 34, 30, 44, 38, 36, 42, 36, 46, 40, 26, 50, 32, 40, 32, 40, 34, 34, 50, 22, 48, 40, 24, 38, 48, 44, 42, 36, 40, 36, 42, 36, 40, 36, 44, 44, 28, 52, 32, 40, 40, 38, 28, 42, 36, 54, 38, 28, 40, 34, 30, 50, 34, 34, 38, 34, 38, 34, 32, 42, 40, 34, 34, 26, 52, 38, 44, 36, 44, 36, 36, 36, 46, 40, 48, 30, 38, 40, 34, 40, 38, 38, 40, 46, 24, 40, 34, 36, 44, 28, 36, 38, 44, 42, 30, 40, 34, 36, 40, 40, 40, 40, 46, 32, 30, 42, 38, 34, 40, 40, 38, 38, 38, 50, 32, 44, 38, 38, 40, 32, 56, 44, 34, 34, 44, 34, 42, 42, 26, 38, 46, 38, 40, 34, 36, 38, 38, 32, 38, 46, 34, 36, 40, 40, 34, 42, 28, 50, 36, 44, 34, 36, 38, 44, 40, 42, 38, 38, 50, 36, 50, 34, 48, 32, 28, 40, 42, 34, 50, 32, 40, 36, 32, 44, 28, 50, 36, 36, 38, 28, 54, 28, 42, 32, 40, 36, 40, 46, 40, 48, 44, 36, 40, 44, 28, 52, 40, 46, 24, 48, 40, 34, 46, 38, 38, 38, 40, 32, 44, 40, 34, 34, 28, 42, 42, 48, 32, 36, 44, 40, 34, 28, 54, 38, 36, 36, 40, 42, 46, 34, 36, 40, 28, 54, 26, 60, 30, 44, 40, 28, 38, 44, 38, 48, 40, 30, 36, 42, 36, 38, 40, 32, 42, 38, 36, 48, 28, 38, 38, 40, 26, 48, 40, 42, 42, 46, 36, 40, 42, 36, 46, 36, 48, 30, 38, 48, 34, 42, 42, 34, 40, 48, 40, 46, 30, 36, 36, 34, 42, 40, 38, 38, 38, 44, 36, 34, 40, 40, 44, 34, 36, 42, 36, 48, 36, 38, 42, 30, 42, 38, 54, 36, 38, 40, 32, 38, 46, 38, 42, 38, 50, 24, 52, 38, 38, 38, 38, 36, 38, 42, 46, 32, 36, 38, 32, 36}, + {60, 66, 64, 52, 48, 56, 50, 58, 64, 56, 54, 52, 58, 66, 54, 56, 46, 50, 64, 60, 54, 50, 80, 54, 62, 46, 52, 62, 66, 66, 54, 50, 66, 48, 68, 58, 58, 54, 52, 66, 58, 52, 70, 42, 56, 60, 44, 54, 56, 60, 62, 56, 44, 56, 52, 60, 56, 56, 62, 50, 58, 62, 60, 70, 40, 46, 62, 64, 54, 56, 64, 50, 50, 54, 46, 62, 70, 54, 56, 44, 54, 56, 50, 70, 58, 48, 44, 58, 60, 60, 50, 46, 46, 66, 50, 48, 62, 64, 56, 64, 42, 42, 68, 54, 60, 52, 54, 54, 38, 74, 56, 62, 46, 44, 66, 68, 54, 62, 54, 60, 56, 50, 52, 54, 64, 52, 54, 52, 58, 52, 60, 56, 68, 38, 56, 52, 68, 52, 60, 42, 50, 68, 56, 50, 50, 72, 58, 50, 48, 56, 64, 60, 48, 62, 44, 68, 44, 68, 54, 62, 50, 52, 54, 70, 64, 58, 36, 62, 56, 56, 50, 52, 72, 50, 54, 60, 54, 62, 56, 58, 52, 54, 62, 50, 72, 58, 54, 56, 48, 66, 66, 64, 60, 52, 56, 50, 56, 60, 54, 70, 46, 62, 46, 66, 60, 58, 56, 62, 50, 52, 58, 68, 60, 50, 44, 52, 70, 50, 68, 50, 70, 54, 56, 52, 52, 70, 54, 52, 60, 48, 66, 44, 64, 66, 52, 58, 46, 70, 54, 72, 58, 38, 66, 52, 48, 68, 50, 58, 56, 56, 52, 62, 46, 66, 54, 60, 54, 48, 54, 76, 58, 60, 46, 48, 72, 46, 76, 48, 62, 60, 44, 60, 56, 62, 64, 40, 72, 54, 50, 58, 60, 58, 58, 50, 52, 68, 54, 70, 46, 46, 58, 60, 50, 62, 60, 66, 42, 70, 46, 64, 56, 54, 48, 64, 60, 54, 50, 72, 70, 54, 54, 52, 56, 76, 60, 58, 54, 62, 54, 42, 66, 56, 66, 40, 58, 58, 54, 58, 54, 52, 66, 52, 48, 62, 58, 68, 52, 42, 54, 66, 48, 60, 68, 58, 50, 56, 58, 54, 68, 58, 48, 60, 60, 58, 58, 60, 58, 54, 50, 56}, + {84, 78, 78, 82, 74, 80, 70, 82, 72, 88, 68, 86, 76, 74, 68, 78, 80, 84, 72, 74, 80, 64, 80, 84, 74, 80, 66, 72, 76, 64, 74, 72, 62, 78, 72, 82, 68, 80, 68, 82, 60, 84, 88, 70, 80, 64, 72, 76, 72, 90, 70, 76, 70, 82, 74, 78, 76, 70, 76, 92, 62, 82, 60, 80, 88, 62, 72, 66, 68, 70, 78, 72, 66, 68, 72, 76, 68, 82, 72, 58, 80, 76, 72, 82, 54, 82, 88, 64, 80, 70, 84, 72, 98, 72, 52, 90, 60, 82, 90, 66, 78, 60, 84, 74, 60, 74, 66, 80, 76, 60, 64, 86, 70, 68, 78, 60, 74, 90, 60, 90, 60, 76, 70, 78, 74, 82, 66, 76, 78, 82, 70, 82, 82, 62, 96, 60, 78, 72, 72, 92, 62, 82, 68, 80, 64, 78, 80, 70, 72, 64, 78, 86, 66, 80, 56, 72, 86, 62, 78, 62, 78, 78, 70, 80, 72, 80, 78, 82, 74, 64, 86, 72, 84, 76, 74, 70, 82, 74, 92, 72, 66, 76, 84, 70, 88, 60, 88, 92, 56, 74, 78, 68, 78, 70, 72, 72, 76, 58, 80, 86, 74, 78, 64, 78, 86, 70, 78, 70, 72, 84, 76, 82, 76, 76, 76, 80, 74, 78, 82, 60, 82, 78, 74, 80, 60, 80, 72, 68, 72, 70, 78, 68, 84, 72, 60, 92, 56, 84, 62, 84, 70, 82, 78, 58, 90, 66, 74, 80, 78, 78, 70, 78, 90, 70, 82, 82, 66, 86, 68, 84, 80, 66, 86, 66, 74, 76, 74, 74, 66, 76, 82, 56, 86, 70, 84, 68, 82, 54, 90, 76, 62, 98, 58, 86, 72, 68, 86, 72, 86, 76, 88, 74, 76, 80, 74, 86, 82, 70, 80, 70, 80, 80, 54, 78, 66, 78, 76, 76, 64, 86, 76, 44, 92, 72, 70, 76, 60, 88, 76, 66, 74, 70, 82, 78, 76, 72, 78, 84, 68, 82, 76, 64, 106, 68, 78, 72, 84, 76, 76, 72, 86, 76, 64, 76, 72, 78, 84, 58, 86, 80, 62, 76, 66, 82, 82, 68, 82, 70, 72, 70}, + {98, 126, 94, 80, 94, 116, 116, 86, 98, 116, 112, 92, 102, 108, 126, 100, 94, 86, 120, 114, 86, 108, 104, 106, 92, 94, 112, 104, 122, 96, 82, 116, 106, 86, 100, 108, 112, 102, 90, 86, 110, 118, 88, 90, 106, 114, 100, 98, 102, 110, 104, 98, 86, 116, 118, 100, 100, 102, 98, 96, 106, 94, 106, 124, 86, 98, 92, 130, 100, 78, 118, 100, 98, 82, 98, 118, 108, 102, 68, 104, 120, 84, 104, 90, 112, 104, 96, 102, 82, 130, 86, 84, 98, 116, 106, 86, 100, 100, 120, 86, 100, 100, 122, 104, 76, 96, 114, 126, 86, 88, 98, 120, 90, 92, 96, 118, 112, 88, 102, 102, 108, 88, 92, 104, 116, 94, 96, 70, 124, 122, 76, 100, 108, 108, 88, 108, 96, 126, 102, 102, 96, 104, 124, 86, 100, 108, 114, 90, 88, 104, 100, 120, 86, 72, 130, 98, 100, 98, 100, 112, 104, 86, 102, 106, 112, 98, 84, 104, 130, 90, 92, 112, 110, 108, 96, 94, 122, 128, 90, 92, 108, 116, 102, 96, 90, 116, 126, 80, 100, 106, 114, 118, 76, 120, 108, 100, 98, 88, 110, 102, 96, 88, 100, 128, 94, 100, 100, 110, 116, 92, 100, 122, 102, 106, 92, 82, 130, 114, 80, 110, 120, 98, 98, 98, 104, 114, 100, 94, 94, 108, 110, 84, 100, 112, 106, 88, 98, 106, 118, 120, 74, 106, 120, 100, 104, 96, 110, 104, 106, 92, 88, 140, 100, 100, 94, 94, 124, 86, 112, 98, 120, 98, 96, 104, 102, 130, 76, 100, 116, 110, 90, 86, 102, 116, 106, 88, 94, 124, 104, 96, 90, 108, 122, 90, 100, 104, 116, 106, 92, 74, 122, 140, 66, 108, 98, 110, 102, 96, 106, 116, 126, 98, 78, 110, 124, 108, 84, 114, 120, 104, 96, 86, 96, 134, 110, 78, 102, 114, 104, 94, 84, 130, 106, 90, 98, 102, 116, 108, 88, 96, 122, 100, 92, 116, 108, 120, 102, 96, 108, 124, 106, 76, 116, 114, 112, 90, 90, 108, 120, 90, 94, 90, 118, 110, 74, 116, 98, 108, 94, 96}, + {100, 140, 114, 118, 138, 120, 134, 116, 104, 158, 98, 150, 112, 122, 152, 108, 106, 152, 112, 134, 124, 120, 148, 114, 138, 124, 100, 146, 112, 136, 122, 116, 122, 110, 138, 124, 110, 132, 122, 130, 134, 112, 136, 122, 108, 132, 116, 118, 132, 104, 132, 118, 116, 136, 128, 126, 118, 136, 120, 108, 144, 118, 128, 120, 120, 136, 116, 110, 126, 104, 136, 110, 122, 120, 110, 122, 136, 110, 124, 118, 126, 126, 116, 124, 112, 120, 116, 120, 132, 116, 120, 134, 110, 118, 122, 100, 148, 118, 120, 128, 98, 136, 124, 106, 128, 114, 128, 104, 116, 132, 116, 130, 108, 114, 150, 110, 130, 106, 120, 134, 106, 104, 128, 110, 136, 124, 106, 132, 118, 118, 146, 104, 130, 114, 116, 132, 126, 126, 100, 118, 142, 106, 150, 98, 136, 142, 102, 122, 130, 104, 140, 114, 122, 128, 112, 124, 110, 114, 148, 94, 128, 126, 106, 136, 112, 112, 140, 118, 130, 112, 126, 142, 102, 140, 110, 112, 154, 104, 126, 146, 108, 144, 106, 120, 154, 114, 142, 106, 122, 148, 106, 124, 130, 110, 124, 108, 120, 140, 104, 136, 120, 126, 132, 118, 130, 130, 108, 140, 108, 134, 132, 98, 158, 106, 116, 148, 108, 130, 134, 114, 146, 112, 142, 106, 126, 120, 110, 140, 120, 114, 126, 114, 126, 136, 122, 104, 132, 116, 140, 130, 110, 132, 116, 124, 116, 122, 138, 112, 130, 110, 134, 114, 124, 138, 120, 136, 110, 128, 142, 110, 134, 126, 116, 124, 120, 128, 116, 128, 132, 116, 114, 130, 124, 128, 128, 112, 136, 128, 106, 138, 116, 138, 92, 130, 106, 122, 144, 114, 124, 142, 106, 132, 118, 116, 144, 136, 108, 140, 114, 128, 116, 114, 140, 118, 120, 110, 132, 144, 102, 146, 110, 122, 156, 108, 130, 128, 110, 146, 100, 110, 144, 108, 116, 126, 98, 156, 116, 114, 148, 102, 134, 114, 118, 140, 114, 152, 96, 120, 152, 120, 132, 110, 112, 164, 98, 132, 130, 114, 138, 112, 124, 124, 116, 128, 124, 126, 122, 122, 102, 152}, + {154, 130, 150, 136, 158, 138, 130, 160, 146, 146, 138, 138, 142, 144, 152, 130, 148, 152, 162, 138, 144, 170, 126, 162, 142, 150, 148, 142, 152, 138, 172, 142, 136, 156, 130, 162, 138, 144, 146, 144, 144, 138, 138, 146, 156, 128, 148, 146, 144, 146, 132, 154, 138, 146, 146, 138, 142, 162, 138, 144, 160, 138, 144, 146, 150, 140, 142, 162, 118, 174, 144, 126, 146, 142, 154, 146, 130, 154, 130, 156, 140, 134, 142, 148, 136, 144, 150, 136, 142, 140, 142, 146, 138, 160, 140, 140, 156, 136, 144, 140, 156, 134, 140, 138, 160, 136, 156, 136, 128, 162, 126, 160, 152, 128, 162, 138, 144, 138, 160, 140, 116, 158, 150, 146, 136, 142, 146, 142, 148, 134, 154, 144, 150, 130, 148, 158, 126, 152, 146, 132, 160, 138, 152, 146, 146, 142, 146, 146, 160, 148, 128, 156, 146, 154, 146, 160, 130, 144, 160, 126, 172, 146, 136, 158, 146, 146, 146, 140, 146, 144, 144, 136, 160, 134, 154, 132, 146, 154, 128, 166, 142, 140, 152, 168, 138, 144, 170, 144, 152, 148, 158, 148, 156, 148, 138, 148, 136, 160, 146, 144, 152, 132, 170, 134, 124, 150, 150, 144, 130, 156, 146, 156, 138, 138, 142, 150, 164, 134, 158, 150, 142, 144, 152, 150, 146, 148, 140, 144, 166, 150, 126, 152, 154, 130, 148, 130, 164, 160, 136, 146, 138, 156, 144, 130, 162, 142, 150, 130, 164, 150, 140, 152, 142, 164, 138, 160, 124, 158, 162, 128, 170, 134, 156, 156, 132, 152, 138, 180, 148, 116, 170, 148, 138, 142, 158, 134, 160, 144, 146, 136, 154, 152, 136, 152, 156, 138, 162, 124, 160, 138, 164, 148, 134, 148, 152, 134, 144, 166, 136, 142, 154, 144, 148, 130, 168, 148, 146, 164, 136, 152, 150, 146, 152, 148, 140, 152, 156, 142, 126, 158, 158, 138, 152, 150, 136, 156, 140, 128, 166, 150, 130, 134, 162, 148, 136, 152, 148, 148, 152, 164, 118, 172, 144, 142, 148, 152, 156, 130, 156, 156, 142, 158, 148, 158, 134, 164, 142, 138, 150, 148}, + {168, 176, 158, 168, 166, 168, 178, 182, 172, 174, 180, 190, 170, 166, 186, 172, 148, 212, 146, 182, 168, 172, 172, 172, 174, 160, 176, 172, 162, 178, 156, 174, 196, 164, 172, 170, 162, 176, 168, 176, 178, 150, 188, 166, 184, 172, 162, 164, 188, 152, 184, 170, 170, 166, 162, 180, 182, 152, 170, 176, 170, 164, 184, 158, 158, 182, 188, 146, 180, 158, 162, 170, 170, 162, 156, 172, 176, 148, 168, 182, 158, 168, 178, 146, 174, 184, 158, 172, 162, 180, 152, 178, 146, 176, 172, 152, 166, 176, 144, 184, 160, 166, 188, 162, 146, 188, 156, 176, 158, 152, 162, 180, 146, 174, 164, 170, 160, 186, 156, 172, 184, 156, 160, 164, 168, 176, 152, 146, 188, 154, 168, 168, 152, 192, 184, 142, 184, 162, 182, 166, 190, 150, 184, 168, 164, 164, 190, 158, 174, 158, 176, 168, 142, 180, 182, 150, 196, 144, 166, 170, 166, 172, 170, 154, 180, 162, 174, 170, 178, 164, 174, 168, 180, 186, 166, 164, 184, 178, 164, 192, 150, 182, 190, 158, 166, 180, 162, 168, 170, 178, 146, 202, 152, 174, 176, 166, 156, 170, 168, 180, 158, 168, 176, 166, 180, 186, 156, 180, 164, 176, 176, 190, 162, 170, 180, 184, 160, 174, 172, 174, 176, 166, 186, 154, 178, 172, 162, 180, 186, 148, 180, 168, 166, 170, 182, 158, 176, 174, 174, 158, 178, 170, 182, 174, 166, 162, 182, 158, 182, 168, 172, 174, 160, 164, 174, 178, 182, 158, 186, 170, 164, 184, 160, 174, 186, 170, 164, 168, 168, 180, 164, 166, 176, 172, 160, 158, 166, 194, 148, 200, 150, 154, 196, 182, 156, 160, 198, 176, 144, 188, 158, 174, 174, 180, 150, 194, 178, 162, 180, 178, 184, 164, 170, 182, 166, 172, 170, 168, 186, 164, 178, 168, 170, 174, 176, 158, 184, 170, 168, 154, 178, 158, 164, 190, 156, 152, 194, 160, 184, 166, 164, 204, 162, 164, 188, 164, 174, 166, 178, 182, 174, 170, 162, 184, 178, 158, 170, 176, 168, 166, 166, 180, 166, 174, 178, 152, 172, 174, 156, 180}, + {184, 192, 186, 178, 186, 188, 182, 190, 168, 194, 192, 166, 200, 178, 184, 190, 180, 188, 180, 190, 192, 162, 202, 188, 176, 184, 178, 200, 178, 170, 202, 162, 192, 178, 172, 206, 182, 188, 184, 174, 202, 176, 180, 194, 176, 178, 182, 176, 184, 186, 190, 194, 174, 190, 174, 188, 188, 188, 186, 176, 182, 194, 166, 182, 196, 158, 188, 176, 184, 182, 164, 202, 158, 186, 180, 178, 190, 180, 182, 186, 166, 190, 178, 172, 196, 168, 204, 186, 170, 202, 160, 196, 188, 160, 190, 160, 202, 176, 184, 178, 186, 166, 180, 160, 198, 174, 172, 190, 178, 168, 182, 178, 178, 190, 166, 198, 172, 174, 194, 168, 192, 176, 190, 178, 174, 188, 184, 186, 188, 174, 204, 172, 164, 192, 156, 216, 184, 150, 206, 156, 190, 180, 172, 194, 168, 206, 156, 178, 192, 176, 184, 170, 170, 200, 166, 172, 194, 188, 182, 186, 166, 206, 186, 170, 212, 168, 194, 190, 180, 196, 178, 170, 194, 176, 186, 170, 204, 176, 176, 202, 166, 188, 192, 160, 206, 180, 196, 190, 162, 200, 186, 176, 210, 182, 172, 176, 196, 184, 186, 196, 172, 190, 180, 174, 192, 192, 188, 182, 176, 192, 194, 174, 182, 192, 174, 204, 196, 160, 194, 178, 194, 188, 180, 184, 176, 176, 190, 168, 192, 174, 202, 178, 160, 216, 160, 200, 186, 172, 204, 178, 184, 198, 170, 182, 196, 186, 178, 186, 186, 194, 192, 176, 192, 200, 188, 170, 186, 182, 208, 166, 180, 190, 168, 188, 190, 166, 194, 198, 172, 184, 192, 174, 188, 190, 194, 182, 180, 182, 176, 186, 196, 170, 204, 154, 216, 188, 174, 206, 172, 192, 190, 170, 192, 188, 180, 184, 168, 202, 184, 178, 164, 182, 196, 168, 172, 192, 176, 214, 156, 186, 180, 186, 188, 196, 164, 210, 172, 178, 186, 186, 186, 198, 178, 194, 170, 200, 198, 172, 202, 196, 160, 190, 170, 198, 178, 174, 208, 156, 204, 180, 170, 208, 178, 182, 182, 176, 204, 162, 190, 168, 188, 188, 184, 176, 188, 184, 202, 166, 192, 192}, + {196, 226, 164, 214, 202, 180, 212, 198, 198, 194, 206, 200, 162, 226, 206, 162, 244, 172, 196, 232, 154, 218, 214, 184, 224, 192, 200, 194, 200, 202, 186, 216, 196, 178, 204, 196, 186, 208, 192, 200, 206, 178, 226, 178, 200, 192, 176, 234, 162, 206, 228, 140, 218, 200, 172, 222, 196, 188, 212, 180, 206, 190, 216, 182, 180, 236, 164, 210, 216, 148, 230, 186, 180, 214, 170, 200, 190, 184, 212, 180, 202, 204, 170, 216, 176, 180, 212, 170, 196, 208, 170, 208, 178, 210, 182, 200, 210, 158, 220, 204, 152, 232, 180, 168, 214, 190, 182, 218, 178, 208, 182, 194, 200, 192, 212, 172, 210, 190, 168, 226, 178, 182, 206, 184, 182, 190, 206, 198, 168, 220, 192, 176, 226, 180, 186, 222, 160, 224, 200, 162, 228, 190, 198, 196, 220, 198, 166, 222, 186, 190, 232, 172, 182, 216, 186, 194, 196, 192, 194, 194, 210, 178, 192, 224, 170, 198, 194, 176, 220, 172, 192, 212, 198, 198, 172, 234, 180, 194, 212, 184, 198, 230, 166, 202, 222, 186, 212, 194, 194, 206, 196, 206, 196, 214, 190, 186, 212, 184, 190, 220, 182, 208, 204, 178, 200, 204, 196, 194, 196, 222, 166, 206, 226, 146, 240, 188, 186, 236, 168, 198, 204, 190, 214, 202, 198, 178, 210, 206, 182, 200, 206, 170, 222, 184, 186, 222, 184, 210, 196, 178, 220, 164, 222, 196, 174, 222, 174, 194, 220, 182, 200, 216, 170, 206, 194, 180, 202, 202, 218, 174, 230, 198, 174, 238, 168, 210, 220, 166, 206, 202, 180, 196, 210, 196, 198, 200, 212, 184, 196, 214, 178, 222, 180, 190, 200, 186, 216, 188, 202, 204, 184, 216, 180, 204, 218, 166, 220, 216, 168, 228, 204, 166, 224, 194, 202, 200, 202, 214, 186, 222, 174, 192, 234, 160, 228, 216, 178, 212, 184, 196, 200, 204, 186, 182, 198, 216, 168, 220, 200, 164, 240, 174, 190, 222, 192, 204, 194, 206, 204, 192, 204, 162, 230, 206, 170, 222, 204, 172, 230, 188, 188, 218, 186, 206, 208, 194, 180, 184, 232, 172}, + {216, 204, 212, 194, 218, 196, 204, 218, 192, 220, 212, 192, 216, 214, 206, 202, 228, 200, 212, 224, 206, 216, 198, 220, 208, 210, 220, 196, 218, 218, 200, 200, 228, 208, 214, 206, 204, 216, 212, 194, 212, 234, 194, 186, 222, 194, 208, 208, 210, 202, 202, 208, 206, 226, 190, 212, 210, 200, 218, 192, 220, 206, 230, 210, 194, 220, 200, 196, 206, 216, 204, 192, 220, 188, 208, 218, 192, 202, 200, 202, 204, 208, 194, 216, 208, 194, 210, 192, 214, 202, 218, 196, 202, 212, 198, 196, 200, 212, 198, 188, 224, 198, 216, 198, 208, 186, 200, 220, 180, 206, 192, 232, 196, 178, 230, 200, 200, 212, 214, 194, 208, 208, 202, 212, 188, 218, 208, 190, 208, 192, 214, 188, 218, 194, 192, 214, 198, 222, 196, 224, 178, 222, 216, 200, 196, 216, 218, 192, 204, 222, 198, 214, 192, 220, 212, 206, 214, 216, 202, 194, 226, 188, 206, 224, 196, 216, 192, 222, 192, 212, 208, 196, 224, 192, 218, 210, 210, 198, 218, 200, 202, 226, 210, 206, 216, 208, 218, 198, 236, 190, 220, 228, 188, 208, 216, 224, 186, 214, 204, 210, 198, 206, 224, 214, 190, 206, 226, 196, 212, 224, 184, 230, 214, 198, 208, 214, 226, 196, 214, 216, 216, 198, 214, 218, 202, 214, 202, 220, 196, 210, 220, 198, 220, 200, 210, 190, 214, 218, 176, 248, 204, 220, 190, 202, 224, 204, 208, 202, 216, 178, 222, 232, 188, 218, 216, 222, 186, 218, 218, 204, 228, 188, 220, 216, 214, 216, 188, 242, 204, 212, 194, 208, 214, 202, 216, 190, 234, 190, 208, 214, 180, 228, 222, 198, 194, 232, 206, 194, 248, 192, 208, 212, 212, 212, 204, 222, 198, 232, 174, 236, 214, 204, 192, 202, 236, 192, 204, 220, 198, 228, 208, 212, 212, 234, 188, 194, 252, 184, 218, 208, 212, 202, 204, 206, 200, 238, 176, 220, 218, 188, 218, 210, 206, 204, 220, 204, 204, 218, 204, 220, 206, 222, 202, 200, 228, 202, 214, 204, 220, 198, 216, 208, 208, 224, 192, 234, 210, 198, 212, 196}, + {236, 202, 184, 222, 206, 220, 198, 200, 208, 216, 204, 210, 212, 210, 200, 236, 186, 220, 212, 194, 224, 206, 182, 212, 218, 204, 202, 208, 198, 216, 200, 204, 210, 204, 208, 194, 206, 212, 198, 204, 208, 198, 202, 222, 206, 202, 204, 200, 208, 236, 180, 216, 202, 198, 224, 208, 190, 220, 206, 208, 214, 182, 206, 218, 216, 190, 220, 190, 218, 212, 188, 202, 208, 196, 200, 202, 198, 214, 198, 196, 208, 196, 216, 202, 180, 218, 212, 200, 224, 200, 190, 214, 202, 194, 216, 198, 202, 210, 216, 186, 220, 196, 208, 202, 184, 208, 208, 196, 206, 194, 198, 198, 196, 224, 194, 204, 208, 208, 192, 202, 182, 208, 214, 188, 198, 222, 204, 192, 204, 218, 176, 220, 190, 216, 220, 188, 196, 226, 178, 216, 212, 198, 220, 186, 210, 218, 202, 208, 200, 198, 224, 210, 186, 194, 208, 188, 220, 192, 198, 212, 216, 194, 226, 194, 206, 222, 196, 210, 208, 202, 212, 208, 198, 206, 214, 208, 220, 194, 210, 228, 194, 200, 244, 190, 190, 226, 200, 204, 212, 200, 222, 202, 182, 224, 210, 204, 216, 190, 206, 222, 192, 208, 204, 212, 220, 204, 188, 222, 190, 204, 230, 204, 192, 244, 210, 184, 220, 202, 216, 222, 188, 200, 210, 200, 212, 198, 214, 218, 204, 196, 206, 226, 202, 202, 200, 220, 202, 192, 226, 224, 178, 214, 218, 192, 234, 184, 200, 228, 214, 202, 210, 202, 224, 220, 200, 198, 228, 198, 204, 208, 208, 196, 224, 212, 204, 206, 210, 218, 190, 206, 210, 196, 208, 212, 182, 212, 224, 202, 206, 206, 210, 224, 194, 196, 236, 182, 210, 220, 198, 208, 218, 190, 230, 208, 186, 228, 212, 192, 210, 202, 198, 226, 206, 198, 216, 202, 212, 216, 194, 226, 186, 224, 212, 200, 202, 218, 210, 194, 204, 206, 210, 208, 212, 208, 208, 190, 234, 214, 176, 232, 202, 204, 226, 194, 192, 236, 210, 192, 218, 220, 206, 224, 196, 210, 224, 202, 202, 212, 198, 212, 202, 204, 216, 194, 208, 204, 200, 214, 210, 180}, + {202, 232, 228, 212, 240, 226, 214, 220, 222, 214, 224, 216, 226, 224, 228, 226, 206, 220, 224, 234, 220, 206, 236, 228, 220, 224, 222, 216, 218, 222, 218, 200, 226, 220, 228, 244, 200, 226, 224, 220, 212, 212, 242, 214, 218, 206, 228, 218, 224, 198, 230, 196, 246, 220, 228, 230, 216, 202, 216, 232, 210, 228, 236, 194, 230, 206, 230, 212, 216, 232, 208, 198, 230, 222, 220, 200, 232, 212, 214, 208, 220, 226, 204, 232, 234, 180, 238, 218, 194, 224, 216, 224, 206, 228, 200, 212, 228, 210, 198, 220, 206, 234, 206, 220, 212, 198, 206, 230, 212, 208, 214, 240, 212, 194, 234, 224, 194, 236, 216, 202, 228, 204, 200, 234, 202, 208, 214, 222, 204, 216, 232, 214, 240, 202, 194, 234, 210, 200, 230, 216, 218, 212, 232, 206, 230, 206, 222, 216, 238, 188, 240, 206, 224, 206, 216, 234, 214, 220, 214, 196, 230, 218, 220, 216, 228, 210, 244, 204, 204, 252, 206, 216, 224, 210, 230, 220, 200, 228, 230, 236, 214, 236, 200, 226, 234, 228, 214, 230, 206, 240, 220, 208, 230, 230, 208, 208, 224, 240, 204, 230, 228, 208, 218, 228, 216, 236, 218, 202, 220, 252, 194, 238, 226, 212, 216, 244, 212, 224, 224, 212, 228, 240, 208, 230, 224, 200, 216, 224, 236, 208, 222, 218, 218, 226, 220, 212, 246, 204, 220, 232, 232, 204, 232, 228, 204, 222, 236, 204, 238, 220, 208, 222, 238, 206, 232, 222, 196, 242, 238, 200, 218, 230, 220, 216, 224, 220, 224, 220, 216, 226, 220, 232, 214, 230, 218, 216, 214, 254, 194, 238, 200, 236, 236, 208, 206, 240, 220, 234, 202, 224, 228, 220, 214, 224, 234, 214, 214, 242, 196, 240, 224, 222, 210, 220, 210, 228, 232, 226, 214, 244, 212, 216, 212, 240, 218, 226, 212, 226, 228, 208, 212, 236, 210, 202, 246, 218, 212, 226, 228, 204, 232, 244, 194, 220, 244, 204, 244, 210, 216, 220, 240, 222, 222, 216, 222, 226, 238, 206, 232, 218, 214, 216, 218, 222, 226, 238, 214, 192, 228, 242}, + {220, 218, 208, 218, 216, 208, 238, 200, 226, 236, 202, 212, 222, 220, 206, 230, 216, 214, 232, 220, 188, 238, 228, 222, 228, 194, 210, 224, 218, 226, 232, 220, 198, 214, 226, 200, 240, 234, 208, 232, 216, 188, 234, 224, 202, 212, 232, 224, 208, 222, 210, 206, 252, 190, 214, 244, 192, 232, 234, 196, 214, 214, 230, 218, 202, 230, 202, 232, 220, 192, 246, 224, 198, 212, 212, 208, 220, 230, 218, 216, 218, 198, 208, 242, 188, 236, 214, 198, 216, 214, 208, 218, 218, 210, 216, 220, 194, 218, 208, 222, 208, 226, 210, 192, 224, 198, 224, 210, 208, 212, 220, 218, 206, 216, 202, 208, 232, 196, 206, 228, 208, 212, 216, 178, 240, 222, 202, 212, 200, 202, 222, 220, 206, 208, 226, 214, 192, 222, 210, 216, 226, 202, 216, 220, 218, 206, 202, 210, 220, 220, 226, 194, 214, 216, 188, 234, 214, 202, 232, 232, 186, 210, 226, 216, 200, 242, 196, 220, 228, 202, 212, 222, 208, 234, 206, 214, 218, 212, 226, 214, 224, 202, 228, 224, 210, 206, 240, 214, 218, 230, 226, 208, 210, 228, 206, 208, 230, 208, 232, 228, 184, 228, 230, 200, 244, 202, 212, 236, 224, 176, 232, 214, 206, 224, 240, 204, 218, 238, 200, 218, 232, 208, 224, 216, 226, 196, 226, 218, 216, 230, 216, 208, 240, 204, 196, 238, 208, 222, 230, 204, 208, 228, 212, 208, 218, 232, 212, 236, 220, 186, 228, 220, 202, 238, 206, 234, 218, 222, 186, 242, 222, 216, 212, 230, 204, 218, 240, 194, 234, 224, 198, 226, 216, 222, 214, 224, 222, 216, 224, 210, 212, 224, 190, 220, 228, 206, 234, 232, 198, 206, 232, 210, 220, 216, 224, 220, 226, 188, 222, 240, 200, 216, 246, 196, 212, 224, 226, 202, 218, 236, 218, 214, 222, 210, 226, 230, 192, 232, 228, 192, 230, 210, 206, 214, 230, 210, 224, 234, 196, 214, 238, 190, 222, 238, 208, 226, 202, 234, 204, 220, 216, 232, 224, 214, 218, 220, 194, 234, 224, 214, 218, 216, 222, 206, 216, 226, 216, 224, 214, 210}, + {204, 206, 218, 220, 200, 214, 198, 204, 208, 204, 208, 214, 216, 202, 204, 216, 192, 220, 212, 182, 228, 198, 228, 196, 206, 212, 198, 230, 202, 204, 218, 214, 200, 218, 192, 212, 210, 200, 206, 212, 200, 208, 220, 216, 192, 214, 200, 212, 212, 210, 188, 222, 186, 214, 218, 188, 204, 210, 196, 206, 214, 220, 196, 216, 210, 204, 220, 198, 196, 222, 208, 212, 196, 204, 206, 204, 220, 188, 200, 218, 182, 230, 206, 182, 214, 210, 206, 194, 220, 192, 204, 218, 192, 196, 206, 214, 198, 200, 208, 194, 220, 202, 208, 208, 186, 212, 210, 200, 202, 202, 208, 192, 200, 226, 192, 220, 188, 212, 208, 222, 190, 190, 200, 208, 198, 212, 198, 216, 200, 192, 198, 204, 186, 218, 216, 198, 200, 206, 208, 204, 208, 194, 204, 210, 204, 212, 196, 198, 214, 222, 198, 208, 210, 194, 216, 210, 194, 206, 214, 216, 190, 218, 206, 212, 210, 198, 196, 224, 202, 214, 206, 198, 210, 202, 224, 188, 224, 210, 182, 228, 214, 190, 224, 228, 184, 196, 216, 214, 206, 216, 212, 200, 226, 198, 214, 214, 210, 216, 218, 188, 208, 212, 200, 224, 212, 190, 220, 220, 200, 184, 240, 202, 202, 216, 196, 208, 206, 202, 208, 188, 224, 214, 208, 216, 202, 200, 222, 198, 226, 192, 204, 228, 224, 184, 214, 200, 218, 216, 218, 196, 208, 220, 202, 204, 224, 192, 214, 206, 208, 210, 198, 218, 204, 200, 212, 206, 208, 204, 206, 212, 202, 210, 220, 192, 214, 214, 194, 228, 208, 224, 204, 212, 212, 188, 220, 208, 196, 226, 198, 212, 234, 204, 194, 212, 214, 204, 216, 200, 204, 218, 200, 202, 224, 214, 196, 238, 196, 198, 214, 206, 226, 204, 208, 208, 216, 216, 180, 210, 220, 204, 212, 218, 200, 214, 212, 206, 224, 208, 198, 230, 210, 192, 208, 218, 214, 190, 222, 192, 218, 214, 190, 210, 214, 216, 208, 224, 192, 206, 226, 200, 210, 212, 206, 214, 202, 198, 210, 226, 198, 206, 210, 218, 196, 232, 206, 186, 210, 228, 202, 208}, + {182, 188, 194, 186, 190, 222, 186, 184, 224, 170, 184, 212, 180, 200, 206, 180, 204, 190, 182, 202, 174, 210, 200, 182, 192, 200, 174, 196, 192, 198, 198, 190, 200, 214, 166, 190, 236, 180, 176, 232, 170, 194, 226, 160, 200, 208, 178, 210, 200, 170, 208, 186, 192, 208, 194, 186, 184, 200, 186, 196, 200, 188, 196, 186, 200, 180, 182, 212, 172, 194, 208, 190, 198, 206, 172, 200, 226, 162, 210, 204, 174, 208, 184, 184, 206, 194, 176, 196, 186, 184, 218, 170, 178, 212, 172, 184, 214, 166, 204, 192, 170, 194, 184, 190, 190, 176, 196, 188, 174, 206, 198, 166, 194, 194, 184, 198, 184, 174, 200, 186, 180, 218, 174, 174, 208, 178, 176, 220, 166, 176, 216, 170, 174, 204, 172, 194, 182, 188, 196, 178, 188, 206, 182, 184, 196, 168, 206, 180, 174, 194, 190, 168, 210, 170, 178, 214, 172, 182, 218, 170, 186, 206, 174, 182, 216, 174, 200, 210, 182, 188, 196, 182, 198, 200, 178, 208, 176, 180, 208, 168, 192, 196, 184, 212, 184, 176, 212, 190, 180, 202, 184, 190, 210, 178, 192, 200, 184, 180, 220, 184, 210, 202, 168, 208, 206, 164, 220, 198, 178, 206, 178, 190, 214, 182, 196, 208, 178, 194, 194, 186, 182, 194, 190, 202, 178, 200, 200, 186, 182, 218, 176, 204, 208, 158, 202, 202, 172, 210, 196, 200, 198, 192, 180, 214, 176, 194, 222, 184, 180, 204, 176, 186, 216, 184, 184, 194, 198, 204, 164, 194, 222, 186, 194, 200, 180, 194, 200, 180, 194, 202, 192, 208, 192, 188, 210, 186, 196, 208, 182, 190, 218, 182, 182, 224, 174, 194, 220, 164, 208, 206, 164, 198, 190, 182, 204, 196, 178, 210, 176, 200, 194, 180, 202, 186, 194, 206, 180, 202, 208, 196, 182, 222, 172, 200, 208, 158, 200, 214, 156, 202, 228, 156, 200, 204, 180, 202, 192, 182, 204, 194, 178, 182, 190, 186, 212, 180, 190, 192, 184, 200, 190, 184, 218, 190, 190, 200, 170, 196, 206, 166, 206, 210, 164, 212, 200, 174, 210, 186, 190, 206}, + {180, 206, 180, 186, 180, 180, 198, 198, 166, 206, 196, 162, 204, 190, 188, 202, 174, 198, 188, 190, 184, 172, 194, 206, 180, 178, 202, 178, 172, 196, 184, 170, 192, 180, 180, 194, 166, 182, 198, 172, 200, 186, 170, 206, 192, 182, 200, 184, 190, 192, 196, 174, 186, 192, 198, 178, 182, 194, 192, 154, 192, 196, 166, 204, 192, 170, 206, 180, 178, 184, 174, 188, 186, 180, 192, 178, 158, 198, 180, 182, 200, 170, 186, 188, 182, 172, 190, 190, 170, 198, 164, 196, 190, 158, 198, 186, 162, 206, 176, 166, 192, 186, 170, 182, 184, 186, 178, 166, 176, 178, 166, 196, 170, 172, 186, 174, 168, 192, 164, 174, 190, 164, 182, 184, 166, 194, 178, 166, 196, 168, 178, 198, 178, 170, 200, 178, 186, 178, 178, 184, 184, 178, 172, 186, 166, 194, 174, 168, 182, 188, 168, 202, 166, 182, 188, 184, 184, 174, 180, 196, 184, 182, 184, 182, 166, 194, 178, 176, 208, 184, 176, 206, 170, 188, 198, 168, 192, 206, 150, 186, 196, 162, 200, 172, 196, 206, 170, 184, 182, 196, 188, 190, 174, 204, 194, 176, 188, 200, 160, 204, 186, 170, 196, 180, 178, 204, 160, 198, 200, 172, 194, 188, 186, 202, 184, 176, 214, 184, 176, 208, 188, 176, 186, 186, 192, 184, 166, 180, 202, 176, 178, 184, 180, 212, 176, 176, 200, 172, 188, 188, 172, 200, 198, 192, 182, 176, 180, 204, 184, 176, 212, 178, 168, 200, 194, 172, 198, 188, 174, 200, 168, 200, 190, 168, 206, 200, 166, 192, 186, 166, 196, 186, 178, 188, 178, 176, 190, 184, 186, 182, 174, 200, 194, 158, 200, 194, 160, 212, 188, 182, 202, 182, 180, 194, 192, 186, 190, 184, 202, 176, 172, 210, 188, 172, 196, 178, 180, 184, 172, 162, 200, 182, 182, 188, 176, 186, 184, 178, 206, 192, 168, 196, 196, 166, 192, 202, 180, 182, 180, 194, 202, 178, 190, 194, 172, 210, 186, 178, 200, 180, 176, 194, 182, 174, 202, 180, 180, 188, 184, 196, 178, 176, 200, 178, 184, 186, 184, 176, 192, 188}, + {180, 184, 174, 174, 194, 162, 184, 186, 164, 174, 196, 174, 190, 174, 166, 190, 178, 176, 204, 168, 192, 200, 158, 182, 184, 166, 194, 180, 178, 186, 186, 176, 192, 174, 178, 188, 180, 166, 194, 170, 172, 200, 168, 184, 186, 162, 188, 174, 166, 204, 174, 176, 192, 156, 182, 206, 166, 184, 192, 176, 190, 180, 176, 192, 188, 174, 184, 180, 188, 184, 168, 188, 192, 154, 188, 190, 158, 188, 180, 164, 178, 180, 160, 188, 178, 170, 184, 172, 178, 204, 168, 160, 210, 172, 184, 194, 156, 196, 178, 176, 184, 168, 176, 194, 162, 172, 182, 166, 182, 190, 160, 178, 182, 164, 178, 180, 172, 174, 182, 174, 188, 166, 170, 196, 156, 182, 180, 166, 182, 178, 150, 192, 170, 170, 184, 168, 170, 198, 168, 176, 186, 166, 178, 188, 174, 170, 204, 164, 184, 178, 170, 180, 184, 170, 178, 164, 176, 192, 146, 184, 184, 152, 190, 180, 162, 202, 188, 164, 180, 180, 166, 190, 186, 166, 190, 176, 178, 202, 178, 180, 194, 170, 182, 186, 162, 198, 178, 178, 208, 160, 186, 194, 160, 174, 190, 164, 184, 190, 168, 188, 186, 168, 196, 180, 168, 188, 182, 166, 188, 164, 182, 198, 168, 190, 198, 156, 184, 186, 170, 192, 180, 180, 198, 170, 180, 204, 174, 180, 202, 156, 184, 196, 156, 180, 184, 172, 186, 182, 178, 196, 166, 176, 190, 152, 186, 184, 170, 182, 192, 166, 200, 196, 164, 196, 184, 168, 190, 172, 174, 208, 172, 170, 206, 162, 178, 192, 170, 190, 192, 178, 190, 160, 180, 190, 166, 178, 192, 160, 196, 180, 162, 182, 190, 170, 172, 200, 166, 196, 180, 162, 200, 170, 186, 206, 168, 188, 192, 162, 190, 190, 170, 190, 186, 164, 192, 176, 182, 188, 180, 178, 202, 172, 170, 196, 174, 176, 200, 166, 182, 184, 170, 186, 186, 176, 198, 162, 178, 194, 160, 184, 188, 170, 194, 172, 176, 180, 186, 184, 188, 186, 172, 196, 182, 170, 192, 176, 178, 210, 164, 166, 206, 156, 188, 194, 162, 200, 180, 176, 180, 160}, + {188, 168, 176, 198, 158, 196, 190, 148, 194, 166, 154, 198, 160, 164, 206, 160, 178, 190, 162, 178, 192, 154, 184, 194, 164, 182, 180, 166, 190, 178, 164, 206, 162, 178, 182, 166, 184, 190, 154, 192, 182, 156, 192, 174, 160, 196, 170, 172, 188, 172, 174, 202, 156, 184, 202, 160, 176, 190, 166, 182, 188, 152, 194, 176, 152, 208, 166, 174, 192, 158, 178, 188, 166, 188, 188, 166, 192, 188, 168, 186, 174, 172, 198, 168, 162, 202, 164, 170, 188, 156, 180, 198, 142, 196, 188, 152, 182, 170, 164, 192, 166, 178, 180, 158, 170, 188, 156, 174, 184, 148, 178, 188, 162, 176, 172, 162, 190, 178, 156, 192, 160, 178, 182, 160, 184, 178, 156, 184, 176, 154, 190, 168, 158, 190, 158, 162, 186, 158, 160, 190, 166, 164, 184, 154, 176, 180, 160, 182, 162, 160, 188, 170, 162, 190, 166, 178, 182, 158, 180, 184, 158, 188, 190, 156, 192, 172, 160, 176, 176, 166, 192, 166, 168, 200, 148, 182, 178, 166, 176, 178, 154, 202, 174, 162, 200, 154, 180, 188, 158, 186, 182, 158, 182, 196, 170, 184, 186, 156, 192, 180, 160, 192, 166, 166, 196, 164, 176, 188, 168, 186, 170, 166, 180, 186, 154, 186, 190, 162, 202, 176, 154, 192, 168, 184, 198, 166, 176, 186, 156, 190, 188, 154, 198, 182, 164, 196, 162, 174, 188, 160, 178, 196, 168, 186, 184, 166, 186, 186, 166, 184, 166, 156, 194, 170, 156, 204, 172, 174, 200, 144, 188, 190, 162, 192, 178, 166, 194, 172, 170, 184, 182, 174, 184, 170, 182, 194, 172, 180, 192, 162, 188, 182, 150, 200, 180, 138, 208, 168, 170, 208, 156, 174, 192, 162, 174, 196, 164, 182, 174, 162, 188, 190, 154, 196, 172, 176, 186, 168, 162, 192, 160, 184, 192, 162, 188, 184, 146, 192, 188, 158, 200, 186, 168, 196, 172, 178, 196, 164, 178, 194, 166, 180, 190, 156, 184, 186, 148, 200, 162, 152, 206, 158, 166, 198, 158, 186, 192, 166, 180, 188, 168, 182, 190, 160, 192, 160, 170, 196, 166, 176}, + {162, 188, 178, 176, 174, 186, 160, 184, 176, 176, 182, 174, 182, 174, 170, 186, 172, 176, 176, 170, 168, 180, 176, 166, 182, 176, 164, 184, 174, 166, 182, 162, 182, 172, 164, 182, 170, 162, 186, 172, 176, 180, 180, 166, 184, 174, 170, 180, 178, 176, 184, 164, 180, 188, 154, 188, 180, 164, 186, 174, 166, 178, 168, 176, 180, 162, 176, 172, 174, 184, 174, 180, 168, 184, 158, 176, 178, 156, 186, 174, 164, 176, 172, 186, 176, 164, 180, 188, 158, 184, 176, 160, 194, 174, 166, 172, 176, 170, 174, 160, 176, 168, 166, 172, 180, 164, 174, 178, 156, 174, 174, 152, 184, 162, 162, 176, 160, 162, 176, 162, 178, 166, 160, 164, 180, 162, 170, 168, 174, 178, 166, 162, 180, 164, 174, 176, 156, 180, 178, 150, 170, 178, 152, 184, 178, 150, 190, 164, 164, 174, 168, 170, 166, 152, 172, 176, 164, 170, 170, 168, 176, 172, 154, 178, 174, 156, 194, 164, 172, 170, 174, 180, 180, 164, 178, 174, 168, 174, 178, 164, 186, 170, 176, 190, 178, 174, 172, 160, 180, 178, 160, 180, 180, 154, 180, 190, 158, 186, 170, 174, 188, 166, 182, 180, 166, 180, 178, 162, 186, 184, 164, 182, 174, 164, 188, 174, 168, 184, 174, 168, 192, 166, 180, 158, 168, 186, 164, 166, 182, 182, 158, 188, 160, 178, 182, 168, 174, 182, 178, 180, 188, 164, 162, 188, 152, 186, 178, 174, 196, 172, 182, 172, 174, 194, 174, 172, 182, 166, 164, 186, 166, 176, 170, 178, 160, 174, 178, 164, 178, 176, 174, 176, 178, 174, 172, 168, 184, 172, 170, 178, 162, 172, 182, 178, 174, 190, 174, 180, 174, 160, 192, 178, 168, 168, 180, 158, 186, 180, 158, 184, 184, 160, 186, 170, 178, 172, 170, 178, 180, 172, 176, 158, 166, 188, 162, 172, 184, 174, 172, 180, 174, 164, 188, 166, 168, 180, 178, 176, 182, 154, 186, 180, 158, 184, 172, 176, 190, 160, 188, 170, 176, 184, 178, 166, 182, 174, 160, 180, 174, 166, 180, 180, 164, 176, 174, 176, 190, 160, 176, 184}, + {188, 176, 170, 176, 178, 162, 180, 166, 172, 188, 154, 170, 186, 164, 172, 178, 164, 176, 174, 182, 178, 160, 170, 190, 160, 168, 184, 166, 170, 182, 166, 184, 170, 172, 174, 174, 162, 182, 176, 170, 178, 168, 174, 188, 162, 168, 188, 154, 186, 178, 158, 178, 152, 180, 178, 164, 162, 172, 164, 166, 182, 164, 170, 182, 160, 178, 188, 160, 174, 178, 160, 172, 180, 168, 190, 154, 186, 180, 166, 176, 178, 174, 176, 164, 160, 186, 154, 170, 176, 166, 160, 166, 160, 160, 166, 164, 176, 174, 152, 170, 180, 160, 168, 172, 168, 180, 160, 168, 184, 150, 178, 176, 152, 180, 172, 154, 176, 174, 156, 172, 166, 164, 174, 168, 154, 176, 168, 154, 176, 158, 164, 172, 156, 176, 166, 168, 166, 168, 156, 190, 148, 170, 184, 156, 164, 176, 146, 170, 178, 150, 174, 190, 146, 188, 180, 152, 170, 176, 160, 178, 174, 154, 190, 150, 182, 176, 148, 178, 162, 176, 168, 172, 170, 172, 164, 172, 182, 154, 168, 180, 162, 170, 178, 162, 174, 182, 152, 190, 178, 172, 178, 170, 176, 184, 168, 174, 184, 166, 180, 172, 160, 182, 172, 166, 184, 172, 162, 188, 164, 176, 176, 170, 172, 192, 150, 172, 184, 152, 178, 178, 154, 178, 170, 172, 174, 180, 180, 172, 166, 176, 186, 164, 174, 176, 154, 182, 182, 158, 182, 168, 158, 196, 168, 168, 192, 160, 162, 176, 162, 164, 176, 174, 170, 160, 174, 174, 170, 166, 174, 166, 184, 178, 170, 178, 186, 156, 186, 182, 154, 176, 178, 162, 188, 186, 164, 190, 166, 178, 174, 168, 178, 176, 162, 172, 174, 170, 164, 172, 162, 182, 162, 166, 174, 166, 164, 194, 162, 176, 186, 152, 180, 186, 168, 168, 182, 164, 174, 188, 158, 176, 174, 180, 184, 164, 184, 172, 166, 178, 182, 150, 178, 178, 164, 178, 164, 178, 174, 164, 160, 194, 164, 178, 186, 172, 160, 178, 170, 166, 176, 178, 170, 180, 168, 178, 168, 178, 178, 168, 176, 180, 158, 182, 174, 170, 170, 188, 154, 186, 168, 162}, + {180, 148, 180, 170, 164, 184, 162, 180, 186, 144, 180, 178, 154, 182, 170, 150, 196, 170, 154, 176, 162, 162, 180, 148, 182, 186, 152, 168, 178, 154, 176, 182, 142, 194, 168, 158, 188, 174, 170, 176, 160, 168, 182, 156, 182, 184, 150, 176, 170, 150, 182, 184, 162, 166, 186, 150, 196, 164, 178, 178, 166, 174, 174, 154, 186, 180, 132, 196, 162, 154, 188, 172, 154, 190, 156, 164, 182, 158, 168, 196, 148, 176, 182, 156, 182, 192, 142, 172, 196, 142, 186, 166, 174, 184, 152, 180, 176, 148, 184, 174, 146, 180, 170, 148, 190, 162, 158, 172, 162, 148, 182, 150, 168, 184, 152, 178, 172, 146, 172, 172, 148, 182, 166, 158, 178, 158, 178, 178, 134, 172, 180, 158, 166, 188, 140, 180, 174, 136, 182, 174, 140, 182, 162, 146, 182, 156, 174, 174, 148, 180, 164, 144, 186, 158, 156, 168, 172, 154, 182, 156, 166, 184, 150, 170, 180, 160, 174, 178, 152, 188, 182, 136, 168, 174, 154, 166, 180, 160, 170, 160, 176, 180, 158, 172, 188, 148, 188, 172, 144, 186, 176, 148, 176, 180, 150, 184, 166, 166, 184, 144, 190, 184, 152, 190, 172, 160, 176, 178, 160, 180, 170, 158, 182, 162, 190, 176, 146, 176, 186, 156, 170, 190, 148, 178, 178, 140, 198, 162, 160, 174, 168, 168, 186, 148, 190, 172, 150, 196, 178, 158, 184, 168, 164, 180, 168, 164, 180, 164, 186, 188, 150, 198, 164, 164, 168, 182, 154, 188, 174, 156, 174, 162, 166, 172, 158, 176, 166, 150, 190, 174, 148, 186, 180, 144, 180, 162, 166, 178, 166, 164, 178, 168, 172, 190, 162, 180, 180, 156, 192, 176, 160, 188, 170, 156, 182, 164, 170, 182, 158, 172, 168, 160, 186, 180, 146, 182, 174, 142, 192, 178, 156, 182, 164, 162, 184, 166, 176, 178, 150, 180, 176, 156, 180, 176, 168, 170, 190, 160, 184, 180, 164, 172, 168, 166, 182, 158, 182, 180, 142, 190, 170, 136, 186, 174, 148, 190, 158, 158, 184, 166, 164, 180, 166, 178, 174, 156, 168, 186, 148, 180}, + {150, 186, 180, 152, 168, 170, 168, 164, 160, 172, 178, 156, 178, 180, 152, 178, 180, 146, 196, 172, 156, 186, 168, 156, 184, 154, 172, 182, 170, 182, 170, 162, 174, 178, 154, 170, 174, 154, 174, 166, 164, 180, 164, 168, 170, 158, 174, 188, 152, 186, 174, 156, 186, 168, 150, 190, 156, 166, 192, 158, 168, 184, 162, 174, 178, 154, 186, 178, 154, 182, 180, 148, 184, 166, 150, 188, 166, 170, 174, 162, 172, 170, 166, 168, 164, 158, 178, 178, 154, 186, 162, 164, 172, 166, 174, 166, 160, 166, 182, 158, 166, 176, 142, 182, 172, 140, 200, 158, 152, 182, 162, 148, 180, 156, 160, 174, 156, 176, 168, 146, 170, 176, 146, 172, 168, 144, 170, 164, 154, 180, 154, 162, 164, 144, 172, 168, 148, 180, 164, 144, 194, 158, 148, 178, 166, 150, 170, 158, 166, 164, 156, 174, 174, 152, 170, 164, 144, 184, 172, 138, 188, 154, 148, 184, 154, 164, 168, 150, 164, 170, 150, 178, 166, 162, 180, 166, 156, 176, 160, 170, 168, 168, 170, 174, 156, 180, 170, 154, 194, 164, 150, 206, 162, 152, 202, 162, 150, 180, 168, 166, 176, 162, 146, 186, 146, 172, 176, 144, 188, 176, 146, 184, 160, 166, 178, 152, 166, 186, 158, 170, 180, 152, 182, 172, 156, 184, 170, 158, 190, 172, 162, 184, 164, 160, 180, 154, 180, 170, 146, 188, 176, 152, 194, 160, 156, 196, 168, 150, 184, 154, 154, 170, 168, 172, 176, 158, 168, 184, 146, 188, 174, 158, 186, 170, 168, 186, 164, 158, 186, 158, 172, 174, 158, 194, 164, 152, 190, 166, 156, 194, 170, 160, 180, 156, 170, 170, 164, 174, 170, 160, 176, 178, 142, 184, 184, 134, 194, 168, 150, 174, 172, 168, 164, 166, 168, 174, 164, 174, 170, 154, 178, 170, 164, 178, 170, 168, 174, 170, 160, 180, 158, 184, 174, 158, 174, 178, 142, 188, 158, 156, 188, 158, 158, 180, 160, 174, 168, 166, 164, 188, 170, 174, 178, 158, 170, 172, 154, 184, 174, 160, 182, 176, 162, 166, 166, 168, 184, 160, 182, 176}, + {166, 170, 154, 182, 180, 156, 188, 166, 164, 182, 154, 162, 186, 146, 172, 188, 152, 172, 182, 150, 172, 182, 158, 176, 174, 164, 176, 156, 160, 172, 142, 184, 170, 148, 178, 172, 156, 180, 168, 150, 190, 172, 164, 188, 166, 164, 182, 160, 156, 182, 156, 166, 176, 158, 174, 164, 170, 174, 162, 160, 186, 150, 170, 176, 150, 172, 176, 156, 172, 180, 146, 188, 170, 150, 188, 170, 156, 180, 162, 160, 178, 162, 178, 172, 156, 180, 170, 152, 178, 168, 162, 182, 160, 164, 192, 150, 164, 170, 148, 160, 180, 146, 180, 172, 150, 162, 170, 150, 168, 172, 154, 178, 162, 156, 174, 146, 162, 168, 144, 178, 178, 138, 182, 148, 152, 178, 150, 150, 180, 160, 150, 172, 164, 164, 178, 152, 158, 176, 146, 172, 166, 152, 174, 168, 148, 176, 156, 152, 184, 156, 160, 168, 146, 162, 170, 142, 174, 160, 152, 178, 172, 138, 178, 162, 156, 170, 168, 160, 188, 150, 170, 176, 150, 172, 160, 160, 172, 170, 158, 182, 152, 164, 172, 168, 158, 178, 144, 176, 182, 150, 182, 172, 158, 174, 178, 148, 182, 168, 162, 184, 152, 170, 188, 154, 176, 178, 168, 176, 178, 166, 172, 174, 158, 186, 162, 164, 190, 156, 162, 182, 148, 164, 184, 152, 162, 190, 146, 170, 168, 156, 170, 168, 148, 180, 160, 170, 188, 166, 170, 176, 148, 178, 166, 162, 172, 164, 158, 180, 166, 156, 192, 158, 168, 186, 152, 182, 170, 158, 166, 180, 150, 184, 164, 168, 172, 160, 174, 180, 170, 156, 174, 160, 166, 168, 164, 168, 184, 146, 192, 162, 150, 182, 170, 148, 188, 146, 162, 192, 154, 180, 172, 160, 174, 172, 158, 176, 168, 166, 180, 174, 156, 186, 148, 174, 180, 158, 170, 172, 156, 180, 172, 148, 182, 174, 160, 172, 164, 160, 184, 172, 144, 178, 154, 166, 178, 156, 172, 164, 166, 164, 186, 156, 180, 164, 166, 174, 156, 172, 186, 142, 172, 180, 140, 190, 174, 156, 176, 174, 156, 176, 164, 152, 178, 162, 164, 174, 156, 164, 170, 164}, + {178, 136, 184, 172, 138, 170, 178, 144, 178, 162, 164, 168, 172, 152, 174, 152, 172, 166, 160, 174, 176, 152, 168, 176, 140, 172, 168, 164, 168, 178, 166, 174, 164, 164, 182, 162, 164, 190, 146, 168, 176, 152, 172, 164, 162, 170, 168, 162, 166, 162, 170, 172, 148, 180, 162, 148, 174, 168, 158, 168, 174, 152, 170, 158, 168, 180, 170, 162, 182, 158, 166, 176, 158, 174, 164, 158, 168, 172, 160, 182, 162, 162, 158, 168, 162, 174, 170, 166, 166, 154, 172, 176, 150, 164, 164, 150, 180, 166, 158, 170, 162, 164, 168, 156, 172, 168, 154, 180, 158, 168, 158, 178, 146, 172, 164, 160, 172, 152, 164, 174, 154, 158, 172, 150, 168, 168, 158, 164, 176, 146, 172, 148, 174, 158, 168, 162, 156, 164, 170, 162, 154, 172, 166, 144, 168, 172, 152, 172, 166, 146, 166, 160, 154, 178, 164, 166, 174, 146, 168, 174, 142, 166, 178, 156, 172, 166, 158, 160, 160, 164, 162, 160, 166, 180, 150, 174, 164, 144, 168, 170, 164, 166, 176, 158, 176, 164, 168, 164, 166, 176, 168, 158, 184, 172, 154, 170, 172, 166, 164, 182, 150, 168, 176, 158, 170, 164, 154, 176, 138, 170, 182, 142, 166, 186, 148, 174, 168, 160, 170, 162, 180, 162, 154, 180, 168, 158, 170, 174, 172, 158, 184, 160, 172, 182, 156, 180, 164, 154, 176, 156, 168, 182, 158, 176, 184, 142, 176, 170, 154, 172, 170, 156, 174, 164, 166, 168, 160, 170, 168, 166, 154, 188, 150, 174, 174, 154, 170, 176, 158, 176, 170, 164, 176, 142, 182, 176, 144, 170, 174, 156, 176, 166, 160, 172, 178, 150, 180, 166, 156, 164, 172, 162, 172, 156, 162, 190, 140, 176, 170, 156, 168, 174, 156, 170, 166, 162, 176, 164, 160, 182, 150, 178, 182, 152, 174, 172, 154, 168, 184, 152, 178, 170, 170, 170, 164, 170, 172, 150, 180, 166, 154, 184, 166, 150, 168, 168, 160, 170, 164, 166, 182, 168, 160, 184, 154, 170, 168, 162, 164, 184, 146, 178, 172, 160, 170, 178, 168, 172, 166, 170}, + {166, 164, 164, 160, 164, 172, 156, 178, 166, 150, 190, 166, 152, 182, 168, 154, 178, 174, 158, 170, 154, 180, 160, 170, 174, 174, 158, 168, 166, 164, 168, 162, 166, 162, 160, 162, 164, 156, 172, 160, 156, 178, 162, 160, 180, 162, 154, 188, 162, 160, 178, 152, 164, 174, 166, 172, 178, 162, 172, 172, 164, 166, 174, 154, 174, 170, 150, 182, 166, 156, 172, 150, 180, 166, 152, 184, 166, 154, 180, 166, 144, 180, 154, 168, 178, 152, 170, 168, 156, 180, 168, 162, 178, 172, 164, 180, 160, 150, 186, 164, 152, 174, 164, 156, 166, 152, 164, 172, 140, 170, 154, 150, 172, 170, 146, 172, 154, 148, 178, 156, 158, 164, 156, 158, 158, 152, 166, 158, 142, 176, 154, 148, 178, 160, 150, 172, 164, 154, 174, 156, 168, 166, 142, 170, 164, 150, 166, 162, 152, 176, 148, 156, 166, 162, 150, 156, 158, 158, 168, 140, 172, 168, 132, 180, 160, 148, 170, 168, 144, 182, 144, 166, 160, 160, 168, 152, 160, 170, 156, 174, 166, 164, 150, 176, 168, 146, 186, 164, 158, 174, 156, 176, 174, 144, 172, 174, 138, 182, 156, 154, 184, 166, 152, 174, 154, 158, 178, 168, 168, 168, 160, 162, 174, 158, 180, 168, 154, 188, 160, 156, 184, 166, 162, 184, 152, 176, 174, 148, 178, 160, 150, 182, 154, 152, 168, 172, 150, 182, 158, 168, 164, 160, 162, 168, 158, 156, 188, 154, 170, 174, 138, 180, 168, 158, 176, 156, 168, 180, 162, 166, 170, 162, 172, 162, 154, 178, 172, 158, 186, 160, 152, 168, 174, 162, 176, 156, 156, 188, 152, 170, 174, 150, 182, 164, 140, 194, 158, 160, 186, 162, 172, 168, 166, 168, 166, 164, 172, 172, 156, 154, 174, 170, 172, 170, 160, 176, 158, 154, 184, 158, 166, 172, 160, 174, 164, 158, 186, 152, 148, 188, 162, 152, 184, 156, 156, 168, 164, 168, 156, 166, 182, 158, 164, 160, 184, 152, 172, 172, 158, 184, 152, 160, 170, 164, 172, 172, 156, 178, 162, 152, 188, 162, 150, 178, 158, 158, 176, 156, 164, 160}, + {154, 178, 178, 138, 180, 168, 148, 172, 174, 164, 172, 162, 164, 176, 148, 168, 172, 154, 164, 176, 162, 170, 160, 156, 182, 162, 158, 176, 150, 170, 166, 160, 172, 174, 140, 186, 178, 146, 182, 176, 152, 186, 164, 166, 172, 152, 166, 178, 146, 178, 174, 150, 176, 170, 146, 178, 150, 152, 172, 162, 156, 178, 152, 162, 174, 156, 172, 182, 148, 178, 174, 150, 190, 172, 152, 174, 158, 164, 178, 142, 160, 190, 148, 182, 172, 140, 178, 174, 138, 190, 164, 144, 174, 160, 154, 168, 160, 152, 168, 148, 176, 170, 144, 170, 172, 144, 170, 158, 148, 172, 162, 150, 174, 148, 160, 178, 140, 178, 164, 138, 178, 164, 140, 176, 164, 152, 172, 150, 156, 160, 164, 158, 156, 158, 162, 168, 148, 160, 168, 144, 178, 162, 142, 182, 158, 146, 164, 150, 156, 168, 150, 158, 164, 148, 168, 164, 150, 172, 162, 152, 176, 166, 148, 166, 156, 158, 168, 158, 156, 170, 148, 170, 170, 148, 174, 182, 138, 180, 156, 144, 176, 150, 166, 168, 156, 162, 166, 158, 172, 168, 154, 180, 162, 162, 180, 164, 160, 188, 162, 162, 172, 146, 176, 186, 144, 188, 156, 156, 174, 162, 156, 170, 162, 154, 184, 154, 156, 182, 152, 164, 178, 162, 150, 176, 152, 166, 188, 140, 180, 170, 148, 180, 160, 172, 170, 154, 168, 178, 152, 180, 170, 150, 176, 168, 168, 170, 162, 162, 176, 152, 166, 174, 152, 164, 172, 154, 170, 176, 138, 174, 170, 144, 182, 166, 156, 178, 150, 170, 168, 152, 164, 174, 152, 168, 168, 150, 170, 170, 144, 182, 166, 156, 174, 152, 172, 176, 160, 162, 170, 160, 170, 162, 152, 186, 162, 160, 178, 156, 168, 184, 152, 160, 176, 150, 170, 172, 144, 160, 184, 142, 172, 172, 142, 184, 162, 162, 186, 162, 162, 184, 152, 172, 172, 150, 176, 170, 152, 186, 162, 148, 172, 166, 162, 172, 158, 158, 178, 152, 168, 176, 142, 172, 180, 132, 180, 172, 142, 188, 162, 158, 172, 162, 152, 178, 142, 184, 174, 144, 176, 170}, + {158, 174, 152, 170, 156, 156, 174, 160, 156, 158, 156, 158, 170, 160, 152, 176, 156, 172, 178, 150, 172, 184, 150, 172, 166, 150, 180, 156, 162, 178, 160, 160, 168, 152, 176, 166, 148, 168, 168, 152, 164, 160, 158, 168, 160, 144, 176, 160, 152, 182, 144, 170, 184, 158, 162, 170, 156, 176, 156, 162, 170, 164, 168, 180, 156, 166, 172, 150, 164, 170, 150, 168, 158, 154, 170, 162, 154, 172, 170, 156, 172, 154, 156, 174, 160, 168, 174, 150, 160, 170, 160, 160, 170, 164, 178, 154, 158, 180, 164, 160, 176, 154, 154, 174, 150, 162, 166, 166, 164, 160, 150, 170, 156, 154, 168, 152, 158, 166, 150, 166, 158, 148, 160, 156, 154, 162, 158, 154, 172, 154, 150, 162, 160, 146, 176, 154, 144, 168, 164, 156, 164, 148, 162, 166, 148, 180, 158, 156, 168, 160, 156, 180, 140, 168, 166, 150, 164, 160, 152, 176, 148, 146, 166, 158, 158, 164, 164, 146, 180, 154, 144, 164, 156, 164, 148, 158, 176, 156, 154, 180, 156, 166, 184, 150, 166, 188, 154, 162, 186, 148, 176, 166, 166, 156, 164, 166, 168, 160, 152, 174, 156, 162, 170, 158, 156, 170, 154, 166, 166, 154, 178, 156, 156, 186, 160, 164, 178, 152, 154, 178, 162, 158, 184, 162, 168, 166, 162, 160, 158, 160, 166, 174, 158, 186, 142, 168, 174, 160, 160, 170, 146, 174, 164, 154, 174, 156, 162, 186, 150, 160, 174, 164, 162, 176, 162, 156, 178, 150, 164, 178, 160, 164, 172, 150, 190, 154, 164, 180, 158, 158, 186, 148, 158, 176, 158, 182, 168, 152, 174, 162, 160, 162, 164, 166, 172, 156, 150, 180, 154, 156, 180, 158, 166, 178, 146, 164, 176, 160, 172, 154, 154, 192, 142, 162, 182, 158, 166, 182, 156, 172, 162, 156, 184, 164, 152, 166, 160, 152, 168, 168, 146, 184, 156, 162, 176, 154, 158, 168, 152, 170, 160, 156, 178, 144, 168, 180, 162, 164, 170, 168, 164, 170, 158, 176, 168, 156, 174, 172, 148, 168, 172, 150, 188, 160, 158, 176, 156, 168, 178, 156}, + {188, 162, 148, 184, 162, 162, 176, 154, 172, 170, 162, 174, 178, 158, 176, 178, 142, 176, 176, 146, 172, 162, 148, 176, 152, 166, 174, 150, 168, 178, 134, 172, 186, 122, 184, 162, 154, 172, 160, 158, 180, 164, 160, 182, 156, 170, 184, 154, 172, 170, 148, 172, 170, 140, 178, 172, 146, 174, 160, 162, 170, 142, 174, 170, 148, 172, 174, 138, 178, 172, 148, 188, 154, 160, 176, 160, 154, 182, 148, 166, 190, 138, 174, 178, 136, 180, 168, 148, 172, 176, 152, 182, 164, 152, 186, 152, 170, 174, 144, 174, 170, 148, 174, 170, 138, 178, 158, 156, 164, 158, 154, 166, 138, 164, 164, 132, 180, 166, 132, 172, 170, 134, 182, 164, 144, 166, 156, 152, 170, 156, 162, 164, 146, 174, 166, 142, 172, 170, 130, 182, 166, 142, 174, 152, 150, 172, 136, 160, 174, 128, 174, 162, 142, 166, 162, 132, 170, 158, 148, 162, 158, 154, 172, 136, 164, 168, 132, 164, 178, 132, 174, 182, 132, 182, 166, 144, 180, 158, 154, 176, 156, 146, 176, 146, 168, 162, 150, 174, 170, 144, 170, 168, 144, 176, 158, 162, 170, 146, 172, 176, 140, 174, 176, 142, 180, 168, 152, 172, 174, 146, 180, 166, 154, 180, 150, 160, 180, 154, 180, 162, 140, 182, 168, 144, 170, 176, 148, 194, 156, 150, 168, 158, 166, 166, 148, 166, 174, 136, 178, 180, 144, 172, 170, 154, 176, 162, 150, 176, 164, 168, 176, 130, 176, 172, 138, 176, 176, 144, 172, 168, 152, 174, 166, 150, 178, 152, 162, 172, 146, 160, 178, 144, 180, 166, 142, 174, 170, 156, 176, 160, 162, 162, 160, 172, 168, 152, 170, 182, 140, 176, 176, 140, 176, 168, 148, 188, 162, 134, 186, 156, 162, 180, 144, 168, 182, 138, 176, 168, 148, 170, 168, 140, 170, 164, 162, 182, 156, 158, 174, 156, 170, 170, 150, 170, 172, 144, 182, 168, 142, 180, 180, 152, 166, 158, 168, 174, 154, 166, 176, 138, 174, 186, 138, 176, 166, 150, 180, 162, 148, 178, 158, 162, 174, 136, 174, 174, 136, 174, 168, 136}, + {174, 160, 168, 168, 158, 156, 168, 160, 164, 160, 156, 176, 136, 162, 174, 150, 166, 174, 148, 168, 172, 150, 174, 176, 152, 172, 160, 160, 166, 160, 170, 176, 140, 164, 180, 160, 158, 178, 156, 154, 172, 162, 164, 164, 152, 174, 150, 152, 176, 152, 156, 178, 156, 174, 164, 158, 164, 166, 166, 156, 154, 166, 180, 146, 168, 174, 146, 164, 172, 158, 160, 176, 152, 162, 178, 156, 166, 160, 158, 170, 148, 166, 176, 156, 164, 172, 148, 160, 178, 156, 162, 176, 154, 170, 152, 152, 172, 154, 160, 170, 142, 158, 170, 138, 172, 168, 146, 156, 160, 164, 164, 164, 156, 164, 148, 166, 172, 146, 162, 166, 140, 148, 172, 152, 156, 166, 152, 160, 160, 160, 162, 160, 144, 160, 150, 162, 174, 142, 154, 172, 138, 164, 160, 152, 156, 158, 162, 166, 136, 166, 174, 140, 158, 168, 146, 162, 172, 156, 158, 174, 152, 160, 174, 154, 166, 152, 158, 176, 140, 166, 172, 136, 158, 170, 146, 158, 156, 162, 164, 156, 156, 176, 158, 160, 172, 162, 158, 170, 158, 158, 180, 158, 166, 174, 156, 172, 170, 160, 178, 158, 160, 180, 142, 168, 178, 144, 168, 168, 158, 156, 166, 166, 158, 162, 168, 170, 154, 168, 166, 160, 156, 168, 152, 158, 178, 144, 162, 170, 158, 168, 166, 152, 168, 162, 176, 162, 150, 176, 170, 146, 174, 168, 154, 154, 180, 150, 174, 162, 156, 166, 164, 166, 180, 154, 164, 182, 150, 172, 168, 142, 174, 170, 150, 168, 166, 168, 168, 160, 170, 172, 150, 168, 160, 166, 156, 174, 156, 158, 174, 158, 160, 182, 148, 170, 158, 166, 170, 154, 166, 184, 144, 170, 170, 144, 166, 164, 150, 174, 166, 154, 170, 158, 166, 176, 144, 160, 178, 142, 158, 176, 162, 156, 178, 150, 172, 172, 154, 170, 160, 156, 176, 156, 168, 164, 160, 170, 164, 152, 168, 166, 146, 162, 174, 148, 172, 160, 164, 174, 150, 160, 182, 146, 162, 184, 152, 156, 170, 152, 174, 164, 156, 166, 160, 164, 170, 162, 172, 172, 158, 160}, + {168, 136, 170, 158, 148, 190, 170, 138, 172, 164, 160, 164, 154, 170, 176, 138, 178, 178, 146, 174, 174, 142, 174, 158, 150, 168, 158, 162, 176, 150, 164, 166, 152, 172, 164, 142, 184, 168, 138, 174, 166, 144, 174, 164, 158, 176, 146, 164, 176, 142, 182, 168, 136, 174, 170, 140, 190, 158, 142, 180, 166, 160, 166, 156, 166, 178, 142, 186, 170, 140, 180, 170, 138, 168, 164, 148, 182, 156, 154, 184, 146, 168, 174, 138, 174, 172, 142, 172, 178, 130, 180, 154, 144, 176, 170, 152, 172, 162, 168, 176, 142, 182, 170, 140, 182, 166, 130, 180, 168, 142, 166, 156, 142, 168, 160, 152, 168, 140, 174, 158, 140, 176, 152, 142, 170, 170, 128, 170, 158, 140, 182, 146, 156, 170, 140, 170, 166, 142, 184, 158, 128, 188, 166, 142, 184, 146, 146, 168, 156, 158, 170, 138, 176, 164, 134, 172, 162, 136, 162, 160, 138, 170, 156, 144, 174, 150, 160, 160, 136, 168, 160, 134, 176, 166, 136, 172, 172, 132, 180, 156, 156, 162, 156, 162, 166, 154, 178, 168, 140, 190, 170, 132, 178, 168, 126, 176, 160, 148, 178, 154, 158, 178, 146, 170, 170, 148, 176, 176, 136, 172, 162, 150, 178, 162, 154, 170, 156, 170, 172, 142, 170, 174, 150, 174, 176, 142, 180, 176, 132, 186, 164, 152, 172, 152, 162, 172, 152, 172, 168, 144, 186, 164, 142, 176, 162, 148, 160, 172, 140, 180, 160, 150, 178, 144, 166, 176, 124, 176, 176, 142, 182, 166, 146, 178, 162, 146, 176, 152, 170, 164, 148, 178, 160, 144, 172, 158, 150, 176, 176, 130, 182, 166, 140, 174, 160, 148, 172, 150, 178, 172, 138, 184, 178, 138, 186, 172, 144, 180, 164, 154, 176, 156, 166, 166, 150, 182, 166, 156, 178, 170, 130, 190, 172, 142, 176, 168, 140, 176, 156, 156, 172, 146, 166, 174, 134, 180, 172, 144, 192, 166, 148, 178, 162, 154, 164, 164, 152, 174, 162, 168, 170, 140, 180, 174, 128, 188, 168, 142, 178, 164, 146, 176, 162, 154, 182, 138, 168, 170, 140, 174}, + {156, 172, 162, 154, 178, 162, 140, 186, 168, 146, 172, 170, 154, 166, 158, 166, 168, 152, 162, 174, 148, 168, 170, 142, 180, 158, 156, 178, 152, 152, 168, 164, 164, 170, 162, 164, 152, 150, 176, 166, 144, 180, 164, 144, 178, 164, 156, 172, 154, 164, 164, 154, 166, 176, 150, 178, 156, 154, 172, 170, 146, 174, 168, 148, 162, 160, 158, 160, 160, 160, 162, 144, 182, 166, 138, 172, 164, 134, 176, 162, 152, 178, 160, 174, 156, 150, 174, 158, 152, 184, 162, 152, 190, 168, 144, 178, 164, 138, 172, 152, 156, 164, 154, 168, 162, 146, 170, 164, 140, 168, 172, 138, 172, 146, 146, 166, 162, 148, 150, 162, 158, 160, 142, 172, 158, 142, 174, 166, 140, 176, 150, 144, 176, 150, 160, 166, 142, 176, 144, 160, 166, 154, 136, 170, 156, 148, 158, 160, 142, 158, 156, 154, 154, 152, 160, 162, 150, 156, 176, 144, 166, 168, 136, 170, 158, 150, 168, 154, 150, 162, 150, 174, 154, 142, 174, 158, 144, 176, 158, 148, 170, 170, 144, 172, 160, 162, 168, 154, 154, 162, 160, 166, 178, 154, 184, 160, 146, 174, 160, 148, 168, 160, 160, 162, 172, 154, 160, 148, 180, 164, 152, 176, 164, 146, 176, 168, 148, 176, 162, 164, 170, 148, 168, 162, 148, 172, 154, 144, 182, 162, 146, 178, 162, 156, 170, 156, 148, 170, 168, 154, 168, 152, 168, 176, 142, 176, 174, 144, 176, 168, 150, 184, 152, 166, 164, 168, 172, 156, 156, 178, 156, 144, 182, 172, 136, 188, 166, 146, 162, 164, 150, 164, 156, 168, 166, 154, 166, 162, 148, 174, 180, 142, 178, 154, 152, 174, 168, 158, 164, 168, 162, 166, 156, 168, 160, 142, 174, 164, 142, 170, 158, 150, 172, 166, 150, 164, 166, 158, 162, 148, 178, 158, 146, 158, 176, 138, 182, 172, 142, 178, 164, 148, 168, 168, 154, 180, 146, 166, 164, 150, 166, 166, 152, 182, 164, 146, 172, 174, 154, 172, 158, 162, 162, 152, 176, 152, 148, 168, 166, 140, 182, 166, 148, 180, 164, 158, 162, 162, 158, 170}, + {138, 156, 184, 144, 174, 166, 152, 160, 160, 156, 168, 154, 166, 184, 148, 154, 182, 132, 164, 188, 138, 162, 172, 146, 164, 166, 148, 164, 154, 154, 180, 150, 158, 176, 144, 166, 176, 160, 160, 172, 158, 168, 176, 142, 176, 162, 144, 182, 148, 160, 172, 142, 164, 172, 136, 170, 170, 154, 164, 164, 148, 178, 150, 162, 180, 146, 162, 180, 144, 162, 184, 146, 164, 174, 152, 170, 168, 154, 172, 162, 156, 174, 152, 154, 182, 146, 164, 182, 144, 156, 182, 150, 156, 168, 146, 176, 160, 158, 174, 148, 154, 178, 148, 154, 174, 146, 152, 184, 140, 160, 158, 158, 160, 170, 148, 174, 138, 156, 180, 130, 158, 174, 138, 154, 172, 150, 150, 160, 144, 168, 166, 142, 168, 154, 148, 172, 144, 156, 168, 140, 158, 182, 132, 162, 166, 146, 160, 156, 146, 174, 140, 162, 174, 144, 152, 164, 152, 154, 170, 144, 164, 162, 146, 174, 162, 142, 174, 158, 148, 178, 128, 160, 166, 138, 156, 172, 146, 148, 164, 156, 166, 154, 152, 188, 144, 156, 182, 144, 160, 182, 142, 160, 178, 130, 166, 174, 142, 178, 160, 158, 172, 160, 156, 182, 138, 172, 188, 148, 160, 174, 148, 156, 170, 154, 180, 164, 146, 178, 142, 154, 178, 146, 156, 176, 140, 170, 164, 148, 164, 176, 148, 166, 170, 156, 168, 156, 150, 188, 140, 164, 182, 140, 172, 174, 154, 158, 170, 146, 168, 158, 148, 176, 146, 158, 182, 144, 150, 192, 140, 160, 172, 158, 148, 184, 146, 166, 158, 160, 174, 154, 160, 188, 140, 154, 180, 148, 166, 174, 154, 160, 166, 144, 170, 166, 158, 182, 142, 162, 186, 142, 158, 188, 134, 166, 170, 144, 162, 180, 144, 156, 170, 152, 174, 154, 166, 188, 138, 164, 174, 150, 160, 174, 152, 184, 176, 148, 166, 168, 146, 174, 156, 156, 180, 142, 154, 186, 140, 170, 174, 148, 166, 180, 152, 158, 156, 162, 170, 152, 158, 176, 142, 166, 174, 144, 152, 192, 148, 156, 172, 146, 156, 176, 138, 172, 160, 156, 182, 144, 168, 172}, + {142, 188, 146, 150, 172, 146, 162, 170, 162, 170, 164, 150, 176, 138, 154, 184, 158, 160, 176, 158, 156, 176, 152, 162, 168, 152, 164, 166, 156, 174, 162, 138, 186, 154, 154, 186, 148, 156, 168, 152, 154, 176, 146, 188, 150, 148, 190, 156, 148, 188, 150, 154, 168, 164, 150, 170, 160, 156, 170, 156, 166, 158, 152, 180, 146, 160, 190, 152, 152, 184, 154, 148, 178, 150, 160, 170, 144, 180, 154, 154, 174, 160, 148, 176, 160, 158, 178, 150, 150, 186, 150, 160, 180, 154, 168, 158, 156, 176, 146, 154, 192, 144, 152, 178, 160, 140, 176, 146, 162, 166, 158, 160, 160, 134, 164, 154, 156, 176, 154, 142, 174, 130, 150, 176, 142, 152, 166, 142, 168, 144, 144, 172, 146, 150, 178, 150, 152, 164, 148, 142, 172, 146, 152, 164, 136, 162, 158, 144, 166, 144, 154, 174, 148, 146, 184, 142, 146, 180, 158, 144, 160, 150, 166, 152, 140, 172, 146, 146, 170, 144, 152, 164, 150, 148, 172, 140, 146, 176, 138, 164, 152, 156, 172, 156, 158, 174, 148, 150, 186, 154, 156, 186, 156, 160, 172, 146, 176, 154, 148, 172, 166, 146, 170, 150, 156, 178, 144, 156, 184, 140, 162, 174, 150, 166, 162, 146, 184, 152, 160, 184, 150, 148, 186, 152, 150, 178, 160, 158, 170, 150, 166, 168, 150, 172, 162, 150, 178, 150, 160, 184, 156, 150, 190, 138, 162, 174, 144, 166, 164, 140, 180, 148, 138, 192, 150, 152, 182, 156, 162, 170, 164, 146, 170, 156, 172, 164, 154, 166, 162, 150, 176, 156, 150, 190, 152, 140, 182, 148, 162, 180, 148, 176, 174, 150, 172, 140, 160, 174, 144, 158, 180, 156, 158, 180, 150, 154, 176, 140, 164, 174, 150, 168, 156, 150, 174, 150, 146, 192, 154, 150, 180, 154, 156, 164, 146, 176, 168, 146, 182, 158, 144, 182, 146, 152, 178, 158, 150, 178, 158, 146, 180, 142, 162, 170, 142, 170, 152, 156, 186, 146, 152, 192, 142, 158, 178, 146, 164, 170, 154, 156, 178, 146, 178, 160, 148, 168, 162, 152, 176, 158}, + {164, 162, 152, 164, 162, 154, 162, 168, 146, 164, 174, 150, 168, 168, 160, 152, 166, 164, 152, 158, 172, 166, 142, 164, 180, 148, 154, 184, 140, 154, 172, 154, 162, 158, 158, 166, 156, 168, 164, 152, 172, 164, 150, 162, 182, 146, 154, 174, 148, 152, 164, 162, 152, 154, 172, 168, 146, 160, 178, 144, 160, 178, 150, 158, 176, 150, 162, 168, 154, 170, 154, 176, 152, 146, 166, 166, 150, 166, 160, 146, 156, 178, 146, 168, 166, 154, 158, 164, 164, 164, 150, 166, 172, 146, 172, 176, 152, 158, 170, 146, 156, 166, 158, 160, 152, 174, 162, 150, 168, 162, 138, 160, 166, 148, 162, 170, 146, 146, 160, 148, 148, 170, 150, 154, 148, 160, 164, 142, 160, 170, 146, 156, 170, 152, 158, 172, 150, 148, 164, 154, 160, 150, 168, 166, 142, 160, 170, 140, 156, 168, 142, 150, 164, 146, 150, 160, 164, 152, 150, 174, 160, 146, 152, 166, 152, 158, 178, 136, 158, 172, 148, 158, 158, 152, 156, 154, 172, 156, 148, 160, 168, 148, 166, 172, 154, 158, 172, 156, 154, 164, 156, 166, 150, 178, 164, 148, 166, 174, 144, 158, 168, 142, 162, 176, 154, 154, 172, 166, 160, 156, 176, 158, 154, 162, 178, 146, 164, 178, 142, 162, 172, 152, 158, 160, 166, 162, 146, 160, 170, 150, 160, 176, 152, 170, 166, 146, 156, 176, 158, 158, 160, 166, 152, 164, 164, 166, 152, 166, 170, 148, 158, 184, 144, 170, 172, 152, 162, 158, 158, 176, 144, 166, 170, 150, 162, 178, 144, 164, 184, 150, 154, 166, 160, 144, 160, 168, 160, 156, 158, 158, 152, 166, 172, 136, 170, 182, 150, 164, 170, 150, 166, 156, 162, 158, 160, 168, 162, 152, 160, 176, 140, 158, 174, 156, 152, 176, 150, 162, 158, 166, 158, 156, 164, 174, 156, 162, 174, 144, 166, 174, 144, 170, 174, 150, 154, 158, 162, 156, 150, 166, 164, 158, 170, 172, 152, 166, 178, 148, 164, 176, 150, 166, 162, 156, 160, 158, 162, 162, 146, 176, 156, 146, 162, 184, 150, 168, 172, 154, 156, 164}, + {180, 160, 146, 166, 166, 148, 172, 162, 146, 176, 150, 162, 166, 146, 176, 170, 136, 178, 180, 132, 190, 158, 148, 162, 158, 146, 172, 140, 164, 176, 142, 164, 166, 150, 178, 170, 136, 172, 168, 136, 176, 164, 150, 174, 144, 168, 180, 140, 174, 172, 132, 180, 180, 132, 170, 156, 154, 172, 162, 158, 172, 150, 164, 164, 148, 160, 168, 146, 174, 164, 132, 180, 170, 138, 176, 158, 146, 174, 154, 164, 182, 122, 182, 162, 140, 180, 172, 142, 172, 168, 138, 180, 162, 152, 172, 140, 160, 168, 150, 172, 162, 140, 174, 160, 136, 174, 162, 134, 186, 154, 158, 158, 152, 152, 164, 138, 170, 166, 132, 174, 174, 120, 178, 162, 132, 172, 146, 150, 168, 140, 170, 162, 132, 162, 170, 132, 178, 164, 134, 168, 154, 138, 170, 160, 142, 164, 150, 150, 160, 132, 164, 170, 126, 178, 176, 128, 160, 166, 140, 166, 162, 144, 168, 146, 160, 168, 130, 176, 152, 130, 166, 158, 126, 172, 156, 128, 166, 156, 146, 172, 152, 150, 172, 140, 174, 172, 134, 178, 172, 144, 178, 174, 134, 170, 164, 148, 174, 144, 166, 170, 144, 178, 162, 140, 180, 172, 134, 170, 174, 132, 176, 168, 146, 180, 160, 152, 178, 146, 170, 164, 144, 172, 170, 130, 174, 166, 140, 178, 158, 146, 170, 156, 160, 174, 136, 180, 172, 140, 174, 172, 142, 180, 176, 142, 178, 162, 152, 164, 158, 156, 166, 146, 170, 164, 132, 176, 170, 138, 184, 162, 148, 178, 156, 148, 168, 162, 162, 170, 148, 162, 178, 136, 174, 182, 136, 172, 172, 140, 174, 172, 140, 176, 158, 158, 178, 140, 172, 168, 134, 188, 166, 142, 186, 168, 144, 174, 156, 144, 172, 154, 160, 172, 144, 162, 174, 148, 174, 172, 146, 168, 170, 134, 180, 172, 142, 176, 158, 148, 176, 146, 176, 162, 124, 182, 168, 134, 182, 160, 150, 172, 168, 148, 166, 172, 154, 164, 148, 162, 166, 144, 172, 166, 136, 182, 176, 130, 176, 168, 138, 168, 164, 152, 174, 130, 176, 168, 130, 178, 176, 142}, + {162, 150, 166, 166, 140, 170, 166, 144, 174, 156, 156, 162, 174, 160, 154, 160, 164, 160, 146, 178, 148, 150, 164, 174, 140, 166, 170, 154, 162, 158, 156, 164, 164, 164, 156, 158, 170, 156, 152, 176, 164, 142, 176, 176, 152, 160, 156, 166, 150, 146, 174, 148, 142, 172, 158, 150, 168, 164, 140, 170, 170, 154, 172, 160, 166, 156, 174, 160, 162, 152, 174, 152, 150, 182, 162, 142, 172, 160, 152, 158, 158, 172, 158, 160, 164, 158, 154, 166, 158, 146, 178, 162, 150, 170, 172, 154, 168, 166, 152, 160, 158, 158, 156, 158, 168, 152, 154, 174, 152, 144, 160, 170, 148, 162, 152, 162, 154, 156, 156, 146, 154, 158, 148, 146, 166, 146, 152, 164, 158, 142, 156, 166, 154, 158, 150, 170, 152, 150, 170, 146, 152, 164, 156, 136, 162, 162, 140, 158, 158, 154, 152, 152, 164, 150, 154, 164, 160, 142, 168, 162, 146, 174, 156, 152, 160, 164, 148, 148, 156, 162, 154, 156, 162, 146, 152, 158, 158, 138, 160, 160, 144, 164, 164, 156, 162, 166, 166, 154, 144, 176, 162, 148, 180, 160, 144, 182, 160, 152, 156, 168, 154, 162, 162, 164, 152, 152, 168, 154, 158, 174, 158, 152, 162, 158, 152, 176, 152, 158, 160, 172, 148, 166, 152, 180, 156, 146, 170, 154, 146, 178, 164, 142, 170, 168, 154, 158, 156, 178, 156, 154, 172, 164, 142, 172, 158, 148, 170, 164, 144, 166, 162, 154, 152, 168, 158, 150, 160, 166, 158, 158, 174, 152, 146, 174, 176, 134, 170, 174, 144, 170, 158, 166, 154, 148, 166, 166, 138, 172, 158, 150, 176, 156, 146, 168, 166, 164, 152, 164, 166, 158, 156, 168, 148, 160, 164, 162, 152, 166, 164, 140, 162, 164, 152, 170, 146, 164, 156, 154, 168, 152, 160, 174, 164, 142, 180, 160, 152, 172, 166, 158, 154, 166, 166, 156, 150, 186, 148, 152, 162, 162, 144, 170, 168, 144, 170, 164, 154, 160, 168, 162, 164, 156, 172, 156, 154, 180, 154, 142, 172, 162, 142, 162, 186, 158, 156, 160, 164, 170, 164, 168}, + {168, 142, 158, 158, 158, 160, 156, 152, 166, 164, 152, 172, 166, 148, 174, 154, 150, 174, 170, 144, 176, 154, 164, 160, 156, 170, 160, 140, 180, 158, 138, 174, 158, 148, 182, 148, 156, 172, 166, 160, 160, 162, 166, 158, 150, 174, 170, 144, 174, 170, 136, 176, 164, 146, 166, 158, 152, 168, 156, 168, 160, 148, 174, 162, 146, 162, 170, 148, 184, 156, 158, 172, 160, 154, 170, 156, 152, 164, 142, 172, 162, 138, 176, 160, 152, 168, 160, 156, 176, 152, 148, 168, 162, 156, 160, 154, 160, 162, 138, 172, 160, 144, 182, 156, 146, 168, 168, 156, 164, 148, 166, 154, 156, 170, 158, 148, 160, 164, 136, 168, 146, 154, 168, 142, 150, 158, 144, 148, 156, 144, 160, 162, 136, 168, 164, 138, 178, 164, 140, 164, 154, 162, 156, 158, 150, 156, 154, 154, 158, 144, 170, 154, 136, 168, 146, 148, 162, 158, 148, 160, 154, 158, 154, 148, 158, 156, 148, 162, 164, 134, 164, 156, 138, 162, 142, 150, 160, 152, 154, 158, 162, 152, 156, 148, 170, 172, 134, 182, 160, 156, 168, 162, 156, 168, 162, 154, 168, 154, 170, 162, 140, 168, 162, 136, 168, 160, 156, 178, 144, 166, 164, 164, 164, 156, 154, 166, 172, 140, 174, 160, 148, 176, 162, 140, 172, 160, 156, 168, 148, 158, 172, 156, 166, 162, 154, 176, 174, 132, 174, 158, 150, 176, 152, 158, 174, 152, 162, 164, 148, 164, 162, 140, 170, 164, 144, 168, 156, 152, 168, 166, 158, 168, 156, 160, 168, 162, 166, 154, 162, 174, 162, 142, 174, 152, 142, 176, 150, 160, 164, 156, 162, 164, 158, 158, 176, 144, 174, 162, 142, 178, 164, 140, 180, 146, 164, 174, 148, 164, 160, 164, 164, 154, 142, 174, 180, 142, 172, 164, 146, 180, 154, 162, 158, 172, 158, 170, 146, 152, 180, 146, 166, 164, 134, 172, 160, 138, 172, 146, 154, 170, 160, 158, 164, 160, 170, 160, 152, 162, 170, 140, 182, 162, 140, 186, 154, 152, 170, 160, 140, 168, 154, 168, 156, 144, 170, 166, 142, 172, 160, 148}, + {152, 152, 168, 156, 150, 166, 152, 148, 178, 138, 160, 178, 144, 170, 170, 144, 172, 164, 150, 186, 154, 146, 180, 162, 142, 176, 142, 170, 166, 140, 170, 158, 142, 176, 150, 158, 162, 158, 152, 176, 152, 148, 178, 162, 142, 176, 140, 172, 164, 140, 166, 158, 138, 180, 158, 140, 174, 154, 156, 168, 146, 164, 170, 142, 178, 162, 148, 184, 148, 152, 172, 154, 144, 186, 140, 150, 178, 144, 150, 178, 142, 164, 166, 140, 174, 164, 150, 176, 162, 152, 178, 158, 158, 182, 148, 156, 182, 142, 172, 172, 138, 176, 154, 146, 176, 156, 142, 176, 156, 140, 174, 152, 154, 168, 134, 164, 162, 140, 172, 148, 140, 170, 144, 148, 166, 146, 148, 170, 146, 150, 164, 144, 152, 164, 140, 170, 164, 142, 166, 154, 140, 174, 158, 142, 172, 146, 148, 172, 132, 150, 160, 130, 164, 154, 142, 160, 156, 150, 166, 154, 150, 182, 156, 152, 166, 138, 158, 158, 148, 166, 154, 136, 174, 152, 146, 162, 154, 150, 168, 144, 150, 174, 146, 162, 172, 138, 182, 162, 150, 172, 162, 150, 180, 154, 140, 192, 140, 154, 172, 138, 170, 160, 144, 176, 152, 150, 166, 156, 160, 162, 162, 156, 172, 156, 156, 174, 156, 168, 162, 146, 182, 152, 146, 174, 156, 140, 180, 152, 150, 182, 146, 156, 172, 144, 164, 166, 144, 176, 160, 154, 170, 160, 156, 170, 156, 146, 174, 148, 152, 174, 144, 158, 166, 136, 184, 162, 144, 178, 150, 148, 180, 156, 146, 180, 158, 152, 170, 158, 152, 168, 144, 176, 158, 142, 172, 154, 150, 162, 156, 152, 176, 142, 154, 186, 140, 168, 168, 140, 180, 154, 152, 180, 156, 156, 174, 148, 150, 174, 150, 146, 170, 152, 162, 160, 142, 168, 164, 142, 176, 158, 150, 174, 164, 148, 176, 154, 160, 180, 138, 168, 166, 148, 164, 166, 140, 180, 154, 152, 176, 152, 144, 182, 146, 156, 170, 146, 166, 172, 146, 172, 170, 140, 180, 158, 152, 172, 154, 152, 170, 158, 142, 178, 148, 160, 172, 142, 168, 164, 150, 180}, + {168, 146, 162, 170, 154, 164, 160, 160, 146, 160, 174, 152, 156, 180, 144, 164, 168, 172, 152, 158, 164, 156, 150, 158, 166, 144, 158, 168, 144, 164, 170, 152, 158, 158, 164, 152, 162, 170, 162, 160, 166, 168, 148, 158, 176, 150, 160, 168, 150, 156, 174, 162, 146, 154, 158, 166, 156, 164, 158, 160, 152, 178, 146, 166, 166, 156, 152, 180, 154, 154, 170, 164, 170, 140, 174, 162, 142, 156, 170, 148, 152, 176, 154, 154, 160, 162, 156, 156, 168, 160, 156, 162, 166, 148, 160, 182, 140, 160, 166, 152, 154, 170, 150, 158, 152, 166, 160, 150, 156, 174, 146, 152, 168, 144, 172, 160, 148, 150, 168, 152, 148, 156, 158, 136, 146, 158, 158, 136, 164, 158, 144, 154, 174, 150, 158, 166, 158, 148, 158, 164, 158, 156, 150, 164, 142, 146, 168, 136, 160, 164, 138, 152, 160, 148, 150, 160, 160, 148, 150, 164, 162, 136, 168, 162, 146, 154, 178, 146, 146, 164, 146, 152, 156, 152, 144, 156, 150, 148, 160, 152, 154, 142, 154, 170, 146, 160, 166, 156, 164, 160, 164, 152, 160, 166, 170, 142, 160, 170, 152, 150, 172, 150, 160, 164, 154, 152, 172, 150, 160, 162, 170, 156, 154, 162, 166, 152, 152, 178, 154, 152, 178, 150, 160, 154, 168, 152, 150, 156, 160, 152, 144, 164, 158, 154, 174, 154, 168, 166, 160, 148, 174, 164, 154, 158, 170, 160, 152, 154, 176, 148, 158, 176, 146, 150, 166, 156, 156, 164, 166, 164, 152, 168, 162, 154, 160, 178, 150, 158, 180, 146, 164, 160, 164, 146, 170, 162, 152, 166, 156, 158, 148, 152, 172, 150, 156, 170, 152, 168, 162, 166, 152, 164, 164, 152, 172, 158, 166, 148, 158, 168, 142, 164, 162, 152, 154, 172, 154, 164, 168, 162, 156, 158, 162, 160, 150, 160, 170, 148, 166, 172, 144, 162, 172, 156, 148, 156, 162, 148, 162, 162, 158, 156, 168, 168, 156, 170, 162, 156, 152, 182, 156, 156, 166, 156, 156, 154, 158, 162, 144, 162, 166, 144, 156, 166, 148, 160, 166, 154, 158, 156}, + {160, 158, 170, 140, 170, 158, 136, 154, 178, 146, 162, 176, 146, 158, 174, 152, 166, 148, 170, 168, 140, 176, 176, 144, 160, 180, 144, 146, 176, 142, 154, 164, 158, 162, 148, 164, 158, 148, 164, 170, 154, 164, 174, 148, 162, 182, 142, 162, 178, 152, 150, 160, 160, 166, 140, 168, 158, 134, 168, 170, 150, 154, 182, 142, 164, 172, 158, 156, 158, 158, 160, 150, 162, 166, 144, 164, 176, 134, 158, 176, 146, 146, 172, 158, 160, 162, 154, 166, 148, 168, 164, 150, 176, 174, 142, 158, 176, 146, 156, 178, 146, 162, 160, 164, 154, 142, 164, 170, 138, 158, 172, 144, 158, 168, 146, 156, 168, 146, 162, 152, 154, 156, 130, 172, 158, 142, 152, 164, 136, 150, 178, 140, 146, 160, 154, 148, 154, 164, 156, 154, 154, 162, 142, 158, 172, 140, 154, 168, 138, 146, 170, 142, 146, 160, 156, 154, 136, 172, 150, 142, 170, 174, 144, 156, 172, 138, 148, 166, 148, 152, 164, 146, 142, 150, 158, 158, 134, 160, 154, 134, 164, 176, 156, 150, 172, 148, 162, 166, 164, 164, 158, 164, 174, 146, 166, 172, 140, 160, 166, 146, 156, 166, 154, 150, 166, 156, 162, 148, 172, 158, 144, 166, 176, 146, 162, 190, 146, 156, 182, 144, 152, 166, 158, 164, 150, 162, 164, 150, 166, 170, 144, 164, 164, 148, 164, 168, 150, 160, 168, 160, 162, 146, 174, 170, 140, 174, 170, 146, 154, 176, 144, 144, 176, 154, 152, 162, 146, 162, 150, 170, 160, 146, 172, 166, 148, 168, 164, 150, 158, 176, 152, 158, 162, 152, 164, 144, 164, 160, 148, 168, 166, 152, 162, 172, 152, 156, 178, 152, 162, 166, 160, 164, 152, 170, 160, 144, 172, 160, 142, 160, 180, 146, 154, 176, 146, 152, 168, 140, 160, 166, 158, 172, 156, 164, 174, 154, 160, 180, 138, 160, 172, 140, 152, 166, 160, 152, 156, 158, 168, 144, 162, 168, 146, 158, 180, 140, 156, 190, 140, 156, 174, 148, 162, 162, 158, 164, 152, 170, 164, 142, 156, 174, 154, 152, 162, 156, 154, 172, 152, 160}, + {148, 156, 158, 148, 162, 160, 152, 172, 150, 156, 166, 142, 162, 174, 132, 178, 164, 146, 174, 162, 148, 168, 154, 156, 168, 148, 164, 168, 150, 160, 162, 140, 162, 154, 154, 172, 168, 146, 170, 160, 154, 172, 152, 160, 170, 134, 176, 172, 134, 170, 166, 144, 156, 174, 138, 166, 168, 154, 164, 154, 154, 168, 144, 174, 166, 146, 164, 176, 140, 178, 176, 142, 168, 158, 158, 160, 156, 158, 166, 138, 156, 164, 142, 168, 162, 146, 168, 180, 144, 162, 166, 150, 174, 154, 166, 168, 154, 160, 172, 126, 176, 160, 142, 164, 168, 144, 162, 156, 162, 168, 150, 156, 168, 142, 166, 162, 140, 166, 154, 132, 170, 158, 146, 144, 160, 142, 154, 152, 144, 168, 128, 162, 170, 134, 168, 172, 142, 154, 172, 144, 168, 162, 140, 166, 150, 150, 166, 130, 158, 156, 132, 158, 158, 134, 168, 162, 144, 162, 164, 150, 160, 156, 158, 158, 140, 164, 176, 140, 160, 164, 130, 158, 164, 140, 154, 160, 136, 168, 148, 146, 164, 146, 148, 166, 132, 170, 168, 140, 174, 160, 156, 170, 158, 152, 168, 158, 164, 172, 146, 160, 170, 140, 166, 162, 140, 162, 164, 144, 162, 172, 152, 166, 152, 164, 168, 148, 162, 174, 136, 174, 172, 142, 170, 158, 156, 154, 168, 138, 174, 148, 146, 174, 150, 158, 170, 148, 164, 168, 150, 172, 168, 140, 166, 164, 150, 166, 154, 156, 170, 146, 160, 168, 136, 160, 168, 142, 174, 170, 148, 160, 174, 144, 170, 166, 164, 166, 160, 156, 174, 142, 168, 160, 144, 170, 162, 140, 168, 162, 142, 158, 160, 154, 168, 146, 162, 172, 146, 162, 172, 144, 166, 178, 138, 168, 160, 158, 162, 160, 160, 166, 140, 164, 166, 136, 166, 170, 140, 174, 170, 138, 168, 170, 152, 166, 160, 148, 172, 154, 166, 170, 140, 174, 164, 142, 166, 174, 130, 162, 164, 146, 162, 156, 156, 176, 146, 158, 174, 140, 174, 172, 138, 170, 174, 138, 182, 160, 146, 170, 158, 154, 162, 140, 162, 166, 152, 162, 170, 144, 172, 166}, + {158, 172, 146, 158, 158, 142, 162, 144, 156, 168, 154, 152, 170, 166, 152, 164, 154, 170, 160, 152, 170, 170, 154, 170, 152, 148, 158, 156, 150, 166, 162, 146, 164, 160, 154, 164, 154, 162, 160, 146, 174, 150, 158, 176, 172, 142, 166, 158, 156, 164, 150, 166, 160, 142, 176, 150, 142, 174, 146, 152, 172, 158, 148, 168, 166, 154, 170, 164, 162, 160, 156, 164, 158, 150, 168, 160, 144, 174, 154, 146, 170, 164, 144, 162, 154, 162, 162, 154, 162, 156, 152, 186, 154, 150, 166, 162, 152, 170, 160, 164, 164, 154, 158, 162, 142, 166, 152, 156, 172, 154, 150, 170, 152, 156, 160, 158, 148, 158, 164, 148, 150, 148, 156, 150, 140, 166, 142, 138, 166, 146, 144, 164, 156, 152, 164, 144, 156, 162, 152, 166, 160, 154, 170, 150, 142, 162, 152, 146, 158, 158, 138, 156, 160, 144, 152, 142, 158, 148, 128, 172, 162, 142, 174, 162, 144, 166, 160, 146, 154, 162, 150, 152, 150, 154, 156, 136, 166, 142, 140, 166, 146, 148, 174, 152, 158, 164, 168, 156, 156, 156, 164, 166, 150, 176, 150, 154, 166, 156, 146, 168, 156, 150, 164, 150, 148, 164, 158, 160, 162, 148, 156, 164, 142, 172, 160, 156, 178, 158, 154, 172, 160, 156, 162, 156, 162, 156, 142, 174, 148, 152, 174, 154, 152, 170, 158, 148, 172, 160, 158, 154, 162, 166, 170, 150, 168, 152, 142, 174, 150, 152, 174, 154, 146, 180, 154, 150, 162, 156, 148, 160, 152, 170, 166, 148, 174, 166, 140, 172, 168, 148, 160, 170, 156, 162, 148, 164, 156, 140, 170, 154, 146, 172, 154, 156, 168, 166, 142, 170, 160, 160, 170, 154, 164, 160, 156, 166, 162, 144, 178, 140, 140, 180, 152, 148, 166, 164, 146, 166, 154, 164, 158, 150, 180, 152, 158, 170, 162, 144, 172, 152, 154, 168, 160, 150, 162, 154, 164, 160, 146, 164, 166, 144, 168, 148, 164, 168, 160, 158, 168, 170, 152, 170, 156, 170, 158, 146, 170, 148, 146, 172, 152, 146, 170, 148, 142, 172, 156, 152, 160, 164}, + {162, 154, 158, 154, 176, 142, 156, 164, 166, 152, 162, 162, 148, 148, 170, 162, 154, 168, 178, 152, 158, 170, 162, 152, 170, 158, 154, 154, 164, 150, 144, 154, 158, 150, 166, 164, 144, 162, 174, 158, 150, 172, 166, 152, 164, 164, 154, 158, 176, 146, 164, 154, 166, 148, 154, 166, 158, 150, 162, 156, 152, 160, 164, 148, 156, 172, 160, 156, 158, 178, 148, 158, 168, 154, 148, 166, 158, 142, 166, 164, 146, 144, 176, 148, 150, 160, 164, 156, 164, 170, 154, 154, 178, 156, 152, 174, 166, 148, 152, 164, 150, 150, 160, 158, 152, 148, 168, 148, 150, 162, 162, 152, 162, 156, 156, 148, 168, 158, 154, 152, 162, 142, 152, 168, 142, 138, 168, 148, 142, 158, 154, 146, 142, 168, 154, 164, 156, 162, 148, 152, 158, 152, 152, 164, 152, 142, 150, 164, 140, 150, 156, 146, 142, 150, 156, 144, 154, 170, 148, 140, 170, 162, 144, 156, 166, 148, 154, 162, 156, 154, 156, 156, 144, 156, 156, 150, 144, 158, 146, 144, 158, 160, 142, 148, 156, 158, 154, 166, 166, 152, 164, 174, 154, 146, 180, 162, 156, 160, 162, 152, 154, 166, 160, 152, 166, 154, 150, 164, 164, 162, 162, 172, 166, 144, 170, 168, 162, 156, 160, 158, 154, 170, 152, 156, 156, 168, 144, 150, 164, 160, 142, 158, 158, 146, 162, 168, 152, 156, 170, 164, 158, 156, 170, 154, 158, 168, 160, 156, 164, 162, 146, 152, 170, 146, 152, 168, 162, 144, 162, 170, 148, 164, 166, 158, 154, 176, 158, 156, 158, 172, 160, 140, 166, 166, 144, 164, 166, 152, 152, 154, 158, 148, 162, 162, 146, 156, 176, 156, 156, 170, 166, 150, 160, 170, 154, 162, 168, 156, 144, 168, 168, 142, 160, 164, 152, 140, 172, 152, 160, 168, 160, 160, 146, 166, 164, 156, 166, 170, 150, 158, 172, 152, 148, 166, 166, 150, 152, 164, 150, 152, 170, 154, 152, 156, 158, 156, 158, 170, 158, 162, 170, 160, 150, 162, 162, 150, 156, 180, 156, 140, 170, 152, 146, 156, 170, 156, 144, 162, 160, 148}, + {158, 162, 152, 158, 158, 154, 166, 158, 142, 170, 156, 144, 176, 158, 154, 164, 160, 158, 160, 156, 170, 154, 156, 172, 150, 144, 168, 160, 136, 174, 152, 152, 170, 150, 152, 162, 160, 162, 158, 156, 168, 150, 154, 182, 160, 144, 172, 160, 146, 174, 150, 154, 160, 154, 164, 146, 148, 172, 150, 156, 166, 158, 144, 180, 148, 150, 170, 162, 162, 164, 164, 164, 156, 156, 168, 156, 148, 168, 154, 140, 176, 156, 146, 170, 150, 158, 154, 148, 168, 160, 162, 162, 164, 162, 170, 152, 148, 176, 152, 160, 174, 156, 150, 172, 140, 166, 144, 162, 162, 160, 146, 166, 156, 154, 164, 156, 144, 172, 142, 154, 158, 158, 160, 144, 150, 162, 146, 142, 168, 140, 140, 170, 156, 142, 162, 148, 160, 160, 158, 156, 158, 156, 170, 154, 146, 168, 160, 130, 164, 148, 134, 162, 140, 150, 152, 150, 152, 150, 164, 156, 154, 146, 182, 156, 140, 172, 164, 142, 168, 138, 154, 158, 150, 140, 154, 148, 156, 160, 138, 156, 150, 138, 166, 160, 146, 172, 152, 156, 164, 168, 156, 166, 156, 172, 152, 150, 168, 166, 144, 168, 160, 146, 158, 144, 152, 164, 158, 152, 160, 156, 160, 154, 144, 172, 162, 154, 174, 156, 150, 172, 148, 160, 170, 156, 158, 156, 146, 172, 148, 146, 170, 158, 152, 162, 160, 146, 170, 158, 142, 168, 162, 170, 160, 162, 168, 154, 156, 164, 160, 144, 174, 152, 152, 166, 152, 152, 160, 152, 158, 160, 158, 164, 162, 160, 162, 164, 156, 168, 160, 148, 168, 150, 148, 156, 168, 160, 156, 154, 160, 154, 152, 174, 156, 146, 176, 152, 150, 168, 160, 154, 178, 160, 160, 166, 154, 164, 154, 158, 168, 152, 142, 166, 156, 142, 166, 156, 148, 164, 148, 158, 160, 156, 164, 158, 154, 184, 158, 140, 172, 164, 146, 174, 162, 140, 166, 152, 150, 156, 154, 174, 148, 152, 168, 164, 150, 174, 162, 146, 166, 156, 154, 166, 164, 160, 160, 160, 156, 148, 156, 178, 150, 144, 176, 154, 134, 176, 156, 146, 166, 162}, + {168, 154, 144, 180, 140, 156, 168, 140, 164, 166, 140, 172, 160, 152, 164, 160, 156, 168, 156, 162, 168, 154, 152, 170, 154, 160, 162, 148, 166, 158, 150, 160, 152, 146, 176, 148, 144, 176, 152, 146, 174, 152, 170, 174, 154, 170, 166, 154, 174, 154, 150, 166, 144, 150, 162, 150, 156, 160, 146, 156, 166, 142, 166, 158, 158, 174, 150, 160, 172, 148, 152, 166, 156, 154, 168, 160, 154, 160, 148, 170, 154, 144, 168, 160, 148, 168, 160, 152, 172, 142, 158, 166, 152, 166, 170, 154, 168, 158, 152, 164, 154, 148, 160, 148, 146, 166, 152, 146, 170, 142, 158, 170, 140, 172, 156, 152, 168, 170, 154, 166, 146, 142, 152, 146, 142, 158, 144, 150, 158, 138, 164, 152, 140, 166, 156, 148, 162, 164, 146, 164, 148, 154, 166, 146, 152, 168, 132, 162, 154, 144, 158, 156, 140, 164, 142, 144, 160, 142, 144, 164, 160, 150, 158, 148, 158, 158, 142, 178, 150, 154, 166, 144, 144, 164, 140, 148, 158, 128, 152, 162, 134, 160, 158, 144, 160, 156, 152, 170, 154, 152, 172, 156, 158, 170, 152, 162, 170, 138, 174, 160, 146, 164, 162, 154, 166, 144, 152, 176, 146, 146, 176, 156, 156, 166, 148, 164, 180, 148, 166, 162, 162, 168, 150, 140, 168, 152, 154, 168, 146, 160, 160, 140, 164, 168, 146, 166, 170, 148, 176, 152, 156, 174, 152, 158, 166, 156, 156, 168, 146, 162, 158, 146, 164, 150, 150, 160, 156, 158, 162, 158, 152, 170, 150, 158, 162, 152, 172, 164, 150, 170, 160, 156, 180, 154, 142, 172, 142, 138, 166, 152, 160, 170, 136, 168, 160, 144, 174, 162, 152, 170, 164, 152, 162, 154, 162, 172, 144, 158, 164, 146, 158, 170, 150, 166, 160, 144, 164, 160, 154, 170, 152, 152, 164, 150, 162, 174, 146, 170, 168, 150, 168, 158, 150, 174, 152, 154, 170, 150, 152, 162, 152, 150, 170, 142, 160, 170, 150, 168, 166, 154, 176, 158, 154, 170, 150, 152, 172, 150, 148, 174, 146, 152, 156, 144, 162, 162, 144, 174, 158, 148}, + {172, 144, 166, 154, 156, 166, 140, 152, 164, 146, 154, 162, 146, 156, 172, 148, 168, 164, 160, 164, 164, 162, 172, 150, 160, 158, 150, 158, 160, 156, 144, 164, 150, 158, 162, 146, 174, 158, 162, 164, 154, 166, 160, 150, 156, 170, 148, 164, 164, 148, 160, 168, 164, 160, 154, 160, 158, 148, 158, 166, 148, 156, 162, 152, 160, 168, 150, 158, 170, 172, 156, 168, 160, 160, 154, 154, 172, 146, 152, 166, 140, 164, 168, 142, 154, 160, 156, 162, 160, 162, 164, 162, 158, 172, 150, 152, 168, 144, 164, 170, 150, 152, 172, 156, 156, 154, 152, 164, 148, 162, 156, 156, 152, 168, 148, 152, 164, 142, 158, 168, 146, 160, 154, 148, 162, 140, 150, 154, 138, 148, 146, 132, 156, 166, 140, 156, 164, 150, 154, 162, 162, 158, 160, 156, 156, 144, 150, 162, 140, 150, 162, 128, 154, 156, 146, 156, 160, 154, 158, 152, 154, 168, 154, 152, 162, 146, 160, 166, 148, 144, 164, 148, 156, 148, 152, 152, 146, 150, 158, 136, 156, 158, 136, 154, 162, 146, 162, 166, 152, 160, 164, 160, 170, 158, 162, 166, 154, 158, 160, 144, 166, 160, 144, 156, 164, 150, 156, 160, 148, 166, 154, 158, 168, 148, 176, 158, 154, 162, 168, 146, 162, 170, 150, 170, 164, 160, 156, 152, 156, 154, 158, 148, 164, 146, 158, 172, 136, 162, 162, 158, 164, 168, 168, 160, 160, 160, 174, 148, 164, 160, 142, 160, 164, 138, 156, 168, 146, 154, 166, 144, 162, 154, 168, 164, 152, 160, 168, 150, 160, 170, 142, 156, 168, 152, 156, 156, 164, 168, 154, 146, 160, 154, 156, 154, 154, 164, 166, 148, 164, 164, 162, 160, 168, 160, 160, 152, 164, 160, 152, 158, 172, 130, 152, 170, 140, 146, 178, 142, 164, 158, 156, 172, 158, 162, 166, 160, 164, 166, 142, 166, 172, 148, 160, 162, 148, 154, 158, 150, 158, 162, 146, 162, 156, 154, 168, 150, 156, 168, 144, 158, 172, 156, 156, 170, 156, 158, 160, 162, 164, 148, 158, 168, 140, 154, 170, 142, 156, 160, 154, 156}, + {144, 170, 160, 152, 150, 154, 150, 152, 160, 160, 156, 156, 158, 156, 152, 158, 164, 144, 164, 172, 148, 156, 166, 162, 156, 170, 158, 158, 156, 152, 154, 146, 172, 148, 148, 158, 154, 160, 150, 164, 150, 156, 170, 168, 164, 156, 164, 158, 146, 166, 156, 150, 160, 154, 144, 150, 168, 148, 148, 160, 160, 162, 164, 158, 154, 150, 174, 156, 158, 162, 174, 144, 152, 176, 150, 160, 162, 162, 150, 154, 164, 148, 148, 158, 156, 156, 156, 160, 146, 156, 170, 156, 156, 172, 170, 158, 164, 166, 154, 148, 170, 156, 140, 162, 162, 144, 158, 164, 152, 152, 168, 156, 160, 162, 162, 148, 160, 162, 156, 148, 152, 160, 138, 150, 162, 148, 144, 160, 150, 146, 158, 166, 140, 150, 162, 156, 148, 160, 164, 144, 150, 172, 152, 150, 160, 160, 148, 152, 160, 150, 146, 152, 154, 134, 152, 148, 138, 148, 162, 138, 156, 164, 160, 152, 160, 166, 154, 154, 170, 154, 146, 154, 160, 136, 146, 158, 140, 144, 150, 154, 144, 156, 166, 146, 146, 164, 164, 146, 170, 172, 150, 158, 174, 154, 152, 168, 162, 154, 168, 156, 162, 158, 152, 150, 148, 162, 156, 146, 152, 166, 150, 154, 164, 160, 150, 166, 174, 158, 148, 178, 154, 146, 160, 160, 150, 150, 168, 150, 144, 174, 154, 156, 162, 160, 156, 152, 162, 150, 148, 170, 160, 156, 164, 168, 152, 156, 158, 158, 156, 162, 164, 152, 148, 170, 160, 144, 156, 164, 150, 162, 168, 150, 154, 174, 154, 156, 168, 176, 152, 162, 168, 158, 148, 170, 156, 150, 152, 154, 146, 158, 162, 152, 152, 166, 160, 148, 164, 168, 152, 156, 164, 172, 152, 156, 174, 148, 152, 170, 162, 146, 162, 170, 154, 146, 164, 158, 140, 168, 154, 148, 156, 160, 144, 162, 174, 162, 152, 170, 172, 150, 162, 164, 158, 148, 160, 160, 144, 160, 156, 150, 150, 162, 152, 150, 164, 162, 158, 158, 168, 158, 156, 176, 162, 142, 158, 172, 152, 154, 164, 154, 144, 168, 160, 146, 154, 168, 156, 148, 162, 172}, + {166, 150, 156, 170, 152, 148, 166, 154, 154, 158, 152, 152, 154, 166, 160, 152, 172, 160, 152, 166, 180, 152, 146, 174, 150, 148, 162, 158, 154, 156, 162, 154, 146, 166, 164, 146, 158, 172, 140, 154, 170, 156, 152, 168, 164, 166, 154, 172, 164, 150, 170, 156, 156, 152, 166, 150, 148, 162, 148, 154, 154, 164, 144, 156, 166, 166, 146, 180, 164, 150, 164, 176, 144, 158, 168, 150, 154, 158, 164, 150, 146, 166, 164, 142, 166, 164, 150, 154, 160, 156, 156, 168, 158, 154, 166, 164, 152, 160, 164, 166, 148, 168, 162, 144, 152, 168, 140, 154, 170, 146, 146, 168, 152, 152, 148, 170, 152, 152, 170, 170, 140, 170, 154, 140, 146, 154, 140, 144, 146, 142, 148, 136, 160, 154, 142, 162, 166, 150, 160, 166, 160, 144, 166, 150, 158, 162, 150, 146, 140, 160, 148, 144, 156, 154, 138, 158, 162, 138, 148, 176, 146, 150, 162, 154, 158, 154, 162, 160, 150, 166, 156, 144, 154, 160, 148, 144, 164, 140, 148, 148, 150, 146, 150, 156, 152, 148, 164, 162, 144, 156, 166, 154, 160, 176, 158, 158, 166, 154, 156, 162, 158, 158, 148, 160, 156, 148, 162, 160, 152, 152, 168, 146, 158, 162, 168, 150, 156, 164, 168, 144, 174, 168, 150, 162, 168, 154, 144, 170, 148, 150, 168, 144, 154, 154, 162, 154, 154, 172, 168, 156, 170, 164, 158, 160, 170, 142, 170, 160, 162, 146, 156, 162, 158, 138, 168, 164, 136, 154, 170, 140, 156, 176, 146, 150, 174, 160, 160, 158, 176, 158, 146, 170, 168, 142, 164, 156, 152, 158, 164, 142, 154, 166, 148, 152, 160, 160, 152, 154, 170, 160, 150, 162, 178, 156, 154, 168, 154, 148, 168, 156, 150, 152, 154, 156, 144, 158, 166, 140, 170, 162, 154, 154, 174, 144, 158, 164, 168, 150, 166, 162, 158, 150, 164, 168, 146, 162, 164, 142, 160, 172, 142, 146, 176, 154, 150, 158, 162, 160, 154, 174, 158, 154, 170, 166, 154, 160, 170, 146, 156, 168, 150, 148, 160, 162, 150, 142, 166, 158, 142, 158}, + {154, 158, 162, 146, 158, 166, 138, 162, 158, 140, 166, 158, 156, 154, 164, 150, 156, 164, 154, 164, 156, 174, 176, 136, 170, 176, 138, 164, 166, 138, 156, 164, 146, 148, 158, 146, 162, 152, 162, 168, 146, 168, 166, 146, 160, 170, 156, 156, 166, 154, 160, 164, 148, 166, 148, 158, 164, 146, 162, 166, 142, 160, 162, 158, 156, 160, 154, 156, 164, 164, 166, 154, 168, 168, 140, 176, 162, 140, 162, 158, 148, 160, 156, 146, 152, 168, 146, 162, 162, 160, 160, 152, 170, 168, 146, 172, 164, 150, 152, 166, 140, 164, 158, 152, 162, 158, 158, 160, 138, 170, 156, 144, 166, 164, 152, 160, 156, 154, 152, 156, 150, 156, 156, 150, 158, 140, 164, 146, 134, 160, 156, 144, 148, 152, 142, 156, 158, 154, 162, 150, 156, 160, 146, 162, 162, 144, 156, 166, 140, 152, 158, 134, 150, 146, 146, 146, 150, 148, 160, 136, 166, 164, 140, 164, 156, 156, 156, 164, 150, 160, 158, 150, 150, 144, 146, 158, 132, 162, 152, 136, 156, 154, 134, 160, 156, 152, 156, 162, 158, 164, 158, 166, 168, 150, 176, 162, 142, 166, 170, 130, 166, 156, 150, 162, 156, 148, 158, 158, 156, 164, 152, 164, 168, 136, 168, 172, 144, 168, 168, 164, 156, 160, 150, 160, 162, 152, 170, 144, 162, 156, 134, 160, 166, 140, 162, 162, 138, 158, 160, 158, 160, 166, 162, 170, 154, 172, 158, 144, 172, 168, 146, 154, 156, 160, 152, 150, 156, 166, 154, 152, 170, 140, 170, 164, 136, 166, 170, 146, 170, 164, 156, 154, 170, 142, 170, 160, 154, 154, 146, 162, 162, 138, 162, 158, 152, 158, 164, 150, 166, 156, 164, 160, 162, 150, 170, 152, 164, 166, 142, 164, 164, 142, 162, 164, 146, 156, 152, 150, 160, 156, 156, 168, 146, 172, 172, 146, 170, 172, 144, 164, 170, 144, 164, 160, 152, 154, 152, 158, 154, 142, 160, 156, 144, 160, 164, 142, 170, 166, 162, 148, 166, 164, 168, 160, 156, 160, 152, 164, 164, 138, 162, 166, 136, 164, 164, 152, 154, 164, 150, 162}, + {154, 164, 162, 148, 166, 152, 156, 154, 154, 154, 168, 154, 146, 164, 152, 168, 166, 148, 174, 154, 158, 166, 156, 156, 166, 152, 158, 162, 154, 158, 160, 146, 156, 154, 148, 166, 152, 148, 164, 150, 150, 170, 158, 156, 180, 158, 154, 174, 146, 168, 158, 144, 168, 154, 146, 160, 150, 138, 166, 142, 150, 168, 152, 154, 168, 152, 160, 164, 152, 176, 166, 140, 168, 158, 150, 162, 152, 154, 160, 160, 150, 156, 146, 160, 156, 146, 166, 164, 140, 174, 152, 152, 168, 152, 162, 174, 166, 158, 164, 154, 170, 164, 140, 168, 152, 132, 162, 156, 138, 164, 154, 148, 164, 160, 148, 156, 158, 170, 160, 146, 170, 156, 136, 166, 144, 136, 158, 150, 142, 156, 154, 140, 160, 154, 150, 158, 136, 176, 158, 146, 162, 156, 142, 176, 156, 154, 164, 146, 144, 156, 150, 152, 150, 142, 152, 154, 136, 170, 138, 152, 162, 154, 152, 174, 156, 144, 154, 152, 162, 158, 136, 168, 150, 148, 154, 146, 142, 152, 150, 140, 156, 150, 144, 156, 148, 156, 170, 140, 168, 166, 146, 168, 162, 162, 160, 162, 160, 170, 156, 166, 150, 164, 152, 154, 150, 160, 150, 142, 162, 156, 138, 172, 158, 156, 162, 158, 156, 168, 156, 168, 160, 154, 170, 166, 146, 166, 152, 148, 170, 148, 152, 164, 156, 148, 166, 156, 160, 164, 144, 168, 156, 146, 170, 166, 150, 162, 162, 152, 162, 156, 146, 162, 160, 148, 154, 150, 154, 152, 138, 170, 154, 150, 168, 152, 156, 172, 158, 170, 166, 158, 162, 166, 138, 174, 150, 152, 164, 158, 148, 160, 154, 146, 162, 162, 144, 168, 162, 158, 160, 158, 172, 164, 152, 180, 162, 152, 162, 154, 152, 174, 158, 152, 160, 148, 154, 158, 150, 166, 156, 148, 164, 144, 154, 168, 150, 160, 172, 158, 164, 168, 160, 158, 158, 160, 160, 156, 142, 170, 158, 138, 170, 154, 148, 168, 156, 154, 162, 156, 146, 162, 156, 164, 166, 156, 168, 154, 158, 166, 150, 156, 162, 152, 154, 156, 154, 148, 164, 138, 168, 158}, + {154, 162, 162, 148, 154, 164, 150, 150, 150, 162, 144, 136, 182, 150, 150, 162, 164, 150, 164, 166, 160, 162, 170, 160, 158, 148, 170, 152, 148, 170, 156, 148, 170, 154, 142, 162, 160, 146, 158, 170, 154, 152, 166, 174, 150, 150, 186, 148, 156, 166, 162, 140, 168, 156, 154, 164, 160, 158, 150, 148, 170, 144, 150, 176, 150, 146, 176, 150, 160, 170, 170, 154, 162, 174, 162, 154, 162, 168, 154, 136, 174, 146, 144, 168, 154, 136, 168, 152, 154, 166, 164, 162, 150, 166, 166, 152, 154, 174, 154, 144, 172, 142, 156, 166, 160, 154, 160, 156, 156, 160, 144, 168, 156, 140, 180, 144, 142, 168, 158, 146, 160, 162, 142, 148, 156, 148, 142, 140, 164, 136, 128, 166, 140, 134, 168, 148, 148, 160, 156, 150, 162, 156, 160, 160, 152, 166, 142, 152, 168, 138, 136, 158, 142, 142, 160, 140, 144, 154, 152, 150, 140, 164, 162, 152, 150, 178, 148, 152, 170, 156, 154, 162, 156, 140, 148, 154, 148, 144, 150, 150, 140, 148, 156, 146, 138, 164, 146, 154, 160, 160, 148, 168, 166, 160, 160, 166, 164, 156, 138, 176, 158, 140, 170, 160, 146, 168, 154, 150, 160, 168, 154, 148, 160, 160, 154, 156, 170, 162, 148, 178, 158, 146, 168, 160, 148, 164, 154, 158, 144, 162, 152, 152, 140, 180, 140, 148, 168, 164, 146, 174, 158, 158, 166, 166, 158, 158, 158, 176, 150, 152, 176, 154, 140, 172, 152, 142, 168, 154, 146, 160, 160, 160, 160, 168, 162, 150, 156, 174, 152, 152, 174, 152, 154, 170, 154, 150, 164, 156, 150, 154, 152, 160, 148, 140, 174, 152, 138, 176, 152, 144, 170, 162, 154, 160, 174, 148, 162, 160, 166, 146, 142, 182, 146, 136, 182, 144, 150, 160, 160, 148, 162, 166, 154, 150, 170, 164, 156, 164, 176, 154, 148, 174, 152, 146, 164, 160, 146, 156, 156, 146, 154, 156, 160, 146, 156, 168, 156, 146, 182, 154, 152, 178, 160, 148, 172, 166, 150, 154, 170, 156, 152, 152, 162, 148, 144, 170, 148, 144, 168, 156}, + {168, 148, 154, 166, 160, 132, 166, 156, 152, 152, 164, 152, 146, 166, 164, 144, 162, 164, 152, 164, 174, 166, 144, 174, 162, 150, 160, 162, 148, 150, 162, 160, 142, 148, 170, 146, 142, 174, 156, 144, 170, 160, 148, 160, 170, 158, 152, 178, 158, 148, 170, 168, 148, 150, 168, 152, 136, 170, 150, 144, 158, 160, 146, 150, 168, 158, 146, 166, 174, 154, 154, 180, 152, 142, 168, 164, 146, 154, 164, 154, 152, 160, 154, 144, 164, 162, 142, 152, 172, 156, 144, 168, 156, 150, 166, 168, 156, 158, 172, 160, 150, 164, 164, 146, 150, 164, 146, 146, 166, 152, 148, 166, 154, 160, 154, 164, 164, 148, 162, 168, 150, 152, 170, 150, 136, 166, 142, 142, 152, 156, 144, 146, 160, 146, 138, 156, 170, 156, 146, 176, 148, 150, 172, 152, 148, 168, 156, 142, 150, 164, 150, 140, 162, 150, 132, 154, 152, 142, 142, 162, 152, 138, 162, 162, 150, 150, 160, 160, 146, 160, 168, 148, 142, 166, 146, 136, 162, 144, 130, 156, 144, 142, 150, 164, 150, 138, 166, 166, 150, 158, 166, 158, 152, 172, 162, 150, 170, 162, 152, 158, 168, 154, 144, 164, 156, 144, 146, 162, 142, 136, 174, 152, 146, 168, 162, 156, 152, 176, 166, 156, 168, 162, 150, 150, 178, 144, 154, 160, 166, 142, 170, 150, 148, 148, 164, 154, 148, 164, 166, 144, 154, 176, 156, 152, 186, 158, 146, 158, 164, 142, 160, 160, 154, 152, 156, 158, 144, 158, 158, 148, 148, 162, 160, 138, 168, 162, 160, 164, 174, 158, 158, 176, 160, 150, 158, 166, 152, 140, 168, 158, 140, 164, 158, 150, 162, 150, 164, 154, 158, 174, 142, 166, 176, 154, 148, 178, 160, 144, 174, 150, 160, 154, 158, 154, 144, 164, 158, 146, 148, 168, 154, 144, 178, 162, 144, 172, 164, 148, 158, 176, 154, 152, 168, 162, 150, 154, 174, 144, 148, 172, 146, 138, 162, 156, 150, 154, 164, 158, 142, 172, 166, 150, 166, 182, 150, 156, 174, 152, 136, 168, 160, 150, 152, 158, 152, 146, 162, 158, 146, 156}, + {156, 164, 150, 154, 162, 158, 150, 156, 158, 150, 144, 164, 156, 146, 156, 164, 146, 160, 166, 156, 158, 166, 166, 152, 166, 168, 154, 166, 160, 158, 146, 158, 158, 146, 156, 148, 162, 146, 150, 160, 154, 162, 164, 154, 158, 168, 160, 158, 164, 166, 146, 152, 160, 154, 150, 168, 156, 142, 164, 154, 150, 156, 166, 156, 148, 166, 156, 152, 162, 164, 162, 158, 170, 164, 148, 168, 154, 154, 156, 162, 148, 146, 166, 148, 148, 148, 164, 146, 146, 166, 154, 154, 166, 164, 164, 172, 172, 160, 154, 160, 162, 150, 156, 162, 152, 156, 154, 152, 152, 158, 160, 148, 156, 162, 160, 148, 156, 166, 142, 158, 160, 154, 150, 154, 156, 132, 160, 150, 140, 144, 152, 142, 138, 158, 148, 146, 146, 162, 150, 152, 170, 146, 154, 168, 164, 148, 158, 166, 144, 140, 158, 154, 134, 146, 156, 138, 142, 156, 158, 134, 158, 164, 146, 154, 176, 158, 152, 160, 162, 150, 152, 166, 144, 144, 156, 148, 142, 158, 156, 146, 150, 154, 150, 146, 156, 158, 140, 162, 158, 150, 154, 168, 166, 156, 166, 162, 156, 162, 166, 156, 148, 166, 160, 142, 162, 158, 146, 156, 154, 160, 148, 162, 164, 146, 166, 156, 162, 156, 170, 168, 150, 170, 160, 160, 148, 166, 152, 152, 158, 150, 144, 156, 160, 152, 156, 158, 158, 148, 160, 162, 154, 156, 170, 160, 150, 178, 160, 154, 162, 170, 150, 154, 162, 150, 146, 160, 162, 148, 154, 162, 156, 150, 160, 160, 144, 174, 166, 154, 158, 170, 160, 150, 160, 162, 148, 148, 162, 162, 148, 150, 156, 150, 156, 158, 146, 166, 158, 158, 156, 156, 162, 150, 166, 164, 162, 150, 172, 164, 140, 168, 156, 154, 156, 156, 158, 142, 154, 156, 146, 152, 166, 156, 146, 162, 160, 154, 168, 172, 162, 160, 164, 166, 142, 164, 168, 140, 154, 160, 154, 146, 160, 160, 146, 160, 158, 148, 152, 160, 160, 152, 166, 168, 148, 156, 174, 158, 152, 170, 160, 152, 160, 164, 148, 158, 156, 158, 144, 158, 164, 138}, + {156, 164, 154, 160, 160, 150, 154, 158, 146, 156, 158, 146, 162, 146, 160, 162, 156, 156, 166, 160, 168, 164, 156, 164, 152, 156, 156, 152, 162, 158, 158, 148, 156, 156, 150, 160, 150, 160, 158, 152, 168, 156, 152, 158, 160, 166, 162, 156, 164, 160, 164, 156, 164, 150, 158, 152, 150, 158, 152, 154, 162, 142, 148, 162, 154, 160, 162, 160, 160, 172, 154, 166, 168, 158, 160, 156, 164, 152, 156, 150, 164, 150, 146, 162, 152, 154, 158, 158, 160, 160, 152, 158, 164, 152, 164, 146, 166, 166, 154, 162, 166, 160, 156, 160, 154, 160, 156, 152, 154, 150, 154, 146, 160, 146, 160, 160, 158, 160, 162, 152, 168, 152, 162, 150, 146, 158, 150, 140, 150, 150, 144, 154, 146, 138, 164, 144, 150, 164, 160, 158, 160, 148, 160, 152, 158, 158, 152, 150, 158, 142, 144, 152, 152, 144, 152, 136, 160, 144, 142, 154, 152, 150, 160, 152, 146, 164, 162, 144, 164, 152, 158, 168, 150, 154, 158, 140, 154, 142, 140, 148, 146, 140, 146, 146, 144, 160, 152, 158, 162, 156, 162, 162, 158, 162, 168, 156, 164, 152, 164, 158, 156, 152, 162, 156, 146, 160, 154, 150, 158, 148, 156, 156, 144, 166, 152, 156, 158, 160, 154, 164, 164, 158, 164, 154, 168, 160, 154, 160, 156, 154, 160, 150, 150, 160, 144, 156, 160, 158, 156, 166, 156, 160, 168, 158, 168, 160, 156, 168, 148, 160, 154, 156, 152, 168, 152, 152, 158, 146, 156, 162, 148, 158, 164, 154, 162, 158, 154, 168, 158, 160, 166, 158, 160, 168, 156, 160, 162, 146, 162, 152, 152, 152, 146, 154, 156, 144, 148, 168, 156, 154, 166, 162, 164, 166, 164, 170, 152, 160, 162, 160, 156, 154, 152, 150, 162, 150, 148, 162, 150, 156, 160, 156, 160, 156, 154, 158, 162, 152, 160, 166, 160, 158, 162, 150, 162, 164, 146, 162, 144, 160, 154, 148, 162, 152, 152, 158, 156, 156, 168, 152, 156, 170, 166, 166, 164, 162, 162, 156, 148, 162, 154, 150, 154, 152, 152, 154, 148, 154, 164, 160}, + {170, 156, 160, 166, 148, 160, 158, 148, 160, 166, 140, 154, 158, 148, 154, 160, 146, 162, 148, 160, 166, 156, 168, 176, 148, 164, 172, 144, 150, 170, 138, 160, 152, 148, 150, 160, 146, 160, 148, 160, 160, 142, 164, 170, 150, 168, 166, 158, 158, 160, 152, 166, 148, 162, 164, 144, 162, 162, 138, 148, 166, 144, 166, 160, 152, 160, 160, 156, 150, 162, 160, 164, 154, 166, 166, 146, 160, 168, 152, 158, 164, 140, 160, 156, 148, 156, 154, 152, 152, 150, 166, 162, 150, 164, 174, 156, 166, 168, 150, 158, 164, 154, 154, 154, 150, 158, 144, 156, 156, 148, 156, 170, 140, 164, 160, 152, 154, 160, 148, 160, 160, 152, 154, 148, 150, 154, 136, 152, 162, 128, 152, 156, 136, 150, 154, 148, 144, 162, 150, 160, 156, 162, 156, 154, 164, 160, 152, 160, 158, 146, 152, 154, 136, 146, 152, 142, 146, 144, 152, 152, 136, 156, 168, 148, 166, 164, 146, 158, 168, 150, 162, 154, 146, 152, 140, 154, 158, 136, 156, 150, 142, 154, 158, 138, 156, 142, 152, 150, 164, 148, 162, 150, 164, 168, 150, 174, 168, 156, 154, 166, 140, 158, 166, 140, 166, 148, 148, 154, 154, 156, 168, 144, 162, 164, 148, 158, 170, 154, 170, 164, 152, 158, 170, 150, 162, 152, 158, 158, 146, 160, 160, 146, 154, 160, 144, 162, 154, 148, 162, 148, 162, 156, 150, 168, 170, 148, 168, 166, 146, 160, 170, 144, 166, 158, 140, 158, 152, 148, 154, 146, 158, 160, 134, 172, 158, 156, 158, 176, 148, 172, 166, 150, 158, 156, 158, 160, 154, 154, 154, 152, 154, 164, 144, 160, 162, 146, 162, 154, 154, 160, 156, 150, 170, 158, 164, 164, 158, 158, 166, 148, 158, 172, 146, 156, 160, 150, 146, 162, 154, 152, 156, 152, 160, 152, 164, 166, 146, 176, 170, 150, 164, 170, 142, 164, 170, 144, 164, 152, 150, 160, 142, 164, 154, 150, 158, 166, 152, 160, 166, 150, 160, 166, 154, 158, 164, 160, 160, 146, 168, 166, 146, 162, 160, 142, 154, 168, 136, 156, 146, 150}, + {158, 146, 150, 166, 138, 158, 168, 138, 150, 156, 156, 162, 146, 162, 164, 148, 164, 168, 148, 162, 178, 144, 164, 168, 156, 158, 150, 164, 160, 148, 170, 162, 142, 154, 166, 132, 154, 172, 140, 158, 162, 156, 152, 162, 162, 166, 158, 170, 166, 150, 170, 170, 142, 160, 160, 150, 150, 156, 154, 158, 152, 158, 144, 148, 160, 158, 142, 172, 168, 144, 166, 172, 152, 164, 162, 158, 154, 156, 154, 156, 146, 166, 154, 132, 168, 158, 146, 156, 170, 144, 158, 166, 150, 158, 162, 160, 162, 154, 174, 164, 138, 170, 164, 144, 160, 166, 142, 156, 152, 142, 150, 150, 160, 160, 156, 156, 164, 150, 164, 166, 142, 164, 174, 138, 150, 158, 138, 148, 144, 148, 150, 140, 158, 144, 146, 156, 164, 134, 160, 166, 146, 156, 168, 154, 154, 162, 152, 156, 154, 154, 150, 134, 158, 164, 130, 144, 160, 132, 154, 156, 140, 150, 160, 148, 158, 148, 166, 154, 146, 168, 166, 146, 162, 168, 138, 152, 158, 138, 146, 154, 140, 138, 144, 156, 148, 140, 164, 162, 142, 166, 166, 150, 156, 176, 142, 162, 170, 156, 166, 150, 172, 158, 146, 170, 162, 142, 154, 170, 136, 154, 166, 144, 156, 158, 156, 162, 156, 164, 170, 150, 174, 168, 142, 166, 174, 144, 148, 170, 148, 146, 152, 152, 154, 152, 150, 154, 148, 166, 170, 148, 160, 172, 146, 160, 174, 160, 162, 160, 166, 154, 150, 162, 154, 146, 170, 154, 136, 170, 162, 144, 162, 162, 156, 148, 164, 152, 160, 156, 168, 160, 152, 174, 164, 144, 158, 172, 142, 156, 166, 142, 150, 148, 150, 152, 152, 164, 152, 152, 166, 160, 148, 176, 174, 144, 168, 162, 152, 154, 160, 158, 158, 150, 154, 160, 146, 162, 160, 140, 152, 168, 134, 166, 162, 152, 156, 170, 152, 158, 162, 170, 166, 156, 170, 158, 136, 164, 168, 146, 154, 158, 144, 154, 158, 150, 150, 156, 150, 162, 150, 168, 166, 154, 160, 176, 146, 172, 168, 156, 154, 162, 146, 156, 154, 164, 148, 144, 162, 164, 138, 164}, + {170, 154, 170, 148, 172, 154, 142, 166, 162, 130, 156, 154, 142, 150, 164, 150, 158, 158, 162, 158, 152, 172, 170, 154, 172, 172, 142, 156, 174, 140, 158, 156, 154, 156, 146, 160, 162, 140, 164, 156, 148, 158, 176, 136, 170, 172, 146, 158, 172, 156, 158, 162, 158, 160, 154, 158, 164, 144, 160, 164, 134, 150, 170, 138, 158, 158, 166, 148, 150, 164, 164, 156, 164, 164, 154, 164, 172, 142, 168, 158, 146, 152, 168, 146, 148, 156, 152, 154, 146, 168, 160, 148, 174, 162, 148, 162, 182, 144, 162, 172, 158, 152, 162, 154, 154, 142, 170, 156, 142, 164, 164, 138, 158, 156, 136, 168, 168, 146, 150, 168, 150, 158, 146, 160, 156, 142, 164, 156, 136, 148, 158, 134, 144, 164, 134, 146, 142, 158, 156, 146, 166, 166, 146, 164, 164, 150, 156, 170, 134, 150, 158, 142, 144, 148, 142, 146, 142, 152, 150, 140, 164, 154, 138, 162, 172, 140, 160, 166, 154, 154, 164, 150, 154, 152, 154, 150, 130, 156, 152, 132, 154, 154, 140, 146, 158, 146, 142, 162, 156, 152, 152, 166, 164, 148, 178, 172, 148, 160, 168, 144, 154, 168, 144, 154, 156, 158, 156, 148, 152, 164, 140, 164, 158, 146, 158, 170, 138, 174, 168, 152, 156, 168, 164, 158, 152, 164, 166, 142, 166, 160, 146, 156, 166, 134, 158, 166, 144, 152, 154, 158, 154, 144, 176, 164, 152, 164, 172, 146, 162, 168, 148, 160, 162, 152, 144, 160, 148, 144, 150, 158, 150, 146, 164, 164, 144, 172, 170, 144, 158, 180, 148, 158, 166, 158, 156, 154, 160, 162, 142, 174, 160, 144, 158, 162, 142, 148, 170, 146, 158, 172, 154, 154, 160, 170, 156, 158, 174, 168, 152, 160, 162, 146, 154, 168, 138, 150, 166, 146, 146, 150, 164, 152, 146, 164, 164, 144, 168, 170, 152, 150, 184, 140, 158, 170, 156, 160, 156, 150, 160, 150, 162, 158, 142, 160, 168, 138, 158, 168, 142, 154, 164, 154, 162, 160, 166, 158, 160, 162, 162, 148, 164, 170, 136, 148, 168, 140, 152, 146, 160, 152}, + {146, 158, 168, 146, 154, 160, 162, 150, 152, 162, 146, 150, 160, 158, 148, 158, 168, 142, 166, 162, 156, 158, 166, 152, 150, 162, 160, 160, 148, 164, 164, 132, 164, 154, 150, 152, 164, 140, 154, 162, 156, 162, 156, 158, 158, 152, 168, 168, 154, 168, 166, 138, 162, 162, 146, 156, 158, 144, 146, 158, 150, 160, 144, 158, 164, 146, 162, 162, 154, 170, 170, 148, 164, 180, 150, 152, 160, 162, 154, 152, 164, 156, 138, 168, 156, 136, 160, 162, 150, 152, 158, 150, 150, 164, 164, 160, 158, 164, 162, 154, 162, 162, 144, 168, 170, 146, 148, 162, 150, 146, 154, 158, 152, 152, 162, 158, 150, 170, 156, 150, 166, 162, 152, 156, 162, 142, 144, 154, 140, 144, 144, 146, 148, 140, 160, 158, 138, 168, 158, 150, 154, 162, 154, 152, 166, 154, 158, 144, 168, 150, 142, 156, 152, 138, 154, 152, 140, 148, 154, 140, 142, 154, 152, 154, 150, 164, 158, 160, 164, 164, 142, 168, 160, 146, 154, 160, 142, 142, 148, 148, 142, 142, 146, 148, 138, 156, 158, 142, 158, 174, 144, 156, 164, 156, 158, 166, 160, 162, 158, 162, 170, 148, 166, 164, 138, 164, 154, 146, 156, 158, 140, 146, 170, 150, 158, 158, 160, 156, 146, 176, 164, 158, 166, 172, 138, 158, 168, 148, 146, 160, 148, 150, 148, 158, 154, 146, 162, 162, 148, 162, 166, 150, 154, 176, 150, 164, 170, 154, 164, 154, 156, 158, 146, 160, 162, 142, 168, 162, 138, 150, 166, 148, 154, 158, 158, 146, 158, 166, 166, 154, 168, 162, 154, 164, 168, 140, 164, 164, 148, 142, 158, 150, 152, 156, 150, 160, 146, 162, 158, 146, 168, 162, 158, 158, 172, 154, 160, 166, 158, 148, 164, 154, 152, 144, 160, 160, 142, 164, 162, 142, 160, 162, 148, 158, 160, 150, 158, 162, 162, 174, 148, 178, 162, 140, 172, 152, 148, 164, 164, 138, 150, 160, 148, 150, 146, 156, 156, 148, 164, 166, 152, 166, 168, 152, 168, 170, 146, 158, 166, 154, 152, 152, 162, 158, 152, 166, 148, 150, 154, 164}, + {162, 160, 152, 168, 156, 150, 152, 158, 144, 154, 160, 154, 146, 162, 154, 142, 158, 152, 162, 160, 162, 160, 160, 166, 176, 150, 162, 164, 150, 154, 160, 154, 154, 160, 142, 150, 144, 162, 158, 150, 152, 154, 152, 162, 168, 160, 168, 158, 158, 154, 170, 160, 158, 160, 158, 158, 148, 158, 156, 144, 156, 152, 146, 158, 156, 156, 146, 162, 156, 156, 158, 160, 166, 154, 170, 158, 160, 162, 160, 152, 150, 168, 148, 144, 162, 148, 148, 156, 152, 158, 152, 160, 160, 152, 168, 168, 148, 168, 164, 162, 156, 166, 152, 150, 152, 152, 156, 148, 156, 156, 146, 154, 162, 148, 162, 160, 156, 148, 156, 156, 158, 158, 158, 160, 152, 150, 146, 148, 154, 148, 144, 152, 146, 142, 138, 144, 150, 140, 156, 156, 160, 150, 158, 168, 142, 162, 160, 156, 160, 156, 152, 148, 148, 142, 140, 148, 142, 156, 136, 154, 148, 146, 160, 158, 154, 158, 162, 148, 156, 160, 166, 148, 162, 152, 156, 138, 154, 154, 140, 150, 150, 142, 152, 148, 152, 144, 150, 156, 152, 150, 160, 164, 148, 170, 162, 148, 168, 172, 154, 164, 164, 152, 152, 162, 154, 150, 152, 154, 146, 150, 158, 164, 138, 164, 168, 144, 162, 170, 164, 158, 164, 158, 154, 160, 166, 160, 152, 164, 166, 140, 160, 162, 150, 152, 152, 150, 152, 160, 150, 152, 162, 164, 164, 150, 164, 168, 154, 168, 160, 160, 162, 160, 154, 154, 164, 148, 146, 150, 150, 154, 148, 158, 158, 152, 160, 164, 152, 168, 160, 162, 162, 176, 154, 156, 162, 164, 154, 156, 148, 164, 150, 154, 156, 150, 162, 150, 156, 152, 158, 158, 150, 154, 160, 166, 154, 168, 168, 152, 162, 166, 146, 168, 152, 154, 156, 154, 150, 146, 150, 156, 154, 154, 158, 156, 152, 162, 152, 158, 170, 162, 156, 160, 166, 166, 148, 170, 150, 154, 148, 166, 158, 136, 160, 154, 150, 166, 158, 154, 152, 158, 150, 158, 166, 162, 166, 154, 168, 166, 154, 158, 164, 148, 162, 156, 146, 146, 166, 152, 144, 158}, + {168, 158, 154, 160, 156, 158, 158, 160, 154, 152, 154, 144, 152, 148, 154, 166, 152, 162, 152, 156, 168, 160, 158, 160, 160, 166, 160, 160, 158, 168, 152, 156, 148, 150, 160, 158, 150, 162, 146, 150, 162, 162, 154, 158, 152, 156, 166, 162, 162, 168, 152, 162, 160, 152, 160, 154, 154, 150, 156, 158, 146, 160, 156, 152, 146, 162, 162, 154, 158, 164, 158, 172, 156, 162, 162, 170, 146, 154, 164, 148, 164, 148, 156, 152, 148, 160, 158, 150, 160, 152, 154, 156, 162, 156, 158, 166, 170, 150, 162, 156, 168, 156, 160, 162, 148, 162, 152, 154, 148, 158, 150, 146, 152, 156, 154, 156, 150, 160, 170, 152, 158, 154, 162, 150, 158, 148, 150, 148, 136, 146, 142, 140, 146, 144, 150, 152, 150, 154, 152, 158, 148, 160, 164, 156, 160, 150, 160, 156, 148, 152, 146, 152, 148, 150, 144, 148, 150, 144, 148, 146, 150, 142, 146, 158, 154, 156, 150, 162, 158, 158, 152, 160, 148, 162, 148, 154, 148, 142, 150, 138, 152, 140, 150, 140, 140, 152, 152, 156, 148, 160, 164, 154, 158, 154, 164, 172, 154, 166, 158, 162, 152, 162, 154, 156, 154, 154, 156, 152, 162, 150, 156, 144, 158, 148, 152, 162, 160, 148, 164, 162, 158, 162, 168, 154, 164, 158, 152, 154, 158, 158, 152, 150, 152, 156, 150, 152, 156, 150, 160, 162, 156, 152, 158, 172, 162, 156, 168, 158, 172, 144, 158, 164, 154, 156, 146, 154, 160, 144, 162, 152, 152, 158, 148, 152, 152, 156, 156, 160, 164, 158, 158, 156, 164, 160, 164, 152, 158, 152, 162, 154, 150, 152, 158, 144, 144, 162, 144, 168, 158, 150, 162, 156, 168, 156, 160, 164, 158, 164, 150, 164, 162, 150, 162, 152, 148, 156, 154, 150, 154, 146, 158, 148, 154, 158, 166, 156, 168, 158, 156, 168, 162, 156, 164, 152, 160, 150, 158, 158, 152, 154, 148, 160, 148, 154, 146, 146, 152, 160, 162, 150, 166, 158, 152, 158, 168, 162, 168, 154, 154, 160, 156, 160, 146, 158, 154, 152, 150, 150, 158, 150}, + {160, 168, 156, 154, 158, 146, 158, 150, 152, 148, 162, 154, 144, 160, 160, 142, 160, 150, 164, 154, 160, 170, 160, 156, 170, 160, 152, 162, 154, 152, 156, 154, 160, 148, 148, 156, 146, 148, 158, 152, 154, 154, 150, 158, 160, 174, 154, 162, 160, 156, 170, 162, 162, 150, 156, 156, 156, 148, 156, 148, 152, 148, 150, 154, 158, 158, 158, 162, 158, 150, 164, 152, 176, 160, 162, 156, 158, 158, 156, 162, 146, 154, 164, 150, 148, 154, 150, 148, 150, 160, 158, 154, 154, 154, 168, 156, 162, 162, 160, 174, 164, 152, 158, 162, 152, 152, 158, 150, 152, 160, 146, 156, 154, 150, 156, 158, 156, 160, 154, 162, 166, 158, 146, 162, 146, 154, 158, 146, 146, 154, 146, 144, 148, 146, 140, 152, 144, 154, 156, 146, 164, 154, 148, 168, 148, 164, 154, 156, 152, 160, 152, 146, 148, 148, 152, 142, 144, 148, 142, 144, 150, 158, 146, 160, 152, 156, 170, 156, 152, 164, 154, 160, 162, 148, 158, 146, 150, 148, 138, 148, 138, 146, 138, 156, 148, 136, 152, 152, 156, 158, 144, 164, 158, 164, 168, 160, 162, 164, 160, 154, 172, 150, 158, 154, 164, 154, 150, 150, 154, 148, 150, 156, 148, 158, 156, 160, 146, 162, 166, 154, 160, 170, 162, 166, 154, 164, 152, 162, 150, 152, 150, 154, 154, 148, 152, 154, 152, 154, 156, 156, 156, 160, 154, 152, 166, 168, 154, 166, 158, 162, 154, 156, 164, 146, 158, 156, 150, 152, 152, 158, 150, 150, 160, 152, 162, 162, 158, 152, 164, 170, 154, 166, 166, 172, 148, 162, 160, 154, 150, 152, 150, 150, 152, 162, 150, 142, 160, 148, 152, 158, 160, 160, 162, 172, 158, 158, 166, 156, 166, 158, 154, 150, 164, 156, 156, 158, 148, 152, 158, 150, 156, 158, 152, 158, 150, 150, 168, 156, 166, 160, 162, 158, 174, 158, 160, 160, 156, 158, 148, 158, 154, 146, 150, 152, 160, 146, 166, 148, 148, 162, 154, 156, 174, 162, 166, 158, 156, 160, 166, 154, 160, 156, 156, 158, 152, 146, 162, 148, 150, 154}, + {154, 172, 160, 154, 168, 162, 146, 166, 162, 150, 152, 144, 162, 148, 142, 170, 150, 154, 158, 156, 148, 166, 166, 158, 156, 166, 164, 158, 156, 166, 156, 160, 154, 150, 154, 158, 144, 146, 158, 154, 156, 156, 168, 152, 158, 156, 168, 160, 158, 168, 154, 154, 164, 160, 148, 160, 158, 146, 158, 156, 148, 156, 148, 160, 152, 146, 160, 148, 152, 168, 156, 160, 174, 156, 162, 162, 166, 162, 156, 156, 164, 146, 150, 160, 144, 148, 160, 150, 142, 162, 150, 156, 160, 160, 152, 162, 166, 162, 162, 154, 162, 152, 158, 166, 154, 150, 160, 156, 146, 156, 156, 152, 146, 160, 152, 156, 156, 160, 156, 152, 158, 154, 152, 160, 158, 152, 148, 150, 142, 146, 144, 154, 136, 148, 154, 138, 146, 162, 146, 152, 164, 156, 162, 156, 166, 156, 160, 160, 160, 152, 150, 156, 142, 140, 150, 138, 146, 152, 144, 148, 148, 146, 150, 150, 162, 158, 146, 156, 166, 152, 156, 158, 150, 154, 164, 148, 146, 150, 156, 144, 152, 144, 158, 146, 134, 160, 144, 148, 160, 152, 158, 166, 152, 152, 162, 166, 162, 164, 164, 166, 146, 154, 162, 156, 146, 158, 148, 148, 156, 158, 142, 160, 158, 146, 158, 156, 166, 158, 160, 166, 164, 140, 170, 152, 156, 168, 166, 148, 164, 158, 154, 154, 154, 156, 154, 154, 152, 154, 152, 158, 152, 150, 162, 164, 146, 172, 164, 158, 160, 162, 162, 158, 152, 166, 148, 144, 160, 150, 148, 158, 146, 152, 156, 156, 154, 162, 164, 158, 156, 164, 168, 156, 152, 164, 152, 152, 166, 152, 156, 162, 156, 150, 152, 152, 154, 150, 154, 162, 162, 152, 162, 150, 152, 162, 154, 162, 166, 170, 160, 156, 162, 158, 160, 142, 166, 146, 146, 162, 146, 142, 164, 144, 148, 160, 156, 158, 156, 166, 164, 158, 154, 174, 152, 156, 166, 144, 150, 162, 152, 144, 166, 164, 144, 156, 152, 160, 150, 154, 168, 156, 152, 164, 154, 154, 162, 158, 160, 170, 158, 158, 156, 160, 156, 150, 148, 162, 148, 146, 158, 146}, + {164, 152, 164, 162, 148, 150, 168, 142, 140, 166, 140, 146, 162, 152, 150, 154, 160, 156, 162, 166, 162, 156, 158, 172, 154, 152, 168, 154, 144, 168, 150, 150, 166, 158, 150, 146, 162, 162, 142, 148, 164, 152, 136, 172, 148, 162, 164, 160, 158, 168, 168, 160, 152, 162, 158, 160, 150, 168, 150, 136, 168, 144, 148, 160, 154, 152, 160, 164, 156, 152, 160, 166, 158, 158, 166, 158, 150, 174, 148, 152, 160, 164, 140, 156, 158, 152, 154, 156, 158, 148, 146, 166, 154, 148, 176, 156, 148, 168, 156, 158, 170, 162, 156, 158, 166, 162, 148, 154, 166, 140, 142, 164, 150, 144, 168, 146, 148, 166, 160, 156, 160, 164, 162, 154, 152, 160, 150, 144, 158, 138, 134, 150, 144, 138, 152, 142, 138, 150, 162, 154, 154, 146, 162, 156, 154, 166, 152, 146, 170, 142, 152, 154, 146, 150, 142, 146, 144, 138, 152, 146, 146, 138, 158, 142, 142, 170, 154, 148, 168, 164, 152, 156, 166, 160, 146, 148, 156, 146, 134, 160, 136, 132, 156, 132, 150, 152, 152, 146, 146, 158, 160, 148, 162, 158, 160, 156, 168, 150, 146, 178, 162, 148, 166, 158, 152, 162, 160, 152, 154, 150, 158, 138, 148, 174, 148, 148, 164, 154, 150, 168, 164, 170, 154, 176, 162, 152, 156, 162, 152, 146, 164, 146, 150, 154, 146, 142, 164, 152, 150, 156, 166, 158, 158, 166, 178, 160, 154, 168, 158, 154, 170, 152, 144, 158, 162, 146, 156, 152, 152, 148, 156, 160, 150, 146, 168, 144, 148, 170, 162, 154, 164, 164, 166, 166, 168, 162, 152, 164, 160, 146, 142, 162, 150, 136, 166, 148, 142, 166, 142, 152, 158, 174, 152, 164, 166, 160, 162, 150, 170, 154, 158, 166, 144, 162, 156, 154, 148, 154, 154, 158, 146, 166, 156, 160, 148, 162, 150, 160, 166, 162, 156, 174, 160, 156, 162, 166, 152, 158, 160, 162, 140, 150, 162, 140, 142, 168, 140, 150, 160, 158, 158, 168, 158, 168, 162, 172, 160, 160, 160, 166, 154, 144, 164, 148, 150, 166, 142, 156, 160, 156}, + {168, 162, 154, 168, 152, 150, 160, 164, 150, 150, 164, 152, 146, 148, 162, 146, 148, 162, 154, 138, 174, 152, 158, 168, 170, 158, 166, 172, 162, 150, 164, 158, 142, 144, 166, 142, 136, 164, 148, 148, 160, 160, 154, 158, 162, 156, 160, 160, 170, 146, 156, 182, 150, 148, 172, 152, 146, 162, 150, 156, 144, 166, 148, 146, 152, 160, 152, 142, 168, 154, 154, 178, 156, 148, 178, 158, 162, 152, 170, 158, 152, 152, 168, 144, 144, 166, 146, 136, 172, 148, 150, 162, 156, 160, 152, 168, 160, 156, 160, 174, 154, 154, 170, 142, 142, 164, 150, 146, 160, 152, 152, 152, 152, 160, 146, 160, 166, 144, 152, 172, 150, 140, 168, 160, 142, 166, 146, 146, 150, 150, 150, 142, 152, 154, 140, 142, 158, 142, 138, 166, 140, 158, 170, 154, 158, 156, 168, 160, 152, 158, 156, 148, 146, 154, 142, 140, 158, 140, 136, 150, 146, 142, 158, 162, 152, 152, 158, 166, 148, 154, 174, 152, 140, 164, 152, 146, 162, 138, 150, 152, 148, 150, 144, 148, 146, 144, 142, 160, 150, 142, 160, 156, 148, 168, 158, 160, 170, 170, 164, 158, 166, 162, 150, 150, 170, 144, 136, 168, 142, 138, 168, 154, 148, 160, 156, 158, 160, 162, 160, 152, 158, 168, 160, 144, 180, 152, 156, 168, 156, 150, 162, 156, 148, 150, 162, 162, 138, 150, 164, 152, 142, 168, 152, 140, 172, 152, 160, 166, 168, 158, 152, 164, 168, 162, 148, 168, 144, 142, 170, 144, 142, 160, 150, 150, 158, 160, 158, 150, 170, 166, 152, 154, 168, 160, 144, 172, 150, 142, 166, 156, 152, 160, 156, 150, 146, 150, 170, 146, 152, 170, 146, 144, 176, 150, 148, 184, 158, 158, 168, 162, 156, 156, 166, 156, 146, 156, 154, 144, 144, 160, 154, 132, 168, 148, 156, 166, 154, 154, 168, 166, 160, 156, 158, 174, 158, 144, 168, 148, 138, 166, 156, 144, 152, 158, 146, 152, 160, 152, 156, 148, 164, 142, 162, 168, 154, 148, 176, 154, 148, 168, 156, 158, 158, 154, 156, 148, 156, 152, 142, 144}, + {174, 154, 160, 156, 160, 170, 152, 144, 174, 146, 132, 170, 144, 144, 160, 152, 148, 164, 156, 160, 152, 166, 168, 162, 152, 170, 154, 148, 172, 160, 138, 174, 156, 146, 156, 156, 160, 146, 154, 160, 142, 154, 166, 148, 142, 176, 160, 148, 168, 166, 154, 164, 170, 156, 150, 172, 158, 144, 158, 154, 150, 134, 168, 146, 144, 168, 154, 150, 162, 160, 158, 158, 164, 168, 152, 160, 178, 148, 142, 166, 158, 142, 158, 150, 146, 156, 152, 154, 150, 160, 158, 150, 150, 162, 154, 152, 172, 164, 152, 176, 160, 156, 158, 164, 166, 158, 156, 158, 144, 152, 160, 142, 140, 168, 148, 144, 154, 162, 152, 162, 170, 160, 154, 156, 170, 144, 148, 162, 136, 140, 156, 144, 128, 160, 140, 140, 154, 148, 152, 154, 154, 164, 142, 160, 162, 150, 146, 176, 150, 144, 168, 144, 142, 158, 142, 148, 140, 150, 148, 144, 142, 156, 140, 142, 170, 152, 142, 170, 162, 152, 162, 156, 154, 156, 158, 154, 148, 150, 154, 132, 146, 152, 138, 134, 160, 142, 138, 152, 152, 156, 162, 154, 160, 148, 164, 174, 148, 156, 162, 154, 148, 176, 156, 140, 170, 156, 150, 150, 158, 160, 144, 142, 166, 142, 156, 164, 154, 138, 178, 156, 148, 180, 154, 164, 160, 166, 156, 152, 164, 156, 142, 152, 162, 146, 136, 160, 156, 142, 168, 158, 152, 158, 164, 160, 158, 170, 164, 150, 154, 180, 148, 144, 168, 146, 146, 160, 156, 152, 154, 158, 146, 150, 152, 168, 142, 150, 160, 160, 148, 168, 164, 154, 172, 160, 164, 148, 166, 166, 148, 156, 166, 142, 146, 162, 144, 148, 164, 152, 146, 154, 164, 158, 154, 166, 162, 152, 160, 172, 142, 156, 172, 142, 148, 162, 156, 144, 166, 150, 148, 154, 152, 160, 146, 152, 164, 140, 158, 168, 156, 144, 186, 164, 146, 172, 154, 154, 166, 156, 166, 146, 152, 162, 142, 152, 166, 142, 138, 166, 144, 152, 168, 158, 152, 168, 164, 168, 150, 170, 172, 152, 158, 162, 152, 148, 172, 148, 134, 170, 156, 142}, + {148, 168, 174, 160, 136, 174, 152, 150, 160, 150, 160, 146, 152, 156, 146, 156, 158, 144, 150, 164, 148, 146, 178, 156, 158, 172, 156, 164, 156, 152, 162, 146, 160, 164, 140, 142, 160, 156, 136, 166, 156, 136, 164, 160, 160, 158, 154, 168, 156, 152, 176, 154, 152, 170, 154, 138, 168, 152, 142, 170, 138, 156, 152, 152, 162, 144, 158, 168, 144, 156, 164, 160, 144, 176, 160, 146, 174, 162, 160, 158, 148, 164, 146, 158, 166, 148, 146, 154, 140, 142, 170, 148, 150, 170, 156, 160, 168, 156, 166, 154, 158, 174, 150, 152, 164, 148, 146, 162, 154, 136, 164, 146, 150, 152, 150, 162, 152, 152, 174, 142, 158, 170, 146, 148, 164, 152, 146, 156, 150, 140, 148, 138, 150, 140, 148, 158, 132, 144, 162, 144, 146, 162, 166, 142, 172, 164, 158, 158, 158, 160, 148, 154, 158, 134, 146, 156, 142, 128, 160, 144, 130, 156, 146, 146, 160, 146, 162, 150, 154, 164, 148, 160, 168, 150, 150, 160, 156, 130, 164, 138, 140, 154, 144, 150, 136, 146, 158, 142, 156, 156, 154, 146, 172, 158, 146, 180, 160, 154, 172, 162, 168, 148, 158, 170, 144, 156, 164, 146, 136, 164, 152, 150, 154, 154, 144, 160, 152, 158, 154, 168, 170, 150, 156, 174, 160, 148, 172, 158, 142, 170, 160, 148, 158, 148, 156, 146, 150, 166, 140, 152, 166, 154, 152, 170, 158, 148, 170, 168, 150, 168, 164, 164, 150, 166, 164, 140, 158, 158, 144, 138, 164, 148, 138, 172, 156, 152, 168, 150, 164, 160, 158, 170, 154, 164, 176, 150, 148, 162, 156, 144, 164, 148, 144, 160, 152, 148, 148, 156, 162, 150, 156, 166, 154, 158, 176, 156, 154, 178, 162, 156, 166, 164, 162, 152, 148, 164, 142, 154, 166, 138, 150, 156, 154, 144, 166, 162, 146, 168, 156, 164, 158, 164, 170, 154, 160, 172, 142, 152, 162, 160, 136, 172, 148, 140, 158, 152, 160, 154, 152, 166, 146, 160, 162, 154, 156, 174, 162, 148, 174, 158, 144, 174, 146, 160, 156, 148, 164, 134, 150, 162}, + {156, 156, 164, 152, 168, 150, 162, 156, 142, 156, 152, 148, 146, 162, 150, 144, 164, 152, 156, 164, 156, 168, 152, 162, 166, 146, 166, 164, 160, 152, 166, 160, 142, 162, 150, 152, 154, 150, 162, 140, 150, 172, 150, 154, 160, 152, 162, 166, 160, 160, 174, 158, 156, 166, 152, 158, 154, 154, 164, 138, 156, 162, 150, 144, 154, 160, 134, 166, 158, 152, 170, 158, 170, 152, 160, 168, 152, 164, 160, 154, 158, 170, 152, 142, 168, 148, 140, 164, 152, 154, 146, 162, 164, 138, 160, 166, 152, 156, 172, 162, 154, 170, 158, 158, 164, 156, 160, 156, 146, 164, 150, 158, 158, 146, 148, 160, 152, 148, 166, 164, 146, 172, 154, 156, 152, 156, 162, 140, 146, 162, 142, 140, 158, 144, 132, 150, 146, 144, 156, 150, 156, 154, 142, 166, 152, 162, 166, 146, 152, 162, 156, 146, 162, 144, 134, 160, 138, 148, 140, 144, 160, 138, 140, 158, 146, 160, 164, 162, 150, 170, 164, 140, 172, 148, 160, 152, 148, 160, 136, 154, 142, 146, 140, 146, 142, 134, 162, 136, 144, 168, 142, 160, 156, 144, 172, 148, 164, 164, 152, 162, 168, 164, 142, 170, 156, 144, 160, 152, 160, 146, 150, 150, 148, 154, 166, 152, 154, 158, 154, 152, 164, 160, 160, 172, 152, 164, 158, 154, 160, 144, 152, 164, 140, 152, 162, 148, 138, 162, 158, 142, 162, 156, 150, 162, 154, 166, 160, 154, 174, 156, 152, 168, 160, 142, 160, 158, 146, 168, 144, 154, 158, 150, 158, 146, 154, 164, 138, 162, 168, 158, 154, 170, 160, 146, 172, 158, 154, 160, 162, 158, 142, 160, 166, 140, 150, 160, 146, 140, 166, 148, 144, 168, 152, 154, 162, 160, 164, 156, 162, 166, 150, 154, 156, 156, 148, 170, 158, 136, 160, 146, 146, 162, 152, 158, 146, 150, 174, 148, 162, 174, 150, 154, 164, 158, 158, 160, 160, 154, 162, 146, 160, 142, 156, 168, 136, 152, 154, 148, 154, 162, 154, 150, 172, 158, 154, 158, 160, 172, 152, 158, 166, 142, 166, 154, 152, 152, 152, 154, 138, 166}, + {166, 166, 162, 168, 156, 156, 152, 160, 160, 148, 172, 138, 152, 152, 146, 164, 144, 162, 150, 160, 154, 158, 164, 154, 176, 156, 156, 178, 154, 158, 156, 146, 162, 140, 158, 150, 152, 146, 150, 158, 144, 160, 150, 150, 164, 148, 164, 160, 162, 162, 154, 162, 168, 154, 162, 160, 148, 148, 158, 154, 148, 160, 140, 152, 154, 148, 162, 146, 156, 162, 144, 164, 164, 166, 154, 174, 158, 152, 170, 152, 142, 156, 152, 158, 144, 156, 158, 142, 144, 160, 152, 146, 160, 162, 150, 164, 156, 166, 168, 156, 164, 158, 158, 160, 150, 160, 158, 154, 144, 158, 152, 138, 160, 152, 148, 154, 152, 168, 150, 154, 172, 144, 156, 164, 162, 144, 164, 152, 148, 152, 140, 140, 150, 138, 152, 142, 144, 152, 142, 148, 158, 160, 150, 162, 154, 154, 174, 152, 154, 164, 146, 160, 148, 144, 158, 132, 146, 150, 142, 144, 144, 156, 140, 152, 150, 156, 158, 146, 158, 156, 162, 166, 148, 156, 158, 160, 154, 150, 146, 140, 160, 134, 144, 150, 144, 150, 140, 152, 156, 150, 160, 156, 160, 162, 156, 164, 150, 176, 152, 158, 174, 146, 168, 152, 158, 158, 138, 154, 156, 150, 146, 156, 148, 142, 168, 146, 152, 162, 154, 168, 158, 164, 164, 152, 164, 166, 162, 154, 166, 152, 150, 164, 150, 148, 158, 148, 162, 142, 154, 162, 148, 154, 168, 148, 160, 170, 156, 162, 172, 154, 160, 164, 150, 162, 156, 148, 164, 142, 156, 152, 152, 140, 160, 150, 138, 168, 162, 144, 166, 156, 170, 160, 164, 174, 154, 160, 162, 150, 152, 162, 154, 142, 160, 148, 146, 160, 150, 156, 150, 152, 172, 144, 160, 158, 164, 152, 168, 164, 152, 176, 158, 156, 166, 150, 158, 156, 142, 158, 148, 156, 156, 142, 146, 164, 156, 146, 158, 158, 154, 174, 158, 162, 162, 162, 166, 162, 152, 164, 150, 158, 154, 158, 142, 156, 158, 146, 158, 150, 156, 160, 142, 168, 146, 166, 172, 156, 156, 166, 174, 148, 172, 154, 154, 170, 146, 158, 156, 152, 154, 138}, + {160, 162, 154, 162, 172, 146, 158, 160, 144, 158, 140, 158, 154, 152, 152, 150, 150, 154, 158, 148, 162, 160, 154, 164, 154, 160, 156, 162, 164, 160, 156, 168, 154, 158, 142, 170, 144, 150, 164, 134, 158, 154, 152, 162, 150, 164, 158, 164, 160, 170, 160, 154, 168, 154, 156, 162, 156, 162, 162, 148, 150, 154, 152, 162, 150, 150, 156, 150, 150, 168, 154, 156, 170, 148, 166, 156, 160, 172, 152, 166, 170, 150, 154, 162, 150, 142, 158, 146, 154, 160, 148, 154, 150, 158, 162, 150, 166, 164, 160, 156, 168, 160, 150, 176, 156, 142, 170, 140, 166, 148, 146, 154, 144, 156, 156, 154, 150, 158, 158, 150, 160, 160, 160, 160, 146, 166, 150, 144, 152, 140, 150, 142, 150, 140, 150, 142, 138, 156, 144, 150, 164, 144, 162, 156, 148, 164, 154, 158, 158, 146, 152, 158, 156, 140, 148, 148, 146, 146, 138, 150, 144, 138, 152, 144, 154, 146, 164, 154, 158, 152, 160, 162, 158, 152, 160, 148, 156, 158, 140, 146, 150, 146, 146, 142, 140, 156, 142, 140, 146, 150, 156, 160, 152, 156, 168, 152, 164, 156, 160, 158, 160, 166, 156, 160, 152, 162, 164, 152, 166, 144, 148, 160, 142, 154, 150, 160, 156, 160, 156, 156, 164, 152, 172, 158, 156, 174, 150, 164, 160, 154, 158, 146, 154, 150, 150, 150, 146, 154, 148, 158, 152, 152, 164, 156, 154, 164, 154, 162, 158, 166, 160, 162, 160, 158, 152, 152, 164, 146, 150, 160, 142, 158, 160, 142, 168, 148, 156, 164, 150, 158, 162, 156, 154, 162, 158, 158, 166, 162, 154, 164, 148, 162, 146, 154, 148, 148, 146, 156, 152, 144, 160, 160, 150, 174, 148, 164, 164, 156, 164, 152, 160, 160, 152, 156, 166, 154, 150, 156, 146, 152, 160, 152, 154, 152, 150, 164, 152, 152, 162, 148, 162, 170, 160, 156, 166, 162, 154, 166, 146, 156, 162, 142, 154, 148, 142, 156, 148, 156, 150, 158, 152, 158, 156, 158, 166, 156, 166, 160, 150, 170, 156, 152, 158, 148, 156, 156, 152, 144, 154, 154}, + {160, 166, 164, 156, 158, 164, 154, 160, 148, 156, 150, 158, 150, 140, 158, 160, 148, 158, 154, 164, 152, 166, 160, 166, 168, 156, 162, 156, 162, 164, 152, 150, 162, 152, 158, 146, 154, 144, 150, 154, 154, 152, 152, 158, 158, 152, 160, 160, 158, 168, 152, 164, 156, 166, 162, 158, 158, 152, 146, 158, 152, 150, 150, 154, 142, 158, 156, 150, 156, 148, 162, 160, 158, 164, 164, 164, 158, 160, 164, 148, 158, 152, 156, 158, 152, 152, 152, 154, 152, 152, 150, 158, 156, 148, 162, 150, 162, 166, 154, 166, 166, 154, 172, 160, 152, 166, 152, 158, 152, 154, 148, 156, 148, 146, 156, 148, 154, 158, 156, 158, 162, 154, 156, 158, 158, 158, 156, 152, 152, 150, 144, 154, 130, 150, 146, 138, 148, 148, 148, 148, 152, 152, 154, 158, 162, 162, 154, 156, 164, 158, 158, 156, 148, 152, 152, 134, 146, 140, 148, 138, 148, 142, 144, 150, 148, 164, 136, 158, 158, 150, 162, 162, 156, 160, 158, 154, 152, 150, 148, 148, 142, 136, 148, 134, 156, 142, 138, 154, 152, 148, 152, 156, 160, 150, 156, 160, 160, 160, 168, 170, 150, 164, 170, 148, 162, 152, 144, 152, 152, 148, 154, 150, 154, 152, 150, 152, 160, 150, 162, 162, 156, 170, 154, 156, 162, 160, 164, 156, 150, 160, 158, 158, 152, 160, 148, 152, 160, 140, 156, 154, 150, 158, 150, 158, 158, 164, 166, 164, 160, 156, 168, 148, 154, 162, 150, 158, 152, 152, 146, 148, 158, 150, 150, 150, 156, 154, 152, 160, 154, 164, 166, 154, 166, 162, 160, 166, 156, 154, 154, 150, 158, 156, 156, 150, 156, 144, 150, 158, 146, 164, 156, 152, 158, 158, 162, 166, 162, 156, 168, 164, 160, 164, 152, 156, 154, 146, 164, 148, 150, 144, 152, 150, 146, 158, 152, 158, 160, 162, 158, 160, 162, 162, 156, 168, 160, 154, 162, 152, 156, 152, 158, 154, 160, 148, 150, 156, 146, 158, 158, 146, 164, 158, 148, 164, 162, 164, 154, 164, 162, 158, 166, 160, 160, 154, 158, 154, 146, 160, 152, 142}, + {164, 158, 162, 164, 152, 164, 160, 148, 168, 156, 150, 146, 158, 148, 142, 154, 152, 146, 158, 152, 160, 142, 168, 158, 150, 168, 170, 160, 156, 168, 160, 150, 158, 154, 154, 148, 158, 152, 146, 158, 156, 140, 162, 150, 150, 156, 160, 156, 158, 158, 172, 160, 162, 162, 162, 146, 154, 162, 152, 160, 152, 148, 148, 158, 148, 146, 154, 156, 160, 160, 158, 156, 152, 164, 166, 148, 168, 166, 152, 164, 154, 154, 158, 152, 150, 154, 144, 154, 156, 142, 154, 156, 146, 164, 156, 154, 158, 166, 162, 158, 154, 170, 158, 156, 158, 158, 148, 160, 158, 146, 158, 154, 146, 158, 144, 156, 148, 156, 152, 156, 158, 160, 166, 150, 154, 160, 146, 162, 154, 140, 146, 146, 148, 142, 150, 138, 152, 142, 146, 154, 144, 164, 156, 146, 166, 162, 160, 150, 158, 150, 150, 164, 150, 148, 148, 152, 144, 142, 142, 154, 138, 150, 142, 146, 156, 156, 156, 156, 166, 158, 162, 164, 152, 160, 150, 158, 150, 148, 152, 152, 136, 150, 146, 150, 132, 152, 144, 142, 146, 156, 152, 150, 150, 164, 150, 170, 160, 160, 156, 166, 170, 154, 166, 160, 152, 162, 152, 158, 144, 164, 148, 144, 158, 156, 146, 152, 158, 154, 148, 160, 162, 158, 164, 164, 160, 158, 166, 172, 146, 158, 154, 150, 156, 156, 152, 138, 150, 162, 144, 154, 152, 158, 156, 160, 152, 154, 164, 160, 156, 168, 166, 162, 162, 156, 160, 162, 152, 158, 156, 142, 154, 156, 146, 154, 162, 144, 156, 154, 154, 164, 166, 162, 164, 160, 162, 160, 168, 152, 164, 150, 158, 158, 146, 150, 156, 152, 152, 150, 152, 148, 154, 154, 158, 150, 162, 168, 152, 164, 166, 154, 170, 162, 156, 154, 158, 158, 142, 164, 152, 154, 146, 154, 156, 144, 160, 154, 146, 152, 168, 152, 158, 172, 156, 158, 168, 160, 156, 166, 156, 162, 142, 152, 152, 144, 156, 152, 154, 144, 160, 154, 150, 164, 162, 156, 158, 156, 164, 154, 162, 162, 156, 160, 164, 148, 152, 156, 158, 144, 152, 154}, + {164, 152, 160, 164, 160, 148, 166, 154, 152, 158, 158, 150, 144, 160, 158, 146, 162, 160, 144, 160, 158, 158, 156, 170, 168, 146, 160, 168, 154, 158, 162, 160, 142, 160, 158, 148, 150, 158, 146, 140, 158, 160, 144, 170, 156, 164, 144, 174, 166, 148, 168, 158, 154, 164, 168, 160, 150, 154, 156, 144, 162, 150, 154, 138, 160, 152, 148, 156, 152, 146, 160, 164, 164, 148, 172, 164, 156, 162, 160, 158, 164, 156, 156, 146, 160, 154, 148, 148, 156, 156, 142, 160, 154, 148, 158, 164, 154, 158, 170, 158, 154, 158, 166, 158, 150, 168, 156, 148, 160, 158, 142, 148, 158, 146, 156, 152, 156, 144, 162, 156, 152, 162, 162, 160, 156, 156, 162, 142, 154, 158, 138, 144, 150, 138, 138, 154, 142, 140, 148, 154, 148, 146, 160, 154, 144, 162, 168, 162, 156, 164, 164, 136, 162, 156, 138, 148, 148, 146, 140, 144, 146, 140, 152, 148, 140, 150, 152, 152, 146, 162, 158, 154, 166, 162, 152, 152, 164, 152, 142, 150, 158, 144, 142, 142, 150, 132, 152, 148, 142, 154, 158, 152, 156, 158, 162, 150, 168, 158, 158, 158, 160, 162, 152, 164, 156, 144, 162, 166, 148, 144, 162, 146, 140, 156, 162, 146, 162, 160, 166, 144, 160, 170, 144, 172, 166, 154, 154, 164, 164, 148, 166, 146, 150, 154, 156, 154, 140, 152, 160, 140, 166, 156, 148, 156, 174, 156, 156, 170, 162, 156, 156, 162, 162, 148, 154, 154, 142, 160, 154, 154, 142, 162, 152, 142, 158, 164, 150, 156, 164, 150, 148, 170, 158, 154, 168, 164, 154, 160, 162, 156, 148, 154, 156, 148, 146, 154, 154, 148, 152, 158, 146, 156, 158, 156, 160, 166, 168, 152, 160, 164, 152, 156, 164, 154, 148, 162, 158, 144, 156, 152, 144, 152, 158, 152, 142, 162, 160, 150, 156, 166, 160, 154, 166, 162, 156, 168, 160, 146, 160, 158, 156, 154, 152, 152, 148, 154, 150, 152, 140, 162, 156, 144, 160, 164, 162, 162, 168, 166, 152, 170, 166, 146, 158, 158, 160, 146, 156, 160, 148, 150}, + {174, 166, 152, 164, 168, 162, 142, 164, 166, 140, 154, 152, 146, 142, 156, 152, 136, 158, 164, 142, 160, 164, 160, 152, 166, 158, 160, 164, 174, 156, 152, 166, 158, 146, 164, 160, 142, 148, 156, 146, 148, 152, 158, 130, 164, 158, 154, 148, 174, 166, 142, 176, 166, 152, 164, 162, 164, 150, 164, 160, 134, 160, 152, 148, 144, 164, 154, 138, 168, 160, 148, 160, 160, 164, 150, 162, 168, 144, 170, 166, 152, 152, 164, 160, 142, 162, 154, 148, 142, 156, 160, 138, 162, 162, 144, 160, 164, 150, 160, 170, 158, 154, 166, 170, 152, 156, 158, 152, 146, 164, 150, 150, 156, 148, 140, 152, 156, 158, 148, 162, 166, 148, 162, 164, 158, 148, 158, 160, 140, 148, 156, 136, 146, 154, 148, 130, 152, 144, 142, 144, 162, 150, 154, 164, 158, 140, 170, 158, 148, 158, 160, 162, 140, 160, 148, 136, 148, 144, 144, 138, 152, 146, 140, 148, 158, 146, 158, 164, 152, 150, 164, 166, 152, 162, 156, 152, 152, 160, 156, 134, 144, 146, 142, 144, 154, 144, 130, 156, 152, 132, 162, 154, 154, 152, 150, 168, 152, 168, 166, 158, 162, 170, 158, 150, 170, 156, 148, 156, 162, 146, 148, 162, 146, 144, 156, 160, 140, 160, 158, 156, 150, 172, 170, 142, 162, 172, 152, 164, 162, 164, 146, 166, 154, 146, 156, 156, 144, 150, 150, 164, 140, 162, 160, 156, 150, 172, 164, 150, 170, 168, 150, 166, 174, 156, 154, 162, 162, 142, 160, 148, 150, 140, 158, 158, 134, 158, 156, 152, 158, 168, 164, 154, 170, 162, 146, 170, 168, 154, 160, 156, 164, 144, 162, 154, 148, 154, 154, 148, 144, 164, 158, 150, 162, 166, 148, 152, 174, 162, 158, 168, 164, 156, 156, 170, 158, 150, 156, 160, 138, 156, 158, 142, 148, 158, 158, 148, 158, 160, 150, 166, 166, 164, 156, 174, 160, 150, 162, 170, 154, 152, 164, 146, 146, 166, 152, 142, 154, 154, 152, 148, 158, 158, 146, 160, 164, 152, 160, 166, 164, 154, 162, 170, 146, 162, 154, 154, 148, 162, 146, 144}, + {150, 170, 162, 152, 164, 168, 158, 146, 156, 168, 140, 166, 162, 142, 146, 154, 158, 140, 160, 160, 146, 154, 162, 164, 146, 180, 160, 146, 162, 170, 156, 152, 156, 158, 142, 156, 154, 152, 150, 162, 146, 148, 164, 166, 142, 160, 164, 154, 156, 170, 160, 152, 160, 168, 146, 158, 164, 154, 144, 162, 164, 140, 156, 162, 142, 146, 154, 162, 146, 156, 160, 148, 164, 170, 162, 160, 168, 172, 144, 168, 166, 148, 152, 162, 156, 136, 160, 158, 144, 152, 156, 156, 146, 156, 160, 148, 164, 172, 152, 158, 166, 164, 154, 160, 164, 148, 166, 158, 154, 144, 164, 154, 134, 158, 158, 146, 152, 156, 162, 144, 162, 160, 148, 162, 160, 150, 152, 160, 162, 136, 150, 156, 136, 136, 152, 144, 134, 156, 140, 138, 156, 160, 140, 144, 166, 170, 142, 174, 162, 148, 152, 158, 156, 144, 156, 150, 132, 154, 148, 140, 140, 152, 148, 134, 152, 160, 138, 154, 162, 160, 146, 170, 154, 144, 162, 156, 148, 150, 156, 152, 134, 152, 148, 126, 146, 148, 148, 138, 150, 158, 142, 160, 156, 152, 156, 170, 162, 144, 172, 166, 146, 164, 164, 158, 150, 160, 162, 144, 156, 150, 146, 144, 170, 150, 134, 160, 162, 142, 158, 166, 158, 156, 162, 168, 158, 160, 166, 150, 154, 162, 160, 138, 166, 160, 136, 152, 164, 144, 148, 150, 154, 140, 158, 156, 154, 154, 176, 158, 142, 172, 166, 150, 156, 166, 150, 152, 164, 154, 138, 160, 156, 140, 148, 162, 160, 142, 168, 160, 140, 156, 164, 160, 150, 166, 172, 144, 162, 168, 150, 158, 152, 158, 144, 160, 150, 146, 152, 156, 156, 140, 160, 158, 142, 162, 166, 158, 160, 164, 162, 144, 170, 166, 144, 156, 160, 156, 146, 158, 158, 136, 154, 160, 140, 154, 154, 150, 146, 162, 160, 152, 168, 160, 166, 150, 172, 162, 152, 160, 156, 144, 154, 164, 154, 138, 154, 162, 136, 158, 156, 144, 160, 158, 160, 142, 174, 156, 154, 162, 168, 158, 150, 170, 164, 140, 170, 146, 150, 148, 158, 148}, + {170, 144, 178, 164, 146, 164, 164, 152, 150, 158, 154, 138, 156, 156, 142, 146, 154, 164, 134, 162, 166, 138, 162, 168, 162, 150, 168, 168, 146, 168, 162, 156, 154, 164, 160, 136, 166, 148, 138, 154, 156, 152, 140, 154, 158, 144, 164, 160, 158, 150, 176, 166, 146, 172, 178, 142, 154, 170, 148, 142, 160, 154, 140, 150, 152, 144, 158, 154, 156, 140, 166, 166, 142, 172, 162, 154, 160, 158, 166, 150, 158, 158, 152, 152, 160, 160, 132, 162, 156, 138, 152, 160, 142, 160, 166, 156, 138, 168, 166, 150, 166, 174, 164, 150, 176, 156, 138, 166, 154, 152, 148, 154, 156, 134, 150, 162, 144, 156, 156, 162, 148, 164, 168, 154, 158, 166, 146, 152, 152, 164, 134, 150, 146, 140, 144, 148, 150, 134, 160, 154, 128, 160, 164, 164, 150, 154, 162, 146, 166, 160, 148, 156, 158, 154, 134, 162, 148, 136, 152, 156, 136, 136, 156, 142, 136, 160, 154, 144, 156, 164, 156, 154, 170, 166, 140, 164, 168, 146, 152, 156, 148, 134, 152, 150, 136, 150, 142, 146, 134, 154, 158, 136, 166, 162, 148, 152, 162, 168, 154, 168, 168, 146, 166, 170, 160, 148, 162, 164, 134, 170, 154, 146, 142, 160, 158, 140, 166, 154, 154, 156, 158, 158, 150, 170, 168, 144, 180, 162, 158, 154, 158, 158, 140, 156, 158, 148, 146, 160, 146, 150, 164, 162, 140, 166, 166, 150, 154, 170, 168, 152, 160, 170, 148, 164, 160, 154, 142, 168, 158, 134, 162, 160, 140, 150, 156, 156, 142, 166, 156, 150, 166, 164, 162, 156, 172, 168, 150, 166, 166, 148, 162, 160, 152, 138, 158, 154, 134, 156, 154, 150, 150, 156, 160, 142, 162, 172, 148, 164, 170, 166, 152, 166, 170, 140, 158, 156, 158, 144, 164, 160, 136, 154, 162, 138, 162, 156, 160, 148, 164, 158, 146, 170, 162, 154, 158, 176, 166, 146, 174, 158, 150, 154, 164, 150, 142, 158, 148, 140, 158, 158, 142, 144, 174, 162, 150, 172, 166, 150, 162, 180, 156, 160, 160, 162, 136, 168, 162, 148, 154, 156}, + {166, 162, 150, 166, 164, 148, 160, 164, 156, 148, 164, 162, 136, 156, 166, 142, 150, 156, 152, 146, 156, 164, 142, 166, 156, 164, 148, 174, 168, 140, 168, 170, 144, 160, 150, 166, 134, 168, 150, 140, 158, 150, 154, 148, 160, 168, 138, 174, 168, 150, 160, 166, 162, 150, 160, 166, 152, 156, 162, 158, 140, 166, 162, 126, 168, 152, 140, 150, 158, 166, 136, 166, 158, 148, 164, 168, 158, 156, 172, 170, 144, 170, 156, 152, 156, 160, 148, 138, 156, 154, 138, 156, 164, 148, 144, 166, 166, 140, 176, 164, 146, 160, 168, 162, 150, 162, 162, 144, 166, 156, 148, 148, 156, 158, 138, 164, 162, 142, 160, 154, 148, 154, 164, 162, 142, 168, 160, 148, 152, 154, 148, 132, 156, 154, 128, 148, 148, 146, 130, 150, 156, 138, 154, 156, 154, 154, 164, 174, 140, 172, 164, 146, 162, 154, 152, 138, 146, 148, 132, 144, 144, 144, 140, 154, 154, 134, 166, 164, 138, 158, 170, 154, 156, 162, 156, 146, 160, 156, 142, 140, 154, 150, 132, 150, 158, 122, 156, 158, 138, 142, 162, 156, 136, 158, 164, 148, 170, 160, 166, 144, 168, 172, 138, 164, 164, 152, 154, 156, 162, 130, 160, 152, 144, 150, 152, 158, 132, 168, 162, 140, 170, 162, 156, 160, 156, 168, 142, 172, 160, 152, 158, 160, 162, 144, 160, 154, 134, 162, 156, 146, 146, 160, 162, 138, 172, 152, 154, 154, 170, 164, 144, 172, 174, 142, 166, 162, 150, 146, 162, 154, 136, 150, 150, 146, 152, 152, 162, 142, 168, 160, 142, 170, 162, 156, 152, 166, 162, 150, 162, 162, 144, 160, 158, 162, 138, 160, 162, 130, 158, 160, 150, 158, 162, 156, 144, 166, 162, 142, 168, 162, 162, 152, 178, 162, 144, 170, 154, 148, 150, 150, 156, 140, 158, 156, 138, 156, 160, 158, 142, 164, 172, 142, 174, 164, 156, 154, 164, 166, 136, 164, 158, 144, 144, 162, 154, 138, 164, 164, 130, 162, 166, 150, 150, 156, 158, 152, 172, 162, 150, 160, 164, 156, 150, 164, 168, 136, 162, 166, 134, 150}, + {162, 162, 170, 144, 178, 174, 140, 162, 164, 150, 146, 166, 148, 142, 152, 144, 148, 150, 160, 162, 142, 166, 170, 142, 174, 172, 152, 158, 172, 156, 148, 162, 164, 146, 160, 148, 164, 136, 160, 166, 128, 164, 160, 142, 148, 162, 158, 134, 180, 160, 154, 164, 162, 168, 152, 164, 166, 140, 162, 162, 142, 148, 156, 154, 136, 160, 154, 150, 158, 150, 172, 146, 166, 170, 146, 168, 160, 154, 160, 164, 170, 146, 164, 152, 148, 152, 156, 160, 136, 164, 162, 128, 160, 158, 152, 154, 160, 162, 152, 166, 164, 150, 164, 166, 166, 148, 170, 160, 138, 164, 164, 144, 150, 148, 160, 136, 154, 156, 144, 158, 168, 162, 148, 176, 166, 134, 168, 156, 150, 158, 154, 140, 138, 146, 146, 132, 146, 148, 148, 134, 162, 164, 136, 170, 152, 146, 164, 150, 172, 144, 162, 156, 138, 162, 152, 146, 140, 150, 152, 128, 160, 146, 136, 142, 152, 148, 136, 164, 158, 142, 154, 162, 170, 144, 168, 168, 138, 166, 162, 148, 148, 148, 144, 136, 148, 152, 132, 142, 142, 146, 140, 162, 166, 136, 164, 164, 146, 166, 172, 158, 156, 166, 166, 150, 166, 158, 154, 154, 158, 162, 136, 158, 162, 136, 160, 156, 148, 140, 166, 162, 138, 170, 160, 158, 158, 166, 180, 140, 168, 166, 142, 168, 148, 158, 144, 160, 152, 136, 160, 148, 150, 150, 158, 166, 140, 170, 178, 152, 164, 166, 164, 148, 164, 168, 144, 160, 162, 152, 148, 156, 164, 132, 164, 154, 142, 160, 152, 160, 146, 160, 166, 150, 170, 166, 156, 160, 166, 170, 140, 170, 164, 142, 158, 156, 152, 142, 150, 160, 142, 154, 156, 148, 142, 166, 172, 138, 178, 176, 140, 172, 166, 160, 148, 164, 158, 140, 166, 150, 146, 148, 158, 154, 130, 164, 168, 138, 166, 160, 152, 160, 162, 164, 146, 176, 164, 156, 160, 162, 166, 138, 174, 154, 138, 164, 156, 146, 140, 156, 160, 136, 160, 154, 148, 154, 168, 164, 142, 176, 176, 144, 172, 168, 160, 148, 160, 160, 142, 158, 154, 148}, + {146, 166, 164, 158, 146, 170, 168, 142, 156, 162, 150, 142, 160, 164, 128, 172, 156, 138, 158, 152, 158, 138, 162, 164, 146, 170, 160, 166, 150, 172, 176, 142, 168, 162, 144, 162, 156, 152, 144, 148, 154, 138, 158, 150, 154, 146, 168, 168, 138, 176, 166, 148, 168, 166, 156, 158, 162, 162, 148, 162, 158, 148, 146, 154, 158, 134, 158, 160, 138, 168, 148, 156, 154, 160, 170, 146, 172, 162, 156, 156, 164, 164, 142, 170, 162, 140, 158, 154, 154, 136, 154, 160, 138, 162, 156, 158, 148, 160, 170, 136, 178, 172, 142, 174, 166, 156, 146, 160, 162, 144, 154, 152, 146, 150, 154, 158, 136, 170, 162, 132, 160, 162, 154, 154, 162, 164, 144, 164, 156, 142, 142, 162, 150, 130, 158, 152, 126, 156, 152, 134, 136, 160, 158, 138, 164, 162, 144, 162, 166, 162, 144, 172, 164, 130, 170, 150, 136, 144, 154, 146, 122, 158, 142, 146, 144, 150, 164, 134, 164, 166, 138, 170, 162, 154, 150, 162, 154, 140, 158, 156, 134, 148, 144, 148, 132, 148, 154, 130, 158, 152, 144, 146, 156, 162, 138, 168, 164, 148, 162, 164, 166, 142, 174, 170, 140, 164, 164, 144, 150, 156, 158, 138, 154, 148, 142, 154, 160, 160, 140, 158, 170, 140, 176, 162, 162, 164, 156, 168, 144, 164, 160, 142, 162, 152, 154, 136, 160, 166, 130, 164, 160, 142, 158, 156, 156, 144, 162, 156, 150, 164, 154, 168, 148, 168, 166, 142, 170, 162, 142, 158, 146, 156, 136, 156, 160, 138, 162, 148, 168, 148, 156, 172, 142, 172, 162, 156, 162, 168, 170, 138, 160, 162, 148, 148, 154, 156, 134, 162, 160, 132, 164, 154, 148, 154, 156, 168, 150, 160, 170, 144, 162, 166, 162, 150, 170, 160, 138, 176, 160, 142, 158, 154, 150, 138, 158, 158, 140, 152, 164, 150, 154, 172, 168, 134, 174, 170, 150, 170, 160, 154, 144, 166, 164, 128, 156, 152, 148, 150, 156, 168, 130, 168, 166, 146, 158, 168, 166, 148, 160, 162, 148, 164, 160, 158, 154, 156, 166, 134, 170, 158}, + {166, 148, 162, 170, 166, 146, 172, 164, 146, 174, 156, 144, 150, 160, 152, 128, 158, 154, 146, 160, 156, 166, 146, 162, 172, 138, 174, 164, 150, 166, 162, 168, 138, 164, 162, 144, 152, 154, 154, 136, 160, 166, 128, 170, 152, 156, 146, 160, 162, 148, 172, 156, 152, 162, 162, 164, 146, 158, 164, 132, 168, 160, 144, 152, 158, 152, 138, 158, 160, 136, 162, 154, 166, 150, 168, 178, 140, 174, 166, 152, 162, 164, 154, 142, 162, 148, 146, 154, 146, 154, 146, 152, 164, 134, 168, 160, 144, 162, 166, 164, 158, 160, 174, 140, 164, 162, 162, 150, 154, 168, 132, 168, 156, 142, 154, 152, 156, 132, 160, 170, 144, 166, 154, 166, 150, 162, 164, 140, 166, 156, 138, 148, 150, 142, 130, 148, 144, 138, 144, 150, 154, 142, 156, 166, 134, 172, 162, 152, 168, 160, 158, 142, 158, 160, 134, 156, 150, 140, 140, 154, 150, 126, 156, 148, 134, 158, 154, 144, 148, 164, 166, 134, 174, 162, 156, 144, 166, 166, 136, 168, 154, 132, 160, 144, 142, 140, 146, 144, 134, 150, 148, 158, 154, 150, 172, 142, 168, 170, 144, 172, 162, 156, 156, 164, 168, 150, 156, 160, 156, 144, 158, 164, 126, 168, 160, 136, 160, 148, 166, 154, 158, 164, 148, 168, 154, 158, 152, 168, 180, 144, 172, 162, 136, 166, 170, 142, 146, 150, 152, 138, 154, 160, 148, 146, 166, 170, 140, 176, 170, 144, 180, 160, 162, 150, 162, 158, 140, 160, 150, 146, 152, 152, 164, 134, 160, 164, 134, 164, 158, 146, 162, 162, 164, 144, 176, 158, 152, 156, 158, 170, 144, 162, 158, 138, 166, 158, 142, 142, 154, 168, 132, 170, 156, 152, 152, 152, 170, 148, 170, 172, 146, 176, 164, 156, 144, 168, 158, 132, 162, 154, 138, 150, 160, 154, 140, 160, 166, 136, 166, 172, 150, 156, 168, 164, 152, 166, 158, 154, 160, 162, 160, 144, 158, 170, 138, 162, 158, 142, 152, 150, 152, 140, 162, 158, 142, 174, 158, 168, 154, 172, 180, 142, 178, 160, 146, 162, 154, 156, 136, 160}, + {174, 172, 142, 170, 162, 156, 152, 164, 160, 140, 152, 156, 150, 144, 156, 168, 138, 152, 160, 140, 166, 156, 152, 162, 156, 170, 148, 170, 164, 152, 156, 152, 174, 142, 164, 166, 134, 162, 158, 146, 144, 156, 154, 138, 156, 150, 164, 154, 158, 176, 140, 170, 170, 144, 176, 160, 166, 156, 160, 162, 140, 160, 152, 146, 150, 152, 158, 134, 168, 168, 132, 170, 160, 148, 156, 162, 164, 146, 166, 174, 154, 150, 164, 162, 142, 162, 164, 136, 168, 150, 144, 148, 154, 160, 134, 170, 160, 144, 164, 160, 164, 148, 162, 178, 146, 178, 154, 148, 152, 164, 158, 142, 156, 154, 142, 148, 152, 164, 138, 158, 166, 138, 172, 158, 156, 156, 154, 162, 136, 164, 162, 136, 150, 142, 154, 134, 152, 150, 128, 154, 148, 144, 150, 160, 166, 134, 164, 156, 154, 160, 158, 162, 146, 158, 166, 134, 158, 152, 132, 142, 154, 148, 132, 146, 148, 138, 152, 154, 162, 140, 160, 170, 140, 180, 158, 154, 160, 160, 150, 138, 150, 150, 134, 146, 140, 148, 134, 154, 158, 126, 158, 154, 140, 168, 150, 156, 154, 166, 164, 150, 166, 164, 166, 154, 162, 170, 140, 168, 160, 140, 156, 158, 148, 130, 156, 152, 142, 162, 144, 164, 146, 160, 176, 140, 180, 166, 152, 166, 158, 168, 142, 158, 166, 140, 150, 158, 150, 144, 152, 168, 130, 170, 160, 148, 156, 160, 160, 152, 170, 162, 142, 166, 166, 166, 152, 170, 160, 144, 166, 164, 138, 156, 148, 156, 136, 154, 160, 140, 158, 164, 156, 158, 162, 176, 138, 176, 170, 146, 176, 158, 150, 146, 170, 154, 130, 162, 152, 148, 144, 148, 168, 132, 166, 160, 144, 174, 158, 166, 156, 158, 168, 146, 170, 164, 162, 152, 152, 172, 136, 162, 154, 140, 156, 156, 148, 146, 158, 162, 140, 156, 160, 162, 144, 170, 170, 138, 176, 170, 144, 162, 160, 154, 150, 152, 150, 144, 146, 150, 154, 146, 154, 168, 138, 168, 160, 144, 172, 162, 154, 158, 162, 164, 144, 166, 150, 154, 152, 160, 164, 130}, + {150, 166, 156, 154, 172, 152, 180, 142, 162, 170, 138, 172, 162, 142, 158, 146, 144, 146, 158, 156, 142, 156, 154, 160, 150, 170, 176, 136, 172, 168, 150, 176, 164, 150, 150, 154, 162, 136, 156, 146, 156, 140, 154, 166, 142, 170, 158, 142, 168, 160, 160, 156, 160, 176, 146, 164, 158, 154, 148, 156, 172, 134, 170, 154, 138, 152, 152, 150, 142, 156, 168, 138, 164, 160, 166, 154, 164, 172, 142, 174, 168, 148, 170, 160, 156, 146, 158, 148, 138, 154, 152, 152, 142, 158, 168, 134, 164, 162, 146, 170, 166, 160, 158, 164, 164, 142, 168, 160, 156, 154, 154, 162, 130, 160, 162, 134, 164, 156, 146, 150, 160, 160, 138, 170, 160, 154, 154, 156, 174, 134, 158, 156, 128, 162, 140, 136, 138, 150, 146, 134, 154, 142, 150, 146, 148, 178, 142, 168, 172, 146, 172, 154, 146, 154, 158, 156, 132, 146, 148, 144, 134, 144, 152, 130, 152, 154, 138, 164, 146, 160, 154, 154, 164, 150, 162, 156, 156, 148, 150, 172, 134, 156, 150, 130, 160, 144, 134, 144, 150, 152, 134, 156, 152, 150, 148, 160, 168, 138, 172, 176, 140, 174, 158, 152, 156, 158, 160, 144, 154, 160, 152, 144, 156, 166, 144, 156, 160, 134, 174, 158, 148, 160, 162, 166, 144, 170, 160, 156, 162, 154, 166, 146, 158, 164, 134, 170, 160, 142, 148, 146, 160, 128, 162, 154, 148, 158, 154, 168, 144, 170, 180, 138, 178, 158, 154, 148, 166, 156, 140, 158, 154, 144, 148, 152, 162, 136, 164, 168, 138, 166, 156, 152, 164, 162, 164, 148, 168, 164, 152, 158, 164, 158, 146, 162, 162, 134, 166, 152, 144, 154, 154, 154, 140, 162, 156, 140, 170, 158, 166, 148, 164, 178, 136, 174, 160, 144, 168, 152, 152, 142, 158, 150, 146, 152, 144, 160, 142, 160, 170, 140, 172, 160, 150, 168, 168, 166, 144, 166, 166, 152, 156, 150, 164, 142, 158, 164, 132, 172, 152, 138, 162, 148, 162, 148, 156, 164, 148, 158, 166, 166, 150, 164, 180, 140, 176, 160, 136, 162, 148, 158}, + {170, 148, 170, 170, 146, 178, 150, 162, 158, 162, 160, 134, 154, 152, 144, 152, 150, 160, 130, 162, 158, 140, 170, 166, 150, 156, 166, 166, 150, 158, 166, 150, 158, 158, 160, 146, 162, 164, 136, 166, 150, 144, 152, 150, 158, 136, 168, 158, 142, 160, 164, 172, 146, 162, 178, 144, 180, 160, 146, 160, 148, 162, 142, 152, 156, 142, 148, 160, 160, 148, 152, 168, 138, 172, 158, 154, 162, 162, 174, 142, 164, 166, 142, 154, 150, 164, 138, 160, 162, 130, 168, 160, 138, 156, 152, 166, 146, 162, 160, 156, 158, 168, 160, 150, 168, 176, 144, 172, 158, 142, 158, 154, 158, 140, 154, 152, 144, 154, 150, 166, 142, 162, 172, 136, 178, 158, 144, 168, 152, 154, 146, 148, 150, 136, 148, 144, 156, 136, 144, 160, 130, 162, 162, 144, 168, 146, 156, 156, 160, 162, 140, 168, 154, 154, 144, 154, 160, 130, 158, 146, 126, 154, 154, 140, 142, 146, 152, 142, 162, 150, 164, 150, 158, 174, 146, 170, 158, 146, 168, 146, 154, 134, 158, 142, 130, 152, 142, 144, 138, 142, 160, 134, 170, 156, 144, 158, 164, 162, 150, 160, 166, 152, 164, 162, 168, 150, 162, 168, 140, 162, 160, 142, 158, 148, 142, 146, 156, 160, 134, 164, 156, 150, 160, 160, 176, 144, 176, 168, 148, 174, 160, 152, 150, 164, 162, 134, 154, 148, 146, 140, 158, 170, 138, 168, 166, 138, 178, 156, 162, 158, 160, 170, 142, 170, 160, 160, 150, 154, 174, 138, 160, 156, 140, 154, 152, 146, 144, 158, 162, 140, 162, 158, 164, 156, 164, 170, 144, 170, 174, 144, 168, 158, 152, 144, 160, 158, 142, 154, 148, 150, 142, 156, 172, 138, 158, 170, 146, 174, 162, 158, 162, 166, 162, 148, 166, 152, 158, 154, 154, 166, 138, 162, 154, 136, 172, 150, 142, 158, 150, 164, 138, 172, 164, 154, 162, 152, 174, 150, 166, 164, 146, 178, 148, 148, 152, 146, 150, 136, 156, 154, 150, 156, 146, 172, 144, 168, 174, 142, 176, 164, 156, 164, 158, 166, 136, 164, 158, 148, 152, 150}, + {162, 156, 152, 164, 166, 140, 166, 166, 150, 152, 156, 170, 146, 162, 156, 132, 164, 150, 158, 144, 162, 162, 142, 164, 156, 164, 152, 158, 176, 150, 172, 168, 148, 168, 154, 150, 144, 160, 150, 136, 154, 154, 148, 150, 152, 168, 138, 162, 168, 148, 174, 160, 160, 156, 162, 170, 140, 168, 162, 150, 166, 144, 166, 132, 160, 158, 136, 154, 156, 140, 158, 154, 162, 142, 168, 158, 160, 152, 156, 178, 152, 170, 166, 146, 178, 150, 146, 152, 150, 160, 130, 152, 152, 152, 154, 144, 170, 140, 164, 170, 152, 174, 158, 154, 162, 162, 164, 144, 154, 154, 152, 150, 148, 162, 136, 156, 158, 134, 168, 152, 148, 156, 156, 170, 148, 162, 158, 154, 156, 146, 168, 138, 152, 150, 130, 158, 138, 138, 152, 136, 148, 134, 148, 150, 148, 150, 164, 160, 148, 176, 176, 134, 172, 152, 146, 158, 148, 148, 138, 144, 156, 130, 140, 140, 152, 136, 150, 162, 138, 172, 152, 146, 160, 154, 164, 144, 162, 156, 146, 158, 152, 154, 136, 150, 156, 124, 164, 148, 132, 146, 152, 152, 138, 158, 160, 152, 158, 150, 174, 146, 164, 176, 138, 176, 162, 156, 164, 150, 162, 142, 158, 144, 142, 154, 152, 162, 138, 160, 170, 134, 170, 162, 150, 168, 164, 160, 146, 160, 172, 146, 158, 156, 160, 148, 150, 166, 136, 166, 156, 140, 154, 156, 156, 138, 160, 158, 142, 166, 158, 166, 154, 158, 178, 146, 176, 160, 146, 168, 142, 152, 144, 156, 150, 148, 152, 154, 154, 144, 156, 166, 142, 170, 162, 146, 168, 168, 164, 154, 158, 160, 146, 154, 148, 176, 138, 152, 160, 136, 164, 158, 138, 168, 146, 160, 156, 150, 160, 150, 162, 164, 166, 150, 164, 176, 146, 172, 158, 136, 168, 146, 154, 144, 154, 150, 140, 154, 150, 160, 142, 160, 172, 138, 176, 168, 148, 178, 158, 156, 156, 160, 156, 134, 168, 158, 154, 154, 152, 168, 132, 156, 156, 136, 170, 152, 154, 148, 168, 168, 138, 168, 162, 160, 154, 166, 178, 138, 168, 162, 140, 164}, + {162, 164, 172, 152, 164, 182, 148, 172, 160, 146, 168, 146, 154, 142, 152, 154, 140, 158, 146, 156, 144, 150, 176, 136, 174, 164, 150, 166, 164, 158, 144, 170, 162, 152, 158, 154, 170, 134, 158, 168, 132, 162, 158, 136, 162, 146, 164, 142, 156, 158, 154, 164, 160, 166, 150, 162, 180, 140, 166, 160, 140, 172, 148, 152, 146, 158, 150, 144, 152, 158, 162, 142, 152, 172, 142, 176, 162, 158, 172, 158, 156, 150, 158, 158, 140, 166, 150, 158, 152, 144, 172, 134, 160, 158, 136, 170, 160, 152, 158, 168, 160, 144, 170, 158, 166, 150, 158, 174, 142, 172, 158, 138, 168, 152, 144, 146, 148, 158, 138, 156, 158, 158, 148, 150, 176, 142, 170, 162, 138, 174, 142, 148, 144, 156, 142, 128, 152, 142, 144, 140, 144, 162, 142, 168, 158, 146, 164, 162, 156, 154, 158, 156, 144, 168, 148, 152, 146, 142, 152, 134, 148, 156, 130, 160, 150, 142, 142, 152, 154, 136, 170, 156, 156, 166, 160, 172, 138, 168, 168, 130, 168, 148, 142, 142, 148, 150, 124, 148, 148, 140, 142, 146, 164, 142, 156, 162, 140, 178, 148, 160, 160, 156, 176, 136, 174, 162, 154, 158, 150, 174, 138, 166, 156, 134, 172, 144, 150, 148, 156, 162, 138, 156, 158, 162, 152, 166, 176, 144, 168, 176, 146, 176, 152, 146, 158, 152, 156, 136, 154, 152, 146, 142, 150, 172, 140, 162, 168, 150, 176, 156, 152, 164, 164, 162, 150, 164, 154, 156, 160, 152, 170, 140, 156, 154, 136, 164, 156, 146, 160, 160, 154, 142, 170, 164, 154, 162, 156, 176, 152, 168, 170, 142, 174, 148, 146, 156, 152, 152, 142, 144, 154, 148, 154, 146, 168, 146, 168, 174, 146, 176, 154, 154, 164, 162, 160, 146, 162, 156, 144, 156, 144, 160, 136, 152, 162, 142, 172, 150, 150, 158, 158, 168, 146, 172, 156, 156, 162, 158, 178, 148, 164, 168, 136, 166, 156, 134, 158, 154, 148, 148, 150, 156, 144, 158, 156, 160, 148, 168, 180, 142, 176, 164, 152, 162, 150, 160, 146, 156, 160, 142}, + {142, 178, 160, 152, 158, 160, 166, 144, 162, 156, 152, 158, 152, 170, 134, 158, 162, 132, 166, 158, 146, 160, 150, 160, 146, 164, 162, 154, 158, 168, 170, 146, 166, 166, 142, 174, 148, 148, 158, 150, 160, 134, 148, 150, 152, 158, 144, 180, 142, 168, 168, 152, 182, 156, 156, 168, 156, 164, 148, 156, 154, 150, 148, 152, 156, 142, 156, 164, 134, 168, 154, 144, 160, 158, 168, 148, 162, 152, 158, 162, 154, 180, 144, 162, 166, 138, 170, 158, 140, 162, 142, 160, 146, 154, 150, 144, 150, 158, 164, 148, 164, 182, 142, 176, 162, 154, 170, 156, 156, 144, 164, 156, 136, 152, 152, 156, 146, 156, 164, 134, 164, 158, 152, 168, 160, 164, 144, 160, 160, 138, 158, 160, 148, 138, 152, 156, 126, 158, 146, 134, 150, 148, 148, 142, 158, 158, 142, 160, 158, 168, 148, 158, 172, 132, 172, 158, 146, 158, 144, 148, 132, 148, 140, 132, 144, 144, 154, 146, 154, 170, 136, 164, 158, 148, 170, 152, 156, 144, 152, 172, 132, 158, 140, 146, 138, 142, 160, 122, 154, 152, 134, 154, 150, 154, 148, 162, 156, 146, 170, 158, 166, 154, 158, 180, 144, 168, 160, 140, 174, 150, 154, 142, 158, 154, 134, 152, 146, 156, 144, 154, 178, 142, 168, 168, 152, 174, 152, 166, 154, 160, 158, 150, 160, 154, 166, 142, 150, 166, 138, 160, 158, 138, 172, 148, 156, 150, 156, 160, 146, 168, 164, 162, 158, 154, 174, 140, 168, 162, 134, 168, 146, 150, 148, 152, 148, 146, 148, 152, 158, 136, 166, 168, 140, 174, 168, 148, 174, 154, 156, 158, 160, 162, 140, 162, 152, 150, 144, 150, 168, 140, 154, 162, 138, 174, 152, 154, 156, 158, 168, 142, 172, 168, 160, 154, 162, 168, 140, 162, 158, 140, 170, 152, 146, 148, 148, 152, 130, 160, 160, 150, 162, 144, 178, 144, 170, 170, 142, 174, 154, 160, 148, 162, 160, 142, 156, 154, 144, 146, 150, 162, 138, 162, 162, 146, 168, 158, 152, 158, 162, 166, 144, 162, 166, 158, 158, 154, 166, 144, 158, 162}, + {168, 148, 164, 168, 164, 152, 166, 182, 148, 170, 162, 140, 164, 146, 148, 142, 154, 156, 136, 150, 152, 154, 146, 158, 172, 146, 172, 168, 150, 174, 158, 164, 158, 158, 158, 140, 164, 150, 152, 152, 142, 166, 140, 156, 160, 138, 168, 148, 154, 152, 166, 158, 144, 168, 156, 164, 158, 158, 174, 144, 166, 158, 144, 164, 146, 144, 146, 152, 154, 140, 156, 160, 158, 152, 148, 184, 148, 178, 170, 142, 180, 152, 162, 150, 162, 160, 134, 158, 152, 148, 144, 140, 166, 136, 158, 162, 144, 168, 158, 152, 166, 162, 158, 150, 162, 158, 158, 160, 160, 168, 138, 164, 162, 138, 172, 148, 140, 148, 156, 162, 142, 164, 150, 152, 160, 160, 168, 146, 158, 170, 136, 166, 150, 136, 148, 144, 146, 132, 146, 146, 138, 142, 152, 158, 140, 158, 170, 140, 176, 154, 158, 158, 160, 162, 132, 162, 152, 142, 140, 138, 162, 130, 154, 152, 138, 154, 142, 144, 160, 150, 166, 142, 156, 160, 160, 164, 158, 166, 146, 154, 174, 130, 164, 144, 136, 152, 136, 150, 136, 146, 146, 142, 154, 150, 166, 140, 160, 170, 146, 178, 158, 156, 168, 166, 164, 154, 160, 164, 140, 158, 150, 166, 140, 154, 168, 136, 168, 150, 142, 164, 150, 156, 148, 164, 158, 152, 172, 148, 178, 148, 160, 172, 138, 172, 154, 146, 164, 146, 150, 144, 152, 152, 144, 152, 148, 170, 152, 158, 174, 148, 174, 158, 148, 180, 160, 168, 144, 164, 162, 138, 158, 146, 160, 140, 154, 164, 140, 164, 152, 156, 156, 160, 166, 150, 168, 152, 158, 168, 150, 174, 152, 154, 164, 146, 172, 156, 144, 166, 140, 150, 146, 148, 156, 140, 160, 156, 154, 156, 164, 176, 140, 176, 166, 148, 172, 162, 154, 154, 162, 158, 140, 148, 146, 152, 148, 150, 172, 138, 160, 160, 140, 184, 148, 170, 156, 156, 170, 146, 172, 160, 164, 150, 152, 170, 140, 168, 160, 140, 156, 150, 148, 144, 156, 158, 146, 152, 160, 166, 152, 160, 182, 148, 172, 168, 148, 168, 154, 156, 150, 146}, + {156, 170, 148, 172, 162, 154, 172, 152, 162, 146, 156, 158, 152, 156, 150, 160, 140, 152, 164, 136, 172, 160, 142, 156, 156, 168, 150, 160, 158, 156, 160, 148, 178, 150, 160, 168, 144, 170, 160, 142, 162, 148, 148, 148, 150, 152, 146, 162, 150, 166, 154, 162, 178, 146, 172, 162, 148, 170, 152, 156, 152, 162, 152, 138, 158, 150, 156, 142, 152, 168, 136, 164, 156, 148, 170, 156, 158, 160, 154, 170, 148, 168, 164, 164, 154, 150, 170, 142, 164, 154, 138, 162, 152, 158, 142, 156, 164, 142, 156, 162, 158, 152, 160, 184, 146, 172, 166, 150, 164, 150, 160, 144, 162, 148, 138, 154, 154, 154, 142, 150, 168, 140, 168, 162, 152, 174, 160, 152, 156, 154, 164, 136, 154, 142, 148, 140, 144, 158, 130, 150, 154, 136, 156, 156, 152, 152, 156, 156, 142, 162, 160, 158, 144, 158, 168, 134, 162, 150, 134, 168, 142, 136, 136, 148, 148, 136, 152, 144, 154, 150, 146, 178, 142, 164, 172, 146, 170, 150, 148, 156, 148, 154, 138, 144, 142, 142, 140, 138, 152, 134, 154, 154, 136, 166, 148, 154, 156, 156, 164, 148, 164, 162, 154, 152, 158, 178, 146, 164, 168, 138, 168, 150, 146, 150, 146, 152, 140, 154, 152, 150, 150, 158, 166, 144, 170, 170, 144, 180, 154, 160, 164, 158, 158, 142, 164, 154, 138, 150, 152, 164, 138, 156, 162, 142, 174, 154, 148, 158, 162, 162, 146, 170, 162, 152, 158, 164, 170, 142, 162, 162, 142, 166, 154, 144, 148, 146, 156, 138, 162, 160, 150, 156, 148, 174, 142, 180, 172, 140, 178, 164, 156, 156, 162, 156, 138, 158, 152, 140, 158, 148, 158, 142, 156, 166, 142, 168, 160, 150, 162, 160, 166, 144, 164, 168, 152, 152, 160, 164, 146, 152, 164, 142, 170, 152, 144, 156, 156, 160, 138, 158, 156, 144, 164, 156, 172, 150, 162, 182, 142, 172, 160, 148, 168, 150, 150, 140, 152, 150, 146, 146, 154, 158, 140, 156, 172, 144, 174, 162, 150, 170, 156, 164, 152, 156, 162, 160, 154, 142, 174, 144}, + {164, 160, 164, 150, 162, 158, 164, 156, 158, 172, 144, 160, 158, 138, 168, 150, 144, 154, 152, 154, 138, 152, 164, 148, 160, 144, 172, 152, 168, 174, 144, 184, 146, 156, 156, 160, 158, 134, 160, 148, 146, 152, 146, 166, 142, 158, 162, 140, 168, 164, 148, 166, 160, 160, 152, 162, 162, 152, 164, 156, 158, 142, 160, 166, 134, 172, 146, 144, 156, 148, 158, 138, 162, 160, 144, 160, 160, 168, 156, 162, 174, 146, 174, 154, 146, 170, 146, 158, 142, 154, 152, 140, 148, 148, 162, 142, 154, 172, 142, 174, 164, 152, 164, 154, 166, 148, 168, 162, 152, 158, 148, 170, 138, 156, 166, 136, 164, 154, 144, 160, 156, 158, 146, 152, 162, 152, 158, 158, 158, 146, 154, 168, 134, 158, 142, 132, 148, 142, 146, 134, 148, 144, 132, 150, 152, 166, 136, 158, 174, 148, 178, 158, 156, 170, 148, 158, 142, 156, 150, 126, 148, 144, 154, 136, 140, 158, 130, 154, 156, 138, 172, 148, 156, 152, 164, 162, 142, 172, 152, 162, 146, 150, 162, 134, 160, 148, 134, 156, 146, 142, 138, 148, 152, 144, 158, 150, 160, 148, 152, 176, 148, 176, 164, 156, 172, 154, 164, 148, 162, 164, 138, 164, 148, 156, 138, 148, 168, 136, 164, 158, 150, 162, 160, 164, 158, 162, 160, 154, 168, 152, 172, 156, 156, 170, 138, 164, 160, 140, 166, 148, 148, 144, 152, 158, 132, 160, 158, 160, 160, 160, 180, 142, 172, 168, 144, 170, 154, 154, 152, 160, 152, 140, 148, 148, 152, 146, 148, 168, 138, 162, 162, 142, 180, 156, 166, 152, 160, 174, 136, 172, 160, 160, 148, 152, 174, 138, 160, 154, 140, 160, 148, 152, 154, 152, 162, 142, 158, 158, 166, 158, 156, 182, 146, 168, 172, 152, 168, 150, 154, 154, 146, 158, 136, 156, 144, 148, 142, 152, 172, 140, 164, 168, 148, 176, 162, 156, 162, 160, 168, 152, 162, 150, 154, 152, 150, 170, 138, 162, 154, 138, 166, 154, 148, 156, 152, 158, 142, 168, 164, 154, 164, 156, 174, 150, 166, 162, 144, 178, 148, 148}, + {156, 156, 166, 176, 148, 168, 166, 148, 176, 154, 156, 150, 162, 158, 132, 160, 150, 148, 138, 156, 164, 140, 156, 170, 142, 174, 162, 156, 160, 158, 166, 144, 176, 166, 156, 158, 152, 170, 138, 166, 156, 136, 158, 148, 148, 144, 160, 164, 142, 154, 162, 164, 148, 164, 178, 146, 172, 174, 146, 170, 158, 152, 152, 154, 154, 138, 154, 152, 148, 146, 154, 174, 138, 162, 168, 146, 178, 160, 156, 156, 166, 168, 142, 162, 158, 154, 156, 150, 166, 134, 164, 156, 140, 166, 154, 146, 154, 152, 154, 142, 162, 160, 164, 164, 158, 174, 146, 170, 162, 142, 180, 152, 148, 152, 150, 154, 138, 146, 148, 158, 150, 144, 174, 142, 162, 172, 148, 174, 154, 150, 156, 156, 154, 138, 150, 150, 142, 138, 140, 158, 130, 152, 160, 138, 164, 148, 154, 158, 152, 162, 148, 158, 156, 148, 156, 146, 172, 132, 152, 156, 130, 156, 144, 134, 154, 146, 148, 142, 154, 150, 148, 156, 154, 164, 152, 168, 172, 134, 172, 152, 146, 156, 144, 146, 132, 152, 148, 134, 138, 144, 154, 136, 152, 164, 134, 168, 158, 152, 166, 162, 166, 150, 170, 156, 152, 164, 164, 164, 146, 156, 164, 132, 170, 154, 144, 154, 150, 154, 136, 158, 162, 150, 154, 150, 168, 146, 166, 176, 138, 174, 162, 150, 162, 148, 168, 142, 160, 150, 140, 152, 156, 156, 140, 156, 176, 142, 162, 158, 148, 170, 156, 164, 152, 168, 168, 156, 162, 156, 162, 146, 156, 162, 140, 166, 150, 144, 156, 154, 148, 140, 162, 156, 148, 166, 152, 170, 148, 158, 184, 142, 174, 160, 146, 174, 156, 146, 148, 162, 150, 140, 150, 146, 160, 142, 150, 174, 138, 170, 166, 144, 174, 158, 164, 158, 154, 160, 154, 160, 146, 170, 142, 150, 164, 138, 170, 154, 140, 164, 152, 154, 152, 158, 164, 148, 160, 160, 162, 150, 154, 176, 142, 172, 160, 140, 166, 150, 152, 142, 152, 152, 142, 152, 148, 162, 140, 160, 170, 140, 174, 172, 148, 170, 164, 158, 160, 164, 156, 134, 164, 154}, + {158, 148, 162, 162, 160, 150, 158, 178, 144, 164, 152, 162, 144, 156, 170, 130, 166, 156, 142, 154, 152, 154, 148, 158, 158, 144, 162, 166, 168, 150, 164, 182, 140, 170, 160, 142, 170, 142, 156, 140, 154, 152, 142, 160, 152, 154, 142, 150, 172, 140, 172, 162, 156, 166, 158, 170, 150, 162, 166, 144, 156, 150, 168, 142, 154, 164, 134, 162, 154, 140, 166, 144, 162, 148, 150, 164, 154, 160, 166, 166, 146, 164, 180, 148, 170, 156, 140, 164, 148, 156, 138, 160, 148, 138, 154, 148, 166, 142, 164, 174, 146, 172, 168, 148, 174, 160, 156, 152, 158, 164, 136, 162, 150, 154, 152, 146, 170, 138, 158, 156, 138, 168, 152, 156, 160, 162, 164, 140, 162, 156, 152, 144, 152, 166, 130, 152, 146, 130, 154, 144, 144, 140, 144, 154, 138, 160, 156, 156, 156, 154, 178, 146, 168, 164, 138, 172, 148, 152, 140, 152, 148, 128, 154, 142, 140, 134, 142, 164, 136, 166, 158, 144, 164, 164, 150, 158, 164, 154, 142, 160, 154, 154, 148, 148, 152, 130, 148, 152, 132, 158, 150, 146, 148, 150, 164, 134, 162, 156, 154, 164, 152, 172, 142, 174, 172, 144, 178, 158, 150, 156, 158, 160, 138, 152, 150, 144, 146, 154, 164, 140, 160, 166, 142, 178, 152, 158, 168, 160, 170, 144, 170, 162, 152, 158, 146, 174, 136, 162, 160, 138, 158, 148, 146, 154, 148, 160, 144, 156, 158, 162, 162, 158, 170, 142, 168, 168, 142, 172, 158, 148, 156, 154, 158, 142, 158, 144, 154, 150, 158, 170, 138, 162, 166, 146, 178, 160, 160, 170, 156, 162, 150, 158, 152, 148, 148, 154, 164, 138, 156, 158, 140, 166, 150, 142, 164, 152, 164, 142, 166, 166, 150, 164, 152, 172, 152, 166, 166, 138, 174, 152, 154, 156, 148, 154, 138, 148, 156, 146, 154, 154, 162, 148, 160, 176, 144, 180, 164, 154, 170, 160, 170, 144, 162, 160, 140, 158, 148, 162, 138, 154, 166, 136, 168, 150, 154, 156, 160, 174, 148, 164, 160, 156, 160, 156, 176, 150, 158, 176, 138, 168}, + {162, 158, 160, 156, 166, 174, 144, 162, 170, 142, 168, 156, 150, 154, 150, 158, 142, 148, 156, 146, 148, 156, 162, 146, 160, 166, 144, 176, 158, 156, 156, 166, 168, 148, 164, 160, 154, 162, 144, 166, 136, 154, 164, 126, 168, 158, 146, 164, 152, 160, 142, 164, 156, 160, 164, 154, 172, 154, 166, 164, 144, 178, 150, 140, 162, 148, 156, 140, 154, 150, 146, 156, 144, 174, 146, 164, 170, 148, 176, 154, 156, 168, 158, 162, 142, 166, 154, 146, 156, 148, 162, 132, 156, 162, 140, 168, 154, 148, 154, 160, 162, 152, 160, 162, 154, 162, 158, 182, 144, 166, 164, 138, 174, 160, 134, 158, 148, 148, 148, 152, 154, 144, 152, 162, 156, 148, 168, 174, 138, 176, 154, 144, 154, 148, 148, 134, 152, 154, 134, 142, 144, 154, 136, 150, 170, 134, 170, 154, 146, 164, 152, 170, 148, 158, 158, 142, 152, 156, 150, 140, 144, 158, 124, 160, 148, 134, 146, 148, 146, 134, 162, 164, 144, 156, 164, 166, 148, 164, 176, 134, 168, 156, 144, 154, 146, 156, 138, 156, 150, 140, 144, 152, 150, 144, 154, 172, 136, 166, 160, 144, 176, 166, 160, 152, 160, 164, 144, 164, 154, 160, 150, 150, 168, 132, 166, 154, 144, 162, 156, 154, 146, 154, 158, 142, 172, 160, 164, 152, 156, 182, 144, 170, 166, 140, 176, 144, 152, 140, 156, 162, 136, 154, 150, 154, 150, 150, 170, 140, 170, 166, 148, 174, 160, 164, 154, 164, 162, 148, 152, 158, 154, 142, 154, 166, 132, 164, 154, 136, 164, 150, 154, 154, 160, 164, 146, 156, 162, 160, 156, 162, 178, 148, 174, 164, 144, 162, 150, 148, 148, 150, 150, 142, 158, 154, 154, 146, 162, 172, 140, 170, 174, 144, 176, 158, 156, 156, 158, 164, 138, 164, 152, 144, 150, 148, 164, 138, 158, 164, 136, 168, 156, 148, 150, 162, 166, 142, 164, 168, 154, 154, 162, 168, 140, 164, 166, 138, 172, 150, 146, 148, 150, 160, 132, 158, 158, 150, 156, 148, 176, 144, 170, 170, 148, 174, 158, 160, 152, 152, 166, 142}, + {138, 168, 168, 146, 168, 164, 162, 160, 170, 168, 146, 156, 152, 166, 142, 148, 164, 134, 162, 160, 136, 164, 152, 160, 148, 154, 170, 148, 164, 168, 160, 150, 162, 178, 144, 164, 158, 142, 168, 156, 152, 146, 154, 158, 134, 150, 148, 160, 146, 156, 174, 146, 176, 166, 146, 174, 162, 152, 158, 162, 162, 140, 162, 162, 144, 152, 148, 168, 132, 160, 166, 136, 170, 156, 146, 152, 164, 164, 144, 174, 164, 154, 154, 158, 176, 140, 170, 158, 136, 170, 152, 152, 146, 144, 162, 134, 156, 156, 156, 154, 154, 178, 144, 172, 168, 146, 176, 154, 164, 148, 166, 160, 132, 160, 154, 144, 148, 154, 160, 136, 168, 160, 142, 166, 164, 156, 156, 160, 156, 144, 162, 158, 150, 146, 144, 152, 130, 148, 150, 126, 162, 146, 138, 148, 148, 162, 132, 172, 156, 152, 174, 154, 170, 142, 164, 170, 134, 168, 152, 134, 146, 144, 146, 126, 152, 144, 146, 140, 154, 164, 140, 158, 174, 136, 170, 154, 160, 156, 152, 166, 140, 162, 166, 146, 158, 150, 172, 144, 158, 160, 144, 164, 160, 138, 156, 156, 164, 144, 156, 166, 154, 152, 160, 172, 148, 168, 178, 140, 174, 152, 144, 158, 154, 158, 140, 154, 148, 142, 146, 146, 168, 140, 160, 170, 144, 172, 156, 158, 170, 158, 164, 154, 158, 162, 146, 162, 152, 166, 142, 150, 164, 132, 164, 158, 142, 164, 156, 158, 148, 162, 160, 148, 170, 154, 170, 150, 166, 172, 140, 172, 158, 140, 160, 146, 152, 142, 150, 160, 138, 158, 152, 166, 144, 160, 174, 148, 178, 160, 148, 164, 160, 162, 138, 162, 156, 142, 160, 152, 154, 140, 154, 160, 134, 168, 154, 148, 158, 156, 160, 156, 166, 164, 148, 166, 168, 170, 154, 154, 168, 138, 174, 158, 140, 156, 158, 146, 144, 140, 168, 136, 158, 160, 156, 158, 160, 180, 140, 172, 166, 150, 172, 156, 160, 140, 166, 156, 138, 154, 150, 154, 142, 150, 174, 144, 162, 162, 140, 178, 150, 168, 156, 160, 156, 154, 172, 156, 162, 156, 150, 170}, + {156, 150, 158, 166, 150, 166, 154, 166, 150, 160, 168, 146, 174, 152, 142, 166, 154, 150, 138, 150, 150, 150, 158, 146, 170, 144, 158, 174, 148, 170, 164, 150, 170, 158, 166, 146, 162, 158, 140, 148, 154, 160, 142, 146, 172, 134, 174, 152, 146, 160, 152, 162, 150, 168, 166, 152, 166, 152, 170, 142, 160, 170, 136, 166, 164, 136, 158, 148, 154, 138, 148, 164, 140, 154, 166, 162, 152, 160, 178, 138, 174, 168, 152, 168, 160, 158, 140, 168, 156, 134, 158, 146, 154, 150, 150, 170, 136, 164, 162, 146, 162, 158, 164, 154, 158, 170, 138, 172, 164, 156, 150, 158, 172, 136, 168, 160, 138, 154, 156, 154, 136, 158, 168, 134, 164, 154, 162, 148, 164, 164, 134, 170, 160, 138, 152, 142, 148, 134, 152, 146, 130, 144, 154, 148, 146, 158, 174, 134, 166, 166, 142, 176, 158, 154, 146, 152, 164, 132, 152, 150, 146, 138, 154, 154, 122, 154, 150, 132, 158, 152, 150, 146, 152, 164, 144, 168, 162, 166, 152, 164, 184, 150, 170, 168, 144, 176, 146, 146, 152, 152, 148, 138, 150, 154, 148, 150, 150, 170, 138, 168, 172, 146, 176, 162, 156, 156, 160, 166, 146, 160, 162, 152, 144, 152, 166, 134, 158, 158, 136, 172, 150, 160, 150, 158, 166, 148, 172, 160, 158, 164, 158, 174, 142, 168, 166, 134, 172, 154, 140, 150, 150, 152, 134, 154, 166, 142, 148, 166, 166, 144, 178, 174, 140, 180, 160, 158, 156, 158, 170, 138, 158, 168, 140, 154, 150, 162, 138, 156, 164, 136, 168, 152, 150, 160, 168, 164, 144, 168, 170, 152, 160, 166, 174, 140, 172, 160, 138, 170, 152, 142, 146, 154, 164, 130, 156, 162, 150, 160, 156, 172, 148, 164, 174, 140, 174, 164, 156, 154, 168, 162, 136, 156, 154, 138, 142, 158, 158, 146, 160, 166, 142, 166, 164, 150, 162, 164, 170, 148, 164, 164, 150, 158, 160, 166, 136, 156, 164, 138, 166, 154, 136, 156, 152, 150, 144, 158, 164, 146, 166, 152, 168, 152, 172, 174, 134, 172, 162, 138, 170, 150}, + {164, 168, 146, 174, 172, 138, 176, 166, 158, 162, 160, 156, 144, 154, 162, 144, 148, 154, 164, 138, 160, 162, 138, 166, 154, 150, 162, 160, 168, 144, 170, 164, 152, 158, 160, 170, 138, 168, 168, 138, 166, 152, 142, 150, 146, 160, 126, 164, 158, 154, 154, 162, 170, 142, 170, 172, 140, 186, 162, 160, 158, 156, 156, 144, 156, 152, 140, 148, 152, 160, 138, 164, 168, 134, 170, 154, 152, 168, 160, 166, 148, 162, 168, 158, 154, 164, 158, 146, 162, 166, 132, 168, 150, 138, 150, 152, 160, 136, 162, 164, 144, 174, 158, 168, 148, 166, 188, 134, 178, 162, 146, 154, 158, 154, 138, 154, 156, 144, 146, 150, 162, 138, 156, 174, 136, 174, 162, 160, 162, 164, 154, 140, 162, 158, 142, 150, 136, 158, 130, 150, 158, 122, 154, 148, 140, 154, 150, 162, 138, 158, 166, 144, 156, 160, 158, 152, 154, 174, 134, 158, 148, 136, 136, 150, 148, 138, 148, 146, 138, 156, 146, 166, 144, 158, 172, 138, 178, 160, 152, 166, 160, 154, 152, 162, 156, 142, 162, 150, 158, 142, 162, 162, 134, 160, 164, 138, 162, 158, 158, 150, 162, 160, 144, 170, 164, 164, 152, 160, 168, 138, 172, 158, 142, 162, 150, 152, 146, 158, 158, 138, 160, 148, 160, 148, 162, 174, 140, 174, 164, 150, 168, 158, 168, 146, 156, 160, 136, 160, 152, 150, 144, 154, 170, 128, 164, 156, 142, 164, 156, 158, 152, 160, 172, 138, 170, 160, 160, 146, 164, 166, 140, 164, 160, 136, 160, 154, 148, 146, 152, 160, 136, 166, 158, 148, 160, 164, 172, 140, 170, 174, 146, 172, 152, 152, 142, 172, 162, 132, 156, 158, 150, 142, 148, 168, 138, 166, 162, 144, 162, 158, 166, 156, 160, 168, 144, 162, 164, 154, 146, 156, 170, 142, 162, 166, 132, 160, 156, 140, 146, 156, 160, 140, 154, 166, 156, 152, 158, 178, 140, 176, 172, 152, 164, 152, 162, 148, 156, 156, 136, 152, 158, 148, 142, 154, 174, 140, 162, 164, 144, 180, 168, 148, 156, 166, 166, 154, 164, 158, 156, 148}, + {152, 164, 154, 154, 164, 170, 150, 164, 160, 158, 150, 166, 168, 142, 162, 162, 140, 156, 148, 154, 138, 156, 158, 140, 158, 156, 154, 160, 158, 174, 142, 174, 170, 146, 172, 160, 152, 150, 156, 156, 132, 164, 154, 146, 144, 160, 168, 132, 164, 160, 142, 164, 160, 164, 160, 152, 176, 140, 162, 166, 150, 156, 156, 170, 140, 168, 156, 142, 160, 146, 152, 138, 156, 168, 132, 168, 162, 154, 152, 168, 180, 138, 170, 168, 146, 164, 164, 152, 146, 154, 156, 132, 160, 152, 152, 146, 154, 172, 140, 160, 172, 138, 170, 166, 158, 162, 152, 170, 148, 162, 156, 150, 150, 162, 160, 134, 158, 164, 128, 168, 152, 148, 160, 158, 162, 136, 162, 166, 150, 150, 162, 164, 140, 158, 156, 128, 164, 140, 142, 136, 146, 156, 136, 154, 142, 152, 150, 154, 174, 140, 172, 180, 140, 168, 158, 146, 154, 154, 158, 134, 144, 150, 144, 138, 152, 154, 126, 154, 158, 132, 166, 148, 164, 154, 156, 162, 146, 168, 162, 154, 162, 168, 170, 144, 172, 172, 134, 172, 162, 140, 144, 158, 154, 138, 154, 166, 144, 148, 160, 160, 150, 168, 180, 140, 174, 166, 158, 164, 164, 158, 140, 164, 164, 136, 152, 150, 156, 136, 156, 164, 136, 170, 164, 144, 158, 164, 168, 142, 170, 164, 148, 164, 164, 164, 150, 162, 170, 138, 168, 160, 140, 150, 142, 168, 136, 164, 166, 138, 160, 158, 166, 148, 170, 182, 132, 188, 168, 158, 156, 162, 160, 138, 154, 158, 142, 148, 154, 154, 138, 164, 170, 132, 166, 166, 152, 162, 162, 166, 148, 160, 164, 154, 166, 158, 158, 140, 158, 166, 130, 158, 156, 146, 162, 160, 152, 142, 162, 158, 144, 168, 160, 168, 150, 168, 186, 140, 174, 172, 146, 162, 148, 152, 138, 154, 160, 134, 154, 156, 156, 144, 156, 172, 142, 170, 170, 152, 168, 156, 170, 144, 164, 156, 154, 162, 148, 162, 148, 160, 164, 134, 156, 158, 140, 160, 146, 166, 148, 156, 164, 144, 156, 170, 168, 150, 168, 176, 136, 170, 156, 144}, + {154, 150, 162, 170, 148, 166, 176, 138, 174, 172, 154, 154, 154, 160, 144, 158, 156, 140, 158, 150, 156, 138, 164, 168, 134, 172, 166, 148, 160, 168, 162, 150, 168, 162, 148, 158, 166, 152, 150, 162, 164, 128, 162, 164, 144, 150, 154, 152, 142, 172, 170, 136, 168, 160, 160, 152, 166, 176, 142, 174, 168, 144, 154, 160, 158, 134, 164, 148, 140, 158, 154, 156, 144, 158, 170, 138, 164, 170, 152, 164, 156, 170, 152, 168, 168, 142, 160, 158, 154, 146, 154, 172, 124, 166, 160, 144, 154, 152, 164, 148, 158, 166, 144, 166, 164, 158, 150, 170, 172, 140, 168, 164, 148, 152, 158, 152, 142, 154, 152, 140, 160, 160, 146, 138, 160, 174, 142, 174, 166, 146, 160, 158, 158, 142, 152, 152, 132, 150, 142, 148, 134, 142, 158, 124, 160, 160, 148, 160, 154, 150, 152, 154, 170, 138, 166, 164, 146, 150, 160, 156, 132, 156, 146, 130, 152, 138, 154, 132, 148, 162, 138, 162, 150, 154, 150, 162, 178, 142, 180, 170, 144, 170, 160, 162, 144, 154, 162, 140, 146, 164, 146, 142, 156, 158, 132, 162, 160, 144, 162, 164, 150, 158, 166, 162, 148, 168, 158, 154, 152, 166, 166, 138, 162, 168, 136, 160, 154, 146, 144, 160, 152, 140, 156, 170, 144, 162, 166, 174, 140, 174, 174, 136, 172, 156, 150, 150, 156, 160, 128, 156, 160, 144, 150, 148, 164, 140, 156, 172, 140, 166, 166, 160, 156, 158, 170, 140, 164, 160, 154, 154, 154, 166, 142, 156, 162, 134, 162, 156, 144, 146, 158, 164, 140, 162, 160, 152, 158, 164, 178, 142, 168, 168, 146, 166, 160, 154, 146, 154, 164, 140, 158, 150, 140, 144, 156, 170, 138, 164, 168, 142, 166, 166, 152, 158, 154, 168, 146, 156, 160, 146, 158, 160, 160, 132, 158, 162, 132, 160, 158, 150, 152, 156, 160, 146, 162, 164, 154, 164, 156, 174, 152, 170, 168, 140, 174, 154, 144, 152, 146, 162, 132, 156, 160, 134, 158, 152, 166, 142, 166, 176, 146, 170, 164, 154, 154, 164, 172, 142, 162, 158}, + {162, 142, 168, 158, 166, 158, 168, 168, 152, 162, 162, 150, 152, 158, 166, 130, 166, 164, 134, 160, 156, 152, 142, 152, 162, 138, 156, 168, 158, 156, 162, 170, 144, 172, 178, 146, 166, 164, 146, 150, 164, 152, 136, 154, 148, 146, 144, 166, 160, 136, 158, 172, 146, 168, 176, 156, 160, 164, 164, 146, 162, 162, 148, 160, 152, 164, 132, 160, 166, 130, 160, 156, 140, 156, 158, 164, 136, 172, 166, 150, 168, 156, 166, 148, 166, 172, 142, 164, 162, 148, 150, 150, 158, 130, 154, 154, 148, 152, 152, 164, 146, 160, 178, 144, 172, 164, 160, 158, 158, 176, 144, 160, 154, 148, 150, 154, 160, 136, 164, 158, 132, 156, 166, 166, 152, 154, 164, 150, 162, 168, 144, 156, 158, 154, 138, 150, 156, 126, 152, 152, 138, 148, 142, 154, 132, 154, 158, 140, 160, 168, 156, 148, 172, 168, 134, 164, 168, 142, 150, 150, 148, 136, 150, 154, 132, 142, 144, 154, 138, 156, 164, 130, 166, 160, 146, 156, 156, 168, 148, 168, 168, 146, 166, 162, 160, 142, 162, 164, 134, 166, 164, 142, 148, 156, 156, 138, 162, 156, 150, 154, 166, 164, 146, 172, 174, 142, 178, 170, 150, 158, 156, 158, 146, 160, 156, 136, 160, 152, 154, 134, 166, 162, 138, 164, 168, 146, 164, 166, 160, 150, 166, 168, 154, 164, 166, 148, 156, 158, 166, 138, 156, 164, 136, 156, 154, 150, 148, 160, 162, 140, 172, 162, 154, 160, 162, 182, 142, 170, 164, 144, 166, 154, 152, 150, 158, 152, 132, 158, 154, 150, 146, 156, 170, 142, 166, 176, 144, 166, 158, 170, 150, 160, 178, 142, 160, 156, 158, 146, 150, 160, 128, 160, 164, 138, 162, 150, 164, 148, 160, 162, 154, 162, 170, 156, 158, 168, 172, 142, 170, 166, 142, 156, 162, 154, 146, 150, 152, 138, 154, 166, 146, 142, 162, 172, 140, 174, 170, 148, 172, 162, 164, 156, 158, 166, 138, 162, 158, 148, 150, 154, 162, 132, 158, 168, 138, 162, 164, 150, 148, 160, 170, 150, 164, 168, 158, 158, 166, 162, 142, 168}, + {154, 164, 140, 170, 160, 158, 154, 164, 168, 142, 174, 168, 152, 162, 152, 162, 140, 156, 158, 136, 154, 152, 150, 146, 160, 168, 138, 168, 162, 154, 164, 162, 164, 148, 158, 164, 148, 160, 166, 154, 142, 168, 160, 128, 162, 166, 140, 152, 158, 164, 144, 162, 158, 148, 160, 166, 156, 150, 170, 174, 144, 170, 160, 142, 158, 156, 156, 138, 150, 154, 144, 156, 164, 146, 148, 164, 170, 136, 170, 176, 154, 166, 168, 160, 152, 156, 170, 144, 162, 156, 148, 146, 156, 162, 132, 156, 164, 140, 162, 160, 154, 154, 168, 160, 140, 170, 174, 152, 158, 168, 164, 140, 166, 168, 134, 164, 150, 154, 140, 154, 162, 140, 154, 154, 152, 156, 162, 166, 142, 156, 168, 138, 164, 156, 152, 144, 154, 150, 136, 146, 146, 140, 138, 154, 154, 134, 160, 168, 136, 160, 170, 152, 158, 160, 160, 150, 152, 168, 140, 146, 152, 146, 130, 150, 156, 130, 154, 144, 142, 138, 162, 154, 138, 162, 162, 152, 166, 162, 168, 144, 170, 174, 140, 166, 170, 156, 158, 154, 164, 132, 156, 154, 140, 150, 156, 160, 136, 164, 166, 140, 166, 152, 168, 156, 162, 164, 146, 168, 166, 152, 158, 158, 158, 136, 160, 160, 134, 158, 156, 152, 148, 156, 166, 140, 162, 162, 142, 164, 168, 162, 144, 168, 170, 140, 164, 164, 152, 150, 156, 154, 136, 154, 158, 142, 156, 162, 156, 142, 162, 162, 146, 166, 176, 152, 156, 160, 172, 150, 156, 164, 142, 160, 160, 148, 138, 160, 166, 130, 158, 160, 144, 160, 158, 156, 142, 166, 168, 150, 158, 170, 158, 152, 164, 172, 140, 164, 162, 152, 156, 152, 162, 138, 152, 158, 134, 156, 158, 154, 144, 160, 176, 142, 168, 168, 158, 160, 162, 170, 142, 160, 160, 144, 150, 156, 156, 138, 166, 162, 132, 158, 164, 154, 154, 156, 168, 152, 158, 164, 148, 160, 170, 158, 148, 160, 172, 134, 162, 170, 136, 150, 152, 152, 144, 150, 160, 140, 156, 162, 154, 156, 166, 170, 140, 172, 170, 148, 160, 166, 158, 144}, + {146, 160, 174, 144, 174, 162, 162, 160, 164, 162, 142, 160, 156, 156, 154, 164, 152, 138, 156, 162, 138, 154, 168, 144, 160, 154, 166, 142, 170, 166, 144, 164, 168, 166, 156, 166, 166, 140, 158, 154, 152, 144, 156, 158, 140, 150, 156, 148, 156, 152, 160, 148, 168, 168, 148, 170, 172, 154, 160, 158, 166, 140, 162, 164, 140, 156, 156, 152, 142, 154, 158, 132, 154, 160, 160, 152, 156, 170, 146, 168, 166, 138, 166, 172, 158, 148, 164, 158, 142, 160, 170, 140, 144, 158, 154, 144, 154, 158, 138, 158, 164, 154, 148, 168, 178, 138, 166, 174, 150, 164, 162, 160, 142, 162, 162, 136, 158, 152, 148, 140, 156, 166, 140, 160, 160, 150, 158, 166, 172, 156, 158, 162, 140, 158, 158, 142, 128, 150, 154, 124, 154, 150, 136, 142, 150, 152, 140, 158, 164, 146, 154, 166, 162, 146, 174, 164, 142, 158, 164, 148, 146, 156, 144, 134, 148, 148, 138, 146, 150, 142, 142, 164, 168, 136, 162, 168, 144, 160, 166, 164, 154, 158, 172, 146, 166, 156, 150, 150, 166, 160, 138, 162, 162, 140, 152, 162, 154, 146, 154, 166, 146, 174, 164, 156, 154, 174, 166, 152, 162, 168, 144, 162, 158, 158, 150, 156, 154, 136, 156, 154, 148, 154, 152, 164, 146, 162, 172, 152, 166, 170, 160, 156, 158, 182, 130, 164, 156, 156, 148, 162, 152, 138, 158, 168, 132, 152, 160, 166, 148, 168, 158, 146, 168, 168, 150, 160, 164, 170, 146, 166, 162, 140, 160, 164, 148, 142, 158, 148, 144, 154, 162, 142, 146, 170, 168, 142, 170, 176, 150, 162, 174, 158, 164, 158, 154, 146, 162, 154, 142, 152, 152, 158, 134, 156, 164, 138, 162, 164, 152, 152, 168, 158, 154, 172, 168, 152, 158, 166, 164, 140, 166, 164, 140, 158, 154, 154, 146, 156, 160, 140, 158, 154, 150, 160, 154, 168, 152, 168, 176, 150, 166, 166, 162, 152, 158, 162, 140, 152, 162, 148, 146, 162, 148, 144, 160, 166, 138, 158, 170, 150, 152, 166, 170, 156, 162, 174, 152, 164, 158, 164}, + {158, 144, 162, 162, 144, 172, 168, 152, 158, 174, 166, 152, 160, 164, 144, 156, 160, 150, 146, 150, 152, 142, 156, 156, 142, 158, 160, 158, 140, 174, 172, 156, 162, 172, 156, 158, 160, 162, 150, 162, 160, 150, 152, 156, 148, 142, 154, 164, 136, 164, 160, 154, 148, 170, 162, 144, 170, 164, 152, 164, 164, 166, 142, 162, 162, 144, 154, 164, 146, 144, 158, 166, 144, 154, 154, 152, 156, 158, 162, 148, 166, 182, 142, 164, 174, 156, 150, 162, 164, 144, 154, 158, 146, 150, 154, 154, 140, 162, 162, 146, 160, 166, 158, 150, 166, 160, 156, 166, 162, 152, 158, 162, 154, 146, 160, 168, 140, 148, 166, 146, 148, 150, 160, 140, 166, 150, 150, 158, 162, 158, 146, 160, 162, 138, 156, 160, 144, 146, 144, 152, 128, 152, 152, 134, 150, 154, 158, 142, 160, 162, 142, 162, 162, 160, 152, 154, 164, 136, 156, 154, 142, 142, 150, 146, 134, 148, 150, 136, 150, 150, 150, 146, 154, 162, 146, 162, 158, 162, 158, 168, 160, 154, 164, 172, 142, 162, 168, 146, 150, 162, 158, 140, 146, 162, 138, 150, 156, 158, 148, 158, 166, 142, 170, 162, 158, 156, 168, 162, 154, 154, 160, 150, 156, 156, 148, 142, 158, 158, 138, 154, 166, 138, 164, 160, 160, 146, 162, 166, 146, 162, 178, 152, 160, 162, 174, 144, 164, 150, 150, 142, 166, 150, 142, 146, 162, 146, 156, 156, 150, 150, 164, 166, 148, 160, 176, 148, 162, 168, 168, 146, 162, 168, 140, 154, 160, 150, 144, 162, 154, 136, 158, 162, 150, 152, 152, 166, 150, 164, 160, 150, 164, 166, 160, 150, 172, 158, 146, 158, 166, 144, 144, 158, 148, 146, 158, 166, 136, 160, 164, 150, 148, 174, 168, 142, 162, 178, 148, 166, 162, 162, 148, 158, 156, 142, 154, 152, 144, 144, 158, 164, 136, 160, 162, 148, 156, 168, 160, 156, 156, 166, 144, 172, 162, 158, 146, 162, 162, 136, 156, 162, 140, 150, 154, 158, 142, 156, 160, 150, 158, 160, 164, 156, 168, 158, 144, 166, 170, 146, 156, 156}, + {162, 156, 150, 156, 178, 140, 164, 166, 156, 156, 172, 164, 138, 164, 156, 150, 154, 162, 150, 142, 164, 150, 140, 160, 164, 148, 154, 168, 158, 154, 162, 164, 152, 164, 166, 152, 146, 168, 160, 148, 156, 156, 146, 146, 164, 154, 148, 152, 158, 142, 158, 162, 148, 158, 168, 162, 144, 176, 170, 154, 166, 160, 158, 146, 158, 156, 144, 154, 164, 146, 144, 148, 162, 144, 162, 160, 154, 158, 166, 168, 146, 158, 168, 156, 162, 170, 162, 150, 156, 164, 138, 162, 152, 144, 150, 156, 154, 138, 154, 166, 144, 160, 162, 160, 156, 172, 164, 148, 168, 172, 162, 158, 160, 160, 146, 154, 156, 146, 150, 158, 144, 152, 158, 160, 144, 172, 162, 154, 160, 166, 154, 154, 154, 160, 140, 146, 160, 138, 142, 146, 150, 128, 144, 162, 130, 150, 154, 154, 152, 160, 160, 146, 172, 166, 148, 160, 154, 168, 146, 160, 150, 140, 136, 154, 138, 142, 148, 148, 136, 156, 150, 144, 156, 156, 164, 142, 160, 170, 150, 166, 162, 166, 154, 164, 172, 142, 158, 162, 150, 152, 150, 154, 140, 160, 160, 144, 152, 162, 156, 146, 158, 164, 152, 174, 166, 154, 158, 168, 160, 154, 160, 166, 144, 156, 160, 152, 144, 154, 156, 144, 154, 160, 144, 148, 164, 156, 150, 172, 166, 158, 158, 170, 158, 158, 158, 160, 146, 156, 164, 146, 148, 160, 150, 142, 158, 158, 140, 160, 164, 154, 146, 168, 164, 154, 168, 170, 150, 160, 162, 160, 142, 154, 164, 140, 162, 150, 150, 146, 158, 154, 138, 160, 158, 160, 160, 166, 156, 150, 166, 168, 148, 164, 168, 160, 150, 162, 162, 144, 154, 154, 148, 148, 158, 150, 140, 156, 164, 148, 158, 164, 156, 152, 174, 160, 152, 162, 166, 142, 162, 162, 154, 150, 162, 160, 142, 148, 166, 144, 148, 150, 158, 146, 158, 162, 154, 160, 164, 164, 158, 162, 176, 148, 156, 166, 154, 156, 160, 156, 146, 154, 156, 134, 156, 154, 154, 144, 162, 162, 142, 162, 166, 158, 162, 164, 176, 150, 168, 172, 148, 162}, + {154, 164, 150, 156, 160, 166, 156, 166, 172, 150, 160, 162, 162, 146, 158, 160, 142, 152, 152, 150, 144, 154, 162, 134, 156, 160, 150, 156, 158, 166, 158, 168, 168, 150, 166, 172, 160, 148, 158, 160, 144, 160, 154, 146, 148, 156, 148, 142, 164, 158, 152, 160, 160, 150, 164, 160, 166, 154, 158, 170, 154, 160, 160, 158, 154, 160, 154, 150, 144, 154, 154, 154, 154, 154, 142, 156, 158, 148, 164, 166, 164, 156, 162, 166, 156, 158, 158, 158, 150, 156, 162, 140, 160, 156, 136, 152, 156, 160, 148, 156, 156, 150, 158, 166, 156, 154, 164, 170, 148, 162, 166, 146, 162, 156, 152, 152, 154, 148, 150, 148, 158, 148, 154, 160, 158, 142, 158, 160, 154, 158, 162, 150, 164, 154, 160, 142, 148, 154, 140, 140, 154, 154, 138, 144, 148, 134, 156, 160, 148, 152, 164, 164, 148, 158, 170, 146, 160, 154, 160, 142, 150, 152, 148, 144, 150, 148, 136, 150, 148, 134, 146, 156, 146, 156, 162, 160, 146, 170, 166, 148, 170, 164, 168, 156, 162, 162, 148, 154, 164, 150, 152, 154, 154, 146, 152, 160, 144, 154, 158, 150, 158, 156, 168, 148, 168, 164, 152, 160, 172, 158, 152, 156, 162, 144, 158, 154, 150, 146, 156, 148, 144, 154, 164, 152, 154, 160, 160, 152, 164, 162, 156, 162, 166, 154, 160, 158, 166, 160, 152, 156, 150, 148, 156, 152, 148, 150, 158, 142, 160, 156, 162, 158, 170, 162, 150, 164, 176, 156, 166, 164, 162, 154, 158, 158, 136, 160, 156, 140, 154, 154, 164, 144, 162, 150, 156, 152, 172, 170, 152, 164, 172, 154, 166, 168, 156, 156, 152, 162, 140, 160, 156, 144, 150, 158, 164, 144, 150, 164, 150, 160, 160, 158, 156, 172, 158, 160, 166, 170, 162, 160, 164, 156, 144, 154, 162, 142, 156, 150, 142, 158, 158, 154, 150, 162, 168, 150, 156, 166, 162, 156, 168, 164, 162, 156, 158, 146, 156, 162, 156, 144, 160, 164, 144, 148, 156, 156, 150, 156, 166, 144, 162, 164, 154, 160, 156, 166, 156, 160, 160, 152}, + {148, 160, 156, 154, 162, 164, 164, 154, 158, 168, 154, 162, 154, 164, 150, 158, 164, 140, 168, 152, 152, 150, 154, 160, 146, 160, 156, 154, 150, 170, 164, 154, 164, 168, 148, 166, 166, 152, 162, 154, 156, 150, 150, 154, 152, 146, 162, 152, 142, 158, 158, 146, 170, 154, 152, 166, 166, 160, 156, 156, 166, 158, 156, 150, 162, 148, 158, 152, 146, 156, 152, 140, 158, 152, 152, 164, 158, 162, 154, 158, 162, 168, 152, 162, 166, 160, 160, 158, 156, 152, 160, 154, 144, 152, 162, 146, 150, 146, 162, 148, 160, 164, 144, 162, 170, 156, 162, 160, 166, 162, 158, 154, 160, 146, 162, 154, 150, 154, 158, 144, 148, 162, 146, 152, 154, 162, 150, 164, 164, 150, 160, 152, 162, 140, 154, 158, 142, 146, 148, 140, 142, 148, 136, 148, 152, 148, 140, 154, 162, 152, 150, 156, 162, 154, 156, 158, 148, 162, 152, 156, 144, 150, 146, 140, 140, 140, 150, 142, 152, 144, 146, 154, 156, 146, 160, 156, 162, 148, 162, 166, 158, 160, 162, 168, 152, 162, 162, 154, 152, 158, 146, 154, 154, 146, 150, 152, 156, 148, 158, 164, 154, 156, 164, 164, 154, 170, 158, 156, 164, 166, 156, 158, 154, 160, 154, 152, 156, 148, 148, 158, 160, 138, 154, 160, 156, 158, 156, 158, 160, 164, 170, 152, 168, 168, 156, 154, 154, 160, 144, 160, 150, 144, 154, 154, 144, 158, 150, 156, 160, 160, 150, 156, 152, 166, 164, 156, 158, 162, 148, 162, 148, 156, 152, 162, 156, 150, 150, 156, 148, 152, 148, 166, 140, 162, 154, 150, 162, 162, 164, 156, 156, 156, 158, 158, 154, 162, 154, 154, 156, 144, 158, 154, 144, 148, 148, 150, 156, 150, 156, 156, 162, 160, 160, 156, 164, 170, 140, 166, 158, 148, 150, 158, 158, 152, 158, 148, 152, 154, 148, 148, 156, 156, 154, 152, 152, 160, 156, 170, 160, 162, 164, 162, 156, 152, 162, 162, 148, 148, 156, 152, 138, 152, 152, 148, 158, 154, 154, 158, 160, 162, 160, 158, 166, 156, 166, 162, 164, 156, 158, 162}, + {152, 154, 162, 150, 162, 156, 166, 166, 156, 174, 164, 150, 170, 152, 164, 154, 152, 162, 140, 152, 150, 152, 152, 148, 158, 150, 164, 154, 156, 164, 156, 164, 164, 158, 168, 156, 166, 154, 156, 154, 160, 154, 150, 160, 144, 148, 150, 156, 150, 158, 150, 158, 154, 164, 160, 162, 160, 168, 172, 156, 170, 164, 150, 160, 150, 154, 158, 156, 148, 148, 158, 150, 148, 148, 158, 158, 152, 160, 158, 156, 166, 158, 164, 164, 160, 158, 162, 152, 148, 168, 144, 154, 164, 144, 154, 148, 152, 162, 144, 152, 166, 158, 156, 160, 168, 160, 166, 156, 156, 172, 156, 162, 160, 152, 158, 154, 156, 148, 150, 152, 152, 144, 152, 160, 152, 154, 166, 148, 164, 166, 156, 160, 152, 158, 154, 154, 148, 148, 146, 140, 146, 138, 150, 148, 142, 150, 154, 146, 150, 156, 160, 156, 158, 162, 166, 158, 158, 154, 156, 154, 156, 142, 152, 146, 142, 152, 136, 142, 152, 148, 140, 150, 158, 156, 144, 160, 152, 166, 152, 164, 172, 150, 174, 156, 156, 156, 160, 158, 156, 150, 156, 148, 146, 164, 154, 142, 162, 158, 144, 162, 150, 160, 164, 158, 164, 164, 166, 160, 158, 158, 156, 160, 150, 156, 150, 144, 158, 156, 142, 158, 146, 160, 158, 154, 150, 160, 160, 160, 168, 152, 166, 168, 150, 170, 162, 150, 164, 152, 162, 154, 158, 148, 148, 150, 150, 154, 146, 158, 154, 150, 170, 156, 164, 166, 162, 162, 162, 164, 164, 160, 160, 146, 174, 146, 158, 156, 140, 156, 154, 144, 154, 146, 158, 168, 154, 158, 160, 162, 156, 172, 150, 172, 162, 162, 162, 154, 148, 164, 154, 156, 150, 154, 148, 154, 156, 146, 164, 150, 164, 162, 142, 166, 162, 172, 160, 160, 164, 164, 166, 158, 164, 150, 156, 154, 140, 162, 144, 152, 154, 156, 144, 162, 156, 160, 154, 160, 158, 154, 168, 164, 164, 154, 164, 174, 150, 162, 160, 158, 158, 152, 154, 150, 150, 156, 148, 156, 152, 152, 152, 160, 156, 164, 160, 162, 154, 172, 158, 160, 160, 164}, + {170, 154, 144, 172, 150, 162, 162, 160, 154, 160, 170, 154, 156, 160, 152, 164, 148, 154, 160, 148, 152, 148, 148, 156, 148, 152, 156, 156, 156, 156, 164, 154, 172, 152, 166, 158, 154, 168, 152, 158, 154, 154, 150, 150, 160, 144, 156, 150, 150, 158, 146, 164, 158, 150, 168, 160, 152, 166, 154, 160, 166, 162, 148, 166, 160, 150, 164, 138, 164, 152, 144, 158, 156, 150, 162, 148, 156, 164, 154, 160, 162, 162, 158, 166, 160, 162, 164, 156, 164, 148, 158, 158, 142, 148, 152, 156, 142, 154, 158, 144, 160, 146, 164, 158, 148, 174, 152, 162, 174, 152, 158, 164, 160, 154, 164, 160, 140, 166, 142, 148, 154, 150, 162, 146, 148, 164, 152, 156, 162, 158, 154, 166, 156, 150, 156, 142, 152, 148, 136, 156, 142, 150, 150, 136, 142, 152, 140, 154, 156, 156, 154, 158, 148, 166, 156, 152, 156, 162, 144, 160, 146, 148, 148, 146, 144, 150, 152, 136, 140, 142, 150, 154, 140, 166, 160, 148, 166, 152, 160, 168, 156, 156, 160, 168, 156, 164, 150, 162, 162, 150, 156, 154, 152, 152, 142, 152, 154, 154, 152, 152, 168, 148, 162, 156, 156, 172, 150, 168, 152, 162, 164, 152, 164, 158, 158, 158, 148, 150, 148, 156, 150, 148, 156, 150, 162, 154, 148, 164, 156, 160, 164, 154, 162, 164, 166, 148, 166, 148, 150, 158, 146, 158, 156, 146, 154, 148, 156, 158, 152, 150, 156, 158, 150, 168, 154, 166, 164, 156, 168, 156, 158, 164, 144, 156, 158, 148, 150, 158, 148, 152, 156, 154, 150, 158, 152, 164, 156, 152, 172, 150, 164, 162, 160, 162, 168, 160, 144, 164, 152, 150, 158, 144, 160, 148, 144, 166, 144, 150, 156, 156, 154, 162, 156, 152, 162, 156, 160, 164, 152, 162, 154, 156, 158, 156, 158, 154, 150, 146, 154, 150, 152, 150, 152, 156, 162, 146, 168, 160, 148, 170, 156, 158, 164, 150, 158, 152, 154, 150, 158, 148, 154, 156, 142, 156, 160, 144, 158, 156, 152, 162, 156, 154, 168, 162, 160, 160, 160, 156, 160, 146}, + {150, 156, 152, 154, 162, 154, 168, 158, 168, 168, 146, 172, 160, 156, 164, 140, 156, 160, 150, 146, 158, 152, 150, 154, 154, 154, 158, 148, 170, 152, 158, 174, 150, 162, 170, 156, 162, 156, 166, 144, 168, 148, 154, 158, 142, 162, 146, 148, 160, 144, 158, 162, 152, 156, 154, 164, 154, 168, 158, 156, 168, 158, 162, 146, 152, 164, 150, 150, 150, 148, 156, 150, 150, 144, 166, 148, 152, 162, 150, 166, 160, 160, 164, 160, 162, 164, 152, 154, 164, 160, 144, 168, 152, 150, 156, 140, 168, 148, 152, 164, 146, 158, 164, 154, 162, 166, 166, 148, 168, 162, 154, 164, 154, 164, 152, 144, 166, 140, 156, 160, 146, 148, 160, 156, 144, 164, 152, 154, 168, 156, 162, 152, 158, 160, 152, 152, 154, 146, 148, 144, 148, 130, 156, 144, 142, 156, 142, 158, 156, 150, 166, 148, 168, 158, 160, 152, 172, 146, 160, 156, 156, 142, 156, 138, 146, 134, 142, 158, 140, 144, 160, 138, 154, 158, 156, 148, 160, 160, 154, 164, 156, 172, 162, 152, 176, 156, 154, 162, 146, 158, 154, 156, 148, 150, 158, 144, 152, 154, 160, 158, 148, 166, 146, 164, 172, 152, 158, 172, 166, 150, 164, 158, 144, 166, 150, 150, 152, 154, 164, 148, 144, 170, 134, 154, 160, 154, 154, 162, 172, 152, 170, 156, 166, 158, 160, 164, 144, 164, 166, 152, 154, 156, 152, 144, 158, 152, 144, 162, 152, 156, 154, 156, 172, 160, 156, 172, 148, 166, 166, 164, 146, 162, 158, 144, 166, 146, 154, 150, 152, 154, 148, 152, 164, 142, 154, 158, 158, 158, 162, 170, 148, 176, 156, 156, 156, 154, 166, 148, 150, 164, 140, 152, 152, 152, 148, 154, 158, 144, 168, 148, 164, 164, 162, 166, 154, 168, 170, 150, 164, 166, 164, 148, 166, 152, 134, 168, 152, 144, 158, 144, 164, 146, 156, 160, 148, 160, 162, 162, 158, 174, 156, 154, 170, 160, 162, 160, 154, 162, 148, 154, 164, 138, 158, 158, 142, 150, 160, 162, 148, 162, 148, 170, 160, 158, 172, 158, 158, 172, 158, 160}, + {166, 146, 160, 154, 154, 170, 148, 164, 166, 152, 164, 172, 162, 146, 166, 156, 150, 154, 150, 156, 146, 150, 162, 142, 154, 162, 150, 158, 152, 156, 154, 172, 166, 150, 172, 158, 162, 168, 148, 164, 142, 166, 154, 140, 150, 166, 150, 142, 160, 156, 136, 162, 150, 158, 164, 162, 174, 158, 156, 180, 150, 158, 166, 156, 148, 172, 154, 146, 170, 146, 146, 152, 148, 160, 138, 160, 168, 138, 158, 172, 164, 148, 176, 152, 154, 174, 160, 162, 154, 156, 166, 140, 152, 162, 144, 152, 154, 150, 140, 166, 158, 144, 170, 146, 156, 160, 156, 176, 156, 158, 174, 146, 150, 162, 156, 150, 168, 152, 138, 160, 150, 152, 156, 152, 162, 148, 148, 172, 142, 162, 160, 150, 150, 160, 152, 148, 160, 138, 144, 156, 132, 164, 132, 144, 160, 132, 146, 156, 148, 148, 162, 160, 138, 172, 160, 152, 166, 148, 166, 146, 150, 158, 136, 148, 148, 152, 134, 150, 140, 132, 158, 146, 150, 160, 146, 168, 148, 152, 176, 142, 168, 162, 154, 160, 166, 162, 150, 168, 154, 154, 158, 142, 158, 142, 150, 162, 144, 150, 158, 148, 152, 162, 160, 152, 170, 156, 168, 164, 156, 176, 154, 156, 166, 142, 164, 162, 146, 142, 156, 154, 142, 160, 158, 152, 158, 156, 170, 148, 156, 168, 154, 156, 180, 150, 156, 164, 164, 134, 170, 148, 146, 162, 144, 156, 150, 148, 160, 138, 158, 166, 152, 152, 168, 156, 150, 164, 166, 152, 166, 156, 168, 156, 158, 170, 142, 156, 160, 148, 140, 160, 152, 140, 166, 158, 148, 168, 156, 164, 160, 162, 168, 158, 166, 166, 158, 154, 168, 154, 148, 166, 148, 150, 158, 148, 162, 148, 152, 162, 144, 152, 166, 154, 154, 170, 160, 144, 166, 168, 158, 162, 150, 166, 150, 150, 176, 140, 150, 164, 140, 152, 156, 156, 146, 170, 156, 150, 170, 148, 168, 162, 162, 174, 154, 162, 166, 146, 160, 158, 156, 140, 154, 154, 140, 160, 146, 158, 156, 146, 168, 144, 162, 160, 152, 160, 170, 156, 158, 170, 158, 150}, + {134, 162, 164, 156, 148, 166, 162, 146, 174, 160, 156, 164, 156, 168, 148, 158, 172, 144, 150, 162, 146, 144, 164, 148, 144, 172, 150, 156, 162, 156, 166, 152, 162, 172, 150, 160, 172, 146, 152, 170, 152, 140, 172, 154, 154, 150, 152, 160, 148, 156, 162, 144, 158, 170, 144, 148, 168, 160, 156, 164, 166, 154, 160, 166, 160, 146, 154, 166, 132, 156, 164, 144, 146, 160, 160, 136, 158, 166, 152, 164, 154, 166, 164, 162, 178, 142, 162, 168, 148, 156, 160, 156, 150, 164, 150, 146, 154, 150, 158, 150, 156, 170, 144, 162, 172, 154, 152, 166, 162, 156, 168, 170, 152, 168, 148, 160, 146, 156, 162, 140, 148, 162, 138, 144, 164, 154, 154, 166, 160, 158, 166, 160, 162, 152, 148, 172, 140, 150, 158, 130, 148, 150, 148, 134, 148, 152, 140, 150, 152, 162, 154, 152, 170, 146, 156, 178, 142, 154, 164, 150, 146, 158, 150, 138, 156, 134, 154, 142, 148, 160, 136, 142, 164, 136, 150, 168, 158, 146, 164, 166, 150, 170, 164, 162, 164, 158, 168, 146, 158, 168, 142, 150, 162, 156, 138, 166, 146, 150, 164, 150, 158, 154, 160, 166, 154, 162, 168, 148, 160, 162, 156, 152, 168, 154, 146, 156, 152, 154, 152, 156, 158, 146, 154, 158, 148, 148, 160, 158, 150, 172, 160, 158, 168, 166, 156, 166, 152, 170, 138, 162, 166, 136, 154, 160, 146, 150, 160, 166, 138, 158, 158, 160, 162, 162, 174, 154, 156, 180, 150, 160, 160, 150, 148, 156, 158, 142, 164, 150, 148, 152, 144, 170, 136, 156, 172, 138, 154, 166, 154, 150, 178, 158, 148, 170, 158, 152, 158, 158, 162, 144, 160, 162, 140, 148, 158, 148, 144, 164, 156, 152, 166, 156, 156, 162, 162, 174, 154, 150, 176, 154, 152, 166, 146, 150, 170, 154, 138, 158, 154, 150, 152, 144, 168, 146, 152, 168, 146, 166, 176, 148, 148, 172, 152, 156, 168, 154, 158, 164, 148, 166, 150, 146, 166, 142, 150, 164, 138, 150, 160, 164, 140, 170, 162, 156, 162, 164, 174, 152, 156, 172}, + {160, 142, 160, 156, 162, 156, 166, 176, 160, 152, 180, 148, 158, 166, 156, 142, 162, 160, 144, 150, 154, 158, 152, 150, 160, 138, 154, 170, 144, 150, 172, 156, 150, 178, 162, 154, 164, 168, 162, 154, 156, 168, 142, 150, 166, 142, 144, 152, 156, 138, 166, 160, 144, 156, 168, 158, 162, 164, 172, 152, 158, 180, 146, 150, 168, 152, 144, 166, 156, 148, 154, 154, 154, 150, 156, 166, 146, 154, 168, 146, 154, 172, 148, 154, 164, 170, 154, 158, 160, 156, 156, 152, 162, 142, 152, 168, 134, 148, 168, 142, 144, 162, 160, 146, 158, 164, 160, 164, 160, 174, 148, 156, 180, 136, 160, 164, 144, 144, 172, 144, 146, 162, 162, 154, 152, 150, 168, 148, 154, 166, 150, 150, 174, 144, 154, 168, 150, 142, 152, 146, 146, 146, 148, 150, 138, 142, 158, 140, 150, 162, 144, 148, 170, 154, 152, 162, 164, 152, 160, 156, 166, 144, 152, 154, 130, 150, 156, 138, 136, 154, 144, 142, 154, 156, 152, 162, 154, 164, 154, 152, 178, 150, 160, 174, 150, 154, 166, 158, 150, 164, 160, 152, 154, 154, 158, 148, 148, 164, 138, 156, 168, 150, 144, 172, 158, 152, 166, 170, 160, 172, 172, 154, 150, 156, 168, 144, 146, 166, 144, 140, 162, 146, 146, 168, 160, 154, 160, 156, 162, 156, 164, 172, 148, 158, 178, 148, 158, 166, 152, 138, 162, 160, 148, 150, 152, 158, 150, 138, 172, 146, 154, 166, 148, 150, 166, 160, 160, 168, 168, 156, 158, 168, 164, 158, 152, 162, 142, 150, 168, 136, 146, 162, 156, 142, 158, 162, 152, 164, 170, 164, 158, 156, 182, 138, 166, 180, 140, 150, 162, 154, 138, 160, 154, 148, 154, 152, 158, 152, 154, 170, 140, 158, 170, 154, 150, 172, 158, 166, 180, 158, 152, 158, 154, 160, 146, 154, 162, 144, 146, 168, 142, 146, 168, 150, 154, 162, 156, 154, 166, 170, 162, 160, 164, 176, 152, 154, 166, 144, 152, 166, 150, 146, 154, 154, 140, 160, 162, 156, 160, 150, 172, 144, 158, 180, 146, 154, 172, 162, 154, 164}, + {144, 162, 146, 152, 164, 146, 156, 164, 160, 158, 164, 164, 162, 160, 160, 162, 158, 146, 172, 146, 152, 160, 138, 148, 158, 156, 146, 156, 162, 160, 158, 166, 164, 154, 156, 178, 150, 162, 166, 150, 146, 168, 150, 150, 152, 162, 144, 160, 150, 160, 150, 154, 170, 154, 142, 170, 154, 154, 174, 152, 158, 164, 164, 158, 156, 162, 158, 152, 150, 164, 138, 148, 168, 138, 146, 162, 156, 148, 172, 164, 156, 156, 172, 166, 164, 154, 176, 152, 152, 164, 156, 142, 166, 150, 144, 152, 164, 144, 154, 162, 160, 150, 156, 164, 156, 154, 184, 148, 154, 168, 162, 148, 166, 164, 154, 158, 160, 154, 148, 150, 162, 142, 142, 164, 140, 150, 166, 150, 150, 160, 166, 154, 154, 158, 158, 152, 154, 162, 140, 144, 160, 130, 140, 154, 144, 142, 156, 152, 142, 158, 154, 160, 152, 160, 162, 146, 158, 164, 142, 152, 160, 146, 140, 148, 152, 144, 148, 146, 142, 142, 148, 158, 140, 144, 170, 142, 150, 170, 148, 162, 166, 164, 154, 168, 170, 162, 160, 158, 160, 144, 148, 166, 140, 146, 162, 144, 148, 160, 154, 148, 160, 162, 160, 150, 166, 178, 148, 152, 174, 142, 152, 170, 154, 150, 166, 160, 146, 156, 158, 150, 150, 156, 160, 146, 152, 164, 146, 150, 176, 154, 152, 174, 162, 154, 166, 170, 152, 158, 160, 164, 154, 146, 170, 142, 148, 164, 142, 148, 166, 154, 152, 160, 170, 154, 162, 162, 166, 152, 152, 182, 146, 148, 170, 144, 148, 172, 154, 146, 152, 164, 152, 148, 156, 164, 150, 152, 170, 144, 150, 176, 148, 158, 162, 168, 152, 160, 168, 158, 156, 158, 166, 150, 152, 162, 140, 142, 166, 140, 148, 168, 158, 154, 162, 162, 160, 166, 158, 170, 148, 152, 172, 146, 156, 166, 152, 146, 160, 148, 146, 156, 156, 152, 152, 156, 160, 152, 154, 166, 150, 152, 174, 150, 154, 166, 160, 154, 158, 160, 158, 158, 156, 154, 150, 144, 162, 146, 136, 168, 144, 150, 162, 154, 158, 166, 166, 160, 162, 160, 174, 154}, + {148, 164, 156, 154, 154, 168, 156, 164, 164, 166, 154, 160, 170, 148, 160, 166, 142, 160, 154, 154, 146, 156, 162, 148, 148, 158, 154, 154, 154, 164, 150, 150, 174, 156, 156, 162, 164, 156, 158, 164, 164, 152, 158, 166, 140, 146, 166, 136, 148, 168, 144, 148, 160, 152, 162, 166, 166, 156, 160, 166, 170, 162, 154, 172, 138, 152, 170, 146, 150, 166, 148, 146, 154, 156, 154, 152, 154, 166, 146, 154, 164, 158, 156, 180, 146, 162, 166, 162, 156, 160, 158, 154, 158, 152, 162, 146, 136, 168, 142, 146, 166, 148, 148, 174, 152, 152, 164, 172, 164, 162, 158, 176, 154, 154, 166, 150, 146, 168, 144, 152, 156, 158, 146, 158, 158, 152, 162, 160, 164, 154, 158, 168, 160, 146, 166, 144, 144, 156, 142, 142, 146, 154, 144, 146, 146, 150, 146, 138, 158, 148, 154, 172, 152, 152, 164, 162, 152, 158, 164, 154, 158, 156, 156, 146, 140, 154, 136, 136, 162, 138, 142, 154, 150, 142, 156, 158, 154, 158, 158, 164, 152, 166, 162, 152, 156, 178, 146, 158, 166, 148, 160, 156, 160, 158, 148, 162, 152, 150, 154, 160, 144, 152, 164, 152, 150, 162, 164, 160, 168, 170, 160, 156, 158, 168, 152, 152, 164, 144, 152, 166, 140, 138, 164, 146, 146, 162, 160, 158, 154, 166, 164, 154, 164, 178, 146, 160, 170, 134, 152, 160, 152, 146, 160, 152, 148, 156, 154, 160, 144, 160, 162, 146, 148, 172, 154, 154, 176, 150, 166, 160, 170, 158, 152, 168, 152, 150, 156, 162, 144, 140, 162, 150, 142, 162, 148, 152, 166, 166, 154, 164, 166, 164, 164, 152, 170, 156, 146, 164, 152, 142, 166, 146, 148, 150, 160, 150, 152, 162, 154, 150, 156, 158, 156, 152, 176, 148, 160, 170, 162, 158, 160, 154, 154, 156, 156, 160, 154, 150, 160, 146, 146, 162, 146, 144, 166, 152, 154, 160, 170, 162, 158, 174, 166, 160, 160, 166, 156, 144, 172, 138, 144, 172, 138, 156, 158, 160, 154, 156, 154, 164, 156, 160, 164, 150, 160, 174, 150, 158, 164, 160}, + {160, 144, 156, 162, 156, 146, 170, 146, 158, 176, 156, 158, 164, 170, 152, 154, 160, 158, 150, 154, 162, 146, 144, 166, 144, 146, 170, 146, 156, 166, 162, 156, 154, 170, 162, 160, 164, 164, 154, 154, 160, 154, 150, 154, 156, 152, 154, 158, 150, 152, 158, 158, 154, 158, 160, 150, 150, 172, 158, 158, 164, 158, 160, 158, 162, 164, 146, 156, 164, 146, 152, 162, 146, 156, 158, 146, 154, 156, 152, 154, 160, 162, 160, 150, 168, 170, 156, 162, 168, 150, 150, 168, 150, 148, 158, 148, 166, 148, 152, 158, 150, 156, 160, 148, 164, 162, 150, 162, 162, 160, 156, 162, 158, 152, 164, 152, 154, 152, 158, 148, 150, 154, 166, 146, 144, 166, 144, 154, 164, 152, 150, 168, 146, 164, 156, 164, 156, 148, 150, 150, 144, 144, 146, 142, 144, 152, 140, 148, 156, 152, 152, 148, 158, 158, 156, 162, 162, 160, 150, 158, 152, 148, 154, 148, 140, 152, 154, 144, 142, 148, 142, 144, 146, 156, 150, 148, 168, 150, 156, 170, 156, 156, 176, 158, 162, 162, 164, 160, 152, 164, 156, 152, 150, 158, 140, 142, 156, 150, 144, 166, 156, 162, 154, 166, 154, 164, 164, 170, 152, 164, 164, 156, 156, 168, 154, 156, 160, 152, 144, 150, 160, 156, 152, 160, 156, 152, 154, 158, 158, 150, 172, 156, 156, 162, 162, 168, 158, 166, 162, 152, 154, 164, 140, 154, 158, 154, 144, 162, 148, 148, 166, 152, 162, 156, 160, 170, 154, 166, 168, 158, 154, 170, 152, 142, 162, 152, 148, 158, 146, 156, 152, 152, 162, 146, 156, 172, 148, 148, 166, 156, 162, 168, 154, 162, 176, 156, 156, 162, 160, 162, 156, 154, 156, 154, 150, 152, 152, 140, 168, 152, 148, 166, 152, 152, 166, 166, 164, 158, 166, 172, 156, 158, 158, 156, 150, 156, 146, 144, 164, 156, 148, 160, 154, 158, 152, 160, 158, 156, 162, 164, 162, 148, 166, 158, 152, 166, 154, 160, 152, 166, 152, 146, 158, 148, 148, 148, 154, 146, 154, 162, 154, 146, 170, 158, 156, 164, 166, 156, 162, 164}, + {162, 154, 150, 160, 158, 156, 160, 164, 166, 154, 162, 162, 164, 158, 166, 152, 156, 160, 154, 148, 160, 148, 158, 148, 158, 150, 144, 166, 154, 150, 158, 162, 166, 160, 168, 162, 154, 164, 166, 156, 162, 156, 160, 154, 156, 152, 144, 162, 146, 156, 154, 154, 152, 150, 170, 158, 156, 160, 166, 162, 156, 168, 164, 158, 164, 156, 158, 152, 154, 152, 154, 152, 144, 152, 146, 148, 160, 156, 158, 162, 156, 156, 168, 170, 156, 162, 154, 160, 160, 156, 166, 152, 156, 160, 148, 152, 152, 154, 154, 150, 158, 150, 162, 156, 150, 164, 166, 154, 168, 156, 168, 158, 168, 166, 148, 154, 166, 148, 148, 162, 148, 146, 154, 150, 152, 156, 158, 150, 164, 150, 168, 158, 166, 152, 158, 144, 166, 144, 140, 156, 142, 146, 150, 142, 152, 142, 146, 144, 152, 148, 154, 156, 162, 156, 158, 162, 156, 156, 156, 158, 152, 148, 156, 148, 156, 142, 150, 142, 146, 144, 162, 144, 142, 156, 152, 154, 152, 156, 156, 156, 154, 166, 154, 166, 160, 164, 158, 158, 156, 148, 160, 152, 152, 162, 154, 156, 154, 152, 160, 148, 160, 154, 156, 160, 162, 160, 152, 170, 158, 156, 164, 164, 156, 152, 156, 162, 146, 164, 160, 146, 146, 154, 150, 144, 160, 156, 152, 172, 154, 160, 158, 168, 164, 154, 170, 152, 164, 152, 156, 162, 150, 162, 158, 144, 156, 148, 154, 142, 158, 160, 150, 160, 162, 160, 156, 160, 170, 158, 164, 156, 162, 156, 152, 174, 154, 156, 164, 148, 154, 156, 146, 164, 144, 160, 150, 150, 154, 160, 154, 162, 162, 156, 164, 164, 152, 166, 162, 160, 146, 164, 146, 156, 154, 148, 156, 162, 150, 160, 150, 160, 158, 150, 158, 170, 152, 166, 158, 160, 154, 166, 158, 152, 166, 152, 156, 160, 158, 158, 146, 146, 154, 154, 152, 154, 154, 156, 160, 162, 152, 168, 154, 172, 164, 164, 160, 160, 162, 158, 158, 152, 152, 158, 152, 160, 148, 148, 164, 152, 152, 160, 152, 166, 150, 164, 164, 160, 158, 166, 164, 156}, + {150, 160, 152, 150, 156, 160, 162, 156, 158, 166, 166, 162, 162, 164, 150, 160, 160, 158, 146, 158, 150, 162, 144, 154, 146, 158, 162, 148, 154, 156, 156, 156, 156, 162, 158, 164, 164, 158, 166, 152, 160, 166, 148, 164, 152, 154, 152, 150, 154, 150, 148, 158, 154, 160, 152, 162, 154, 164, 162, 162, 162, 168, 158, 160, 152, 160, 148, 156, 158, 158, 146, 150, 162, 152, 160, 162, 150, 152, 164, 154, 158, 156, 168, 152, 164, 162, 164, 168, 156, 160, 150, 162, 160, 146, 166, 144, 154, 148, 150, 158, 144, 158, 158, 158, 160, 156, 158, 156, 172, 166, 156, 170, 166, 148, 168, 150, 158, 160, 158, 150, 154, 150, 156, 154, 156, 158, 152, 164, 150, 160, 156, 158, 156, 160, 150, 168, 154, 156, 160, 142, 148, 144, 146, 156, 140, 150, 144, 150, 144, 146, 162, 150, 152, 162, 160, 148, 162, 162, 154, 164, 158, 158, 146, 154, 144, 152, 144, 152, 140, 144, 146, 144, 148, 150, 154, 150, 160, 160, 152, 166, 164, 154, 168, 160, 172, 152, 164, 162, 154, 164, 154, 156, 148, 156, 156, 148, 156, 156, 142, 158, 154, 152, 160, 150, 160, 156, 166, 158, 168, 168, 164, 160, 158, 162, 164, 140, 168, 146, 150, 152, 156, 150, 158, 160, 144, 166, 150, 150, 164, 154, 172, 164, 162, 158, 162, 166, 160, 154, 168, 152, 162, 152, 152, 150, 156, 154, 148, 160, 158, 148, 154, 160, 158, 152, 156, 172, 150, 168, 158, 168, 162, 160, 164, 146, 160, 156, 146, 162, 150, 152, 154, 144, 162, 150, 158, 158, 160, 152, 164, 164, 160, 172, 160, 160, 164, 162, 158, 156, 164, 148, 156, 160, 154, 156, 142, 152, 152, 152, 160, 150, 156, 160, 156, 158, 166, 156, 168, 156, 170, 158, 166, 164, 150, 158, 158, 154, 148, 156, 154, 154, 156, 138, 154, 164, 154, 152, 162, 152, 156, 160, 168, 156, 166, 158, 168, 152, 156, 166, 154, 160, 160, 148, 150, 144, 158, 152, 156, 154, 152, 154, 160, 152, 164, 164, 158, 152, 162, 168, 152, 166}, + {152, 158, 150, 170, 152, 160, 154, 158, 164, 160, 156, 168, 160, 154, 170, 162, 152, 162, 162, 148, 154, 148, 162, 144, 152, 160, 144, 156, 158, 164, 152, 172, 152, 158, 162, 168, 152, 172, 160, 162, 156, 148, 160, 156, 150, 160, 152, 148, 160, 160, 144, 160, 160, 148, 158, 158, 156, 154, 164, 168, 164, 146, 168, 168, 152, 160, 162, 154, 156, 158, 148, 156, 152, 150, 154, 144, 158, 154, 148, 164, 162, 150, 166, 170, 152, 168, 170, 150, 158, 172, 152, 156, 148, 160, 148, 154, 156, 158, 146, 162, 166, 134, 166, 154, 144, 158, 168, 162, 160, 152, 166, 158, 160, 166, 154, 158, 158, 164, 146, 152, 158, 150, 154, 154, 150, 154, 154, 154, 152, 154, 168, 166, 146, 162, 162, 146, 162, 150, 144, 148, 152, 138, 148, 142, 150, 138, 148, 144, 154, 144, 154, 168, 148, 158, 158, 158, 156, 166, 156, 158, 148, 162, 146, 144, 156, 148, 146, 140, 156, 140, 148, 148, 142, 150, 152, 156, 154, 150, 164, 152, 152, 164, 162, 158, 162, 172, 150, 162, 160, 150, 162, 162, 154, 152, 152, 156, 146, 148, 164, 152, 150, 164, 160, 156, 162, 158, 156, 162, 170, 152, 162, 166, 156, 154, 146, 170, 148, 156, 166, 154, 142, 162, 156, 138, 160, 150, 160, 162, 154, 156, 148, 158, 166, 160, 154, 170, 168, 152, 156, 166, 152, 156, 166, 144, 154, 158, 160, 146, 146, 160, 150, 150, 158, 158, 156, 160, 174, 150, 172, 168, 154, 160, 156, 164, 148, 150, 166, 152, 144, 154, 164, 150, 156, 160, 142, 158, 166, 152, 156, 156, 168, 154, 158, 166, 162, 158, 164, 168, 146, 168, 154, 142, 154, 164, 146, 152, 156, 152, 144, 160, 154, 156, 152, 162, 160, 156, 168, 168, 150, 170, 158, 152, 158, 162, 162, 152, 158, 156, 144, 156, 152, 162, 148, 162, 152, 156, 154, 168, 150, 164, 162, 166, 154, 168, 156, 170, 150, 156, 160, 148, 156, 160, 152, 164, 150, 152, 152, 148, 164, 150, 150, 168, 152, 144, 166, 168, 160, 166, 170, 158}, + {146, 138, 176, 150, 144, 160, 166, 156, 164, 170, 150, 170, 172, 154, 154, 154, 164, 154, 148, 168, 152, 144, 156, 156, 148, 158, 162, 144, 160, 158, 154, 150, 164, 172, 162, 150, 172, 156, 156, 166, 160, 148, 168, 160, 146, 158, 162, 140, 150, 154, 156, 148, 150, 168, 152, 148, 174, 160, 146, 174, 168, 152, 164, 164, 156, 162, 154, 154, 156, 144, 162, 152, 138, 166, 162, 146, 160, 162, 148, 164, 164, 150, 156, 164, 166, 164, 156, 174, 154, 138, 170, 158, 152, 158, 166, 140, 154, 162, 144, 146, 156, 156, 156, 148, 170, 158, 146, 168, 170, 152, 168, 170, 150, 156, 170, 146, 162, 148, 162, 146, 154, 162, 152, 140, 160, 154, 148, 160, 168, 146, 162, 164, 154, 154, 162, 154, 150, 152, 152, 146, 142, 154, 150, 132, 152, 148, 142, 154, 152, 148, 152, 152, 156, 154, 158, 162, 156, 144, 172, 152, 150, 162, 160, 140, 152, 152, 132, 152, 146, 146, 144, 140, 158, 148, 140, 158, 162, 144, 166, 168, 146, 172, 166, 158, 160, 158, 168, 154, 158, 168, 160, 136, 172, 160, 142, 158, 164, 142, 152, 168, 140, 158, 156, 162, 152, 160, 168, 162, 148, 176, 162, 152, 170, 166, 150, 154, 166, 144, 154, 156, 154, 144, 150, 168, 150, 152, 166, 156, 144, 170, 166, 158, 158, 176, 152, 164, 164, 156, 166, 150, 156, 154, 138, 174, 150, 134, 160, 162, 144, 162, 166, 150, 158, 164, 148, 160, 154, 164, 166, 148, 174, 160, 152, 160, 160, 152, 158, 160, 152, 152, 150, 150, 150, 152, 158, 158, 138, 168, 160, 150, 164, 176, 154, 158, 178, 154, 158, 160, 154, 158, 150, 170, 156, 140, 164, 154, 138, 164, 168, 134, 164, 162, 150, 156, 162, 166, 156, 164, 170, 164, 152, 164, 164, 150, 154, 166, 142, 158, 164, 148, 154, 158, 150, 146, 162, 152, 158, 148, 170, 156, 142, 182, 166, 154, 170, 160, 156, 162, 156, 150, 150, 158, 154, 148, 144, 160, 156, 146, 154, 164, 152, 162, 168, 156, 164, 168, 158, 160, 156, 172}, + {170, 144, 150, 162, 150, 160, 158, 162, 158, 156, 170, 160, 142, 172, 170, 146, 164, 162, 150, 160, 162, 146, 154, 160, 148, 150, 150, 168, 156, 146, 162, 168, 142, 160, 174, 152, 164, 180, 152, 158, 160, 158, 162, 152, 158, 158, 136, 166, 158, 132, 172, 162, 142, 156, 166, 146, 154, 160, 166, 158, 164, 172, 160, 152, 170, 168, 144, 162, 174, 144, 156, 160, 156, 148, 148, 156, 154, 154, 160, 156, 152, 168, 162, 138, 178, 162, 158, 162, 174, 158, 152, 158, 152, 156, 146, 174, 148, 130, 172, 162, 140, 164, 164, 146, 158, 172, 156, 162, 160, 166, 160, 154, 178, 162, 144, 172, 158, 140, 166, 170, 140, 150, 166, 144, 154, 158, 154, 154, 148, 166, 156, 136, 174, 160, 142, 170, 164, 138, 152, 160, 150, 148, 146, 154, 142, 142, 154, 152, 136, 160, 154, 138, 168, 162, 150, 158, 172, 148, 160, 164, 150, 152, 154, 156, 150, 126, 170, 146, 130, 164, 150, 138, 148, 156, 146, 152, 156, 152, 156, 152, 168, 154, 150, 170, 166, 148, 176, 176, 142, 162, 162, 148, 156, 160, 148, 152, 150, 162, 158, 130, 176, 154, 144, 164, 166, 148, 166, 172, 152, 162, 174, 154, 154, 158, 156, 162, 150, 160, 156, 136, 160, 162, 146, 160, 166, 136, 162, 162, 152, 160, 158, 162, 164, 156, 170, 160, 146, 170, 164, 144, 164, 166, 144, 152, 156, 156, 156, 148, 158, 150, 148, 160, 166, 132, 174, 166, 146, 172, 172, 156, 166, 164, 158, 148, 164, 154, 160, 150, 158, 160, 136, 168, 158, 138, 160, 166, 152, 160, 162, 154, 160, 150, 170, 166, 146, 180, 162, 146, 168, 160, 144, 154, 162, 144, 156, 160, 150, 152, 142, 174, 150, 150, 166, 160, 140, 168, 168, 148, 164, 168, 156, 154, 160, 156, 160, 154, 160, 154, 144, 162, 154, 138, 164, 162, 136, 164, 166, 158, 152, 164, 168, 156, 158, 170, 154, 158, 164, 154, 140, 178, 170, 136, 160, 156, 146, 160, 152, 150, 158, 152, 158, 152, 150, 164, 162, 146, 174, 168, 150, 172}, + {148, 158, 158, 142, 172, 156, 142, 166, 170, 148, 166, 166, 164, 164, 162, 164, 158, 152, 162, 154, 142, 162, 162, 130, 166, 160, 138, 158, 166, 142, 164, 148, 162, 158, 162, 170, 164, 140, 172, 162, 146, 168, 164, 142, 160, 158, 150, 152, 162, 148, 150, 146, 158, 162, 144, 174, 166, 142, 168, 162, 150, 160, 178, 146, 164, 146, 160, 160, 142, 164, 158, 142, 160, 164, 138, 164, 164, 138, 156, 166, 146, 160, 158, 170, 162, 156, 166, 164, 144, 168, 162, 144, 168, 166, 142, 156, 166, 146, 152, 144, 162, 154, 144, 168, 154, 150, 162, 158, 148, 170, 176, 150, 162, 170, 152, 166, 158, 156, 148, 148, 156, 162, 140, 166, 160, 132, 172, 154, 146, 162, 170, 146, 160, 156, 158, 158, 144, 172, 144, 140, 150, 154, 138, 158, 160, 126, 154, 152, 142, 146, 152, 160, 158, 154, 158, 164, 148, 166, 160, 132, 174, 170, 136, 160, 160, 144, 144, 150, 144, 146, 138, 154, 142, 144, 154, 154, 142, 174, 162, 146, 162, 168, 152, 164, 162, 168, 156, 156, 166, 162, 150, 170, 160, 136, 168, 166, 140, 154, 156, 148, 154, 168, 146, 164, 154, 168, 148, 154, 174, 166, 142, 176, 156, 150, 168, 164, 148, 162, 160, 152, 148, 154, 140, 154, 144, 166, 160, 146, 172, 164, 148, 162, 170, 152, 162, 174, 158, 162, 150, 168, 156, 148, 164, 158, 142, 168, 152, 140, 160, 170, 146, 156, 154, 160, 156, 150, 170, 160, 150, 168, 164, 150, 172, 176, 138, 166, 166, 144, 158, 160, 150, 156, 144, 164, 154, 140, 164, 154, 146, 178, 162, 144, 182, 164, 154, 158, 160, 162, 156, 146, 158, 148, 152, 162, 154, 140, 166, 168, 138, 152, 170, 150, 162, 166, 152, 160, 164, 164, 168, 148, 182, 162, 144, 174, 162, 142, 168, 166, 130, 160, 156, 144, 156, 146, 162, 152, 146, 158, 164, 148, 162, 172, 144, 166, 176, 152, 160, 166, 154, 152, 154, 162, 156, 154, 156, 154, 152, 162, 160, 136, 164, 170, 142, 166, 162, 152, 164, 160, 164, 154}, + {142, 158, 156, 148, 154, 152, 158, 158, 148, 162, 164, 158, 172, 168, 150, 158, 164, 150, 160, 158, 156, 150, 152, 154, 150, 150, 160, 158, 146, 170, 162, 150, 174, 152, 152, 166, 162, 160, 172, 158, 160, 156, 154, 160, 156, 150, 168, 148, 142, 164, 160, 148, 160, 160, 152, 158, 154, 162, 162, 160, 170, 172, 148, 176, 162, 156, 162, 166, 152, 162, 160, 142, 160, 148, 156, 152, 142, 160, 160, 144, 168, 164, 150, 166, 168, 156, 162, 174, 156, 160, 162, 148, 162, 148, 158, 160, 146, 152, 158, 150, 160, 158, 148, 164, 162, 148, 152, 168, 156, 174, 144, 172, 158, 150, 172, 166, 146, 166, 166, 144, 164, 156, 146, 154, 146, 160, 150, 154, 158, 166, 146, 170, 152, 150, 164, 170, 150, 156, 166, 140, 158, 146, 134, 150, 140, 154, 148, 140, 156, 162, 136, 156, 160, 148, 164, 162, 148, 154, 168, 162, 154, 148, 158, 152, 136, 156, 150, 142, 154, 154, 142, 154, 150, 142, 156, 150, 152, 148, 150, 166, 154, 154, 160, 178, 154, 170, 168, 158, 154, 164, 152, 160, 146, 160, 152, 150, 150, 156, 146, 158, 160, 142, 160, 160, 144, 166, 166, 150, 168, 168, 156, 162, 162, 162, 152, 158, 160, 158, 144, 168, 158, 146, 170, 160, 142, 162, 154, 148, 160, 154, 158, 168, 144, 166, 168, 152, 170, 164, 150, 156, 170, 148, 160, 158, 144, 152, 152, 154, 150, 140, 164, 164, 152, 172, 162, 160, 162, 174, 148, 170, 170, 152, 166, 142, 162, 164, 142, 164, 162, 140, 160, 156, 140, 156, 162, 150, 162, 164, 148, 156, 152, 162, 164, 160, 164, 164, 150, 168, 164, 156, 166, 170, 146, 152, 162, 144, 154, 140, 156, 158, 144, 156, 160, 152, 166, 162, 150, 168, 176, 146, 164, 166, 156, 158, 150, 156, 152, 144, 172, 154, 146, 166, 158, 150, 164, 158, 148, 164, 158, 148, 168, 162, 168, 160, 156, 162, 168, 146, 170, 166, 148, 156, 164, 140, 160, 156, 144, 152, 154, 154, 160, 146, 174, 162, 152, 164, 168, 156, 180, 168}, + {152, 150, 154, 164, 158, 154, 172, 156, 158, 160, 156, 156, 162, 158, 164, 154, 160, 152, 168, 150, 164, 154, 158, 162, 152, 156, 158, 154, 152, 158, 152, 156, 162, 156, 162, 170, 158, 162, 164, 158, 164, 152, 158, 158, 156, 146, 154, 164, 142, 160, 148, 152, 160, 148, 158, 158, 162, 162, 162, 152, 172, 158, 156, 166, 160, 148, 168, 154, 158, 158, 146, 156, 158, 150, 158, 146, 162, 160, 154, 148, 164, 150, 156, 154, 164, 156, 168, 158, 166, 164, 152, 166, 156, 158, 166, 158, 144, 166, 154, 142, 154, 150, 154, 158, 154, 156, 170, 154, 164, 152, 170, 166, 166, 156, 158, 152, 162, 160, 146, 154, 152, 154, 152, 162, 148, 160, 154, 154, 162, 152, 158, 164, 156, 152, 170, 148, 152, 164, 152, 146, 152, 148, 150, 148, 150, 154, 144, 136, 156, 136, 150, 158, 150, 152, 164, 154, 154, 162, 148, 166, 154, 168, 164, 142, 152, 158, 144, 142, 158, 138, 136, 148, 142, 152, 150, 154, 154, 162, 150, 166, 158, 150, 168, 154, 156, 166, 158, 160, 166, 154, 158, 170, 148, 164, 146, 158, 166, 150, 150, 160, 154, 154, 156, 156, 150, 168, 154, 162, 164, 158, 166, 166, 164, 164, 154, 158, 160, 158, 152, 150, 146, 154, 156, 146, 160, 160, 152, 168, 156, 158, 160, 158, 162, 168, 170, 154, 168, 158, 156, 164, 150, 160, 154, 152, 160, 154, 148, 162, 156, 154, 152, 156, 148, 154, 154, 156, 156, 158, 164, 168, 156, 170, 154, 162, 166, 154, 156, 166, 134, 158, 156, 152, 150, 158, 154, 150, 164, 150, 160, 160, 160, 170, 160, 160, 170, 166, 156, 164, 154, 150, 162, 146, 150, 166, 152, 156, 166, 154, 166, 148, 158, 168, 152, 154, 160, 166, 156, 166, 148, 168, 168, 154, 168, 158, 154, 164, 158, 154, 164, 146, 146, 156, 140, 152, 152, 162, 158, 162, 152, 156, 162, 158, 168, 160, 158, 172, 152, 158, 162, 152, 152, 166, 146, 152, 158, 148, 158, 156, 152, 166, 150, 156, 166, 150, 154, 164, 160, 152, 162, 158}, + {160, 142, 160, 154, 152, 152, 156, 162, 154, 166, 170, 166, 162, 172, 164, 158, 162, 168, 152, 160, 158, 146, 150, 158, 156, 138, 156, 164, 144, 160, 162, 156, 160, 160, 164, 150, 168, 174, 158, 166, 158, 168, 146, 164, 162, 154, 158, 152, 160, 144, 160, 158, 144, 164, 160, 154, 150, 162, 158, 150, 160, 170, 160, 160, 170, 160, 154, 158, 162, 148, 160, 166, 142, 158, 158, 158, 138, 158, 166, 148, 158, 162, 162, 156, 160, 168, 162, 162, 170, 150, 158, 162, 160, 150, 152, 160, 156, 154, 158, 158, 148, 160, 166, 152, 152, 168, 148, 156, 162, 170, 148, 170, 166, 152, 162, 164, 154, 152, 164, 162, 148, 156, 158, 146, 152, 156, 158, 142, 160, 162, 150, 156, 164, 156, 144, 168, 168, 146, 162, 162, 142, 146, 160, 148, 130, 154, 146, 148, 146, 160, 150, 142, 164, 156, 154, 156, 170, 148, 154, 166, 154, 136, 166, 162, 134, 154, 148, 144, 138, 166, 158, 138, 158, 154, 138, 146, 164, 148, 154, 156, 166, 156, 156, 170, 158, 156, 168, 164, 150, 164, 166, 146, 160, 158, 160, 144, 154, 158, 146, 150, 158, 154, 154, 166, 164, 152, 158, 162, 156, 162, 178, 154, 156, 160, 162, 146, 162, 160, 152, 160, 160, 160, 140, 162, 156, 146, 158, 150, 162, 148, 170, 160, 148, 164, 162, 160, 156, 166, 160, 156, 160, 162, 150, 164, 158, 154, 148, 150, 166, 140, 156, 166, 152, 152, 162, 170, 152, 166, 176, 154, 166, 168, 160, 152, 162, 168, 148, 160, 166, 150, 146, 166, 156, 144, 150, 174, 140, 156, 162, 156, 146, 156, 164, 150, 168, 162, 160, 156, 162, 170, 150, 164, 170, 146, 142, 158, 146, 148, 158, 158, 142, 160, 162, 158, 156, 162, 164, 148, 174, 166, 158, 170, 158, 162, 148, 168, 144, 148, 166, 154, 152, 150, 166, 160, 148, 156, 164, 150, 160, 168, 160, 150, 176, 162, 154, 168, 168, 160, 154, 168, 156, 156, 162, 160, 152, 148, 162, 144, 148, 162, 150, 156, 152, 160, 156, 156, 170, 166, 156, 168}, + {156, 166, 146, 152, 168, 156, 146, 166, 156, 150, 164, 164, 162, 160, 162, 164, 152, 156, 178, 144, 158, 168, 142, 156, 158, 168, 144, 154, 170, 146, 154, 164, 160, 148, 162, 170, 144, 162, 172, 158, 146, 166, 162, 148, 158, 162, 152, 154, 154, 160, 148, 150, 174, 136, 152, 174, 156, 146, 172, 166, 152, 162, 172, 156, 160, 164, 166, 146, 164, 168, 138, 160, 170, 142, 138, 164, 158, 146, 158, 164, 156, 154, 164, 162, 148, 174, 180, 148, 152, 186, 150, 152, 174, 160, 148, 162, 152, 146, 146, 160, 158, 150, 146, 170, 148, 156, 176, 142, 154, 166, 166, 156, 168, 180, 148, 158, 166, 158, 150, 162, 172, 140, 150, 178, 144, 150, 166, 154, 148, 158, 170, 152, 150, 168, 154, 150, 160, 170, 138, 144, 168, 142, 140, 158, 148, 136, 160, 152, 144, 142, 154, 154, 136, 164, 166, 148, 156, 176, 140, 154, 168, 162, 148, 156, 168, 138, 158, 154, 150, 132, 146, 156, 128, 152, 162, 146, 138, 166, 156, 150, 166, 164, 158, 152, 176, 156, 162, 162, 170, 154, 154, 172, 146, 154, 164, 150, 146, 158, 160, 154, 154, 164, 152, 148, 156, 168, 148, 170, 162, 156, 156, 176, 162, 150, 168, 168, 152, 160, 168, 148, 148, 162, 158, 140, 150, 170, 144, 150, 168, 152, 152, 166, 170, 154, 164, 176, 160, 162, 156, 172, 140, 158, 168, 144, 152, 162, 154, 144, 158, 174, 144, 154, 168, 156, 152, 160, 164, 142, 158, 180, 146, 144, 176, 154, 156, 164, 158, 148, 154, 166, 150, 142, 166, 162, 148, 144, 176, 146, 154, 178, 156, 154, 166, 178, 152, 166, 172, 160, 156, 152, 166, 146, 148, 176, 148, 152, 170, 146, 136, 166, 158, 152, 152, 168, 156, 154, 160, 166, 144, 162, 182, 142, 148, 174, 150, 150, 172, 164, 146, 158, 162, 150, 152, 162, 154, 144, 152, 166, 146, 154, 166, 158, 156, 168, 172, 148, 160, 166, 164, 158, 156, 154, 144, 154, 170, 142, 152, 166, 146, 156, 166, 156, 150, 166, 166, 154, 158, 174, 162, 148}, + {148, 156, 158, 148, 150, 162, 164, 152, 160, 174, 142, 162, 178, 150, 154, 176, 152, 164, 156, 164, 156, 152, 160, 154, 150, 150, 164, 144, 140, 184, 138, 152, 174, 156, 152, 162, 174, 164, 154, 174, 166, 150, 154, 172, 150, 154, 178, 138, 146, 174, 144, 152, 158, 164, 154, 154, 160, 162, 154, 158, 172, 154, 156, 184, 144, 150, 172, 160, 144, 160, 160, 154, 148, 162, 162, 144, 160, 166, 144, 154, 166, 144, 150, 172, 154, 154, 160, 166, 162, 156, 160, 170, 150, 158, 170, 146, 154, 172, 140, 148, 176, 142, 154, 162, 152, 156, 160, 172, 158, 150, 166, 164, 156, 150, 180, 152, 148, 164, 152, 152, 156, 162, 150, 144, 162, 160, 156, 150, 170, 152, 150, 174, 156, 146, 178, 150, 150, 158, 160, 156, 142, 160, 160, 138, 144, 160, 138, 136, 168, 134, 146, 160, 152, 150, 154, 162, 154, 150, 168, 160, 160, 150, 170, 146, 142, 166, 142, 134, 172, 148, 142, 154, 154, 146, 146, 156, 158, 144, 160, 162, 150, 148, 174, 142, 158, 190, 144, 160, 168, 154, 162, 154, 168, 160, 156, 158, 164, 146, 152, 166, 146, 140, 178, 148, 154, 164, 164, 150, 162, 170, 168, 154, 168, 166, 152, 148, 172, 142, 152, 178, 142, 146, 174, 154, 150, 144, 172, 148, 156, 156, 160, 152, 154, 180, 142, 156, 186, 144, 162, 166, 164, 152, 160, 158, 164, 152, 148, 170, 148, 150, 172, 142, 148, 174, 150, 150, 172, 164, 160, 162, 172, 170, 156, 162, 166, 146, 160, 168, 146, 144, 174, 144, 138, 166, 152, 148, 160, 158, 164, 150, 156, 166, 152, 158, 178, 144, 150, 176, 156, 150, 170, 156, 164, 150, 154, 158, 152, 158, 164, 150, 144, 170, 152, 148, 174, 150, 160, 168, 168, 156, 164, 180, 168, 152, 160, 166, 150, 152, 166, 148, 146, 172, 142, 148, 168, 156, 152, 162, 162, 162, 148, 162, 168, 160, 152, 182, 154, 152, 174, 142, 154, 170, 154, 150, 156, 162, 154, 150, 156, 162, 136, 162, 168, 150, 142, 184, 134, 156, 176, 166}, + {162, 152, 152, 170, 148, 150, 174, 150, 148, 166, 160, 174, 160, 158, 174, 156, 154, 172, 138, 154, 168, 148, 156, 170, 134, 160, 162, 150, 158, 152, 156, 162, 156, 154, 168, 152, 160, 172, 150, 162, 172, 158, 154, 168, 146, 172, 146, 162, 158, 146, 164, 158, 142, 162, 160, 150, 150, 174, 140, 166, 162, 158, 170, 158, 164, 172, 146, 162, 164, 154, 146, 172, 148, 152, 166, 138, 154, 168, 140, 162, 162, 166, 160, 154, 158, 176, 154, 156, 176, 146, 160, 170, 140, 162, 158, 154, 156, 150, 154, 166, 144, 158, 156, 152, 156, 172, 132, 154, 178, 146, 160, 184, 146, 170, 160, 164, 166, 158, 152, 180, 144, 152, 162, 150, 152, 166, 140, 158, 160, 146, 162, 160, 150, 162, 142, 156, 168, 156, 146, 160, 144, 150, 156, 138, 150, 156, 138, 156, 142, 150, 164, 148, 148, 158, 160, 150, 172, 140, 152, 166, 150, 160, 166, 146, 156, 156, 142, 162, 144, 142, 156, 142, 142, 158, 144, 138, 162, 146, 152, 172, 144, 170, 160, 162, 176, 148, 168, 172, 154, 168, 168, 140, 156, 166, 146, 150, 164, 148, 158, 162, 154, 166, 150, 148, 168, 154, 156, 162, 152, 156, 172, 148, 162, 178, 154, 164, 166, 150, 164, 146, 168, 158, 144, 152, 164, 146, 150, 172, 146, 152, 178, 140, 166, 160, 164, 170, 158, 164, 160, 150, 158, 160, 162, 150, 168, 140, 160, 162, 138, 156, 154, 150, 164, 154, 166, 158, 154, 150, 170, 158, 154, 166, 152, 158, 174, 148, 158, 158, 166, 166, 148, 156, 170, 146, 158, 162, 148, 150, 170, 142, 166, 166, 154, 160, 170, 156, 176, 158, 160, 174, 154, 150, 170, 148, 150, 160, 146, 154, 172, 134, 164, 162, 152, 162, 156, 158, 162, 150, 154, 176, 152, 148, 164, 158, 156, 170, 152, 150, 164, 148, 152, 154, 150, 168, 152, 144, 170, 152, 154, 176, 148, 156, 178, 144, 172, 160, 164, 168, 154, 164, 162, 158, 148, 172, 150, 142, 162, 148, 148, 168, 150, 154, 168, 150, 166, 150, 170, 172, 164, 150}, + {166, 138, 164, 160, 154, 162, 152, 162, 158, 154, 162, 146, 158, 172, 164, 152, 174, 162, 152, 176, 156, 148, 164, 148, 166, 156, 140, 162, 164, 140, 162, 166, 134, 170, 164, 146, 170, 170, 152, 170, 162, 158, 160, 160, 156, 150, 152, 158, 162, 144, 154, 172, 134, 160, 166, 150, 162, 156, 166, 162, 156, 162, 158, 156, 168, 168, 146, 168, 168, 142, 166, 170, 144, 160, 146, 158, 158, 150, 160, 164, 144, 162, 160, 154, 160, 170, 148, 170, 174, 158, 156, 160, 168, 162, 156, 160, 152, 158, 156, 154, 142, 164, 164, 140, 162, 162, 156, 166, 156, 158, 168, 152, 174, 164, 148, 166, 158, 152, 164, 156, 148, 158, 164, 146, 156, 152, 156, 168, 138, 168, 162, 146, 164, 166, 146, 166, 164, 140, 176, 158, 148, 156, 152, 148, 154, 142, 156, 146, 142, 150, 150, 146, 152, 160, 140, 168, 166, 150, 156, 162, 148, 166, 150, 164, 150, 148, 148, 158, 134, 158, 158, 130, 156, 154, 140, 168, 148, 148, 150, 156, 158, 154, 156, 158, 154, 164, 158, 178, 146, 158, 168, 154, 164, 154, 160, 152, 154, 152, 154, 138, 168, 158, 140, 168, 166, 136, 170, 168, 150, 168, 158, 158, 168, 150, 158, 162, 152, 160, 154, 152, 152, 172, 138, 162, 164, 144, 164, 156, 154, 160, 148, 160, 162, 160, 162, 170, 144, 176, 168, 150, 164, 168, 148, 166, 158, 152, 162, 150, 156, 156, 148, 162, 158, 138, 168, 166, 148, 164, 168, 148, 172, 174, 156, 170, 150, 152, 166, 156, 146, 152, 154, 156, 162, 136, 158, 176, 142, 164, 158, 154, 164, 158, 162, 164, 142, 174, 166, 148, 168, 162, 150, 160, 164, 144, 164, 166, 144, 154, 154, 156, 160, 138, 164, 158, 148, 160, 174, 152, 164, 174, 152, 174, 160, 160, 170, 146, 164, 164, 156, 158, 166, 142, 156, 166, 130, 164, 164, 142, 160, 162, 146, 166, 152, 158, 164, 164, 160, 162, 154, 156, 174, 142, 170, 166, 138, 164, 162, 148, 164, 154, 164, 154, 150, 156, 162, 152, 158, 164, 148, 174}, + {154, 158, 154, 138, 166, 150, 146, 164, 170, 154, 162, 174, 156, 160, 166, 156, 154, 150, 166, 146, 150, 172, 148, 154, 158, 164, 146, 152, 166, 150, 166, 156, 160, 160, 154, 164, 156, 150, 172, 164, 152, 170, 168, 142, 168, 166, 148, 150, 178, 142, 156, 148, 170, 152, 152, 166, 158, 146, 164, 164, 148, 166, 178, 156, 168, 154, 164, 152, 152, 170, 152, 146, 162, 158, 146, 160, 162, 142, 160, 164, 150, 152, 172, 154, 154, 156, 164, 162, 152, 168, 170, 144, 164, 174, 150, 158, 168, 146, 160, 172, 146, 146, 160, 166, 148, 148, 162, 160, 148, 164, 166, 150, 166, 170, 160, 156, 164, 162, 154, 154, 166, 152, 148, 164, 156, 146, 164, 162, 144, 168, 166, 146, 172, 160, 156, 144, 158, 160, 158, 146, 164, 154, 136, 162, 148, 140, 150, 162, 142, 146, 160, 152, 148, 156, 154, 160, 146, 180, 154, 144, 168, 168, 144, 172, 156, 152, 154, 164, 136, 150, 146, 158, 144, 134, 156, 142, 146, 164, 156, 148, 160, 176, 142, 162, 176, 158, 166, 160, 170, 160, 148, 170, 150, 154, 164, 166, 146, 158, 168, 146, 152, 162, 154, 160, 146, 172, 152, 150, 174, 148, 156, 180, 164, 156, 170, 166, 148, 166, 166, 142, 158, 164, 148, 152, 144, 166, 158, 156, 164, 166, 150, 166, 166, 146, 158, 174, 156, 162, 154, 172, 152, 160, 158, 150, 150, 166, 156, 142, 168, 168, 140, 156, 164, 156, 152, 158, 168, 156, 154, 172, 158, 156, 176, 162, 150, 176, 164, 140, 172, 174, 144, 150, 158, 154, 152, 142, 166, 148, 146, 166, 166, 146, 160, 170, 158, 166, 170, 156, 156, 158, 164, 154, 154, 164, 150, 152, 166, 160, 142, 164, 166, 146, 160, 170, 146, 160, 154, 152, 160, 170, 164, 164, 146, 170, 162, 146, 168, 158, 148, 158, 160, 150, 158, 152, 162, 146, 158, 162, 166, 140, 184, 158, 156, 164, 176, 148, 168, 172, 164, 156, 158, 150, 154, 140, 174, 152, 144, 164, 156, 140, 160, 164, 152, 162, 168, 150, 164, 158, 162, 152}, + {156, 148, 168, 158, 148, 176, 154, 150, 158, 170, 146, 154, 164, 162, 170, 174, 166, 160, 154, 172, 152, 148, 168, 158, 148, 158, 158, 152, 150, 162, 154, 150, 158, 168, 158, 160, 176, 162, 156, 166, 160, 148, 162, 176, 142, 162, 164, 156, 150, 166, 156, 148, 156, 162, 152, 146, 168, 152, 148, 170, 156, 156, 160, 164, 164, 158, 174, 170, 152, 156, 164, 160, 152, 154, 158, 148, 158, 158, 150, 154, 168, 158, 152, 172, 168, 154, 156, 176, 156, 164, 168, 158, 152, 158, 156, 154, 152, 170, 150, 144, 160, 158, 148, 162, 168, 158, 148, 164, 168, 150, 164, 164, 152, 164, 172, 154, 154, 164, 162, 154, 154, 172, 158, 146, 160, 156, 142, 162, 164, 142, 154, 174, 144, 152, 158, 170, 154, 164, 158, 150, 140, 160, 150, 146, 154, 146, 148, 140, 156, 146, 146, 150, 152, 150, 156, 170, 154, 148, 150, 160, 144, 160, 162, 146, 154, 164, 142, 140, 164, 148, 148, 148, 156, 150, 144, 160, 150, 148, 160, 156, 136, 154, 174, 150, 154, 162, 166, 158, 164, 166, 154, 158, 168, 152, 150, 160, 164, 146, 156, 158, 160, 152, 160, 160, 156, 156, 168, 160, 158, 166, 162, 154, 170, 166, 148, 166, 166, 152, 154, 170, 158, 148, 168, 162, 150, 152, 158, 154, 150, 156, 166, 150, 162, 160, 162, 160, 166, 168, 160, 168, 164, 158, 154, 166, 160, 140, 166, 152, 138, 150, 164, 154, 154, 166, 158, 154, 164, 160, 154, 152, 182, 150, 156, 166, 152, 154, 158, 168, 144, 154, 170, 154, 148, 166, 168, 150, 154, 176, 152, 152, 164, 158, 160, 154, 164, 152, 166, 166, 162, 164, 166, 172, 150, 152, 170, 156, 142, 160, 160, 142, 160, 166, 144, 152, 178, 156, 150, 172, 166, 152, 162, 170, 160, 148, 172, 154, 150, 154, 176, 148, 150, 166, 152, 152, 160, 166, 150, 158, 166, 154, 150, 160, 154, 160, 158, 174, 154, 156, 164, 164, 150, 166, 172, 158, 152, 156, 150, 138, 164, 160, 144, 162, 160, 148, 154, 170, 156, 160, 168, 172}, + {158, 148, 158, 156, 152, 160, 152, 164, 160, 146, 176, 162, 150, 172, 154, 150, 168, 162, 162, 162, 154, 162, 156, 158, 162, 154, 148, 160, 162, 136, 172, 156, 152, 162, 160, 152, 156, 150, 166, 174, 160, 168, 162, 148, 180, 148, 146, 170, 162, 136, 178, 152, 146, 162, 156, 150, 162, 160, 166, 156, 152, 166, 166, 152, 176, 162, 146, 152, 166, 152, 168, 156, 154, 166, 150, 160, 156, 154, 164, 154, 140, 170, 164, 138, 172, 150, 156, 164, 168, 168, 164, 164, 160, 162, 152, 166, 160, 144, 168, 156, 146, 158, 160, 146, 162, 150, 160, 162, 154, 164, 156, 160, 178, 162, 140, 176, 170, 150, 170, 150, 150, 162, 164, 146, 164, 148, 162, 156, 160, 162, 156, 152, 164, 158, 146, 160, 160, 150, 166, 160, 154, 154, 150, 154, 150, 146, 164, 146, 136, 154, 156, 146, 156, 152, 142, 160, 156, 154, 172, 156, 164, 160, 154, 166, 172, 132, 168, 156, 136, 160, 146, 140, 156, 154, 142, 160, 142, 152, 158, 144, 172, 160, 146, 174, 160, 148, 168, 166, 156, 170, 166, 148, 164, 158, 156, 168, 148, 170, 154, 140, 162, 154, 150, 170, 156, 158, 158, 152, 156, 166, 156, 170, 162, 160, 170, 154, 146, 168, 158, 142, 170, 154, 138, 160, 158, 144, 170, 152, 154, 164, 148, 162, 158, 150, 166, 166, 148, 174, 158, 152, 162, 160, 154, 168, 156, 162, 156, 162, 166, 156, 152, 166, 156, 140, 160, 158, 146, 174, 158, 154, 162, 170, 158, 164, 170, 164, 158, 144, 170, 156, 140, 162, 152, 152, 156, 154, 156, 154, 158, 158, 164, 162, 170, 158, 154, 174, 160, 148, 170, 162, 148, 158, 158, 148, 172, 156, 154, 154, 154, 160, 152, 142, 170, 162, 140, 164, 162, 144, 166, 176, 148, 172, 162, 156, 164, 156, 176, 164, 148, 162, 150, 142, 162, 160, 142, 158, 164, 140, 170, 152, 160, 162, 160, 166, 162, 152, 174, 170, 148, 160, 162, 148, 162, 152, 160, 164, 156, 160, 166, 148, 158, 160, 152, 160, 158, 142, 170, 162, 142, 164}, + {150, 164, 162, 150, 164, 154, 144, 164, 156, 154, 170, 152, 162, 162, 162, 172, 170, 146, 170, 158, 148, 168, 160, 148, 164, 152, 152, 168, 144, 158, 164, 152, 168, 166, 136, 176, 164, 154, 168, 158, 158, 172, 152, 160, 170, 154, 160, 168, 144, 168, 150, 146, 164, 154, 154, 166, 152, 150, 168, 150, 158, 170, 156, 164, 182, 150, 162, 180, 136, 168, 166, 148, 162, 146, 164, 158, 148, 148, 180, 142, 162, 168, 144, 158, 176, 148, 174, 160, 156, 166, 162, 154, 164, 150, 158, 162, 152, 158, 166, 150, 158, 162, 146, 158, 156, 156, 162, 158, 150, 170, 156, 156, 166, 154, 170, 166, 160, 162, 170, 142, 162, 168, 138, 176, 148, 156, 162, 140, 148, 170, 156, 152, 174, 148, 162, 158, 148, 162, 156, 156, 162, 146, 144, 166, 140, 150, 152, 152, 148, 164, 144, 150, 162, 140, 158, 154, 152, 172, 144, 154, 170, 146, 144, 174, 146, 152, 156, 140, 160, 156, 138, 154, 152, 136, 156, 144, 146, 170, 142, 150, 162, 156, 158, 172, 148, 162, 176, 146, 172, 162, 156, 172, 156, 150, 176, 148, 146, 170, 146, 156, 162, 148, 158, 168, 138, 174, 166, 146, 174, 150, 166, 162, 164, 158, 172, 152, 166, 174, 148, 164, 168, 140, 172, 156, 144, 176, 148, 140, 170, 150, 152, 176, 152, 164, 174, 150, 162, 178, 154, 162, 168, 152, 170, 154, 152, 158, 154, 148, 162, 146, 154, 170, 146, 166, 172, 146, 168, 166, 150, 164, 162, 156, 176, 158, 148, 168, 150, 158, 176, 152, 158, 174, 148, 160, 160, 150, 158, 158, 150, 168, 150, 140, 172, 144, 164, 170, 160, 172, 162, 152, 164, 174, 146, 162, 162, 150, 164, 150, 152, 158, 158, 146, 166, 148, 164, 168, 146, 162, 164, 152, 168, 156, 160, 182, 152, 156, 166, 152, 154, 166, 152, 170, 164, 144, 164, 164, 142, 172, 154, 148, 170, 158, 152, 164, 160, 158, 170, 158, 156, 174, 142, 166, 166, 140, 166, 154, 148, 164, 154, 144, 176, 146, 152, 170, 150, 162, 180, 148, 162, 160}, + {156, 176, 140, 156, 156, 150, 166, 160, 154, 170, 156, 148, 170, 156, 156, 180, 150, 160, 170, 154, 150, 170, 146, 162, 160, 150, 168, 144, 160, 176, 144, 156, 168, 146, 150, 182, 152, 160, 156, 166, 162, 162, 158, 162, 156, 152, 164, 148, 154, 174, 142, 156, 162, 150, 154, 162, 152, 158, 156, 158, 168, 166, 150, 166, 154, 166, 176, 144, 166, 176, 156, 156, 164, 150, 154, 158, 152, 170, 140, 154, 170, 142, 160, 182, 144, 158, 166, 150, 156, 180, 162, 156, 168, 152, 166, 158, 152, 168, 150, 150, 170, 144, 154, 170, 152, 152, 166, 158, 160, 160, 162, 166, 156, 158, 170, 158, 154, 176, 154, 164, 168, 146, 158, 176, 140, 158, 156, 158, 158, 154, 150, 168, 146, 162, 170, 152, 156, 162, 156, 156, 156, 158, 150, 156, 154, 154, 148, 136, 168, 136, 140, 168, 136, 158, 164, 154, 150, 166, 162, 152, 158, 160, 158, 160, 162, 162, 142, 152, 170, 140, 150, 162, 144, 154, 152, 148, 154, 152, 144, 158, 150, 152, 166, 152, 156, 176, 146, 160, 182, 160, 148, 174, 156, 154, 158, 162, 160, 162, 152, 174, 148, 152, 170, 138, 164, 162, 146, 156, 178, 160, 148, 166, 154, 172, 152, 160, 170, 148, 158, 170, 144, 156, 170, 146, 154, 154, 158, 156, 162, 158, 154, 158, 160, 158, 156, 158, 172, 146, 174, 172, 142, 164, 172, 152, 154, 164, 156, 158, 154, 148, 160, 152, 150, 164, 138, 156, 176, 146, 158, 170, 156, 152, 172, 162, 168, 154, 158, 170, 152, 162, 170, 134, 168, 164, 144, 152, 174, 152, 154, 162, 154, 168, 158, 162, 164, 160, 156, 176, 146, 164, 174, 146, 164, 162, 150, 150, 172, 144, 158, 164, 150, 174, 152, 154, 170, 144, 152, 186, 154, 152, 174, 158, 162, 154, 166, 158, 168, 158, 160, 160, 140, 172, 138, 152, 170, 140, 154, 166, 156, 148, 176, 154, 160, 162, 158, 170, 158, 162, 168, 144, 166, 172, 150, 164, 170, 154, 156, 168, 148, 156, 158, 150, 164, 156, 150, 178, 142, 156, 176, 150}, + {162, 146, 158, 168, 152, 152, 162, 148, 156, 152, 172, 158, 160, 166, 156, 158, 170, 164, 150, 158, 174, 156, 164, 162, 156, 152, 164, 154, 154, 152, 164, 154, 152, 162, 162, 156, 158, 170, 158, 152, 172, 160, 164, 164, 168, 152, 158, 160, 152, 150, 156, 170, 142, 158, 172, 146, 160, 172, 158, 144, 168, 160, 158, 158, 172, 160, 148, 166, 164, 156, 156, 170, 152, 152, 172, 150, 152, 158, 162, 150, 154, 168, 156, 148, 160, 174, 154, 166, 160, 162, 156, 174, 150, 154, 168, 158, 160, 156, 172, 146, 156, 154, 168, 144, 164, 164, 150, 152, 168, 152, 160, 162, 158, 152, 168, 168, 158, 150, 164, 162, 148, 160, 168, 144, 156, 172, 144, 156, 162, 166, 146, 156, 168, 142, 150, 168, 160, 150, 150, 170, 158, 152, 166, 156, 140, 160, 156, 138, 148, 160, 150, 148, 156, 150, 148, 158, 156, 156, 158, 166, 156, 142, 160, 158, 148, 156, 164, 144, 146, 156, 156, 140, 150, 166, 148, 148, 162, 150, 146, 166, 154, 146, 162, 178, 148, 154, 164, 156, 154, 170, 180, 144, 158, 180, 154, 154, 164, 162, 146, 148, 160, 148, 148, 162, 166, 150, 156, 172, 146, 156, 180, 154, 162, 174, 158, 156, 160, 176, 152, 148, 160, 166, 150, 158, 174, 146, 148, 172, 164, 152, 170, 162, 152, 160, 172, 150, 158, 176, 160, 148, 170, 164, 150, 164, 170, 150, 150, 180, 144, 152, 166, 166, 146, 152, 168, 158, 156, 166, 166, 152, 158, 174, 158, 164, 160, 166, 160, 160, 168, 146, 154, 168, 152, 152, 162, 162, 142, 154, 170, 156, 148, 176, 156, 154, 172, 164, 148, 156, 172, 154, 150, 168, 160, 148, 166, 168, 156, 156, 164, 150, 152, 154, 166, 144, 160, 164, 160, 146, 160, 172, 152, 162, 178, 160, 154, 170, 160, 160, 160, 158, 152, 156, 166, 158, 142, 156, 168, 142, 160, 172, 152, 152, 168, 158, 154, 162, 164, 154, 162, 170, 172, 144, 168, 162, 152, 152, 172, 150, 158, 160, 156, 146, 172, 158, 154, 154, 172, 156, 152, 164}, + {156, 172, 146, 148, 170, 154, 152, 164, 154, 164, 148, 160, 172, 152, 160, 180, 162, 156, 168, 146, 152, 178, 142, 162, 160, 154, 162, 156, 162, 166, 144, 162, 162, 152, 160, 170, 158, 150, 174, 148, 158, 170, 150, 168, 150, 168, 164, 154, 168, 174, 150, 146, 174, 144, 154, 176, 148, 152, 162, 164, 156, 160, 166, 170, 150, 164, 176, 158, 154, 178, 152, 150, 174, 146, 162, 162, 144, 160, 156, 160, 156, 148, 160, 168, 156, 148, 182, 144, 162, 172, 158, 154, 182, 150, 158, 166, 152, 168, 146, 158, 170, 150, 154, 176, 138, 150, 178, 144, 162, 176, 148, 166, 156, 166, 168, 152, 166, 168, 158, 154, 172, 154, 146, 178, 154, 148, 164, 150, 148, 162, 164, 160, 150, 170, 166, 150, 158, 166, 146, 146, 164, 140, 152, 162, 152, 146, 148, 150, 164, 136, 152, 154, 142, 152, 162, 150, 154, 168, 148, 148, 168, 158, 152, 162, 160, 158, 140, 166, 156, 144, 154, 162, 134, 136, 162, 138, 150, 166, 150, 152, 152, 150, 162, 148, 156, 176, 152, 162, 176, 156, 152, 174, 142, 154, 172, 150, 156, 152, 168, 170, 148, 168, 170, 148, 148, 166, 146, 144, 180, 144, 158, 176, 144, 164, 164, 158, 164, 160, 156, 174, 154, 154, 174, 146, 154, 166, 152, 148, 164, 150, 160, 158, 160, 164, 154, 168, 170, 148, 162, 180, 146, 166, 172, 150, 156, 166, 148, 156, 166, 152, 156, 150, 162, 172, 144, 156, 172, 156, 152, 172, 152, 156, 176, 150, 166, 168, 158, 164, 156, 164, 166, 148, 156, 172, 140, 152, 168, 156, 146, 170, 144, 154, 168, 148, 166, 154, 174, 166, 154, 168, 168, 158, 152, 168, 154, 152, 170, 148, 166, 162, 152, 152, 154, 166, 160, 154, 154, 178, 154, 154, 168, 154, 154, 182, 148, 160, 164, 154, 160, 156, 166, 174, 148, 158, 166, 154, 150, 178, 144, 152, 176, 152, 150, 176, 154, 162, 160, 166, 170, 158, 158, 174, 158, 152, 174, 144, 152, 166, 138, 158, 160, 156, 158, 160, 150, 174, 154, 162, 178, 146}, + {180, 150, 154, 170, 140, 166, 162, 142, 172, 168, 146, 168, 172, 142, 176, 160, 146, 172, 166, 154, 178, 154, 158, 166, 146, 170, 156, 138, 160, 174, 132, 168, 166, 144, 168, 158, 154, 180, 152, 172, 166, 150, 172, 168, 144, 170, 174, 134, 172, 152, 144, 166, 158, 148, 164, 148, 168, 166, 146, 164, 170, 146, 164, 164, 146, 170, 174, 134, 176, 162, 160, 172, 144, 158, 166, 144, 160, 170, 142, 162, 172, 134, 170, 166, 144, 174, 152, 156, 174, 152, 162, 166, 154, 162, 170, 148, 172, 172, 134, 176, 166, 130, 174, 160, 140, 170, 150, 162, 160, 146, 172, 172, 148, 166, 172, 164, 156, 164, 148, 168, 162, 144, 182, 144, 156, 170, 144, 164, 178, 134, 162, 174, 132, 168, 170, 144, 166, 158, 154, 170, 156, 158, 156, 144, 166, 164, 130, 168, 148, 134, 166, 160, 134, 162, 158, 140, 158, 150, 158, 162, 156, 162, 166, 136, 168, 160, 152, 152, 168, 130, 160, 152, 150, 170, 138, 154, 164, 134, 164, 160, 142, 164, 166, 144, 174, 168, 140, 168, 156, 156, 172, 164, 164, 166, 150, 168, 166, 144, 174, 164, 134, 160, 166, 138, 176, 164, 148, 180, 156, 158, 172, 146, 172, 162, 156, 164, 178, 138, 172, 174, 132, 172, 160, 146, 172, 148, 154, 166, 144, 162, 168, 144, 172, 166, 144, 162, 162, 162, 172, 166, 144, 162, 164, 156, 168, 152, 168, 168, 136, 160, 180, 136, 160, 168, 142, 164, 166, 148, 164, 158, 156, 168, 150, 172, 160, 158, 168, 164, 140, 170, 168, 138, 170, 168, 136, 170, 156, 148, 172, 148, 158, 172, 148, 162, 170, 142, 166, 172, 142, 170, 170, 146, 174, 160, 160, 170, 146, 158, 162, 146, 164, 174, 130, 168, 172, 132, 174, 170, 144, 176, 166, 154, 172, 154, 162, 164, 156, 164, 172, 136, 158, 166, 140, 174, 156, 138, 164, 162, 148, 168, 146, 162, 172, 138, 176, 168, 138, 176, 174, 136, 162, 172, 140, 178, 156, 150, 172, 148, 164, 162, 144, 164, 164, 136, 160, 172, 138, 166, 166, 144}, + {154, 142, 168, 156, 148, 168, 164, 154, 158, 158, 158, 160, 146, 178, 156, 152, 182, 158, 148, 176, 160, 148, 174, 172, 138, 158, 156, 160, 162, 146, 176, 154, 134, 166, 168, 148, 176, 160, 144, 166, 166, 150, 170, 162, 164, 156, 158, 172, 160, 146, 182, 154, 140, 174, 166, 136, 158, 182, 144, 160, 162, 166, 162, 156, 176, 146, 152, 182, 156, 146, 176, 164, 146, 176, 160, 146, 162, 156, 154, 164, 152, 168, 156, 146, 174, 158, 146, 178, 166, 148, 168, 176, 152, 170, 158, 162, 160, 148, 170, 160, 146, 170, 152, 140, 182, 156, 146, 166, 172, 142, 162, 168, 150, 164, 158, 166, 162, 152, 180, 156, 150, 172, 160, 142, 178, 160, 144, 166, 150, 156, 160, 148, 180, 152, 148, 174, 154, 138, 166, 158, 150, 158, 164, 144, 146, 166, 142, 156, 152, 164, 150, 140, 160, 150, 136, 176, 164, 142, 160, 168, 138, 166, 164, 154, 156, 158, 156, 158, 138, 178, 158, 136, 160, 148, 142, 156, 164, 136, 148, 164, 140, 158, 158, 162, 156, 148, 184, 160, 146, 180, 166, 142, 174, 160, 150, 160, 166, 140, 162, 152, 160, 158, 150, 168, 148, 150, 174, 160, 144, 170, 168, 138, 176, 160, 156, 162, 152, 172, 162, 148, 172, 160, 142, 176, 156, 140, 168, 166, 140, 170, 164, 146, 154, 154, 168, 158, 154, 172, 160, 148, 182, 158, 148, 172, 168, 144, 160, 172, 150, 158, 158, 162, 164, 142, 172, 160, 142, 180, 164, 142, 178, 168, 144, 164, 172, 150, 166, 160, 168, 156, 148, 164, 166, 142, 174, 162, 142, 170, 162, 148, 158, 168, 154, 160, 168, 160, 174, 144, 180, 154, 152, 182, 148, 146, 170, 160, 138, 176, 178, 132, 158, 162, 152, 164, 142, 180, 164, 134, 178, 158, 140, 180, 170, 146, 168, 166, 146, 168, 156, 160, 172, 150, 170, 148, 150, 170, 164, 132, 174, 166, 144, 162, 178, 144, 166, 158, 168, 162, 150, 172, 168, 146, 176, 164, 144, 170, 168, 148, 162, 180, 138, 162, 162, 164, 154, 148, 178, 158, 144, 176}, + {172, 160, 144, 174, 152, 152, 148, 164, 162, 158, 162, 168, 160, 160, 170, 158, 148, 178, 166, 144, 172, 164, 154, 150, 162, 174, 146, 168, 156, 158, 150, 168, 168, 150, 172, 152, 156, 170, 158, 156, 168, 170, 156, 158, 156, 176, 152, 152, 170, 154, 148, 172, 160, 140, 162, 162, 160, 144, 170, 150, 160, 160, 166, 158, 160, 178, 156, 158, 168, 164, 144, 170, 158, 152, 156, 176, 158, 148, 162, 162, 152, 148, 180, 154, 148, 174, 162, 150, 162, 158, 164, 154, 166, 156, 156, 164, 166, 164, 146, 168, 150, 158, 170, 164, 136, 172, 168, 140, 162, 172, 160, 156, 158, 172, 150, 162, 164, 170, 144, 174, 166, 150, 164, 156, 154, 150, 160, 158, 162, 162, 158, 152, 148, 178, 158, 146, 176, 166, 138, 168, 158, 156, 148, 168, 166, 138, 152, 154, 146, 144, 162, 150, 144, 166, 160, 136, 162, 162, 142, 164, 164, 154, 146, 166, 164, 152, 158, 154, 156, 140, 162, 162, 140, 166, 152, 144, 150, 156, 158, 146, 164, 154, 146, 156, 170, 154, 148, 174, 164, 150, 168, 174, 146, 162, 180, 150, 158, 164, 174, 152, 154, 172, 154, 152, 174, 146, 148, 172, 168, 146, 170, 174, 154, 158, 172, 156, 164, 164, 170, 164, 148, 176, 150, 154, 174, 156, 158, 154, 168, 158, 160, 162, 162, 160, 160, 174, 152, 162, 168, 166, 144, 168, 164, 154, 162, 168, 152, 158, 162, 156, 148, 152, 170, 154, 148, 172, 156, 152, 172, 156, 154, 160, 162, 168, 154, 178, 158, 148, 162, 166, 162, 158, 162, 160, 144, 162, 154, 150, 162, 164, 148, 154, 170, 162, 144, 166, 170, 154, 154, 168, 160, 156, 174, 162, 152, 174, 158, 156, 144, 182, 160, 146, 160, 166, 158, 144, 170, 168, 140, 176, 156, 150, 160, 168, 160, 154, 186, 160, 152, 164, 156, 150, 154, 166, 160, 148, 174, 158, 152, 162, 166, 150, 156, 166, 168, 148, 166, 168, 156, 162, 170, 156, 156, 172, 156, 146, 164, 158, 154, 144, 164, 162, 150, 158, 174, 152, 154, 168, 164, 152}, + {162, 148, 176, 146, 152, 176, 152, 154, 164, 154, 158, 178, 148, 158, 174, 144, 170, 158, 154, 178, 152, 162, 172, 160, 152, 172, 146, 152, 178, 142, 160, 174, 132, 170, 160, 138, 180, 156, 148, 184, 152, 158, 172, 156, 156, 170, 146, 170, 176, 140, 174, 146, 156, 174, 152, 156, 174, 154, 156, 172, 152, 164, 168, 152, 166, 170, 152, 166, 166, 146, 182, 154, 148, 186, 140, 154, 168, 154, 152, 176, 142, 154, 170, 144, 164, 170, 138, 184, 160, 154, 174, 156, 156, 182, 150, 164, 172, 150, 160, 176, 144, 172, 152, 144, 176, 152, 148, 176, 152, 148, 164, 166, 156, 168, 156, 162, 178, 144, 174, 168, 138, 174, 168, 148, 178, 144, 156, 180, 150, 152, 172, 148, 164, 168, 140, 168, 152, 146, 176, 152, 150, 166, 152, 152, 166, 144, 156, 168, 142, 148, 168, 136, 156, 152, 138, 162, 154, 150, 168, 148, 150, 174, 148, 156, 174, 140, 156, 172, 140, 172, 160, 134, 170, 150, 136, 178, 142, 150, 174, 140, 152, 172, 142, 164, 168, 148, 166, 168, 142, 186, 154, 154, 182, 154, 150, 178, 156, 154, 170, 152, 154, 172, 140, 168, 166, 148, 164, 160, 148, 176, 152, 148, 190, 146, 156, 176, 148, 160, 180, 136, 172, 166, 136, 180, 148, 144, 170, 152, 148, 170, 144, 156, 172, 146, 166, 170, 144, 168, 174, 152, 172, 160, 154, 174, 154, 150, 178, 146, 154, 178, 154, 152, 176, 144, 156, 174, 144, 170, 152, 152, 174, 152, 164, 170, 164, 144, 178, 152, 164, 170, 144, 166, 170, 150, 168, 156, 154, 174, 152, 140, 184, 150, 156, 174, 160, 154, 176, 144, 174, 166, 152, 162, 168, 156, 176, 146, 152, 172, 154, 146, 170, 162, 148, 172, 142, 170, 170, 146, 178, 164, 146, 178, 160, 152, 170, 148, 152, 170, 146, 166, 170, 148, 170, 164, 148, 162, 154, 148, 172, 152, 148, 178, 154, 152, 176, 152, 146, 186, 150, 162, 170, 150, 170, 168, 144, 174, 160, 152, 174, 150, 154, 172, 146, 152, 168, 148, 166, 168, 140, 168}, + {148, 156, 166, 160, 156, 164, 150, 170, 162, 150, 170, 144, 154, 188, 134, 172, 178, 144, 164, 158, 160, 164, 168, 148, 170, 162, 154, 174, 142, 160, 166, 146, 156, 170, 150, 166, 168, 150, 166, 174, 150, 168, 154, 158, 180, 150, 156, 176, 152, 162, 176, 144, 160, 164, 154, 164, 152, 148, 176, 156, 148, 172, 146, 160, 182, 142, 170, 174, 148, 160, 170, 150, 164, 164, 150, 166, 158, 150, 180, 140, 160, 178, 140, 168, 174, 134, 170, 162, 158, 162, 168, 154, 164, 160, 160, 176, 146, 162, 174, 138, 166, 174, 146, 162, 166, 144, 164, 152, 158, 172, 158, 146, 182, 154, 160, 174, 136, 164, 166, 148, 166, 180, 148, 160, 168, 148, 170, 156, 146, 182, 140, 154, 182, 136, 168, 166, 146, 158, 162, 152, 156, 166, 150, 162, 156, 142, 164, 152, 144, 168, 136, 162, 162, 148, 154, 166, 142, 158, 152, 156, 160, 146, 162, 178, 140, 158, 166, 138, 156, 170, 138, 162, 160, 136, 156, 158, 148, 158, 148, 146, 164, 146, 158, 174, 132, 166, 178, 146, 162, 174, 142, 156, 166, 146, 174, 154, 158, 174, 154, 148, 174, 146, 158, 172, 132, 158, 176, 146, 164, 170, 146, 168, 160, 158, 174, 154, 162, 182, 134, 168, 180, 154, 166, 176, 144, 166, 164, 150, 166, 154, 150, 176, 156, 152, 170, 150, 162, 184, 134, 164, 174, 148, 168, 168, 158, 172, 168, 152, 168, 144, 158, 178, 146, 160, 180, 138, 166, 176, 150, 164, 170, 160, 160, 170, 154, 180, 154, 146, 186, 136, 174, 172, 128, 164, 168, 152, 156, 160, 148, 178, 160, 146, 170, 156, 152, 180, 146, 168, 178, 142, 164, 184, 142, 160, 172, 158, 160, 166, 148, 178, 148, 146, 178, 138, 158, 170, 136, 160, 166, 150, 168, 170, 148, 174, 158, 166, 180, 152, 152, 176, 148, 164, 172, 134, 168, 176, 156, 164, 158, 162, 172, 158, 152, 174, 152, 156, 182, 144, 168, 168, 148, 168, 174, 148, 166, 168, 144, 170, 158, 152, 164, 160, 146, 178, 146, 162, 174, 132, 174, 174}, + {156, 170, 166, 146, 174, 162, 140, 160, 168, 158, 158, 176, 152, 160, 164, 166, 156, 158, 164, 170, 158, 158, 166, 158, 158, 164, 160, 156, 158, 160, 164, 158, 164, 158, 158, 170, 162, 150, 168, 162, 160, 160, 176, 146, 156, 174, 172, 156, 152, 168, 156, 150, 172, 170, 142, 162, 174, 144, 154, 174, 158, 150, 168, 162, 150, 162, 172, 156, 160, 170, 158, 154, 166, 170, 154, 152, 178, 152, 156, 166, 164, 148, 162, 168, 160, 158, 160, 174, 150, 164, 168, 150, 170, 166, 160, 156, 164, 154, 164, 170, 156, 158, 154, 166, 154, 146, 170, 160, 158, 150, 178, 160, 156, 166, 164, 158, 166, 164, 162, 170, 162, 160, 154, 172, 164, 150, 164, 168, 148, 156, 176, 148, 160, 160, 174, 152, 154, 174, 160, 150, 160, 162, 152, 154, 154, 152, 144, 162, 158, 150, 150, 152, 154, 150, 164, 158, 144, 174, 170, 136, 160, 164, 158, 144, 174, 156, 152, 156, 166, 154, 144, 166, 150, 150, 158, 164, 142, 156, 156, 150, 148, 166, 146, 154, 162, 148, 158, 160, 182, 158, 156, 166, 172, 156, 158, 170, 152, 158, 174, 158, 152, 166, 166, 164, 158, 170, 152, 158, 168, 162, 154, 164, 172, 150, 152, 174, 152, 148, 176, 164, 146, 158, 168, 148, 158, 156, 176, 144, 164, 168, 144, 164, 166, 158, 154, 170, 160, 156, 166, 168, 154, 162, 166, 164, 142, 164, 172, 154, 156, 172, 160, 144, 158, 162, 142, 166, 164, 156, 146, 168, 162, 144, 174, 168, 152, 162, 162, 162, 152, 164, 156, 158, 178, 166, 162, 152, 174, 162, 148, 156, 172, 162, 154, 172, 154, 154, 162, 160, 160, 160, 164, 164, 158, 172, 162, 148, 172, 158, 156, 162, 160, 164, 148, 168, 164, 158, 156, 174, 154, 154, 176, 156, 156, 160, 174, 146, 152, 178, 156, 164, 176, 154, 158, 164, 154, 150, 146, 162, 166, 140, 164, 168, 152, 160, 172, 164, 154, 168, 160, 152, 164, 172, 144, 154, 164, 176, 154, 158, 162, 152, 164, 170, 152, 150, 164, 156, 156, 160, 166, 154}, + {146, 174, 152, 154, 166, 156, 156, 184, 136, 154, 178, 136, 166, 184, 142, 168, 172, 144, 170, 154, 162, 172, 148, 160, 186, 140, 166, 174, 128, 170, 176, 144, 160, 170, 142, 166, 164, 160, 172, 148, 158, 176, 138, 176, 176, 140, 160, 186, 138, 168, 168, 140, 166, 156, 160, 170, 138, 164, 180, 140, 164, 180, 142, 164, 186, 140, 166, 176, 134, 176, 170, 156, 172, 152, 158, 184, 136, 164, 184, 130, 166, 190, 134, 170, 170, 138, 174, 154, 162, 166, 154, 164, 168, 146, 168, 176, 142, 166, 176, 136, 172, 172, 140, 168, 176, 136, 176, 152, 164, 178, 132, 168, 184, 126, 176, 184, 136, 164, 176, 140, 170, 170, 150, 166, 152, 164, 168, 142, 164, 180, 132, 160, 182, 134, 160, 174, 136, 166, 160, 144, 180, 156, 154, 164, 148, 154, 180, 134, 162, 166, 134, 164, 172, 132, 162, 160, 140, 166, 144, 166, 166, 140, 156, 182, 132, 164, 176, 146, 156, 176, 140, 156, 158, 142, 164, 142, 162, 158, 140, 156, 172, 136, 166, 176, 134, 172, 170, 140, 162, 166, 160, 166, 154, 158, 178, 142, 172, 182, 128, 170, 178, 140, 170, 168, 136, 162, 170, 146, 174, 156, 164, 174, 140, 170, 182, 142, 174, 178, 140, 160, 186, 142, 172, 164, 150, 168, 146, 162, 166, 146, 166, 172, 146, 168, 180, 138, 170, 182, 128, 174, 174, 148, 168, 162, 164, 174, 148, 162, 178, 140, 168, 188, 138, 166, 178, 138, 166, 168, 146, 166, 160, 158, 170, 152, 168, 170, 150, 164, 186, 144, 170, 184, 132, 168, 170, 140, 162, 160, 156, 174, 140, 158, 182, 138, 174, 182, 144, 170, 166, 148, 168, 166, 152, 170, 156, 146, 178, 148, 162, 178, 136, 166, 182, 132, 168, 182, 136, 154, 180, 144, 170, 160, 160, 180, 142, 170, 172, 144, 172, 178, 140, 172, 182, 140, 166, 174, 140, 172, 156, 158, 170, 144, 162, 172, 132, 170, 188, 140, 172, 186, 136, 160, 188, 146, 166, 156, 154, 174, 154, 158, 176, 140, 170, 178, 134, 174, 186, 136, 166, 170}, + {176, 162, 144, 184, 162, 148, 172, 154, 154, 178, 148, 156, 176, 150, 168, 166, 148, 184, 164, 146, 176, 168, 148, 172, 166, 152, 170, 160, 168, 168, 144, 170, 172, 140, 174, 172, 138, 176, 160, 156, 172, 174, 148, 166, 166, 154, 174, 150, 168, 156, 156, 174, 174, 144, 168, 164, 146, 168, 162, 158, 164, 160, 164, 162, 152, 166, 170, 144, 184, 158, 144, 180, 164, 146, 182, 166, 142, 158, 166, 156, 162, 146, 174, 162, 138, 180, 170, 136, 180, 170, 148, 174, 162, 156, 166, 162, 162, 164, 154, 168, 164, 146, 172, 152, 148, 180, 160, 142, 170, 166, 148, 176, 160, 164, 168, 154, 170, 160, 148, 182, 172, 140, 180, 164, 148, 170, 162, 156, 166, 162, 156, 166, 150, 172, 160, 144, 176, 156, 144, 178, 162, 140, 162, 164, 134, 170, 152, 152, 156, 158, 156, 158, 134, 170, 154, 136, 178, 162, 144, 158, 164, 146, 158, 162, 146, 164, 146, 154, 162, 142, 162, 164, 132, 172, 166, 138, 162, 158, 138, 164, 158, 156, 158, 148, 164, 148, 154, 168, 172, 144, 174, 162, 150, 160, 172, 150, 170, 172, 152, 172, 154, 160, 162, 148, 174, 162, 140, 182, 166, 136, 172, 168, 144, 168, 168, 160, 164, 156, 162, 170, 146, 172, 156, 156, 168, 164, 144, 174, 176, 148, 166, 168, 150, 160, 156, 164, 162, 152, 182, 156, 150, 174, 168, 142, 180, 166, 146, 166, 166, 138, 174, 150, 150, 164, 150, 176, 158, 152, 180, 164, 142, 172, 172, 144, 170, 162, 158, 166, 152, 164, 166, 148, 172, 164, 148, 184, 166, 136, 184, 150, 150, 184, 150, 154, 162, 154, 156, 164, 156, 178, 162, 140, 178, 160, 142, 190, 164, 148, 172, 164, 150, 164, 166, 164, 162, 132, 178, 170, 134, 182, 162, 146, 178, 168, 158, 164, 170, 150, 168, 162, 158, 158, 148, 172, 164, 146, 180, 160, 152, 178, 158, 160, 168, 164, 156, 164, 160, 156, 168, 146, 170, 164, 138, 188, 164, 146, 192, 158, 144, 174, 172, 146, 154, 156, 162, 158, 150, 172, 164, 142}, + {152, 178, 160, 150, 164, 150, 176, 152, 160, 164, 162, 164, 166, 154, 156, 176, 160, 148, 182, 152, 152, 168, 160, 162, 164, 156, 174, 156, 142, 184, 152, 150, 178, 152, 162, 162, 150, 158, 170, 148, 174, 158, 166, 170, 154, 164, 174, 156, 152, 188, 152, 148, 182, 150, 144, 176, 158, 160, 160, 138, 184, 152, 154, 186, 150, 166, 174, 156, 144, 172, 156, 150, 176, 156, 156, 156, 166, 170, 152, 154, 180, 158, 148, 174, 166, 142, 178, 158, 160, 168, 152, 174, 162, 144, 182, 148, 156, 180, 152, 156, 174, 166, 148, 182, 154, 146, 178, 156, 156, 162, 156, 168, 154, 148, 182, 150, 156, 188, 152, 146, 174, 158, 158, 164, 152, 164, 162, 154, 182, 146, 156, 172, 160, 152, 176, 162, 152, 172, 160, 148, 166, 158, 150, 164, 152, 158, 150, 140, 184, 140, 146, 178, 144, 150, 168, 156, 142, 170, 144, 164, 152, 158, 172, 142, 166, 166, 148, 160, 170, 150, 148, 178, 156, 136, 160, 152, 152, 160, 146, 176, 148, 138, 174, 152, 152, 182, 146, 152, 174, 160, 156, 174, 156, 166, 166, 156, 170, 144, 158, 174, 150, 160, 180, 156, 144, 184, 152, 148, 170, 162, 164, 164, 160, 178, 150, 156, 174, 160, 152, 168, 162, 154, 174, 154, 152, 188, 150, 156, 168, 148, 160, 158, 154, 172, 156, 152, 188, 152, 152, 182, 160, 148, 174, 158, 154, 160, 162, 174, 156, 166, 180, 150, 162, 174, 150, 154, 178, 148, 150, 172, 162, 158, 154, 170, 168, 154, 156, 178, 150, 148, 188, 160, 146, 182, 156, 138, 174, 158, 164, 170, 148, 174, 164, 168, 164, 154, 156, 180, 154, 152, 184, 158, 148, 180, 170, 142, 178, 156, 156, 158, 158, 180, 142, 152, 178, 158, 146, 182, 158, 156, 170, 148, 170, 166, 150, 170, 158, 162, 166, 154, 168, 170, 154, 154, 182, 158, 142, 166, 160, 144, 170, 138, 172, 160, 148, 184, 162, 164, 176, 154, 156, 178, 160, 154, 174, 150, 146, 174, 160, 164, 162, 166, 172, 150, 154, 176, 160, 140, 184, 150}, + {180, 162, 150, 182, 146, 164, 174, 142, 160, 180, 122, 178, 166, 140, 180, 160, 140, 184, 146, 158, 182, 144, 160, 172, 150, 170, 164, 138, 180, 160, 144, 180, 156, 144, 180, 170, 152, 180, 146, 168, 174, 140, 168, 152, 152, 180, 156, 140, 182, 156, 146, 186, 152, 156, 180, 150, 158, 166, 150, 172, 162, 140, 178, 166, 142, 180, 162, 148, 188, 164, 150, 180, 148, 172, 178, 152, 168, 170, 142, 186, 156, 144, 178, 156, 142, 192, 150, 150, 182, 148, 166, 172, 150, 168, 162, 148, 176, 168, 132, 184, 168, 126, 190, 144, 156, 184, 148, 160, 178, 140, 176, 166, 150, 184, 168, 136, 178, 156, 144, 182, 158, 154, 178, 164, 160, 172, 142, 172, 158, 136, 186, 156, 138, 188, 158, 136, 178, 154, 150, 182, 150, 160, 170, 140, 164, 168, 146, 168, 160, 136, 174, 158, 140, 174, 148, 148, 176, 146, 164, 166, 142, 172, 148, 148, 178, 166, 130, 186, 154, 142, 170, 148, 142, 176, 148, 158, 164, 142, 160, 156, 140, 174, 162, 138, 174, 156, 136, 184, 154, 148, 184, 148, 166, 172, 146, 178, 170, 154, 176, 172, 136, 180, 160, 138, 188, 152, 154, 182, 146, 158, 164, 156, 170, 170, 152, 180, 158, 142, 188, 160, 142, 192, 160, 140, 190, 146, 152, 186, 132, 182, 174, 140, 182, 162, 142, 178, 164, 140, 182, 164, 144, 184, 154, 158, 172, 156, 170, 168, 152, 170, 158, 150, 176, 168, 134, 186, 156, 146, 186, 148, 154, 182, 152, 170, 172, 152, 174, 156, 160, 180, 162, 136, 186, 156, 146, 190, 154, 158, 166, 146, 158, 166, 138, 178, 160, 150, 184, 168, 134, 194, 160, 146, 178, 150, 156, 176, 146, 172, 174, 144, 172, 160, 150, 182, 166, 136, 186, 156, 136, 176, 154, 160, 174, 146, 172, 168, 146, 174, 166, 140, 188, 160, 140, 192, 150, 150, 180, 152, 162, 174, 158, 164, 170, 150, 170, 166, 130, 184, 162, 136, 190, 156, 134, 174, 152, 166, 190, 144, 166, 162, 136, 176, 160, 146, 182, 162, 138, 194, 156, 152}, + {172, 150, 166, 178, 152, 168, 162, 160, 162, 166, 156, 166, 164, 166, 164, 158, 176, 168, 160, 168, 172, 150, 170, 174, 154, 168, 172, 160, 162, 162, 164, 162, 152, 170, 166, 146, 162, 174, 148, 166, 176, 154, 172, 168, 156, 168, 162, 162, 160, 160, 170, 162, 156, 162, 164, 146, 176, 170, 154, 156, 174, 158, 164, 168, 158, 168, 152, 164, 172, 150, 174, 162, 156, 162, 174, 148, 166, 168, 152, 162, 170, 156, 152, 164, 170, 148, 162, 166, 166, 156, 168, 178, 156, 156, 168, 156, 162, 162, 164, 172, 156, 170, 170, 154, 166, 164, 144, 176, 162, 150, 172, 174, 152, 158, 162, 160, 166, 170, 172, 160, 154, 164, 160, 154, 158, 168, 158, 170, 170, 160, 162, 168, 156, 162, 162, 162, 146, 160, 164, 154, 154, 158, 174, 142, 166, 160, 152, 152, 172, 162, 148, 154, 154, 170, 134, 160, 166, 150, 152, 166, 144, 160, 166, 146, 152, 154, 164, 164, 156, 154, 158, 150, 166, 158, 148, 154, 174, 140, 162, 168, 152, 156, 162, 142, 168, 154, 172, 162, 156, 172, 158, 156, 154, 176, 150, 164, 172, 154, 170, 154, 168, 160, 166, 158, 162, 154, 160, 164, 152, 166, 172, 144, 166, 166, 154, 160, 166, 168, 152, 160, 168, 156, 156, 174, 156, 166, 168, 174, 156, 152, 168, 148, 172, 156, 154, 166, 168, 162, 172, 152, 174, 164, 140, 170, 168, 150, 162, 176, 154, 166, 168, 154, 148, 168, 166, 154, 154, 174, 160, 164, 168, 172, 146, 166, 172, 144, 176, 168, 142, 162, 168, 168, 164, 160, 168, 170, 154, 164, 168, 158, 154, 176, 156, 162, 170, 152, 158, 154, 178, 154, 160, 164, 168, 150, 166, 172, 152, 170, 168, 154, 162, 166, 158, 158, 166, 160, 162, 154, 186, 166, 160, 166, 174, 154, 168, 166, 168, 158, 168, 160, 162, 156, 164, 158, 158, 164, 166, 150, 160, 176, 142, 174, 160, 158, 154, 172, 162, 164, 168, 168, 154, 164, 172, 164, 156, 164, 180, 152, 170, 168, 162, 160, 170, 156, 164, 158, 172, 148, 164, 156}, + {184, 150, 166, 150, 166, 170, 148, 162, 178, 142, 166, 192, 138, 174, 184, 136, 178, 168, 134, 172, 162, 150, 176, 146, 168, 178, 140, 168, 178, 136, 186, 178, 134, 164, 174, 150, 166, 168, 156, 186, 148, 154, 176, 156, 162, 186, 132, 168, 188, 136, 170, 178, 146, 170, 168, 160, 174, 150, 158, 186, 138, 170, 186, 130, 178, 184, 144, 168, 168, 146, 172, 166, 152, 178, 152, 154, 178, 140, 178, 182, 126, 178, 184, 132, 170, 184, 136, 170, 168, 154, 174, 154, 168, 176, 144, 168, 176, 142, 174, 186, 140, 170, 176, 146, 166, 174, 146, 178, 150, 160, 180, 128, 180, 172, 140, 182, 182, 132, 174, 178, 132, 176, 174, 148, 178, 168, 156, 176, 146, 156, 184, 140, 170, 184, 132, 178, 178, 154, 162, 174, 150, 180, 138, 166, 166, 152, 160, 174, 128, 160, 178, 130, 162, 178, 136, 160, 156, 150, 174, 152, 158, 168, 142, 162, 172, 134, 166, 178, 130, 168, 176, 140, 160, 164, 148, 174, 144, 152, 178, 144, 148, 174, 128, 170, 186, 132, 172, 172, 140, 164, 166, 162, 164, 168, 154, 174, 128, 168, 188, 130, 172, 192, 134, 172, 182, 134, 176, 178, 148, 178, 162, 158, 186, 154, 164, 178, 142, 160, 190, 126, 178, 186, 142, 168, 176, 152, 166, 154, 160, 178, 148, 168, 182, 144, 168, 176, 138, 168, 184, 144, 166, 166, 166, 162, 156, 164, 176, 146, 162, 188, 128, 170, 194, 126, 168, 188, 136, 174, 170, 134, 182, 160, 160, 176, 146, 174, 172, 142, 168, 192, 132, 166, 180, 136, 168, 164, 146, 166, 156, 160, 180, 146, 164, 180, 132, 172, 182, 136, 172, 184, 136, 172, 180, 142, 174, 164, 152, 184, 148, 156, 184, 146, 170, 184, 128, 172, 188, 144, 164, 166, 144, 170, 148, 160, 174, 154, 162, 176, 138, 170, 178, 134, 174, 188, 136, 170, 180, 138, 180, 158, 168, 162, 144, 168, 186, 132, 176, 192, 130, 172, 178, 144, 164, 178, 146, 176, 158, 148, 176, 150, 156, 178, 138, 166, 184, 136, 160, 200, 132, 160}, + {156, 150, 180, 156, 164, 170, 158, 172, 158, 156, 174, 148, 166, 166, 154, 162, 176, 164, 170, 174, 154, 156, 186, 156, 166, 150, 162, 172, 164, 148, 182, 150, 160, 178, 160, 164, 172, 158, 164, 158, 162, 174, 156, 160, 166, 164, 160, 166, 160, 160, 176, 162, 158, 174, 156, 156, 178, 144, 168, 164, 152, 182, 144, 164, 172, 150, 158, 176, 154, 166, 174, 162, 156, 178, 152, 170, 170, 164, 170, 160, 160, 164, 148, 168, 176, 162, 152, 178, 152, 168, 170, 154, 172, 158, 168, 162, 164, 154, 176, 154, 162, 172, 154, 162, 172, 162, 160, 168, 154, 162, 174, 160, 166, 162, 158, 176, 156, 154, 190, 154, 150, 182, 142, 174, 160, 156, 172, 166, 154, 172, 154, 162, 164, 152, 168, 172, 146, 152, 172, 152, 154, 160, 152, 164, 164, 146, 168, 152, 154, 172, 148, 150, 172, 152, 158, 170, 146, 152, 166, 148, 166, 168, 152, 160, 164, 148, 176, 134, 154, 176, 152, 142, 178, 152, 152, 168, 150, 158, 164, 148, 172, 156, 154, 174, 134, 160, 164, 156, 154, 176, 148, 158, 162, 160, 160, 168, 162, 174, 154, 164, 172, 152, 168, 168, 162, 160, 174, 156, 160, 174, 150, 160, 166, 156, 176, 156, 166, 174, 156, 162, 174, 154, 154, 176, 152, 156, 166, 162, 162, 160, 156, 178, 154, 162, 168, 164, 162, 174, 150, 168, 186, 150, 164, 174, 154, 162, 168, 156, 168, 158, 168, 172, 156, 168, 172, 150, 160, 160, 168, 160, 166, 164, 158, 164, 160, 162, 164, 162, 184, 144, 160, 176, 148, 162, 182, 166, 166, 180, 152, 164, 166, 158, 168, 158, 160, 176, 164, 160, 170, 158, 174, 160, 162, 148, 170, 154, 166, 178, 146, 170, 172, 148, 170, 154, 164, 166, 156, 162, 174, 170, 150, 180, 158, 166, 164, 160, 168, 158, 160, 172, 158, 162, 162, 166, 164, 174, 156, 156, 188, 148, 156, 182, 152, 162, 162, 162, 170, 154, 164, 170, 152, 168, 174, 156, 158, 172, 148, 174, 168, 160, 174, 164, 170, 162, 154, 164, 172, 146, 154, 186}, + {140, 178, 174, 144, 180, 170, 132, 182, 164, 154, 176, 158, 168, 184, 130, 176, 190, 132, 172, 176, 148, 174, 168, 152, 172, 166, 156, 176, 160, 168, 178, 142, 170, 182, 126, 176, 182, 136, 172, 174, 156, 178, 158, 178, 164, 156, 158, 178, 140, 168, 176, 136, 172, 178, 136, 182, 174, 156, 174, 168, 158, 168, 166, 166, 188, 142, 170, 188, 136, 170, 182, 142, 176, 160, 158, 172, 154, 160, 178, 158, 162, 174, 158, 152, 186, 130, 178, 186, 132, 170, 170, 146, 172, 158, 164, 174, 148, 172, 182, 148, 170, 178, 134, 188, 174, 132, 186, 168, 146, 176, 170, 150, 172, 168, 150, 176, 160, 162, 174, 138, 174, 176, 138, 168, 178, 140, 178, 156, 162, 184, 150, 164, 180, 152, 166, 184, 146, 172, 176, 142, 182, 166, 142, 164, 166, 154, 164, 152, 154, 174, 138, 166, 184, 128, 164, 178, 134, 172, 170, 144, 164, 148, 152, 168, 152, 152, 176, 146, 164, 170, 138, 170, 172, 124, 174, 168, 140, 172, 160, 154, 168, 146, 158, 168, 150, 162, 180, 138, 176, 180, 138, 178, 172, 148, 178, 156, 158, 166, 162, 156, 182, 146, 168, 180, 132, 170, 178, 132, 170, 170, 152, 176, 164, 154, 172, 162, 158, 168, 154, 156, 182, 140, 186, 176, 144, 184, 180, 140, 182, 166, 150, 172, 160, 150, 188, 138, 168, 180, 138, 170, 174, 148, 166, 172, 142, 170, 166, 160, 168, 160, 156, 176, 154, 160, 182, 140, 176, 190, 136, 168, 186, 140, 176, 166, 160, 174, 160, 164, 168, 160, 160, 178, 144, 166, 182, 134, 172, 182, 124, 182, 164, 150, 170, 162, 160, 168, 142, 166, 192, 130, 166, 188, 134, 182, 184, 144, 178, 156, 162, 170, 158, 170, 176, 158, 160, 180, 136, 170, 188, 134, 178, 174, 142, 178, 172, 162, 170, 152, 168, 172, 152, 168, 186, 128, 174, 184, 130, 170, 176, 148, 174, 168, 152, 178, 166, 158, 178, 152, 160, 186, 138, 170, 188, 134, 176, 174, 152, 170, 166, 158, 172, 156, 166, 164, 158, 160, 184, 140, 178, 180}, + {166, 168, 146, 166, 172, 170, 162, 174, 160, 162, 176, 154, 174, 156, 170, 176, 152, 156, 184, 142, 170, 174, 156, 162, 170, 158, 170, 158, 154, 174, 156, 166, 170, 154, 166, 172, 154, 166, 174, 154, 158, 174, 154, 158, 168, 158, 178, 156, 162, 184, 146, 176, 188, 148, 170, 176, 150, 158, 180, 150, 170, 170, 146, 168, 160, 160, 174, 156, 170, 170, 152, 158, 168, 168, 160, 176, 152, 162, 164, 158, 168, 156, 162, 182, 150, 174, 168, 146, 180, 180, 160, 164, 180, 162, 158, 172, 164, 170, 154, 164, 170, 158, 156, 174, 156, 162, 172, 148, 168, 170, 154, 162, 178, 150, 168, 168, 152, 178, 160, 172, 176, 160, 166, 180, 154, 166, 170, 162, 174, 168, 164, 166, 152, 166, 172, 148, 174, 166, 148, 168, 172, 156, 160, 176, 148, 162, 172, 152, 160, 154, 158, 164, 146, 162, 166, 150, 156, 170, 142, 164, 172, 154, 162, 174, 150, 170, 160, 160, 154, 160, 154, 168, 150, 166, 178, 136, 158, 176, 142, 160, 170, 154, 164, 162, 156, 176, 136, 164, 164, 158, 162, 176, 152, 162, 172, 156, 154, 182, 158, 162, 170, 158, 168, 156, 168, 184, 152, 166, 188, 152, 162, 168, 172, 158, 174, 164, 178, 164, 164, 166, 156, 170, 166, 154, 168, 160, 160, 158, 178, 152, 158, 182, 152, 172, 164, 160, 174, 150, 170, 178, 142, 176, 168, 164, 160, 178, 154, 166, 172, 156, 172, 168, 164, 182, 150, 172, 172, 160, 164, 182, 146, 166, 172, 154, 166, 170, 150, 178, 154, 166, 174, 152, 162, 182, 142, 164, 174, 158, 166, 170, 166, 158, 188, 148, 168, 184, 156, 180, 158, 168, 174, 156, 160, 172, 152, 162, 182, 154, 170, 158, 168, 170, 154, 166, 168, 164, 164, 164, 146, 176, 170, 154, 158, 180, 162, 148, 176, 146, 166, 168, 148, 180, 154, 160, 186, 146, 174, 180, 148, 168, 170, 158, 158, 188, 146, 170, 168, 158, 170, 162, 160, 182, 150, 162, 178, 156, 156, 178, 152, 158, 170, 164, 170, 166, 154, 176, 154, 176, 168, 146}, + {174, 176, 148, 184, 160, 160, 180, 148, 160, 190, 148, 158, 174, 152, 150, 184, 152, 176, 174, 152, 166, 170, 144, 182, 172, 144, 184, 158, 160, 182, 150, 172, 182, 138, 174, 178, 150, 178, 172, 156, 178, 178, 160, 184, 156, 148, 180, 150, 172, 178, 154, 168, 166, 140, 166, 174, 144, 186, 154, 160, 176, 156, 164, 184, 150, 168, 182, 142, 166, 184, 160, 168, 180, 144, 166, 172, 150, 184, 156, 162, 190, 150, 160, 180, 154, 170, 176, 154, 166, 164, 148, 172, 164, 162, 168, 166, 150, 188, 150, 162, 182, 144, 168, 182, 148, 174, 172, 146, 180, 162, 160, 178, 154, 166, 194, 150, 172, 182, 142, 170, 166, 150, 164, 178, 140, 188, 152, 158, 168, 152, 164, 190, 154, 168, 180, 142, 172, 176, 150, 154, 172, 154, 166, 150, 160, 170, 148, 164, 174, 156, 150, 180, 140, 160, 178, 136, 172, 172, 140, 176, 162, 142, 164, 150, 156, 168, 148, 160, 172, 136, 164, 182, 140, 172, 162, 148, 178, 150, 144, 178, 142, 162, 180, 146, 150, 186, 142, 160, 176, 144, 172, 166, 150, 164, 160, 158, 180, 160, 150, 178, 150, 160, 184, 150, 162, 184, 146, 170, 174, 142, 176, 174, 136, 188, 148, 150, 186, 154, 166, 194, 146, 164, 172, 150, 168, 180, 142, 178, 162, 158, 176, 152, 166, 184, 148, 174, 182, 146, 172, 192, 144, 168, 178, 146, 170, 170, 148, 180, 158, 170, 170, 148, 168, 168, 150, 170, 168, 148, 170, 176, 138, 192, 174, 138, 186, 160, 158, 184, 154, 158, 186, 154, 154, 180, 142, 172, 184, 156, 180, 168, 158, 172, 152, 162, 186, 138, 162, 178, 154, 164, 188, 132, 170, 186, 148, 168, 166, 150, 170, 168, 158, 174, 148, 166, 182, 146, 160, 192, 148, 168, 180, 152, 176, 178, 152, 188, 156, 160, 180, 152, 168, 180, 150, 172, 184, 144, 166, 180, 132, 180, 168, 160, 180, 158, 154, 180, 154, 170, 184, 152, 170, 172, 162, 152, 178, 154, 172, 176, 146, 184, 162, 142, 178, 164, 160, 190, 142, 166, 182, 146}, + {182, 156, 156, 184, 156, 148, 186, 150, 174, 174, 156, 178, 164, 172, 182, 150, 166, 174, 162, 170, 166, 164, 162, 174, 170, 156, 170, 168, 158, 170, 164, 166, 154, 172, 172, 150, 166, 180, 144, 176, 160, 158, 168, 160, 162, 164, 170, 180, 160, 158, 168, 168, 162, 164, 180, 152, 164, 182, 152, 168, 178, 154, 172, 166, 160, 174, 164, 164, 172, 152, 166, 160, 162, 170, 174, 150, 174, 168, 172, 152, 156, 176, 164, 162, 170, 168, 152, 160, 188, 150, 172, 178, 160, 166, 176, 154, 180, 158, 156, 176, 156, 178, 168, 158, 164, 176, 150, 170, 176, 154, 160, 178, 170, 150, 170, 170, 152, 162, 170, 170, 166, 160, 176, 160, 168, 176, 154, 164, 180, 150, 168, 162, 168, 166, 166, 174, 174, 146, 174, 170, 168, 158, 180, 152, 158, 168, 164, 146, 176, 150, 160, 158, 166, 168, 152, 162, 168, 156, 166, 166, 152, 168, 164, 162, 156, 166, 170, 154, 154, 164, 166, 152, 168, 168, 148, 158, 176, 150, 160, 174, 162, 162, 164, 152, 172, 154, 166, 176, 154, 156, 184, 146, 172, 180, 148, 166, 170, 150, 166, 166, 182, 164, 162, 176, 156, 154, 178, 168, 158, 176, 168, 160, 170, 180, 166, 164, 178, 152, 178, 146, 170, 178, 160, 160, 184, 152, 170, 186, 152, 170, 178, 160, 158, 166, 168, 156, 178, 162, 156, 154, 172, 176, 150, 164, 190, 154, 166, 180, 160, 160, 168, 170, 162, 166, 170, 172, 166, 168, 176, 162, 176, 156, 156, 168, 176, 172, 154, 172, 170, 156, 164, 166, 174, 166, 166, 182, 150, 148, 186, 146, 162, 184, 150, 170, 178, 166, 170, 166, 174, 158, 158, 174, 154, 168, 172, 176, 164, 168, 166, 156, 164, 178, 162, 168, 174, 160, 180, 150, 164, 180, 144, 156, 180, 148, 166, 178, 158, 172, 162, 166, 162, 172, 162, 162, 162, 166, 170, 148, 172, 186, 148, 158, 192, 142, 180, 166, 160, 174, 160, 168, 178, 144, 172, 176, 162, 168, 166, 154, 168, 158, 168, 168, 160, 170, 162, 172, 170, 164, 158, 160}, + {158, 174, 176, 168, 158, 180, 156, 166, 182, 150, 178, 186, 152, 160, 188, 146, 178, 176, 154, 172, 158, 168, 176, 154, 162, 178, 148, 170, 176, 152, 170, 168, 154, 172, 168, 166, 182, 164, 166, 176, 166, 166, 190, 150, 180, 184, 146, 172, 174, 154, 176, 164, 156, 178, 154, 174, 170, 170, 154, 182, 148, 172, 178, 150, 174, 184, 142, 172, 184, 148, 176, 166, 166, 172, 168, 162, 180, 142, 182, 182, 146, 174, 182, 154, 172, 178, 154, 178, 166, 158, 180, 164, 170, 180, 146, 170, 178, 142, 178, 170, 164, 160, 180, 148, 190, 164, 148, 178, 160, 172, 178, 158, 168, 176, 150, 182, 180, 158, 168, 174, 160, 164, 164, 170, 168, 162, 172, 174, 154, 174, 178, 148, 180, 172, 144, 174, 172, 150, 186, 152, 150, 178, 158, 162, 180, 154, 168, 186, 138, 168, 172, 142, 174, 154, 162, 172, 160, 158, 174, 146, 164, 176, 154, 160, 172, 142, 174, 172, 146, 166, 170, 148, 172, 162, 142, 168, 154, 162, 162, 152, 158, 174, 130, 184, 166, 154, 164, 164, 156, 176, 162, 152, 180, 146, 158, 176, 158, 162, 184, 136, 180, 166, 150, 176, 174, 154, 176, 172, 168, 174, 152, 168, 172, 162, 172, 164, 164, 170, 166, 160, 174, 164, 152, 176, 176, 152, 176, 150, 150, 176, 154, 160, 190, 148, 170, 184, 138, 186, 176, 168, 180, 168, 164, 184, 148, 170, 172, 164, 168, 170, 166, 160, 180, 146, 176, 164, 158, 164, 174, 142, 186, 158, 160, 180, 152, 170, 174, 146, 174, 164, 160, 176, 170, 158, 166, 160, 170, 174, 172, 160, 176, 158, 176, 178, 138, 170, 190, 136, 182, 184, 146, 176, 180, 156, 176, 154, 160, 174, 142, 182, 164, 152, 178, 170, 150, 174, 168, 164, 178, 174, 156, 188, 174, 158, 192, 140, 162, 186, 146, 168, 200, 130, 170, 194, 154, 170, 164, 172, 164, 160, 168, 172, 154, 176, 172, 148, 176, 172, 152, 176, 184, 158, 172, 166, 158, 166, 166, 162, 182, 142, 184, 182, 144, 168, 182, 158, 160, 172, 164, 172}, + {166, 164, 166, 158, 176, 168, 166, 164, 166, 160, 166, 160, 176, 166, 160, 166, 178, 158, 172, 176, 156, 186, 162, 160, 184, 170, 152, 174, 162, 164, 184, 168, 162, 174, 164, 170, 168, 154, 178, 174, 156, 158, 172, 164, 172, 166, 170, 184, 158, 168, 170, 164, 164, 172, 152, 186, 170, 148, 178, 176, 150, 172, 160, 174, 174, 154, 192, 174, 164, 172, 178, 156, 178, 160, 160, 182, 162, 170, 166, 168, 154, 184, 150, 176, 174, 162, 164, 178, 154, 172, 178, 156, 164, 172, 158, 160, 170, 180, 164, 170, 166, 174, 164, 172, 162, 154, 186, 168, 164, 176, 164, 166, 182, 160, 164, 168, 164, 174, 174, 156, 158, 180, 164, 172, 174, 156, 172, 174, 162, 166, 164, 168, 176, 156, 168, 194, 148, 170, 174, 154, 174, 174, 156, 164, 164, 164, 156, 166, 158, 156, 162, 174, 170, 156, 168, 160, 162, 162, 160, 164, 182, 158, 152, 178, 146, 168, 162, 158, 154, 180, 146, 162, 164, 156, 164, 168, 158, 162, 170, 158, 154, 172, 150, 174, 160, 170, 164, 154, 172, 164, 168, 170, 164, 144, 194, 150, 164, 170, 170, 162, 174, 162, 164, 174, 156, 168, 172, 156, 166, 178, 162, 166, 178, 164, 174, 170, 166, 180, 162, 170, 174, 156, 168, 178, 154, 166, 180, 160, 178, 184, 158, 174, 168, 166, 166, 166, 168, 166, 166, 154, 172, 156, 168, 162, 152, 180, 168, 158, 184, 166, 158, 174, 168, 162, 174, 158, 162, 180, 162, 176, 178, 152, 174, 188, 152, 178, 174, 164, 168, 174, 158, 176, 150, 174, 170, 160, 182, 170, 156, 176, 160, 166, 168, 172, 172, 170, 164, 172, 174, 160, 164, 180, 144, 178, 162, 152, 182, 178, 156, 168, 172, 154, 180, 160, 162, 178, 150, 176, 164, 158, 170, 170, 158, 160, 172, 172, 170, 176, 164, 166, 164, 168, 172, 168, 152, 180, 152, 170, 172, 154, 180, 164, 160, 170, 166, 176, 178, 166, 164, 172, 164, 166, 176, 150, 172, 174, 164, 174, 172, 164, 170, 176, 148, 190, 154, 160, 172, 166, 164, 184}, + {164, 192, 150, 174, 182, 148, 176, 174, 158, 188, 166, 154, 190, 150, 156, 200, 152, 172, 170, 156, 178, 178, 154, 188, 170, 162, 158, 174, 174, 176, 148, 174, 168, 158, 166, 182, 156, 178, 176, 158, 184, 174, 162, 178, 166, 162, 182, 156, 166, 176, 156, 172, 178, 158, 170, 174, 154, 176, 184, 146, 180, 174, 156, 182, 162, 166, 180, 148, 166, 180, 144, 184, 162, 162, 180, 158, 164, 182, 156, 174, 178, 164, 154, 190, 140, 176, 178, 154, 174, 178, 160, 182, 180, 160, 176, 168, 166, 178, 150, 172, 174, 170, 158, 188, 148, 170, 180, 142, 182, 174, 156, 170, 184, 148, 168, 168, 158, 192, 148, 166, 188, 148, 170, 172, 172, 176, 160, 158, 184, 164, 170, 174, 162, 170, 184, 146, 174, 186, 146, 180, 168, 158, 176, 174, 142, 180, 162, 162, 174, 168, 156, 176, 140, 168, 174, 150, 164, 166, 160, 166, 166, 150, 174, 166, 154, 174, 160, 162, 172, 170, 160, 186, 142, 162, 172, 150, 166, 160, 146, 186, 162, 154, 178, 142, 160, 182, 142, 178, 170, 154, 172, 168, 158, 170, 170, 158, 178, 162, 158, 174, 166, 174, 166, 158, 170, 184, 152, 174, 170, 160, 162, 172, 170, 178, 172, 152, 182, 166, 160, 188, 160, 168, 178, 158, 174, 184, 154, 182, 162, 156, 186, 158, 162, 176, 154, 172, 188, 144, 180, 198, 160, 176, 186, 158, 174, 170, 160, 160, 182, 164, 168, 178, 156, 184, 166, 174, 170, 164, 164, 182, 154, 182, 166, 154, 178, 168, 156, 174, 160, 162, 176, 168, 176, 190, 152, 180, 170, 154, 174, 168, 168, 168, 180, 150, 192, 164, 164, 184, 154, 170, 182, 156, 182, 180, 156, 186, 172, 170, 160, 166, 170, 182, 162, 160, 180, 166, 160, 172, 158, 178, 172, 168, 178, 186, 164, 180, 162, 154, 184, 160, 168, 186, 160, 162, 184, 160, 162, 178, 162, 168, 188, 150, 170, 172, 166, 170, 158, 174, 174, 154, 170, 178, 154, 178, 176, 156, 168, 170, 166, 176, 154, 168, 182, 166, 158, 186, 158, 158, 182, 158}, + {170, 152, 180, 190, 140, 164, 200, 140, 176, 174, 158, 162, 180, 166, 180, 168, 156, 186, 162, 172, 182, 146, 176, 192, 138, 180, 186, 158, 172, 168, 172, 168, 160, 180, 172, 162, 178, 190, 140, 164, 200, 142, 178, 188, 144, 182, 188, 148, 188, 166, 164, 172, 158, 172, 182, 158, 172, 172, 154, 160, 186, 166, 170, 178, 164, 178, 170, 182, 178, 166, 166, 192, 154, 178, 188, 156, 172, 176, 154, 172, 186, 160, 184, 166, 162, 184, 154, 170, 184, 148, 178, 178, 154, 160, 198, 146, 176, 174, 160, 168, 180, 168, 176, 170, 164, 186, 154, 178, 186, 156, 182, 178, 158, 182, 182, 174, 170, 172, 166, 178, 164, 174, 180, 154, 172, 192, 148, 172, 186, 142, 182, 170, 158, 178, 158, 162, 186, 156, 168, 182, 140, 184, 188, 148, 172, 190, 146, 162, 180, 168, 170, 166, 172, 182, 162, 160, 176, 156, 172, 184, 134, 176, 176, 150, 172, 168, 160, 172, 156, 150, 174, 148, 164, 180, 156, 158, 182, 146, 168, 170, 152, 162, 184, 156, 180, 168, 162, 178, 162, 170, 180, 162, 174, 172, 148, 178, 174, 152, 186, 172, 154, 170, 168, 168, 176, 162, 170, 184, 158, 168, 188, 150, 172, 184, 148, 178, 180, 158, 182, 148, 178, 176, 158, 164, 188, 164, 164, 188, 148, 166, 192, 154, 176, 192, 150, 174, 174, 160, 182, 158, 176, 172, 154, 174, 180, 162, 176, 180, 142, 180, 178, 158, 174, 154, 176, 178, 158, 168, 180, 148, 170, 186, 152, 170, 188, 152, 184, 184, 162, 168, 192, 158, 170, 168, 172, 180, 148, 164, 196, 148, 182, 176, 156, 166, 180, 154, 176, 176, 156, 180, 170, 164, 172, 158, 162, 186, 146, 170, 184, 150, 178, 174, 158, 176, 168, 174, 180, 168, 182, 174, 156, 158, 188, 154, 164, 192, 146, 164, 204, 144, 180, 176, 148, 178, 176, 162, 176, 172, 156, 188, 150, 166, 178, 152, 176, 174, 166, 170, 180, 176, 174, 162, 172, 188, 148, 184, 184, 150, 170, 186, 162, 166, 192, 148, 180, 182, 154, 180, 162, 170}, + {174, 170, 184, 170, 168, 190, 168, 174, 184, 156, 190, 188, 142, 188, 176, 160, 178, 182, 172, 168, 172, 168, 176, 160, 172, 182, 156, 170, 190, 156, 176, 190, 148, 188, 184, 156, 174, 166, 170, 192, 150, 172, 192, 154, 180, 180, 156, 178, 176, 162, 168, 188, 158, 186, 166, 160, 188, 158, 182, 184, 152, 164, 186, 158, 178, 174, 154, 184, 172, 166, 178, 170, 158, 188, 154, 180, 186, 160, 186, 176, 146, 188, 172, 166, 168, 186, 156, 190, 172, 160, 178, 166, 172, 188, 160, 170, 184, 158, 184, 180, 156, 168, 176, 162, 172, 178, 164, 182, 158, 166, 188, 148, 164, 192, 142, 176, 180, 162, 182, 176, 154, 186, 174, 168, 162, 176, 170, 184, 162, 174, 182, 150, 182, 186, 158, 172, 174, 162, 168, 182, 164, 188, 152, 166, 174, 154, 180, 174, 148, 174, 174, 154, 172, 172, 148, 178, 166, 158, 176, 150, 170, 184, 144, 176, 170, 150, 178, 172, 160, 178, 168, 158, 172, 174, 150, 176, 162, 174, 166, 154, 170, 170, 144, 172, 180, 148, 170, 178, 156, 164, 176, 150, 184, 154, 170, 178, 142, 182, 184, 146, 174, 186, 140, 184, 170, 158, 184, 172, 158, 188, 168, 172, 170, 164, 172, 188, 158, 174, 176, 164, 172, 178, 162, 180, 174, 156, 176, 166, 174, 182, 158, 164, 196, 144, 182, 174, 154, 180, 186, 164, 172, 186, 172, 176, 172, 160, 184, 152, 176, 184, 158, 168, 194, 164, 170, 186, 154, 194, 162, 158, 190, 164, 170, 188, 166, 170, 180, 162, 158, 182, 160, 174, 186, 158, 174, 178, 164, 194, 158, 172, 182, 146, 184, 180, 142, 192, 182, 144, 194, 170, 168, 188, 172, 164, 182, 176, 162, 176, 168, 168, 174, 160, 176, 190, 158, 176, 178, 148, 186, 174, 156, 198, 158, 162, 188, 160, 178, 188, 160, 168, 176, 166, 172, 184, 160, 180, 178, 166, 184, 166, 174, 194, 170, 180, 180, 154, 176, 178, 144, 180, 174, 166, 174, 184, 140, 192, 168, 174, 182, 168, 170, 172, 154, 180, 178, 156, 162, 192, 160, 180}, + {168, 188, 160, 170, 182, 168, 164, 182, 160, 164, 186, 164, 174, 178, 166, 176, 176, 158, 186, 178, 156, 200, 170, 168, 184, 162, 188, 178, 168, 178, 168, 170, 180, 180, 156, 194, 160, 170, 184, 164, 164, 190, 170, 166, 184, 164, 170, 176, 166, 172, 176, 172, 182, 166, 172, 188, 176, 172, 182, 162, 180, 180, 158, 180, 188, 164, 168, 190, 150, 186, 178, 152, 204, 164, 164, 190, 166, 160, 174, 160, 176, 180, 170, 178, 166, 166, 182, 160, 160, 198, 168, 166, 190, 168, 170, 190, 156, 172, 184, 158, 180, 186, 166, 186, 170, 154, 188, 164, 174, 186, 178, 176, 182, 166, 188, 168, 156, 184, 174, 160, 176, 178, 154, 196, 164, 162, 188, 166, 168, 188, 162, 186, 168, 176, 174, 178, 172, 178, 162, 164, 192, 156, 168, 180, 170, 168, 182, 168, 176, 178, 160, 172, 172, 168, 170, 170, 154, 184, 174, 156, 188, 156, 176, 160, 174, 166, 162, 162, 164, 170, 170, 170, 174, 144, 176, 160, 164, 176, 162, 166, 176, 166, 184, 180, 144, 182, 166, 166, 190, 168, 158, 190, 152, 170, 186, 168, 170, 172, 172, 176, 176, 164, 170, 184, 158, 192, 160, 166, 178, 162, 154, 200, 146, 180, 192, 160, 180, 188, 162, 186, 176, 164, 180, 180, 160, 182, 174, 174, 188, 166, 178, 176, 166, 176, 182, 176, 172, 174, 156, 184, 178, 156, 190, 148, 174, 182, 168, 172, 176, 176, 174, 180, 170, 184, 158, 166, 180, 176, 164, 186, 170, 162, 192, 160, 166, 196, 162, 174, 174, 168, 180, 180, 158, 190, 168, 160, 184, 174, 166, 186, 162, 176, 186, 170, 180, 170, 172, 172, 182, 164, 168, 180, 166, 186, 172, 156, 188, 164, 180, 194, 172, 172, 184, 172, 170, 178, 162, 196, 156, 170, 190, 164, 166, 182, 164, 170, 194, 156, 170, 194, 160, 176, 168, 174, 180, 160, 158, 188, 170, 160, 190, 158, 172, 170, 166, 172, 188, 162, 184, 174, 168, 188, 168, 154, 186, 174, 172, 198, 166, 160, 184, 164, 166, 194, 160, 182, 174, 168, 184, 160}, + {174, 176, 178, 182, 162, 174, 184, 174, 182, 170, 162, 196, 168, 160, 200, 164, 176, 186, 158, 180, 190, 146, 186, 174, 180, 186, 166, 176, 174, 174, 168, 180, 184, 166, 188, 158, 186, 184, 150, 202, 174, 160, 180, 174, 170, 182, 168, 182, 190, 168, 178, 182, 164, 180, 182, 168, 182, 170, 168, 186, 180, 182, 190, 164, 166, 186, 164, 172, 188, 162, 170, 184, 158, 180, 176, 162, 194, 174, 170, 182, 174, 172, 188, 166, 182, 188, 170, 184, 180, 164, 188, 184, 144, 198, 176, 160, 190, 166, 172, 192, 160, 178, 184, 166, 182, 182, 166, 184, 180, 158, 182, 176, 164, 180, 172, 184, 186, 172, 162, 188, 170, 174, 194, 164, 188, 182, 160, 184, 176, 172, 180, 170, 178, 180, 164, 182, 186, 162, 186, 190, 158, 176, 176, 156, 178, 168, 164, 182, 176, 166, 182, 168, 174, 174, 166, 182, 184, 160, 178, 172, 162, 194, 176, 160, 178, 174, 166, 180, 168, 158, 188, 158, 164, 198, 158, 184, 174, 166, 182, 168, 152, 176, 166, 174, 168, 166, 168, 174, 150, 184, 172, 166, 182, 180, 156, 192, 172, 152, 192, 164, 170, 178, 174, 174, 184, 166, 174, 176, 166, 178, 188, 166, 190, 170, 164, 192, 164, 170, 190, 158, 170, 180, 174, 176, 192, 166, 172, 192, 168, 186, 168, 168, 184, 170, 172, 176, 168, 184, 174, 172, 182, 184, 164, 180, 172, 180, 176, 184, 170, 186, 182, 164, 188, 170, 182, 172, 170, 170, 204, 158, 182, 190, 148, 188, 184, 162, 192, 164, 166, 180, 180, 172, 178, 168, 174, 182, 170, 172, 184, 158, 180, 178, 170, 194, 172, 162, 192, 168, 174, 186, 164, 174, 188, 150, 186, 186, 162, 182, 174, 166, 184, 170, 158, 176, 188, 168, 182, 174, 174, 180, 162, 176, 188, 170, 186, 184, 156, 194, 176, 176, 188, 176, 166, 186, 172, 186, 174, 168, 184, 178, 174, 192, 172, 172, 168, 176, 168, 188, 166, 174, 184, 168, 170, 198, 156, 194, 178, 144, 180, 176, 164, 194, 170, 178, 186, 170, 178, 178, 170, 178}, + {160, 184, 176, 164, 192, 178, 172, 192, 160, 186, 200, 168, 182, 186, 162, 188, 184, 154, 198, 184, 158, 192, 178, 172, 188, 182, 162, 198, 164, 178, 194, 168, 178, 194, 146, 202, 188, 162, 194, 172, 168, 202, 158, 182, 186, 164, 180, 192, 160, 176, 210, 152, 184, 192, 158, 204, 166, 164, 204, 164, 176, 186, 178, 184, 190, 170, 186, 178, 156, 200, 180, 162, 190, 184, 164, 194, 180, 162, 204, 180, 172, 186, 170, 174, 182, 168, 188, 188, 150, 202, 176, 174, 194, 162, 174, 190, 164, 184, 186, 164, 186, 190, 168, 186, 190, 166, 186, 192, 158, 196, 160, 184, 194, 174, 176, 192, 158, 186, 194, 156, 188, 180, 150, 190, 174, 164, 184, 182, 170, 192, 182, 166, 194, 164, 176, 192, 152, 196, 188, 160, 200, 172, 170, 204, 166, 170, 196, 164, 172, 196, 164, 184, 184, 168, 168, 176, 156, 188, 176, 162, 182, 162, 168, 184, 168, 162, 198, 156, 182, 182, 144, 198, 174, 158, 186, 186, 154, 188, 174, 172, 182, 170, 168, 182, 168, 178, 186, 156, 178, 188, 152, 184, 176, 156, 186, 170, 162, 202, 152, 172, 202, 150, 192, 174, 160, 188, 182, 162, 194, 188, 158, 184, 162, 172, 184, 186, 166, 190, 164, 180, 206, 162, 182, 190, 156, 208, 180, 156, 194, 172, 172, 194, 166, 180, 186, 164, 180, 180, 166, 186, 196, 166, 182, 182, 164, 202, 172, 160, 194, 162, 172, 192, 168, 184, 204, 152, 194, 186, 152, 204, 180, 158, 200, 172, 170, 194, 168, 174, 198, 180, 172, 188, 162, 176, 194, 152, 190, 186, 162, 212, 178, 168, 196, 166, 172, 196, 154, 186, 186, 146, 200, 182, 162, 194, 178, 164, 184, 198, 152, 200, 166, 180, 188, 174, 176, 194, 160, 184, 192, 170, 188, 186, 166, 200, 158, 174, 190, 156, 182, 176, 152, 174, 194, 152, 176, 184, 166, 194, 182, 160, 196, 178, 168, 190, 180, 178, 198, 172, 184, 172, 168, 194, 188, 150, 196, 178, 156, 202, 188, 162, 194, 180, 166, 192, 168, 176, 188, 168, 180, 184}, + {198, 182, 168, 204, 172, 180, 184, 192, 180, 188, 182, 174, 188, 182, 190, 190, 166, 190, 190, 182, 188, 174, 176, 192, 160, 182, 204, 164, 192, 180, 178, 192, 174, 186, 198, 162, 188, 190, 168, 180, 198, 170, 188, 202, 174, 174, 196, 170, 194, 180, 154, 196, 188, 162, 198, 164, 188, 198, 168, 180, 190, 180, 182, 176, 178, 180, 190, 190, 186, 178, 174, 192, 182, 178, 200, 172, 176, 206, 156, 182, 190, 180, 186, 172, 182, 186, 184, 170, 200, 172, 178, 202, 174, 180, 186, 178, 188, 194, 170, 186, 184, 170, 190, 172, 176, 198, 176, 168, 204, 172, 184, 188, 184, 168, 192, 178, 184, 176, 188, 186, 184, 180, 194, 166, 186, 194, 172, 172, 196, 176, 180, 198, 168, 184, 196, 174, 198, 172, 168, 196, 166, 168, 190, 176, 182, 190, 180, 170, 188, 180, 174, 176, 162, 190, 190, 162, 194, 182, 172, 194, 172, 176, 192, 168, 170, 192, 156, 180, 178, 176, 190, 156, 178, 180, 184, 152, 186, 176, 166, 184, 178, 166, 188, 166, 178, 184, 164, 182, 176, 160, 202, 164, 170, 194, 176, 168, 186, 172, 180, 180, 176, 184, 180, 186, 180, 176, 170, 192, 166, 178, 188, 182, 178, 192, 180, 166, 194, 166, 190, 176, 164, 194, 178, 180, 188, 170, 178, 192, 184, 172, 186, 184, 178, 186, 180, 182, 196, 178, 200, 182, 170, 194, 180, 154, 192, 166, 182, 194, 172, 174, 190, 180, 184, 174, 192, 184, 178, 186, 188, 186, 168, 194, 180, 182, 184, 180, 188, 196, 162, 176, 198, 160, 202, 186, 176, 190, 176, 172, 190, 178, 176, 194, 174, 182, 178, 184, 188, 186, 192, 192, 190, 174, 192, 174, 166, 198, 178, 164, 208, 174, 184, 168, 184, 180, 186, 190, 190, 170, 170, 194, 184, 168, 190, 178, 186, 200, 166, 182, 188, 186, 186, 194, 170, 186, 198, 168, 188, 188, 174, 188, 170, 178, 198, 160, 190, 190, 174, 180, 174, 202, 176, 174, 188, 194, 188, 172, 188, 178, 170, 202, 162, 180, 198, 178, 180, 194, 170, 192, 190, 172}, + {182, 198, 186, 184, 208, 170, 196, 182, 188, 190, 178, 188, 192, 188, 184, 192, 188, 170, 212, 170, 194, 204, 180, 176, 200, 180, 198, 184, 172, 202, 180, 178, 198, 192, 184, 192, 182, 194, 204, 178, 180, 208, 168, 180, 214, 180, 188, 184, 168, 196, 196, 178, 210, 174, 192, 202, 166, 188, 194, 184, 192, 200, 168, 204, 182, 176, 206, 176, 180, 206, 186, 158, 210, 186, 166, 208, 166, 192, 200, 166, 198, 182, 192, 202, 182, 188, 198, 188, 180, 198, 190, 182, 200, 176, 192, 170, 182, 188, 190, 184, 198, 180, 180, 206, 172, 176, 208, 180, 186, 200, 178, 192, 204, 170, 188, 190, 176, 196, 178, 190, 188, 182, 184, 188, 176, 198, 202, 176, 194, 204, 154, 202, 198, 172, 192, 188, 182, 208, 182, 178, 204, 174, 194, 194, 164, 190, 182, 190, 178, 186, 178, 198, 180, 170, 200, 180, 170, 206, 178, 172, 202, 184, 178, 196, 174, 192, 204, 184, 184, 166, 178, 198, 176, 174, 198, 178, 186, 182, 180, 184, 192, 158, 194, 190, 164, 192, 178, 178, 196, 184, 174, 202, 176, 162, 204, 172, 196, 190, 166, 190, 186, 178, 190, 184, 176, 204, 176, 180, 194, 180, 180, 198, 174, 194, 202, 166, 200, 184, 176, 198, 184, 178, 192, 190, 168, 194, 182, 188, 184, 178, 208, 188, 170, 198, 196, 184, 188, 190, 166, 208, 184, 166, 204, 206, 182, 210, 168, 190, 204, 172, 184, 196, 190, 186, 178, 194, 186, 180, 182, 198, 182, 188, 196, 168, 190, 192, 166, 194, 210, 162, 202, 194, 174, 204, 168, 186, 200, 186, 196, 196, 168, 194, 192, 194, 190, 182, 170, 200, 182, 172, 192, 198, 184, 200, 174, 182, 208, 172, 180, 202, 176, 196, 188, 188, 188, 188, 168, 210, 180, 190, 200, 164, 196, 188, 186, 170, 210, 196, 180, 188, 168, 192, 192, 168, 198, 184, 182, 208, 172, 188, 192, 182, 192, 212, 168, 192, 194, 182, 198, 178, 180, 202, 176, 188, 202, 170, 184, 210, 168, 174, 220, 158, 202, 180, 174, 194, 194, 176, 198, 182}, + {186, 212, 176, 200, 190, 182, 218, 186, 182, 212, 184, 198, 216, 178, 186, 226, 178, 192, 204, 180, 190, 206, 204, 174, 202, 198, 190, 198, 194, 190, 196, 188, 212, 180, 192, 208, 180, 202, 190, 194, 208, 180, 200, 204, 172, 204, 212, 186, 194, 202, 184, 190, 192, 200, 194, 214, 188, 192, 210, 184, 202, 188, 200, 200, 192, 192, 198, 188, 200, 204, 194, 204, 184, 184, 212, 180, 204, 194, 188, 202, 194, 192, 184, 192, 208, 182, 214, 190, 192, 198, 174, 212, 182, 196, 230, 200, 176, 208, 194, 188, 212, 186, 210, 198, 200, 194, 182, 204, 176, 200, 200, 180, 202, 200, 202, 192, 202, 190, 198, 198, 180, 182, 222, 206, 176, 208, 200, 190, 208, 186, 192, 196, 202, 196, 194, 204, 170, 212, 190, 186, 216, 186, 184, 212, 202, 190, 182, 198, 194, 186, 198, 200, 178, 210, 186, 172, 210, 190, 188, 194, 180, 200, 200, 186, 182, 200, 176, 186, 212, 180, 178, 216, 184, 182, 200, 192, 178, 202, 180, 202, 184, 196, 192, 192, 186, 190, 192, 180, 188, 190, 190, 202, 200, 194, 174, 190, 192, 188, 186, 196, 190, 182, 202, 174, 194, 204, 178, 210, 194, 168, 218, 182, 178, 198, 198, 200, 208, 200, 176, 196, 210, 186, 196, 198, 188, 198, 196, 184, 196, 190, 194, 200, 190, 198, 172, 200, 210, 166, 214, 208, 184, 202, 192, 172, 204, 202, 190, 192, 198, 188, 210, 196, 190, 216, 188, 196, 228, 168, 202, 206, 182, 202, 212, 192, 204, 204, 198, 178, 196, 202, 190, 190, 202, 186, 196, 184, 202, 180, 198, 202, 190, 198, 180, 200, 214, 182, 206, 208, 192, 190, 208, 170, 196, 228, 186, 186, 200, 188, 202, 188, 204, 196, 196, 194, 206, 198, 174, 214, 194, 184, 202, 212, 178, 196, 190, 202, 176, 196, 206, 188, 186, 218, 176, 210, 196, 186, 214, 200, 190, 198, 202, 180, 206, 206, 186, 198, 190, 184, 206, 200, 176, 212, 208, 178, 198, 190, 192, 206, 186, 208, 184, 204, 196, 192, 186, 182, 212, 196, 200, 190}, + {238, 194, 228, 226, 188, 226, 234, 200, 226, 212, 216, 222, 210, 214, 236, 206, 208, 238, 212, 204, 220, 214, 228, 234, 202, 230, 218, 210, 222, 206, 214, 240, 194, 220, 248, 160, 254, 204, 200, 236, 212, 214, 246, 216, 190, 244, 218, 194, 246, 220, 194, 244, 210, 200, 224, 206, 218, 230, 194, 224, 222, 206, 238, 204, 216, 236, 210, 212, 222, 198, 236, 214, 214, 230, 212, 188, 238, 218, 208, 234, 210, 198, 240, 218, 192, 256, 182, 218, 246, 182, 244, 226, 196, 220, 210, 226, 208, 220, 206, 234, 204, 210, 218, 214, 224, 202, 220, 212, 226, 204, 234, 216, 200, 226, 210, 194, 246, 184, 236, 258, 188, 212, 234, 174, 238, 228, 206, 230, 206, 198, 234, 218, 198, 232, 228, 194, 228, 218, 214, 220, 194, 212, 216, 218, 230, 194, 208, 234, 202, 220, 210, 206, 222, 222, 200, 222, 224, 198, 220, 226, 192, 244, 206, 188, 238, 212, 192, 240, 214, 188, 220, 200, 210, 230, 188, 226, 212, 200, 218, 206, 200, 222, 206, 212, 214, 214, 214, 222, 210, 198, 230, 194, 232, 212, 182, 232, 218, 200, 234, 184, 200, 244, 190, 206, 230, 198, 216, 218, 212, 196, 242, 198, 218, 228, 194, 224, 212, 206, 220, 202, 226, 214, 216, 210, 224, 214, 216, 236, 186, 240, 190, 220, 248, 186, 222, 228, 202, 226, 214, 198, 228, 238, 200, 216, 232, 184, 240, 226, 186, 244, 216, 188, 240, 200, 202, 232, 204, 218, 222, 200, 232, 212, 216, 210, 228, 204, 232, 212, 206, 236, 228, 202, 216, 210, 218, 230, 188, 224, 224, 204, 242, 238, 166, 248, 200, 216, 234, 202, 218, 244, 210, 214, 216, 220, 216, 220, 214, 218, 222, 202, 208, 230, 206, 220, 212, 218, 214, 190, 240, 216, 206, 230, 222, 206, 248, 222, 184, 252, 210, 196, 240, 206, 194, 252, 204, 210, 216, 210, 218, 234, 192, 224, 226, 186, 226, 228, 186, 254, 212, 210, 228, 198, 234, 206, 210, 226, 208, 208, 228, 208, 220, 226, 214, 210, 254, 198, 198, 240, 206, 210}, + {206, 210, 236, 222, 206, 216, 216, 226, 222, 210, 234, 206, 218, 210, 236, 202, 232, 236, 212, 200, 234, 208, 236, 202, 242, 208, 212, 254, 188, 204, 256, 200, 214, 238, 202, 234, 212, 230, 210, 232, 214, 226, 220, 198, 224, 226, 202, 232, 220, 204, 246, 212, 198, 240, 224, 208, 224, 220, 228, 206, 220, 216, 208, 220, 210, 226, 236, 208, 210, 226, 228, 216, 216, 234, 226, 212, 226, 188, 238, 230, 200, 242, 208, 184, 254, 202, 220, 220, 232, 224, 214, 228, 204, 224, 230, 236, 204, 210, 236, 208, 220, 204, 218, 212, 236, 212, 216, 230, 208, 228, 216, 204, 250, 208, 222, 254, 190, 208, 234, 220, 220, 216, 230, 220, 222, 210, 206, 242, 208, 228, 216, 198, 228, 222, 216, 230, 218, 220, 232, 194, 234, 200, 228, 230, 214, 220, 222, 216, 214, 222, 212, 222, 216, 220, 230, 224, 200, 216, 216, 202, 222, 238, 200, 232, 212, 196, 232, 224, 202, 238, 206, 214, 212, 214, 212, 216, 232, 204, 210, 224, 202, 220, 212, 226, 212, 204, 234, 198, 216, 232, 176, 236, 240, 192, 212, 220, 202, 234, 210, 196, 236, 208, 210, 238, 210, 200, 216, 214, 214, 212, 218, 206, 232, 206, 204, 234, 214, 224, 212, 206, 232, 222, 208, 222, 206, 238, 202, 210, 220, 214, 214, 226, 212, 214, 226, 218, 198, 226, 216, 210, 252, 216, 210, 224, 196, 234, 216, 216, 218, 224, 206, 232, 206, 214, 226, 218, 228, 216, 228, 218, 210, 216, 220, 204, 226, 224, 224, 210, 220, 208, 224, 232, 216, 220, 246, 202, 208, 238, 190, 226, 226, 204, 232, 210, 218, 210, 226, 222, 220, 242, 212, 192, 236, 216, 220, 222, 212, 222, 224, 214, 220, 210, 224, 210, 228, 246, 192, 232, 216, 218, 222, 228, 212, 226, 218, 216, 206, 224, 216, 234, 214, 232, 210, 220, 198, 246, 218, 190, 258, 224, 198, 218, 218, 218, 216, 228, 218, 210, 230, 222, 190, 216, 240, 216, 220, 234, 220, 210, 210, 222, 218, 222, 212, 230, 208, 202, 240, 200, 206, 244}, + {238, 214, 200, 206, 220, 212, 226, 196, 222, 214, 212, 220, 200, 212, 214, 202, 228, 218, 198, 220, 212, 220, 190, 228, 204, 212, 206, 210, 212, 226, 198, 228, 198, 202, 210, 234, 196, 210, 220, 204, 228, 210, 216, 206, 218, 222, 200, 210, 228, 212, 204, 218, 208, 204, 220, 218, 208, 204, 216, 218, 214, 208, 214, 206, 202, 246, 204, 192, 232, 206, 222, 196, 204, 216, 226, 206, 198, 228, 228, 200, 228, 204, 228, 222, 200, 212, 216, 200, 218, 218, 226, 194, 202, 228, 210, 192, 234, 208, 216, 210, 208, 212, 236, 194, 202, 224, 214, 208, 218, 200, 210, 220, 196, 228, 224, 192, 220, 230, 204, 222, 194, 222, 206, 222, 208, 202, 220, 214, 206, 228, 200, 224, 218, 200, 206, 200, 228, 208, 208, 214, 204, 206, 232, 196, 208, 216, 182, 224, 226, 186, 224, 220, 188, 226, 214, 206, 228, 204, 216, 184, 220, 206, 210, 216, 186, 214, 226, 216, 204, 196, 220, 208, 210, 196, 212, 220, 202, 194, 222, 194, 202, 210, 216, 206, 218, 214, 194, 220, 200, 184, 236, 208, 194, 218, 214, 188, 218, 194, 218, 222, 194, 212, 222, 194, 218, 212, 198, 216, 196, 228, 208, 204, 198, 204, 218, 220, 200, 214, 192, 216, 196, 220, 204, 210, 226, 182, 218, 216, 206, 210, 200, 194, 234, 216, 188, 216, 228, 198, 206, 230, 208, 202, 208, 210, 226, 210, 204, 208, 214, 216, 208, 198, 224, 196, 220, 206, 210, 202, 242, 186, 212, 216, 200, 234, 216, 196, 198, 226, 210, 194, 220, 214, 222, 212, 200, 230, 224, 200, 234, 206, 204, 220, 210, 222, 202, 210, 218, 210, 216, 216, 208, 218, 216, 216, 202, 218, 188, 222, 208, 224, 210, 214, 202, 214, 208, 200, 228, 222, 196, 206, 206, 218, 238, 212, 202, 212, 202, 242, 208, 202, 224, 206, 202, 218, 204, 220, 196, 234, 210, 212, 226, 204, 218, 224, 190, 218, 212, 234, 202, 198, 224, 220, 206, 198, 202, 224, 238, 192, 220, 214, 214, 208, 228, 200, 212, 222, 214, 202, 230, 188}, + {214, 218, 218, 196, 208, 224, 204, 222, 194, 204, 216, 208, 190, 200, 218, 224, 206, 192, 226, 218, 202, 210, 218, 206, 218, 188, 190, 226, 194, 214, 206, 222, 198, 224, 198, 216, 230, 192, 214, 224, 202, 214, 194, 204, 222, 210, 218, 204, 208, 214, 206, 206, 220, 198, 204, 208, 212, 180, 224, 198, 222, 204, 198, 220, 214, 200, 200, 224, 204, 216, 210, 208, 212, 200, 196, 230, 204, 192, 228, 200, 202, 210, 202, 206, 230, 212, 178, 230, 218, 214, 202, 208, 214, 202, 204, 208, 192, 218, 216, 214, 188, 210, 196, 230, 206, 198, 218, 222, 192, 224, 200, 200, 218, 216, 188, 228, 218, 214, 202, 202, 216, 220, 202, 214, 218, 198, 204, 208, 202, 210, 200, 210, 210, 216, 208, 212, 212, 218, 206, 194, 218, 210, 208, 220, 210, 204, 222, 196, 202, 222, 194, 206, 230, 190, 202, 204, 198, 210, 218, 192, 200, 222, 208, 194, 214, 194, 206, 220, 184, 220, 194, 204, 216, 200, 194, 200, 210, 226, 194, 184, 240, 204, 194, 188, 208, 208, 218, 182, 202, 212, 200, 212, 210, 186, 216, 214, 186, 210, 216, 196, 210, 208, 184, 218, 208, 200, 214, 190, 216, 190, 212, 210, 204, 204, 210, 218, 188, 214, 214, 194, 208, 194, 206, 200, 196, 210, 220, 190, 204, 218, 206, 210, 198, 212, 222, 204, 188, 236, 208, 210, 208, 194, 216, 218, 194, 216, 218, 202, 208, 210, 218, 186, 220, 206, 210, 206, 198, 206, 188, 230, 210, 194, 218, 206, 192, 224, 214, 204, 222, 214, 198, 208, 192, 214, 216, 196, 200, 222, 212, 208, 224, 198, 224, 222, 194, 200, 204, 214, 198, 206, 200, 208, 208, 214, 202, 218, 212, 200, 222, 210, 194, 210, 206, 216, 188, 226, 200, 210, 218, 192, 204, 226, 204, 206, 234, 200, 210, 206, 200, 202, 212, 220, 210, 208, 204, 206, 208, 200, 214, 194, 222, 216, 202, 204, 216, 200, 232, 188, 222, 204, 208, 200, 234, 196, 222, 202, 192, 250, 186, 180, 234, 214, 204, 206, 200, 196, 214, 220, 176, 224}, + {204, 194, 238, 188, 214, 210, 206, 212, 192, 218, 216, 214, 204, 208, 212, 198, 214, 198, 212, 204, 202, 200, 204, 220, 208, 204, 202, 212, 212, 200, 232, 190, 214, 204, 200, 212, 200, 214, 204, 210, 204, 226, 202, 212, 216, 196, 202, 196, 212, 200, 208, 208, 198, 218, 208, 214, 208, 188, 226, 196, 222, 194, 198, 216, 214, 196, 198, 226, 200, 214, 206, 206, 218, 216, 202, 194, 220, 202, 204, 218, 202, 222, 188, 228, 204, 194, 226, 200, 206, 198, 226, 188, 222, 208, 204, 228, 188, 216, 202, 216, 218, 210, 200, 202, 220, 192, 206, 216, 188, 230, 182, 232, 210, 202, 210, 206, 202, 198, 230, 186, 222, 214, 194, 214, 200, 220, 206, 212, 216, 206, 212, 194, 218, 194, 212, 208, 196, 220, 208, 214, 194, 220, 200, 214, 202, 196, 226, 176, 226, 200, 198, 218, 194, 216, 202, 210, 210, 212, 196, 206, 236, 192, 192, 226, 202, 212, 198, 212, 204, 220, 198, 204, 208, 190, 224, 186, 210, 208, 198, 196, 200, 208, 206, 196, 200, 204, 202, 198, 216, 192, 206, 212, 220, 194, 190, 230, 188, 224, 192, 216, 200, 204, 214, 212, 190, 212, 208, 182, 204, 214, 186, 202, 204, 218, 188, 204, 210, 208, 198, 198, 212, 190, 208, 208, 186, 216, 198, 196, 210, 186, 232, 198, 200, 208, 222, 186, 208, 210, 198, 216, 198, 208, 208, 206, 206, 198, 214, 210, 216, 198, 192, 224, 194, 206, 208, 212, 194, 226, 200, 198, 204, 206, 236, 180, 210, 224, 192, 214, 208, 212, 196, 232, 188, 198, 234, 182, 220, 202, 204, 214, 196, 222, 202, 220, 202, 214, 212, 204, 218, 196, 228, 200, 214, 206, 200, 202, 200, 222, 188, 224, 210, 194, 220, 206, 220, 190, 210, 212, 208, 200, 206, 224, 178, 222, 212, 194, 220, 188, 228, 204, 222, 192, 216, 210, 192, 214, 204, 222, 206, 180, 228, 196, 228, 182, 232, 202, 210, 198, 204, 236, 174, 214, 208, 188, 210, 200, 216, 190, 220, 208, 194, 212, 208, 218, 194, 228, 206, 208, 220, 212}, + {182, 232, 186, 192, 206, 152, 240, 176, 186, 228, 148, 226, 178, 174, 228, 184, 194, 224, 172, 210, 220, 168, 216, 192, 214, 188, 194, 214, 152, 240, 196, 158, 236, 178, 216, 202, 174, 218, 194, 204, 204, 178, 216, 204, 154, 224, 196, 198, 214, 168, 216, 190, 196, 188, 190, 228, 172, 208, 212, 172, 234, 166, 198, 220, 178, 206, 212, 156, 234, 212, 160, 210, 196, 194, 200, 192, 216, 178, 240, 182, 178, 232, 162, 210, 206, 176, 218, 176, 212, 208, 182, 226, 182, 174, 246, 166, 208, 212, 158, 218, 192, 184, 198, 196, 214, 174, 212, 186, 196, 226, 174, 204, 212, 170, 222, 198, 194, 226, 186, 192, 212, 182, 214, 194, 200, 206, 174, 218, 186, 184, 224, 172, 196, 186, 200, 194, 188, 202, 194, 186, 218, 166, 204, 234, 152, 244, 178, 182, 236, 164, 218, 204, 186, 214, 176, 202, 204, 168, 216, 176, 208, 196, 180, 216, 188, 182, 212, 166, 216, 182, 190, 200, 168, 220, 180, 168, 222, 180, 198, 224, 154, 198, 216, 182, 200, 194, 200, 186, 198, 198, 176, 234, 192, 174, 226, 166, 194, 202, 164, 224, 178, 198, 190, 166, 226, 178, 178, 214, 180, 186, 204, 170, 204, 200, 176, 216, 166, 216, 188, 196, 186, 176, 234, 174, 190, 216, 158, 226, 208, 166, 212, 202, 176, 208, 180, 204, 200, 186, 208, 184, 214, 208, 160, 234, 182, 196, 190, 196, 208, 166, 206, 194, 180, 220, 172, 182, 230, 170, 226, 198, 164, 232, 180, 196, 214, 176, 222, 192, 176, 192, 198, 212, 184, 216, 190, 184, 230, 188, 194, 230, 176, 194, 214, 172, 214, 204, 186, 206, 168, 230, 188, 162, 252, 170, 202, 200, 186, 194, 198, 202, 174, 214, 200, 160, 214, 204, 186, 232, 182, 180, 236, 176, 216, 208, 180, 228, 192, 192, 198, 186, 214, 168, 210, 218, 174, 202, 192, 196, 202, 188, 194, 196, 184, 208, 174, 204, 202, 178, 234, 162, 198, 232, 164, 222, 206, 172, 228, 198, 198, 208, 198, 212, 182, 216, 188, 180, 210, 180, 192, 202}, + {188, 180, 190, 184, 188, 174, 196, 178, 190, 184, 184, 184, 190, 188, 170, 190, 184, 166, 190, 196, 170, 214, 168, 166, 198, 188, 212, 160, 178, 206, 166, 192, 174, 192, 188, 170, 192, 168, 188, 208, 168, 192, 186, 182, 188, 172, 202, 184, 178, 200, 166, 182, 196, 156, 172, 202, 168, 190, 186, 162, 212, 170, 202, 184, 186, 182, 184, 188, 186, 172, 208, 168, 178, 182, 168, 216, 164, 182, 208, 160, 210, 166, 192, 198, 168, 188, 168, 182, 210, 158, 202, 172, 190, 192, 164, 196, 196, 178, 190, 170, 200, 178, 190, 182, 182, 178, 200, 174, 180, 194, 170, 192, 186, 176, 204, 176, 184, 186, 182, 192, 170, 196, 186, 158, 222, 156, 192, 182, 178, 204, 170, 180, 200, 164, 202, 178, 182, 208, 166, 204, 174, 180, 208, 160, 200, 170, 186, 176, 180, 194, 176, 182, 200, 180, 184, 180, 174, 186, 180, 178, 188, 168, 168, 192, 176, 196, 180, 182, 194, 170, 186, 202, 176, 190, 170, 194, 176, 164, 194, 166, 194, 180, 170, 194, 184, 180, 174, 168, 220, 156, 176, 200, 158, 192, 176, 196, 184, 176, 186, 166, 186, 188, 166, 194, 172, 178, 186, 172, 192, 184, 174, 180, 182, 174, 186, 182, 180, 168, 182, 190, 174, 180, 188, 160, 202, 170, 182, 192, 148, 210, 184, 166, 204, 156, 188, 172, 180, 198, 166, 190, 180, 178, 214, 164, 194, 172, 176, 190, 170, 196, 184, 168, 186, 168, 182, 192, 188, 178, 192, 180, 184, 182, 186, 194, 184, 186, 180, 176, 206, 170, 182, 196, 172, 208, 166, 184, 196, 154, 224, 174, 182, 202, 138, 200, 170, 180, 216, 170, 180, 194, 178, 190, 166, 208, 176, 174, 202, 164, 210, 170, 182, 188, 176, 190, 190, 170, 184, 190, 176, 192, 182, 160, 202, 188, 180, 200, 168, 190, 196, 176, 186, 176, 206, 170, 184, 176, 172, 210, 182, 182, 200, 156, 208, 182, 172, 214, 156, 210, 182, 172, 186, 180, 188, 172, 182, 188, 178, 202, 160, 182, 214, 172, 184, 176, 164, 196, 192, 184, 196, 164}, + {198, 154, 172, 186, 152, 160, 180, 170, 180, 162, 178, 182, 162, 176, 182, 148, 180, 190, 162, 166, 170, 174, 164, 180, 166, 158, 180, 172, 160, 180, 160, 180, 162, 184, 164, 154, 174, 176, 150, 194, 170, 170, 168, 170, 166, 194, 158, 162, 170, 182, 166, 168, 176, 180, 172, 160, 174, 188, 148, 192, 154, 160, 184, 160, 162, 172, 164, 182, 168, 156, 180, 158, 176, 182, 166, 168, 176, 164, 182, 148, 194, 148, 186, 148, 176, 186, 148, 170, 192, 160, 194, 160, 160, 190, 168, 168, 162, 164, 178, 172, 168, 156, 178, 172, 164, 172, 168, 174, 176, 144, 164, 206, 152, 168, 164, 170, 188, 178, 148, 192, 166, 186, 162, 176, 164, 176, 176, 174, 162, 180, 158, 178, 156, 174, 172, 158, 176, 170, 164, 188, 160, 150, 184, 164, 168, 170, 168, 168, 156, 164, 188, 150, 176, 166, 162, 180, 180, 158, 164, 174, 180, 156, 182, 162, 166, 170, 164, 172, 166, 164, 182, 156, 168, 168, 150, 176, 190, 142, 186, 172, 168, 168, 170, 160, 164, 162, 166, 154, 186, 154, 162, 192, 160, 174, 156, 188, 154, 152, 178, 174, 160, 180, 142, 178, 178, 152, 174, 172, 154, 182, 152, 174, 168, 174, 166, 170, 166, 168, 156, 178, 148, 180, 160, 170, 162, 164, 158, 180, 156, 166, 158, 166, 164, 160, 192, 158, 154, 182, 168, 152, 186, 158, 180, 174, 180, 160, 158, 168, 162, 180, 168, 162, 178, 154, 172, 174, 174, 168, 172, 146, 192, 168, 146, 176, 170, 152, 194, 156, 172, 160, 188, 154, 174, 182, 168, 164, 166, 166, 188, 154, 188, 154, 172, 194, 164, 172, 184, 162, 180, 184, 156, 178, 182, 156, 168, 168, 176, 168, 170, 176, 164, 184, 142, 184, 170, 168, 166, 144, 168, 196, 142, 184, 178, 156, 186, 180, 152, 188, 164, 164, 176, 166, 196, 158, 164, 172, 166, 168, 172, 166, 156, 196, 166, 142, 182, 180, 156, 196, 160, 154, 194, 144, 174, 182, 164, 168, 180, 150, 184, 166, 164, 182, 152, 180, 180, 158, 166, 172, 176, 156}, + {142, 148, 148, 150, 144, 140, 134, 158, 142, 148, 134, 142, 134, 150, 140, 146, 150, 128, 158, 146, 144, 134, 160, 146, 140, 162, 142, 144, 136, 164, 134, 148, 160, 144, 154, 142, 144, 138, 148, 162, 124, 168, 138, 146, 154, 146, 132, 146, 176, 120, 142, 150, 144, 146, 138, 154, 126, 144, 150, 140, 156, 150, 150, 132, 154, 160, 136, 158, 144, 152, 150, 150, 138, 158, 154, 140, 154, 134, 170, 128, 154, 152, 124, 174, 130, 146, 146, 142, 158, 118, 162, 138, 152, 148, 136, 146, 150, 144, 128, 154, 158, 140, 142, 146, 140, 126, 154, 156, 132, 170, 140, 138, 150, 162, 142, 126, 168, 150, 150, 148, 152, 132, 160, 140, 138, 154, 146, 152, 128, 162, 144, 122, 166, 140, 140, 156, 140, 146, 150, 158, 128, 150, 142, 148, 134, 168, 158, 124, 166, 150, 140, 142, 150, 148, 130, 158, 144, 158, 144, 138, 134, 166, 144, 134, 164, 138, 140, 146, 142, 158, 130, 162, 126, 136, 150, 146, 146, 144, 148, 112, 162, 138, 136, 146, 158, 144, 128, 164, 152, 128, 148, 146, 144, 138, 152, 136, 142, 154, 134, 140, 156, 140, 136, 150, 142, 130, 150, 144, 134, 132, 150, 148, 138, 136, 144, 152, 128, 146, 152, 136, 144, 136, 154, 142, 142, 138, 144, 170, 128, 154, 156, 140, 148, 142, 150, 130, 162, 154, 126, 154, 144, 150, 154, 140, 130, 160, 152, 130, 140, 152, 152, 126, 150, 138, 148, 148, 148, 148, 126, 158, 140, 140, 170, 152, 144, 148, 150, 134, 160, 144, 136, 166, 144, 138, 134, 148, 158, 134, 162, 150, 138, 148, 144, 138, 142, 160, 132, 128, 160, 148, 142, 148, 160, 124, 180, 132, 122, 158, 134, 160, 130, 158, 134, 140, 140, 140, 146, 168, 152, 120, 166, 154, 124, 170, 138, 154, 148, 148, 142, 134, 172, 134, 150, 158, 132, 158, 138, 162, 134, 142, 150, 152, 140, 152, 142, 120, 176, 148, 122, 156, 146, 144, 128, 160, 132, 144, 164, 152, 140, 156, 162, 138, 148, 152, 130, 156, 158, 138, 124, 174}, + {122, 132, 134, 132, 110, 130, 138, 114, 142, 106, 108, 148, 102, 138, 110, 124, 158, 98, 130, 140, 112, 142, 112, 138, 118, 112, 118, 114, 134, 132, 116, 108, 134, 104, 152, 104, 128, 134, 112, 152, 98, 130, 152, 112, 136, 98, 130, 142, 102, 116, 132, 122, 136, 104, 136, 132, 118, 136, 116, 96, 164, 102, 128, 114, 126, 136, 90, 138, 126, 116, 152, 92, 128, 140, 114, 132, 126, 132, 132, 104, 132, 128, 114, 140, 120, 104, 134, 108, 148, 120, 130, 144, 102, 144, 104, 136, 142, 106, 120, 134, 108, 136, 102, 140, 126, 112, 124, 132, 112, 158, 104, 132, 118, 116, 138, 116, 126, 138, 120, 130, 106, 156, 114, 110, 148, 108, 132, 122, 118, 150, 98, 138, 122, 112, 138, 128, 112, 126, 110, 144, 116, 118, 136, 124, 132, 114, 130, 122, 120, 114, 118, 122, 144, 110, 116, 136, 94, 144, 112, 118, 128, 124, 122, 130, 108, 158, 104, 118, 138, 116, 142, 112, 116, 132, 112, 128, 108, 128, 136, 114, 126, 128, 100, 152, 100, 136, 124, 104, 132, 114, 124, 144, 98, 132, 112, 126, 138, 114, 106, 144, 120, 138, 110, 132, 130, 100, 138, 110, 106, 150, 98, 132, 114, 126, 146, 92, 120, 148, 96, 140, 110, 112, 142, 100, 124, 112, 122, 128, 114, 118, 118, 120, 150, 94, 130, 128, 116, 130, 122, 130, 142, 94, 136, 124, 100, 146, 112, 112, 138, 112, 148, 110, 114, 132, 108, 134, 126, 116, 130, 122, 124, 106, 128, 126, 98, 140, 118, 112, 150, 108, 112, 150, 100, 136, 132, 128, 128, 116, 124, 132, 112, 138, 112, 134, 120, 122, 134, 108, 150, 120, 116, 136, 120, 122, 142, 110, 118, 130, 114, 136, 114, 124, 132, 110, 136, 118, 124, 138, 114, 132, 116, 122, 140, 108, 138, 116, 122, 120, 128, 132, 128, 108, 138, 118, 126, 130, 112, 154, 114, 114, 130, 110, 138, 116, 118, 130, 118, 138, 112, 116, 134, 116, 140, 98, 138, 130, 112, 122, 122, 120, 132, 126, 120, 136, 102, 130, 128, 116, 124, 122}, + {94, 130, 102, 94, 88, 104, 120, 88, 110, 86, 122, 114, 88, 70, 138, 112, 80, 104, 96, 106, 118, 82, 96, 110, 116, 92, 86, 114, 104, 112, 84, 102, 114, 96, 106, 82, 102, 136, 98, 70, 114, 116, 102, 98, 94, 110, 108, 112, 82, 102, 112, 108, 84, 100, 122, 94, 88, 112, 94, 110, 106, 76, 98, 128, 98, 78, 106, 92, 122, 100, 94, 102, 112, 92, 90, 98, 120, 108, 106, 90, 118, 102, 106, 92, 100, 126, 106, 76, 110, 112, 108, 90, 90, 114, 110, 90, 110, 86, 112, 102, 90, 92, 118, 116, 78, 110, 100, 108, 104, 82, 92, 132, 110, 72, 102, 94, 122, 108, 102, 108, 100, 110, 104, 88, 126, 98, 92, 90, 108, 112, 94, 92, 90, 112, 108, 92, 92, 122, 98, 96, 86, 106, 126, 86, 88, 110, 94, 116, 92, 74, 114, 124, 88, 94, 110, 104, 100, 94, 94, 118, 100, 98, 78, 124, 102, 100, 88, 100, 98, 108, 100, 98, 100, 116, 92, 82, 118, 110, 98, 94, 96, 100, 112, 84, 94, 108, 110, 108, 82, 92, 114, 116, 82, 104, 102, 110, 106, 82, 98, 124, 92, 88, 100, 98, 106, 108, 94, 92, 110, 116, 74, 80, 130, 112, 80, 94, 104, 100, 90, 108, 74, 116, 108, 76, 86, 130, 98, 86, 98, 94, 114, 88, 90, 96, 114, 102, 94, 88, 112, 118, 86, 90, 110, 110, 106, 114, 68, 116, 116, 90, 86, 90, 122, 92, 96, 102, 102, 102, 102, 90, 110, 116, 90, 94, 102, 100, 104, 102, 94, 104, 118, 94, 84, 118, 106, 94, 106, 102, 116, 108, 90, 106, 98, 110, 112, 80, 114, 116, 92, 98, 86, 108, 116, 86, 104, 94, 108, 94, 88, 108, 112, 104, 86, 110, 100, 100, 100, 98, 84, 132, 102, 64, 116, 112, 108, 96, 108, 106, 106, 94, 110, 88, 120, 98, 86, 102, 112, 104, 94, 96, 90, 116, 110, 88, 96, 142, 82, 92, 94, 110, 118, 90, 98, 90, 114, 96, 86, 98, 120, 124, 66, 100, 120, 108, 90, 86, 110, 102, 114, 84}, + {88, 86, 78, 82, 66, 90, 76, 80, 76, 86, 56, 88, 70, 84, 94, 70, 82, 74, 90, 92, 66, 82, 90, 60, 100, 62, 78, 82, 76, 76, 80, 82, 80, 70, 82, 80, 78, 70, 68, 88, 84, 84, 74, 68, 78, 88, 70, 84, 92, 72, 78, 72, 82, 80, 76, 84, 72, 88, 74, 80, 80, 86, 88, 74, 70, 70, 70, 98, 80, 66, 90, 68, 80, 84, 64, 86, 74, 76, 76, 76, 86, 70, 78, 88, 80, 66, 76, 70, 94, 90, 68, 76, 66, 100, 80, 80, 82, 76, 90, 74, 64, 90, 72, 86, 60, 86, 88, 78, 76, 74, 82, 78, 68, 84, 84, 82, 86, 70, 66, 94, 66, 98, 74, 86, 78, 72, 88, 74, 78, 90, 70, 76, 90, 72, 72, 76, 90, 96, 68, 64, 78, 80, 88, 78, 76, 84, 64, 98, 66, 78, 92, 60, 88, 80, 76, 78, 68, 76, 86, 74, 66, 84, 70, 82, 98, 76, 68, 74, 84, 86, 78, 86, 60, 80, 80, 68, 80, 86, 70, 70, 86, 86, 66, 78, 84, 74, 88, 62, 64, 84, 92, 78, 78, 64, 76, 76, 80, 62, 86, 70, 68, 88, 76, 88, 68, 68, 82, 82, 56, 80, 76, 86, 84, 72, 72, 80, 76, 88, 74, 74, 84, 74, 92, 60, 78, 74, 76, 80, 80, 78, 82, 64, 86, 74, 62, 80, 60, 94, 88, 68, 86, 62, 86, 76, 72, 86, 88, 60, 80, 80, 86, 66, 80, 78, 80, 90, 72, 82, 74, 90, 70, 82, 64, 68, 84, 78, 86, 70, 82, 72, 70, 90, 68, 80, 64, 86, 74, 84, 90, 64, 80, 76, 84, 72, 66, 84, 100, 76, 74, 76, 72, 96, 78, 68, 88, 74, 86, 72, 76, 82, 82, 70, 70, 80, 90, 76, 70, 92, 72, 86, 64, 76, 90, 82, 96, 64, 70, 86, 66, 84, 84, 90, 62, 84, 66, 92, 92, 70, 74, 72, 84, 78, 80, 80, 68, 92, 76, 70, 78, 86, 80, 66, 90, 80, 74, 92, 80, 68, 96, 62, 72, 94, 70, 92, 70, 74, 82, 72, 78, 62}, + {62, 62, 58, 46, 68, 50, 78, 58, 50, 52, 66, 42, 66, 38, 84, 54, 48, 50, 58, 60, 60, 52, 70, 64, 58, 48, 54, 68, 60, 54, 58, 54, 64, 74, 50, 60, 54, 68, 50, 52, 62, 66, 64, 60, 50, 70, 48, 60, 52, 66, 62, 46, 44, 62, 68, 64, 44, 46, 66, 54, 64, 60, 52, 74, 46, 50, 58, 56, 70, 54, 62, 74, 52, 48, 66, 62, 60, 56, 52, 66, 56, 76, 58, 54, 48, 62, 50, 56, 56, 80, 34, 76, 48, 50, 64, 60, 48, 62, 64, 56, 44, 64, 58, 68, 44, 46, 58, 70, 62, 66, 56, 72, 52, 42, 68, 68, 60, 54, 62, 62, 60, 40, 68, 56, 62, 60, 44, 64, 62, 58, 66, 54, 48, 66, 52, 64, 50, 72, 56, 52, 58, 50, 60, 68, 36, 74, 62, 48, 50, 56, 70, 62, 46, 58, 62, 72, 58, 60, 52, 60, 44, 62, 52, 64, 60, 54, 64, 56, 54, 54, 52, 66, 60, 52, 50, 44, 70, 66, 50, 52, 44, 60, 72, 56, 62, 54, 66, 48, 50, 66, 64, 62, 46, 68, 58, 60, 50, 70, 52, 72, 46, 54, 56, 62, 70, 62, 38, 56, 62, 34, 72, 50, 70, 50, 56, 50, 52, 60, 58, 46, 62, 68, 56, 40, 64, 56, 54, 46, 62, 50, 78, 62, 50, 70, 56, 48, 52, 56, 64, 66, 48, 62, 48, 72, 52, 54, 56, 74, 50, 40, 48, 76, 46, 68, 32, 58, 68, 50, 58, 64, 58, 54, 56, 56, 58, 58, 64, 42, 60, 68, 66, 42, 66, 56, 64, 50, 70, 60, 62, 66, 64, 46, 64, 46, 58, 62, 56, 66, 52, 56, 64, 56, 62, 54, 52, 60, 58, 52, 36, 82, 56, 58, 50, 48, 60, 68, 50, 70, 54, 66, 50, 54, 66, 64, 58, 54, 62, 66, 68, 44, 68, 58, 60, 48, 50, 54, 80, 42, 74, 44, 52, 60, 58, 62, 56, 70, 56, 42, 68, 52, 56, 64, 46, 66, 54, 58, 60, 54, 68, 56, 46, 66, 62, 66, 56, 58, 58, 54, 50, 64}, + {54, 44, 30, 26, 40, 50, 34, 38, 36, 32, 38, 42, 38, 42, 54, 18, 40, 38, 28, 48, 46, 22, 52, 32, 38, 38, 32, 44, 38, 28, 34, 42, 44, 36, 48, 28, 34, 36, 30, 50, 50, 34, 30, 38, 32, 38, 32, 44, 40, 40, 36, 36, 28, 48, 42, 34, 42, 18, 44, 46, 44, 38, 36, 34, 34, 30, 32, 54, 42, 24, 42, 34, 36, 42, 32, 44, 32, 40, 28, 42, 46, 36, 40, 30, 40, 38, 36, 44, 40, 48, 24, 38, 36, 42, 36, 48, 26, 40, 38, 34, 40, 36, 38, 42, 28, 36, 38, 42, 38, 42, 32, 36, 30, 36, 44, 44, 36, 42, 32, 38, 40, 40, 42, 38, 44, 34, 26, 38, 50, 36, 36, 34, 30, 40, 46, 34, 46, 40, 22, 36, 34, 38, 44, 36, 24, 46, 38, 42, 42, 28, 40, 32, 36, 38, 38, 50, 34, 38, 28, 30, 40, 42, 34, 56, 34, 30, 32, 38, 46, 34, 38, 32, 46, 34, 28, 44, 44, 36, 34, 32, 28, 54, 36, 38, 42, 28, 38, 32, 34, 48, 40, 36, 30, 34, 42, 32, 44, 36, 36, 40, 30, 28, 44, 46, 34, 34, 32, 34, 42, 38, 38, 50, 34, 26, 32, 42, 36, 40, 32, 34, 46, 28, 48, 42, 30, 36, 34, 32, 38, 40, 42, 34, 38, 30, 38, 32, 42, 42, 50, 34, 32, 32, 50, 32, 44, 36, 32, 36, 32, 42, 38, 54, 34, 32, 40, 28, 48, 52, 28, 44, 38, 24, 38, 38, 38, 42, 36, 30, 38, 44, 30, 50, 36, 34, 42, 26, 48, 42, 36, 36, 36, 36, 36, 40, 32, 50, 46, 36, 32, 24, 52, 38, 44, 28, 36, 48, 36, 38, 36, 50, 24, 34, 40, 26, 52, 36, 32, 46, 26, 40, 40, 34, 46, 44, 38, 28, 40, 42, 38, 42, 28, 34, 42, 36, 36, 52, 44, 32, 36, 36, 40, 38, 48, 28, 38, 28, 30, 38, 46, 38, 34, 26, 34, 44, 38, 40, 52, 30, 30, 34, 28, 50, 42, 44, 32, 30, 42, 38, 40, 30}, + {38, 24, 30, 18, 40, 28, 30, 26, 24, 24, 34, 22, 36, 20, 32, 24, 22, 28, 44, 32, 18, 22, 26, 34, 28, 32, 30, 24, 24, 20, 26, 38, 44, 20, 24, 26, 28, 30, 34, 24, 38, 34, 28, 20, 30, 30, 46, 24, 38, 16, 32, 24, 34, 20, 34, 18, 20, 36, 14, 34, 32, 32, 24, 26, 36, 28, 34, 22, 22, 34, 26, 32, 24, 28, 28, 34, 34, 30, 24, 34, 34, 30, 22, 30, 30, 28, 32, 34, 22, 24, 34, 24, 24, 54, 22, 24, 26, 24, 22, 34, 26, 26, 30, 16, 32, 22, 26, 40, 36, 14, 38, 30, 30, 18, 40, 30, 32, 28, 32, 24, 34, 32, 40, 26, 28, 28, 26, 30, 36, 28, 16, 22, 32, 34, 24, 30, 26, 32, 22, 34, 32, 32, 22, 22, 26, 22, 36, 24, 28, 26, 30, 26, 30, 32, 36, 32, 20, 36, 20, 30, 18, 46, 32, 22, 20, 34, 28, 26, 38, 40, 12, 36, 18, 30, 26, 30, 20, 24, 24, 20, 34, 38, 22, 30, 24, 26, 36, 24, 22, 30, 40, 22, 24, 26, 26, 38, 24, 34, 24, 34, 34, 18, 28, 40, 28, 20, 28, 24, 34, 40, 26, 14, 36, 24, 30, 36, 32, 14, 28, 22, 22, 20, 38, 30, 24, 24, 22, 24, 32, 36, 34, 20, 28, 34, 16, 22, 32, 40, 22, 32, 20, 36, 30, 34, 30, 26, 30, 40, 20, 24, 28, 30, 20, 20, 24, 38, 30, 32, 20, 18, 28, 40, 30, 20, 26, 20, 32, 18, 24, 34, 34, 28, 24, 28, 32, 42, 24, 20, 28, 42, 26, 16, 34, 28, 36, 38, 22, 22, 28, 40, 28, 40, 16, 24, 36, 16, 22, 32, 24, 26, 24, 18, 32, 38, 30, 14, 30, 26, 38, 22, 22, 28, 38, 30, 26, 34, 40, 32, 26, 32, 22, 32, 32, 28, 26, 34, 24, 28, 16, 22, 30, 40, 36, 28, 16, 42, 22, 34, 26, 30, 16, 26, 28, 18, 32, 36, 22, 32, 26, 34, 28, 30, 24, 30, 34, 26, 20, 22, 32, 32}, + {8, 16, 8, 20, 14, 8, 18, 12, 10, 18, 16, 20, 14, 10, 4, 20, 12, 10, 20, 8, 16, 12, 16, 8, 28, 12, 8, 14, 18, 10, 14, 10, 22, 12, 10, 14, 8, 18, 10, 18, 22, 18, 12, 10, 14, 10, 10, 10, 20, 10, 20, 16, 4, 16, 10, 22, 14, 14, 16, 8, 14, 12, 16, 22, 6, 12, 8, 14, 18, 18, 18, 14, 8, 20, 10, 6, 22, 12, 8, 16, 18, 12, 12, 8, 14, 18, 20, 16, 10, 16, 16, 8, 4, 14, 28, 8, 12, 12, 14, 16, 16, 18, 16, 10, 14, 10, 12, 10, 20, 10, 16, 8, 10, 16, 12, 20, 18, 10, 18, 8, 12, 14, 16, 12, 16, 16, 22, 10, 10, 22, 12, 6, 24, 16, 12, 8, 6, 16, 20, 14, 12, 14, 10, 18, 18, 8, 16, 18, 16, 10, 12, 12, 10, 12, 14, 14, 12, 16, 10, 16, 12, 22, 10, 10, 26, 8, 14, 10, 6, 16, 24, 12, 12, 14, 14, 12, 12, 22, 10, 18, 4, 16, 6, 18, 18, 10, 12, 14, 10, 16, 20, 22, 10, 10, 14, 14, 22, 8, 6, 20, 10, 16, 24, 10, 16, 14, 6, 8, 28, 8, 14, 8, 12, 14, 12, 12, 18, 14, 12, 18, 16, 2, 26, 14, 8, 18, 8, 14, 6, 16, 14, 24, 8, 20, 10, 14, 20, 6, 18, 16, 10, 16, 8, 14, 10, 8, 22, 10, 20, 14, 20, 12, 12, 8, 16, 18, 14, 6, 14, 14, 10, 10, 22, 6, 20, 18, 18, 14, 12, 14, 16, 12, 12, 8, 14, 14, 2, 18, 24, 22, 6, 10, 16, 18, 18, 4, 14, 20, 14, 10, 2, 26, 12, 12, 22, 14, 18, 8, 12, 14, 18, 16, 10, 10, 8, 16, 8, 16, 18, 12, 12, 16, 10, 20, 12, 18, 12, 10, 14, 18, 4, 10, 16, 26, 16, 18, 14, 18, 10, 6, 12, 26, 6, 14, 14, 10, 16, 8, 10, 24, 18, 16, 8, 16, 6, 16, 18, 8, 12, 14, 8, 14, 16, 24, 18, 10, 10, 14, 14, 18}, + {6, 4, 8, 4, 4, 8, 6, 6, 8, 6, 8, 6, 0, 6, 4, 10, 6, 6, 2, 4, 4, 18, 4, 8, 14, 8, 0, 0, 4, 8, 6, 10, 0, 4, 6, 4, 6, 0, 4, 4, 8, 0, 4, 8, 10, 2, 4, 4, 8, 6, 8, 0, 0, 16, 6, 4, 4, 6, 4, 4, 12, 4, 12, 6, 2, 8, 2, 6, 8, 10, 2, 6, 0, 2, 6, 6, 4, 2, 12, 0, 0, 6, 6, 6, 4, 2, 12, 6, 2, 6, 12, 4, 8, 6, 6, 6, 0, 8, 2, 10, 6, 10, 6, 6, 8, 4, 10, 6, 2, 2, 6, 6, 4, 2, 4, 8, 4, 6, 8, 4, 4, 6, 2, 4, 6, 4, 4, 8, 4, 4, 12, 6, 6, 2, 6, 4, 10, 6, 2, 6, 10, 0, 10, 0, 8, 12, 6, 6, 4, 2, 8, 6, 2, 8, 8, 2, 2, 4, 2, 0, 6, 4, 8, 2, 6, 6, 0, 6, 6, 10, 8, 0, 4, 4, 4, 8, 6, 14, 6, 6, 6, 0, 8, 14, 6, 0, 2, 8, 2, 4, 2, 4, 8, 8, 4, 2, 10, 6, 0, 10, 2, 4, 0, 4, 0, 8, 2, 8, 10, 4, 8, 12, 0, 2, 12, 4, 4, 6, 2, 2, 8, 6, 4, 10, 10, 8, 6, 6, 0, 6, 10, 4, 0, 4, 4, 2, 2, 2, 10, 8, 4, 6, 2, 0, 2, 8, 6, 2, 10, 2, 6, 6, 6, 12, 2, 4, 2, 4, 6, 10, 6, 8, 6, 6, 6, 2, 14, 2, 8, 4, 6, 4, 6, 2, 2, 6, 4, 4, 2, 2, 6, 0, 6, 6, 8, 12, 8, 4, 4, 6, 6, 4, 8, 2, 2, 10, 6, 8, 8, 10, 2, 6, 6, 4, 4, 10, 8, 2, 8, 4, 4, 2, 4, 4, 10, 4, 4, 4, 2, 4, 2, 4, 2, 4, 6, 2, 8, 8, 8, 10, 10, 2, 0, 6, 8, 0, 10, 6, 6, 6, 6, 0, 6, 4, 10, 12, 6, 4, 2, 2, 6, 4, 6, 6, 6, 8, 0, 4, 0, 4} + } +} diff --git a/dap4/src/test/data/resources/baselinehyrax/amsre_20060131v5.dat.ncdump b/dap4/src/test/data/resources/baselinehyrax/amsre_20060131v5.dat.ncdump new file mode 100644 index 0000000000..8f3cecf7d4 --- /dev/null +++ b/dap4/src/test/data/resources/baselinehyrax/amsre_20060131v5.dat.ncdump @@ -0,0 +1,32 @@ +netcdf amsre_20060131v5.dat { + variables: + ubyte time_a(3, 6); + string time_a:Equator_Crossing_Time = "1:30 PM"; + + // global attributes: + string :wspd_d.description = "wind speed 10 meters above the water surface, derived from surface roughness(wind stress); missing due to: sun glint; rain; near sea ice"; + string :FF_GLOBAL.latitude = "latitude = 0.25*ydim-90.125"; + string :wspd_a.pass = "ascending"; + :wspd_d.offset = 0.0f; + string :FF_GLOBAL.Server = "DODS FreeFrom based on FFND release 4.2.3", "DODS FreeFrom based on FFND release 4.2.3"; + string :wspd_a.long_name = "Surface Wind Speed"; + string :wspd_d.pass = "descending"; + string :wspd_a.units = "meters/second"; + :wspd_a.offset = 0.0f; + string :FF_GLOBAL.longitude = "longitude = 0.25*xdim-0.125 degreesEast"; + :wspd_a.scale = 0.2f; + string :FF_GLOBAL.Description = "Version-5 AMSR-E Ocean Product"; + string :wspd_a.description = "wind speed 10 meters above the water surface, derived from surface roughness(wind stress); missing due to: sun glint; rain; near sea ice"; + string :wspd_d.units = "meters/second"; + :wspd_d.scale = 0.2f; + string :wspd_d.long_name = "Surface Wind Speed"; + string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; + + data: + time_a = + { + {255, 255, 255, 255, 255, 255}, + {255, 255, 255, 255, 255, 255}, + {255, 255, 255, 255, 255, 255} + } +} diff --git a/dap4/src/test/data/resources/baselinehyrax/nc4_nc_classic_comp.nc.ncdump b/dap4/src/test/data/resources/baselinehyrax/nc4_nc_classic_comp.nc.ncdump new file mode 100644 index 0000000000..984a9461d3 --- /dev/null +++ b/dap4/src/test/data/resources/baselinehyrax/nc4_nc_classic_comp.nc.ncdump @@ -0,0 +1,137 @@ +netcdf nc4_nc_classic_comp { + dimensions: + lat = 6; + lon = 5; + time = 2; + variables: + float t(time, lat, lon); + + double p(time, lat, lon); + p:_FillValue = -9999.0; + + short rh(time, lat, lon); + rh:_FillValue = -1S; + + short pixel(lat, lon); + + string source(lat); + source:string_length = 5; + + int lat(lat); + string lat:units = "degrees_north"; + string lat:_CoordinateAxisType = "Lat"; + + int lon(lon); + string lon:units = "degrees_east"; + string lon:_CoordinateAxisType = "Lon"; + + int time(time); + string time:units = "seconds"; + + float z(time, lat, lon); + z:valid_range = 0.0, 5000.0; + z:_FillValue = 1.0f; + string z:units = "meters"; + string z:_CoordinateAxisType = "Height"; + + // global attributes: + string :NC_GLOBAL.title = "Hyrax/netcdf handler test file 1"; + :NC_GLOBAL.version = 1.0; + string :NC_GLOBAL.description = "This file has all of the NC_CLASSIC_MODEL data types."; + string :DODS_EXTRA.Unlimited_Dimension = "time"; + string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; + + data: + t = + { + { + {1.0, 1.0, 1.0, 1.0, 1.0}, + {1.0, 1.0, 1.0, 1.0, 1.0}, + {1.0, 1.0, 1.0, 1.0, 1.0}, + {1.0, 1.0, 1.0, 1.0, 1.0}, + {1.0, 1.0, 1.0, 1.0, 1.0}, + {1.0, 1.0, 1.0, 1.0, 1.0} + }, + { + {1.0, 1.0, 1.0, 1.0, 1.0}, + {1.0, 1.0, 1.0, 1.0, 1.0}, + {1.0, 1.0, 1.0, 1.0, 1.0}, + {1.0, 1.0, 1.0, 1.0, 1.0}, + {1.0, 1.0, 1.0, 1.0, 1.0}, + {1.0, 1.0, 1.0, 1.0, 1.0} + } + } + p = + { + { + {0.1, 0.1, 0.1, 0.1, 0.1}, + {0.1, 0.1, 0.1, 0.1, 0.1}, + {0.1, 0.1, 0.1, 0.1, 0.1}, + {0.1, 0.1, 0.1, 0.1, 0.1}, + {0.1, 0.1, 0.1, 0.1, 0.1}, + {0.1, 0.1, 0.1, 0.1, 0.1} + }, + { + {0.1, 0.1, 0.1, 0.1, 0.1}, + {0.1, 0.1, 0.1, 0.1, 0.1}, + {0.1, 0.1, 0.1, 0.1, 0.1}, + {0.1, 0.1, 0.1, 0.1, 0.1}, + {0.1, 0.1, 0.1, 0.1, 0.1}, + {0.1, 0.1, 0.1, 0.1, 0.1} + } + } + rh = + { + { + {2, 2, 2, 2, 2}, + {2, 2, 2, 2, 2}, + {2, 2, 2, 2, 2}, + {2, 2, 2, 2, 2}, + {2, 2, 2, 2, 2}, + {2, 2, 2, 2, 2} + }, + { + {2, 2, 2, 2, 2}, + {2, 2, 2, 2, 2}, + {2, 2, 2, 2, 2}, + {2, 2, 2, 2, 2}, + {2, 2, 2, 2, 2}, + {2, 2, 2, 2, 2} + } + } + pixel = + { + {7, 7, 7, 7, 7}, + {7, 7, 7, 7, 7}, + {7, 7, 7, 7, 7}, + {7, 7, 7, 7, 7}, + {7, 7, 7, 7, 7}, + {7, 7, 7, 7, 7} + } + source = "aaaaa", "aaaaa", "aaaaa", "aaaaa", "aaaaa", "aaaaa" + lat = + {0, 10, 20, 30, 40, 50} + lon = + {-140, -118, -96, -84, -52} + time = + {1, 2} + z = + { + { + {10.0, 10.0, 10.0, 10.0, 10.0}, + {10.0, 10.0, 10.0, 10.0, 10.0}, + {10.0, 10.0, 10.0, 10.0, 10.0}, + {10.0, 10.0, 10.0, 10.0, 10.0}, + {10.0, 10.0, 10.0, 10.0, 10.0}, + {10.0, 10.0, 10.0, 10.0, 10.0} + }, + { + {10.0, 10.0, 10.0, 10.0, 10.0}, + {10.0, 10.0, 10.0, 10.0, 10.0}, + {10.0, 10.0, 10.0, 10.0, 10.0}, + {10.0, 10.0, 10.0, 10.0, 10.0}, + {10.0, 10.0, 10.0, 10.0, 10.0}, + {10.0, 10.0, 10.0, 10.0, 10.0} + } + } +} diff --git a/dap4/src/test/data/resources/baselinehyrax/nc4_nc_classic_no_comp.nc.ncdump b/dap4/src/test/data/resources/baselinehyrax/nc4_nc_classic_no_comp.nc.ncdump new file mode 100644 index 0000000000..83d2544aa0 --- /dev/null +++ b/dap4/src/test/data/resources/baselinehyrax/nc4_nc_classic_no_comp.nc.ncdump @@ -0,0 +1,137 @@ +netcdf nc4_nc_classic_no_comp { + dimensions: + lat = 6; + lon = 5; + time = 2; + variables: + float t(time, lat, lon); + + double p(time, lat, lon); + p:_FillValue = -9999.0; + + short rh(time, lat, lon); + rh:_FillValue = -1S; + + short pixel(lat, lon); + + string source(lat); + source:string_length = 5; + + int lat(lat); + string lat:units = "degrees_north"; + string lat:_CoordinateAxisType = "Lat"; + + int lon(lon); + string lon:units = "degrees_east"; + string lon:_CoordinateAxisType = "Lon"; + + int time(time); + string time:units = "seconds"; + + float z(time, lat, lon); + z:valid_range = 0.0, 5000.0; + z:_FillValue = 1.0f; + string z:units = "meters"; + string z:_CoordinateAxisType = "Height"; + + // global attributes: + string :NC_GLOBAL.title = "Hyrax/netcdf handler test file 1"; + :NC_GLOBAL.version = 1.0; + string :NC_GLOBAL.description = "This file has all of the NC_CLASSIC_MODEL data types."; + string :DODS_EXTRA.Unlimited_Dimension = "time"; + string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; + + data: + t = + { + { + {1.0, 1.0, 1.0, 1.0, 1.0}, + {1.0, 1.0, 1.0, 1.0, 1.0}, + {1.0, 1.0, 1.0, 1.0, 1.0}, + {1.0, 1.0, 1.0, 1.0, 1.0}, + {1.0, 1.0, 1.0, 1.0, 1.0}, + {1.0, 1.0, 1.0, 1.0, 1.0} + }, + { + {1.0, 1.0, 1.0, 1.0, 1.0}, + {1.0, 1.0, 1.0, 1.0, 1.0}, + {1.0, 1.0, 1.0, 1.0, 1.0}, + {1.0, 1.0, 1.0, 1.0, 1.0}, + {1.0, 1.0, 1.0, 1.0, 1.0}, + {1.0, 1.0, 1.0, 1.0, 1.0} + } + } + p = + { + { + {0.1, 0.1, 0.1, 0.1, 0.1}, + {0.1, 0.1, 0.1, 0.1, 0.1}, + {0.1, 0.1, 0.1, 0.1, 0.1}, + {0.1, 0.1, 0.1, 0.1, 0.1}, + {0.1, 0.1, 0.1, 0.1, 0.1}, + {0.1, 0.1, 0.1, 0.1, 0.1} + }, + { + {0.1, 0.1, 0.1, 0.1, 0.1}, + {0.1, 0.1, 0.1, 0.1, 0.1}, + {0.1, 0.1, 0.1, 0.1, 0.1}, + {0.1, 0.1, 0.1, 0.1, 0.1}, + {0.1, 0.1, 0.1, 0.1, 0.1}, + {0.1, 0.1, 0.1, 0.1, 0.1} + } + } + rh = + { + { + {2, 2, 2, 2, 2}, + {2, 2, 2, 2, 2}, + {2, 2, 2, 2, 2}, + {2, 2, 2, 2, 2}, + {2, 2, 2, 2, 2}, + {2, 2, 2, 2, 2} + }, + { + {2, 2, 2, 2, 2}, + {2, 2, 2, 2, 2}, + {2, 2, 2, 2, 2}, + {2, 2, 2, 2, 2}, + {2, 2, 2, 2, 2}, + {2, 2, 2, 2, 2} + } + } + pixel = + { + {7, 7, 7, 7, 7}, + {7, 7, 7, 7, 7}, + {7, 7, 7, 7, 7}, + {7, 7, 7, 7, 7}, + {7, 7, 7, 7, 7}, + {7, 7, 7, 7, 7} + } + source = "aaaaa", "aaaaa", "aaaaa", "aaaaa", "aaaaa", "aaaaa" + lat = + {0, 10, 20, 30, 40, 50} + lon = + {-140, -118, -96, -84, -52} + time = + {1, 2} + z = + { + { + {10.0, 10.0, 10.0, 10.0, 10.0}, + {10.0, 10.0, 10.0, 10.0, 10.0}, + {10.0, 10.0, 10.0, 10.0, 10.0}, + {10.0, 10.0, 10.0, 10.0, 10.0}, + {10.0, 10.0, 10.0, 10.0, 10.0}, + {10.0, 10.0, 10.0, 10.0, 10.0} + }, + { + {10.0, 10.0, 10.0, 10.0, 10.0}, + {10.0, 10.0, 10.0, 10.0, 10.0}, + {10.0, 10.0, 10.0, 10.0, 10.0}, + {10.0, 10.0, 10.0, 10.0, 10.0}, + {10.0, 10.0, 10.0, 10.0, 10.0}, + {10.0, 10.0, 10.0, 10.0, 10.0} + } + } +} diff --git a/dap4/src/test/data/resources/baselinehyrax/nc4_strings.nc.ncdump b/dap4/src/test/data/resources/baselinehyrax/nc4_strings.nc.ncdump new file mode 100644 index 0000000000..2cf8b72421 --- /dev/null +++ b/dap4/src/test/data/resources/baselinehyrax/nc4_strings.nc.ncdump @@ -0,0 +1,36 @@ +netcdf nc4_strings { + dimensions: + lat = 6; + lon = 5; + variables: + string station(lat, lon); + string station:names = "site_1", "site_2", "site_3"; + string station:who = "james"; + + string scan_line(lon); + + string codec_name; + + int lat(lat); + string lat:_CoordinateAxisType = "Lat"; + + int lon(lon); + string lon:_CoordinateAxisType = "Lon"; + + // global attributes: + string :NC_GLOBAL.title = "Hyrax/netcdf handler test file 2"; + :NC_GLOBAL.version = 1.0; + string :NC_GLOBAL.description = "This file has all of the new netcdf 4 unsigned data types."; + string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; + + data: + station = + { "one", "two", "three", "four", "five", "one_b", "two_b", "three_b", "four_b", "five_b", "one_c", "two_c", "three_c", "four_c", "five_c", "one", "two", "three", "four", "five", "one", "two", "three", "four", "five", "one_f", "two_f", "three_f", "four_f", "five_f" + } + scan_line = "r", "r1", "r2", "r3", "r4" + codec_name = "mp3" + lat = + {0, 10, 20, 30, 40, 50} + lon = + {-140, -118, -96, -84, -52} +} diff --git a/dap4/src/test/data/resources/baselinehyrax/nc4_strings_comp.nc.ncdump b/dap4/src/test/data/resources/baselinehyrax/nc4_strings_comp.nc.ncdump new file mode 100644 index 0000000000..13eaa126f9 --- /dev/null +++ b/dap4/src/test/data/resources/baselinehyrax/nc4_strings_comp.nc.ncdump @@ -0,0 +1,36 @@ +netcdf nc4_strings_comp { + dimensions: + lat = 6; + lon = 5; + variables: + string station(lat, lon); + string station:names = "site_1", "site_2", "site_3"; + string station:who = "james"; + + string scan_line(lon); + + string codec_name; + + int lat(lat); + string lat:_CoordinateAxisType = "Lat"; + + int lon(lon); + string lon:_CoordinateAxisType = "Lon"; + + // global attributes: + string :NC_GLOBAL.title = "Hyrax/netcdf handler test file 2"; + :NC_GLOBAL.version = 1.0; + string :NC_GLOBAL.description = "This file has all of the new netcdf 4 unsigned data types."; + string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; + + data: + station = + { "one", "two", "three", "four", "five", "one_b", "two_b", "three_b", "four_b", "five_b", "one_c", "two_c", "three_c", "four_c", "five_c", "one", "two", "three", "four", "five", "one", "two", "three", "four", "five", "one_f", "two_f", "three_f", "four_f", "five_f" + } + scan_line = "r", "r1", "r2", "r3", "r4" + codec_name = "mp3" + lat = + {0, 10, 20, 30, 40, 50} + lon = + {-140, -118, -96, -84, -52} +} diff --git a/dap4/src/test/data/resources/baselinehyrax/nc4_unsigned_types.nc.ncdump b/dap4/src/test/data/resources/baselinehyrax/nc4_unsigned_types.nc.ncdump new file mode 100644 index 0000000000..c195c7df5f --- /dev/null +++ b/dap4/src/test/data/resources/baselinehyrax/nc4_unsigned_types.nc.ncdump @@ -0,0 +1,75 @@ +netcdf nc4_unsigned_types { + dimensions: + lat = 6; + lon = 5; + time = 2; + variables: + uint temp(time, lat, lon); + + ushort rh(time, lat, lon); + rh:_FillValue = 9999S; + + int lat(lat); + string lat:units = "degrees_north"; + string lat:_CoordinateAxisType = "Lat"; + + int lon(lon); + string lon:units = "degrees_east"; + string lon:_CoordinateAxisType = "Lon"; + + int time(time); + string time:units = "seconds"; + + // global attributes: + string :NC_GLOBAL.title = "Hyrax/netcdf handler test file 2"; + :NC_GLOBAL.version = 1.0; + string :NC_GLOBAL.description = "This file has all of the new netcdf 4 cardinal data types."; + string :DODS_EXTRA.Unlimited_Dimension = "time"; + string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; + + data: + temp = + { + { + {7, 7, 7, 7, 7}, + {7, 7, 7, 7, 7}, + {7, 7, 7, 7, 7}, + {7, 7, 7, 7, 7}, + {7, 7, 7, 7, 7}, + {7, 7, 7, 7, 7} + }, + { + {7, 7, 7, 7, 7}, + {7, 7, 7, 7, 7}, + {7, 7, 7, 7, 7}, + {7, 7, 7, 7, 7}, + {7, 7, 7, 7, 7}, + {7, 7, 7, 7, 7} + } + } + rh = + { + { + {2, 2, 2, 2, 2}, + {2, 2, 2, 2, 2}, + {2, 2, 2, 2, 2}, + {2, 2, 2, 2, 2}, + {2, 2, 2, 2, 2}, + {2, 2, 2, 2, 2} + }, + { + {2, 2, 2, 2, 2}, + {2, 2, 2, 2, 2}, + {2, 2, 2, 2, 2}, + {2, 2, 2, 2, 2}, + {2, 2, 2, 2, 2}, + {2, 2, 2, 2, 2} + } + } + lat = + {0, 10, 20, 30, 40, 50} + lon = + {-140, -118, -96, -84, -52} + time = + {1, 2} +} diff --git a/dap4/src/test/data/resources/baselinehyrax/nc4_unsigned_types_comp.nc.ncdump b/dap4/src/test/data/resources/baselinehyrax/nc4_unsigned_types_comp.nc.ncdump new file mode 100644 index 0000000000..9be7467142 --- /dev/null +++ b/dap4/src/test/data/resources/baselinehyrax/nc4_unsigned_types_comp.nc.ncdump @@ -0,0 +1,75 @@ +netcdf nc4_unsigned_types_comp { + dimensions: + lat = 6; + lon = 5; + time = 2; + variables: + uint temp(time, lat, lon); + + ushort rh(time, lat, lon); + rh:_FillValue = 9999S; + + int lat(lat); + string lat:units = "degrees_north"; + string lat:_CoordinateAxisType = "Lat"; + + int lon(lon); + string lon:units = "degrees_east"; + string lon:_CoordinateAxisType = "Lon"; + + int time(time); + string time:units = "seconds"; + + // global attributes: + string :NC_GLOBAL.title = "Hyrax/netcdf handler test file 2"; + :NC_GLOBAL.version = 1.0; + string :NC_GLOBAL.description = "This file has all of the new netcdf 4 cardinal data types."; + string :DODS_EXTRA.Unlimited_Dimension = "time"; + string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; + + data: + temp = + { + { + {7, 7, 7, 7, 7}, + {7, 7, 7, 7, 7}, + {7, 7, 7, 7, 7}, + {7, 7, 7, 7, 7}, + {7, 7, 7, 7, 7}, + {7, 7, 7, 7, 7} + }, + { + {7, 7, 7, 7, 7}, + {7, 7, 7, 7, 7}, + {7, 7, 7, 7, 7}, + {7, 7, 7, 7, 7}, + {7, 7, 7, 7, 7}, + {7, 7, 7, 7, 7} + } + } + rh = + { + { + {2, 2, 2, 2, 2}, + {2, 2, 2, 2, 2}, + {2, 2, 2, 2, 2}, + {2, 2, 2, 2, 2}, + {2, 2, 2, 2, 2}, + {2, 2, 2, 2, 2} + }, + { + {2, 2, 2, 2, 2}, + {2, 2, 2, 2, 2}, + {2, 2, 2, 2, 2}, + {2, 2, 2, 2, 2}, + {2, 2, 2, 2, 2}, + {2, 2, 2, 2, 2} + } + } + lat = + {0, 10, 20, 30, 40, 50} + lon = + {-140, -118, -96, -84, -52} + time = + {1, 2} +} diff --git a/dap4/src/test/data/resources/baselinehyrax/ref_tst_compounds.nc.ncdump b/dap4/src/test/data/resources/baselinehyrax/ref_tst_compounds.nc.ncdump new file mode 100644 index 0000000000..c687cc5544 --- /dev/null +++ b/dap4/src/test/data/resources/baselinehyrax/ref_tst_compounds.nc.ncdump @@ -0,0 +1,43 @@ +netcdf ref_tst_compounds { + dimensions: + n = 3; + variables: + + Structure { + short day; + short elev; + int count; + float relhum; + double time; + } obs(n); + obs:elev = -99S; + obs:count = -99; + obs:time = -99.0; + obs:day = -99S; + obs:relhum = -99.0f; + + + // global attributes: + string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; + + data: + obs = + { day = 15 + elev = 2 + count = 1 + relhum = 0.5 + time = 3600.01 + } obs(0) + { day = 157 + elev = -99 + count = -99 + relhum = -99.0 + time = -99.0 + } obs(1) + { day = 20 + elev = 6 + count = 3 + relhum = 0.75 + time = 5000.01 + } obs(2) +} diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_atomic_array.nc.8.raw.txt b/dap4/src/test/data/resources/baselineraw/test_atomic_array.2.nc.ncdump similarity index 59% rename from dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_atomic_array.nc.8.raw.txt rename to dap4/src/test/data/resources/baselineraw/test_atomic_array.2.nc.ncdump index 8c33c36312..ad2d6e91b7 100644 --- a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_atomic_array.nc.8.raw.txt +++ b/dap4/src/test/data/resources/baselineraw/test_atomic_array.2.nc.ncdump @@ -1,12 +1,13 @@ -netcdf test_atomic_array.nc.8 { +netcdf test_atomic_array.2.nc.dap { variables: short v16(3); - string v16:_DAP4_Checksum_CRC32 = "0xb4fb7f89"; // global attributes: string :_dap4.ce = "/v16[0:1,3]"; + :_DAP4_Little_Endian = 1B; string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -v16 = - {1, 2, 4} + + data: + v16 = + {1, 2, 4} } diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_atomic_array.nc.9.raw.txt b/dap4/src/test/data/resources/baselineraw/test_atomic_array.3.nc.ncdump similarity index 59% rename from dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_atomic_array.nc.9.raw.txt rename to dap4/src/test/data/resources/baselineraw/test_atomic_array.3.nc.ncdump index 7137b40bd6..15b3796744 100644 --- a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_atomic_array.nc.9.raw.txt +++ b/dap4/src/test/data/resources/baselineraw/test_atomic_array.3.nc.ncdump @@ -1,12 +1,13 @@ -netcdf test_atomic_array.nc.9 { +netcdf test_atomic_array.3.nc.dap { variables: short v16(3); - string v16:_DAP4_Checksum_CRC32 = "0xa0d9e652"; // global attributes: string :_dap4.ce = "/v16[3,0:1]"; + :_DAP4_Little_Endian = 1B; string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -v16 = - {4, 1, 2} + + data: + v16 = + {4, 1, 2} } diff --git a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_atomic_array.nc.nc4.dap b/dap4/src/test/data/resources/baselineraw/test_atomic_array.nc.ncdump similarity index 64% rename from dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_atomic_array.nc.nc4.dap rename to dap4/src/test/data/resources/baselineraw/test_atomic_array.nc.ncdump index a190c8fd5c..cd0d5ea889 100644 --- a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_atomic_array.nc.nc4.dap +++ b/dap4/src/test/data/resources/baselineraw/test_atomic_array.nc.ncdump @@ -19,7 +19,7 @@ netcdf test_atomic_array { char vc(d2); - String vs(d2, d2); + string vs(d2, d2); opaque vo(d1, d2); @@ -28,29 +28,30 @@ netcdf test_atomic_array { // global attributes: string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -vu8 = - { - {255, 1, 2}, - {3, 4, 5} - } -v16 = - {1, 2, 3, 4} -vu32 = - { - {5, 4, 3}, - {2, 1, 0} - } -vd = - {17.9, 1024.8} -vc = "@&" -vs = - { "hello world", " + + data: + vu8 = + { + {255, 1, 2}, + {3, 4, 5} + } + v16 = + {1, 2, 3, 4} + vu32 = + { + {5, 4, 3}, + {2, 1, 0} + } + vd = + {17.9, 1024.8} + vc = "@&" + vs = + { "hello world", " ", "Καλημέα", "abc" - } -vo = 0x0123456789abcdef, - 0xabcdef0000000000; + } + vo = 0x0123456789abcdef, + 0xabcdef0000000000; -primary_cloud = - {0, 2, 0, 1, 127} + primary_cloud = + {0, 2, 0, 1, 127} } diff --git a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_atomic_types.nc.nc4.dap b/dap4/src/test/data/resources/baselineraw/test_atomic_types.nc.ncdump similarity index 67% rename from dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_atomic_types.nc.nc4.dap rename to dap4/src/test/data/resources/baselineraw/test_atomic_types.nc.ncdump index 205e48eb6d..c330cbcde2 100644 --- a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_atomic_types.nc.nc4.dap +++ b/dap4/src/test/data/resources/baselineraw/test_atomic_types.nc.ncdump @@ -25,7 +25,7 @@ netcdf test_atomic_types { char vc; - String vs; + string vs; opaque vo; @@ -37,21 +37,22 @@ netcdf test_atomic_types { // global attributes: string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -v8 =-128 -vu8 =255 -v16 =-32768 -vu16 =65535 -v32 =2147483647 -vu32 =4294967295 -v64 =9223372036854775807 -vu64 =18446744073709551615 -vf =3.1415927 -vd =3.141592653589793 -vc =@ -vs = "hello world" -vo = 0x0123456789abcdef; - -primary_cloud =2 -secondary_cloud =127 + + data: + v8 = -128 + vu8 = 255 + v16 = -32768 + vu16 = 65535 + v32 = 2147483647 + vu32 = 4294967295 + v64 = 9223372036854775807 + vu64 = 18446744073709551615 + vf = 3.1415927 + vd = 3.141592653589793 + vc = @ + vs = "hello world" + vo = 0x0123456789abcdef; + + primary_cloud = 2 + secondary_cloud = 127 } diff --git a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_enum.nc.nc4.dap b/dap4/src/test/data/resources/baselineraw/test_enum_1.nc.ncdump similarity index 89% rename from dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_enum.nc.nc4.dap rename to dap4/src/test/data/resources/baselineraw/test_enum_1.nc.ncdump index 7723b215c7..1c69c45002 100644 --- a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_enum.nc.nc4.dap +++ b/dap4/src/test/data/resources/baselineraw/test_enum_1.nc.ncdump @@ -1,4 +1,4 @@ -netcdf test_enum { +netcdf test_enum_1 { types: byte enum cloud_class_t { Clear = 0, Cumulonimbus = 1, Stratus = 2, Stratocumulus = 3, Cumulus = 4, Altostratus = 5, Nimbostratus = 6, Altocumulus = 7, Cirrostratus = 8, Cirrocumulus = 9, Cirrus = 10, Missing = 127}; @@ -8,6 +8,7 @@ netcdf test_enum { // global attributes: string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -primary_cloud =2 + + data: + primary_cloud = 2 } diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_enum_2.nc.raw.txt b/dap4/src/test/data/resources/baselineraw/test_enum_2.nc.ncdump similarity index 83% rename from dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_enum_2.nc.raw.txt rename to dap4/src/test/data/resources/baselineraw/test_enum_2.nc.ncdump index 62ee4d281a..e74e8a0f91 100644 --- a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_enum_2.nc.raw.txt +++ b/dap4/src/test/data/resources/baselineraw/test_enum_2.nc.ncdump @@ -2,16 +2,16 @@ netcdf test_enum_2 { types: byte enum cloud_class_t { Clear = 0, Cumulonimbus = 1, Stratus = 2, Stratocumulus = 3, Cumulus = 4, Altostratus = 5, Nimbostratus = 6, Altocumulus = 7, Cirrostratus = 8, Cirrocumulus = 9, Cirrus = 10, Missing = 127}; - group: h { variables: enum cloud_class_t primary_cloud; string primary_cloud:_FillValue = "Missing"; - string primary_cloud:_DAP4_Checksum_CRC32 = "0x3c0c8ea1"; } + // global attributes: string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -h/primary_cloud =2 + + data: + h/primary_cloud = 2 } diff --git a/dap4/src/test/data/resources/baselineraw/test_enum_3.nc.ncdump b/dap4/src/test/data/resources/baselineraw/test_enum_3.nc.ncdump new file mode 100644 index 0000000000..b46188656b --- /dev/null +++ b/dap4/src/test/data/resources/baselineraw/test_enum_3.nc.ncdump @@ -0,0 +1,16 @@ +netcdf test_enum_3 { + types: + byte enum cloud_class_t { Clear = 0, Stratus = 1, Missing = 127}; + + group: h { + variables: + enum cloud_class_t primary_cloud; + + } + + // global attributes: + string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; + + data: + h/primary_cloud = 1 +} diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_enum_array.nc.4.raw.txt b/dap4/src/test/data/resources/baselineraw/test_enum_array.6.nc.ncdump similarity index 79% rename from dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_enum_array.nc.4.raw.txt rename to dap4/src/test/data/resources/baselineraw/test_enum_array.6.nc.ncdump index 82933a50d3..a026f37c27 100644 --- a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_enum_array.nc.4.raw.txt +++ b/dap4/src/test/data/resources/baselineraw/test_enum_array.6.nc.ncdump @@ -1,16 +1,17 @@ -netcdf test_enum_array.nc.4 { +netcdf test_enum_array.6.nc.dap { types: byte enum cloud_class_t { Clear = 0, Cumulonimbus = 1, Stratus = 2, Stratocumulus = 3, Cumulus = 4, Altostratus = 5, Nimbostratus = 6, Altocumulus = 7, Cirrostratus = 8, Cirrocumulus = 9, Cirrus = 10, Missing = 127}; variables: enum cloud_class_t primary_cloud(2); string primary_cloud:_FillValue = "Missing"; - string primary_cloud:_DAP4_Checksum_CRC32 = "0x04e840eb"; // global attributes: string :_dap4.ce = "/primary_cloud[1:2:4]"; + :_DAP4_Little_Endian = 1B; string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -primary_cloud = - {2, 1} + + data: + primary_cloud = + {2, 1} } diff --git a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_enum_array.nc.nc4.dap b/dap4/src/test/data/resources/baselineraw/test_enum_array.nc.ncdump similarity index 90% rename from dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_enum_array.nc.nc4.dap rename to dap4/src/test/data/resources/baselineraw/test_enum_array.nc.ncdump index 6bc8a7ac6d..1ede109916 100644 --- a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_enum_array.nc.nc4.dap +++ b/dap4/src/test/data/resources/baselineraw/test_enum_array.nc.ncdump @@ -10,7 +10,8 @@ netcdf test_enum_array { // global attributes: string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -primary_cloud = - {0, 2, 0, 1, 127} + + data: + primary_cloud = + {0, 2, 0, 1, 127} } diff --git a/dap4/src/test/data/resources/baselineraw/test_fill.nc.ncdump b/dap4/src/test/data/resources/baselineraw/test_fill.nc.ncdump new file mode 100644 index 0000000000..26ece6583d --- /dev/null +++ b/dap4/src/test/data/resources/baselineraw/test_fill.nc.ncdump @@ -0,0 +1,17 @@ +netcdf test_fill { + variables: + ubyte uv8; + + short v16; + + int uv32; + uv32:_FillValue = 17; + + // global attributes: + string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; + + data: + uv8 = 240 + v16 = 32700 + uv32 = 111000 +} diff --git a/dap4/src/test/data/resources/baselineraw/test_fill_2.nc.ncdump b/dap4/src/test/data/resources/baselineraw/test_fill_2.nc.ncdump new file mode 100644 index 0000000000..ffdf800d09 --- /dev/null +++ b/dap4/src/test/data/resources/baselineraw/test_fill_2.nc.ncdump @@ -0,0 +1,32 @@ +netcdf test_fill_2 { + types: + byte enum cloud_class_t { Clear = 0, Cumulonimbus = 1, Stratus = 2, Stratocumulus = 3, Cumulus = 4, Altostratus = 5, Nimbostratus = 6, Altocumulus = 7, Cirrostratus = 8, Cirrocumulus = 9, Cirrus = 10, Missing = 127}; + + dimensions: + d2 = 2; + variables: + enum cloud_class_t enumvar(d2); + string enumvar:_FillValue = "Missing"; + + int uv32(d2); + uv32:_FillValue = 17; + + ubyte uv8(d2); + uv8:_FillValue = 120B; + + short v16(d2); + v16:_FillValue = -37S; + + // global attributes: + string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; + + data: + enumvar = + {2, 127} + uv32 = + {111000, 17} + uv8 = + {240, 120} + v16 = + {32700, -37} +} diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_groups1.nc.raw.txt b/dap4/src/test/data/resources/baselineraw/test_groups1.nc.ncdump similarity index 50% rename from dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_groups1.nc.raw.txt rename to dap4/src/test/data/resources/baselineraw/test_groups1.nc.ncdump index 253a698474..2cb5bfc39b 100644 --- a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_groups1.nc.raw.txt +++ b/dap4/src/test/data/resources/baselineraw/test_groups1.nc.ncdump @@ -1,20 +1,16 @@ netcdf test_groups1 { dimensions: dim1 = 5; - group: g { dimensions: dim2 = 3; - group: h { dimensions: dim3 = 7; variables: int v1(dim1); - string v1:_DAP4_Checksum_CRC32 = "0x1d1d272c"; float v2(dim2); - string v2:_DAP4_Checksum_CRC32 = "0x0fe72d43"; } @@ -23,22 +19,23 @@ netcdf test_groups1 { dim3 = 7; variables: int v1(dim1); - string v1:_DAP4_Checksum_CRC32 = "0xa9b4a0fb"; float v3(dim3); - string v3:_DAP4_Checksum_CRC32 = "0x29f1e312"; } + } + // global attributes: string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -g/h/v1 = - {-876354855, -1761252264, 1723477387, -46827465, 1475147969} -g/h/v2 = - {12.0, -100.0, 9.96921E36} -g/i/v1 = - {2, 3, 5, 7, 11} -g/i/v3 = - {23.0, 29.0, 19.0, 31.0, 17.0, 37.0, 13.0} + + data: + g/h/v1 = + {-876354855, -1761252264, 1723477387, -46827465, 1475147969} + g/h/v2 = + {12.0, -100.0, 9.96921E36} + g/i/v1 = + {2, 3, 5, 7, 11} + g/i/v3 = + {23.0, 29.0, 19.0, 31.0, 17.0, 37.0, 13.0} } diff --git a/dap4/src/test/data/resources/baselineraw/test_misc1.nc.ncdump b/dap4/src/test/data/resources/baselineraw/test_misc1.nc.ncdump new file mode 100644 index 0000000000..1302c57ce3 --- /dev/null +++ b/dap4/src/test/data/resources/baselineraw/test_misc1.nc.ncdump @@ -0,0 +1,30 @@ +netcdf test_misc1 { + dimensions: + lon = 4; + time = 0; + lat = 6; + unlim = 3; + variables: + float var(unlim); + var:_ChunkSizes = 1024; + + float lon(lon); + string lon:units = "degrees_east"; + string lon:_CoordinateAxisType = "Lon"; + + float lat(lat); + string lat:units = "degrees_north"; + string lat:_CoordinateAxisType = "Lat"; + + // global attributes: + string :title = "example for workshop"; + string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; + + data: + var = + {0.0, 1.0, 3.0} + lon = + {9.96921E36, 9.96921E36, 9.96921E36, 9.96921E36} + lat = + {9.96921E36, 9.96921E36, 9.96921E36, 9.96921E36, 9.96921E36, 9.96921E36} +} diff --git a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_one_var.nc.nc4.dmr b/dap4/src/test/data/resources/baselineraw/test_one_var.nc.ncdump similarity index 87% rename from dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_one_var.nc.nc4.dmr rename to dap4/src/test/data/resources/baselineraw/test_one_var.nc.ncdump index 2f331bc8d9..f43721d3ea 100644 --- a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_one_var.nc.nc4.dmr +++ b/dap4/src/test/data/resources/baselineraw/test_one_var.nc.ncdump @@ -4,4 +4,7 @@ netcdf test_one_var { // global attributes: string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; + + data: + t = 17 } diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_one_vararray.nc.1.raw.txt b/dap4/src/test/data/resources/baselineraw/test_one_vararray.4.nc.ncdump similarity index 60% rename from dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_one_vararray.nc.1.raw.txt rename to dap4/src/test/data/resources/baselineraw/test_one_vararray.4.nc.ncdump index 4b380edb65..7b193661a4 100644 --- a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_one_vararray.nc.1.raw.txt +++ b/dap4/src/test/data/resources/baselineraw/test_one_vararray.4.nc.ncdump @@ -1,12 +1,13 @@ -netcdf test_one_vararray.nc.1 { +netcdf test_one_vararray.4.nc.dap { variables: int t(1); - string t:_DAP4_Checksum_CRC32 = "0xb6a88010"; // global attributes: string :_dap4.ce = "/t[1]"; + :_DAP4_Little_Endian = 1B; string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -t = - {37} + + data: + t = + {37} } diff --git a/dap4/src/test/data/resources/baselineraw/test_one_vararray.5.nc.ncdump b/dap4/src/test/data/resources/baselineraw/test_one_vararray.5.nc.ncdump new file mode 100644 index 0000000000..c0144f5c1c --- /dev/null +++ b/dap4/src/test/data/resources/baselineraw/test_one_vararray.5.nc.ncdump @@ -0,0 +1,13 @@ +netcdf test_one_vararray.5.nc.dap { + variables: + int t(2); + + // global attributes: + string :_dap4.ce = "/t[0:1]"; + :_DAP4_Little_Endian = 1B; + string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; + + data: + t = + {17, 37} +} diff --git a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_one_vararray.nc.nc4.dap b/dap4/src/test/data/resources/baselineraw/test_one_vararray.nc.ncdump similarity index 84% rename from dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_one_vararray.nc.nc4.dap rename to dap4/src/test/data/resources/baselineraw/test_one_vararray.nc.ncdump index 6c047673ba..4f97c08829 100644 --- a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_one_vararray.nc.nc4.dap +++ b/dap4/src/test/data/resources/baselineraw/test_one_vararray.nc.ncdump @@ -6,7 +6,8 @@ netcdf test_one_vararray { // global attributes: string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -t = - {17, 37} + + data: + t = + {17, 37} } diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_opaque.nc.raw.txt b/dap4/src/test/data/resources/baselineraw/test_opaque.nc.ncdump similarity index 63% rename from dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_opaque.nc.raw.txt rename to dap4/src/test/data/resources/baselineraw/test_opaque.nc.ncdump index 54dcb52c2b..940999bb11 100644 --- a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_opaque.nc.raw.txt +++ b/dap4/src/test/data/resources/baselineraw/test_opaque.nc.ncdump @@ -1,11 +1,11 @@ netcdf test_opaque { variables: opaque vo1; - string vo1:_DAP4_Checksum_CRC32 = "0xd24ddadd"; // global attributes: string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -vo1 = 0x0123456789abcdef; + + data: + vo1 = 0x0123456789abcdef; } diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_opaque_array.nc.7.raw.txt b/dap4/src/test/data/resources/baselineraw/test_opaque_array.7.nc.ncdump similarity index 54% rename from dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_opaque_array.nc.7.raw.txt rename to dap4/src/test/data/resources/baselineraw/test_opaque_array.7.nc.ncdump index 10d45fe22b..693c3ea122 100644 --- a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_opaque_array.nc.7.raw.txt +++ b/dap4/src/test/data/resources/baselineraw/test_opaque_array.7.nc.ncdump @@ -1,13 +1,14 @@ -netcdf test_opaque_array.nc.7 { +netcdf test_opaque_array.7.nc.dap { variables: opaque vo2(1, 2); - string vo2:_DAP4_Checksum_CRC32 = "0xcca386bf"; // global attributes: string :_dap4.ce = "/vo2[1][0:1]"; + :_DAP4_Little_Endian = 1B; string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -vo2 = 0xfedcba9876543210, - 0xfedcba9876543210; + + data: + vo2 = 0xfedcba9876543210, + 0xfedcba9876543210; } diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_opaque_array.nc.raw.txt b/dap4/src/test/data/resources/baselineraw/test_opaque_array.nc.ncdump similarity index 55% rename from dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_opaque_array.nc.raw.txt rename to dap4/src/test/data/resources/baselineraw/test_opaque_array.nc.ncdump index 0f2053e984..3d7b9c3f77 100644 --- a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_opaque_array.nc.raw.txt +++ b/dap4/src/test/data/resources/baselineraw/test_opaque_array.nc.ncdump @@ -3,14 +3,14 @@ netcdf test_opaque_array { d2 = 2; variables: opaque vo2(d2, d2); - string vo2:_DAP4_Checksum_CRC32 = "0x91581cda"; // global attributes: string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -vo2 = 0x0123456789abcdef, - 0x0123456789abcdef, - 0x0123456789abcdef, - 0x0123456789abcdef; + + data: + vo2 = 0x0123456789abcdef, + 0xabcdef0000000000, + 0xfedcba9876543210, + 0xfedcba9999999999; } diff --git a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_struct_type.nc.nc4.dmr b/dap4/src/test/data/resources/baselineraw/test_struct1.nc.ncdump similarity index 74% rename from dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_struct_type.nc.nc4.dmr rename to dap4/src/test/data/resources/baselineraw/test_struct1.nc.ncdump index 17f3955052..1f85a06a38 100644 --- a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_struct_type.nc.nc4.dmr +++ b/dap4/src/test/data/resources/baselineraw/test_struct1.nc.ncdump @@ -1,4 +1,4 @@ -netcdf test_struct_type { +netcdf test_struct1 { variables: Structure { @@ -11,4 +11,10 @@ netcdf test_struct_type { // global attributes: string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; + + data: + s = + { x = 1 + y = -2 + } s(0) } diff --git a/dap4/d4tests/src/test/data/resources/TestConstraints/baseline/test_struct_array.nc.6.raw.txt b/dap4/src/test/data/resources/baselineraw/test_struct_array.8.nc.ncdump similarity index 51% rename from dap4/d4tests/src/test/data/resources/TestConstraints/baseline/test_struct_array.nc.6.raw.txt rename to dap4/src/test/data/resources/baselineraw/test_struct_array.8.nc.ncdump index 5ca77032b5..e3b8fe225b 100644 --- a/dap4/d4tests/src/test/data/resources/TestConstraints/baseline/test_struct_array.nc.6.raw.txt +++ b/dap4/src/test/data/resources/baselineraw/test_struct_array.8.nc.ncdump @@ -1,4 +1,4 @@ -netcdf test_struct_array.nc.6 { +netcdf test_struct_array.8.nc.dap { variables: Structure { @@ -7,28 +7,29 @@ netcdf test_struct_array.nc.6 { int y; string y:_CoordinateAxisType = "GeoY"; } s(2, 2); - string s:_DAP4_Checksum_CRC32 = "0x324d0ea6"; // global attributes: string :_dap4.ce = "/s[0:2:3][0:1]"; + :_DAP4_Little_Endian = 1B; string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -s = - { - x =1 - y =-1 - } s(0) - { - x =17 - y =37 - } s(1) - { - x =-4 - y =12 - } s(2) - { - x =-8 - y =8 - } s(3) + + data: + s = + { + x = 1 + y = -1 + } s(0) + { + x = 17 + y = 37 + } s(1) + { + x = -4 + y = 12 + } s(2) + { + x = -8 + y = 8 + } s(3) } diff --git a/dap4/src/test/data/resources/baselineraw/test_struct_array.nc.ncdump b/dap4/src/test/data/resources/baselineraw/test_struct_array.nc.ncdump new file mode 100644 index 0000000000..17e281c7d7 --- /dev/null +++ b/dap4/src/test/data/resources/baselineraw/test_struct_array.nc.ncdump @@ -0,0 +1,56 @@ +netcdf test_struct_array { + dimensions: + dx = 4; + dy = 3; + variables: + + Structure { + int x; + string x:_CoordinateAxisType = "GeoX"; + int y; + string y:_CoordinateAxisType = "GeoY"; + } s(dx, dy); + + + // global attributes: + string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; + + data: + s = + { x = 1 + y = -1 + } s(0) + { x = 17 + y = 37 + } s(1) + { x = -32767 + y = 32767 + } s(2) + { x = -1 + y = 3 + } s(3) + { x = -2 + y = 2 + } s(4) + { x = -3 + y = 1 + } s(5) + { x = -4 + y = 12 + } s(6) + { x = -8 + y = 8 + } s(7) + { x = -12 + y = 4 + } s(8) + { x = -5 + y = 15 + } s(9) + { x = -10 + y = 10 + } s(10) + { x = -15 + y = 5 + } s(11) +} diff --git a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_struct_nested.nc.nc4.dap b/dap4/src/test/data/resources/baselineraw/test_struct_nested.nc.ncdump similarity index 74% rename from dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_struct_nested.nc.nc4.dap rename to dap4/src/test/data/resources/baselineraw/test_struct_nested.nc.ncdump index 19f3ca3f32..7b333adcdb 100644 --- a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_struct_nested.nc.nc4.dap +++ b/dap4/src/test/data/resources/baselineraw/test_struct_nested.nc.ncdump @@ -21,18 +21,16 @@ netcdf test_struct_nested { // global attributes: string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; + data: - x = - { - field1 = - { - x = 1 + x = + { field1 = + { x = 1 y = -2 - } x.field1(0) - field2 = - { - x = 255 + } field1(0) + field2 = + { x = 255 y = 90 - } x.field2(0) + } field2(0) } x(0) } diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_struct_nested3.hdf5.raw.txt b/dap4/src/test/data/resources/baselineraw/test_struct_nested3.nc.ncdump similarity index 60% rename from dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_struct_nested3.hdf5.raw.txt rename to dap4/src/test/data/resources/baselineraw/test_struct_nested3.nc.ncdump index a165d7033e..afb80725ed 100644 --- a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_struct_nested3.hdf5.raw.txt +++ b/dap4/src/test/data/resources/baselineraw/test_struct_nested3.nc.ncdump @@ -1,4 +1,4 @@ -netcdf test_struct_nested3.hdf5 { +netcdf test_struct_nested3 { variables: Structure { @@ -12,19 +12,16 @@ netcdf test_struct_nested3.hdf5 { } field3; } x; - string x:_DAP4_Checksum_CRC32 = "0xc9e1efe6"; // global attributes: string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; + data: - x = - { - field3 = - { - field2 = - { - field1 = 17 + x = + { field3 = + { field2 = + { field1 = 17 } field2(0) } field3(0) } x(0) diff --git a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_struct_type.nc.nc4.dap b/dap4/src/test/data/resources/baselineraw/test_struct_type.nc.ncdump similarity index 91% rename from dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_struct_type.nc.nc4.dap rename to dap4/src/test/data/resources/baselineraw/test_struct_type.nc.ncdump index 084f785c8c..e66c700642 100644 --- a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_struct_type.nc.nc4.dap +++ b/dap4/src/test/data/resources/baselineraw/test_struct_type.nc.ncdump @@ -11,11 +11,10 @@ netcdf test_struct_type { // global attributes: string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; + data: - s = - { - x = 1 + s = + { x = 1 y = -2 } s(0) } - diff --git a/dap4/src/test/data/resources/baselineraw/test_test.nc.ncdump b/dap4/src/test/data/resources/baselineraw/test_test.nc.ncdump new file mode 100644 index 0000000000..62d089889d --- /dev/null +++ b/dap4/src/test/data/resources/baselineraw/test_test.nc.ncdump @@ -0,0 +1,13 @@ +netcdf test_test { + types: + byte enum enum_t { c1 = 1, c2 = 2, c3 = 3}; + + variables: + enum enum_t v1; + + // global attributes: + string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; + + data: + v1 = 1 +} diff --git a/dap4/src/test/data/resources/baselineraw/test_unlim.nc.ncdump b/dap4/src/test/data/resources/baselineraw/test_unlim.nc.ncdump new file mode 100644 index 0000000000..38981848bf --- /dev/null +++ b/dap4/src/test/data/resources/baselineraw/test_unlim.nc.ncdump @@ -0,0 +1,50 @@ +netcdf test_unlim { + dimensions: + lon = 2; + time = 2; + lat = 3; + variables: + float lon(lon); + string lon:units = "degrees_east"; + string lon:_CoordinateAxisType = "Lon"; + + float pr(time, lat, lon); + pr:_ChunkSizes = 1, 3, 2; + string pr:standard_name = "air_pressure_at_sea_level"; + string pr:units = "hPa"; + string pr:_CoordinateAxisType = "Pressure"; + + double time(time); + time:_ChunkSizes = 512; + string time:units = "seconds since 2009-01-01"; + string time:_CoordinateAxisType = "Time"; + + float lat(lat); + string lat:units = "degrees_north"; + string lat:_CoordinateAxisType = "Lat"; + + // global attributes: + string :title = "example for workshop"; + string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; + + data: + lon = + {9.96921E36, 9.96921E36} + pr = + { + { + {0.0, 1.0}, + {2.0, 3.0}, + {4.0, 5.0} + }, + { + {10.0, 11.0}, + {12.0, 13.0}, + {14.0, 15.0} + } + } + time = + {9.969209968386869E36, 9.969209968386869E36} + lat = + {9.96921E36, 9.96921E36, 9.96921E36} +} diff --git a/dap4/src/test/data/resources/baselineraw/test_unlim1.nc.ncdump b/dap4/src/test/data/resources/baselineraw/test_unlim1.nc.ncdump new file mode 100644 index 0000000000..39d22f9672 --- /dev/null +++ b/dap4/src/test/data/resources/baselineraw/test_unlim1.nc.ncdump @@ -0,0 +1,50 @@ +netcdf test_unlim1 { + dimensions: + lon = 2; + lat = 3; + time = 2; + variables: + float lon(lon); + string lon:units = "degrees_east"; + string lon:_CoordinateAxisType = "Lon"; + + float pr(time, lat, lon); + pr:_ChunkSizes = 1, 3, 2; + string pr:standard_name = "air_pressure_at_sea_level"; + string pr:units = "hPa"; + string pr:_CoordinateAxisType = "Pressure"; + + double time(time); + time:_ChunkSizes = 512; + string time:units = "seconds since 2009-01-01"; + string time:_CoordinateAxisType = "Time"; + + float lat(lat); + string lat:units = "degrees_north"; + string lat:_CoordinateAxisType = "Lat"; + + // global attributes: + string :title = "example for workshop"; + string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; + + data: + lon = + {9.96921E36, 9.96921E36} + pr = + { + { + {0.0, 1.0}, + {2.0, 3.0}, + {4.0, 5.0} + }, + { + {10.0, 11.0}, + {12.0, 13.0}, + {14.0, 15.0} + } + } + time = + {9.969209968386869E36, 9.969209968386869E36} + lat = + {9.96921E36, 9.96921E36, 9.96921E36} +} diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_utf8.nc.raw.txt b/dap4/src/test/data/resources/baselineraw/test_utf8.nc.ncdump similarity index 63% rename from dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_utf8.nc.raw.txt rename to dap4/src/test/data/resources/baselineraw/test_utf8.nc.ncdump index e99cf54c4a..772972588d 100644 --- a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_utf8.nc.raw.txt +++ b/dap4/src/test/data/resources/baselineraw/test_utf8.nc.ncdump @@ -3,10 +3,10 @@ netcdf test_utf8 { d2 = 2; variables: string vs(d2); - string vs:_DAP4_Checksum_CRC32 = "0xfce3cd28"; // global attributes: string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -vs = "Καλημέα", "Καλημέα" + + data: + vs = "Καλημέα", "abc" } diff --git a/dap4/src/test/data/resources/baselineraw/test_vlen1.nc.ncdump b/dap4/src/test/data/resources/baselineraw/test_vlen1.nc.ncdump new file mode 100644 index 0000000000..f0c03074d5 --- /dev/null +++ b/dap4/src/test/data/resources/baselineraw/test_vlen1.nc.ncdump @@ -0,0 +1,24 @@ +netcdf test_vlen1 { + variables: + + Sequence { + int x; + string x:_CoordinateAxisType = "GeoX"; + } x(*); + x:_FillValue = 0; + + + // global attributes: + string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; + + data: + x = + { x = 1 + } x + { x = 3 + } x + { x = 5 + } x + { x = 7 + } x +} diff --git a/dap4/src/test/data/resources/baselineraw/test_vlen11.nc.ncdump b/dap4/src/test/data/resources/baselineraw/test_vlen11.nc.ncdump new file mode 100644 index 0000000000..31920fc31f --- /dev/null +++ b/dap4/src/test/data/resources/baselineraw/test_vlen11.nc.ncdump @@ -0,0 +1,19 @@ +netcdf test_vlen11 { + variables: + + Sequence { + int v; + } v(*); + v:_FillValue = 0; + + + // global attributes: + string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; + + data: + v = + { v = 4 + } v + { v = 754 + } v +} diff --git a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_vlen3.nc.nc4.dmr b/dap4/src/test/data/resources/baselineraw/test_vlen3.nc.ncdump similarity index 70% rename from dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_vlen3.nc.nc4.dmr rename to dap4/src/test/data/resources/baselineraw/test_vlen3.nc.ncdump index ecef24cd25..538f1eee16 100644 --- a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_vlen3.nc.nc4.dmr +++ b/dap4/src/test/data/resources/baselineraw/test_vlen3.nc.ncdump @@ -2,10 +2,17 @@ netcdf test_vlen3 { variables: Structure { - int f1(*); + + Sequence { + int f1; + } f1(*); + } v1; // global attributes: string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; -} + + data: + +null diff --git a/dap4/src/test/data/resources/baselineraw/test_zerodim.nc.ncdump b/dap4/src/test/data/resources/baselineraw/test_zerodim.nc.ncdump new file mode 100644 index 0000000000..5c5b831150 --- /dev/null +++ b/dap4/src/test/data/resources/baselineraw/test_zerodim.nc.ncdump @@ -0,0 +1,30 @@ +netcdf test_zerodim { + dimensions: + lon = 4; + time = 0; + lat = 6; + unlim = 3; + variables: + float var(unlim); + var:_ChunkSizes = 1024; + + float lon(lon); + string lon:units = "degrees_east"; + string lon:_CoordinateAxisType = "Lon"; + + float lat(lat); + string lat:units = "degrees_north"; + string lat:_CoordinateAxisType = "Lat"; + + // global attributes: + string :title = "example for workshop"; + string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; + + data: + var = + {0.0, 1.0, 3.0} + lon = + {9.96921E36, 9.96921E36, 9.96921E36, 9.96921E36} + lat = + {9.96921E36, 9.96921E36, 9.96921E36, 9.96921E36, 9.96921E36, 9.96921E36} +} diff --git a/dap4/src/test/data/resources/baselineremote/test_atomic_array.2.nc.ncdump b/dap4/src/test/data/resources/baselineremote/test_atomic_array.2.nc.ncdump new file mode 100644 index 0000000000..a662df4360 --- /dev/null +++ b/dap4/src/test/data/resources/baselineremote/test_atomic_array.2.nc.ncdump @@ -0,0 +1,57 @@ +netcdf test_atomic_array.2 { + types: + byte enum cloud_class_t { Clear = 0, Cumulonimbus = 1, Stratus = 2, Stratocumulus = 3, Cumulus = 4, Altostratus = 5, Nimbostratus = 6, Altocumulus = 7, Cirrostratus = 8, Cirrocumulus = 9, Cirrus = 10, Missing = 127}; + + dimensions: + d1 = 1; + d2 = 2; + d3 = 3; + d4 = 4; + d5 = 5; + variables: + ubyte vu8(d2, d3); + + short v16(d4); + + uint vu32(d2, d3); + + double vd(d2); + + char vc(d2); + + String vs(d2, d2); + + opaque vo(d1, d2); + + enum cloud_class_t primary_cloud(d5); + string primary_cloud:_FillValue = "Missing"; + + // global attributes: + :_DAP4_Little_Endian = 1B; + string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; + + data: + vu8 = + { + {255, 1, 2}, + {3, 4, 5} + } + v16 = + {1, 2, 3, 4} + vu32 = + { + {5, 4, 3}, + {2, 1, 0} + } + vd = + {17.9, 1024.8} + vc = "@&" + vs = + { "hello world", "hello world", "hello world", "hello world" + } + vo = 0x0123456789abcdef, + 0x0123456789abcdef; + + primary_cloud = + {0, 2, 0, 1, 127} +} diff --git a/dap4/src/test/data/resources/baselineremote/test_atomic_array.3.nc.ncdump b/dap4/src/test/data/resources/baselineremote/test_atomic_array.3.nc.ncdump new file mode 100644 index 0000000000..a488e214d2 --- /dev/null +++ b/dap4/src/test/data/resources/baselineremote/test_atomic_array.3.nc.ncdump @@ -0,0 +1,57 @@ +netcdf test_atomic_array.3 { + types: + byte enum cloud_class_t { Clear = 0, Cumulonimbus = 1, Stratus = 2, Stratocumulus = 3, Cumulus = 4, Altostratus = 5, Nimbostratus = 6, Altocumulus = 7, Cirrostratus = 8, Cirrocumulus = 9, Cirrus = 10, Missing = 127}; + + dimensions: + d1 = 1; + d2 = 2; + d3 = 3; + d4 = 4; + d5 = 5; + variables: + ubyte vu8(d2, d3); + + short v16(d4); + + uint vu32(d2, d3); + + double vd(d2); + + char vc(d2); + + String vs(d2, d2); + + opaque vo(d1, d2); + + enum cloud_class_t primary_cloud(d5); + string primary_cloud:_FillValue = "Missing"; + + // global attributes: + :_DAP4_Little_Endian = 1B; + string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; + + data: + vu8 = + { + {255, 1, 2}, + {3, 4, 5} + } + v16 = + {1, 2, 3, 4} + vu32 = + { + {5, 4, 3}, + {2, 1, 0} + } + vd = + {17.9, 1024.8} + vc = "@&" + vs = + { "hello world", "hello world", "hello world", "hello world" + } + vo = 0x0123456789abcdef, + 0x0123456789abcdef; + + primary_cloud = + {0, 2, 0, 1, 127} +} diff --git a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_atomic_array.nc.nc4.dmr b/dap4/src/test/data/resources/baselineremote/test_atomic_array.nc.ncdump similarity index 59% rename from dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_atomic_array.nc.nc4.dmr rename to dap4/src/test/data/resources/baselineremote/test_atomic_array.nc.ncdump index 822a30cbc9..448052ed2e 100644 --- a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_atomic_array.nc.nc4.dmr +++ b/dap4/src/test/data/resources/baselineremote/test_atomic_array.nc.ncdump @@ -19,7 +19,7 @@ netcdf test_atomic_array { char vc(d2); - String vs(d2, d2); + string vs(d2, d2); opaque vo(d1, d2); @@ -27,5 +27,32 @@ netcdf test_atomic_array { string primary_cloud:_FillValue = "Missing"; // global attributes: + :_DAP4_Little_Endian = 1B; string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; + + data: + vu8 = + { + {255, 1, 2}, + {3, 4, 5} + } + v16 = + {1, 2, 3, 4} + vu32 = + { + {5, 4, 3}, + {2, 1, 0} + } + vd = + {17.9, 1024.8} + vc = "@&" + vs = + { "hello world", " +", "Καλημέα", "abc" + } + vo = 0x0123456789abcdef, + 0xabcdef0000000000; + + primary_cloud = + {0, 2, 0, 1, 127} } diff --git a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_atomic_types.nc.nc4.dmr b/dap4/src/test/data/resources/baselineremote/test_atomic_types.nc.ncdump similarity index 65% rename from dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_atomic_types.nc.nc4.dmr rename to dap4/src/test/data/resources/baselineremote/test_atomic_types.nc.ncdump index d771557b7f..b68d5b3fa1 100644 --- a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_atomic_types.nc.nc4.dmr +++ b/dap4/src/test/data/resources/baselineremote/test_atomic_types.nc.ncdump @@ -25,7 +25,7 @@ netcdf test_atomic_types { char vc; - String vs; + string vs; opaque vo; @@ -36,5 +36,24 @@ netcdf test_atomic_types { string secondary_cloud:_FillValue = "Missing"; // global attributes: + :_DAP4_Little_Endian = 1B; string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; + + data: + v8 = -128 + vu8 = 255 + v16 = -32768 + vu16 = 65535 + v32 = 2147483647 + vu32 = 4294967295 + v64 = 9223372036854775807 + vu64 = 18446744073709551615 + vf = 3.1415927 + vd = 3.141592653589793 + vc = @ + vs = "hello world" + vo = 0x0123456789abcdef; + + primary_cloud = 2 + secondary_cloud = 127 } diff --git a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_enum.nc.nc4.dmr b/dap4/src/test/data/resources/baselineremote/test_enum_1.nc.ncdump similarity index 84% rename from dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_enum.nc.nc4.dmr rename to dap4/src/test/data/resources/baselineremote/test_enum_1.nc.ncdump index 0b98070c42..abcb007674 100644 --- a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_enum.nc.nc4.dmr +++ b/dap4/src/test/data/resources/baselineremote/test_enum_1.nc.ncdump @@ -1,4 +1,4 @@ -netcdf test_enum { +netcdf test_enum_1 { types: byte enum cloud_class_t { Clear = 0, Cumulonimbus = 1, Stratus = 2, Stratocumulus = 3, Cumulus = 4, Altostratus = 5, Nimbostratus = 6, Altocumulus = 7, Cirrostratus = 8, Cirrocumulus = 9, Cirrus = 10, Missing = 127}; @@ -7,5 +7,9 @@ netcdf test_enum { string primary_cloud:_FillValue = "Missing"; // global attributes: + :_DAP4_Little_Endian = 1B; string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; + + data: + primary_cloud = 2 } diff --git a/dap4/src/test/data/resources/baselineremote/test_enum_2.nc.ncdump b/dap4/src/test/data/resources/baselineremote/test_enum_2.nc.ncdump new file mode 100644 index 0000000000..651cc35de6 --- /dev/null +++ b/dap4/src/test/data/resources/baselineremote/test_enum_2.nc.ncdump @@ -0,0 +1,18 @@ +netcdf test_enum_2 { + types: + byte enum cloud_class_t { Clear = 0, Cumulonimbus = 1, Stratus = 2, Stratocumulus = 3, Cumulus = 4, Altostratus = 5, Nimbostratus = 6, Altocumulus = 7, Cirrostratus = 8, Cirrocumulus = 9, Cirrus = 10, Missing = 127}; + + group: h { + variables: + enum cloud_class_t primary_cloud; + string primary_cloud:_FillValue = "Missing"; + + } + + // global attributes: + :_DAP4_Little_Endian = 1B; + string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; + + data: + h/primary_cloud = 2 +} diff --git a/dap4/src/test/data/resources/baselineremote/test_enum_3.nc.ncdump b/dap4/src/test/data/resources/baselineremote/test_enum_3.nc.ncdump new file mode 100644 index 0000000000..d550189ba8 --- /dev/null +++ b/dap4/src/test/data/resources/baselineremote/test_enum_3.nc.ncdump @@ -0,0 +1,17 @@ +netcdf test_enum_3 { + types: + byte enum cloud_class_t { Clear = 0, Stratus = 1, Missing = 127}; + + group: h { + variables: + enum cloud_class_t primary_cloud; + + } + + // global attributes: + :_DAP4_Little_Endian = 1B; + string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; + + data: + h/primary_cloud = 1 +} diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_enum.nc.raw.txt b/dap4/src/test/data/resources/baselineremote/test_enum_array.6.nc.ncdump similarity index 68% rename from dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_enum.nc.raw.txt rename to dap4/src/test/data/resources/baselineremote/test_enum_array.6.nc.ncdump index b666139c20..57f2a0ce47 100644 --- a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_enum.nc.raw.txt +++ b/dap4/src/test/data/resources/baselineremote/test_enum_array.6.nc.ncdump @@ -1,14 +1,18 @@ -netcdf test_enum { +netcdf test_enum_array.6 { types: byte enum cloud_class_t { Clear = 0, Cumulonimbus = 1, Stratus = 2, Stratocumulus = 3, Cumulus = 4, Altostratus = 5, Nimbostratus = 6, Altocumulus = 7, Cirrostratus = 8, Cirrocumulus = 9, Cirrus = 10, Missing = 127}; + dimensions: + d5 = 5; variables: - enum cloud_class_t primary_cloud; + enum cloud_class_t primary_cloud(d5); string primary_cloud:_FillValue = "Missing"; - string primary_cloud:_DAP4_Checksum_CRC32 = "0x3c0c8ea1"; // global attributes: + :_DAP4_Little_Endian = 1B; string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -primary_cloud =2 + + data: + primary_cloud = + {0, 2, 0, 1, 127} } diff --git a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_enum_array.nc.nc4.dmr b/dap4/src/test/data/resources/baselineremote/test_enum_array.nc.ncdump similarity index 85% rename from dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_enum_array.nc.nc4.dmr rename to dap4/src/test/data/resources/baselineremote/test_enum_array.nc.ncdump index 0ba318f4b9..b11536aadb 100644 --- a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_enum_array.nc.nc4.dmr +++ b/dap4/src/test/data/resources/baselineremote/test_enum_array.nc.ncdump @@ -9,5 +9,10 @@ netcdf test_enum_array { string primary_cloud:_FillValue = "Missing"; // global attributes: + :_DAP4_Little_Endian = 1B; string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; + + data: + primary_cloud = + {0, 2, 0, 1, 127} } diff --git a/dap4/src/test/data/resources/baselineremote/test_fill.nc.ncdump b/dap4/src/test/data/resources/baselineremote/test_fill.nc.ncdump new file mode 100644 index 0000000000..1a740740b1 --- /dev/null +++ b/dap4/src/test/data/resources/baselineremote/test_fill.nc.ncdump @@ -0,0 +1,18 @@ +netcdf test_fill { + variables: + ubyte uv8; + + short v16; + + int uv32; + uv32:_FillValue = 17; + + // global attributes: + :_DAP4_Little_Endian = 1B; + string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; + + data: + uv8 = 240 + v16 = 32700 + uv32 = 111000 +} diff --git a/dap4/src/test/data/resources/baselineremote/test_fill_2.nc.ncdump b/dap4/src/test/data/resources/baselineremote/test_fill_2.nc.ncdump new file mode 100644 index 0000000000..70d7dd28ae --- /dev/null +++ b/dap4/src/test/data/resources/baselineremote/test_fill_2.nc.ncdump @@ -0,0 +1,33 @@ +netcdf test_fill_2 { + types: + byte enum cloud_class_t { Clear = 0, Cumulonimbus = 1, Stratus = 2, Stratocumulus = 3, Cumulus = 4, Altostratus = 5, Nimbostratus = 6, Altocumulus = 7, Cirrostratus = 8, Cirrocumulus = 9, Cirrus = 10, Missing = 127}; + + dimensions: + d2 = 2; + variables: + enum cloud_class_t enumvar(d2); + string enumvar:_FillValue = "Missing"; + + int uv32(d2); + uv32:_FillValue = 17; + + ubyte uv8(d2); + uv8:_FillValue = 120B; + + short v16(d2); + v16:_FillValue = -37S; + + // global attributes: + :_DAP4_Little_Endian = 1B; + string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; + + data: + enumvar = + {2, 127} + uv32 = + {111000, 17} + uv8 = + {240, 120} + v16 = + {32700, -37} +} diff --git a/dap4/src/test/data/resources/baselineremote/test_groups1.nc.ncdump b/dap4/src/test/data/resources/baselineremote/test_groups1.nc.ncdump new file mode 100644 index 0000000000..e8a21f1643 --- /dev/null +++ b/dap4/src/test/data/resources/baselineremote/test_groups1.nc.ncdump @@ -0,0 +1,42 @@ +netcdf test_groups1 { + dimensions: + dim1 = 5; + group: g { + dimensions: + dim2 = 3; + group: h { + dimensions: + dim3 = 7; + variables: + int v1(dim1); + + float v2(dim2); + + } + + group: i { + dimensions: + dim3 = 7; + variables: + int v1(dim1); + + float v3(dim3); + + } + + } + + // global attributes: + :_DAP4_Little_Endian = 1B; + string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; + + data: + g/h/v1 = + {-876354855, -1761252264, 1723477387, -46827465, 1475147969} + g/h/v2 = + {12.0, -100.0, 9.96921E36} + g/i/v1 = + {2, 3, 5, 7, 11} + g/i/v3 = + {23.0, 29.0, 19.0, 31.0, 17.0, 37.0, 13.0} +} diff --git a/dap4/src/test/data/resources/baselineremote/test_misc1.nc.ncdump b/dap4/src/test/data/resources/baselineremote/test_misc1.nc.ncdump new file mode 100644 index 0000000000..e7494b8a76 --- /dev/null +++ b/dap4/src/test/data/resources/baselineremote/test_misc1.nc.ncdump @@ -0,0 +1,31 @@ +netcdf test_misc1 { + dimensions: + lon = 4; + time = 0; + lat = 6; + unlim = 3; + variables: + float var(unlim); + var:_ChunkSizes = 1024; + + float lon(lon); + string lon:units = "degrees_east"; + string lon:_CoordinateAxisType = "Lon"; + + float lat(lat); + string lat:units = "degrees_north"; + string lat:_CoordinateAxisType = "Lat"; + + // global attributes: + :_DAP4_Little_Endian = 1B; + string :title = "example for workshop"; + string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; + + data: + var = + {0.0, 1.0, 3.0} + lon = + {9.96921E36, 9.96921E36, 9.96921E36, 9.96921E36} + lat = + {9.96921E36, 9.96921E36, 9.96921E36, 9.96921E36, 9.96921E36, 9.96921E36} +} diff --git a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_one_var.nc.nc4.dap b/dap4/src/test/data/resources/baselineremote/test_one_var.nc.ncdump similarity index 74% rename from dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_one_var.nc.nc4.dap rename to dap4/src/test/data/resources/baselineremote/test_one_var.nc.ncdump index cf8dae631c..dc9ffc41ce 100644 --- a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_one_var.nc.nc4.dap +++ b/dap4/src/test/data/resources/baselineremote/test_one_var.nc.ncdump @@ -3,7 +3,9 @@ netcdf test_one_var { int t; // global attributes: + :_DAP4_Little_Endian = 1B; string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; - data: -t =17 + + data: + t = 17 } diff --git a/dap4/src/test/data/resources/baselineremote/test_one_vararray.4.nc.ncdump b/dap4/src/test/data/resources/baselineremote/test_one_vararray.4.nc.ncdump new file mode 100644 index 0000000000..f4bfee691f --- /dev/null +++ b/dap4/src/test/data/resources/baselineremote/test_one_vararray.4.nc.ncdump @@ -0,0 +1,14 @@ +netcdf test_one_vararray.4 { + dimensions: + d2 = 2; + variables: + int t(d2); + + // global attributes: + :_DAP4_Little_Endian = 1B; + string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; + + data: + t = + {17, 37} +} diff --git a/dap4/src/test/data/resources/baselineremote/test_one_vararray.5.nc.ncdump b/dap4/src/test/data/resources/baselineremote/test_one_vararray.5.nc.ncdump new file mode 100644 index 0000000000..31eab0d90e --- /dev/null +++ b/dap4/src/test/data/resources/baselineremote/test_one_vararray.5.nc.ncdump @@ -0,0 +1,14 @@ +netcdf test_one_vararray.5 { + dimensions: + d2 = 2; + variables: + int t(d2); + + // global attributes: + :_DAP4_Little_Endian = 1B; + string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; + + data: + t = + {17, 37} +} diff --git a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_one_vararray.nc.nc4.dmr b/dap4/src/test/data/resources/baselineremote/test_one_vararray.nc.ncdump similarity index 74% rename from dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_one_vararray.nc.nc4.dmr rename to dap4/src/test/data/resources/baselineremote/test_one_vararray.nc.ncdump index ff9f4f085d..6f4c930944 100644 --- a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_one_vararray.nc.nc4.dmr +++ b/dap4/src/test/data/resources/baselineremote/test_one_vararray.nc.ncdump @@ -5,5 +5,10 @@ netcdf test_one_vararray { int t(d2); // global attributes: + :_DAP4_Little_Endian = 1B; string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; + + data: + t = + {17, 37} } diff --git a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_vlen4.nc.nc4.dmr b/dap4/src/test/data/resources/baselineremote/test_opaque.nc.ncdump similarity index 50% rename from dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_vlen4.nc.nc4.dmr rename to dap4/src/test/data/resources/baselineremote/test_opaque.nc.ncdump index 357edd6da2..60e1ee1b7b 100644 --- a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_vlen4.nc.nc4.dmr +++ b/dap4/src/test/data/resources/baselineremote/test_opaque.nc.ncdump @@ -1,11 +1,12 @@ -netcdf test_vlen4 { +netcdf test_opaque { variables: - - Structure { - int f1(2, *); - } v1; - + opaque vo1; // global attributes: + :_DAP4_Little_Endian = 1B; string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; + + data: + vo1 = 0x0123456789abcdef; + } diff --git a/dap4/src/test/data/resources/baselineremote/test_opaque_array.7.nc.ncdump b/dap4/src/test/data/resources/baselineremote/test_opaque_array.7.nc.ncdump new file mode 100644 index 0000000000..fc56e6238b --- /dev/null +++ b/dap4/src/test/data/resources/baselineremote/test_opaque_array.7.nc.ncdump @@ -0,0 +1,17 @@ +netcdf test_opaque_array.7 { + dimensions: + d2 = 2; + variables: + opaque vo2(d2, d2); + + // global attributes: + :_DAP4_Little_Endian = 1B; + string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; + + data: + vo2 = 0x0123456789abcdef, + 0x0123456789abcdef, + 0x0123456789abcdef, + 0x0123456789abcdef; + +} diff --git a/dap4/src/test/data/resources/baselineremote/test_opaque_array.nc.ncdump b/dap4/src/test/data/resources/baselineremote/test_opaque_array.nc.ncdump new file mode 100644 index 0000000000..07790cf395 --- /dev/null +++ b/dap4/src/test/data/resources/baselineremote/test_opaque_array.nc.ncdump @@ -0,0 +1,17 @@ +netcdf test_opaque_array { + dimensions: + d2 = 2; + variables: + opaque vo2(d2, d2); + + // global attributes: + :_DAP4_Little_Endian = 1B; + string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; + + data: + vo2 = 0x0123456789abcdef, + 0xabcdef0000000000, + 0xfedcba9876543210, + 0xfedcba9999999999; + +} diff --git a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_struct_array.nc.nc4.dmr b/dap4/src/test/data/resources/baselineremote/test_struct1.nc.ncdump similarity index 66% rename from dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_struct_array.nc.nc4.dmr rename to dap4/src/test/data/resources/baselineremote/test_struct1.nc.ncdump index 8699a2aa57..b647e4efc8 100644 --- a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_struct_array.nc.nc4.dmr +++ b/dap4/src/test/data/resources/baselineremote/test_struct1.nc.ncdump @@ -1,7 +1,4 @@ -netcdf test_struct_array { - dimensions: - dx = 4; - dy = 3; +netcdf test_struct1 { variables: Structure { @@ -9,9 +6,16 @@ netcdf test_struct_array { string x:_CoordinateAxisType = "GeoX"; int y; string y:_CoordinateAxisType = "GeoY"; - } s(dx, dy); + } s; // global attributes: + :_DAP4_Little_Endian = 1B; string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; + + data: + s = + { x = 1 + y = -2 + } s(0) } diff --git a/dap4/src/test/data/resources/baselineremote/test_struct_array.8.nc.ncdump b/dap4/src/test/data/resources/baselineremote/test_struct_array.8.nc.ncdump new file mode 100644 index 0000000000..596b7d0cac --- /dev/null +++ b/dap4/src/test/data/resources/baselineremote/test_struct_array.8.nc.ncdump @@ -0,0 +1,69 @@ +netcdf test_struct_array.8 { + dimensions: + dx = 4; + dy = 3; + variables: + + Structure { + int x; + string x:_CoordinateAxisType = "GeoX"; + int y; + string y:_CoordinateAxisType = "GeoY"; + } s(dx, dy); + + + // global attributes: + :_DAP4_Little_Endian = 1B; + string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; + + data: + s = + { + x = 1 + y = -1 + } s(0) + { + x = 17 + y = 37 + } s(1) + { + x = -32767 + y = 32767 + } s(2) + { + x = -1 + y = 3 + } s(3) + { + x = -2 + y = 2 + } s(4) + { + x = -3 + y = 1 + } s(5) + { + x = -4 + y = 12 + } s(6) + { + x = -8 + y = 8 + } s(7) + { + x = -12 + y = 4 + } s(8) + { + x = -5 + y = 15 + } s(9) + { + x = -10 + y = 10 + } s(10) + { + x = -15 + y = 5 + } s(11) +} diff --git a/dap4/src/test/data/resources/baselineremote/test_struct_array.nc.ncdump b/dap4/src/test/data/resources/baselineremote/test_struct_array.nc.ncdump new file mode 100644 index 0000000000..5d64ae742d --- /dev/null +++ b/dap4/src/test/data/resources/baselineremote/test_struct_array.nc.ncdump @@ -0,0 +1,57 @@ +netcdf test_struct_array { + dimensions: + dx = 4; + dy = 3; + variables: + + Structure { + int x; + string x:_CoordinateAxisType = "GeoX"; + int y; + string y:_CoordinateAxisType = "GeoY"; + } s(dx, dy); + + + // global attributes: + :_DAP4_Little_Endian = 1B; + string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; + + data: + s = + { x = 1 + y = -1 + } s(0) + { x = 17 + y = 37 + } s(1) + { x = -32767 + y = 32767 + } s(2) + { x = -1 + y = 3 + } s(3) + { x = -2 + y = 2 + } s(4) + { x = -3 + y = 1 + } s(5) + { x = -4 + y = 12 + } s(6) + { x = -8 + y = 8 + } s(7) + { x = -12 + y = 4 + } s(8) + { x = -5 + y = 15 + } s(9) + { x = -10 + y = 10 + } s(10) + { x = -15 + y = 5 + } s(11) +} diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_struct_nested.hdf5.raw.txt b/dap4/src/test/data/resources/baselineremote/test_struct_nested.nc.ncdump similarity index 70% rename from dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_struct_nested.hdf5.raw.txt rename to dap4/src/test/data/resources/baselineremote/test_struct_nested.nc.ncdump index fdd4aa1aad..416611fbbc 100644 --- a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_struct_nested.hdf5.raw.txt +++ b/dap4/src/test/data/resources/baselineremote/test_struct_nested.nc.ncdump @@ -1,4 +1,4 @@ -netcdf test_struct_nested.hdf5 { +netcdf test_struct_nested { variables: Structure { @@ -17,22 +17,20 @@ netcdf test_struct_nested.hdf5 { } field2; } x; - string x:_DAP4_Checksum_CRC32 = "0xdfa7461b"; // global attributes: + :_DAP4_Little_Endian = 1B; string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; + data: - x = - { - field1 = - { - x = 1 + x = + { field1 = + { x = 1 y = -2 } field1(0) - field2 = - { - x = 255 + field2 = + { x = 255 y = 90 } field2(0) } x(0) diff --git a/dap4/src/test/data/resources/baselineremote/test_struct_nested3.nc.ncdump b/dap4/src/test/data/resources/baselineremote/test_struct_nested3.nc.ncdump new file mode 100644 index 0000000000..626573d139 --- /dev/null +++ b/dap4/src/test/data/resources/baselineremote/test_struct_nested3.nc.ncdump @@ -0,0 +1,29 @@ +netcdf test_struct_nested3 { + variables: + + Structure { + + Structure { + + Structure { + int field1; + } field2; + + } field3; + + } x; + + + // global attributes: + :_DAP4_Little_Endian = 1B; + string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; + + data: + x = + { field3 = + { field2 = + { field1 = 17 + } field2(0) + } field3(0) + } x(0) +} diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_struct_type.nc.raw.txt b/dap4/src/test/data/resources/baselineremote/test_struct_type.nc.ncdump similarity index 79% rename from dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_struct_type.nc.raw.txt rename to dap4/src/test/data/resources/baselineremote/test_struct_type.nc.ncdump index 64832f765e..dc6deedce7 100644 --- a/dap4/d4tests/src/test/data/resources/TestCDMClient/baseline/test_struct_type.nc.raw.txt +++ b/dap4/src/test/data/resources/baselineremote/test_struct_type.nc.ncdump @@ -7,15 +7,15 @@ netcdf test_struct_type { int y; string y:_CoordinateAxisType = "GeoY"; } s; - string s:_DAP4_Checksum_CRC32 = "0xcf8f9871"; // global attributes: + :_DAP4_Little_Endian = 1B; string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; + data: - s = - { - x = 1 + s = + { x = 1 y = -2 } s(0) } diff --git a/dap4/src/test/data/resources/baselineremote/test_test.nc.ncdump b/dap4/src/test/data/resources/baselineremote/test_test.nc.ncdump new file mode 100644 index 0000000000..aa94dd1cc3 --- /dev/null +++ b/dap4/src/test/data/resources/baselineremote/test_test.nc.ncdump @@ -0,0 +1,14 @@ +netcdf test_test { + types: + byte enum enum_t { c1 = 1, c2 = 2, c3 = 3}; + + variables: + enum enum_t v1; + + // global attributes: + :_DAP4_Little_Endian = 1B; + string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; + + data: + v1 = 1 +} diff --git a/dap4/src/test/data/resources/baselineremote/test_unlim.nc.ncdump b/dap4/src/test/data/resources/baselineremote/test_unlim.nc.ncdump new file mode 100644 index 0000000000..ff378e3fac --- /dev/null +++ b/dap4/src/test/data/resources/baselineremote/test_unlim.nc.ncdump @@ -0,0 +1,51 @@ +netcdf test_unlim { + dimensions: + lon = 2; + time = 2; + lat = 3; + variables: + float lon(lon); + string lon:units = "degrees_east"; + string lon:_CoordinateAxisType = "Lon"; + + float pr(time, lat, lon); + pr:_ChunkSizes = 1, 3, 2; + string pr:standard_name = "air_pressure_at_sea_level"; + string pr:units = "hPa"; + string pr:_CoordinateAxisType = "Pressure"; + + double time(time); + time:_ChunkSizes = 512; + string time:units = "seconds since 2009-01-01"; + string time:_CoordinateAxisType = "Time"; + + float lat(lat); + string lat:units = "degrees_north"; + string lat:_CoordinateAxisType = "Lat"; + + // global attributes: + :_DAP4_Little_Endian = 1B; + string :title = "example for workshop"; + string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; + + data: + lon = + {9.96921E36, 9.96921E36} + pr = + { + { + {0.0, 1.0}, + {2.0, 3.0}, + {4.0, 5.0} + }, + { + {10.0, 11.0}, + {12.0, 13.0}, + {14.0, 15.0} + } + } + time = + {9.969209968386869E36, 9.969209968386869E36} + lat = + {9.96921E36, 9.96921E36, 9.96921E36} +} diff --git a/dap4/src/test/data/resources/baselineremote/test_unlim1.nc.ncdump b/dap4/src/test/data/resources/baselineremote/test_unlim1.nc.ncdump new file mode 100644 index 0000000000..496abbabdc --- /dev/null +++ b/dap4/src/test/data/resources/baselineremote/test_unlim1.nc.ncdump @@ -0,0 +1,51 @@ +netcdf test_unlim1 { + dimensions: + lon = 2; + lat = 3; + time = 2; + variables: + float lon(lon); + string lon:units = "degrees_east"; + string lon:_CoordinateAxisType = "Lon"; + + float pr(time, lat, lon); + pr:_ChunkSizes = 1, 3, 2; + string pr:standard_name = "air_pressure_at_sea_level"; + string pr:units = "hPa"; + string pr:_CoordinateAxisType = "Pressure"; + + double time(time); + time:_ChunkSizes = 512; + string time:units = "seconds since 2009-01-01"; + string time:_CoordinateAxisType = "Time"; + + float lat(lat); + string lat:units = "degrees_north"; + string lat:_CoordinateAxisType = "Lat"; + + // global attributes: + :_DAP4_Little_Endian = 1B; + string :title = "example for workshop"; + string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; + + data: + lon = + {9.96921E36, 9.96921E36} + pr = + { + { + {0.0, 1.0}, + {2.0, 3.0}, + {4.0, 5.0} + }, + { + {10.0, 11.0}, + {12.0, 13.0}, + {14.0, 15.0} + } + } + time = + {9.969209968386869E36, 9.969209968386869E36} + lat = + {9.96921E36, 9.96921E36, 9.96921E36} +} diff --git a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_vlen2.nc.nc4.dmr b/dap4/src/test/data/resources/baselineremote/test_utf8.nc.ncdump similarity index 54% rename from dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_vlen2.nc.nc4.dmr rename to dap4/src/test/data/resources/baselineremote/test_utf8.nc.ncdump index a28e65320e..067d42687d 100644 --- a/dap4/d4tests/src/test/data/resources/TestIosp/baseline/test_vlen2.nc.nc4.dmr +++ b/dap4/src/test/data/resources/baselineremote/test_utf8.nc.ncdump @@ -1,11 +1,13 @@ -netcdf test_vlen2 { +netcdf test_utf8 { dimensions: - d3 = 3; d2 = 2; variables: - int x(d3, d2, *); - string x:_CoordinateAxisType = "GeoX"; + string vs(d2); // global attributes: + :_DAP4_Little_Endian = 1B; string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; + + data: + vs = "Καλημέα", "abc" } diff --git a/dap4/src/test/data/resources/baselineremote/test_vlen1.nc.ncdump b/dap4/src/test/data/resources/baselineremote/test_vlen1.nc.ncdump new file mode 100644 index 0000000000..7a0f561084 --- /dev/null +++ b/dap4/src/test/data/resources/baselineremote/test_vlen1.nc.ncdump @@ -0,0 +1,25 @@ +netcdf test_vlen1 { + variables: + + Sequence { + int x; + string x:_CoordinateAxisType = "GeoX"; + } x(*); + x:_FillValue = 0; + + + // global attributes: + :_DAP4_Little_Endian = 1B; + string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; + + data: + x = + { x = 1 + } x + { x = 3 + } x + { x = 5 + } x + { x = 7 + } x +} diff --git a/dap4/src/test/data/resources/baselineremote/test_vlen11.nc.ncdump b/dap4/src/test/data/resources/baselineremote/test_vlen11.nc.ncdump new file mode 100644 index 0000000000..8474f2c1a2 --- /dev/null +++ b/dap4/src/test/data/resources/baselineremote/test_vlen11.nc.ncdump @@ -0,0 +1,20 @@ +netcdf test_vlen11 { + variables: + + Sequence { + int v; + } v(*); + v:_FillValue = 0; + + + // global attributes: + :_DAP4_Little_Endian = 1B; + string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; + + data: + v = + { v = 4 + } v + { v = 754 + } v +} diff --git a/dap4/src/test/data/resources/baselineremote/test_zerodim.nc.ncdump b/dap4/src/test/data/resources/baselineremote/test_zerodim.nc.ncdump new file mode 100644 index 0000000000..3e0a65caae --- /dev/null +++ b/dap4/src/test/data/resources/baselineremote/test_zerodim.nc.ncdump @@ -0,0 +1,31 @@ +netcdf test_zerodim { + dimensions: + lon = 4; + time = 0; + lat = 6; + unlim = 3; + variables: + float var(unlim); + var:_ChunkSizes = 1024; + + float lon(lon); + string lon:units = "degrees_east"; + string lon:_CoordinateAxisType = "Lon"; + + float lat(lat); + string lat:units = "degrees_north"; + string lat:_CoordinateAxisType = "Lat"; + + // global attributes: + :_DAP4_Little_Endian = 1B; + string :title = "example for workshop"; + string :_CoordSysBuilder = "ucar.nc2.dataset.conv.DefaultConvention"; + + data: + var = + {0.0, 1.0, 3.0} + lon = + {9.96921E36, 9.96921E36, 9.96921E36, 9.96921E36} + lat = + {9.96921E36, 9.96921E36, 9.96921E36, 9.96921E36, 9.96921E36, 9.96921E36} +} diff --git a/dap4/src/test/data/resources/nctestfiles/test_atomic_array.nc b/dap4/src/test/data/resources/nctestfiles/test_atomic_array.nc new file mode 100644 index 0000000000000000000000000000000000000000..e0aaacdb69957ee1c2eefd86bd225535e6cbb3dd GIT binary patch literal 14477 zcmeHOYiwLs5uW>4du^}tD0ZHRZk&*$A#weRaRqVgtat0w8#`nplNN-t_FdOo*1KU} z1QcXcel$r{710(^e#A(vRMb$^NUaK`1*9SoMcAmc{nHk(MCgyuM-owys)8_c&Y8Qn zYj3kA>(Wa1DC@cBede1vGw05^Inm!2s;^yFt9!k`>8eWib;*(zRndF){=0|z`wr;7 zr}QRKW-M1#FV)G1m`~Ds6|L1lqmsr?gNek@fCn$8zAsTb1D1i8nvM(x_NP-vV(Dx= zmVr-URWtr{{N-cmOgxp`)wVqu%Z^#&yE>Y0X>Q$N#qzO4>d0g)ncY5Njqlvm+T7aG z+zB4+BGc_nTV4{&_doyY_r{#RRfZQljo3>fzOqG<@^CUc2YGCnz)%RnTXj%Jyr#;6K&q6yO8L^hRCEe5fJouLZ5aXg*2D*}{p z*5D}n;+af5c_*$zH%w1ewYR2r>d=NOF|qpkE=_A7o^%b9VvecNKx<#Q;YJ}J06(nu z!s;n(&>4JYWm-Q!8*+Nx5 znvO?D6R~DLr&jRcf^?x_KB-|seLDK$lW|K3ku;PLpvB2_@x4Qt`51CN)ABI%!ZA`| zOqV6GF|7ThVA!@e45g0!`rKm!5<_t4p`kFaX_WvlF1tcRY;VJH>;No6=D)It}f zJwh{C(*?rX3ASJ`M%?2bOlDw8ITwTle^UiOJmo z%1+?UE>mLXZ<5RuORR#HLrQG4T2AyoNlfVB0uuYm6F=nbT2dw-Ua|BN>ww_5Z#z3* zV(j{umMgL3%^#7(8fvaXVnQDmkXYT?)Vm)pk!#g1y~K9Hi#uQarIc8Urfs4X>FAzq zkD``XoHu;rt;vB(+lt4QYI-!bQU0p;2I_~0EOl_>lMJ7}^wLH$D0)Hz`0$6PFXHS{$V^ zu-Milo9q8W=WD9kHwCcg6m8vYXy7-HpFNPvG7BCkKAXA>zg#B<7{Fs$BX=MY~sRm5D=Tg&q4u(VEY5Hr^ zjqoq5ZiLUYt=SD5uwx@k{O#o<@D!G=g1LJKvM_+9emLK>{^#Hm4UDG)zkxYyuo|q+ zdtSgU)b^G0KY9TU<6|Q*#sY4_vWmUTh zl)BlzQ7Y}T_gB+vw3~_%uzklSs#%;HmR`mWo?6lvV;kkk(y}*Mro71-HE9{%q;j5E zdX)S&Irm*^3F4iapPlr|`O|OMSP1t^0Rz^2rs@#s-!0rXKo4}(LC00x5uRld16!lv z)UAxeW`zT}eoAHF&`a&E%d65JmKfYkyBL%0RoBaW$-jGUdQ^sf>YXpGi~&;&8{r(Z zt7t0cQ4E;zPQ^HP`G^^xQ^L0yZ!XDl$%<3c)lc6V7zz`Qe4-G~jvmY&%f3ljNH&zk z<#OMsfE$i8t_s+6a{D#Pc(M)UavqmE{nezB-Ub&pdVLMw~&IY%*oGov0Ih)|( za<;`>{uc!xpMQ$Wd7p4OuXClsoXgKC09L7To@e&Qvu9?1HT%r$bF)v(o{`6GYQpk} zj*f{QY?oMm^$G|&rc+}6Ct`_2s^*)ibi$Gq>hDEn_yeVG#znwIz(v4Cz(v4Cz(v4C zz(v4Cz(v4C;FF4g9T(a}95`cS{N`9pWt?a&esDtXvhe#hmj9jfQB zNtX(n^k5mKGQuX6iJQ?PWX$N)b}=*9aWl%!H2?kf`B<7!nay{psPRv&qr(!5^?Kn0BaYxO#V@6B?2q}kQqIubloY>r z2f+f6mc-UTqx2nWFEzcch$ThAd}m1-28Ldy#Z_!5o=6Nw6S>&O9mIt`FT)SXX1;Lz zcj89<7+uC1c)8a?d>sgef(L?wf#8U^7w$y+K?cE!W}}%{ws1jgf8+(;Yu!K}Q_(%% zeuj#casK_$u#9@)JhUP_Tad3!tBC)xGU+y(aP*fGD;06<}NM`Vx>oQa>y1>-MYZiTY>h^esE=<-*Wsr z3$2LuEhXO{0BR~~m-woPDSHb!A6h}aTTune#m7`!3$VWE9JECog$wnZXZyz-bAB=$ zes&>_#Z4;?v-C39y}7VjdOGSkJRIup+XMXdJ{7+9r{s*rdI3giB>N5(W714!rG6}t z%2^|0iD)J>lJ%=%&9vVEtX96@(oDW`(ycbW#nMckK)2fYYECnGzv)&7-}`AM-~8#; zPQL8YOqQXM&vmgJHIsG6$hUT~*U?PA@-y?f_BIx>X0lh(^A<~5Gx@qp&yTUVHIqyR zB|V?9Wo+`jm!41Af;Rc~t^P*Tm)PMTm)PM{*MS;75`&Q z6X#n~{AW3G&E&JmnX|(mr}Rc^Pdg>!`#n9I$y4&X7JV#2tvOF0m5?jsJbj!(BXXX; X{nj=H?>upO<{kWpIZXJ!&8GefSVP_F literal 0 HcmV?d00001 diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_atomic_types.nc b/dap4/src/test/data/resources/nctestfiles/test_atomic_types.nc similarity index 57% rename from dap4/d4tests/src/test/data/resources/testfiles/test_atomic_types.nc rename to dap4/src/test/data/resources/nctestfiles/test_atomic_types.nc index 066dd89354aa8bbd2b2a90305227e39cdacefcd8..887935324f29306c3ce4c2f2af2fb3c2eeaeab98 100644 GIT binary patch literal 12685 zcmeHNTWnNC82-;?VOx5kNH3y+Ws9LAG`+E@QKZnaEK;CQM4oKR?kQb7?Wub?Vj#AP z(U6wN1Mx)yMiL=5B2hH@KqS%!V}iki2bH8qP@^UWX z@u`e|lyR;K3X>Gy4?0Gg0@V1#IBz4vX;1)O25np4*b=jPjaVXT#Ni$kRpL*@pKZkA zQLATJ&Eg&-5sq{&tE+stvU*9xunp7d?KXN6i@PG7OP5twR##O9z=KspI9oB_&%5tC z_067e>aRref~Oc!oP%jp;i&P(lj$oQ(GG*BJ`ecdW@0TqNUYvy8XYlcOm-(tt0&sM zEg6T_M64r0u@z<_%y9_DE6juymx%RP!O1Xz1CGXGj-ZicQYF~Rx@bHe?b(j~P&M5% zZMrunw{PqG>jv+AJ}3$!pR=dsvA(8u*)yG$Xp7hoUhvLhKurnBsTbqIqK{d5)`pR} z`tgih;HbnfQ3+DG7$+{)Of4>s{#J24BNwR3>>Wc50gqSc1S3$uHF$85Rz%ix`2fAjjxvf!Uq!MeVqjKEQtL7<1<(Z1Nw%rzCw*Y12 z64jDhFz|sVSEwb+<3u@%xn8mn(plo!eP-y+mhNhYn)KBPJHAk`~=ZTRVxn?p^w%R?Nq;gO1VY08U$ zo^oyULODlGW2i!b$`@_?jcPd<{)_9EgPB(gD5Tq|3&{in1xLj!+g?}c_=`t88l z1axAl55Du?cN`XSfc8P-CwxCv3X#AoXRsmG!sRco4a3U_@I(FB!t?M0mg3Wz7oUfX zyxKF5UHt`Yj*Xtqxe5mjil|ED3R70lVa|i?-`*^PSawx*qg}%+pm{O>x4<6WjR6y zQaR)|8p!#dK~kZe_;n+K&^r0PfYj0gk_zQwFBK0$TOHFN6!PNW_N4^4%i@e{2l9|^ z?f6rgQd*0jnj&k*&{)-I8ZKtDRkO%9&)JiddZDxrxk=sT0sOj~_~?{;INQAA*{4t! zpBPm#bFtjfi@F(5H;&dIb#Ea?duTQBv16isyq#TqoXojlrQw2qdor&NGnJ`dkz^i*~YJWX$J^lP5gjT@TzkfaH9h9~i~IFPaKGECFTdDe=Vk(*jP?O5cSirtLM zfXjf(fXjf(fXjf(fXjf(fXjf(fXjf(fXl!nU?7bzg!{yBW+=`BOY%{_++u7(}AFB*N-@bK4e8Lq(?}L<9%w+NG0O(dj5rwL4An zTvXpBuIjgpozxRXvDYvW_ISg-#qTj?CfZFmzB&e0TP=H45$z)KN3p18>NNgoW6mT9O3GY_O-hGtX?D1 zEtSgcxl*ZIQDK!`#!Gb2NUORRYXV@=fPXMMv_DUN8cYQn{`GdXb%#TPzHrp_*HZ|2X)io^g`r^JoXmG$6j1Fz~_AgFzsIP0T zt9JoZ%c918{&{K1bq!?Y9m>Ok^|GQ~h5xp+TpHGz8hKLLEO1o#IS>P~SD>>10dutl ze0^cGwZ#Tvfl$yturWr>gPv%(FN&%NLmo;M3BnJxWr1iYqI}4|3v;F$C_R-6%lC)F z>FFY#=0I`!fmQxU#2?&*71S+;wP=d1xMY~h|9?b~r3^Gpz$Gz264(ijbX2UxWYKk9 zBcE3cD@BEBn?|8UD{YiDBBPLltQ11{$mrPX?w+3IutaqW?P-96)RuGW|ByZDcFmX& zO3W;QL4syLnMgsIU?}Yc4dv%Mim3nOBNIZ2Ow~o<6<{qPREd>j(MF6S5f?gxS*F00 zc`)fik+~oq+Yek_m}f;Ngc8dhAId}`1!W@1%klz-vhnSg_vHyCOo%1YlIBkUCs@Vs zNwg#jGIYeSQNS^#W~IVY=0n#5lz;Ne==>kP%d?gfLWyOM4<)TgQczNip{y!UC=Wh0 zb}UaQZ%a#LCQ1ufE5zuCv?Plf4@V3^)^rPFI!j?H^JA7bshr6x3-^9>(Y>~#8>V0# z_4HLWF@*%@bRj&+GYH90rSqCuMRNwoQUxPV?@olc^dZhLx@~Mh>$;A1Tx_BrExf%8 z_oxL%CGf9oxfOawcomUXx%8SU%Sd^>xUKz&y9dhxZUv4gLO4`W>^t4C4V)O2Df=xl zWwvtQaI4+^Z0ovCH&_ol4$Xnxm|P7tXKLocG|X59r{3yw0(JD6FsH$>6dn`S&F4=K z!UkbIyK7|>`qAoyUu*991QrMf%aOJd@EJN(gV!~BN-V}_!ujv7e*v$dLk%?FTyPpL z2#1=^hfl*Ak!{Np*DgU^liZ-aqcaWsG1YfZU6bX`(mwb2h`6WcsDOt39Thud!NPZ+o z7Rj<=PL<@4U&v^a@4u8&B|B9&0>!#APL(WG-3Ju8s8b1%Y)yV}OG2L6y=gH!+-2eI z=3)7UvgeLlayU(-<_@;-+%d1f=8oTf|K>yvEM`!DsC3Rvu1TtGP)(oUnaezYt3#=^ z3B?$T2eQ{DlYAci>cWGbiLqF!c2`=UsT7(LI3i@OEo3KpXGMx1Y++0mW%Fb2Oax2>Oax2>Oax2>Oax2>Oax2>OavwY z0y*|V#2(o!yc0`xEU1@N+igH$>SRT~Cye1>cWc^D$!cqzPV;!?XN>;tdL+;{rf z+q&a&4lKmJ5Z^$uiWs$@YRs*2XYYO;z0>W<=lACxzHFCRl*^+<_4e^r&{0wg^_ErU zMV;Z)p58FO$F8hBy?=3s?jj+LXM}hI%>lh`e;}~FFA(!d{0kK+P239OUY`nwyWU+g zcz04`wMh+eRWT9 zWdP0KopU|z{a_jw%ZHtM-1F&lHu90D9*-QqkBxlrsmDWK&u1fVwwDct{R4gB7Z5yz z@W=Z(ooCnbh|d!WdXpY`-#(K+U_MO*Oax2>Oax2>G7uO^z=*g?GOR9?P>|GrE`PGc fv8a9BU-ODvT4-A2Pe+=^wc6#Ib{-nLq7VNAL*}i! diff --git a/dap4/src/test/data/resources/nctestfiles/test_enum_1.nc b/dap4/src/test/data/resources/nctestfiles/test_enum_1.nc new file mode 100644 index 0000000000000000000000000000000000000000..c4874350bfae43e5b6b837cc84b62e29893a0dc3 GIT binary patch literal 989 zcmd5)y-UMT5Wgg?jkT5H$0CB&&9Bgkih>;^QVQZXh+By1s|H?^`jQ9^(!t5ULeSaG z)y=_GM?d}r-Na4r@=?Ua)r0qryWj8b{c@M{+DbK_9m>k83W8o_{XAF71*8{pC=h7{97Obz3OZ+| z06l01+;!~ce&E55FHAr2u0;?=AqD+1_gyb$tYbkZAfQ9Gh3Eh}1wRq&vSxdp?Hr&E zSxKe4GHQ3Wy*K*FLiPDODVihA9)+XUe=a?pA(6@iO|`A|;f>3CiMJDt8sP7(=I+Bv z=z$9u05GaH=es5k*nj_iSwbW2Xo+tRj`O1py|$X$qO=0Npwe$`tm~V?Z8727%!7V} zG(5EGV4YUSxVJ7(N%HJRg29o8Fjm9kbYY4evKZ;9Qzpnvc+7EUawo9GqPB5sE)j(E=Y9Ot2t8r*Q^;K~ZLIVo@b9 z_<@m-1B=55L{L$m^@sIbBiQ-8M;IZ=0AwvN+<~4L4ss;37AUyuIfOuA!^}7v zn$TczKsbT&oB-=&;AWW508HocZkahbVTn1Vse|4BOpHJPayt;f=z16F%5;Bc4{x48 zkT5d?9|H#{hsOIk2NdNOq!yKArWP{@1EutU7!=iIsYS(^`FXZRI(exj$th{JCVG~7 jhPo-KWvMy&1-YqtB{~@?X{NS@dWHsiW{bYP(`EtyFv>~7 literal 0 HcmV?d00001 diff --git a/dap4/src/test/data/resources/nctestfiles/test_enum_3.nc b/dap4/src/test/data/resources/nctestfiles/test_enum_3.nc new file mode 100644 index 0000000000000000000000000000000000000000..efbb3e23957caa12214f3b0b149f0af26a65ce9e GIT binary patch literal 870 zcmeD5aB<`1lHy|G;9!7(|4@*|3=uJaO0apG-}3ix31Z^e!lVQiV`hR%!L*>$Tucm% zASG-HAd-;yE0%B!YLz$v73?RMCj11^D z!1w|JAiZo*C&z<0AixHpK%@-c^b=s`E9|}1oQ#YOnROXhEr41BkXlrdnOe*s43yFXVo)%Zr4|)u=I7ZO v>ExxBB&Vd=n&?^T8S18_mZj$87v!eqmFQ%oq?y_p>KPj7nJxPEPMZ+`?JK5_ literal 0 HcmV?d00001 diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_enum_array.nc b/dap4/src/test/data/resources/nctestfiles/test_enum_array.nc similarity index 74% rename from dap4/d4tests/src/test/data/resources/testfiles/test_enum_array.nc rename to dap4/src/test/data/resources/nctestfiles/test_enum_array.nc index c6b4a2f3885c8f8f01c47f75d93ca4aab94ded28..f7303bbe7f946cefcbaf8b11869a3cf6c159ddc2 100644 GIT binary patch literal 8197 zcmeI1&1(}u6u{r^X45rpY_%;#5!`yz8d_~j6$*w;VvA{_O%V|xY_nTCvdPxnO`)eC zo;--)wTB)&3m&|RSN{YN&t66FAR_2{vpZ=mtw*UaLw4uu&6_vB_ui0@rwgS@K6fUk z8U~2+D=oT}j7+8z-&o^*eWA3hns3zed`#2QDY0aKol`*}k*q~;B|~p2`IaAa-Db;o zqNo{vNd_T1N)08$mtaeEXI`akp+HSV^BW;+JK+|pKt*5E;h`a#{;4NIk5k#i1epG` z{h6C@z5V#4wfA|c?SMXK;?}rg2tg#98esdL6N24scm1Hl+N<3N8gb~vq7GU#g*`5U zb`x7>G_RgS|B^E`j^8oEowTzw}FplMVcgMeb-1_{SqKweV zR7FwJlY*$V5wiW{_&G>WTQFw8SP!Lj?g=fIAbOZCctMJ=jGpBSv<&R`py-pguQeNXv04W69&yyrG`^r#Tq<+<>#6+8I*Tm)I9A7t z?NY^ZS=;MGEa+IP-Pq~`@$S^76EbJj_X?IMGe8EZsQ(0*WKgr_#VvPjy2RSdI;r|z)eiS+kwi5ZL5LVs z0-_xRq02f>>_vZ~#E_#Msfe1|=KI9g$6<%7sW9Ka_gsAHrY5(g1=&#WeqHHfi| zP<8{my4YBO(|BHr`7wOx&OAs3SH)|XmLJh`Jo7k4vI8)%KUe;D!r)RppWqL4v1|E&u;RUi~x}N29Z_jUcO~2J%x2+}( zEo2w6H?FnKEz@>-9kc6iZ?xAJBM$S~TiN-WVM-U|AYe97m;uU%_g{ZV(8k^_4uHhi z4oiT}qyn!=g}fD}*{0!wP3w31w$rsb%|52hYQAgu(B#@_p_LoBAGC6|?|7jP`j=s5 zbO7y#vmn0Zx=}mtM;x$^A6T(G&+0yc1m##fF>*>7O%5vB((;IkUyF{&KK*w)bWK9pC6QlcWs#Nm5|K^`nrEO(R67FJA(pp{Q(DVY37DP|zaFGM}hS zp*1EEKc=w@GINnn1Rjy)s7_r+KMAOUywFOyS`GTh2c#4a4mw|4(aW`BrChIRxso1k z?(2|mUGP8&Sokw!-N#@MHk2BF)B8{Mb`d$sR2rIT5PdF$rWg(O@cY;c43cVK$`Zhb ziz(+;bo9c-+=Yi0v$kP*D*PHMkXy?a)V2jYM!u`fzOQy2|IoB$xR%kh&8$kY$gbXb z^)%SN@qcaK4u15c5;`%8*(1dexj{UEUEU0~Vl&)|XE?^?%A0zXm%$8nr8pVn_F^$S z2&h8BE=%`Zt7Ev2p+=xml(2H9^1o&<5bzpe#H5DG;~&%ou|*!rmee<%0vm%-M4NZ^g20Ee- zJa1q2(!8#AfCn%#!F-5b)eCx6FKc=|h<+CK5+}6{-|$QyCm$=6#X;GH-k8~Of`1U` z7(~BeU=WEYR%P3rptjHg0fB%(Kp-Fx5C{ka{x<~fX_XScjYV!@m?Pbd=o(FVe-bwv mf$Tucm% zASD6CL;@2A&|vfW@z>s%3%|S$T5K^AYdsiGd5y}+A1o;05Xu7 zkpbOW7@vV1tP4VjuD3Y_c0MlyBO}-)AXAxnKrRG14`L+;11md-$*cw9|K|__X=Y~Z zgE}3e2q?4@BtB%pj7e=bafSsjB|ySkfPs|*5*8pnV*@NO`k{dVixq|)LpC6Q4*z@l zKnT9DfOuAcft3pq79hSL5W_-aA~ZCh6a(R8$zuTuFJ=aA1|9|x28MXI%$%IC#GKMp z1_5B$!|Y>X1OkvkAb`;zdl|w&1Z{wtBA2_rvxhe1Qj3Z+^Yd(tbn;S5l2g)bP4q1F40Tgd%Tjal h3vyHQN^~+((oAg)^$ZR4%=FwQiG0{oKVu^!0|3@LjsgGx literal 0 HcmV?d00001 diff --git a/dap4/src/test/data/resources/nctestfiles/test_groups1.nc b/dap4/src/test/data/resources/nctestfiles/test_groups1.nc new file mode 100644 index 0000000000000000000000000000000000000000..9d004b4bf9f9078f1f0d1d33bd65951bddd4f82b GIT binary patch literal 8321 zcmeHMUuaup6hHUgB#ZIZ)!MFfR(ExiiEBgCuH8fm&63oXrODQeD*6zz<<@4jNlC9! zq@cbjB9sl(z4%b@)%h@(=#zgy!8acUdlB4&ZZK?pP>NXeobUTik~XO(B^wm(NAEq~ z{r;Z&JLfw${hfCwqT_9Wg8|*|2QL4p^0p;g22{t5KYkrbPDH15^P2voXft%x#Z$J+ zfDRfB@paN&^U$4&_R5;9fUjFTd&DrTda}8NP@f@tyLy497#eI}n4jC*Y2=TGzN7kcpDKO%#aMkUx1ccL7h{O%#ReA{f&MDR8mk_7`O(?k zs;@BSjYyTDYhL;2>msR@4WO4o8@{bw{0e$$(8F$WOb%)IzB=;l`>j;}_Q9<>vH?*2 zzTT}}74?TsKBg3IR{aZ?k6aS!x1H29;mo?GX$nGMX>^jiKm5cY;kE!4bo-(EP2AHf z4uTONe>LFa$E6ypN*nfb?~a~m3WW{ufuGin#KWl+Jc857|LFyzlT)!oYBHHfry}8a z49u6%sJN9^PDq5OVq*N58h>ssw`Ad8#>(4HBsy-PPuTgTTp@3rf7P+_1*g(g$`o^% z^YeDl;xY`RkdEs=1STnzPT06TCq_r&ttT2D_chI|IgvLOrs zW|RY5l8Xal=-De64mF3NbnwHlS**oypTdCU|NEi8gQgf7$5C};$|xFp1;rE1p-4w1 zy>I2R#1Q`LESq$et3BBppcdm9@@%ZU#TbSxY``MI0!sEoeP;~AG~U1&Ce7l*6Dbsm z*<3#3*h^bBrci?$io%i}IZ_-roNczxYC=9Oq@33GIZ|8;EL9%MArCZ>KxF@ z6m;pEN*}{|#vw&6Dzi}CwyrKeA4$fA@n|v@QAf!iRQ}DwUn_3spA2jhZs+kb&Q{jp z52M%wZ!7hF3vs6_T?AYNTm)PMTm)PMTm)PMTm)PMTm)PMTm)PMT8cpHnFadKf4%F< zce_=y^%@a(vEK3J2edLXLCi2R6J*X4^JQR)W`Nk0>DYK|I+lpU(t=$X!6k?w$!46) zlI>JzmNGpJ{%TIH9{W_AKw*Bx5RhrYdHrfF7R()MZ4(aFtb2e!ysPtnkBnPDZkOdKFk7Q z{%-Vm@Y!IfKWmrl`NAS51f9OQ?CkJpC>RI3;hW|` literal 0 HcmV?d00001 diff --git a/dap4/src/test/data/resources/nctestfiles/test_misc1.nc b/dap4/src/test/data/resources/nctestfiles/test_misc1.nc new file mode 100644 index 0000000000000000000000000000000000000000..d17d1ccce5d2c68abed0606c44977eabd8959f62 GIT binary patch literal 16155 zcmeHNO>7%Q6drq%)J-;tft0kQw9AjuLR!~plcGpON$NOFMCvqgkWeLLw($nLb#~p| zO-fNvd+33Ro(d-p6jj`~6ev_2IF?%uh$DaEzyT^j#03dj%6l{OypD+#TcQ!F<|*sh zeKYg+&G)_e@pCSXkB+rAKh_+ML>S3EDP2QC6PFdI?{@w;H9k5M)^CKLjzM&fhxip81wUf!D5eqsspYtT-IymLa|^O^Nwqr zb==cl&M7uM3Kc8_?S*Is)BlYgTIfcWe=UF0&E0Q37Ydm%4ygMsNdxJ=6O=d$yC z3CD4>dE4|Yk41qDdObP`@8v=zKIlC#@&K^JHzeJ$>m!|ydQTP7b?~R0bj$R7 z#wPB3*ZyzLX#g}Wi1Q%`Pn2QS*TVYl0ke&5eB$*8J=VQ*pPNfqZCe9Sqnyvqfl+h(dlgb>dB^L3UvcetyBq$vLv{){#qrft4=N=WW?l-@X1E zN1V_cTB?t4?4=*7!uNJ**0bguJL?%<-k!6JgYo#l{&+9^LG{anUwm6L`A@8~>hc{# zYY~Kh|2UWgq45&o4OOQOGF7&(Y`jd07kwg`fhCIzn!&}hriGEOMs2cZS<&-UZaUy@ z&sI?-cUjr42{8ro<%-4{7wrO&Cby@rZg$*23;GGM_*bsw!_XHQo6Y4t1O80Iw*18C zn2`k=wwHHov2>XxXMIOnWHl z1(fr0oNuBT5V?=`h*qo15gx-@xPi>z5`(6&0bVtbJORysojSHu!k0>#Z1{4y0^uFV z)7#(u8!@ND25$j+t>D?TI~XEX1>)-ZZ?<>Olc=>zgq@{VZ9^ydYUZDLdQeACXF zZZ>0^Fj4XNvjZ-CiJ5mZMc4AYMc2xhe#W!ROu<^R3bew@gHx~rCpnTX=}6VQg`rH z5IE*+BtQLf_oaZ7GqT6)vKtXCHy5VC4Ea?CF>ey>SV?2|>R{;w3`dQ%vnZbNf}_~v zM0%EUil;PO=W$ajCxQsUC|i-if~b~1qhsaII9bk}`lJ77Vrmlg@KP@P9`0!4q&ICp!cX>8U-f1Ei-}BG=TC9a`0db;icq=}wgj0fm4l zFl&%Cebcl2AU9D;9J0tpze;t{_kHQ#uJmW0bC(`Qg%-Lk^DI2W37XCGh!P=ZpNoE7 z?vV!Rauk^_*+h>h1=Ih`twr=mpA>n(+7m`Jrt*>!Mwn>%VEW1r>jngNz>H3iqq<)K zu_kE-Zyeh3#z*K<(>8d395>~a!bO*2N1qlr$b4ufl{oG?Ma%W`@Utj}b_^~AZ^?2o zojrJPA7r@U_tU|?*g&jze-=}sP7#vb{=QsxzJIVc)*Fu<&UIhE%Gm01Z5NnVq7YCB zCN2q**;0tx|zfI{Gb zLEr-XGuQBNZFz%Q^9!n-!c)b7iUAb^Dh5;xs2ET&pkhG9fQkVX11bho4E$eW;2)@Y BSc3on literal 0 HcmV?d00001 diff --git a/dap4/src/test/data/resources/nctestfiles/test_one_var.nc b/dap4/src/test/data/resources/nctestfiles/test_one_var.nc new file mode 100644 index 0000000000000000000000000000000000000000..7e0b4b135cf1f1ad5158f220c6bbda87f8d4d672 GIT binary patch literal 606 zcmeD5aB<`1lHy|G;9!7(|4@znf@wjgxtJKh zO4vj|3K?0T${83--b0z9G7KP5ph@U@VSE7rkka2!tKy;h7<6C^V(Fc~-+lu-pO=9V z;u4Vmn0Y`h6ae}j;y48cRxXeTvlfUCWHfLHfox!AjDiLS+!NbC;zJXdgnTgdclPk+ z2?V*HnSqai1LXgBKj(m={DRb?lFZa%24SF-9uR~4U6xu@oSC0zYowExT9TZSW^1Bn msb{F0l3JFUlV6aVnpdKek&vpl7z|+dFMRpe_Klfn&P> literal 0 HcmV?d00001 diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_one_vararray.nc b/dap4/src/test/data/resources/nctestfiles/test_one_vararray.nc similarity index 78% rename from dap4/d4tests/src/test/data/resources/testfiles/test_one_vararray.nc rename to dap4/src/test/data/resources/nctestfiles/test_one_vararray.nc index e0cc0ce34aef43f68a02eeed4a9af4a43d44f5d3..48db970d495a42465862d2e7a16c4ef9ca8d0060 100644 GIT binary patch literal 6152 zcmeI0Pm9w)6u@65Z3!i7yV_C}!KirAHMF%ZdMH@Z)E2v`Hhc0CvL?$0y3NvN>qSr& zJa`iP2!00fEPe`)9zCfiuln93V|SNb?+f#2GB1;Pf9CgI66o80x3^NfTx6OCLjGi; zT})@{*^OTZeKzWM$4vjouJbvSWw(UM@v+E2p(TYXos}G&Nm$VQnQBm|kfP-HI?|H6 znb+zSAOlr_<8H-uxlFd-R5}BA=>V`Qlp`bi;@;rtuiRG@9+WAHB6c7~wL%%MUc1U; z0~k=#p!Nzq<@sLJVj9%Rg1*mUh-7o8Cad43r79FaBj47ro<3zxq(05n1+ef?HNI|8&2m@JT)Aj-mtP+i;3nF6xrz%JKPc~m^2nqByGjA$@eSL_Zw3n{WwNP*rMpP--W6;oh>mN!MQNzZ_Zp$6{-uN5$6k2^C+364WW; z*zVb5+p%nqM_k7SpooE=`13GXhW=Mm&<+DVDI@XRpc^i4J{?pkBmF5|Qk{9@d5-mD z7Vm|#Btlr!fF>T)fQxWO-P3NaVMAdnv|Hu_vvDT~7vUt{!`@2Pc7pAD?S|Q?o9iEb z|KJ^shEgN}N#HCJcw~)+{7uHcr2OT~w;|qI;wvro_O&E5IZ6VOfFvLZNCJ|8Bp?Y$ W0+N6vAPGnUlE7IZK!26r#N#iDp5P7u literal 6248 zcmeH{&1(}u6u{r?Hem@{n`&!fDYy!P2Ms1v(L=$o*_hCDQY;2+{i1pflBUi7`$eQ7A9dM(ULHg9I$*Sz0O=1r|qUCwM|fW$Ch39@p? zKYtP#_)lW#yRnz{may-EA?H+ZP%M_ zr)`%T4wzlC2}sE(x4i41lZ<+bnxpmyL1^K(XCXzqQnkDQfe~1%|1z>hMK?LB7%JsI&e9$^ z3Rpo#`8hU?dV3$>2HJ>S4j;uyq1u5F<61(N@H?^V;T?WEVqNj4?DHLtXj z%{rdf$7OwQ5o^ryQNj7_8Hg8vrWwD|>(l58o$mRe5LX*sU#bmEq-V-{-3>qWiL zk0`~3!mZEVcjC>}76s40KJr_$ez+js5yGQK(Z uri-lr-&S~}v?8DgC<2OrBA^H;0*Zhlpa>`eihv@Z2wWBdtGLlS`1}Q!=HxQ~ diff --git a/dap4/src/test/data/resources/nctestfiles/test_opaque.nc b/dap4/src/test/data/resources/nctestfiles/test_opaque.nc new file mode 100644 index 0000000000000000000000000000000000000000..209d748e748eef8ae2cb3227acb5dbad18db3719 GIT binary patch literal 659 zcmeD5aB<`1lHy|G;9!7(|4=ZQ2_j+um6)fpaihP7OAr&!7A7UI7&BA_1567#&BesP z2vW%=1|k_*KqLq-=f{`4hcMxCV1*#LvV21YC`VL=0i=hS5vL6T0w7~_pbm)#aX^3% zLLrl<6T?iw&R5uXt2r4Ni!pOBu!;iJg2R9frs?(b+O=Q}ybO#Gr-N((ss%a@rka%x z#ADV%gdWfoA&?2ojNMR2!R5BWOdfi)Cu`SSe`gPGoHV%6u{3u5=D{o0i+E@NSLn$(kKaS1w*7pjzglR2_%^iQsmYyHEQE3F&PjD z38pTL2v%5-5ED!c{0A&BAXNylF);K$0Ny*_kv2*e7M6R8eP8dL-}}9Hm)&Z)5{sUU zs*wm0@|%l(BAChXg{OC%OtV^UsoFdBESsa0FA09QR*v8sg?e3oKj@NV z5<4beyT@mRh04ct=oM@}m^npIn<`}ddtyxD-0VP8-2489xvziNd%S+|nWYgDngLbD zAS`Tt{&)}=#I7hx3TIVCQG`RHr6~;Y=$X^ZCqi_Rj*#?2&GTw668?OLpjmOEe)-{YprcLSzSnhphGI`A14|*)NMHa zy1lVbcDG%dBmrKKL!CJX-vlwfEMH*IW0w`>JkF>9QLvlVLOy`0$Ve!TBYJUEp^&L# zxEE9auTdR`AcCqoovMj?l%yaCNU8|J@Vvh5_AK8S91dkd%5eh}?N-1$0U3d6 z+8r_n8kngxJm~tQ;(@q$)gf8jZ8XMuS$RA6t!Y$OM7W~91q$sxLZ>7_a_B+Jte7pc zVVGU!!4hnV9@v&|4IF>u%HO<`$f2}Nh*g|9bPPp|nWr#*)Xp!WhhfYXoNzI(+6A5W zwHvsEWy9*Y+c2*8y&b3TyTBUjISUU)KXm$7jKx9*>JuufxRAY?&ClD;(An~Kpj7?L zroFLP%xCkt?9!*t^H0D?iXU% zNF;M0gme@ljG*FTj8M#@6#CHeX$bTG_)D^~KQVy)t43ZBC7PHnS`9wZ^0`&2WOPoV-}6g=Li zU*G)vs^qS%&o0umP-`)lUM*NxuMgv{D%%)3E%@m?ct*=(b=s^z)YJ&Y%!Wr+O5++{ zoJMu4J+SfLu(1K$Y|d`AvDVZRcJp3fcYDEK)3DKRH<}$kWwSW&wDPq$F5Ec`3?k$| zE*KYXQk$||+yws=4>xFvx&mcWU=%Li0qtKWKLK$p*3zCL74nrTz%jH@5tDdPLriNj zqElBLL!ai}vCKpEJR0_i^JDpqEF2|;g=5A>%NeL=t|`MXhdt*!y#eLXXg-jI`+%v- z6aq}4?B%?&S9HBvn8G41rMI^lL1W+ta^*ocPIX*Y<*c%sx-@|fVSCxqXBsNrJqO}3 zC!anQImtGyH33aP61eV`3i10oBWX}*8}NUsCb8Sx+v z2!KT)Oa%ELecm3h^A+~pYEDMRTFhz;tY$z%Kw(e;)DEN}PE}y2WMDz&ZV!)r3^s(9 zff3>zkljH2KqnJt0xKU#EwdIPyn*%#ft<ajwXJx5H#hLkewnjR6sU^uNX|^VMmU@P| mDXC?tIr#;-sd*(j87XO|wuX9!26|?TzP-~1C4_&#LGCLhDKwtLcnmj+F+X4rXYwVO>^Du^Kd3%;taLf=FL74ds!?1wA zwvacH8Ix&Ofg6|*^d@AJlcw;$;QP-kI&~fXih9L%jnueqIZJk>?o=!K{B>8a zRNdy#O0nh?=gW3fCy6rzq`>-}OhZ70tnHSpg?P$Ya;zOh(it)qdyy;u%po0QL+_Ep z2md>VXMT@EFEzH)v+q3)r#L?bXUP-@#76v~0i?YTaSqe>7U{uG^i_wNbpi5YAFir$ z=2wO}?1E6-D!a$6iGC{UgD`=#p)fJ3)tcp0imqMX87z=g6fmT50o=TH&5P(Rh6JO~}rlU5)tDD?M*w$?s|-|LO_t(-A&iMC70CkhLUYh~Pu%DUJH zBA7PE&1o}hm<53V=|xYg=oag?+l11{EEaApDTq)YAS9rvmO)cU{NCedze1$><9`nk zA>F!lXABY1(evGpehNWig%BmHkTovXs>^oGb>PskbVcF8V_30kSa%YqhoKZf5lO_O zW6{_t%U-d|)n%wk?(m|ua5fQ(#zvx}y&LC0!6Yev#K1)(mk~$m$2J`=Wj*~8Q|h$a zsalhrex3=`{Vr-rEg6suNCqSWk^#wpWI!??8ITM}1|$QL0m;C>VgT>^_<5@b^l^Cj yP3XXfYP8|q{u^k#`+o(EzF$D&N2iaV@y`DaG=63L3>vTcA3#SyzXgpSW`6*CZ+jO2 literal 6272 zcmeHLPft@p5TAXo;0q~&f1p*2KD~G_HkP3AqL#cqETOc75|6fp_Xv&HlJ?n)_21F& zU=zQA2RZ1$BgPNl&6se~4`4i)nCQ&z4pc}{6XR(I_RZ|>%)H&-Z>CB6G?$$j9y&P$ zB#r|y7?mbJerS1|R4Y8^{R$g>bTOA*wBp;=Ik|7gv>T_{tA{KQ&PXb^I*z3Xb z_#N^Sa2Oo?D;K&I|-avvWk?XcOZHR{*Woq8Cp1gq<{WnP*}O{FF; z24Oo~Z*1HR>rrPdSiRiikWO7qrLVxK1m=T09zaH>#fO@2KKPmxXw%HqTQ($N0PPbv zD0b8Vc`5c_|Aig@ob(^ZB;?=L>%UX|@)y0_oI3P*TjjX%ORB+fnu?gZ0fN0!j_&Kp z%dKyllDc6KLQ*e;+Ol*G*7k9_^pUe?cJ7vNAn^#j1{~V4EK3GDM=8)2%pZawg_*Yd zGku911q@22z5H~kgmYq;P*SG?$j;9Dh0<)XP%e4Xd0*4Ds&8ILPZEVkhiE~0s}vwn z2T1pGXMnI|yx7%lm!moTdX;xum-lscAzj?^pHXEUt?*l z)^hQ`>SCdK*%>#eVNFu)y36+>x88_$x7yWat-8D(rd*au=$1Yf{*bsVz4Tuc8xyTA zfkb0oTU0ctF5ZrWiSFOh3dGZzoZBi4V2X{u)lV+C-z9Nl6e(g{vQ{uTq3uDvrOO1Y zcKW@xyJMRf$(!s?0V7y$$(}OH&z6>Un>>ppxb`VLp3xMb|v7eff0jq0IgYTLb|c zfe5oN`ZNBbU-100%071OXeJ;gFMoM+<2 zo7Zd`Z4lUxz)i21msLb%jKUSg70Hdry~*nV`o6=#jj6+BJgw1(#339k&qvrY+8|&M sFbEg~3<3rLgMdN6AYc$M2p9wm0tSKqjR5^3%D;Qj_jdZ8&vUYW0zJq6dH?_b diff --git a/dap4/src/test/data/resources/nctestfiles/test_struct_nested.nc b/dap4/src/test/data/resources/nctestfiles/test_struct_nested.nc new file mode 100644 index 0000000000000000000000000000000000000000..fea0edba273b5650c2c0b59e26dc3dee38a730c2 GIT binary patch literal 844 zcmeD5aB<`1lHy|G;9!7(|4`t=3=uJaN@zw;-0JV)62!!_g-Ho4#tc=#0Mmj_b1^Y6 zf>g4JgGfde5D5Y-#fI@E?;&isBv>U_(kQ;f1j-W-0I5361W{WFp%_GE7(iw*Gvc(F zfd{G-PVsZyR0ca=Vc)IhWMr(xtj54<2DAbc1{Dkp0zew#R0W1g1{P%Q_VC!p*bT{G zPJtK#a&TH^YEFtF0|Rk}f>j$aa1f_@Po~d8uoHM07$G4F3LK#Azz_qOKx_M1#XvSO zYk?yM9=Z?)hY*NnX0(AO47i#gG=)^+Za!k+=I`v`%_agekdXzNOc)p|wnNhoPasH! znSl=&xxhG$_j3*?$}dPQD#=VOW)KES=>aiFTUlyRab|v=t&vV%YDscRnyrbRrJkW~ pN@`hZPJTgdYF>#>MoOBgt)ZTwfu5N=&(lJ3=uJaN*wU(Pxtq531Z^e!lVQiV`hO$!L*>$Tucm% zASD6j17;mGtwszC_>2lv_makLlmoL3no-7RMiDUj^bPB8V54~%7#YD%2L&3?RG`mL zoJ69ztXv=yn6+S$%^?H|S7yd4Xt2Y?8QMVNg9EH0oBWX}*8}NUsCb8Sx+v z2!KT)Oa%ELecm3h^A+~pYEDMRTFhz;tY$z%Kw(e;)DEN}PE}y2WMDz&ZV!)r3^s(9 zff3>zkljH2KqnJt0xKU#EwdIPyn*%#ft<ajwXJx5H#hLkewnjR6sU^uNX|^VMmU@P| mDXC?tIr#;-sd*(j87XO|wuX9!26|?TzP-~1C4_&#L-M0gz@Z zs8ixW91!4vPzX}sLXRKV`3n1PH76ru6=nqnRtsjJ3xKKxfB^xqn}Z?QkRjQKA=#LL zk%_tU{_#k#c3uWXh(|y+0(Alv6Vl7d4pPOe1v0mhLkQ$1X2zLN7eg!q3M~bR4+(He z!6Cul*~6PB5ae8D20jK3P%Op!IR_Nw7o--IWTqA~2m__`fEeV>vecsD%=|oCBb~g| slH`;$TN6D?Jwx4;)Uwo^{DR!nyb_&^lr&RYLp?(SJ+npM-f1%e07bQT7XSbN literal 0 HcmV?d00001 diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_unlim.nc b/dap4/src/test/data/resources/nctestfiles/test_unlim.nc similarity index 58% rename from dap4/d4tests/src/test/data/resources/testfiles/test_unlim.nc rename to dap4/src/test/data/resources/nctestfiles/test_unlim.nc index f362f967fb04419bb47f89d756dd3bfe5b57f02d..e0164af8d0af5d670fed8feac5a493ffb1284c9d 100644 GIT binary patch literal 18251 zcmeHOL2MgE6#cvFBv!IX1GIz|)R+nhMA~4NP*jO1i5w@5k~(S911H=iyJ-xL*X(Xf zL6I79LkJ|`URA&W^-x6uZWO_V148PlT*|2eaY1SX;?hg_e`daIl17maL{R;&%+Btg zKQn*cpZPQXyLtE2_(XT-p-wxU2Bu9z)03K$H3jeAda`Tw)cCyZerX?3JSSy}xXRYN z(*}z~dVA@*=Fk;jLT3Q&d;{PXh{g~wLgjlV6hh9RJ`Oav52~KR=@sw`IkSH`rU6?7PShtWm!fg>{*kupEQ0b(@$C; zWuPw&eV6gBt&>WeXElFgRgY=-pb~?RbOr~WP!*ka*op-|yJIBk;J{oOT&Wl&i~iD3 zJ`5wjT=kM5hF&xVcTY-Uzlu1g2X_ER-T*8=Gq$jx03)agu<@zWh2p~0Y_YVEADbzF zdzknRv}uHkW2XyBo;o6V#7;HppiB?yhJ4m-yu4EO|EU#LAab7}P3va6P%S61YPA~+ zsZ~EX9|b{Ns)kXr3~>F-txy{Qnv6h#M4Y#3gzt^@KGDtWjSGg5%pMnro4DK=Y~W%A_9cR|b)FVj?k;|LWqS0k&>; zs)cmt!;XQ5wchB^+!39bYkMEvSSeElQb~CwSl0dka<6>-UZa6)kLfxeo2qU<8DRSw zC!DA`YN<7QtIeBV>SIa6*zXP3wT&%wyo3b*9eET&6pur*8i6DcO#5TBj z?~s|y&(0{o)KNmqU{M`mULXuVdkf~Xd6>`V1hcNTwPRdMozL=oX5n_&aHI>-xqUj9 zs~{i<2m*qDARq_`0)l`bAP5Kof`A|(2(*p>MLyCL!@vNKefx-M0DtY%4{-`fw5gCp zmO>Kqg^9v^p_ng}R7m0kN>S9n_YyA-Fe1sZ2_M5@)wql?(DZI0_ke%*n~s0{0x3x)@>89p%5t1-f5(QBG}_Mo4I$IHTunH#DR*v(}+VbpLe~g0#@w@2oWpAAs8D& zPX*khKRfQF|AIhzvD+{Ag9ZFBu*hJUN&<=2Orr ztf3i`qs#u%3&Xj=Tz2q8|4-MK05(>)Cu|DVDBe1Xf0))VUB#3c1IS_;#WaWM9Hts3 zAwfV85CjAPK|m1rKOt~-zEH66aKY~sIaf!)`wV3I#Vt%*KlAx%OQ}2x0)l`bAP5Ko zg1`fSfIcs5{|L`~VzuiC@0xfE%UiqD=ulrPHH28c9wjkF{DDeCQtku+K|l}?1Ox#= zKoAfF1OY+dzk$FN^G|bp literal 18392 zcmeI3O>7%Q6o6-U?Z~9-CT-KEP@r2MmYhO^4`uqJ4$WwQ=wAny<|K) zGjIOBH@hppyj+=`n$8YBF(^CeOp zMk>*xakl4!y3kN%I9|qt>LsR=USfbQgfNdNfC(@GCcp%k025#WOn?b60Vco%m;e)C0!-kc5-^Jx z3!p&&0Y(c%Zq$;n9*hzgft;cQ&tEGA!%6lMT_ybH3%hcT2O07OOUu)FMrD{c(hp|l)>6k^Wbhd(O z*bCP~y;^o8go+En=2)H@+dMa4o;^b=)BCPW?PwRwgfba_(#P7dw-;~}rSru}RsTcM zjF!S6ke$Me<2vGSjpCHM>N=n?oFQsftWT@Of;o=1AQ~4uH=;<8EVPoQBVP-o3>%&w zL`~@Q`C}8k&8x=~;9`^*4`|+V35<7>@d)BWGOzF5XWlmtj{Md&%+JrNg_e@_s%&5% z=30ty8ZF;TkEymda=*Xa?f=e;s`kMQi}RSr`We>5wWw(X8CKdMoZK71?eBWqHBs*z zU9#(GIBqDDqPRm8@4;QI4(RhoRF4l-CQ|XutaP#JXhv`3d$hgs7#n+ z%Eao0we?|!qZ69ug01wkyFdB~Ekw6xGKw(ZF@EHbDh=$#TuXI!-wtjjXZzc02VTMM zW+_%lg6hJ^_8dEK8lD}WBz#>yjzgdli0uZAb|Ay>LLeJ<)Ci^BXki?k*;dc+A$Sk% z7v1+yb*_G14T0|`JaKrJ^n0J;G#d#P4E)<#rgKj1h+01Vrhu3IA;P(fC(@GCcp%k025#W zOn?b60Vco%{wV=;Vx))hYrhUY8~XN*PCD}%I%G64BqH!hELNr~iuKVH$l#Jy#9V~wGa z^9UWFD39juXt$ppKXtX&?uh22xjXVPSx;xLo?om~G;j)%-6%&t=iiaflK;OYeInPd z@6AM?+DV`MTeLRvYmpx3On?b60Vco%m;e)C0!)Aj{9g!M#+Z#s_=R*C(kGCtk`Q@F NlaLl5EkSCR{sha|`#=By diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_unlim1.nc b/dap4/src/test/data/resources/nctestfiles/test_unlim1.nc similarity index 66% rename from dap4/d4tests/src/test/data/resources/testfiles/test_unlim1.nc rename to dap4/src/test/data/resources/nctestfiles/test_unlim1.nc index 5b92931e639a768c5376d3bfc20b9472c19109f7..2ad96e39e09dc3d870a7284dc22d8167e823257d 100644 GIT binary patch literal 10059 zcmeHNO>7%Q6rSC+Qqc zd*7R%_1nBNJvr6ad$8Be#BpR5L2oWqK9vUaG%G$L#&)2t!X1|2I2`~?W1B-39fi6t!9v4isJm6QT%$c z9JP9$qy}NJ6~bwH>F;2HcB`s={pH%ve@gTF-m)xc6}Dwr+9VoTk+TmLKb{|g6-0S4 zm=lB7=q}rf7Uwy|zkgNvG^DL$4H7Xx!QkOxB#kSHYdpBa{2;>OD8E+UgQR)S@Y%B+cuQ|jY!h#c4uK?Cj6y%jCyj71$R95hP8};0>5rQ3{3WimgFi|PVLO(^uJNwR z&+W+oK_cd>aIa~&9;im%k%tvD_pjy-p~0~;KOR&Pn5-BAY9Pe(BeU&Fb7x45`gE~5 zvkzRe%@|zIW!w?n{_eM3h#enWQiAwSGYV7PO?m2R2i}(b^yS`R=WBH5m9qJWa$izs zLciMLlhg}+FZS!9M`6cdiroPNd5yTWT>f)FfR~>pLYx9b9k7~?+JQcZPKH+mNuW|`JILJaNuAI=)xXVo2x;wf6z0^wr%1ClcK{uz+a#<-6CVNqh0+SZone zprDxjmDmSR)OF|T=Oi-Dpa)C;#^f!{c{qO() literal 10266 zcmeHNO>7%g5T5;UFwW+uY1)*uQmht4rIN_0T$Box#B!V;)o~)bcW1FTcvWZD>~32Q zK}6g@aH_-+aYjPw0T4ps$gM{tE`Si1N}%#1RpNxg%zJO_Hnjy+g{n$#lDF?~-n^M_ z=Dm%_d3SAjWh6750itvoY#0|!ejF&8J}XDK&-2^d7*KDnEmuwFZ}YU6w`|46Vh-0C z6AWS*7g{8yWM5IMV2B$4&Q)p~FbZk>saJ|yQP}aK#P?zxKZ>O&=JA1a-HT#B3@**@ z1zyr^samDu(Rt0$zH3ubKyRQ`MHI;`Io`T({={xKpQ50()LjB zQB-siYoRsP-ka`jr|o5T!YF$qjIPG5u=CTo=z_pu1PtQ@GGQh8E$Se3>q!!HBs+tC zAj-m28m8XHR?49n(=-h^^T(c@rV;K*z`jy|eIQl?96Kc#tP~sun)^VL!P2I8U;s$hVXcP+28e>$T6N~ z)Utw~wWW?TOTJ(jML5_7u7r70vV?8&<$lb5LHQe8?ioF}U?AJvMH=-rT4@3R{ZIS`nRycg97TV%4 zOI{lKXf;h|2Q1U%b4f8n4F8*pUm&ylo!}Ji%77&PE?sf}m+mgy?fGR?slF)Y_%Sp^ zEyLz$w`uhZi9?$C^~kNBfC+VCzn7EZZhiC0gB(j2E!z=$jWB4&+1L*nUiN%0 zcX2j1kH4=jewOLF7$xBfORixf_-5ul`{(dDhrqy_+ZuFpr%#famT7--k`$0ilX%*a z4m^i|)r~h+f@>LN8_Fx+;2I+549V(unUQpcrnTh?ZWzAv`$h5)A5S@on&CCxQrttw zXw9ko;o1iahAh>>l~INwF1~4kj&n?(zt_HZrCKT(m=t8c zaZP#7|3bgKD7l!QksGwuJp14b^K*WSb>qC&gWS5O5zq)|1T+E~0gZr0KqH_L&nc%iHA3#egEdo{N^{)N8YnWt)5C=NUFLH zLVj^E&qp&wzVPaym+v%cUDbH6USV^Z%9q5Jw<7 zrZ>6S+(n=rngYvq#W<58D?c=P1N5T?fX#}5Xjk8LV+?-kwxVQdR#g;5L?Bu%ONh^0 zzQkMun6Re9+GEs?vskob~ELZMCYs9-PG~LQC#z&278g zYj)cGo>gtxVC*7gxFH^GXjivwrhk{~?;QA36Mv35@&cR&lr zR}>Z+g%>4Phxj?_YS-oo;#EiM`YL(AWb?8!X^0}2RZnNON_rY(F%V3w2*etXC$2wo z0&jXU987xzNC2bl07fg~JB_f>%px7FW^V`9QG;Nw;X|mYc$TfOF%O9{`X#lcbgafb z5t=Alt^&r8U~7MnZv&4?{@Zj-8Oe^q&L#ps~vCb z^#%v`y}p0A-`Tr1WsphVNN27?T!J|=!vSxFf+C>u>DBSFOm$&Z2#HFFP{SFsG?&Tc z+?C5RK>!<)79@{wjEF@V!!V>{INb*|-4{8_go`bFW8+f0wb_?`+;xw z2mVAgZVkJwcF#-OT(UUQ>(7Zq$O+EGX$2`#+>_WXh@>bW;zYevnpP+&&N<2VPa5ky z`I(}rma-i>on@_Ulc|6uj3YJ0u3W0`0IZ;n=1by5f$)=OYSWS3Q{0?S zU;_lLcUg>1c2oJViia@9qmf!jcR#v6$Q!f5Vha9UC=?KTi;QHAx8Dz38S`wjeB)>kCT2^MS!_5f9_RS^_h($!QWMYw{!;>X zoN8I_UTR0?os84r*CKBuyz@nrfqMTztGz3G=2icqlEKs9BzPCR3El@UgA>(>;>psa vu4|frCZGvu0-As(pb2OKnt&#t31|YEfF|&73D7y6|MaA@JDumbO=tXH;Ck{q diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_vlen1.nc b/dap4/src/test/data/resources/nctestfiles/test_vlen1.nc similarity index 85% rename from dap4/d4tests/src/test/data/resources/testfiles/test_vlen1.nc rename to dap4/src/test/data/resources/nctestfiles/test_vlen1.nc index 4c7f0975642da98433a047ea28e435c7424aae7b..a4bd83f8b70ed31adb2c53b850aa97ae23a0facf 100644 GIT binary patch literal 4765 zcmeD5aB<`1lHy|G;9!7(|4=Yj2qIztm549)x##cU62!!_g-Ho4#>@njf@wjgxtJIj zK}y&pK_nv!hy($)vYgbs_>%V!9s`>Qh{4DLRtsWPC_$N`G7KP1%!~}^M#K050wBG5 zP?yAmI3U0ap^(UW*XJj}&R5uft2r4NOE8Ntu!39&GD-j#5D<4NFl?_mya%j>mw^%D zc#t(f)j-!_Q_m^}l3~^YI|<2Z5R(HOn#_#7P?y5hEJ9N_NV&?VOe+1IJ-m4WK@MbQ z;A7wbg;Ttrb3jpkL26M+W@<5mFi=Vlh(UfVOD!tS%+Iqm(#cCLNlr<#HPN%wGt^B< zElbVGFUU>JE78eFNi(%I)H5{DGh6iSoi-@g=R$)A6#wqd{yyMz01YcJ8z>G7IuM^3 zh*^P{9f)Dz0zZs3N{@!XXb6mkz-S1JhQMeDjE2By2#kinXb6mkz-S1JhQMeD4E7KJ E0Ot;MdH?_b literal 4863 zcmeH_%}PQ+6oAj%t9B7BF@uU0(WXUoK{IL7BCeEVWb^_?I+A2p(TfE60zE)4;HFKq z=|$SL?G1VaJ7=5|A+;|!=Q4AC=giDE_r6j-Oea^9K;n52gN!kGny_T25q3F$!NxDT zRwahqA4bU;zb(i)xwz*R6?!G7wR>J-d_hhP0PIO}(Nx*xUm0ON}| z0+YuHWvKgub~oJ5k3ti1F@A>%>WDJ-) zb3A~}XuO&f8)09PRZ}>$pc5$Aa{-$GZOQBe3OsGXR!<-)5N6Z!NQ^p0~lSY8*{5-kLTfDjM@ XLO=)z0U;m+gn$qb0zyCt{B;7KLw0!b diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_vlen11.nc b/dap4/src/test/data/resources/nctestfiles/test_vlen11.nc similarity index 80% rename from dap4/d4tests/src/test/data/resources/testfiles/test_vlen11.nc rename to dap4/src/test/data/resources/nctestfiles/test_vlen11.nc index 729e4b607b28eb57afb11d9d10938b9b2865759f..24be975829c26660c46045fc987eb2eeea8f922b 100644 GIT binary patch literal 4850 zcmeD5aB<`1lHy|G;9!7(|4{Hr2qIztl{kBI*GYd5mmnsdElf&aF=l3{6if>`&BesP z2vWi(4k8&@KqLsTlo`gCyoa#il3N3Jlw84(|c`7(pEUtp9AHZ4fl6Mjc9UX*sCGXzd{qEhbzr5U3E4!K0QVPgS6AZ|OTVB4UHD;p> z$6P<=%>-YsRt~lFhqfHnbzQ>vm~o%dKoDfUfJ^{%0pkdc)8~W}kOdQe%>$<~==HsU z-}Z)>C$>&l#|16$2E%r*yJ?TQo`34LI_(oqm94T>T6Mj^>-72;Ue_O;xvjMrz_vCl zdmVD2F!v!nfSu@EVnFtu)t&|JDJoI|O@{?YpkKs?dUGa(e~J-|U%?ugj-7G*q`taS ztwm&nlyfUOfXO8D6bmDwhC_o=)4!C_mHqh;zLX3IfsD8b=NE`RPh}rxoiGWZ$#-PV zP^61($>R6o+|jB3!JdNKS5lJ&W6nlkH~pFvEICJMVQ8`{f-hM)%0IqQwjl)|x98ON z!?ILELh*`5=AwJShfibC2uJ;N0jA_09TaInqpyMIP;Y!L&mi3OG_A^%0!jg;fKosy ZpcGIFCY-rRY};U(Xw#D@Y1-Y=g)}M28a#*| zJb4nl3B{Wi&w>}hg9`o$BI41j;MuR4w{N!Fv;{>Fls9yD-kW(dJMZ^qCVltk^Rs=) z<4M&p7|{@Ri`(*OKA> zzKQKW6k!dV;06F4%df4}JJ}J{tvPg22?G1!K%A9nfEt*cL#EGW{kbQV?Ei8A?b<33H%a<4-&8wpnn#_@!!Lc zR}cHjyf-0+bBb~b_pd@CQvO94q5>$Ib4>Tj>%>t+TRY3kE;NeX#$g<43KP}8EHsp@ z>i*g4a7&hfcDsgmxTTWdM^SB=}9b9dvd9hGgVzi|} zScz>5i;_GL=fH`chO+n^f!mx~FO=>1%e397q)QCy0 zx)UQ}Oj)7qpA}beZ`d+;5382!E3M|H*9v^d2kd1QJa|GKuZ4|hW_%QS6LgiCN$aAO zJ@0xQuio5*HWiGnyK5I_vQ~D?nwmb{`vHt3{TTvtcDcxpQnUg(VoEwXXDX|1IrSit z(+{-xspCb05u#sQi|zY>;J|qKB6s0=3y=60Ad+KQeuoEbkf>vI`=jp@Cx5-6*)D%V z%#3~-NiGqP2uK7Z0uljyLo&) O-pS*7G>gyi?)?+#uU!@Z literal 4762 zcmeD5aB<`1lHy|G;9!7(|4=YX2qIztm3ZGhA<^H%C5VY<3zHI9jF}lK1=E5~b1^Y6 zf|Rg{fk;Lc5D5azW$`8NAxyX&SRqI*Ile>*%3%`)DPm+{f~sXIGt7gj(}s!>OPNG7 z9s)aGVX<^WI5L)C7GYqO1ezlN!oYxlxKn|_r%f#ayB0%cT?SS&pi>lpTG9*|7_5La zh|LIcDmJq|c!>*v&EjQXgaiagCD0h4AtV{Z3Jz0dCJrHxR%XU3XyAZs2ZOmV#-OE> zo30y!!gv@tPmuZ9ABaY

CX6y-8OlvY6~22mLXkV(vp4Cwa3 z_zZkdrAX8>hvOw+=PT^L)trosC74ARSS5i|4HvkY zX~?Pu7rTDG1iQbphc}xj$X$#qP^U96l^G^NBbz4>B*hGjI}T6`#QQl16y+DB7L{bC z7BdI~rSyOpq^~Tss5mn}&(=sMFSR5&CC%1E&r;7&Hzl6DSQ%w4k)j3dHOn0Vue@4`YqeqaiRF m0;3@?8UmvsFd71*Aut*OqaiRF0;3@?8UmvsFd71bJp=#`m4zk% literal 4982 zcmeH`%}T>S5XWb;Z4IT>qO|yR5HFq#M5^>63Mm?>*y7Pk#Wumx+LSirpgnm~e2PAS z2Ym(a-o5x5o^)rkTeMKT2zr?_}ne2H4#*jCB1 zcOWOhyvp(b_GMZz#s27_bkBs1-kJ(=ScIgom&A={b0)~9v_k7^W4$Z&1(5{xzO4d3 zEYtE=9k&t}y`ix0ean<8pvw|*2Lg7Z9$qWw@%jBpzPcNHvBh z4xQ?eJgK@=S;qe!`Y6ZGXGYw5yv%8fRw6(IhyW2F0z`la5CI}U1c(3;AOb|-zZ3Wb D%x-+o diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_vlen4.nc b/dap4/src/test/data/resources/nctestfiles/test_vlen4.nc similarity index 80% rename from dap4/d4tests/src/test/data/resources/testfiles/test_vlen4.nc rename to dap4/src/test/data/resources/nctestfiles/test_vlen4.nc index f119d3d119f70ae096eb44d36fe7bb7f8a12f630..40232b5b3c7a57cd2a7af1dd0cd26b9559e17b2a 100644 GIT binary patch literal 4884 zcmeD5aB<`1lHy|G;9!7(|4<+z3=uJaN^G6|RNmjiC5VY<3zHI9jF}lK1=E5~b1^Y6 zf|Rg{fk;Lc5D5azW$`8NAxyX&SRqI*Ile>*$`KF%DXLN3Jlw84)4LP#gJK-fz=G? zN(G>nG(!dkDIu7Lr?*xp%TUz5L!G=U*6x@!<$VMWIZDb)O8F@Wrle`zkvWxAc$lJMkEI)I^zAD z1B&tsQj1D5Q;Qiu2~!VAhx@+zYo|I;KT=XA5aVgpj5m6*eShPqIv>GrnTC~haN0R(QhuI{q+628oZ_*c#DV`b8cVk7?O;f?R&A5#iAPACL!bt#30pkdcqc?;TFas7om6O70uhVsVUc>EU zo~A9xIxZ-_+v_(v?VLSmyI!?cZ#J$tmCa-`Tbni4cblDV%WZpu>so#L2f)tkX6zk^ zOJZK-cmR3X7MCDid-!+}=u?zdB@^Z$jQ#>Dy&JbcZi*3%cfRp?iC@JgY0TAaRY0?j znnuME7^ozZ`j!h$DHwKH(Y+tMpw_85azu!Fk(kwrcdLTO=iEphSqy~0d3k?`+M|#E zX11_J9Sn8CR)Qi^T&Nk-^f8jV!2JCh-$=X>m&_MWWcn4ar1+XjQC5WbObp*nD*qsQ z-l97^R2!r;DaX{|s8BwZozzdKy5fZnq=sgM%I*2zBpkJ+>otwa@-)kywweLWfM!55 bpc&8%Xa+O`ngPv#W8Dl9}Ahs4jVr8RCRV5Q;%m25bW}%jCn1tL%8R85o!tm>KvOctFDOeyJtN zDQPAynYo!MD6WC}4roYc{kMFGC3-+h967`ofG%Oy5||vwEF8-r1hR&ikpUV?3Lq{J zz-(n=_>TkdID*tMGl&3PB7$&!~*1S~?p@<1Z)@Zl-`&K};AZ!sxH1%gCD-sXUK+c}^p zzaX`!Bok#>MoOBg zt)ZTwfu5OgztykJf-L;ZlMOfwCRcDsh(ZG&=1hhZpqVE&_i`-fmw}0atO18E)GHt@ E0KSBWZU6uP delta 360 zcmZ2raKT`Lj7We40~i=UC%kn20%;hR(f(i&s{>UQYyWw`^Z+{P$ASQ*y(hcFr zSb|xEfmITySOA1M7#LW<8Wk9P+SDSjYng1psKRY1sU`uI=4GF}nn`AIGo!jxJu}48 zNf3%bR0eDsGc&{FMi$Y@HyNk!GBAASJ);iM$N<#nD8R(P$iTqN#32Nx84V^2FpD!W zf^~5G|No!I2WZ&jUS>x=1EAwT0H~aSK^^EVZI=JOPDPXNF)J`KP5#duD+2d4NCglq vbGhlYxsXGiWfF&hAXGO)3Q*z%5HnBKG4bGsF!mdGFipI8)c0m*C^R&ldYcE!%+Ac4dG9yx&1QL1E|wPJm*c9g zgOI;m%+;_Z%R4?i^U}3)v921Q)HT+oX}n9QoGjxiC^RItLcdCceo3@(GdK#Xu((K- zTfFZDZ;dTeMTw~VULEH;yuN%DXt1Wh$>qd7B)Hae@xb|6XXcw<4_~*ZuT?Dx(Mvd% zELlVlp)DqSe);VSQ(3sDC`p=3RTO1n5;dTpHafX<85sc#6zGgJ`HwE$rBA z{6ju|ci$hG_-&azFR+Rw)AbL$-pKFw%)RG<+3N?#UE|i!Z|!xxj45OT$RHKxKMw{O z)U0|z+wE)?{R7{fAtx9C47Q_3A;X*hWjJpSqANsKTW3*%ZcK}Qf$lI6c%+)VQ;=0p zCtF~ekVHptV}&DDzdv;SUMuiMv+m%wvp_~IQPKp46Y@^rj^H%M+u>9iyCB?2;Ydm^ z3Lc?7Q}W!Swm*mK-)mNRTev1dTBN7ZMThZ|fGn+8w@Y^2u3C1Jt+<8U36$FkS|cw2 z5KB+?8T9D@pJ$OsGn|IW@3%kNWKj&4ql}zb?ym8w@q~IPDp;5{tJdRTf8Y%RA2Cw6 zX7Hkj7<)sCwfsgJ!w&-|znQt8$=z|ivDfVnFcO3GzT3H*&t-Di%+{~=wJWG3MG}w% z&WOMxtLCsQ=Eti@ZgJd*6c^{YIE85(J?m-tYebZ5!}P literal 6272 zcmeI0Pj3=I6u@V8Tig(8skQ};iK{W*BvR3sXsu*f3Mqw#tylTuZqtppG_Z0hiQbIy z;s?;^$MB{X{SF>Xym|2I)j#je&ZC3~sTWW4+GS?mym`F&y*ESPd8trbh@Xu!6vJS1 zEGfG5@>|N&bflp%%{QqtrLC0;buIB#yC~*$U7C@b$u_PrjwUPTAQHxO&L%BroOp<) ziA|A(K(oL&7ic+;JW2nIT74OvE?qc3TAMOh>IwLpH*iMNG_lY)1u6hWeBjN55J`PH z$*X9{Sxk_$DtX6&F%rb6qo^1wl(+4wQ?6ATj+L+2630gwW&oBb5u_pJ4&+nRFaR+_ z4nN=8tXZY4*eV)vxfb>^XoOqx?IXV%a&CRh+lN;_U*PIQ6JzB-9P6Q)-?q^RcX1aU z+Qsg^-#6jEWkMZTg`(;Dka8>yv;8 zR$>vlt+3ViLi9FMXtSfNN^3d{(-u!2&1tYGdh(NddHW6ZRjUXn0+R$bty)Fg26&7? z=#rolNmm735u{%NTfDsGbs=s6T8}#XU_F5fDQ_34r&>io5l{pa0YyL&Py`eKML-cy b1QY>9KoR)g1n?JI`gsw*x8wJG8e{(t#uo3d diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_vlen7.nc b/dap4/src/test/data/resources/nctestfiles/test_vlen7.nc similarity index 75% rename from dap4/d4tests/src/test/data/resources/testfiles/test_vlen7.nc rename to dap4/src/test/data/resources/nctestfiles/test_vlen7.nc index f1989bf335527058821ea58df60fc548364b7072..a63571b14b2751369546c140cfdc59ab32e0c334 100644 GIT binary patch literal 6160 zcmeHLPiqrF6o0#$ge7cks%cZL;@TpL){vB16bTqM8&lkFH0jApNV6NdkR~Nr1A^ee zli*448~70fJqRAeFW}KHARfeQwqn zTGe$B@`p=iKI$p(f#*M8{ixR}4b^z9F0wvN<3qybaGO>^A(PY`os|TgNwje*{2r;0 z$&hl1k3HhOsaaB#gvzhgak0zw*|R{#ngWNH6W1`!z2eO+=WBz7Z@&Nhv=cw(wJao0 zqb)^}K_H@7OnCG7!#n0Obwg3IG?}WPkb)vw^hR~&!udVFoDR7sXpv;;Yw0M(mmIAZ z%o{-DkvK9B<0_eIkOH0Nww!Xa38%1&0wpvm>l?P)T(7&Wrd4)qFdk4?8YCkJx4dC9 z``g@pb2}KB_-mVeKeQ@U(+hU|{wNsq&8>%_*&l@aL*w=^Xm9oWyeXsz6p)JZp8$gb zYPo*c@w%&(U?=bnASbpBVCnbpON8Olu^3L;gXA2ct6gC%!8GEcpQI}!0%xkQ5y+}X zBU@&kki|rBV?`p?U@-K8emnF>2h*9b?KFYmM0ii*j^H%=+u^J?H$kM6LrW^JN#tQ9 z;yO!NzE3P5#1cKKN+ao^&5KHgv zGw5-GPl`yC8BW7w;p49riYSH4QAM(dN%I!DYTTz0Vg;jV%eC$e2fO|-3=l@5YaS0` z#MmDa*GenPNIxV_X*GW{U%ck|W4|}pMJ9&J+g|s2shBSo@@wBZ=N8aOibOyn@Q)C< zW7Qp2#r)POid(!5h!Pj~bA!h*gDq7ydrHS*dpqgL8ylCZL_i`S5s(N-1SA3y0f~S_ ZKq4R!kO)WwBm(~*0rr5WwHtZOMjEOSLU%Ou8Dc5>aeCSd}b`kWy%%9+eMwn{GrPuyT>a#EUT| zrU#FH9KHAl^rjd6JG}W1c=coEy*EIJG`UNzA(vl@o{2IP%VG;G zE{4?nQqoJx6`Iq2g9dZ@N+DM@VqcB(V&62C8kw2xqXy%svUV0cVa()gR)glT2dKx{ z31-1xz3lAvyFI@j2L1rnPr>7eeP}?2et!^jJ6q{d#}Ds&`|Y4bOPN$Ab@`&_5B+wx z_t5WzqXTdM>Xbq{buE?NWN`uJnIR3{kR5t}^1XQHBZo20Y+L{_S&}V6e;OV<8@HGU ziZle8CC0fx%ek~9Te1sQR?+CnxsCDJgvAn1z}}*TJBDG1Bi2b+0${`k@u3h&b3VyS zsK;4EkaSAfS`Fq%5WOaUa>X6DTq{<}^_r6{xeCW;g`)$SC=$|0efSr-$N^Y01$hJK zOx{q8M3sTZl(%EvfL&07!^@DTB%9=?RIKeysxARKPy-y7seL7$7&c^lRK(Nm@!OWQ8z&6-p_9$ZAVbTB8U)zsJeN#>Xse1E`wNy zlL*9XhRuN=qP1g%f*og7X{-3=o}GO)=fNWH$x!C-`a2ryUK7v+W(nMODkX6nsC$hr z33?;xs-P<(rVOk=kC(T&L8gozEl*AKP!rGuGyzRO6VL=S0Zl*?&;&FAO+XXS1pW&G N_;VlqyolfNe*=e;?+pL| diff --git a/dap4/d4tests/src/test/data/resources/testfiles/test_vlen3.hdf5 b/dap4/src/test/data/resources/nctestfiles/test_vlen8.nc similarity index 66% rename from dap4/d4tests/src/test/data/resources/testfiles/test_vlen3.hdf5 rename to dap4/src/test/data/resources/nctestfiles/test_vlen8.nc index 2d3be725086e483adbdc3e6c184103cc1cfe6c02..5d1dab400e33e1436024fea7d46d84f1979bbae3 100644 GIT binary patch literal 6208 zcmeHKPiqrF6o0$h#1K>4+P{k6wg`gOkd#`hQfSz0+G3h$)02o{+uhKGHYv%PlOUoV zJQW1-<_GZPLGYj=DuM_70v`Mdf=5yGz1ex`wzM||!FkE-&dz&p_|0$Ld&AtH&lkFr zN0WLY0W80y%#MU38L7DEyqPM`=a=-S~;42NG z#0TlAbqPc4>27vR_F1Kq1&Z!Y)MTGkMyLV3oqZzvy}dLx8V@zMr2%-?U#toE=IhUQ zR-vVBQWcYU|ZF8n!dBL z?xjtZ2_Qf^&VL9}1gKi_f>pORnfEt*cL#IK5x~h;A0GZW4!2^s5|sai!!QwkfcHM+ za8A=s(E4=@MCN$EcNmv@#dU0mBGx!15{0IVNa8Sk7#hgzpOrd}R(=0ywS^}PU~piv zaBx_SM$`4{PT;k6hR7bNL=(`GQ`f>c?!idMskXzsxKLRJUeYjHQrX%oDFtz|rV&BW zZ>kf8w-=w5t@%s5TuwPIgQ;~S0e?M^Ap}cy!CtaUmR%JHrf^Ck&vgQ)?DI-1UtR@z!hmZ~YZo0@VdksH!FFaz<9Z@saJwI~>0b8Ba3vgvFlJ=MQ;;X67h z`D+Z!S>>YGZdnR=>p2bhB<32kdt4s5A`J;7AJ6ir6G=kjG%wjw`92`u`0DueVV~ke z9@-thgE%&d?Hsm6Y~)MAI6fh;M+^eTr+b82Jro0q0mXn~Krx^gPz)#r6a$I@#eiZ! fF`yWTFd**f@-j_*anG0EbXSk+>24m?(_Q>G{3K1u literal 4733 zcmeD5aB<`1lHy|G;9!7(|4>jX1Q9WSN+kZzTIcWK62!!_g-Ho4#>@tPmuZ9ABaY<*GtF{e3_*I1qspn2q3q`JfcW3dHO{37%Q6drry)J--&KuTItnuVgKBCT=Kv?vl$k~&TkkvdHrE|HMg#v8oF*>!g} zfuf-H&;u1c6;2!|LL4e_DNv|5aNq#9960lL-~>nz!2t;>%6l{OypFMzM4~xVGs^Dl zyqS6P=KJ3KPd)7 zuJ@8(a7&F3Lj{XKdy%xF8T>|tX8Mr%->cso;^wzph(u5;i$)?5GJ$ff11)~Q=te6b z8LTtTIxoUktO;whCxv`{Rm|yy{k$2wCNj2XKko?0RAWJ9eH5E&Ffkn`m&;heLVj@| z<+@(pcFe%?Sv!zH!=sTfE>DzWLGOi`hk&J~MzdKC7($JJjZL0TXR?#inOrtCI+bSn z0hDVjCJ@eyo=)@jI1si6?6^`5+O&dgASc_#>?J$D(JJVGNk5F1mT6md?7-(*Tc8rP z=B*b!%kp!M>jeeIE*_4|3ldlb31Y4^X8>oLBzz?u>pe6H(vFaTWNe#+N|*oXcJa=1 zYT{Y4Hd@zZgsTNHJ~_tyM|{Hj-0;Y|s718-y~-UoCEazlM>?N%PaV>Au&0uA%k%@r zChvUL_Fv9v0<pLOe1WdnGM_pW@D{<;q?kR*1dB|%=QzB$W0VNA|&tW;=>7U zpLgs9=>uc;P{`K#T|#w-lUG6oYh9wxo3g9kU3-lq zPN)twZI5s4r5~%q_g<;iw-#I{?;F1DELcW=GC6oO*$016{ru49-)@=w$7<}l`~=aO z1>xU63MwJde2MUex=RO{syJ6R-zLRCA4_In%i;;u;O4odjgjw0t+HoD)_brp6LQzH zTT~5Kw16WKF$MDFj>clkP7z3x$J5uhJ8q!{eO_$-)qD8}^hL(z3bt>+pJ_N&kQy5| z@}R@DlJlqLnZxCE3-hyPhkvHUJ7)R4boCI`6nA2s0w*a|Tbe%wU6Epp*iFaTd7`?vs(U&3VgYs7LmT1ZJX9SV0;!ySj)5)7& zKIfRQQ1SY+4;~!Ew7p!(vwVNqvvOvT^DQ%1v{tMl?eOyA6rR91GwfM7W5S#Dwp>0| zrWEcSPze_cnm%DqyKs$#D6T&tZD<|SqS0UAUcnP^RY_O<;oSb7oNQDbea9q)MIRcvZ9 zJI6W2TN>{3c&JqpL4=@}tx0D=R4dD9SY;U(%Y}1)9zT_uoiuMkBQ`@hX5iuwWoc6*hCwBsazqT5Kssx1QY@a0fm4< zKp~(IPzWdl6aor?dI(@lB2Hl$is)br2>%hskVK4!B$61Cm`#tTXVaNfI>$p2C!iHZ z4f1AS`c@FeCdz?B7T@ewsV@3|U)pyd`{`%gqz6%;MaUu^;RMOfSww-5KRUbTYgr`Y zB|B&lgOKnbaB2Em>Y*!_T7V+6j0NycNsCaQ0CD5r}ZZ z@25ipiNQqQ(L9Dk-4X=5gCm9f;_;!rL|-y-qHyTu^|{$}Is$Psazn}~S_Votq^_O~ zMFAR!$m*(ERa6Kl1QY@a0fm4<;J!iN68xAuGQ!yUs(KU#$_JDWC?8NhpnO32fbs$5 U1Ih=K4=5i{KA?Qy{_}x<0Ro^`8UO$Q literal 0 HcmV?d00001 diff --git a/dap4/src/test/data/resources/rawtestfiles/CMakeLists.txt b/dap4/src/test/data/resources/rawtestfiles/CMakeLists.txt new file mode 100644 index 0000000000..85d40c3a9b --- /dev/null +++ b/dap4/src/test/data/resources/rawtestfiles/CMakeLists.txt @@ -0,0 +1,13 @@ +# Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, +# 2015, 2016, 2017, 2018 +# University Corporation for Atmospheric Research/Unidata. + +# See netcdf-c/COPYRIGHT file for more info. + +FILE(GLOB COPY_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*) +FILE(COPY ${COPY_FILES} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/ FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE) + +FILE(GLOB CUR_EXTRA_DIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*) +SET(CUR_EXTRA_DIST ${CUR_EXTRA_DIST} CMakeLists.txt) +ADD_EXTRA_DIST("${CUR_EXTRA_DIST}") diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_atomic_array.nc.5.raw b/dap4/src/test/data/resources/rawtestfiles/test_atomic_array.1.nc.dap similarity index 75% rename from dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_atomic_array.nc.5.raw rename to dap4/src/test/data/resources/rawtestfiles/test_atomic_array.1.nc.dap index 64f2028ca32159d15ab7689a7997a624c710f0da..5268ba2f0ae3a4cd10a7722bbb1f94f249afb84c 100644 GIT binary patch delta 135 zcmbQrK8b^cg@O6jMixir$q$&sc>J6Lit-Cmi%K$6izinxY3P-u78Pga=h+(RZYWYrRL-p&x+(Yo delta 94 zcmbQlF_oQ#g@M_3Ba0(*fQ`OOVo73gYKa{$7b63M12gO9t@EUeL4bLJ!^edOOZXTd l;M}Zp8_(@NxBc9nb8F9SRJ7L=<$%hpKKmZbx>FIZ1OWQ#9Kiqp diff --git a/dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_atomic_array.nc.5.dmr b/dap4/src/test/data/resources/rawtestfiles/test_atomic_array.1.nc.dmr similarity index 75% rename from dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_atomic_array.nc.5.dmr rename to dap4/src/test/data/resources/rawtestfiles/test_atomic_array.1.nc.dmr index 83af129bb7..f5aeb23a42 100644 --- a/dap4/d4tests/src/test/data/resources/TestServletConstraints/baseline/test_atomic_array.nc.5.dmr +++ b/dap4/src/test/data/resources/rawtestfiles/test_atomic_array.1.nc.dmr @@ -23,4 +23,10 @@ + + + + + + diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_atomic_array.nc.8.raw b/dap4/src/test/data/resources/rawtestfiles/test_atomic_array.2.nc.dap similarity index 69% rename from dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_atomic_array.nc.8.raw rename to dap4/src/test/data/resources/rawtestfiles/test_atomic_array.2.nc.dap index 9c55a80646cc2c44265ddcdc86e5add9ff446bbc..767948d780056ab55c0b148500ee8a9d5e1f1307 100644 GIT binary patch delta 97 zcmdnOvX_;Gg@I}PMiw!q$y*u4c>J6Lit-Cmi%K$6iznwYYUq`v78Pga=h+(RZYWYrRL-p#>R delta 29 lcmdnXx`l;>g@H+FBa0Z* + + + + + + diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_atomic_array.nc.9.raw b/dap4/src/test/data/resources/rawtestfiles/test_atomic_array.3.nc.dap similarity index 69% rename from dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_atomic_array.nc.9.raw rename to dap4/src/test/data/resources/rawtestfiles/test_atomic_array.3.nc.dap index 6f172413294ae7511b3df23704a98f6c1f221081..3667b076c230e68bab384eecba7bd04e816f5d0f 100644 GIT binary patch delta 97 zcmdnOvX_;Gg@I}PMiw!q$y*u4c>J6Lit-Cmi%K$6iznwYYUq`v78Pga=h+(RZYWYrRL-p#>R delta 29 lcmdnXx`l;>g@H+FBa0Z* + + + + + + diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_atomic_array.nc.raw b/dap4/src/test/data/resources/rawtestfiles/test_atomic_array.nc.dap similarity index 78% rename from dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_atomic_array.nc.raw rename to dap4/src/test/data/resources/rawtestfiles/test_atomic_array.nc.dap index 9a6e30757570a5619e2f88ebbafe3ac8c6f425a7..c25865196cbdbc5e695b1122be521634fe5087de 100644 GIT binary patch delta 274 zcmbOy_(F(Ix+$q;sX6%txv6<2IvFWxrnZK9hDLfullQT! zSkC^>$i&RT%E-XPz|6qHz{GY z7{o+oPGV(X0J0c>d0|O%vgTSW`VLWLd@XXM`7zCInIIKI(S>vF_eq(L&WL8c) n!y^Uy=^PN%42;UI>7A?3zK8LFOt1`ZShzaST*msUq^_+1P_HJ| diff --git a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_atomic_array.nc.dmr b/dap4/src/test/data/resources/rawtestfiles/test_atomic_array.nc.dmr similarity index 86% rename from dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_atomic_array.nc.dmr rename to dap4/src/test/data/resources/rawtestfiles/test_atomic_array.nc.dmr index 2fbda80066..055b24184b 100644 --- a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_atomic_array.nc.dmr +++ b/dap4/src/test/data/resources/rawtestfiles/test_atomic_array.nc.dmr @@ -51,8 +51,14 @@ - + + + + + + + diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_atomic_types.nc.raw b/dap4/src/test/data/resources/rawtestfiles/test_atomic_types.nc.dap similarity index 80% rename from dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_atomic_types.nc.raw rename to dap4/src/test/data/resources/rawtestfiles/test_atomic_types.nc.dap index 97ddca1028198188bc7933ec86decbc65ffcbc63..e69d916e32a9c1c754355ae255674199a72b0350 100644 GIT binary patch delta 225 zcmaFKw~C*Ig@HY2Ba0s^TX0EHW?uT_1lIKkX29fJwgdwOAh2;P0m>(pmZU1=CFZ8u zD#iOb2NdNOq!yKArWPwHlvEY~1)*llWs}k?OD!tS%+Iqm(#cCLNlr<#HPN%wGt^B< zElbVGFUU>JE78eFNi(%I)H5{FGn%}EO(ig(;Xgyee-Nk#lMn*VzRmCHAff9L@>`M9 i!GW6r0y0u_a`HLL^NVs)IG{p|%C701tIxh?ss{jI7*{m_ delta 180 zcmZ3*|B{b|g@NtrMixKT$){MQCQGupOkTkn4`nZz?8VMs-_x)*XP5nd1_p-z3=Q`u zCa(DpWd8?&`ujERLSPnxsJDsva|Xthx$mNQo8QwRRamP>Lf0kaw<4!Q(dk{E9Awws zTfz-A5d<<)b8_-I%kztJQm!nUXvP5%WnffxP48TN_C4R-TfUc=7WVPj)GIXa5CQ;g C&{J6e diff --git a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_atomic_types.nc.dmr b/dap4/src/test/data/resources/rawtestfiles/test_atomic_types.nc.dmr similarity index 81% rename from dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_atomic_types.nc.dmr rename to dap4/src/test/data/resources/rawtestfiles/test_atomic_types.nc.dmr index 760b27b8cc..fc73697673 100644 --- a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_atomic_types.nc.dmr +++ b/dap4/src/test/data/resources/rawtestfiles/test_atomic_types.nc.dmr @@ -33,13 +33,19 @@ - + - + + + + + + + diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_enum.nc.raw b/dap4/src/test/data/resources/rawtestfiles/test_enum_1.nc.dap similarity index 78% rename from dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_enum.nc.raw rename to dap4/src/test/data/resources/rawtestfiles/test_enum_1.nc.dap index ec697568222240e3efa0649d2d0fc969e5193e9b..f4879bac122839a1adbdddf673059af1e89dde5c 100644 GIT binary patch delta 137 zcmcb@d7X=eg@M&?B1;rgyy3>U#msEMB}JKe>67_cHW(-XfsJDcP#~$aBvm0VF*ns# zDc;XHpeVl}wWuUBwOC1^q_O}g2-VcjBBfWBT2!2wpJ!{Nlb2eOoRVg1qGzdRsGE{n gmYS1akeixUqLY!5W@>AwXK18nG&se%CxYL#|8jp Ccn*~S diff --git a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_enum.nc.dmr b/dap4/src/test/data/resources/rawtestfiles/test_enum_1.nc.dmr similarity index 75% rename from dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_enum.nc.dmr rename to dap4/src/test/data/resources/rawtestfiles/test_enum_1.nc.dmr index c6b90cdbb6..1fe6b2733b 100644 --- a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_enum.nc.dmr +++ b/dap4/src/test/data/resources/rawtestfiles/test_enum_1.nc.dmr @@ -1,6 +1,6 @@ - + + + + + + + diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_enum_2.nc.raw b/dap4/src/test/data/resources/rawtestfiles/test_enum_2.nc.dap similarity index 81% rename from dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_enum_2.nc.raw rename to dap4/src/test/data/resources/rawtestfiles/test_enum_2.nc.dap index d38f5337ffd848e4b1c6f5b9ddb4f5f9df5bedab..691a7db739aab77d16453e5545739dfdda7ee7c1 100644 GIT binary patch delta 117 zcmeC<>gQ%*VPI|B$imJtc^R{yoS$<*QGP*cQAuWMv64bbWkIT~QgBI8W?s6I9WU49 z1uSBEWvNBQnfZCPMml+^CCMpiwkCR(dWO0wsb#4-`31SDc_lg-DQTv*hI)oZdPb8! RGEZfLm@s(?O9>Mr697NFB*p*$ delta 32 ocmeC@?&D%%VPIw4$imJtc?L`M + + + + + + - + diff --git a/dap4/src/test/data/resources/rawtestfiles/test_enum_3.nc.dap b/dap4/src/test/data/resources/rawtestfiles/test_enum_3.nc.dap new file mode 100644 index 0000000000000000000000000000000000000000..1388e7518b136e8a62597da6299401be99611d1d GIT binary patch literal 836 zcma)4U2DQX5LDVHq5mOVUo~e^ORY^5v9=W2BDDG%&g9g<-Pq?qze!jP18 zdH!SVOi2S}!w94uYOk|pRc5Jnq+U_aVUFXDSHRGM%J-CeY~_Z{1DZTA$q7B9`bYL%s>k=>bG pKAsXtb(}DLz~$nK^PA5SpV0G#(`ttF*b-kJE$<%x+pSi+{R^#p^CtiR literal 0 HcmV?d00001 diff --git a/dap4/src/test/data/resources/rawtestfiles/test_enum_3.nc.dmr b/dap4/src/test/data/resources/rawtestfiles/test_enum_3.nc.dmr new file mode 100644 index 0000000000..115bfa8ca7 --- /dev/null +++ b/dap4/src/test/data/resources/rawtestfiles/test_enum_3.nc.dmr @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_enum_array.nc.4.raw b/dap4/src/test/data/resources/rawtestfiles/test_enum_array.6.nc.dap similarity index 82% rename from dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_enum_array.nc.4.raw rename to dap4/src/test/data/resources/rawtestfiles/test_enum_array.6.nc.dap index e89b3c55fdae4e9ebb28f0a199144ad42db42b68..a92e1d80b4bd35c53e57a6b34a316a9c51272520 100644 GIT binary patch delta 101 zcmaFN^@N*+g@N_fMivAwXK18nG}(exg_((o F5dePL9|r&c delta 49 zcmaFD{g{h|g@HA6BZ~~n - + + + + + + + diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_enum_array.nc.raw b/dap4/src/test/data/resources/rawtestfiles/test_enum_array.nc.dap similarity index 75% rename from dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_enum_array.nc.raw rename to dap4/src/test/data/resources/rawtestfiles/test_enum_array.nc.dap index 60a17c75246cb0254208ebbf3927302b80e03499..6fd6eb23b3f8837ef483664a187f207a1b6cc9e5 100644 GIT binary patch delta 215 zcmbQo)yKoa!obG3k;R#XEx4p8GcSE|C`+PCN@9VDUUI6ELP=#os;v@4M#+wsO92XO z!V+^zQx(cUq^**EK~ZLIVo_y$a!!6}O0=Psk(Ej8 - + + + + + + + diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_fill.nc.raw b/dap4/src/test/data/resources/rawtestfiles/test_fill.nc.dap similarity index 58% rename from dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_fill.nc.raw rename to dap4/src/test/data/resources/rawtestfiles/test_fill.nc.dap index 151559c495a9d75f9e47acb255384c58cfae0f98..eb66e2ca84d5fcb612b379b4bc5dfcc64db16b55 100644 GIT binary patch delta 128 zcmV-`0Du411k?ot1ONiXu>?E;lR*JLlYs$5lg0sUlfMB4lhXka9!^70a&K^Da&&2B zb0Q#gd2nStB2#p7X>MmCJ`DV>lGAwRobYo;@Jv1&kE-@`+Wp-t3 iZ*Xm8ZgebYWM(xzF)lGOE;5rI0wf3r@VtMRu>k;h<|%am delta 67 zcmcb@dX0sJg@MU>Ba00qW9VcDMtdMx&*;Jt>X}z!Y-GnfS)WOK@ - - + + - + + + + + + + diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_atomic_array.syn.raw b/dap4/src/test/data/resources/rawtestfiles/test_fill_2.nc.dap similarity index 54% rename from dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_atomic_array.syn.raw rename to dap4/src/test/data/resources/rawtestfiles/test_fill_2.nc.dap index 30138ab7b145acb7a31342279540360956ea6b51..84f88272415c93edb8e3267a448910ce62e78b0d 100644 GIT binary patch delta 421 zcmZ1{xR9TPg@L_uB1;%&T4qj8ypdjB^2DrtlYJRQHeX0CY3N`^cuD`l&3n zs5mn}&(=sMFSR5&CC%1E&r;7wHzl?=v T85ag@OIfM3yjt#FG5n%;fmQqN2n~z2eHeiOKtT43!j$GpkZ2MYj&6N`)EOD4}@m7AQ%Vl=swRdDiBHvf7XeV4?N#NyNvpplFW45xOT zY_{KPKI7`_>#P5ju9|(iVP)YXz9pg;6nn$9PF|fN*CZGJ`^^2B8y>HBzsA|iu{dYJ zi$D9fXgxk{e?C*`k(>Kt`}E%r>YV*8g5K3IF+f0dFgui$o@5c{@2bKD<(ec$>ldo# zSz4P$!i1{RJag^h7001(F)uR9a diff --git a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_atomic_array.syn.dmr b/dap4/src/test/data/resources/rawtestfiles/test_fill_2.nc.dmr similarity index 60% rename from dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_atomic_array.syn.dmr rename to dap4/src/test/data/resources/rawtestfiles/test_fill_2.nc.dmr index 4d46c86746..9682baa5cf 100644 --- a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_atomic_array.syn.dmr +++ b/dap4/src/test/data/resources/rawtestfiles/test_fill_2.nc.dmr @@ -1,15 +1,11 @@ - - - - @@ -24,35 +20,34 @@ - + - - - - - - - - - - - - - - - - + + + + + + + + + + - - - + + + + + - - - - - + + - + + + + + + + diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_groups1.nc.raw b/dap4/src/test/data/resources/rawtestfiles/test_groups1.nc.dap similarity index 77% rename from dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_groups1.nc.raw rename to dap4/src/test/data/resources/rawtestfiles/test_groups1.nc.dap index fc6a4a66d70ee332ed888399ee93a3b114ce090b..ad13a7ad93062cc3c50b5f48db62d7a84edcd722 100644 GIT binary patch delta 228 zcmZqXY~W&HVPILYk!2=hy<dfeK%}iwS!z*nW`3TnkxpJ}Npeb>t%;tco}q3^YFTPd zenD<(UWradN}8#yp`M|Uo{^Hi9oQTjeaDi`{fv{D0t0S7I(#}Jhjn_l?yfZR3e&#_ zf4m82U~q6`U^sDzf#E|969WSSGZ3=^F*^`*12F@`4xs!CAf5rlKY+Lch((+j7y=vt D{BJ@< delta 86 zcmZqRYUX5NVPKKo$TE|0vlde;6Jx^U4J;xeI_k2r3=9sA3=Ag@F))0nan^m#KluWS kh|2E;TUIhK>;Ou<0OA=y`~!$PfLO$dfg!+A= + + + + + + diff --git a/dap4/src/test/data/resources/rawtestfiles/test_misc1.nc.dap b/dap4/src/test/data/resources/rawtestfiles/test_misc1.nc.dap new file mode 100644 index 0000000000000000000000000000000000000000..074e0016fec77f83bf2ac256028050fb05a38a20 GIT binary patch literal 1434 zcmcIk(QeZ~5Hu3JRN^13hEa3A!-#toHgdc0zv1y8J?>A{LBQ zA$7Sj+Fc5H!<$SPE^VVqSxJPP_Bu{b3UvLi#;aCbuI^};IhUmtcocSKmcp>kLYr4> zwnKt7wKKRv&k>FM)F5;<=|$0~yKCBoWj;RCw33^*ir9yotIk_dHsCMYZ*qMYwwvpZ zNF4OU>p$b5Q|Y$5DY{KyM05-NR&t{x_F}Kej#>=4w#DYKFaS0MVey|tQ=Vg@3Hm>x zl{Q%Xo$5XcmodFbQTk3ImXN+txfFE#AG1E*Ftr)88@!$G&qGiWyQAGsCEnnLdr{RT z_;YRi&)VGCLf5;GO5a~x8M-VC%Ewdtr;+X=4EGgamd}%jzvh#J9F|b(n(hbOFY@`z jWWpyQ4}U2p4!Wz64#5-8i@eqIZR&YvXP)={>n@)kUO|}x literal 0 HcmV?d00001 diff --git a/dap4/src/test/data/resources/rawtestfiles/test_misc1.nc.dmr b/dap4/src/test/data/resources/rawtestfiles/test_misc1.nc.dmr new file mode 100644 index 0000000000..c844eb9bb2 --- /dev/null +++ b/dap4/src/test/data/resources/rawtestfiles/test_misc1.nc.dmr @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_one_var.nc.raw b/dap4/src/test/data/resources/rawtestfiles/test_one_var.nc.dap similarity index 62% rename from dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_one_var.nc.raw rename to dap4/src/test/data/resources/rawtestfiles/test_one_var.nc.dap index 8b29a0bd17c59a68418c251e6712dd9b89ad1063..8992d46dc1ffa3ffa02dd7551a5e1681298ffa5e 100644 GIT binary patch delta 151 zcmZ3$ypn~5g@H+SBTEZoy#f%}IF^(YWhRxDq$=bk=BC;z#rru26y+DB7L{bC7Aq-~ zR2BdQgMn)D(v|FZxj=eAz$Pp)r!-Ze3`E*0m8BLHXXfYG8tLSvmL#X7*_!BC>KW>$ qq?V=Tqq diff --git a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_one_var.nc.dmr b/dap4/src/test/data/resources/rawtestfiles/test_one_var.nc.dmr similarity index 54% rename from dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_one_var.nc.dmr rename to dap4/src/test/data/resources/rawtestfiles/test_one_var.nc.dmr index f48bc09fc3..9ace4d7c19 100644 --- a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_one_var.nc.dmr +++ b/dap4/src/test/data/resources/rawtestfiles/test_one_var.nc.dmr @@ -6,4 +6,10 @@ xmlns="http://xml.opendap.org/ns/DAP/4.0#" xmlns:dap="http://xml.opendap.org/ns/DAP/4.0#"> + + + + + + diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_one_vararray.nc.1.raw b/dap4/src/test/data/resources/rawtestfiles/test_one_vararray.4.nc.dap similarity index 69% rename from dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_one_vararray.nc.1.raw rename to dap4/src/test/data/resources/rawtestfiles/test_one_vararray.4.nc.dap index 814c0ed7bb77894a503f0082cce29b9d8d9a9315..2193bd63809ee9fb4744023b95171e3f6004c3d5 100644 GIT binary patch delta 91 zcmZ3*vYC~Ig@I}LMixG%$!i(Kc>J6Lit-Cmi%K$6izjC@YUq`v78Pga=h+(RZYWYrRL-p + + + + + + diff --git a/dap4/src/test/data/resources/rawtestfiles/test_one_vararray.5.nc.dap b/dap4/src/test/data/resources/rawtestfiles/test_one_vararray.5.nc.dap new file mode 100644 index 0000000000000000000000000000000000000000..a1100c1689891c49e6673b8799566b342fdf4432 GIT binary patch literal 697 zcmb7C(MrQG6s_We41DkpLd3T%S!;zk+Ku591d)MmFCrzj*%oNilH3*NANiNw&UQ?O zFbgf*oO92)=QbzK@mDbX$Wl^DV^yw0>as2+Qpb6s^dh9wm-|kS5(`2nBF(i7=~`Mk z9JGS50AVGZwMg@5ks%J!LWIny6h;^$)=bBAhn0w8*0}lTwhLuu3sr;cKscnfAzcC# zea^9Bc_DG8g5_qxwdLc{grnTWUQ-`Q2Q?0U?1BdkS01Uu(E7B>7>rd$top=|9_0<4 zZ}?3$0x;@*1+o^1(A{UTqy*LlHa;V)7r#_zB3(&RR^O0vcG$Ww_oW$2mQB9On|>Z*hvm0RR91 literal 0 HcmV?d00001 diff --git a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_one_vararray.nc.3.raw.txt b/dap4/src/test/data/resources/rawtestfiles/test_one_vararray.5.nc.dmr similarity index 52% rename from dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_one_vararray.nc.3.raw.txt rename to dap4/src/test/data/resources/rawtestfiles/test_one_vararray.5.nc.dmr index 495c199edf..3b8f656675 100644 --- a/dap4/d4tests/src/test/data/resources/TestDSP/baseline/test_one_vararray.nc.3.raw.txt +++ b/dap4/src/test/data/resources/rawtestfiles/test_one_vararray.5.nc.dmr @@ -1,17 +1,20 @@ + - - + + + + + + + -/t[0] = 17 -/t[1] = 37 - diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_one_vararray.nc.3.raw b/dap4/src/test/data/resources/rawtestfiles/test_one_vararray.nc.dap similarity index 71% rename from dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_one_vararray.nc.3.raw rename to dap4/src/test/data/resources/rawtestfiles/test_one_vararray.nc.dap index 42ed5d734703ac0b80c211d8b225048e631219ed..67ea5584cd0dd4de190c21715f28e919380c6120 100644 GIT binary patch delta 99 zcmcc4@_?0vg@Nh9Miz6X$=4Xgc>J6Lit-Cmi%K$6iziQF)X*zSEh^5;&$Bhs$xAIs zPD!&h(X-Su)J;h(OU=nI$W6^F(aA_jGqp9;Gc?jOntYH^bh0%QKPQJE0|SF95CZ^6 CIUMZ( delta 31 lcmaFBdYy%Zg@MU=Ba1oH - - + + + + + diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_anon_dim.syn.2.raw b/dap4/src/test/data/resources/rawtestfiles/test_opaque.nc.dap similarity index 63% rename from dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_anon_dim.syn.2.raw rename to dap4/src/test/data/resources/rawtestfiles/test_opaque.nc.dap index 02521f8b96f53a8fcbd4d41bbfad7f38a59d3431..d4a997e339b7a98f144f426198bc0ecc6aa62eb3 100644 GIT binary patch delta 134 zcmdnZvYll@6lZ=xVqs~jUS9IVw6!AsV2(mwVs5IfQdz#ClD-}96i;GaeqMY^X0BdwW!}W(wGp0qCB{Yyd5O8Hwn}BC#zsnZyj%)UVB?aR zt5BR-1(Y&T(uYde=!3Puc#b6{MVU#ZC896Py` lQG2pAqyJ=aCVo*7r5g8L;r8+;-&8a-hnO4MPdQ%g2mtsJFh~FZ diff --git a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_opaque.nc.dmr b/dap4/src/test/data/resources/rawtestfiles/test_opaque.nc.dmr similarity index 54% rename from dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_opaque.nc.dmr rename to dap4/src/test/data/resources/rawtestfiles/test_opaque.nc.dmr index d094bcf790..3de1a76235 100644 --- a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_opaque.nc.dmr +++ b/dap4/src/test/data/resources/rawtestfiles/test_opaque.nc.dmr @@ -6,4 +6,10 @@ xmlns="http://xml.opendap.org/ns/DAP/4.0#" xmlns:dap="http://xml.opendap.org/ns/DAP/4.0#"> + + + + + + diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_opaque_array.nc.7.raw b/dap4/src/test/data/resources/rawtestfiles/test_opaque_array.7.nc.dap similarity index 68% rename from dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_opaque_array.nc.7.raw rename to dap4/src/test/data/resources/rawtestfiles/test_opaque_array.7.nc.dap index a7cfeb0f0c8e7f27669bd22ba154f89dce3ee060..4771a3112d51db5f433b814038e244ac8fef2379 100644 GIT binary patch delta 91 zcmaFG@|l%|g@NhxMiwKc$rl;Lc>J6Lit-Cmi%K$6izjz5YUq`v78Pga=h+(RZYWYrRL-p + + + + + + diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_opaque_array.nc.raw b/dap4/src/test/data/resources/rawtestfiles/test_opaque_array.nc.dap similarity index 55% rename from dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_opaque_array.nc.raw rename to dap4/src/test/data/resources/rawtestfiles/test_opaque_array.nc.dap index 10aa455370590cd54f608cf44ec19b01807cf6ec..22feea39dd2229956cba4998cf7a8a1900d96ad2 100644 GIT binary patch delta 235 zcmX@hvWJa@g@NhIMwVra{wawCCVI)KN(v>F1*x`5!6ikRdFe`ayj%)UU=x;@Q<|z! z1|n^h^vm*%q77rC4Xg}fmGtevs%-QfOMu#vN=s7hCQoKes|V?{fr}~RCFTNk#``%3 z6y+DB7L{bC787e-S!z*nW`3TnkxpJ}Npeb>t%;tco}q3^YFTPdenD<(UWradN}8#y Xp`M|Uo)OeRlV3B+GCEA=WO4uik>o~O delta 32 ocmdnPc9w;Og@K82Bg-0FAZ@cmMzZ diff --git a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_opaque_array.nc.dmr b/dap4/src/test/data/resources/rawtestfiles/test_opaque_array.nc.dmr similarity index 62% rename from dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_opaque_array.nc.dmr rename to dap4/src/test/data/resources/rawtestfiles/test_opaque_array.nc.dmr index fca0f6e7e1..1ef5164539 100644 --- a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_opaque_array.nc.dmr +++ b/dap4/src/test/data/resources/rawtestfiles/test_opaque_array.nc.dmr @@ -10,4 +10,10 @@ + + + + + + diff --git a/dap4/src/test/data/resources/rawtestfiles/test_struct1.nc.dap b/dap4/src/test/data/resources/rawtestfiles/test_struct1.nc.dap new file mode 100644 index 0000000000000000000000000000000000000000..204b43fecb4ffa8bef54ecb22859986585ccccad GIT binary patch literal 632 zcma))QES356otF7hav1ggzQz5wR7MkRb*~37(>|fwPa1yLYtQ4R`kzLui6&JCalmx zdXjU#dvC71%cU5uvy`l~bxCeQ>a#maw25<-m_K7<^`8da^;uVpa!rG3ZpvY$NR%P9)?rE~HCD>-_+j$+XmDwg2LzFy_#E!5h=+N3*VA zqxYwY#im(EaCntHqTz_o``1?@Xd4Z&nulHX$o!7dE1l*=rVX^0YW@)V%nw-bCye0L RCBf=1JntG`?|Zx5?f{2Jw3h$? literal 0 HcmV?d00001 diff --git a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_struct_array.syn.dmr b/dap4/src/test/data/resources/rawtestfiles/test_struct1.nc.dmr similarity index 53% rename from dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_struct_array.syn.dmr rename to dap4/src/test/data/resources/rawtestfiles/test_struct1.nc.dmr index 381b032492..5567443c90 100644 --- a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_struct_array.syn.dmr +++ b/dap4/src/test/data/resources/rawtestfiles/test_struct1.nc.dmr @@ -1,22 +1,18 @@ - - - - - - - - - - + + + + + + diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_struct_array.nc.6.raw b/dap4/src/test/data/resources/rawtestfiles/test_struct_array.8.nc.dap similarity index 70% rename from dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_struct_array.nc.6.raw rename to dap4/src/test/data/resources/rawtestfiles/test_struct_array.8.nc.dap index f551cc102076e8e5ab81df60311debbdee7849c6..8ba7b371ec38dbc8c104b2ffae476a765fc65212 100644 GIT binary patch delta 119 zcmZ3+x}J@Ng@KuUBTF9BWL_pQ9zW-RqWpr?qLR$i;>m{?HT23-i;6Sz^K6ZD@={BZ zQ_^fr^epuZbyHHyQgiYPa#Qn4bTU%XOl=MI42|@RCdV?VC@L^AFfjZF0zn|H3dDba NY#t!}14wfKX#jV2CSU*n delta 28 kcmZ3_wv3g9g@LJRBTF9B + + + + + + diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_struct_array.syn.raw b/dap4/src/test/data/resources/rawtestfiles/test_struct_array.nc.dap similarity index 57% rename from dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_struct_array.syn.raw rename to dap4/src/test/data/resources/rawtestfiles/test_struct_array.nc.dap index 06ce49201d7ab51e3591de55b25c5129bbf70e01..466f51475915171592df24a412b93da4989c28de 100644 GIT binary patch delta 337 zcmZ3*zL%Yag@HMABTEe95n~4O{{gv7K>9C` n2C4l6q{fZ$O$0NPh&Z5bc delta 279 zcmdnXzKWfNg@IXWBTEdUfLl&}Vu`VlLSABSs;yF$(&QD4N{Tl6P+>b>E(IX4K~+_v zH2E;23OiJAas*?qHdvK!Vgb|~{VFAWs9toLlF4@%bte}x`A_y`=CALlaksL!m-n=< zXkfO#bEL+OHTT0lOHNz+6WlR&7GZzwKA1#`O;#z@Qum(iyOwde)KUZ$^p zr^2;PUM>DD6*NVzNiJirM{4}E1zCJTmCiI&3S%e=T7peO5Fqi-a2E( diff --git a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_struct_array.nc.dmr b/dap4/src/test/data/resources/rawtestfiles/test_struct_array.nc.dmr similarity index 67% rename from dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_struct_array.nc.dmr rename to dap4/src/test/data/resources/rawtestfiles/test_struct_array.nc.dmr index ebb845e9e9..a75730d80e 100644 --- a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_struct_array.nc.dmr +++ b/dap4/src/test/data/resources/rawtestfiles/test_struct_array.nc.dmr @@ -13,4 +13,10 @@ + + + + + + diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_struct_nested.hdf5.raw b/dap4/src/test/data/resources/rawtestfiles/test_struct_nested.nc.dap similarity index 68% rename from dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_struct_nested.hdf5.raw rename to dap4/src/test/data/resources/rawtestfiles/test_struct_nested.nc.dap index 9e3de4050bc5d73b962199cd05ed79a7d81b16a0..b24920ae7a492c83c32f94a3f69684acf9257d7a 100644 GIT binary patch delta 144 zcmdnax{r;8g@IXZB1;NWUh>8qb*9OBOkzoX&H+XF1*t_PnW@D}3MG{VskTbNB}JKe z=}LCITnbQN6PB1$nyOF+B5jq*Qj3Z+^Yd(tbn;S5l2g)bP4q1F40Tgd%Tjal3vyHQ jN^~+((oAg)^$d;lj3(DHsR#-%GB7aw`ws*_ItqvZC5tPb delta 47 zcmdnTww;xQg@I}IM3xkmjFdFfjalkUljWHCMMW4H7#RNj2Ld1+1;o;B%kKjKIWrCR diff --git a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_struct_nested.hdf5.dmr b/dap4/src/test/data/resources/rawtestfiles/test_struct_nested.nc.dmr similarity index 64% rename from dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_struct_nested.hdf5.dmr rename to dap4/src/test/data/resources/rawtestfiles/test_struct_nested.nc.dmr index 945da2f1b4..8cb1a3b02a 100644 --- a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_struct_nested.hdf5.dmr +++ b/dap4/src/test/data/resources/rawtestfiles/test_struct_nested.nc.dmr @@ -1,6 +1,6 @@ + + + + + + diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_struct_nested3.hdf5.raw b/dap4/src/test/data/resources/rawtestfiles/test_struct_nested3.nc.dap similarity index 66% rename from dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_struct_nested3.hdf5.raw rename to dap4/src/test/data/resources/rawtestfiles/test_struct_nested3.nc.dap index 8425a19ed38f73dc512149e7ef62447198d5b752..b1d33d717ffbd9a934c6ae093293dd05b4abeee9 100644 GIT binary patch delta 157 zcmaFB@|=~0g@NhzM3z*hyyT6!w;AgdfWXGFq@*Y_sk9_jAulmE)mACq&pDtdzaX`! zBr~;GNui{&04Nv?RFjvkWXH<|(gOlEVTn1VsS0Hv(pIS~wWv5VKhM@kCoi=mIVH{3 wM9)&sP&XyDEHx*;AU8FyL?N+yDRo delta 46 zcmaFP`hbOng@GwxB1#2T#O719D)oC4A0&_JP80b CfDOL@ diff --git a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_struct_nested3.hdf5.dmr b/dap4/src/test/data/resources/rawtestfiles/test_struct_nested3.nc.dmr similarity index 60% rename from dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_struct_nested3.hdf5.dmr rename to dap4/src/test/data/resources/rawtestfiles/test_struct_nested3.nc.dmr index 3dd3a8eb5a..cb3acbfedd 100644 --- a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_struct_nested3.hdf5.dmr +++ b/dap4/src/test/data/resources/rawtestfiles/test_struct_nested3.nc.dmr @@ -1,6 +1,6 @@ + + + + + + diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_struct_type.nc.raw b/dap4/src/test/data/resources/rawtestfiles/test_struct_type.nc.dap similarity index 66% rename from dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_struct_type.nc.raw rename to dap4/src/test/data/resources/rawtestfiles/test_struct_type.nc.dap index 2b3ffbf1bb6dba2b2da82887cf834fbc2ef89229..549f472e23566fed18998d842db2f138788a8981 100644 GIT binary patch delta 159 zcmey&{D*~wg@Gw&BgjmCQcIFk(riuiEcFa^Q&P)PbMgyvQ}ar6GE&k^ zZ4LDdjr5F^^zFdr*yuZ!01ZwmElIWGve9=*EJ-X*oqV5>os)x+fq~)Q|Ns91iCHp7 delta 42 xcmeyv@|l^1g@N(@MwZKrGB)}yi6x1}sU>#2T#O71JV4Cw@Bjb*g){ok0{|4P4tf9p diff --git a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_struct_type.nc.dmr b/dap4/src/test/data/resources/rawtestfiles/test_struct_type.nc.dmr similarity index 60% rename from dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_struct_type.nc.dmr rename to dap4/src/test/data/resources/rawtestfiles/test_struct_type.nc.dmr index 691c85d70d..c21ec1e34a 100644 --- a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_struct_type.nc.dmr +++ b/dap4/src/test/data/resources/rawtestfiles/test_struct_type.nc.dmr @@ -9,4 +9,10 @@ + + + + + + diff --git a/dap4/src/test/data/resources/rawtestfiles/test_test.nc.dap b/dap4/src/test/data/resources/rawtestfiles/test_test.nc.dap new file mode 100644 index 0000000000000000000000000000000000000000..aa010e4fa31bc59af9c26f7db0febcfbef087e83 GIT binary patch literal 754 zcma))-D<)>5QVk$O6WT*+gsgjq6I67B5I*fiqPt9Sd&!)$s}aQ&^~hCqLb!_NT75t z0-HHAbH3TR?cIDki_bV>xz0?OfXglMz?lX=2|_rzeE0D@nsR1PL7<`pw9CJ=;fwje zSu0dV zBFRn?j9f3blFHq8l4d0OSK_>E=WO5->r5fdft4tl{&>jQp#c3#3GM}O%BzF|`!{Ko zfWa!ow>ZmHbRn(9<-8eAS7`+}^)=g6jL3G6iYy2;yWo6*B%7}EAs<=@E&oUW#M xRlnXzdk7l+;OI`oldwjC&UKWeu?8HTgX5!X3CkAE46n>Mvf5Ij@ArEB{ttw_*xCR9 literal 0 HcmV?d00001 diff --git a/dap4/src/test/data/resources/rawtestfiles/test_test.nc.dmr b/dap4/src/test/data/resources/rawtestfiles/test_test.nc.dmr new file mode 100644 index 0000000000..9f0b095029 --- /dev/null +++ b/dap4/src/test/data/resources/rawtestfiles/test_test.nc.dmr @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + diff --git a/dap4/src/test/data/resources/rawtestfiles/test_unlim.nc.dap b/dap4/src/test/data/resources/rawtestfiles/test_unlim.nc.dap new file mode 100644 index 0000000000000000000000000000000000000000..302e7514109b3dbff8549e33203a25d91d7f2833 GIT binary patch literal 2135 zcmbVN+iKfD5LKa22=pI>`kF|#vn5R>?QI_?2g=|D`iXh( zOJ{9KURib=M|foHvpaL<%l5_9Ne*aM_vpA1)v#ljpVv2a2Qms zr+1N8GKpce^UG~kHE^-}jqS42enZLEmRmzVm9eG~B>UiYTCM%9 zR+~OA)}WAUx4ZaE8r7Gm)hNikSZgOx4icFv9KMG2cBf=LADhvb@3OA~F#&ciW5H=Q zPe+0z3cIj#=HzMu9K z-DC>IY*MWXS>Do}O$peKZ= + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dap4/src/test/data/resources/rawtestfiles/test_unlim1.nc.dap b/dap4/src/test/data/resources/rawtestfiles/test_unlim1.nc.dap new file mode 100644 index 0000000000000000000000000000000000000000..80e898ad60dc4dec4e4ec684da392a05ecabe61f GIT binary patch literal 2136 zcmbVNZBN@U5YD7YlaTfwBJV3CO(+OZ!i#vBCT&wCUcP!>bF>zz6WLA&6Cd~`(|#g9 zU>|mFZOjFETC$DY?8j+t?w# z(oAG5F9f9I4iq`qUrSDyW(xGjHQzphjS$zMG_6F=M^Pa9#KALGUfDQZjN?Kh*+7PZ z10g-3QZm%K+zUhe6%-{Pn=&ZmAQUP*IqHSz?o(^i9xi&-#{FryqeR}-0FC#KeF&z9xIFSYClYHt&>VFpvO>0#h1YHx*98 z#`W~iB&=ClZDvWA(v9PCo~SWH+D!-rU5G79mL3l)adVDEYf`@aB2Y+|N;_pEe3NGz zHidlwHr>&{EtQ@v%JfLdjG9(kr8taBT1rr=l0ccJ3K-2{4EgFDR&I=8k1db#jg_`F z+humZe7?*s=9KyQCfn}TK_)Src7D0dng*_Szp-7mqBoR$Ww{mf3y~=tL81?S-0AFY zbRzt`Sc6)w?e6nu(x|>btyV$i#acN5J4i$!_3$;UH)G3sJ~qWM-=$x<);Z8qk#UBz zc{advHpk_m==bBE z#G6cN{xqqUg|ydnye>fZv+J}Q>;} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_utf8.nc.raw b/dap4/src/test/data/resources/rawtestfiles/test_utf8.nc.dap similarity index 63% rename from dap4/d4tests/src/test/data/resources/TestCDMClient/testinput/test_utf8.nc.raw rename to dap4/src/test/data/resources/rawtestfiles/test_utf8.nc.dap index b1518cf6b8a9bfdf99a74b0313a38397754a0cf3..5400f12b29862ced2c55e99705a04b662c3bb1b8 100644 GIT binary patch delta 126 zcmeBTnas+w)e#AO8UWjCB?H diff --git a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_utf8.nc.dmr b/dap4/src/test/data/resources/rawtestfiles/test_utf8.nc.dmr similarity index 60% rename from dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_utf8.nc.dmr rename to dap4/src/test/data/resources/rawtestfiles/test_utf8.nc.dmr index 6330f7b085..a2bc1456e5 100644 --- a/dap4/d4tests/src/test/data/resources/TestServlet/baseline/test_utf8.nc.dmr +++ b/dap4/src/test/data/resources/rawtestfiles/test_utf8.nc.dmr @@ -9,4 +9,10 @@ + + + + + + diff --git a/dap4/src/test/data/resources/rawtestfiles/test_vlen1.nc.dap b/dap4/src/test/data/resources/rawtestfiles/test_vlen1.nc.dap new file mode 100644 index 0000000000000000000000000000000000000000..320ba8bc8c6ee6a6d45eeb80be9439d72d93e42a GIT binary patch literal 721 zcma)4QES355bid|K-l{pOZKXb?Ho8s6`2zTV+fnRmdr*i#B0}{MSs@*;ZEC>4mVif zAjx-k-}fEYu+G24aJSKRuF@=u!Dp`1VYY%r97eG6+3bDN?lC(<38B<6D4*?B#)gBY z7)z9y!t17O4#*ARs4@(4t-y6)!D?_QlewYk5=|Z2q!n~fP=iPvWIkIXCVkH7<;001 zF^LnWD-IbSkEWd3-JTTnDd}H@gMv=Hsn0E0S9W1!$4cPfPdo$Oc@@Iz&REgWZp0a}RYIvLpgDAdmk3d- z;0eM=f?=N#eXq_gelWX+`IPm9esMc)yAfyxcZ&e`Z-X4XZeGw=O6yDXu8K0ZWa + + + + + + + + + + + + + + diff --git a/dap4/src/test/data/resources/rawtestfiles/test_vlen11.nc.dap b/dap4/src/test/data/resources/rawtestfiles/test_vlen11.nc.dap new file mode 100644 index 0000000000000000000000000000000000000000..9c2285881611e877e917602213d766ef8b8bb3a7 GIT binary patch literal 714 zcma)4&1%9x5Kg5hq0mPN+pF%H)Pj{nky@cpieU8`wr179W|AgjsIS#W>l1V|*^puj z-OIB3&3r$@Tw1M9Z~PH!yHHskCEzoM_n56wn0?KCxm9z1v z?M)@hT;WyQHV0%(II0|jLMw0_4r|uHLz%9OPM>s|P@L7!(Lw_vdyxBVhnNn9pchY4 zMQ&1_WLp8bm`>(`=x)xMhE(*g#!)HfE!6v-vMakxQm_g*2K1f)Z`~RZO=yCcMQ?jF zjlnF^dL{K)ABtK}Xdq0#NqkOJH4C_H@E@C&;S4c literal 0 HcmV?d00001 diff --git a/dap4/src/test/data/resources/rawtestfiles/test_vlen11.nc.dmr b/dap4/src/test/data/resources/rawtestfiles/test_vlen11.nc.dmr new file mode 100644 index 0000000000..2968757b79 --- /dev/null +++ b/dap4/src/test/data/resources/rawtestfiles/test_vlen11.nc.dmr @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + diff --git a/dap4/src/test/data/resources/rawtestfiles/test_vlen2.nc.dap b/dap4/src/test/data/resources/rawtestfiles/test_vlen2.nc.dap new file mode 100644 index 0000000000000000000000000000000000000000..a32cf1f1b43a0b21aa6a0f2f4ca750063dd0547f GIT binary patch literal 937 zcmbVK+iJo<5KXJ4AoL%?_EobcTCkERrB*1EB3OM5sk`bzvPqLsv|re-YCE}XjEGP= zFp$lenRDh+*J`Fc+y%bA<#8fH=@8Rs6P?RN$b?)uWcD_0^@yH;Cz!pl zj$$Gsj8{}9bo4NxSnl>DsgFT_N*v^L_DBR=reo0aPFM#!7oXTuhtRV@mI|^CK~w&* z!6EXZ(2f+@>7?vu2_36MRN)Ll1qDEn{48`}%Ca5+V)4EKMdyx%@6SDd!-)?22=!-_ zRS{WU7NT#{K!>!Eu3V)}%bNL5o2r)79Lj(~u#0=>x-SC2=kAka!jp=9hV;EEyM4rL zD&|wx6Oz}*NsRlCLEse@%}ud;xjJ88-L}<~92RWpbd7t%Y%#v&ei-4(p}A(uJI6Fk v%ScC?jp0a)O^a*C?k_Ygs%yF7w^l>HLcd18L{E*Of1#`Q585~SfAf9;<=FRK literal 0 HcmV?d00001 diff --git a/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_vlen2.nc.dmr b/dap4/src/test/data/resources/rawtestfiles/test_vlen2.nc.dmr similarity index 50% rename from dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_vlen2.nc.dmr rename to dap4/src/test/data/resources/rawtestfiles/test_vlen2.nc.dmr index cea92859ec..a48223f412 100644 --- a/dap4/d4tests/src/test/data/resources/TestParsers/dmrset/test_vlen2.nc.dmr +++ b/dap4/src/test/data/resources/rawtestfiles/test_vlen2.nc.dmr @@ -1,3 +1,4 @@ + + + + + + + + + + diff --git a/dap4/src/test/data/resources/rawtestfiles/test_vlen3.nc.dap b/dap4/src/test/data/resources/rawtestfiles/test_vlen3.nc.dap new file mode 100644 index 0000000000000000000000000000000000000000..b42d3d1fd318b288c456a8b7de6c380acf9d0527 GIT binary patch literal 676 zcma)4QA@)x5Ux5A2EO}P;_H^!Zo(Yx#&8OP$UwK(65HEW=+c^Ai+lHnd)u1Qp@M-c zO}>2heRr3Zb^7IvKR1b8g3jYq`OM)r%mx*vQLI)zo4-AF2h7e@WmQ^cUHTVsbdd92Q5PW=8tg+QrNb&{SE2U`9|d*Bpvxn4f8$AE z&#lM=izZtbx=|CgoH>~w>iE4tqYzMO{opx9OdxnrQ7jd+ahp+-=Oi^aa<`C40d~3j z(iBO1KNnBbNvnf;U-=AP?q`}>sxhX)R_VzajsNfb=DD~X1sFz4zt8Wu(~Y2nB+WLU lu(OVqx4y$2m%G23@kI52sQMGjx@uX6MgP_r#W}?V#W&T}w^0B9 literal 0 HcmV?d00001 diff --git a/dap4/src/test/data/resources/rawtestfiles/test_vlen3.nc.dmr b/dap4/src/test/data/resources/rawtestfiles/test_vlen3.nc.dmr new file mode 100644 index 0000000000..56966bb8ea --- /dev/null +++ b/dap4/src/test/data/resources/rawtestfiles/test_vlen3.nc.dmr @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + diff --git a/dap4/src/test/data/resources/rawtestfiles/test_vlen4.nc.dap b/dap4/src/test/data/resources/rawtestfiles/test_vlen4.nc.dap new file mode 100644 index 0000000000000000000000000000000000000000..e92a15ff10aa780a3e07bccec585c90ce1fc7e07 GIT binary patch literal 721 zcma)4+e*Vg5RJ7W6#R#}YiJ3znc@U>kcw{GX zG8y;WSpY#U;G$=0lR<(!h#dSf7Sf?IBrTc;*-EEzFio3ER6|t?S`@02xkt7D*@!Vb z(KHh%CZnm^FqyO2bj~o`j(BfGR>LlrRsKloqL}szP@m-V5xEX4gmT z{>77o8@qN!nzg+5{47e$Jo>~Y*+-EL`djw`TEwgsAbct5x>Q_tlloH{=_h@y2ioq-#A5_A + + + + + + + + + + + + + + diff --git a/dap4/src/test/data/resources/rawtestfiles/test_vlen5.nc.dap b/dap4/src/test/data/resources/rawtestfiles/test_vlen5.nc.dap new file mode 100644 index 0000000000000000000000000000000000000000..4d89d030744ae2e96212fee08048cd7886ef9db1 GIT binary patch literal 754 zcma))-%Ge+@>B^MpW0|J3)3sC*G$f=`SwOY`>4;MN za*|XaOzI?hLsdp+(>cX-*C#N;80=#w+{4c07xv^4YMd6J^9XV+ zDyPCFl~j(wUx<$!$5*RO@!;^R;LbC#b=reOO>i?ILRH=rd1?$=a~QBGfR^t$n9?B* zrXRjYfLMf&ic6-54f_<^St7)+N#?IuoC~`spSS~9=5VV%t&>(i>hFpve0`W}ybui% z*P=>~Xt+Fo=Qqpdb(MgKuY + + + + + + diff --git a/dap4/src/test/data/resources/rawtestfiles/test_vlen6.nc.dap b/dap4/src/test/data/resources/rawtestfiles/test_vlen6.nc.dap new file mode 100644 index 0000000000000000000000000000000000000000..35f0d2c5c5e84dafc54ec46ae09581797f961037 GIT binary patch literal 801 zcma)4+e*Vg5RJ7W6nqeWAgnJwwAm(BsU>MC)`B2XsO@Wr-EF&&Y+^DE*1z@-oLn}h z6v2goY|hL%b7r=wHNNf9XW;88j}s9}hnPl}=v=NsCgjE;i??Z~PxJ&l$vi)l+#!3O zkkPPZPdxAv4i_z59q9##15dzBeJ<|}xgs@~dC^kI^iZY_1#tys9n>J~P9_f70z?B! z@n(b($7UiUj5ky!bTXb%q`N*U8er1D3WtT9JrMzy*%9h*x`71 znUb2MM6w~+&k}B}Ur1Hu7_yfLWffnJi~(Ztz5_+-PKEC;J%7iE4*Lij$a(8Zd0n2O zr&*#yy2x3r!lo5x@zbWNab=`RD4TL|jy?B90QlT}l1z9~sV`8zUstyeluf04ta>E! z`Z$Yme=!JrMWwkpx|f^3`PJLB+LFVHt(~6nV3-}oQ|^Zmt_<2+w!U*r!?cWSRrweW hnz3p5TG9Q9rrk8P;^4P-igAW + + + + + + + + + + + + + + + + diff --git a/dap4/src/test/data/resources/rawtestfiles/test_vlen7.nc.dap b/dap4/src/test/data/resources/rawtestfiles/test_vlen7.nc.dap new file mode 100644 index 0000000000000000000000000000000000000000..fd99b6ce49b4b16840f829de00997d14921cde3e GIT binary patch literal 781 zcma)4TT8<*6t0)2fe)g-m-xChYn?bp>ln^~ATpTSYpF}N1=6&(XT|xi{Rf_2QY%w1 z5K8);^IcAIY#e^N!}m~{8BbCXDUaAzmzZ2FBPP_^BlDL@r%%ij0>uIuDejRSPs#AE z<&FagQVu6AQ!f>Shyzc-&m>njmRgbq%z}8KWqK&nguuSznT zR7gGq_ff%>^9|{)0z>u+p{(XBkP$#4Ubmo0{fUrr5y&kkChTG~Q1CXDioT-6%<@8y zbdj^Z3YXTL^jy?ZL07&jXC?*1>)#oVRZ>qaLl=JBn%KNH&BG32J z1n(~afv>0vH^cO5{WrgUn@(GCShAJZvu-WB!+6GJ6yudad&5@Oo^9EV<@{>KrPXW2 T^aqA + + + + + + + + + + + + + + + + diff --git a/dap4/src/test/data/resources/rawtestfiles/test_vlen8.nc.dap b/dap4/src/test/data/resources/rawtestfiles/test_vlen8.nc.dap new file mode 100644 index 0000000000000000000000000000000000000000..d01d3c4c1856cc59200ccf4532f443bbe222b8bd GIT binary patch literal 907 zcma)4(MrQW5R6(8Dn5um5YN||GqGZoq*APcpi-#yHN@tu2k9jy+o1l4U*$hJNpm$) z3myzyGP^rFd)qKJj@^s5X=LUi&19@RW?M(h6lxrYQcXNIdbmF9Ff*e-g+UZ6;jwp- zv5Rig?FSTOf_9pwJ}Q`kCy|k#M?!ThHD)zB43bAJ(}ql)nx+e?=%7ZSJC%9tg(x}a z9A8$P2sD#eaXR5D#ZgC1@Nzdu{8?vJXR%izrU;=+t@% zpHDp7vK^}!?Q%0Nul618*9>FOFy;q$V*}U(wt#h@IJ>|epyRf2-v>^CJ3z;M;qr+B E-+(gbfdBvi literal 0 HcmV?d00001 diff --git a/dap4/src/test/data/resources/rawtestfiles/test_vlen8.nc.dmr b/dap4/src/test/data/resources/rawtestfiles/test_vlen8.nc.dmr new file mode 100644 index 0000000000..c8a12671a8 --- /dev/null +++ b/dap4/src/test/data/resources/rawtestfiles/test_vlen8.nc.dmr @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + diff --git a/dap4/src/test/data/resources/rawtestfiles/test_zerodim.nc.dap b/dap4/src/test/data/resources/rawtestfiles/test_zerodim.nc.dap new file mode 100644 index 0000000000000000000000000000000000000000..beb062d2bc3d5af92ae39d14b0043a9720639fcd GIT binary patch literal 1436 zcmcIkZEKuB5Vp{M3G_e6_G_}{j4f%d!u;pF9L#lvr%+JNm~^juiC{ES%PW?;jgriViGSONLIvx zp)8~-mqyb|A**>k6^2V&t3s9%A*0C-0~7*X{k!3;C6>!O*rv~Up#>g z)`)E*!3x?5Tt-h3jr>+4v^nWnUaOl+nuTRP-d8k|tB;D%`8_J*92g+ognmo8RuVh1mn28c`&gS~Gng9yn}V?TPo&AuA<`83 zKctm5nExH?&I;!-{Yg>!Ng@`Ieo&bdbo`&aK3o&EZnJB=>F>`?P!hU>-E<{h!-YFh zRt5MoZTwqpZfvfr?OUav&n^rt3xo3c)c&cZTZQ4S0-R>EB;xP+XfJ~W6uP4QfV+7% ldz*~-DCFTU$;3gs9O)3e@Vv-dUO&d3cXHx+kKebsp8$8fnjruH literal 0 HcmV?d00001 diff --git a/dap4/src/test/data/resources/rawtestfiles/test_zerodim.nc.dmr b/dap4/src/test/data/resources/rawtestfiles/test_zerodim.nc.dmr new file mode 100644 index 0000000000..7c9bab9c5b --- /dev/null +++ b/dap4/src/test/data/resources/rawtestfiles/test_zerodim.nc.dmr @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dap4/src/test/java/dap4/test/Dap4ManifestIF.java b/dap4/src/test/java/dap4/test/Dap4ManifestIF.java new file mode 100644 index 0000000000..0e16966a29 --- /dev/null +++ b/dap4/src/test/java/dap4/test/Dap4ManifestIF.java @@ -0,0 +1,33 @@ +/* + * Copyright 2012, UCAR/Unidata. + * See the LICENSE file for more information. + */ + +package dap4.test; + +/** + * This class defines the set of all possible test base names. + * It is the union of all names used any any test. + * Each test excludes names that it cannot process. + */ + +public interface Dap4ManifestIF { + + // List of all file names + static public final String[][] dap4_manifest = {{"test_one_var"}, {"test_atomic_array"}, {"test_atomic_types"}, + {"test_enum_1"}, {"test_enum_2"}, {"test_enum_3"}, {"test_enum_array"}, {"test_fill"}, {"test_fill_2"}, + {"test_groups1"}, {"test_misc1"}, {"test_one_vararray"}, {"test_opaque"}, {"test_opaque_array"}, {"test_struct1"}, + {"test_struct_array"}, {"test_struct_nested"}, {"test_struct_nested3"}, {"test_struct_type"}, {"test_test"}, + {"test_unlim"}, {"test_unlim1"}, {"test_utf8"}, {"test_vlen1"}, {"test_vlen11"}, {"test_vlen2"}, {"test_vlen3"}, + {"test_vlen4"}, {"test_vlen5"}, {"test_vlen6"}, {"test_vlen7"}, {"test_vlen8"}, {"test_zerodim"}}; // dap4manifest + + // Define the Manifest of constrained tests + static public final String[][] constraint_manifest = + {{"test_atomic_array", "1", "/vu8[1][0:2:2];/vd[1];/vs[1][0];/vo[0][1]"}, + {"test_atomic_array", "2", "/v16[0:1,3]"}, {"test_atomic_array", "3", "/v16[3,0:1]"}, + {"test_one_vararray", "4", "/t[1]"}, {"test_one_vararray", "5", "/t[0:1]"}, + {"test_enum_array", "6", "/primary_cloud[1:2:4]"}, {"test_opaque_array", "7", "/vo2[1][0:1]"}, + {"test_struct_array", "8", "/s[0:2:3][0:1]"}}; + +} // Dap4Manifest + diff --git a/dap4/src/test/java/dap4/test/Dap4Server.java b/dap4/src/test/java/dap4/test/Dap4Server.java new file mode 100644 index 0000000000..773b2b8d8d --- /dev/null +++ b/dap4/src/test/java/dap4/test/Dap4Server.java @@ -0,0 +1,110 @@ +/* + * Copyright 2012, UCAR/Unidata. + * See the LICENSE file for more information. + */ + +package dap4.test; + +import dap4.core.util.DapConstants; +import dap4.core.util.DapException; +import ucar.httpservices.HTTPFactory; +import ucar.httpservices.HTTPMethod; + +import java.util.ArrayList; +import java.util.List; + +public class Dap4Server { + + ////////////////////////////////////////////////// + // Server Registry + + // Order is important; testing reachability is in the order listed + static List registry; + + static { + registry = new ArrayList<>(); + } + + static void register(boolean front, Dap4Server svc) { + // If already in registry, then replace it + for (int i = 0; i < registry.size(); i++) { + Dap4Server ds = registry.get(i); + if (ds.id.equals(svc.id)) { + registry.set(i, svc); + return; + } + } + if (front) + registry.add(0, svc); + else + registry.add(svc); + } + + static Dap4Server getServer(String id) { + for (Dap4Server ds : registry) { + if (ds.id.equals(id)) + return ds; + } + return null; + } + + ////////////////////////////////////////////////// + // Instance variables + public String id; + public String ip; + public int port; + public String servletpath; + + ////////////////////////////////////////////////// + // Constructor(s) + + public Dap4Server(String id, String ip, int port, String servletpath) { + this.id = id; + this.ip = ip; + this.port = port; + this.servletpath = servletpath; + } + + public String getURL() { + return getURL(DapConstants.HTTPSCHEME); + } + + public String getURL(String scheme) { + StringBuilder buf = new StringBuilder(); + buf.append(scheme + "//"); + buf.append(this.ip); + if (this.port > 0) { + buf.append(":"); + buf.append(this.port); + } + buf.append("/"); + buf.append(this.servletpath); + return buf.toString(); + } + + public boolean ping() { + boolean ok = false; + String url = getURL(); + try { + try (HTTPMethod method = HTTPFactory.Get(url)) { + int code = method.execute(); + if (code == 200) + ok = true; + } + } catch (Exception e) { + ok = false; + } + return ok; + } + + static public Dap4Server findServer() throws DapException { + // Find the server to use + for (Dap4Server svc : registry) { + if (svc.ping()) + return svc; + } + return null; + } +} + + diff --git a/dap4/src/test/java/dap4/test/DapTestCommon.java b/dap4/src/test/java/dap4/test/DapTestCommon.java new file mode 100644 index 0000000000..71fbc8b0cb --- /dev/null +++ b/dap4/src/test/java/dap4/test/DapTestCommon.java @@ -0,0 +1,404 @@ +/* + * Copyright 2012, UCAR/Unidata. + * See the LICENSE file for more information. + */ + +package dap4.test; + +import dap4.core.util.DapConstants; +import dap4.core.util.DapException; +import dap4.core.util.DapUtil; +import dap4.dap4lib.HttpDSP; +import ucar.nc2.dataset.NetcdfDataset; +import ucar.nc2.write.Ncdump; +import ucar.unidata.util.test.TestDir; +import ucar.unidata.util.test.UnitTestCommon; + +import java.io.File; +import java.io.FileFilter; +import java.io.IOException; +import java.io.StringWriter; +import java.util.ArrayList; +import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +abstract public class DapTestCommon extends UnitTestCommon { + + ////////////////////////////////////////////////// + // Constants + + static final String DEFAULTTREEROOT = "dap4"; + + static public final String FILESERVER = "file://localhost:8080"; + + static public final String ORDERTAG = "ucar.littleendian"; + static public final String TRANSLATETAG = "ucar.translate"; + static public final String TESTTAG = "ucar.testing"; + + static final String D4TESTDIRNAME = ""; + + // Equivalent to the path to the webapp/d4ts for testing purposes + static protected final String DFALTRESOURCEPATH = "/src/test/data/resources"; + + static protected final String[] LEGALEXTENSIONS = {".dap", ".dmr", ".nc", "dmp", ".ncdump", ".dds", ".das", ".dods"}; + + ////////////////////////////////////////////////// + + static class TestFilter implements FileFilter { + boolean debug; + boolean strip; + String[] extensions; + + public TestFilter(boolean debug, String[] extensions) { + this.debug = debug; + this.strip = strip; + this.extensions = extensions; + } + + public boolean accept(File file) { + boolean ok = false; + if (file.isFile() && file.canRead()) { + // Check for proper extension + String name = file.getName(); + if (name != null) { + for (String ext : extensions) { + if (name.endsWith(ext)) + ok = true; + } + } + if (!ok && debug) + System.err.println("Ignoring: " + file.toString()); + } + return ok; + } + + static void filterfiles(String path, List matches, String... extensions) { + File testdirf = new File(path); + assert (testdirf.canRead()); + TestFilter tf = new TestFilter(DEBUG, extensions); + File[] filelist = testdirf.listFiles(tf); + for (int i = 0; i < filelist.length; i++) { + File file = filelist[i]; + if (file.isDirectory()) + continue; + String fname = DapUtil.canonicalpath(file.getAbsolutePath()); + matches.add(fname); + } + } + } + + // Test properties + static class TestProperties { + boolean prop_diff; // Do comparison with baseline files + boolean prop_baseline; // Generate the baseline files + boolean prop_visual; // Debug output: display the test output and the baseline output + boolean prop_debug; // General debug flag + boolean prop_http_debug; // Print request and response headers + + public TestProperties() { + prop_diff = true; + prop_baseline = false; + prop_visual = false; + prop_debug = DEBUG; + prop_http_debug = false; + } + } + + static public class TestCaseCommon { + public String name; + + public TestCaseCommon() { + this(null); + } + + public TestCaseCommon(String name) { + this.name = name; + } + } + + ////////////////////////////////////////////////// + // Static variables + + static protected String dap4root = null; + static protected String dap4testroot = null; + static protected String dap4resourcedir = null; + + static protected TestProperties props = null; + + static { + dap4root = locateDAP4Root(threddsroot); + if (dap4root == null) + System.err.println("Cannot locate /dap4 parent dir"); + dap4testroot = canonjoin(dap4root, D4TESTDIRNAME); + dap4resourcedir = canonjoin(dap4testroot, DFALTRESOURCEPATH); + props = new TestProperties(); + } + + ////////////////////////////////////////////////// + // Static methods + + static protected String getD4TestsRoot() { + return dap4testroot; + } + + static protected String getResourceRoot() { + return dap4resourcedir; + } + + static String locateDAP4Root(String threddsroot) { + String root = threddsroot; + if (root != null) + root = root + "/" + DEFAULTTREEROOT; + // See if it exists + File f = new File(root); + if (!f.exists() || !f.isDirectory()) + root = null; + return root; + } + + ////////////////////////////////////////////////// + // Instance variables + + protected String d4tsserver = null; + + protected String title = "Dap4 Testing"; + + public DapTestCommon() { + this("DapTest"); + } + + public DapTestCommon(String name) { + super(name); + setSystemProperties(); + this.d4tsserver = TestDir.dap4TestServer; + if (DEBUG) + System.err.println("DapTestCommon: d4tsServer=" + d4tsserver); + } + + /** + * Try to get the system properties + */ + protected void setSystemProperties() { + if (System.getProperty("nodiff") != null) + props.prop_diff = false; + if (System.getProperty("baseline") != null) + props.prop_baseline = true; + if (System.getProperty("debug") != null) + props.prop_debug = true; + if (System.getProperty("visual") != null) + props.prop_visual = true; + if (props.prop_baseline && props.prop_diff) + props.prop_diff = false; + } + + public void setup() { + if (props.prop_http_debug) + HttpDSP.setHttpDebug(); + } + + ////////////////////////////////////////////////// + // Accessor + public void setTitle(String title) { + this.title = title; + } + + public String getTitle() { + return this.title; + } + + ////////////////////////////////////////////////// + // Instance Utilities + + public void visual(String header, String captured) { + if (!captured.endsWith("\n")) + captured = captured + "\n"; + // Dump the output for visual comparison + System.err.println("\n" + header + ":"); + System.err.println("---------------"); + System.err.print(captured); + System.err.println("---------------"); + System.err.flush(); + } + + protected void findServer(String path) throws DapException { + String svc = DapConstants.HTTPSCHEME + "//" + this.d4tsserver + "/d4ts"; + if (!checkServer(svc)) + System.err.println("D4TS Server not reachable: " + svc); + // Since we will be accessing it thru NetcdfDataset, we need to change the schema. + d4tsserver = "dap4://" + d4tsserver + "/d4ts"; + } + + ////////////////////////////////////////////////// + + public String getDAP4Root() { + return this.dap4root; + } + + @Override + public String getResourceDir() { + return this.dap4resourcedir; + } + + static void printDir(String path) { + File testdirf = new File(path); + assert (testdirf.canRead()); + File[] filelist = testdirf.listFiles(); + System.err.println("\n*******************"); + System.err.printf("Contents of %s:%n", path); + for (int i = 0; i < filelist.length; i++) { + File file = filelist[i]; + String fname = file.getName(); + System.err.printf("\t%s%s%n", fname, (file.isDirectory() ? "/" : "")); + } + System.err.println("*******************"); + System.err.flush(); + } + + ////////////////////////////////////////////////// + // Filename processing utilities + + /** + * Given a List of file names, return a list of those names except + * for any in the array of filenames to be excluded. + * + * @param manifest The list of file names + * @param exclusions The array of excluded names + * @return manifest with excluded names removed + */ + static public String[][] excludeNames(String[][] manifest, String[] exclusions) { + List xlist = new ArrayList<>(manifest.length); + for (int i = 0; i < manifest.length; i++) { + String name = manifest[i][0]; // Assume tuple element 0 is always the name + boolean matched = false; + for (String excluded : exclusions) { + if (excluded.equals(name)) + matched = true; + } + if (!matched) + xlist.add(manifest[i]); + } + return xlist.toArray(new String[0][]); + } + + // Filter a document with respect to a set of regular expressions + // Used to remove e.g. unwanted attributes + static public boolean regexpFilter(StringBuilder document, String regexp, boolean repeat) { + boolean changed = false; + String doc = document.toString(); + Pattern p = Pattern.compile(regexp, Pattern.DOTALL); + Matcher m = p.matcher(doc); + if (m.find()) { + changed = true; + String newdoc = (repeat ? m.replaceAll("") : m.replaceFirst("")); + doc = newdoc; + document.setLength(0); + document.append(doc); + } + return changed; + } + + static public boolean regexpFilters(StringBuilder sbdoc, String[] regexps, boolean repeat) { + boolean changed = false; + for (String re : regexps) { + if (regexpFilter(sbdoc, re, repeat)) + changed = true; + else + break; + } + return changed; + } + + // Filter a document with respect to a set of regular expressions + // on a per-line basis + static public boolean regexpFilterLine(StringBuilder document, String regexp, boolean repeat) { + boolean changed = false; + Pattern p = Pattern.compile(regexp, Pattern.DOTALL); + String[] lines = document.toString().split("\r?\n"); + document.setLength(0); + for (int i = 0; i < lines.length; i++) { + String line = lines[i]; + Matcher m = p.matcher(line); + if (!m.find()) { + document.append(line); + document.append("\n"); + changed = true; + if (!repeat) + break; + } + } + return changed; + } + + + /** + * Choose a test case based on its name and return its index + * + * @param name to search for + * @param testcases set of testcases to search + */ + static void singleTest(String name, List testcases) { + for (int i = 0; i < testcases.size(); i++) { + TestCaseCommon tc = testcases.get(i); + if (tc.name.equalsIgnoreCase(name)) { + testcases.clear(); + testcases.add(tc); + } + } + return; + } + + /** + * Choose a test case based on its name and return its index + * + * @param index to search for + * @param testcases set of testcases to search + */ + static void singleTest(int index, List testcases) { + TestCaseCommon tc = testcases.get(index); + testcases.clear(); + testcases.add(tc); + return; + } + + protected String dumpmetadata(NetcdfDataset ncfile, String datasetname) throws Exception { + StringWriter sw = new StringWriter(); + StringBuilder args = new StringBuilder("-strict"); + if (datasetname != null) { + args.append(" -datasetname "); + args.append(datasetname); + } + // Print the meta-databuffer using these args to NcdumpW + try { + Ncdump.ncdump(ncfile, args.toString(), sw, null); + // if (!ucar.nc2.NCdumpW.print(ncfile, args.toString(), sw, null)) + // throw new Exception("NcdumpW failed"); + } catch (IOException ioe) { + throw new Exception("Ncdump failed", ioe); + } + sw.close(); + return sw.toString(); + } + + protected String dumpdata(NetcdfDataset ncfile, String datasetname) throws Exception { + StringBuilder args = new StringBuilder("-strict -vall"); + if (datasetname != null) { + args.append(" -datasetname "); + args.append(datasetname); + } + StringWriter sw = new StringWriter(); + // Dump the databuffer + try { + Ncdump.ncdump(ncfile, args.toString(), sw, null); + // if (!ucar.nc2.NCdumpW.print(ncfile, args.toString(), sw, null)) + // throw new Exception("NCdumpW failed"); + } catch (IOException ioe) { + ioe.printStackTrace(); + throw new Exception("NCdump failed", ioe); + } + sw.close(); + return sw.toString(); + } + + +} diff --git a/dap4/d4tests/src/test/java/dap4/test/Dump.java b/dap4/src/test/java/dap4/test/Dump.java similarity index 98% rename from dap4/d4tests/src/test/java/dap4/test/Dump.java rename to dap4/src/test/java/dap4/test/Dump.java index 7ebe022f0a..8a2160798f 100644 --- a/dap4/d4tests/src/test/java/dap4/test/Dump.java +++ b/dap4/src/test/java/dap4/test/Dump.java @@ -6,6 +6,7 @@ package dap4.test; +import dap4.core.util.DapConstants; import dap4.core.util.DapUtil; import dap4.core.util.Escape; import java.io.IOException; @@ -168,7 +169,7 @@ public void verifychecksum() throws IOException { return; int localcrc32 = endchecksum(); // Get the checksum from the input stream - ByteBuffer bbuf = readn(DapUtil.CHECKSUMSIZE); + ByteBuffer bbuf = readn(DapConstants.CHECKSUMSIZE); int remotecrc32 = bbuf.getInt(); assert localcrc32 == remotecrc32; newline(); diff --git a/dap4/src/test/java/dap4/test/TestConstraints.java b/dap4/src/test/java/dap4/test/TestConstraints.java new file mode 100644 index 0000000000..5efb52a48f --- /dev/null +++ b/dap4/src/test/java/dap4/test/TestConstraints.java @@ -0,0 +1,186 @@ +/* + * Copyright 2012, UCAR/Unidata. + * See the LICENSE file for more information. + */ + +package dap4.test; + +import dap4.core.util.DapConstants; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.Parameterized; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import ucar.nc2.dataset.NetcdfDataset; + +import java.io.File; +import java.io.IOException; +import java.io.StringWriter; +import java.lang.invoke.MethodHandles; +import java.nio.file.NoSuchFileException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * This Test uses the JUNIT Version 4 parameterized test mechanism. + * The set of arguments for each test is encapsulated in a class + * called TestCase. This allows for code re-use and for extending + * tests by adding fields to the TestCase object. + */ + +@RunWith(Parameterized.class) +public class TestConstraints extends DapTestCommon implements Dap4ManifestIF { + + ////////////////////////////////////////////////// + // Constants + + // Define the server to use + static protected final String SERVERNAME = "d4ts"; + static protected final String SERVER = "remotetest.unidata.ucar.edu"; + static protected final int SERVERPORT = -1; + static protected final String SERVERPATH = "d4ts/testfiles"; + + // Define the input set location(s) + static protected final String INPUTEXT = ".nc"; // note that the .dap is deliberately left off + static protected final String INPUTQUERY = "?" + DapConstants.CHECKSUMTAG + "=false&"; + static protected final String INPUTFRAG = "#dap4"; + + static protected final String BASELINEDIR = "/baselineconstraints"; + static protected final String BASELINEEXT = ".nc.ncdump"; + + // Following files cannot be tested because of flaws in sequence handling + // by the CDM code in ucar.nc2.dataset. + static protected String[] EXCLUSIONS = + {"test_vlen2", "test_vlen3", "test_vlen4", "test_vlen5", "test_vlen6", "test_vlen7", "test_vlen8"}; + + ////////////////////////////////////////////////// + // Static Fields + + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); + + static public String resourceroot; + static public Dap4Server server; + + static { + // This test uses remotetest + server = new Dap4Server("remotetest", SERVER, SERVERPORT, SERVERPATH); + Dap4Server.register(true, server); + resourceroot = getResourceRoot(); + } + + ////////////////////////////////////////////////// + // Test Case Class + + // Encapulate the arguments for each test + static class TestCase extends TestCaseCommon { + public String url; + public String baseline; + public String ce; // for debugging + + public TestCase(String name, String url, String baseline, String ce) { + super(name); + this.url = url; + this.baseline = baseline; + this.ce = ce; + } + + // This defines how the test is reported by JUNIT. + public String toString() { + return this.name; + } + } + + ////////////////////////////////////////////////// + // Test Generator + + @Parameterized.Parameters(name = "{index}: {0}") + static public List defineTestCases() { + assert (server != null); + List testcases = new ArrayList<>(); + String[][] manifest = excludeNames(constraint_manifest, EXCLUSIONS); + // Separate the manifest string into the file name and the index and the query parts + for (String[] tuple : manifest) { + String file = tuple[0]; + String index = tuple[1]; + String query = tuple[2]; // excluding leading '?' + String url = + server.getURL() + "/" + file + INPUTEXT + INPUTQUERY + DapConstants.CONSTRAINTTAG + query + INPUTFRAG; + String baseline = resourceroot + BASELINEDIR + "/" + file + "." + index + BASELINEEXT; + TestCase tc = new TestCase(file + "." + index, url, baseline, query); + testcases.add(tc); + } + // singleTest(0,testcases); // choose single test for debugging + return testcases; + } + + ////////////////////////////////////////////////// + // Test Fields + + TestCase tc; + + ////////////////////////////////////////////////// + // Constructor(s) + + public TestConstraints(TestCaseCommon tc) { + super(); + this.tc = (TestCase) tc; + } + + ////////////////////////////////////////////////// + // Junit test method(s) + + @Before + public void setup() { + // Set any properties + // props.prop_visual = true; + // props.prop_baseline = true; + super.setup(); + } + + @Test + public void test() throws Exception { + int i, c; + StringBuilder sb = new StringBuilder(); + + NetcdfDataset ncfile; + try { + ncfile = openDataset(tc.url); + } catch (Exception e) { + e.printStackTrace(); + throw new Exception("File open failed: " + tc.url, e); + } + assert ncfile != null; + + String datasetname = tc.name; + String testresult = dumpdata(ncfile, datasetname); + + // Read the baseline file(s) if they exist + String baselinecontent = null; + if (props.prop_baseline) { + writefile(tc.baseline, testresult); + } else { + try { + baselinecontent = readfile(tc.baseline); + } catch (NoSuchFileException nsf) { + Assert.fail(tc.name + ": ***Fail: test comparison file not found: " + tc.baseline); + } + } + if (props.prop_visual) { + if (baselinecontent != null) + visual("Input", baselinecontent); + visual("Output", testresult); + } + if (!props.prop_baseline && props.prop_diff) { // compare with baseline + System.err.println("Comparison: vs " + tc.baseline); + Assert.assertTrue("*** FAIL", same(getTitle(), baselinecontent, testresult)); + System.out.println(tc.name + ": Passed"); + } + } +} + + diff --git a/dap4/src/test/java/dap4/test/TestHyrax.java b/dap4/src/test/java/dap4/test/TestHyrax.java new file mode 100644 index 0000000000..244b87018c --- /dev/null +++ b/dap4/src/test/java/dap4/test/TestHyrax.java @@ -0,0 +1,190 @@ +/* + * Copyright 2012, UCAR/Unidata. + * See the LICENSE file for more information. + */ + +package dap4.test; + +import dap4.core.util.DapConstants; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.Parameterized; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import ucar.nc2.dataset.NetcdfDataset; + +import java.lang.invoke.MethodHandles; +import java.nio.file.NoSuchFileException; +import java.util.ArrayList; +import java.util.List; + +/** + * This Test uses the JUNIT Version 4 parameterized test mechanism. + * The set of arguments for each test is encapsulated in a class + * called TestCase. This allows for code re-use and for extending + * tests by adding fields to the TestCase object. + */ + +/** + * This test set reads DAP4 datasets (both constrained and not) + * from the test.opendap.org test server + */ + +@RunWith(Parameterized.class) +public class TestHyrax extends DapTestCommon implements Dap4ManifestIF { + + ////////////////////////////////////////////////// + // Constants + + // Define the server to use + static protected final String SERVERNAME = "hyrax"; + static protected final String SERVER = "test.opendap.org"; + static protected final int SERVERPORT = -1; + static protected final String SERVERPATH = "opendap"; + + // Define the input set location(s) + static protected final String INPUTEXT = ""; + static protected final String INPUTQUERY = "?dap4.checksum=true"; + static protected final String INPUTFRAG = "#dap4&hyrax"; + + static protected final String BASELINEDIR = "/baselinehyrax"; + static protected final String BASELINEEXT = ".ncdump"; + + static final String[][] hyrax_manifest = new String[][] {{"nc4_nc_classic_no_comp.nc", "nc4_test_files", null}, + {"nc4_nc_classic_comp.nc", "nc4_test_files", null}, {"nc4_unsigned_types.nc", "nc4_test_files", null}, + {"nc4_unsigned_types_comp.nc", "nc4_test_files", null}, {"nc4_strings.nc", "nc4_test_files", null}, + {"nc4_strings_comp.nc", "nc4_test_files", null}, {"ref_tst_compounds.nc", "nc4_test_files", null}, + {"amsre_20060131v5.dat", "RSS/amsre/bmaps_v05/y2006/m01", "/time_a[0:2][0:5]"}, + {"AIRS.2002.12.01.L3.RetStd_H031.v4.0.21.0.G06101132853.hdf", "AIRS/AIRH3STM.003/2002.12.01", "/TotalCounts_A"}}; + + static final String[] HYRAX_EXCLUSIONS = {}; + + ////////////////////////////////////////////////// + // Static Fields + + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); + + static public String resourceroot; + static public Dap4Server server; + + static { + server = new Dap4Server("hyrax", SERVER, SERVERPORT, SERVERPATH); + Dap4Server.register(true, server); + resourceroot = getResourceRoot(); + } + + ////////////////////////////////////////////////// + // Test Case Class + + // Encapulate the arguments for each test + static class TestCase extends TestCaseCommon { + public String url; + public String baseline; + public String ce; // optional + + public TestCase(String name, String url, String baseline, String ce) { + super(name); + this.url = url; + this.baseline = baseline; + this.ce = ce; + } + + // This defines how the test is reported by JUNIT. + public String toString() { + return this.name; + } + } + + ////////////////////////////////////////////////// + // Test Generator + + @Parameterized.Parameters(name = "{index}: {0}") + static public List defineTestCases() { + assert (server != null); + List testcases = new ArrayList<>(); + String[][] manifest = excludeNames(hyrax_manifest, HYRAX_EXCLUSIONS); + // Separate the manifest string into pieces + for (String[] tuple : manifest) { + String file = tuple[0]; + String prefix = tuple[1]; + String query = tuple[2]; // excluding leading '?' + // Unfortunately, The OPeNDAP test server does not appear to support https: + String url = server.getURL("http:") + "/" + prefix + "/" + file + INPUTEXT + INPUTQUERY; + if (query != null) + url += ("&" + DapConstants.CONSTRAINTTAG + "=" + query); + url += INPUTFRAG; + String baseline = resourceroot + BASELINEDIR + "/" + file + BASELINEEXT; + TestCase tc = new TestCase(file, url, baseline, query); + testcases.add(tc); + } + // singleTest("AIRS.2002.12.01.L3.RetStd_H031.v4.0.21.0.G06101132853.hdf", testcases); // choose single test for + // debugging + return testcases; + } + ////////////////////////////////////////////////// + // Test Fields + + TestCase tc; + + ////////////////////////////////////////////////// + // Constructor(s) + + public TestHyrax(TestCaseCommon tc) { + super(); + this.tc = (TestCase) tc; + } + + ////////////////////////////////////////////////// + // Junit test method(s) + + @Before + public void setup() { + // Set any properties + // props.prop_baseline = true; + // props.prop_visual = true; + super.setup(); + } + + @Test + public void test() throws Exception { + int i, c; + StringBuilder sb = new StringBuilder(); + + NetcdfDataset ncfile; + try { + ncfile = openDataset(tc.url); + } catch (Exception e) { + e.printStackTrace(); + throw new Exception("File open failed: " + tc.url, e); + } + assert ncfile != null; + + String datasetname = tc.name; + String testresult = dumpdata(ncfile, datasetname); + + // Read the baseline file(s) if they exist + String baselinecontent = null; + if (props.prop_baseline) { + writefile(tc.baseline, testresult); + } else { + try { + baselinecontent = readfile(tc.baseline); + } catch (NoSuchFileException nsf) { + Assert.fail(tc.name + ": ***Fail: test comparison file not found: " + tc.baseline); + } + } + if (props.prop_visual) { + if (baselinecontent != null) + visual("Input", baselinecontent); + visual("Output", testresult); + } + if (!props.prop_baseline && props.prop_diff) { // compare with baseline + System.err.println("Comparison: vs " + tc.baseline); + Assert.assertTrue("*** FAIL", same(getTitle(), baselinecontent, testresult)); + System.out.println(tc.name + ": Passed"); + } + } + +} diff --git a/dap4/src/test/java/dap4/test/TestParserCE.java b/dap4/src/test/java/dap4/test/TestParserCE.java new file mode 100644 index 0000000000..5216673a8a --- /dev/null +++ b/dap4/src/test/java/dap4/test/TestParserCE.java @@ -0,0 +1,174 @@ +/* + * Copyright 2012, UCAR/Unidata. + * See the LICENSE file for more information. + */ + +package dap4.test; + +import dap4.core.ce.CECompiler; +import dap4.core.ce.CEConstraint; +import dap4.core.ce.parser.CEParserImpl; +import dap4.core.dmr.DMRFactory; +import dap4.core.dmr.DapDataset; +import dap4.core.dmr.ErrorResponse; +import dap4.core.dmr.parser.DOM4Parser; +import dap4.core.dmr.parser.Dap4Parser; +import dap4.core.dmr.parser.ParseUtil; +import dap4.core.dmr.DMRPrinter; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.Parameterized; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import java.io.File; +import java.io.PrintWriter; +import java.io.StringWriter; +import java.lang.invoke.MethodHandles; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.regex.Pattern; + +/** + * This Test uses the JUNIT Version 4 parameterized test mechanism. + * The set of arguments for each test is encapsulated in a class + * called TestCase. This allows for code re-use and for extending + * tests by adding fields to the TestCase object. + */ + +/** + * This tests the Constraint Expression (CE) Parser; + * it is completely self-contained. + */ + +@RunWith(Parameterized.class) +public class TestParserCE extends DapTestCommon implements Dap4ManifestIF { + + ////////////////////////////////////////////////// + // Constants + + static final boolean DMRPARSEDEBUG = false; + static final boolean CEPARSEDEBUG = false; + + // DMR Constants + static final String CE1_DMR = "\n" + + " \n" + " \n" + + " \n" + " \n" + " \n" + " \n" + + " \n" + " \n" + " \n" + " \n" + + " \n" + " \n" + " \n" + " \n" + + " \n" + " \n" + " \n" + " \n" + + " \n" + " \n" + " \n" + " \n" + + " \n" + " \n" + " \n" + " \n" + + " \n" + " \n" + " \n" + " \n" + + " \n" + " \n" + " \n" + ""; + + static final String CE2_DMR = "" + " " + + " " + " " + " " + " " + ""; + + static final String[][] testinputs = + {{"/a[1]", null, CE1_DMR}, {"/b[10:16]", null, CE1_DMR}, {"/c[8:2:15]", null, CE1_DMR}, + {"/a[1];/b[10:16];/c[8:2:15]", null, CE1_DMR}, {"/d[1][0:2:2];/a[1];/e[1][0];/f[0][1]", null, CE1_DMR}, + {"/s[0:3][0:2].x;/s[0:3][0:2].y", "/s[0:3][0:2]", CE1_DMR}, {"/seq|i1<0", null, CE1_DMR}, + {"/seq|00,i1<10", CE1_DMR}, {"vo[1:1][0,0]", "/vo[1][0,0]", CE2_DMR}}; + + ////////////////////////////////////////////////// + // Static Fields + + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); + + ////////////////////////////////////////////////// + // Test Case Class + + // Encapulate the arguments for each test + static class TestCase extends TestCaseCommon { + public String ce; + public String expected; // null => same as ce + public String dmr; // DMR against which the CE is defined + + public TestCase(String ce, String expected, String dmr) { + super(); + this.ce = ce; + this.expected = expected; + this.dmr = dmr; + if (this.expected == null) + this.expected = ce; + } + + // This defines how the test is reported by JUNIT. + public String toString() { + return this.ce; + } + } + + ////////////////////////////////////////////////// + // Test Generator + + @Parameterized.Parameters(name = "{index}: {0}") + static public List defineTestCases() { + List testcases = new ArrayList<>(); + for (String[] triple : testinputs) { + TestCase tc = new TestCase(triple[0], triple[1], triple[2]); + testcases.add(tc); + } + // singleTest(0, testcases); // choose single test for debugging + return testcases; + } + + ////////////////////////////////////////////////// + // Test Fields + + TestCase tc; + + ////////////////////////////////////////////////// + // Constructor(s) + + public TestParserCE(TestCaseCommon tc) { + super(); + this.tc = (TestCase) tc; + } + + ////////////////////////////////////////////////// + // Junit test method(s) + + @Before + public void setup() { + // Set any properties + super.setup(); + } + + @Test + public void test() throws Exception { + int i, c; + + // Create the DMR tree + Dap4Parser parser = new DOM4Parser(new DMRFactory()); + if (DMRPARSEDEBUG) + parser.setDebugLevel(1); + // Parse document + Assert.assertTrue("DMR Parse failed", parser.parse(tc.dmr)); + Assert.assertNull("DMR Parser returned Error response", parser.getErrorResponse()); // Check result + DapDataset dmr = parser.getDMR(); + Assert.assertNotNull("No DMR created", dmr); + + // Parse the constraint expression against the DMR + CEParserImpl ceparser = new CEParserImpl(dmr); + if (CEPARSEDEBUG) + ceparser.setDebugLevel(1); + Assert.assertTrue("CE Parse failed", ceparser.parse(tc.ce)); + CECompiler compiler = new CECompiler(); + CEConstraint ceroot = compiler.compile(dmr, ceparser.getCEAST()); + Assert.assertNotNull("No CEConstraint created", ceroot); + + // Dump the parsed CE for comparison purposes + String cedump = ceroot.toConstraintString(); + if (props.prop_visual) + visual("|" + tc.ce + "|", cedump); + Assert.assertTrue("expected :: CE mismatch", same(getTitle(), tc.expected, cedump)); + System.out.println(tc.ce + ": Passed"); + } + +} diff --git a/dap4/src/test/java/dap4/test/TestParserDMR.java b/dap4/src/test/java/dap4/test/TestParserDMR.java new file mode 100644 index 0000000000..1f1e8c578c --- /dev/null +++ b/dap4/src/test/java/dap4/test/TestParserDMR.java @@ -0,0 +1,186 @@ +/* + * Copyright 2012, UCAR/Unidata. + * See the LICENSE file for more information. + */ + +package dap4.test; + +import dap4.core.dmr.DMRFactory; +import dap4.core.dmr.DapDataset; +import dap4.core.dmr.ErrorResponse; +import dap4.core.dmr.parser.DOM4Parser; +import dap4.core.dmr.parser.Dap4Parser; +import dap4.core.dmr.parser.ParseUtil; +import dap4.core.dmr.DMRPrinter; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.Parameterized; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import java.io.File; +import java.io.PrintWriter; +import java.io.StringWriter; +import java.lang.invoke.MethodHandles; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * This Test uses the JUNIT Version 4 parameterized test mechanism. + * The set of arguments for each test is encapsulated in a class + * called TestCase. This allows for code re-use and for extending + * tests by adding fields to the TestCase object. + */ + +@RunWith(Parameterized.class) +public class TestParserDMR extends DapTestCommon implements Dap4ManifestIF { + + ////////////////////////////////////////////////// + // Constants + + static final boolean PARSEDEBUG = false; + + // Define the input set location(s) + static protected final String INPUTDIR = "/rawtestfiles"; + static protected final String INPUTEXT = ".nc.dmr"; + + // Define some common DMR filter regular expression + static String RE_ENDIAN = "\n[ \t]*[ \t]*"; + static String RE_NCPROPS = "\n[ \t]*[ \t]*"; + static protected final String RE_UNLIMITED = "[ \t]+_edu.ucar.isunlimited=\"1\""; + + ////////////////////////////////////////////////// + // Static Fields + + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); + + static public String resourceroot; + + static { + resourceroot = getResourceRoot(); + } + + ////////////////////////////////////////////////// + // Test Case Class + + // Encapulate the arguments for each test + static class TestCase extends TestCaseCommon { + public String name; // Name from manifest + public String input; // Full path or URL for the input file + + public TestCase(String filename, String input) { + super(filename); + this.input = input; + } + + // This defines how the test is reported by JUNIT. + public String toString() { + return this.name; + } + } + + ////////////////////////////////////////////////// + // Test Generator + + @Parameterized.Parameters(name = "{index}: {0}") + static public List defineTestCases() { + List testcases = new ArrayList<>(); + for (String[] tuple : dap4_manifest) { + String name = tuple[0]; + String path = resourceroot + INPUTDIR + "/" + name + INPUTEXT; + TestCase tc = new TestCase(name, path); + testcases.add(tc); + } + // Include the constraint tests also + for (String[] triple : constraint_manifest) { + String file = triple[0]; // unpack + String index = triple[1]; + String ce = triple[2]; // unused + String path = resourceroot + INPUTDIR + "/" + file + "." + index + INPUTEXT; + TestCase tc = new TestCase(file + "." + index, path); + testcases.add(tc); + } + // singleTest(0, testcases); // choose single test for debugging + return testcases; + } + + ////////////////////////////////////////////////// + // Test Fields + + TestCase tc; + + ////////////////////////////////////////////////// + // Constructor(s) + + public TestParserDMR(TestCaseCommon tc) { + super(); + this.tc = (TestCase) tc; + } + + ////////////////////////////////////////////////// + // Junit test method(s) + + @Before + public void setup() { + // Set any properties + // props.prop_visual = true; + super.setup(); + } + + @Test + public void test() throws Exception { + String document; + int i, c; + + document = readfile(tc.input); + + // Remove unneeded attributes + StringBuilder sb = new StringBuilder(); + sb.append(document); + regexpFilters(sb, new String[] {RE_ENDIAN, RE_NCPROPS}, false); + regexpFilters(sb, new String[] {RE_UNLIMITED}, true); + document = sb.toString(); + + Dap4Parser parser = new DOM4Parser(new DMRFactory()); + if (PARSEDEBUG) + parser.setDebugLevel(1); + // Parse document + Assert.assertTrue("Parse failed", parser.parse(document)); + + // Check result + ErrorResponse err = parser.getErrorResponse(); + if (err != null) + Assert.fail("Error response:\n" + err.buildXML()); + + DapDataset dmr = parser.getDMR(); + Assert.assertNotNull("No dataset created", dmr); + + // Dump the parsed DMR for comparison purposes + StringWriter sw = new StringWriter(); + PrintWriter pw = new PrintWriter(sw); + DMRPrinter dapprinter = new DMRPrinter(dmr, pw); + dapprinter.print(); + pw.close(); + sw.close(); + + sb = new StringBuilder(sw.toString()); + // Remove irrelevant dependencies + regexpFilters(sb, new String[] {RE_ENDIAN}, false); + String testresult = sb.toString(); + + // Use the original DMR as the baseline + String baselinecontent = document; + + if (props.prop_visual) { + visual("Baseline", baselinecontent); + visual("Output", testresult); + } + Assert.assertTrue("Files are different", same(getTitle(), baselinecontent, testresult)); + System.out.println(tc.name + ": Passed"); + } + +} diff --git a/dap4/src/test/java/dap4/test/TestRaw.java b/dap4/src/test/java/dap4/test/TestRaw.java new file mode 100644 index 0000000000..cedb66b3f3 --- /dev/null +++ b/dap4/src/test/java/dap4/test/TestRaw.java @@ -0,0 +1,206 @@ +/* + * Copyright 2012, UCAR/Unidata. + * See the LICENSE file for more information. + */ + +package dap4.test; + +import dap4.core.util.DapConstants; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.Parameterized; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import ucar.nc2.dataset.NetcdfDataset; + +import java.io.File; +import java.io.IOException; +import java.io.StringWriter; +import java.lang.invoke.MethodHandles; +import java.nio.file.NoSuchFileException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import static dap4.core.util.DapConstants.CHECKSUMATTRNAME; + +/** + * This Test uses the JUNIT Version 4 parameterized test mechanism. + * The set of arguments for each test is encapsulated in a class + * called TestCase. This allows for code re-use and for extending + * tests by adding fields to the TestCase object. + */ + +@RunWith(Parameterized.class) +public class TestRaw extends DapTestCommon implements Dap4ManifestIF { + + ////////////////////////////////////////////////// + // Constants + + // Define the input set location(s) + static protected final String INPUTDIR = "/rawtestfiles"; + static protected final String INPUTEXT = ".nc.dap"; + static protected final String INPUTQUERY = "?" + DapConstants.CHECKSUMTAG + "=false"; + static protected final String INPUTFRAG = ""; + static protected final String BASELINEDIR = "/baselineraw"; + static protected final String BASELINEEXT = ".nc.ncdump"; + + + // Following files cannot be tested because of flaws in sequence handling + // by the CDM code in ucar.nc2.dataset. + static protected String[] EXCLUSIONS = + {"test_vlen2", "test_vlen3", "test_vlen4", "test_vlen5", "test_vlen6", "test_vlen7", "test_vlen8"}; + + // Attribute suppression + static String RE_ENDIAN = "\n[ \t]*[ \t]*"; + static String RE_CHECKSUM = ":" + DapConstants.CHECKSUMATTRNAME; + static String RE_DAP4_ENDIAN = ":" + DapConstants.LITTLEENDIANATTRNAME; + static String RE_DAP4_CE = ":" + DapConstants.CEATTRNAME; + + ////////////////////////////////////////////////// + // Static Fields + + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); + + static public String resourceroot; + + static { + resourceroot = getResourceRoot(); + } + + ////////////////////////////////////////////////// + // Test Case Class + + // Encapulate the arguments for each test + static class TestCase extends TestCaseCommon { + public String url; + public String baseline; + + public TestCase(String name, String url, String baseline) { + super(name); + this.url = url; + this.baseline = baseline; + } + + // This defines how the test is reported by JUNIT. + public String toString() { + return this.name; + } + } + + ////////////////////////////////////////////////// + // Test Generator + + @Parameterized.Parameters(name = "{index}: {0}") + static public List defineTestCases() { + List testcases = new ArrayList<>(); + String[][] manifest = excludeNames(dap4_manifest, EXCLUSIONS); + for (String[] tuple : manifest) { + String name = tuple[0]; + String url = buildURL(name); + String baseline = resourceroot + BASELINEDIR + "/" + name + BASELINEEXT; + TestCase tc = new TestCase(name, url, baseline); + testcases.add(tc); + } + // singleTest("test_vlen3", testcases); // choose single test for debugging + return testcases; + } + + ////////////////////////////////////////////////// + // Test Fields + + TestCase tc; + + ////////////////////////////////////////////////// + // Constructor(s) + + public TestRaw(TestCaseCommon tc) { + super(); + this.tc = (TestCase) tc; + } + + ////////////////////////////////////////////////// + // Junit test method(s) + + @Before + public void setup() { + // Set any properties + // props.prop_visual = true; + // props.prop_baseline = true; + super.setup(); + } + + @Test + public void test() throws Exception { + int i, c; + StringBuilder sb = new StringBuilder(); + // String url = buildURL(resourceroot + INPUTDIR, tc.name + INPUTEXT); + String url = tc.url; + NetcdfDataset ncfile; + try { + ncfile = openDataset(url); + } catch (Exception e) { + e.printStackTrace(); + throw new Exception("File open failed: " + url, e); + } + assert ncfile != null; + + String datasetname = tc.url; + String testresult = dumpdata(ncfile, tc.name); // print data section + + // Remove unused text + sb.setLength(0); + sb.append(testresult); + regexpFilterLine(sb, RE_DAP4_ENDIAN, true); + regexpFilterLine(sb, RE_DAP4_CE, true); + testresult = sb.toString(); + + // Read the baseline file(s) if they exist + String baselinecontent = null; + if (props.prop_baseline) { + writefile(tc.baseline, testresult); + } else { + try { + baselinecontent = readfile(tc.baseline); + // Remove unused text + sb.setLength(0); + sb.append(baselinecontent); + regexpFilterLine(sb, RE_CHECKSUM, true); + baselinecontent = sb.toString(); + } catch (NoSuchFileException nsf) { + Assert.fail(tc.name + ": ***Fail: test comparison file not found: " + tc.baseline); + } + } + if (props.prop_visual) { + if (baselinecontent != null) + visual("Input", baselinecontent); + visual("Output", testresult); + } + if (!props.prop_baseline && props.prop_diff) { // compare with baseline + System.err.println("Comparison: vs " + tc.baseline); + Assert.assertTrue("*** FAIL", same(getTitle(), baselinecontent, testresult)); + System.out.println(tc.name + ": Passed"); + } + } + + ////////////////////////////////////////////////// + // Support Methods + + static protected String buildURL(String name) { + StringBuilder url = new StringBuilder(); + url.append("file://"); + url.append(resourceroot); + url.append(INPUTDIR); + url.append("/"); + url.append(name); + url.append(INPUTEXT); + url.append(INPUTQUERY); + url.append(INPUTFRAG); + return url.toString(); + } + +} + + diff --git a/dap4/src/test/java/dap4/test/TestRemote.java b/dap4/src/test/java/dap4/test/TestRemote.java new file mode 100644 index 0000000000..772ff6fb91 --- /dev/null +++ b/dap4/src/test/java/dap4/test/TestRemote.java @@ -0,0 +1,180 @@ +/* + * Copyright 2012, UCAR/Unidata. + * See the LICENSE file for more information. + */ + +package dap4.test; + +import dap4.core.util.DapConstants; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.Parameterized; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import ucar.nc2.dataset.NetcdfDataset; + +import java.io.File; +import java.io.IOException; +import java.io.StringWriter; +import java.lang.invoke.MethodHandles; +import java.nio.file.NoSuchFileException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +/** + * This Test uses the JUNIT Version 4 parameterized test mechanism. + * The set of arguments for each test is encapsulated in a class + * called TestCase. This allows for code re-use and for extending + * tests by adding fields to the TestCase object. + */ + +@RunWith(Parameterized.class) +public class TestRemote extends DapTestCommon implements Dap4ManifestIF { + + ////////////////////////////////////////////////// + // Constants + + // Define the server to use + static protected final String SERVERNAME = "d4ts"; + static protected final String SERVER = "remotetest.unidata.ucar.edu"; + static protected final int SERVERPORT = -1; + static protected final String SERVERPATH = "d4ts/testfiles"; + + // Define the input set location(s) + static protected final String INPUTEXT = ".nc"; // note that the .dap is deliberately left off + static protected final String INPUTQUERY = "?" + DapConstants.CHECKSUMTAG + "=true"; + static protected final String INPUTFRAG = "#dap4"; + + static protected final String BASELINEDIR = "/baselineremote"; + static protected final String BASELINEEXT = ".nc.ncdump"; + + // Following files cannot be tested because of flaws in sequence handling + // by the CDM code in ucar.nc2.dataset. + static protected String[] EXCLUSIONS = + {"test_vlen2", "test_vlen3", "test_vlen4", "test_vlen5", "test_vlen6", "test_vlen7", "test_vlen8"}; + + ////////////////////////////////////////////////// + // Static Fields + + private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); + + static public String resourceroot; + static public Dap4Server server; + + static { + server = new Dap4Server("remotetest", SERVER, SERVERPORT, SERVERPATH); + Dap4Server.register(true, server); + resourceroot = getResourceRoot(); + } + + ////////////////////////////////////////////////// + // Test Case Class + + // Encapulate the arguments for each test + static class TestCase extends TestCaseCommon { + public String url; + public String baseline; + + public TestCase(String name, String url, String baseline) { + super(name); + this.url = url; + this.baseline = baseline; + } + + // This defines how the test is reported by JUNIT. + public String toString() { + return this.name; + } + } + + ////////////////////////////////////////////////// + // Test Generator + + @Parameterized.Parameters(name = "{index}: {0}") + static public List defineTestCases() { + assert (server != null); + List testcases = new ArrayList<>(); + String[][] manifest = excludeNames(dap4_manifest, EXCLUSIONS); + for (String[] tuple : manifest) { + String name = tuple[0]; + String url = server.getURL() + "/" + name + INPUTEXT + INPUTQUERY + INPUTFRAG; + String baseline = resourceroot + BASELINEDIR + "/" + name + BASELINEEXT; + TestCase tc = new TestCase(name, url, baseline); + testcases.add(tc); + } + // singleTest("test_utf8", testcases); // choose single test for debugging + return testcases; + } + + ////////////////////////////////////////////////// + // Test Fields + + TestCase tc; + + ////////////////////////////////////////////////// + // Constructor(s) + + public TestRemote(TestCaseCommon tc) { + super(); + this.tc = (TestCase) tc; + } + + ////////////////////////////////////////////////// + // Junit test method(s) + + @Before + public void setup() { + // Set any properties + // props.prop_visual = true; + // props.prop_baseline = true; + super.setup(); + } + + @Test + public void test() throws Exception { + int i, c; + StringBuilder sb = new StringBuilder(); + + System.err.println(">>> Test: " + tc.url); + + NetcdfDataset ncfile; + try { + ncfile = openDataset(tc.url); + } catch (Exception e) { + e.printStackTrace(); + throw new Exception("File open failed: " + tc.url, e); + } + assert ncfile != null; + + String datasetname = tc.name; + String testresult = dumpdata(ncfile, tc.name); // print data section + + // Read the baseline file(s) if they exist + String baselinecontent = null; + if (props.prop_baseline) { + writefile(tc.baseline, testresult); + } else { + try { + baselinecontent = readfile(tc.baseline); + } catch (NoSuchFileException nsf) { + Assert.fail(tc.name + ": ***Fail: test comparison file not found: " + tc.baseline); + } + } + if (props.prop_visual) { + if (baselinecontent != null) + visual("Input", baselinecontent); + visual("Output", testresult); + } + if (!props.prop_baseline && props.prop_diff) { // compare with baseline + System.err.println("Comparison: vs " + tc.baseline); + Assert.assertTrue("*** FAIL", same(getTitle(), baselinecontent, testresult)); + System.out.println(tc.name + ": Passed"); + } + } + +} + + diff --git a/dap4/d4tests/src/test/resources/logback-test.xml b/dap4/src/test/resources/logback-test.xml similarity index 86% rename from dap4/d4tests/src/test/resources/logback-test.xml rename to dap4/src/test/resources/logback-test.xml index d24280d3c9..f48ace23f7 100644 --- a/dap4/d4tests/src/test/resources/logback-test.xml +++ b/dap4/src/test/resources/logback-test.xml @@ -36,6 +36,14 @@ --> + + + + + + + + diff --git a/gradle/any/coverage.gradle b/gradle/any/coverage.gradle index f6ba25970f..141cb5e034 100644 --- a/gradle/any/coverage.gradle +++ b/gradle/any/coverage.gradle @@ -21,7 +21,7 @@ tasksExtendedByJacoco.all { * in cdm/src/main only. * * That's fine for :cdm, but we have subprojects that contain no code in their 'main' source set, namely :it, - * :cdm-test, and :dap4:d4tests. They only have code in their 'test' SourceSets. As a result, the default + * and :cdm-test. They only have code in their 'test' SourceSets. As a result, the default * 'jacocoTestReport' task added to those tasks will generate an empty report, because there's nothing to report on. * * We could remedy this by adding main SourceSets from other projects to report on. This would be particularly diff --git a/gradle/root/fatJars.gradle b/gradle/root/fatJars.gradle index e98c41705b..6f14b09572 100644 --- a/gradle/root/fatJars.gradle +++ b/gradle/root/fatJars.gradle @@ -41,6 +41,7 @@ dependencies { ncIdv project(':bufr') ncIdv project(':grib') ncIdv project(':opendap') + ncIdv project(':dap4') ncIdv project(':visad:cdm-mcidas') ncIdv project(':visad:cdm-vis5d') ncIdv project(':httpservices') @@ -55,6 +56,7 @@ dependencies { netcdfAll project(':grib') netcdfAll project(':netcdf4') netcdfAll project(':opendap') + netcdfAll project(':dap4') netcdfAll project(':httpservices') netcdfAll project(':visad:cdm-mcidas') diff --git a/httpservices/src/main/java/ucar/httpservices/HTTPIntercepts.java b/httpservices/src/main/java/ucar/httpservices/HTTPIntercepts.java new file mode 100644 index 0000000000..cf35f5ee3a --- /dev/null +++ b/httpservices/src/main/java/ucar/httpservices/HTTPIntercepts.java @@ -0,0 +1,416 @@ +/* + * Copyright (c) 1998-2018 University Corporation for Atmospheric Research/Unidata + * See LICENSE for license information. + */ + +package ucar.httpservices; + +import java.io.*; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.CopyOnWriteArrayList; + +import org.apache.http.*; +import org.apache.http.client.entity.DeflateDecompressingEntity; +import org.apache.http.client.entity.GzipDecompressingEntity; +import org.apache.http.impl.client.HttpClientBuilder; +import org.apache.http.message.BasicHeader; +import org.apache.http.protocol.HttpContext; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Package together all the HTTP Intercept code + */ + +public class HTTPIntercepts { + + ////////////////////////////////////////////////// + // Constants + static private final Logger logger = LoggerFactory.getLogger(HTTPIntercepts.class); + + // Allow printing to a variety of targets + static abstract public interface Printer { + public void print(String s); + + public void println(String s); + } + + // Default printer + static public Printer logprinter = new Printer() { + public void print(String s) { + logger.debug(s); + } + + public void println(String s) { + logger.debug(s); + } + }; + + ////////////////////////////////////////////////// + // Inner classes + + abstract static class InterceptCommon { + private static final Logger logger = LoggerFactory.getLogger(InterceptCommon.class); + + protected HttpContext context = null; + protected List

headers = new ArrayList
(); + protected HttpRequest request = null; + protected HttpResponse response = null; + protected Printer printer = null; + + public InterceptCommon setPrint(Printer printer) { + this.printer = printer; + return this; + } + + public void clear() { + context = null; + headers.clear(); + request = null; + response = null; + } + + public synchronized HttpRequest getRequest() { + return this.request; + } + + public synchronized HttpResponse getResponse() { + return this.response; + } + + public synchronized HttpContext getContext() { + return this.context; + } + + public synchronized HttpEntity getRequestEntity() { + if (this.request != null && this.request instanceof HttpEntityEnclosingRequest) { + return ((HttpEntityEnclosingRequest) this.request).getEntity(); + } else + return null; + } + + synchronized HttpEntity getResponseEntity() { + if (this.response != null) { + return this.response.getEntity(); + } else + return null; + } + + public synchronized List
getHeaders(String key) { + List
keyh = new ArrayList
(); + for (Header h : this.headers) { + if (h.getName().equalsIgnoreCase(key.trim())) + keyh.add(h); + } + return keyh; + } + + public synchronized List
getHeaders() { + return this.headers; + } + + public void printHeaders() { + if (this.request != null) { + DebugInterceptRequest thisreq = (DebugInterceptRequest) this; + printer.println("Request: method=" + thisreq.getMethod() + "; uri=" + thisreq.getUri()); + Header[] hdrs = this.request.getAllHeaders(); + if (hdrs == null) + hdrs = new Header[0]; + printer.println("Request Headers:"); + for (Header h : hdrs) { + printer.println(h.toString()); + } + } + if (this.response != null) { + DebugInterceptResponse thisresp = (DebugInterceptResponse) this; + printer.println("Response: code=" + thisresp.getStatusCode()); + Header[] hdrs = this.response.getAllHeaders(); + if (hdrs == null) + hdrs = new Header[0]; + printer.println("Response Headers:"); + for (Header h : hdrs) { + printer.println(h.toString()); + } + } + } + } + + ////////////////////////////////////////////////// + // Static Variables + + // Use this flag to indicate that all instances should set debug. + static protected boolean defaultinterception = false; + + // Global set debug interceptors + static public void setGlobalDebugInterceptors(boolean tf) { + defaultinterception = true; + } + + // Use this flag to have debug interceptors print their info + // in addition to whatever else it does + static protected Printer defaultprinter = null; + + static public void setGlobalPrinter(Printer printer) { + defaultprinter = printer; + } + + ////////////////////////////////////////////////// + // Specific Interceptors + + static public class DebugInterceptResponse extends HTTPIntercepts.InterceptCommon implements HttpResponseInterceptor { + protected StatusLine statusline = null; // Status Line + + public int getStatusCode() { + return (statusline == null ? -1 : statusline.getStatusCode()); + } + + public synchronized void process(HttpResponse response, HttpContext context) throws HttpException, IOException { + this.response = response; + this.context = context; + this.statusline = response.getStatusLine(); + if (this.printer != null) + printHeaders(); + if (this.response != null) { + Header[] hdrs = this.response.getAllHeaders(); + for (int i = 0; i < hdrs.length; i++) { + headers.add(hdrs[i]); + } + } + } + } + + static public class DebugInterceptRequest extends InterceptCommon implements HttpRequestInterceptor { + protected RequestLine requestline = null; // request Line + + public String getMethod() { + return (requestline == null ? null : requestline.getMethod()); + } + + public String getUri() { + return (requestline == null ? null : requestline.getUri()); + } + + public synchronized void process(HttpRequest request, HttpContext context) throws HttpException, IOException { + this.request = request; + this.context = context; + this.requestline = request.getRequestLine(); + if (this.printer != null) + printHeaders(); + if (this.request != null) { + Header[] hdrs = this.request.getAllHeaders(); + for (int i = 0; i < hdrs.length; i++) { + headers.add(hdrs[i]); + } + } + } + } + + /** + * Temporary hack to remove Content-Encoding: XXX-Endian headers + */ + static class ContentEncodingInterceptor extends InterceptCommon implements HttpResponseInterceptor { + public synchronized void process(HttpResponse response, HttpContext context) throws HttpException, IOException { + if (response == null) + return; + Header[] hdrs = response.getAllHeaders(); + if (hdrs == null) + return; + boolean modified = false; + for (int i = 0; i < hdrs.length; i++) { + Header h = hdrs[i]; + if (!h.getName().equalsIgnoreCase("content-encoding")) + continue; + String value = h.getValue(); + if (value.trim().toLowerCase().endsWith("-endian")) { + hdrs[i] = new BasicHeader("X-Content-Encoding", value); + modified = true; + } + } + if (modified) + response.setHeaders(hdrs); + // Similarly, suppress encoding for Entity + HttpEntity entity = response.getEntity(); + if (entity != null) { + Header ceheader = entity.getContentEncoding(); + if (ceheader != null) { + String value = ceheader.getValue(); + } + } + } + } + + static class GZIPResponseInterceptor implements HttpResponseInterceptor { + public void process(final HttpResponse response, final HttpContext context) throws HttpException, IOException { + HttpEntity entity = response.getEntity(); + if (entity != null) { + Header ceheader = entity.getContentEncoding(); + if (ceheader != null) { + HeaderElement[] codecs = ceheader.getElements(); + for (HeaderElement h : codecs) { + if (h.getName().equalsIgnoreCase("gzip")) { + response.setEntity(new GzipDecompressingEntity(response.getEntity())); + return; + } + } + } + } + } + } + + static class DeflateResponseInterceptor implements HttpResponseInterceptor { + public void process(final HttpResponse response, final HttpContext context) throws HttpException, IOException { + HttpEntity entity = response.getEntity(); + if (entity != null) { + Header ceheader = entity.getContentEncoding(); + if (ceheader != null) { + HeaderElement[] codecs = ceheader.getElements(); + for (HeaderElement h : codecs) { + if (h.getName().equalsIgnoreCase("deflate")) { + response.setEntity(new DeflateDecompressingEntity(response.getEntity())); + return; + } + } + } + } + } + } + + public DebugInterceptRequest debugRequestInterceptor() { + for (HttpRequestInterceptor hri : reqintercepts) { + if (hri instanceof DebugInterceptRequest) { + return ((DebugInterceptRequest) hri); + } + } + return null; + } + + public DebugInterceptResponse debugResponseInterceptor() { + for (HttpResponseInterceptor hri : rspintercepts) { + if (hri instanceof DebugInterceptResponse) { + return ((DebugInterceptResponse) hri); + } + } + return null; + } + + ////////////////////////////////////////////////// + // Instance variables + + protected Printer printer = logprinter; + + // This is a hack to suppress content-encoding headers from request + // Effectively final because its set in the static initializer and otherwise + // read only. + protected HttpResponseInterceptor CEKILL = null; + + // Define interceptor instances; use copy on write for thread safety + protected List reqintercepts = new CopyOnWriteArrayList<>(); + protected List rspintercepts = new CopyOnWriteArrayList<>(); + + // Debug Header interceptors + protected List dbgreq = new CopyOnWriteArrayList<>(); + protected List dbgrsp = new CopyOnWriteArrayList<>(); + + ////////////////////////////////////////////////// + // Constructor(s) + + public HTTPIntercepts() { + if (defaultinterception) + this.addDebugInterceptors(); + else + this.removeDebugIntercepts(); + this.printer = defaultprinter; + } + + ////////////////////////////////////////////////// + // Methods + + public void setCEKILL(boolean tf) { + if (tf) + CEKILL = new ContentEncodingInterceptor(); + else + CEKILL = null; + } + + public void activateInterceptors(HttpClientBuilder cb) { + for (HttpRequestInterceptor hrq : reqintercepts) { + cb.addInterceptorLast(hrq); + } + for (HttpResponseInterceptor hrs : rspintercepts) { + cb.addInterceptorLast(hrs); + } + // Add debug interceptors + for (HttpRequestInterceptor hrq : dbgreq) { + cb.addInterceptorFirst(hrq); + } + for (HttpResponseInterceptor hrs : dbgrsp) { + cb.addInterceptorFirst(hrs); + } + // Hack: add Content-Encoding suppressor + cb.addInterceptorFirst(CEKILL); + } + + protected synchronized void addDebugInterceptors() { + DebugInterceptRequest rq = new DebugInterceptRequest(); + DebugInterceptResponse rs = new DebugInterceptResponse(); + rq.setPrint(this.printer); + rs.setPrint(this.printer); + /* remove any previous */ + for (int i = reqintercepts.size() - 1; i >= 0; i--) { + HttpRequestInterceptor hr = reqintercepts.get(i); + if (hr instanceof InterceptCommon) { + reqintercepts.remove(i); + } + } + for (int i = rspintercepts.size() - 1; i >= 0; i--) { + HttpResponseInterceptor hr = rspintercepts.get(i); + if (hr instanceof InterceptCommon) { + rspintercepts.remove(i); + } + } + reqintercepts.add(rq); + rspintercepts.add(rs); + } + + public synchronized void resetInterceptors() { + for (HttpRequestInterceptor hri : reqintercepts) { + if (hri instanceof InterceptCommon) { + ((InterceptCommon) hri).clear(); + } + } + } + + public void setGzipCompression() { + HttpResponseInterceptor hrsi = new HTTPIntercepts.GZIPResponseInterceptor(); + rspintercepts.add(hrsi); + } + + public void setDeflateCompression() { + HttpResponseInterceptor hrsi = new HTTPIntercepts.DeflateResponseInterceptor(); + rspintercepts.add(hrsi); + } + + public synchronized void removeCompression() { + for (int i = rspintercepts.size() - 1; i >= 0; i--) { // walk backwards + HttpResponseInterceptor hrsi = rspintercepts.get(i); + if (hrsi instanceof HTTPIntercepts.GZIPResponseInterceptor + || hrsi instanceof HTTPIntercepts.DeflateResponseInterceptor) { + rspintercepts.remove(i); + } + } + } + + public synchronized void removeDebugIntercepts() { + for (int i = rspintercepts.size() - 1; i >= 0; i--) { // walk backwards + HttpResponseInterceptor hrsi = rspintercepts.get(i); + if (hrsi instanceof DebugInterceptResponse) + rspintercepts.remove(i); + } + for (int i = reqintercepts.size() - 1; i >= 0; i--) { // walk backwards + HttpRequestInterceptor hrsi = reqintercepts.get(i); + if (hrsi instanceof DebugInterceptRequest) + reqintercepts.remove(i); + } + } +} diff --git a/httpservices/src/main/java/ucar/httpservices/HTTPMethod.java b/httpservices/src/main/java/ucar/httpservices/HTTPMethod.java index 5ec5b1248d..aff490f31d 100755 --- a/httpservices/src/main/java/ucar/httpservices/HTTPMethod.java +++ b/httpservices/src/main/java/ucar/httpservices/HTTPMethod.java @@ -137,8 +137,7 @@ * is accessible. * *

- * For testing purposes, and to allow use of Spring Servlet Mocking, - * it is possible to set a special execution action (see executeRaw). + * For testing purposes, it is possible to set a special execution action (see executeRaw). */ @NotThreadSafe @@ -158,14 +157,11 @@ public static interface Executor { public static boolean TESTING = false; - /* External tests can Set this to true if they are using Spring Servlet Mocking */ - public static Executor MOCKEXECUTOR = null; - ////////////////////////////////////////////////// // Instance fields protected HTTPSession session = null; - protected boolean localsession = false; + protected boolean islocalsession = false; protected URI methodurl = null; protected String userinfo = null; protected HttpEntity content = null; @@ -224,7 +220,7 @@ protected HTTPMethod() throws HTTPException {} if (session == null) { session = HTTPFactory.newSession(url); - localsession = true; + islocalsession = true; } this.session = session; // user info may contain encoded characters (such as a username containing @@ -305,7 +301,7 @@ public synchronized void close() { } if (session != null) { session.removeMethod(this); - if (localsession) { + if (islocalsession) { session.close(); session = null; } @@ -346,7 +342,7 @@ public HttpResponse executeRaw() throws HTTPException { this.executed = true; if (this.methodurl == null) throw new HTTPException("HTTPMethod: no url specified"); - if (!localsession && !sessionCompatible(this.methodurl)) + if (!islocalsession && !sessionCompatible(this.methodurl)) throw new HTTPException("HTTPMethod: session incompatible url: " + this.methodurl); // Capture the current state of the parent HTTPSession; never to be modified in this class @@ -371,12 +367,7 @@ public HttpResponse executeRaw() throws HTTPException { configClient(cb, this.settings); session.setAuthenticationAndProxy(cb); HttpClient httpclient = cb.build(); - if (MOCKEXECUTOR != null) { - URI uri = this.lastrequest.getURI(); - this.lastresponse = MOCKEXECUTOR.execute(this.lastrequest); - } else { - this.lastresponse = httpclient.execute(targethost, this.lastrequest, session.getContext()); - } + this.lastresponse = httpclient.execute(targethost, this.lastrequest, session.getContext()); if (this.lastresponse == null) throw new HTTPException("HTTPMethod.execute: Response was null"); return this.lastresponse; @@ -422,7 +413,7 @@ protected void configClient(HttpClientBuilder cb, Map settings) th String agent = (String) settings.get(Prop.USER_AGENT); if (agent != null) cb.setUserAgent(agent); - session.setInterceptors(cb); + session.activateInterceptors(cb); session.setContentDecoderRegistry(cb); session.setClientManager(cb, this); session.setRetryHandler(cb); @@ -722,7 +713,7 @@ public HTTPSession getSession() { } public boolean isSessionLocal() { - return this.localsession; + return this.islocalsession; } public boolean hasStreamOpen() { @@ -742,7 +733,7 @@ public HTTPMethod setRange(long lo, long hi) { // Pass thru's to HTTPSession public HTTPMethod setCompression(String compressors) { - this.session.setGlobalCompression(compressors); + this.session.setCompression(compressors); return this; } diff --git a/httpservices/src/main/java/ucar/httpservices/HTTPSession.java b/httpservices/src/main/java/ucar/httpservices/HTTPSession.java index 008a1b927d..3c5f83d8a8 100755 --- a/httpservices/src/main/java/ucar/httpservices/HTTPSession.java +++ b/httpservices/src/main/java/ucar/httpservices/HTTPSession.java @@ -9,7 +9,6 @@ import java.io.Closeable; import java.io.FileInputStream; import java.io.IOException; -import java.io.InputStream; import java.net.URI; import java.net.URISyntaxException; import java.security.KeyManagementException; @@ -26,27 +25,16 @@ import java.util.Set; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentSkipListSet; -import java.util.concurrent.CopyOnWriteArrayList; -import java.util.zip.GZIPInputStream; -import java.util.zip.ZipInputStream; import javax.annotation.concurrent.ThreadSafe; import javax.print.attribute.UnmodifiableSetException; -import org.apache.http.Header; -import org.apache.http.HeaderElement; -import org.apache.http.HttpEntity; -import org.apache.http.HttpException; -import org.apache.http.HttpHost; -import org.apache.http.HttpRequestInterceptor; -import org.apache.http.HttpResponse; -import org.apache.http.HttpResponseInterceptor; + +import org.apache.http.*; import org.apache.http.auth.AuthScope; import org.apache.http.auth.Credentials; import org.apache.http.auth.UsernamePasswordCredentials; import org.apache.http.client.CredentialsProvider; import org.apache.http.client.HttpRequestRetryHandler; import org.apache.http.client.config.RequestConfig; -import org.apache.http.client.entity.DeflateDecompressingEntity; -import org.apache.http.client.entity.GzipDecompressingEntity; import org.apache.http.client.entity.InputStreamFactory; import org.apache.http.client.protocol.HttpClientContext; import org.apache.http.conn.socket.ConnectionSocketFactory; @@ -58,7 +46,6 @@ import org.apache.http.impl.client.BasicCredentialsProvider; import org.apache.http.impl.client.DefaultHttpRequestRetryHandler; import org.apache.http.impl.client.HttpClientBuilder; -import org.apache.http.protocol.HttpContext; import org.apache.http.ssl.SSLContextBuilder; import org.apache.http.ssl.SSLContexts; import org.apache.http.ssl.TrustStrategy; @@ -258,57 +245,6 @@ public String getName() { } } - static class GZIPResponseInterceptor implements HttpResponseInterceptor { - public void process(final HttpResponse response, final HttpContext context) throws HttpException, IOException { - HttpEntity entity = response.getEntity(); - if (entity != null) { - Header ceheader = entity.getContentEncoding(); - if (ceheader != null) { - HeaderElement[] codecs = ceheader.getElements(); - for (HeaderElement h : codecs) { - if (h.getName().equalsIgnoreCase("gzip")) { - response.setEntity(new GzipDecompressingEntity(response.getEntity())); - return; - } - } - } - } - } - } - - static class DeflateResponseInterceptor implements HttpResponseInterceptor { - public void process(final HttpResponse response, final HttpContext context) throws HttpException, IOException { - HttpEntity entity = response.getEntity(); - if (entity != null) { - Header ceheader = entity.getContentEncoding(); - if (ceheader != null) { - HeaderElement[] codecs = ceheader.getElements(); - for (HeaderElement h : codecs) { - if (h.getName().equalsIgnoreCase("deflate")) { - response.setEntity(new DeflateDecompressingEntity(response.getEntity())); - return; - } - } - } - } - } - } - - static class ZipStreamFactory implements InputStreamFactory { - // InputStreamFactory methods - @Override - public InputStream create(InputStream instream) throws IOException { - return new ZipInputStream(instream, HTTPUtil.UTF8); - } - } - - static class GZIPStreamFactory implements InputStreamFactory { - // InputStreamFactory methods - @Override - public InputStream create(InputStream instream) throws IOException { - return new GZIPInputStream(instream); - } - } //////////////////////////////////////////////////////////////////////// // Static variables @@ -327,19 +263,6 @@ public InputStream create(InputStream instream) throws IOException { // User is responsible for its contents via setCredentials static CredentialsProvider globalprovider = null; - // Define interceptor instances; use copy on write for thread safety - static List reqintercepts = new CopyOnWriteArrayList<>(); - static List rspintercepts = new CopyOnWriteArrayList<>(); - - // This is a hack to suppress content-encoding headers from request - // Effectively final because its set in the static initializer and otherwise - // read only. - protected static HttpResponseInterceptor CEKILL; - - // Debug Header interceptors - protected static List dbgreq = new CopyOnWriteArrayList<>(); - protected static List dbgrsp = new CopyOnWriteArrayList<>(); - protected static HTTPConnections connmgr; protected static Map contentDecoderMap; @@ -355,10 +278,9 @@ public InputStream create(InputStream instream) throws IOException { } else { connmgr = new HTTPConnectionSimple(); } - CEKILL = new HTTPUtil.ContentEncodingInterceptor(); contentDecoderMap = new HashMap<>(); - contentDecoderMap.put("zip", new ZipStreamFactory()); - contentDecoderMap.put("gzip", new GZIPStreamFactory()); + contentDecoderMap.put("zip", new HTTPUtil.ZipStreamFactory()); + contentDecoderMap.put("gzip", new HTTPUtil.GZIPStreamFactory()); globalsettings = new ConcurrentHashMap<>(); setDefaults(globalsettings); authcontrols = new AuthControls(); @@ -603,38 +525,24 @@ public static synchronized Object getGlobalSetting(String key) { ////////////////////////////////////////////////// // Compression - public static synchronized void setGlobalCompression(String compressors) { + public synchronized void setCompression(String compressors) { if (globalsettings.get(Prop.COMPRESSION) != null) { - removeGlobalCompression(); - } - String compresslist = checkCompressors(compressors); - if (HTTPUtil.nullify(compresslist) == null) { - throw new IllegalArgumentException("Bad compressors: " + compressors); - } - globalsettings.put(Prop.COMPRESSION, compresslist); - HttpResponseInterceptor hrsi; - if (compresslist.contains("gzip")) { - hrsi = new GZIPResponseInterceptor(); - rspintercepts.add(hrsi); - } - if (compresslist.contains("deflate")) { - hrsi = new DeflateResponseInterceptor(); - rspintercepts.add(hrsi); - } - } - - public static synchronized void removeGlobalCompression() { - if (globalsettings.remove(Prop.COMPRESSION) != null) { - for (int i = rspintercepts.size() - 1; i >= 0; i--) { // walk backwards - HttpResponseInterceptor hrsi = rspintercepts.get(i); - if (hrsi instanceof GZIPResponseInterceptor || hrsi instanceof DeflateResponseInterceptor) { - rspintercepts.remove(i); - } + if (globalsettings.remove(HTTPSession.Prop.COMPRESSION) != null) { + this.interceptors.removeCompression(); + } + String compresslist = checkCompressors(compressors); + if (HTTPUtil.nullify(compresslist) == null) { + throw new IllegalArgumentException("Bad compressors: " + compressors); } + globalsettings.put(Prop.COMPRESSION, compresslist); + if (compresslist.contains("deflate")) + interceptors.setDeflateCompression(); + if (compresslist.contains("gzip")) + interceptors.setGzipCompression(); } } - protected static synchronized String checkCompressors(String compressors) { + static protected synchronized String checkCompressors(String compressors) { // Syntactic check of compressors Set cset = new HashSet<>(); compressors = compressors.replace(',', ' '); @@ -701,9 +609,6 @@ public static synchronized void setGlobalRetryCount(int n) { protected String identifier = "Session"; protected Map localsettings = new ConcurrentHashMap(); - // We currently only allow the use of global interceptors - // protected List intercepts = new ArrayList(); // current set of interceptors; - // This context is re-used over all method executions so that we maintain // cookies, credentials, etc. // In theory this also supports credentials cache clearing. @@ -712,6 +617,8 @@ public static synchronized void setGlobalRetryCount(int n) { protected URI requestURI = null; // full uri from the HTTPMethod call + protected HTTPIntercepts interceptors = null; + // cached and recreated as needed protected boolean cachevalid = false; // Are cached items up-to-date? protected RequestConfig cachedconfig = null; @@ -750,28 +657,19 @@ protected void init(AuthScope scope, String actualurl) throws HTTPException { } ////////////////////////////////////////////////// - // Interceptors: Only supported at global level + // Accessor(s) - protected static void setInterceptors(HttpClientBuilder cb) { - for (HttpRequestInterceptor hrq : reqintercepts) { - cb.addInterceptorLast(hrq); - } - for (HttpResponseInterceptor hrs : rspintercepts) { - cb.addInterceptorLast(hrs); - } - // Add debug interceptors - for (HttpRequestInterceptor hrq : dbgreq) { - cb.addInterceptorFirst(hrq); - } - for (HttpResponseInterceptor hrs : dbgrsp) { - cb.addInterceptorFirst(hrs); - } - // Hack: add Content-Encoding suppressor - cb.addInterceptorFirst(CEKILL); + public HTTPIntercepts getIntercepts() { + return this.interceptors; } - ////////////////////////////////////////////////// - // Accessor(s) + public HTTPIntercepts.DebugInterceptRequest getDebugRequestInterceptor() { + return this.interceptors.debugRequestInterceptor(); + } + + public synchronized void resetInterceptors() { + this.interceptors.resetInterceptors(); + } public AuthScope getAuthScope() { return this.scope; @@ -1072,6 +970,18 @@ public ImmutableMap getMergedSettings() { return builder.build(); } + public synchronized void setDebugInterceptors() { + if (this.interceptors == null) + this.interceptors = new HTTPIntercepts(); + this.interceptors.addDebugInterceptors(); + } + + public void activateInterceptors(HttpClientBuilder cb) { + if (this.interceptors == null) + this.interceptors = new HTTPIntercepts(); + this.interceptors.activateInterceptors(cb); + } + ////////////////////////////////////////////////// // Utilities @@ -1117,66 +1027,6 @@ protected static synchronized void track(HTTPSession session) { sessionList.add(session); } - public static synchronized void setInterceptors(boolean print) { - if (!TESTING) { - throw new UnsupportedOperationException(); - } - HTTPUtil.InterceptRequest rq = new HTTPUtil.InterceptRequest(); - HTTPUtil.InterceptResponse rs = new HTTPUtil.InterceptResponse(); - rq.setPrint(print); - rs.setPrint(print); - /* remove any previous */ - for (int i = reqintercepts.size() - 1; i >= 0; i--) { - HttpRequestInterceptor hr = reqintercepts.get(i); - if (hr instanceof HTTPUtil.InterceptCommon) { - reqintercepts.remove(i); - } - } - for (int i = rspintercepts.size() - 1; i >= 0; i--) { - HttpResponseInterceptor hr = rspintercepts.get(i); - if (hr instanceof HTTPUtil.InterceptCommon) { - rspintercepts.remove(i); - } - } - reqintercepts.add(rq); - rspintercepts.add(rs); - } - - public static void resetInterceptors() { - if (!TESTING) { - throw new UnsupportedOperationException(); - } - for (HttpRequestInterceptor hri : reqintercepts) { - if (hri instanceof HTTPUtil.InterceptCommon) { - ((HTTPUtil.InterceptCommon) hri).clear(); - } - } - } - - public static HTTPUtil.InterceptRequest debugRequestInterceptor() { - if (!TESTING) { - throw new UnsupportedOperationException(); - } - for (HttpRequestInterceptor hri : reqintercepts) { - if (hri instanceof HTTPUtil.InterceptRequest) { - return ((HTTPUtil.InterceptRequest) hri); - } - } - return null; - } - - public static HTTPUtil.InterceptResponse debugResponseInterceptor() { - if (!TESTING) { - throw new UnsupportedOperationException(); - } - for (HttpResponseInterceptor hri : rspintercepts) { - if (hri instanceof HTTPUtil.InterceptResponse) { - return ((HTTPUtil.InterceptResponse) hri); - } - } - return null; - } - /* Only allow if debugging */ public static void clearkeystore() { if (!TESTING) { @@ -1242,11 +1092,6 @@ public static int getRetryCount() { throw new UnsupportedOperationException(); } - @Deprecated - public static void setGlobalCompression() { - setGlobalCompression("gzip,deflate"); - } - @Deprecated public static void setGlobalProxy(String host, int port) { throw new UnsupportedOperationException("setGlobalProxy: use -D flags"); diff --git a/httpservices/src/main/java/ucar/httpservices/HTTPUtil.java b/httpservices/src/main/java/ucar/httpservices/HTTPUtil.java index 213025a163..afa933265a 100755 --- a/httpservices/src/main/java/ucar/httpservices/HTTPUtil.java +++ b/httpservices/src/main/java/ucar/httpservices/HTTPUtil.java @@ -5,35 +5,20 @@ package ucar.httpservices; -import java.io.ByteArrayOutputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.Reader; +import java.io.*; import java.net.URI; import java.net.URISyntaxException; import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; -import java.util.ArrayList; import java.util.EnumSet; import java.util.List; import java.util.Map; import java.util.Objects; import java.util.concurrent.ConcurrentHashMap; -import org.apache.http.Header; -import org.apache.http.HttpEntity; -import org.apache.http.HttpEntityEnclosingRequest; -import org.apache.http.HttpException; -import org.apache.http.HttpRequest; -import org.apache.http.HttpRequestInterceptor; -import org.apache.http.HttpResponse; -import org.apache.http.HttpResponseInterceptor; +import java.util.zip.GZIPInputStream; +import java.util.zip.ZipInputStream; +import org.apache.http.client.entity.InputStreamFactory; import org.apache.http.client.utils.URIBuilder; -import org.apache.http.message.BasicHeader; -import org.apache.http.protocol.HttpContext; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -56,117 +41,21 @@ enum URIPart { } ////////////////////////////////////////////////// - // Interceptors + // Inner classes - abstract static class InterceptCommon { - private static final Logger logger = LoggerFactory.getLogger(InterceptCommon.class); - - protected HttpContext context = null; - protected List
headers = new ArrayList
(); - protected HttpRequest request = null; - protected HttpResponse response = null; - protected boolean printheaders = false; - - public InterceptCommon setPrint(boolean tf) { - this.printheaders = tf; - return this; - } - - public void clear() { - context = null; - headers.clear(); - request = null; - response = null; - } - - public synchronized HttpRequest getRequest() { - return this.request; - } - - public synchronized HttpResponse getResponse() { - return this.response; - } - - public synchronized HttpContext getContext() { - return this.context; - } - - public synchronized HttpEntity getRequestEntity() { - if (this.request != null && this.request instanceof HttpEntityEnclosingRequest) { - return ((HttpEntityEnclosingRequest) this.request).getEntity(); - } else - return null; - } - - synchronized HttpEntity getResponseEntity() { - if (this.response != null) { - return this.response.getEntity(); - } else - return null; - } - - public synchronized List
getHeaders(String key) { - List
keyh = new ArrayList
(); - for (Header h : this.headers) { - if (h.getName().equalsIgnoreCase(key.trim())) - keyh.add(h); - } - return keyh; - } - - synchronized List
getHeaders() { - return this.headers; - } - - void printHeaders() { - if (this.request != null) { - Header[] hdrs = this.request.getAllHeaders(); - if (hdrs == null) - hdrs = new Header[0]; - logger.debug("Request Headers:"); - for (Header h : hdrs) { - logger.debug(h.toString()); - } - } - if (this.response != null) { - Header[] hdrs = this.response.getAllHeaders(); - if (hdrs == null) - hdrs = new Header[0]; - logger.debug("Response Headers:"); - for (Header h : hdrs) { - logger.debug(h.toString()); - } - } - } - } - - public static class InterceptResponse extends InterceptCommon implements HttpResponseInterceptor { - public synchronized void process(HttpResponse response, HttpContext context) throws HttpException, IOException { - this.response = response; - this.context = context; - if (this.printheaders) - printHeaders(); - else if (this.response != null) { - Header[] hdrs = this.response.getAllHeaders(); - for (int i = 0; i < hdrs.length; i++) { - headers.add(hdrs[i]); - } - } + static class ZipStreamFactory implements InputStreamFactory { + // InputStreamFactory methods + @Override + public InputStream create(InputStream instream) throws IOException { + return new ZipInputStream(instream, HTTPUtil.UTF8); } } - public static class InterceptRequest extends InterceptCommon implements HttpRequestInterceptor { - public synchronized void process(HttpRequest request, HttpContext context) throws HttpException, IOException { - this.request = request; - this.context = context; - if (this.printheaders) - printHeaders(); - else if (this.request != null) { - Header[] hdrs = this.request.getAllHeaders(); - for (int i = 0; i < hdrs.length; i++) { - headers.add(hdrs[i]); - } - } + static class GZIPStreamFactory implements InputStreamFactory { + // InputStreamFactory methods + @Override + public InputStream create(InputStream instream) throws IOException { + return new GZIPInputStream(instream); } } @@ -315,40 +204,6 @@ static URI uriExclude(final URI uri, URIPart... excludes) { } } - /** - * Temporary hack to remove Content-Encoding: XXX-Endian headers - */ - static class ContentEncodingInterceptor extends InterceptCommon implements HttpResponseInterceptor { - public synchronized void process(HttpResponse response, HttpContext context) throws HttpException, IOException { - if (response == null) - return; - Header[] hdrs = response.getAllHeaders(); - if (hdrs == null) - return; - boolean modified = false; - for (int i = 0; i < hdrs.length; i++) { - Header h = hdrs[i]; - if (!h.getName().equalsIgnoreCase("content-encoding")) - continue; - String value = h.getValue(); - if (value.trim().toLowerCase().endsWith("-endian")) { - hdrs[i] = new BasicHeader("X-Content-Encoding", value); - modified = true; - } - } - if (modified) - response.setHeaders(hdrs); - // Similarly, suppress encoding for Entity - HttpEntity entity = response.getEntity(); - if (entity != null) { - Header ceheader = entity.getContentEncoding(); - if (ceheader != null) { - String value = ceheader.getValue(); - } - } - } - } - protected static Map merge(Map globalsettings, Map localsettings) { // merge global and local settings; local overrides global. diff --git a/httpservices/src/main/java/ucar/httpservices/fix b/httpservices/src/main/java/ucar/httpservices/fix deleted file mode 100644 index 62d4a87e51..0000000000 --- a/httpservices/src/main/java/ucar/httpservices/fix +++ /dev/null @@ -1,5 +0,0 @@ -F=`cd ckp2;ls -1|tr '\\r\\n' ' '` -for f in $F ; do - rm -f $f - sed -e 's|ucar[.]httpclient|ucar.httpservices|g' ./$f -done diff --git a/httpservices/src/test/java/ucar/nc2/util/net/TestHTTPSession.java b/httpservices/src/test/java/ucar/nc2/util/net/TestHTTPSession.java index 3e5ed1e79b..7ab6a08845 100755 --- a/httpservices/src/test/java/ucar/nc2/util/net/TestHTTPSession.java +++ b/httpservices/src/test/java/ucar/nc2/util/net/TestHTTPSession.java @@ -88,15 +88,15 @@ public void testAgent() throws Exception { logger.debug("*** URL: {}", TESTURL1); logger.debug("Test: HTTPSession.setGlobalUserAgent({})", GLOBALAGENT); - HTTPSession.setInterceptors(false); HTTPSession.setGlobalUserAgent(GLOBALAGENT); try (HTTPSession session = HTTPFactory.newSession(TESTURL1)) { + session.setDebugInterceptors(); // indicate we want debug intercepts List
agents = null; HTTPMethod method = HTTPFactory.Get(session, TESTURL1); method.execute(); // Use special interface to access the request // Look for the user agent header - agents = HTTPSession.debugRequestInterceptor().getHeaders(HTTPSession.HEADER_USERAGENT); + agents = session.getDebugRequestInterceptor().getHeaders(HTTPSession.HEADER_USERAGENT); Assert.assertFalse("User-Agent Header not found", agents.size() == 0); // It is possible to see multiple same headers, so verify that they have same value String agentvalue = null; @@ -113,12 +113,12 @@ public void testAgent() throws Exception { // method.close(); logger.debug("Test: HTTPSession.setUserAgent({})", SESSIONAGENT); - HTTPSession.resetInterceptors(); + session.resetInterceptors(); session.setUserAgent(SESSIONAGENT); method = HTTPFactory.Get(session, TESTURL1); method.execute(); // Use special interface to access the request - agents = HTTPSession.debugRequestInterceptor().getHeaders(HTTPSession.HEADER_USERAGENT); + agents = session.getDebugRequestInterceptor().getHeaders(HTTPSession.HEADER_USERAGENT); Assert.assertFalse("User-Agent Header not found", agents.size() == 0); agentvalue = null; for (Header h : agents) { diff --git a/netcdf-java-bom/build.gradle b/netcdf-java-bom/build.gradle index 0f33c578d7..400529c0ee 100644 --- a/netcdf-java-bom/build.gradle +++ b/netcdf-java-bom/build.gradle @@ -19,14 +19,12 @@ dependencies { api project(':cdm:cdm-radial') api project(':cdm:cdm-s3') api project(':cdm-test-utils') - api project(':dap4:d4core') - api project(':dap4:d4lib') - api project(':dap4:d4cdm') api project(':grib') api project(':httpservices') api project(':legacy') api project(':netcdf4') api project(':opendap') + api project(':dap4') api project(':udunits') api project(':uibase') api project(':uicdm') diff --git a/netcdf-java-platform/build.gradle b/netcdf-java-platform/build.gradle index 9cbc1a39f6..c10b172e30 100644 --- a/netcdf-java-platform/build.gradle +++ b/netcdf-java-platform/build.gradle @@ -25,7 +25,7 @@ dependencies { api 'org.jdom:jdom2:2.0.6' api 'joda-time:joda-time:2.10.3' // replace by javax.time - // netcdf4, dap4:d4lib + // netcdf4, dap4 // Tricky dependency here. We need to make sure that we keep in-line with the version // that chronicle-map uses in the TDS, or else we see bad things happen on the TDS side. api 'net.java.dev.jna:jna:5.12.1' diff --git a/netcdf4/src/main/java/ucar/nc2/jni/netcdf/Nc4Iosp.java b/netcdf4/src/main/java/ucar/nc2/jni/netcdf/Nc4Iosp.java index af411373e0..2bcb679edd 100755 --- a/netcdf4/src/main/java/ucar/nc2/jni/netcdf/Nc4Iosp.java +++ b/netcdf4/src/main/java/ucar/nc2/jni/netcdf/Nc4Iosp.java @@ -23,6 +23,7 @@ import ucar.nc2.iosp.hdf4.HdfEos; import ucar.nc2.iosp.hdf5.H5header; import ucar.nc2.ffi.netcdf.NetcdfClibrary; +import ucar.nc2.iosp.netcdf4.Nc4; import ucar.nc2.util.CancelTask; import ucar.nc2.util.DebugFlags; import ucar.nc2.util.EscapeStrings; @@ -60,12 +61,6 @@ public class Nc4Iosp extends AbstractIOServiceProvider implements IOServiceProvi private static Nc4prototypes nc4 = NetcdfClibrary.getForeignFunctionInterface(); - // Define reserved attributes (see Nc4DSP) - public static final String UCARTAGOPAQUE = "_edu.ucar.opaque.size"; - // Not yet implemented - public static final String UCARTAGVLEN = "_edu.ucar.isvlen"; - public static final String UCARTAGORIGTYPE = "_edu.ucar.orig.type"; - // TODO: These flags currently control debug messages that are printed to STDOUT. They ought to be logged to SLF4J. // We could use SLF4J markers to filter which debug-level messages are printed. // See http://stackoverflow.com/questions/12201112/can-i-add-custom-levels-to-slf4j @@ -1072,7 +1067,7 @@ private Variable makeVariable(Group g, Structure parent, String vname, int typei } if (dtype.isEnum()) { - EnumTypedef enumTypedef = g.findEnumeration(utype.name); + EnumTypedef enumTypedef = g.findEnumeration(utype.name, true); v.setEnumTypedef(enumTypedef); } else if (dtype == DataType.OPAQUE) { // TODO whats the problem with knowing the size?? Needed to read properly?? diff --git a/netcdf4/src/test/java/ucar/nc2/jni/netcdf/TestCDF5Reading.java b/netcdf4/src/test/java/ucar/nc2/jni/netcdf/TestCDF5Reading.java index 34a105aabb..8f3b5afa97 100644 --- a/netcdf4/src/test/java/ucar/nc2/jni/netcdf/TestCDF5Reading.java +++ b/netcdf4/src/test/java/ucar/nc2/jni/netcdf/TestCDF5Reading.java @@ -64,12 +64,6 @@ public void testReadSubsection() throws IOException, InvalidRangeException { try (NetcdfFile jni = openJni(location)) { jni.setLocation(location + " (jni)"); Array data = read(jni, "f4", "0:2"); - if (prop_visual) { - String dump = Ncdump.printArray(data); - logger.debug(dump); - String testresult = dump.replace('r', ' ').replace('\n', ' ').trim(); - visual("CDF Read", testresult); - } Assert.assertTrue("***Fail: data mismatch", MAMath.nearlyEquals(data, BASELINE)); System.err.println("***Pass"); } diff --git a/opendap/src/test/data/baseline1/fix b/opendap/src/test/data/baseline1/fix deleted file mode 100644 index 8789443319..0000000000 --- a/opendap/src/test/data/baseline1/fix +++ /dev/null @@ -1,84 +0,0 @@ -F="123.nc.das \ -123bears.nc.das \ -1990-S1700101.HDF.WVC_Lat.das \ -1998-6-avhrr.dat.das \ -D1.das \ -Drifters.das \ -EOSDB.das \ -NestedSeq.das \ -NestedSeq2.das \ -OverideExample.das \ -SimpleDrdsExample.das \ -b31.das \ -b31a.das \ -bears.nc.das \ -ber-2002-10-01.nc.das \ -ce.NAM_CONUS_12km_20100628_1200.grib2.01.das \ -ceopL2AIRS2-2.nc.das \ -ceopL2AIRS2.nc.das \ -ingrid.das \ -nestedDAS.das \ -pbug0001b.das \ -synth1.das \ -synth3.das \ -synth4.das \ -synth5.das \ -test.01.das \ -test.02.das \ -test.03.das \ -test.04.das \ -test.05.das \ -test.06.das \ -test.06a.das \ -test.07.das \ -test.07a.das \ -test.21.das \ -test.22.das \ -test.23.das \ -test.31.das \ -test.32.das \ -test.50.das \ -test.53.das \ -test.55.das \ -test.56.das \ -test.57.das \ -test.66.das \ -test.67.das \ -test.68.das \ -test.69.das \ -test.PointFile.das \ -test.SwathFile.das \ -test.an1.das \ -test.dfp1.das \ -test.dfr1.das \ -test.dfr2.das \ -test.dfr3.das \ -test.gr1.das \ -test.gr2.das \ -test.gr3.das \ -test.gr4.das \ -test.gr5.das \ -test.sds1.das \ -test.sds2.das \ -test.sds3.das \ -test.sds4.das \ -test.sds5.das \ -test.sds6.das \ -test.sds7.das \ -test.vs1.das \ -test.vs2.das \ -test.vs3.das \ -test.vs4.das \ -test.vs5.das \ -test1.das \ -test2.das \ -test3.das \ -whoi.das" - -for f in $F ; do - rm -f ./$f - sed -e 's/\\\\/\\/g' ./$f -done -exit - - diff --git a/opendap/src/test/data/testdata1/fix b/opendap/src/test/data/testdata1/fix deleted file mode 100755 index 8789443319..0000000000 --- a/opendap/src/test/data/testdata1/fix +++ /dev/null @@ -1,84 +0,0 @@ -F="123.nc.das \ -123bears.nc.das \ -1990-S1700101.HDF.WVC_Lat.das \ -1998-6-avhrr.dat.das \ -D1.das \ -Drifters.das \ -EOSDB.das \ -NestedSeq.das \ -NestedSeq2.das \ -OverideExample.das \ -SimpleDrdsExample.das \ -b31.das \ -b31a.das \ -bears.nc.das \ -ber-2002-10-01.nc.das \ -ce.NAM_CONUS_12km_20100628_1200.grib2.01.das \ -ceopL2AIRS2-2.nc.das \ -ceopL2AIRS2.nc.das \ -ingrid.das \ -nestedDAS.das \ -pbug0001b.das \ -synth1.das \ -synth3.das \ -synth4.das \ -synth5.das \ -test.01.das \ -test.02.das \ -test.03.das \ -test.04.das \ -test.05.das \ -test.06.das \ -test.06a.das \ -test.07.das \ -test.07a.das \ -test.21.das \ -test.22.das \ -test.23.das \ -test.31.das \ -test.32.das \ -test.50.das \ -test.53.das \ -test.55.das \ -test.56.das \ -test.57.das \ -test.66.das \ -test.67.das \ -test.68.das \ -test.69.das \ -test.PointFile.das \ -test.SwathFile.das \ -test.an1.das \ -test.dfp1.das \ -test.dfr1.das \ -test.dfr2.das \ -test.dfr3.das \ -test.gr1.das \ -test.gr2.das \ -test.gr3.das \ -test.gr4.das \ -test.gr5.das \ -test.sds1.das \ -test.sds2.das \ -test.sds3.das \ -test.sds4.das \ -test.sds5.das \ -test.sds6.das \ -test.sds7.das \ -test.vs1.das \ -test.vs2.das \ -test.vs3.das \ -test.vs4.das \ -test.vs5.das \ -test1.das \ -test2.das \ -test3.das \ -whoi.das" - -for f in $F ; do - rm -f ./$f - sed -e 's/\\\\/\\/g' ./$f -done -exit - - diff --git a/settings.gradle b/settings.gradle index ab30ed709e..e6d0ff747b 100644 --- a/settings.gradle +++ b/settings.gradle @@ -11,10 +11,6 @@ include 'cdm:s3' include 'cdm:zarr' include 'cdm-test' include 'cdm-test-utils' -include 'dap4:d4core' -include 'dap4:d4lib' -include 'dap4:d4cdm' -include 'dap4:d4tests' include 'docs' include 'grib' include 'httpservices' @@ -24,6 +20,7 @@ include 'netcdf-java-bom' include 'netcdf-java-platform' include 'netcdf-java-testing-platform' include 'opendap' +include 'dap4' include 'udunits' include 'uibase' include 'uicdm' diff --git a/uicdm/build.gradle b/uicdm/build.gradle index cfe13a028a..d8480ec89f 100644 --- a/uicdm/build.gradle +++ b/uicdm/build.gradle @@ -18,11 +18,11 @@ dependencies { compile project(':cdm:cdm-misc') // misc iosps compile project(':cdm:cdm-radial') // radial data compile project(':bufr') - compile project(':dap4:d4cdm') compile project(':grib') compile project(':httpservices') compile project(':netcdf4') compile project(':opendap') + compile project(':dap4') compile project(':uibase') compile project(':visad:cdm-mcidas') // For Gempak IOSPs. compile project(':waterml') diff --git a/uicdm/src/main/java/ucar/nc2/ui/ToolsUI.java b/uicdm/src/main/java/ucar/nc2/ui/ToolsUI.java index d93ad97829..aacde4acc0 100644 --- a/uicdm/src/main/java/ucar/nc2/ui/ToolsUI.java +++ b/uicdm/src/main/java/ucar/nc2/ui/ToolsUI.java @@ -1458,7 +1458,6 @@ public static void main(String[] args) { for (String arg : args) { System.out.println(" " + arg); } - HTTPSession.setInterceptors(true); } // handle multiple versions of ToolsUI, along with passing a dataset name @@ -1505,7 +1504,6 @@ public void setMessage(SocketMessage.Event event) { for (String arg : args) { System.out.println(" " + arg); } - HTTPSession.setInterceptors(true); } // look for command-line arguments From b2304cad83da674e04b34eebca391f62f235cc9a Mon Sep 17 00:00:00 2001 From: Dennis Heimbigner Date: Thu, 19 Jan 2023 21:15:15 -0700 Subject: [PATCH 3/5] ## Addendum: Additional Commit Changes netcdf-java/dap4 was modified as follows: * Remove some old, unused code. * A number of classes were renamed to more accurately reflect their semantics. Specifically: - *DataCursor* -> *D4Array* - *DataIndex* -> *D4Index* * Some refactoring of code was done: - Added *ArrayScheme* - Deleted *CEConstraintIF* --- .../main/java/dap4/core/ce/CEConstraint.java | 152 +----------------- .../dap4/core/interfaces/ArrayScheme.java | 37 +++++ .../dap4/core/interfaces/CEConstraintIF.java | 24 --- .../java/dap4/core/interfaces/DataCursor.java | 53 ------ .../java/dap4/core/interfaces/DataIndex.java | 23 --- .../src/main/java/dap4/core/util/DapUtil.java | 1 - dap4/src/main/java/dap4/core/util/Slice.java | 4 + .../dap4lib/{D4Cursor.java => D4Array.java} | 31 +--- dap4/src/main/java/dap4/dap4lib/D4DSP.java | 8 +- .../java/dap4/dap4lib/D4DataCompiler.java | 8 +- dap4/src/main/java/dap4/dap4lib/D4Index.java | 18 +-- .../main/java/dap4/dap4lib/cdm/CDMUtil.java | 126 --------------- .../dap4/dap4lib/cdm/nc2/CDMCompiler.java | 4 - .../dap4/dap4lib/cdm/nc2/DapNetcdfFile.java | 8 +- .../java/dap4/dap4lib/cdm/nc2/DataToCDM.java | 12 +- 15 files changed, 77 insertions(+), 432 deletions(-) create mode 100644 dap4/src/main/java/dap4/core/interfaces/ArrayScheme.java delete mode 100644 dap4/src/main/java/dap4/core/interfaces/CEConstraintIF.java delete mode 100644 dap4/src/main/java/dap4/core/interfaces/DataCursor.java delete mode 100644 dap4/src/main/java/dap4/core/interfaces/DataIndex.java rename dap4/src/main/java/dap4/dap4lib/{D4Cursor.java => D4Array.java} (66%) diff --git a/dap4/src/main/java/dap4/core/ce/CEConstraint.java b/dap4/src/main/java/dap4/core/ce/CEConstraint.java index c1d92a0a52..d17a188e26 100644 --- a/dap4/src/main/java/dap4/core/ce/CEConstraint.java +++ b/dap4/src/main/java/dap4/core/ce/CEConstraint.java @@ -8,8 +8,9 @@ import dap4.core.ce.parser.CEParserImpl; import dap4.core.dmr.*; import dap4.core.dmr.parser.ParseException; -import dap4.core.interfaces.DataCursor; import dap4.core.util.*; +import dap4.dap4lib.D4Array; + import java.util.*; /** @@ -96,8 +97,6 @@ protected static enum Expand { NONE, EXPANDED, CONTRACTED } - ; - protected static class Segment { DapVariable var; List slices; // projection slices for this variable @@ -141,109 +140,6 @@ public String toString() { } } - /* - * static protected class ReferenceIterator implements Iterator - * { - * - * ////////////////////////////////////////////////// - * // Instance Variables - * - * List list = new ArrayList<>(); - * Iterator listiter = null; - ** - * - * @param ce the constraint over which to iterate - * - * @throws DapException - * - * public ReferenceIterator(CEConstraint ce) - * throws DapException - * { - * list.addAll(ce.dimrefs); - * list.addAll(ce.enums); - * list.addAll(ce.variables); - * listiter = list.iterator(); - * } - * - * ////////////////////////////////////////////////// - * // Iterator Interface - * - * public boolean hasNext() - * { - * return listiter.hasNext(); - * } - * - * public DapNode next() - * { - * return listiter.next(); - * } - * - * public void remove() - * { - * throw new UnsupportedOperationException(); - * } - * - * } - * - * static protected class FilterIterator implements Iterator - * { - * protected DapSequence seq; - * protected DataCursor data; - * protected long nrecords; - * protected CEAST filter; - * - * protected int recno; - * protected DataCursor current; - * CEConstraint ce; - * - * public FilterIterator(CEConstraint ce, DapSequence seq, DataCursor data, CEAST filter) - * { - * this.ce = ce; - * this.filter = filter; - * this.seq = seq; - * this.data = data; - * this.nrecords = data.getRecordCount(); - * this.recno = 0; // actually recno of next record to read - * this.current = null; - * } - * - * // Iterator interface - * public boolean hasNext() - * { - * if(recno < nrecords) - * return false; - * try { - * // look for next matching record starting at recno - * if(filter == null) { - * this.current = data.getRecord(this.recno); - * this.recno++; - * return true; - * } else for(;recno < nrecords;recno++) { - * this.current = data.getRecord(this.recno); - * if(ce.matches(this.seq, this.current, filter)) - * return true; - * } - * } catch (DapException de) { - * return false; - * } - * this.current = null; - * return false; - * } - * - * public DataCursor next() - * { - * if(this.recno >= nrecords || this.current == null) - * throw new NoSuchElementException(); - * return this.current; - * } - * - * public void remove() - * { - * throw new UnsupportedOperationException(); - * } - * } - */ - ////////////////////////////////////////////////// // class variables and methods @@ -266,24 +162,6 @@ public static CEConstraint getUniversal(DapDataset dmr) { public static void release(DapDataset dmr) { universals.remove(dmr); } - /* - * protected static DataCursor fieldValue(DapVariable sqvar, DapSequence seq, DataCursor record, String field) - * throws DapException { - * DapVariable dapv = seq.findByName(field); - * if (dapv == null) - * throw new DapException("Unknown variable in filter: " + field); - * if (!dapv.isAtomic()) - * throw new DapException("Non-atomic variable in filter: " + field); - * if (dapv.getRank() > 0) - * throw new DapException("Non-scalar variable in filter: " + field); - * int fieldindex = seq.indexByName(field); - * DataCursor da = (DataCursor) (record.readField(fieldindex)); - * if (da == null) - * throw new DapException("No such field: " + field); - * return da; - * } - * - */ protected static int compare(Object lvalue, Object rvalue) throws DapException { if (lvalue instanceof String && rvalue instanceof String) @@ -313,7 +191,7 @@ protected static int compare(Object lvalue, Object rvalue) throws DapException { * @throws DapException * @return the value of the expression (usually a Boolean) */ - protected Object eval(DapVariable var, DapSequence seq, DataCursor record, CEAST expr) throws DapException { + protected Object eval(DapVariable var, DapSequence seq, D4Array record, CEAST expr) throws DapException { switch (expr.sort) { case CONSTANT: @@ -619,26 +497,6 @@ public boolean references(DapNode node) { return isref; } - /** - * Reference X Iterator - * Iterate over the variables and return - * those that are referenced. The order of - * return is preorder. - * Inputs: - * 1. the variable whose slices are to be iterated. - * - * @return ReferenceIterator - * @throws DapException if could not create. - */ - /* - * public ReferenceIterator - * referenceIterator() - * throws DapException - * { - * return new ReferenceIterator(this); - * } - */ - ////////////////////////////////////////////////// // Selection (Filter) processing @@ -653,7 +511,7 @@ public boolean references(DapNode node) { * @throws DapException * @return true if the filter matches the record */ - public boolean match(DapVariable sqvar, DapSequence seq, DataCursor rec) throws DapException { + public boolean match(DapVariable sqvar, DapSequence seq, D4Array rec) throws DapException { Segment sseq = findSegment(sqvar); if (sseq == null) return false; @@ -674,7 +532,7 @@ public boolean match(DapVariable sqvar, DapSequence seq, DataCursor rec) throws * @return true if a match * @throws DapException */ - protected boolean matches(DapVariable var, DapSequence seq, DataCursor rec, CEAST filter) throws DapException { + protected boolean matches(DapVariable var, DapSequence seq, D4Array rec, CEAST filter) throws DapException { Object value = eval(var, seq, rec, filter); return ((Boolean) value); } diff --git a/dap4/src/main/java/dap4/core/interfaces/ArrayScheme.java b/dap4/src/main/java/dap4/core/interfaces/ArrayScheme.java new file mode 100644 index 0000000000..0f59e60f63 --- /dev/null +++ b/dap4/src/main/java/dap4/core/interfaces/ArrayScheme.java @@ -0,0 +1,37 @@ +/* + * Copyright 2012, UCAR/Unidata. + * See the LICENSE file for more information. + */ + +package dap4.core.interfaces; + + +import dap4.core.dmr.DapType; +import dap4.core.dmr.DapVariable; + +/** + * Track kinds of Arrays + */ + +public enum ArrayScheme { + ATOMIC, STRUCTARRAY, STRUCTURE, SEQARRAY, SEQUENCE, RECORD; + + ////////////////////////////////////////////////// + // Static methods + + static public ArrayScheme schemeFor(DapVariable field) { + DapType ftype = field.getBaseType(); + ArrayScheme scheme = null; + boolean isscalar = field.getRank() == 0; + if (ftype.getTypeSort().isAtomic()) + scheme = ArrayScheme.ATOMIC; + else { + if (ftype.getTypeSort().isStructType()) + scheme = ArrayScheme.STRUCTARRAY; + else if (ftype.getTypeSort().isSeqType()) + scheme = ArrayScheme.SEQARRAY; + } + return scheme; + } +} + diff --git a/dap4/src/main/java/dap4/core/interfaces/CEConstraintIF.java b/dap4/src/main/java/dap4/core/interfaces/CEConstraintIF.java deleted file mode 100644 index 5e4621c89b..0000000000 --- a/dap4/src/main/java/dap4/core/interfaces/CEConstraintIF.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2012, UCAR/Unidata. - * See the LICENSE file for more information. - */ - -package dap4.core.interfaces; - -import dap4.core.dmr.DapNode; - -public interface CEConstraintIF { - - ////////////////////////////////////////////////// - // Reference processing - - /** - * Reference X match - * - * @param node to test - * @return true if node is referenced by this constraint - */ - - public boolean references(DapNode node); - -} diff --git a/dap4/src/main/java/dap4/core/interfaces/DataCursor.java b/dap4/src/main/java/dap4/core/interfaces/DataCursor.java deleted file mode 100644 index 4e2e5fb67c..0000000000 --- a/dap4/src/main/java/dap4/core/interfaces/DataCursor.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright 2012, UCAR/Unidata. - * See the LICENSE file for more information. - */ - -package dap4.core.interfaces; - -import dap4.core.dmr.DapNode; -import dap4.core.util.DapException; -import dap4.core.util.Slice; -import ucar.ma2.Index; - -import java.util.List; - -/** - * For data access, we adopt a cursor model. - * This comes from database technology where a - * cursor object is used to walk over the - * results of a database query. Here the cursor - * walks the underlying data and stores enough - * state to extract data depending on its - * sort. The cursor may (or may not) contain - * internal subclasses to track various kinds of - * state. - */ - -/** - * This Interface it to allow references to Cursor functionality - * where the cursor object is defined in some non contained code tree. - * Note also this this Interface is shared by both client and server. - */ - -public interface DataCursor { - ////////////////////////////////////////////////// - // Kinds of Cursor - - public static enum Scheme { - ATOMIC, STRUCTARRAY, STRUCTURE, SEQARRAY, SEQUENCE, RECORD; - - public boolean isCompoundArray() { - return this == STRUCTARRAY || this == SEQARRAY; - } - } - - ////////////////////////////////////////////////// - // API - - public Scheme getScheme(); - - public DapNode getTemplate(); - - public boolean isScalar(); -} diff --git a/dap4/src/main/java/dap4/core/interfaces/DataIndex.java b/dap4/src/main/java/dap4/core/interfaces/DataIndex.java deleted file mode 100644 index f8f05408cb..0000000000 --- a/dap4/src/main/java/dap4/core/interfaces/DataIndex.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2012, UCAR/Unidata. - * See the LICENSE file for more information. - */ - -package dap4.core.interfaces; - -public interface DataIndex { - - public int getRank(); - - public int[] getCurrentCounter(); - - public int getCurrentCounter(int i); - - public int[] getShape(); - - public int getShape(int i); - - public int index(); - - public boolean isScalar(); -} diff --git a/dap4/src/main/java/dap4/core/util/DapUtil.java b/dap4/src/main/java/dap4/core/util/DapUtil.java index 1ff9d7be11..c2013147fd 100644 --- a/dap4/src/main/java/dap4/core/util/DapUtil.java +++ b/dap4/src/main/java/dap4/core/util/DapUtil.java @@ -6,7 +6,6 @@ package dap4.core.util; import dap4.core.dmr.*; -import dap4.core.interfaces.DataIndex; import java.io.*; import java.math.BigInteger; diff --git a/dap4/src/main/java/dap4/core/util/Slice.java b/dap4/src/main/java/dap4/core/util/Slice.java index 1e72991983..aa2ccc71c7 100644 --- a/dap4/src/main/java/dap4/core/util/Slice.java +++ b/dap4/src/main/java/dap4/core/util/Slice.java @@ -206,6 +206,10 @@ public int getMax() // not same as getcount and not same as maxsize return this.maxsize; } + public boolean isScalar() { + return this.getSize() <= 1; + } + public Slice setMaxSize(int size) throws DapException { return setIndices(this.first, this.stop, this.stride, size); } diff --git a/dap4/src/main/java/dap4/dap4lib/D4Cursor.java b/dap4/src/main/java/dap4/dap4lib/D4Array.java similarity index 66% rename from dap4/src/main/java/dap4/dap4lib/D4Cursor.java rename to dap4/src/main/java/dap4/dap4lib/D4Array.java index d0736f86af..bed89c73a6 100644 --- a/dap4/src/main/java/dap4/dap4lib/D4Cursor.java +++ b/dap4/src/main/java/dap4/dap4lib/D4Array.java @@ -6,7 +6,7 @@ package dap4.dap4lib; import dap4.core.dmr.*; -import dap4.core.interfaces.DataCursor; +import dap4.core.interfaces.ArrayScheme; import ucar.ma2.Array; /** @@ -15,7 +15,7 @@ * information beside the Array. */ -public class D4Cursor implements DataCursor { +public class D4Array { ////////////////////////////////////////////////// // Mnemonics @@ -27,7 +27,7 @@ public class D4Cursor implements DataCursor { // Instance Variables protected D4DSP dsp; - protected Scheme scheme; // Roughly, what kind of array + protected ArrayScheme scheme; // Roughly, what kind of array protected DapNode template; protected Array array = null; // the Array object for the variable protected Object storage = null; // The storage underlying Array @@ -35,7 +35,7 @@ public class D4Cursor implements DataCursor { ////////////////////////////////////////////////// // Constructor(s) - public D4Cursor(Scheme scheme, D4DSP dsp, DapVariable template) { + public D4Array(ArrayScheme scheme, D4DSP dsp, DapVariable template) { this.scheme = scheme; this.template = template; this.dsp = dsp; @@ -44,7 +44,7 @@ public D4Cursor(Scheme scheme, D4DSP dsp, DapVariable template) { public String toString() { StringBuilder buf = new StringBuilder(); buf.append(getScheme().toString()); - if (getScheme() == Scheme.STRUCTARRAY || getScheme() == Scheme.SEQARRAY) + if (getScheme() == ArrayScheme.STRUCTARRAY || getScheme() == ArrayScheme.SEQARRAY) buf.append("[]"); buf.append(":"); buf.append(getTemplate().toString()); @@ -58,7 +58,7 @@ public D4DSP getDSP() { return this.dsp; } - public Scheme getScheme() { + public ArrayScheme getScheme() { return this.scheme; } @@ -78,32 +78,17 @@ public boolean isScalar() { return ((DapVariable) getTemplate()).getRank() == 0; } - public D4Cursor setArray(Array a) { + public D4Array setArray(Array a) { this.array = a; return this; } - public D4Cursor setStorage(Object store) { + public D4Array setStorage(Object store) { this.storage = store; return this; } - static public Scheme schemeFor(DapVariable field) { - DapType ftype = field.getBaseType(); - Scheme scheme = null; - boolean isscalar = field.getRank() == 0; - if (ftype.getTypeSort().isAtomic()) - scheme = Scheme.ATOMIC; - else { - if (ftype.getTypeSort().isStructType()) - scheme = Scheme.STRUCTARRAY; - else if (ftype.getTypeSort().isSeqType()) - scheme = Scheme.SEQARRAY; - } - return scheme; - } - } diff --git a/dap4/src/main/java/dap4/dap4lib/D4DSP.java b/dap4/src/main/java/dap4/dap4lib/D4DSP.java index cc1baa7dcb..e6f1edc533 100644 --- a/dap4/src/main/java/dap4/dap4lib/D4DSP.java +++ b/dap4/src/main/java/dap4/dap4lib/D4DSP.java @@ -64,7 +64,7 @@ public abstract class D4DSP { // DAP stream compilation D4DataCompiler d4compiler = null; - protected Map datamap = new HashMap<>(); + protected Map datamap = new HashMap<>(); ////////////////////////////////////////////////// // Constructor(s) @@ -100,7 +100,7 @@ public ChecksumMode getChecksumMode() { return this.checksummode; } - public Map getVariableDataMap() { + public Map getVariableDataMap() { return this.datamap; } @@ -123,7 +123,7 @@ protected D4DSP setStream(InputStream input, RequestMode mode) throws IOExceptio return this; } - protected void addVariableData(DapVariable var, D4Cursor cursor) { + protected void addVariableData(DapVariable var, D4Array cursor) { this.datamap.put(var, cursor); } @@ -208,7 +208,7 @@ public void loadContext(DapContext cxt, RequestMode mode) { case DAP: cxt.put(ChecksumSource.REMOTE, d4compiler.getChecksumMap(ChecksumSource.REMOTE)); cxt.put(ChecksumSource.LOCAL, d4compiler.getChecksumMap(ChecksumSource.LOCAL)); - cxt.put(D4Cursor.class, getVariableDataMap()); + cxt.put(D4Array.class, getVariableDataMap()); break; } } diff --git a/dap4/src/main/java/dap4/dap4lib/D4DataCompiler.java b/dap4/src/main/java/dap4/dap4lib/D4DataCompiler.java index ca6a054771..459b5d6b44 100644 --- a/dap4/src/main/java/dap4/dap4lib/D4DataCompiler.java +++ b/dap4/src/main/java/dap4/dap4lib/D4DataCompiler.java @@ -6,7 +6,6 @@ package dap4.dap4lib; -import dap4.core.interfaces.DataIndex; import dap4.core.util.ChecksumMode; import dap4.core.dmr.*; import dap4.core.util.*; @@ -21,11 +20,8 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.zip.Checksum; -import static dap4.core.interfaces.DataCursor.Scheme.*; -import static dap4.dap4lib.D4Cursor.Scheme; -import static dap4.dap4lib.D4Cursor.schemeFor; +import static dap4.core.interfaces.ArrayScheme.*; public class D4DataCompiler { @@ -110,7 +106,7 @@ public void compile() throws IOException { // iterate over the variables represented in the databuffer for (DapVariable vv : this.dmr.getTopVariables()) { Object storage = compileVar(vv); - D4Cursor data = new D4Cursor(schemeFor(vv), this.dsp, vv).setStorage(storage); + D4Array data = new D4Array(schemeFor(vv), this.dsp, vv).setStorage(storage); assert data.getArray() == null; data.setArray(createArray(vv, data.getStorage())); this.dsp.addVariableData(vv, data); diff --git a/dap4/src/main/java/dap4/dap4lib/D4Index.java b/dap4/src/main/java/dap4/dap4lib/D4Index.java index d97479a70b..ad3b1b294b 100644 --- a/dap4/src/main/java/dap4/dap4lib/D4Index.java +++ b/dap4/src/main/java/dap4/dap4lib/D4Index.java @@ -5,16 +5,14 @@ package dap4.dap4lib; -import dap4.core.interfaces.DataIndex; import dap4.core.util.DapException; import dap4.core.util.Slice; import ucar.ma2.Index; import java.util.ArrayList; -import java.util.Arrays; import java.util.List; -public class D4Index extends ucar.ma2.Index implements DataIndex { +public class D4Index extends ucar.ma2.Index { public static final D4Index SCALAR = new D4Index(0); @@ -37,21 +35,21 @@ static public Index offsetToIndex(int offset, int[] shape) { } /** - * Convert DataIndex to list of slices + * Convert ucar.ma2.Index to list of slices * * @param indices to convert * @return list of corresponding slices */ - static public List indexToSlices(DataIndex indices) throws DapException { + static public List indexToSlices(ucar.ma2.Index indices) throws DapException { // short circuit the scalar case int rank = indices.getRank(); if (rank == 0) return Slice.SCALARSLICES; - // offset = d3*(d2*(d1*(x1))+x2)+x3 List slices = new ArrayList<>(rank); + int[] counter = indices.getCurrentCounter(); for (int i = 0; i < rank; i++) { - int isize = indices.getCurrentCounter(i); + int isize = counter[i]; slices.add(new Slice(isize, isize + 1, 1, indices.getShape(i))); } return slices; @@ -66,7 +64,7 @@ static public List indexToSlices(DataIndex indices) throws DapException { * @return Index corresponding to slices * @throws DapException */ - static public DataIndex slicesToIndex(List slices) throws DapException { + static public D4Index slicesToIndex(List slices) throws DapException { int[] positions = new int[slices.size()]; int[] dimsizes = new int[slices.size()]; for (int i = 0; i < positions.length; i++) { @@ -76,7 +74,9 @@ static public DataIndex slicesToIndex(List slices) throws DapException { positions[i] = s.getFirst(); dimsizes[i] = s.getMax(); } - return new D4Index(positions, dimsizes); + D4Index result = new D4Index(dimsizes); + result.set(positions); + return result; } ////////////////////////////////////////////////// diff --git a/dap4/src/main/java/dap4/dap4lib/cdm/CDMUtil.java b/dap4/src/main/java/dap4/dap4lib/cdm/CDMUtil.java index 0d997820aa..3f7b4152b3 100644 --- a/dap4/src/main/java/dap4/dap4lib/cdm/CDMUtil.java +++ b/dap4/src/main/java/dap4/dap4lib/cdm/CDMUtil.java @@ -5,8 +5,6 @@ package dap4.dap4lib.cdm; -import dap4.core.interfaces.DataIndex; -import dap4.dap4lib.D4Cursor; import dap4.core.dmr.DapDimension; import dap4.core.dmr.DapType; import dap4.core.dmr.TypeSort; @@ -156,27 +154,6 @@ public static List createCDMRanges(List slices) throws Da * @return the lowest level Variable instance */ public static Variable unwrap(Variable var) { - /* - * for(;;) { - * if(var instanceof VariableDS) { - * VariableDS vds = (VariableDS) var; - * var = vds.getOriginalVariable(); - * if(var == null) { - * var = vds; - * break; - * } - * } else if(var instanceof StructureDS) { - * StructureDS sds = (StructureDS) var; - * var = sds.getOriginalVariable(); - * if(var == null) { - * var = sds; - * break; - * } - * } else - * break; - * } - * return var; - */ return (Variable) CDMNode.unwrap(var); } @@ -273,68 +250,6 @@ public static Object convertVector(DapType dsttype, DapType srctype, Object src) return result; } - /** - * Given an arbitrary Array (including ArrayStructure), produce - * a new Array that represents the slice defined by the - * section. For now, we create a simple array of the relevant - * type and fill it by extracting the values specified by the - * section. - *

- * param array the array from which the section is extracted - * param section determines what to extract - * throws DapException - * returns the slice array - */ - /* - * static public ucar.ma2.Array - * arraySlice(ucar.ma2.Array array, Section section) - * throws DapException - * { - * // Case it out. - * if(!dapvar.getBaseType().isStructType()) { // =>Atomic type - * if(dapvar.isTopLevel()) { - * // Simplest case: use createview, but watch out for final VLEN - * List ranges = section.getRanges(); - * try { - * if(CDMUtil.hasVLEN(ranges)) - * return array.section(ranges.subList(0, ranges.size() - 2)); - * else - * return array.section(ranges); - * } catch (InvalidRangeException ire) { - * throw new DapException(ire); - * } - * } else - * throw new UnsupportedOperationException(); // same as other cdm - * } else { // struct type - * assert (array instanceof CDMArrayStructure); - * CDMArrayStructure struct = (CDMArrayStructure) array; - * if(dapvar.isTopLevel()) { - * // Build a new ArrayStructure containing - * // the relevant instances. - * int[] shape = section.getShape(); - * StructureMembers sm = new StructureMembers(struct.getStructureMembers()); - * ArrayStructureMA slice = new ArrayStructureMA(sm, shape); - * CDMOdometer odom = new CDMOdometer(dapvar.getDimensions(), section.getRanges()); - * // Compute the number of structuredata instances we need - * long totalsize = section.computeSize(); - * List mlist = sm.getMembers(); - * StructureData[] newdata = new StructureData[(int) totalsize]; - * for(int i = 0;odom.hasNext();odom.next(), i++) { - * long recno = odom.index(); - * StructureDataW clone = new StructureDataW(sm); - * newdata[i] = clone; - * StructureData record = struct.getStructureData((int) recno); - * for(int j = 0;j < mlist.size();j++) { - * StructureMembers.Member m = mlist.get(j); - * clone.setMemberData(m, record.getArray(m)); - * } - * } - * return slice; - * } else - * throw new UnsupportedOperationException(); // same as other cdm - * } - * } - */ public static String getChecksumString(byte[] checksum) { StringBuilder buf = new StringBuilder(); for (int i = 0; i < checksum.length; i++) { @@ -345,47 +260,6 @@ public static String getChecksumString(byte[] checksum) { return buf.toString(); } - /** - * Convert a Section + variable to a constraint - *

- *

- * static public View - * sectionToView(CDMDSP dsp, Variable v, Section section) - * throws DapException - * { - * if(section == null || section.getRank() == 0) - * return null; - * // Get the corresponding DapNode - * DapVariable dv = (DapVariable) dsp.getNode().get(v); - * if(dv == null) - * throw new DapException("Variable has no corresponding dap node: " + v.getFullName()); - * // Get the structure path wrt DapDataset for dv - * // and use path plus the Section to construct a constraint - * List structpath = DapUtil.getStructurePath(dv); - * List ranges = section.getRanges(); - * View view = new View(dmr); - * int next = 0; - * for(int i = 0;i < structpath.size();i++) { - * dv = structpath.get(i); - * int rank = dv.getRank(); - * ViewVariable vv = new ViewVariable(dv); - * List slices = new ArrayList(rank); - * for(int j = 0;j < rank;j++, next++) { - * if(next >= ranges.size()) - * throw new DapException("Range::Rank mismatch"); - * Range range = ranges.get(next); - * Slice slice = new Slice(range.first(), range.last(), range.stride()).validate(); - * slices.add(slice); - * } - * vv.setSlices(slices); - * view.put(dv, vv); - * } - * view.validate(View.EXPAND); - * return view; - * } - */ - - public static List dimsetToRanges(List dimset) throws dap4.core.util.DapException { if (dimset == null) return null; diff --git a/dap4/src/main/java/dap4/dap4lib/cdm/nc2/CDMCompiler.java b/dap4/src/main/java/dap4/dap4lib/cdm/nc2/CDMCompiler.java index 04b6ecdbca..f610c9a878 100644 --- a/dap4/src/main/java/dap4/dap4lib/cdm/nc2/CDMCompiler.java +++ b/dap4/src/main/java/dap4/dap4lib/cdm/nc2/CDMCompiler.java @@ -6,9 +6,6 @@ package dap4.dap4lib.cdm.nc2; -import dap4.core.dmr.DapVariable; -import dap4.core.util.DapContext; -import dap4.dap4lib.D4Cursor; import dap4.dap4lib.D4DSP; import dap4.dap4lib.cdm.NodeMap; import dap4.core.dmr.DapDataset; @@ -16,7 +13,6 @@ import dap4.core.util.DapException; import ucar.ma2.Array; import ucar.nc2.CDMNode; -import ucar.nc2.Group; import ucar.nc2.NetcdfFile; import ucar.nc2.Variable; import java.util.Map; diff --git a/dap4/src/main/java/dap4/dap4lib/cdm/nc2/DapNetcdfFile.java b/dap4/src/main/java/dap4/dap4lib/cdm/nc2/DapNetcdfFile.java index 0ff7208086..22c9d7c954 100644 --- a/dap4/src/main/java/dap4/dap4lib/cdm/nc2/DapNetcdfFile.java +++ b/dap4/src/main/java/dap4/dap4lib/cdm/nc2/DapNetcdfFile.java @@ -295,7 +295,7 @@ protected Array readData(Variable cdmvar, Section section) throws IOException, I protected void loadContext() { this.cxt.put(DapConstants.ChecksumSource.REMOTE, this.dsp.getChecksumMap(DapConstants.ChecksumSource.REMOTE)); this.cxt.put(DapConstants.ChecksumSource.LOCAL, this.dsp.getChecksumMap(DapConstants.ChecksumSource.LOCAL)); - this.cxt.put(D4Cursor.class, this.dsp.getVariableDataMap()); + this.cxt.put(D4Array.class, this.dsp.getVariableDataMap()); } protected void verifyChecksums() throws DapException { @@ -358,11 +358,11 @@ public void ensuredata() throws IOException { // Prepare the array map assert this.arraymap == null; this.arraymap = new HashMap(); - Map datamap = this.dsp.getVariableDataMap(); + Map datamap = this.dsp.getVariableDataMap(); NodeMap nodemap = this.cdmCompiler.getNodeMap(); - for (Map.Entry entry : datamap.entrySet()) { + for (Map.Entry entry : datamap.entrySet()) { DapVariable dv = entry.getKey(); - D4Cursor dc = entry.getValue(); + D4Array dc = entry.getValue(); Variable v = (Variable) nodemap.get(entry.getKey()); assert (dc.getArray() != null); arraymap.put(v, dc.getArray()); diff --git a/dap4/src/main/java/dap4/dap4lib/cdm/nc2/DataToCDM.java b/dap4/src/main/java/dap4/dap4lib/cdm/nc2/DataToCDM.java index 781dc18bd0..ad1a228e08 100644 --- a/dap4/src/main/java/dap4/dap4lib/cdm/nc2/DataToCDM.java +++ b/dap4/src/main/java/dap4/dap4lib/cdm/nc2/DataToCDM.java @@ -6,8 +6,7 @@ package dap4.dap4lib.cdm.nc2; -import dap4.core.interfaces.DataIndex; -import dap4.dap4lib.D4Cursor; +import dap4.dap4lib.D4Array; import dap4.dap4lib.D4DSP; import dap4.dap4lib.cdm.NodeMap; import dap4.core.dmr.*; @@ -19,9 +18,6 @@ import java.util.List; import java.util.Map; -import static dap4.core.dmr.DapType.*; -import static dap4.core.util.DapConstants.*; - /** * Associate the Array objects created in D4DataCompiler * with the corresponding CDM Variable. @@ -52,7 +48,7 @@ abstract public class DataToCDM { protected Map localchecksummap = null; protected Group cdmroot = null; - protected Map datamap = null; + protected Map datamap = null; protected NodeMap nodemap = null; ////////////////////////////////////////////////// @@ -62,14 +58,14 @@ abstract public class DataToCDM { // Correlate CDM Variables with ucar.ma2.Array objects static public Map createDataMap(D4DSP dsp, NodeMap nodemap) throws DapException { - Map datamap = dsp.getVariableDataMap(); + Map datamap = dsp.getVariableDataMap(); DapDataset dmr = dsp.getDMR(); Map arraymap = new HashMap<>(); // iterate over the variables represented in the nodemap List topvars = dmr.getTopVariables(); Map map = null; for (DapVariable var : topvars) { - D4Cursor cursor = datamap.get(var); + D4Array cursor = datamap.get(var); Variable v = (Variable) nodemap.get(var); assert cursor != null && v != null; Array array = cursor.getArray(); From f13fb73de456e1c31454dec27c32fe95bb781d99 Mon Sep 17 00:00:00 2001 From: Dennis Heimbigner Date: Sat, 21 Jan 2023 16:12:48 -0700 Subject: [PATCH 4/5] ckp --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 61d0e90907..eb6b70ada1 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@

+ # netCDF-Java/CDM The netCDF Java library provides an interface for scientific data access. From c740c7784a36fe0b0969b6c70a34e99fcec01b46 Mon Sep 17 00:00:00 2001 From: Dennis Heimbigner Date: Mon, 23 Jan 2023 10:11:47 -0700 Subject: [PATCH 5/5] Minor fix to HTTPSession.java --- httpservices/src/main/java/ucar/httpservices/HTTPSession.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/httpservices/src/main/java/ucar/httpservices/HTTPSession.java b/httpservices/src/main/java/ucar/httpservices/HTTPSession.java index 3c5f83d8a8..f59e850b96 100755 --- a/httpservices/src/main/java/ucar/httpservices/HTTPSession.java +++ b/httpservices/src/main/java/ucar/httpservices/HTTPSession.java @@ -668,7 +668,8 @@ public HTTPIntercepts.DebugInterceptRequest getDebugRequestInterceptor() { } public synchronized void resetInterceptors() { - this.interceptors.resetInterceptors(); + if(this.interceptors != null) + this.interceptors.resetInterceptors(); } public AuthScope getAuthScope() {