diff --git a/CHANGELOG.md b/CHANGELOG.md index da830c9..e99e185 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Update to use CMA 2.0.0, thus allowing 2.0.3 layer for lambda - Update build to use java 11 - To generate java 11 compatible UMMG schema POJOs, jsonschema2pojo shall make use of command line parameter: --target-version 1.11 +- **PODAAC-6169** + - SWOT iso.xml + - OPERA iso.xml + - SWOT archive.xml + - .mp + - SWOT CalVal XML + - Does/does not cross the IDL ### Deprecated ### Removed ### Fixed diff --git a/pom.xml b/pom.xml index 8cb545b..93a67b8 100755 --- a/pom.xml +++ b/pom.xml @@ -44,13 +44,13 @@ com.amazonaws aws-java-sdk-s3 - 1.12.641 + 1.12.701 com.amazonaws aws-java-sdk-secretsmanager - 1.12.544 + 1.12.701 org.apache.httpcomponents @@ -107,7 +107,7 @@ org.slf4j slf4j-reload4j - 1.7.36 + 2.0.13 com.vividsolutions @@ -120,17 +120,22 @@ 4.13.2 test + + com.fasterxml.jackson.core + jackson-databind + 2.17.0 + org.mockito mockito-core - 4.5.1 + 5.11.0 test org.mockito mockito-inline - 4.5.1 + 5.2.0 test @@ -213,8 +218,8 @@ maven-compiler-plugin 3.5.1 - 1.8 - 1.8 + 11 + 11 diff --git a/src/main/java/gov/nasa/cumulus/metadata/aggregator/MetadataAggregatorLambda.java b/src/main/java/gov/nasa/cumulus/metadata/aggregator/MetadataAggregatorLambda.java index 97d24cd..c5edb67 100644 --- a/src/main/java/gov/nasa/cumulus/metadata/aggregator/MetadataAggregatorLambda.java +++ b/src/main/java/gov/nasa/cumulus/metadata/aggregator/MetadataAggregatorLambda.java @@ -81,7 +81,7 @@ public String PerformFunction(String input, Context context) throws Exception { } /* - Typically should only have 1 file tagged with "Data" + Typically should only have 1 file tagged as "data" */ //data location String s3Location = null; diff --git a/src/main/java/gov/nasa/cumulus/metadata/aggregator/MetadataFilesToEcho.java b/src/main/java/gov/nasa/cumulus/metadata/aggregator/MetadataFilesToEcho.java index 405f71f..ad9288d 100644 --- a/src/main/java/gov/nasa/cumulus/metadata/aggregator/MetadataFilesToEcho.java +++ b/src/main/java/gov/nasa/cumulus/metadata/aggregator/MetadataFilesToEcho.java @@ -6,6 +6,7 @@ import java.io.IOException; import java.math.BigDecimal; import java.net.URISyntaxException; +import java.nio.charset.StandardCharsets; import java.text.SimpleDateFormat; import java.util.*; import java.util.regex.Matcher; @@ -99,7 +100,6 @@ public void readConfiguration(String file) throws IOException, ParseException { (Boolean) metadata.get("rangeIs360"), null, additionalAttributes); - } /** @@ -1081,7 +1081,7 @@ public void writeJson(String outputLocation) throws IOException, ParseException, URISyntaxException{ JSONObject granuleJson = createJson(); JSONUtils.cleanJSON(granuleJson); - FileUtils.writeStringToFile(new File(outputLocation), granuleJson.toJSONString()); + FileUtils.writeStringToFile(new File(outputLocation), granuleJson.toJSONString(), StandardCharsets.UTF_8); } public Dataset getDataset(){ diff --git a/src/main/java/gov/nasa/cumulus/metadata/aggregator/UMMGranuleFile.java b/src/main/java/gov/nasa/cumulus/metadata/aggregator/UMMGranuleFile.java index 5ca022c..ec6b380 100644 --- a/src/main/java/gov/nasa/cumulus/metadata/aggregator/UMMGranuleFile.java +++ b/src/main/java/gov/nasa/cumulus/metadata/aggregator/UMMGranuleFile.java @@ -63,6 +63,9 @@ public UMMGranuleFile(Granule granule, Dataset dataset, boolean rangeIs360) { this(granule, dataset,rangeIs360, new HashSet() ); } + public UMMGranuleFile() { + } + public UMMGranuleFile(Granule granule, Dataset dataset, boolean rangeIs360, HashSet inputIsoXMLSpatialTypeEnumHashSet) { this.granule = granule; diff --git a/src/test/java/gov/nasa/cumulus/metadata/test/MetadataFilesToEchoTest.java b/src/test/java/gov/nasa/cumulus/metadata/test/MetadataFilesToEchoTest.java index b65753a..77673c4 100644 --- a/src/test/java/gov/nasa/cumulus/metadata/test/MetadataFilesToEchoTest.java +++ b/src/test/java/gov/nasa/cumulus/metadata/test/MetadataFilesToEchoTest.java @@ -2,18 +2,19 @@ import static org.junit.Assert.*; import static org.junit.Assert.assertEquals; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.mockStatic; import java.io.File; import java.io.IOException; +import java.math.BigDecimal; import java.net.URISyntaxException; import com.google.gson.Gson; import com.google.gson.GsonBuilder; -import com.google.gson.JsonArray; -import com.google.gson.JsonObject; -import cumulus_message_adapter.message_parser.AdapterLogger; import gov.nasa.cumulus.metadata.aggregator.*; +import gov.nasa.cumulus.metadata.state.MENDsIsoXMLSpatialTypeEnum; import gov.nasa.cumulus.metadata.umm.adapter.UMMGCollectionAdapter; import gov.nasa.cumulus.metadata.umm.adapter.UMMGListAdapter; import gov.nasa.cumulus.metadata.umm.adapter.UMMGMapAdapter; @@ -27,9 +28,14 @@ import org.json.simple.JSONObject; import org.json.simple.parser.JSONParser; import org.json.simple.parser.ParseException; +import org.junit.After; +import org.junit.Before; import org.junit.Test; -import org.w3c.dom.Document; +import org.mockito.MockedStatic; import org.xml.sax.SAXException; +import org.mockito.Mockito; +import org.w3c.dom.Document; + import javax.xml.parsers.ParserConfigurationException; import javax.xml.xpath.XPath; @@ -42,7 +48,27 @@ public class MetadataFilesToEchoTest { + MockedStatic mockedCMRRestClientProvider = null; + @Before + public void initialize() throws URISyntaxException, ParseException, IOException{ + System.out.println("MetadataFilesToEchoTest constructor is being called"); + UMMGranuleFile spiedUMMGranuleFile = Mockito.spy(UMMGranuleFile.class); + Mockito.doReturn(true) + .when(spiedUMMGranuleFile) + .isSpatialValid(any()); + CMRLambdaRestClient mockedEchoLambdaRestClient= Mockito.mock(CMRLambdaRestClient.class); + Mockito.doReturn(true) + .when(mockedEchoLambdaRestClient) + .isUMMGSpatialValid(any(), any(), any()); + + mockedCMRRestClientProvider = mockStatic(CMRRestClientProvider.class); + mockedCMRRestClientProvider.when(CMRRestClientProvider::getLambdaRestClient).thenReturn(mockedEchoLambdaRestClient); + } + @After + public void cleanup(){ + mockedCMRRestClientProvider.close(); + } @Test public void testParseCommonHandlerFiles() { @@ -120,8 +146,10 @@ public void testCreateJson() } File file2 = new File(classLoader.getResource("20170408033000-JPL-L2P_GHRSST-SSTskin-MODIS_T-N-v02.0-fv01.0.nc.mp").getFile()); + JSONObject granuleJson=null; try { mfte.readCommonMetadataFile(file2.getAbsolutePath(), "s3://a/path/to/s3"); + granuleJson = mfte.createJson(); } catch (Exception e) { e.printStackTrace(); fail(); @@ -132,6 +160,7 @@ public void testCreateJson() JSONObject granule = mfte.createJson(); System.out.println(granule.toJSONString()); assertEquals("20170408033000-JPL-L2P_GHRSST-SSTskin-MODIS_T-N-v02.0-fv01.0", granule.get("GranuleUR")); + assertTrue(UnitTestUtil.compareFileWithGranuleJson("ummgResults/from_mp_file/20170408033000-JPL-L2P_GHRSST-SSTskin-MODIS_T-N-v02.0-fv01.0.json", granuleJson)); } @Test @@ -151,8 +180,10 @@ public void testCreateJsonWithOrbitNumber() } File file2 = new File(classLoader.getResource("RSS_SMAP_SSS_L2C_r00870_20150401T004312_2015091_FNL_V04.0.nc.mp").getFile()); + JSONObject granuleJson = null; try { mfte.readCommonMetadataFile(file2.getAbsolutePath(), "s3://a/path/to/s3"); + granuleJson = mfte.createJson(); } catch (Exception e) { e.printStackTrace(); fail(); @@ -165,6 +196,7 @@ public void testCreateJsonWithOrbitNumber() JSONArray orbitArray = (JSONArray) granule.get("OrbitCalculatedSpatialDomains"); Integer orbitNumber = (Integer) ((JSONObject) orbitArray.get(0)).get("OrbitNumber"); assertEquals(orbitNumber, new Integer(870)); + assertTrue(UnitTestUtil.compareFileWithGranuleJson("ummgResults/from_mp_file/RSS_SMAP_SSS_L2C_r00870_20150401T004312_2015091_FNL_V04.0.json", granuleJson)); } @Test @@ -176,23 +208,17 @@ public void testCreateJsonWithStartEndOrbitNumber() ClassLoader classLoader = getClass().getClassLoader(); File file = new File(classLoader.getResource("MODIS_T-JPL-L2P-v2014.0.cmr.cfg").getFile()); MetadataFilesToEcho mfte = new MetadataFilesToEcho(); - mfte.readConfiguration(file.getAbsolutePath()); - - File file2 = new File(classLoader.getResource("RSS_smap_SSS_L3_monthly_2015_04_FNL_v04.0.nc.mp").getFile()); - mfte.readCommonMetadataFile(file2.getAbsolutePath(), "s3://a/path/to/s3"); - - mfte.getGranule().setName("SMAP_RSS_L3_SSS_SMI_MONTHLY_V4"); - + mfte.readCommonMetadataFile(file2.getAbsolutePath(), "s3://a/path/to/s3"); JSONObject granule = mfte.createJson(); - System.out.println(granule.toJSONString()); JSONArray orbitArray = (JSONArray) granule.get("OrbitCalculatedSpatialDomains"); Integer beginOrbit = (Integer) ((JSONObject) orbitArray.get(0)).get("BeginOrbitNumber"); Integer endOrbit = (Integer) ((JSONObject) orbitArray.get(0)).get("EndOrbitNumber"); assertEquals(beginOrbit, new Integer("870")); assertEquals(endOrbit, new Integer("1308")); + assertTrue(UnitTestUtil.compareFileWithGranuleJson("ummgResults/from_mp_file/RSS_smap_SSS_L3_monthly_2015_04_FNL_v04.0_OrbitStartEnd.json", granule)); } @Test @@ -206,8 +232,10 @@ public void testCreateJsonWithCyclePass() File file2 = new File(classLoader.getResource("JA1_GPN_2PeP374_172_20120303_112035_20120303_121638.nc.mp").getFile()); + JSONObject granuleJson=null; try { mfte.readCommonMetadataFile(file2.getAbsolutePath(), "s3://a/path/to/s3"); + granuleJson = mfte.createJson(); } catch (Exception e) { e.printStackTrace(); fail(); @@ -221,6 +249,7 @@ public void testCreateJsonWithCyclePass() JSONObject track = (JSONObject) ((JSONObject) ((JSONObject) granule.get("SpatialExtent")).get("HorizontalSpatialDomain")).get("Track"); assertEquals(new Long(374), track.get("Cycle")); assertEquals(new Long(172), ((JSONObject) ((JSONArray) track.get("Passes")).get(0)).get("Pass")); + assertTrue(UnitTestUtil.compareFileWithGranuleJson("ummgResults/from_mp_file/JA1_GPN_2PeP374_172_20120303_112035_20120303_121638_withcyclepass.json", granuleJson)); } @Test @@ -232,25 +261,17 @@ public void testSwotArchive() File cfgFile = new File(classLoader.getResource("MODIS_T-JPL-L2P-v2014.0.cmr.cfg").getFile()); MetadataFilesToEcho mfte = new MetadataFilesToEcho(); - mfte.readConfiguration(cfgFile.getAbsolutePath()); mfte.readSwotArchiveXmlFile(file.getAbsolutePath()); - - mfte.getGranule().setName("SWOT_IVK_20210612T081400_20210612T072103_20210612T080137_O_APID1402"); - JSONObject granule = mfte.createJson(); - Gson gsonBuilder = new GsonBuilder().excludeFieldsWithoutExposeAnnotation() - .registerTypeHierarchyAdapter(Collection.class, new UMMGCollectionAdapter()) - .registerTypeHierarchyAdapter(List.class, new UMMGListAdapter()) - .registerTypeHierarchyAdapter(Map.class, new UMMGMapAdapter()) - .create(); - String jsonStr = gsonBuilder.toJson(granule); + assertEquals("SWOT_IVK_20210612T081400_20210612T072103_20210612T080137_O_APID1402", granule.get("GranuleUR")); JSONObject track = (JSONObject) ((JSONObject) ((JSONObject) granule.get("SpatialExtent")).get("HorizontalSpatialDomain")).get("Track"); assertEquals(new Long(22), track.get("Cycle")); assertEquals(new Long(33), ((JSONObject) ((JSONArray) track.get("Passes")).get(0)).get("Pass")); + assertTrue(UnitTestUtil.compareFileWithGranuleJson("ummgResults/swotArchiveXml/SWOT_IVK_20210612T081400_20210612T072103_20210612T080137_O_APID1402.PTM_1.archive.json", granule)); } @Test @@ -467,11 +488,14 @@ public void testReadIsoMendsMetadataFile_Pass_Cycle_LeadingZeros() throws IOExce } @Test - public void testReadSwotArchoveMetadataFile_Pass_Cycle_LeadingZeros() throws IOException, ParseException, XPathExpressionException, ParserConfigurationException, SAXException{ + public void testReadSwotArchiveMetadataFile_Pass_Cycle_LeadingZeros() throws + IOException, ParseException, XPathExpressionException, ParserConfigurationException, SAXException, URISyntaxException{ ClassLoader classLoader = getClass().getClassLoader(); File file = new File(classLoader.getResource("SWOT_INT_KCAL_Dyn_403_008_20230117T150452_20230117T155629_PIA0_01.archive.xml").getFile()); File cfgFile = new File(classLoader.getResource("MODIS_T-JPL-L2P-v2014.0.cmr.cfg").getFile()); MetadataFilesToEcho mfte = new MetadataFilesToEcho(true); + mfte.getGranule().setName("SWOT_INT_KCAL_Dyn_403_008_20230117T150452_20230117T155629_PIA0_01"); + mfte.readConfiguration(cfgFile.getAbsolutePath()); Document doc = null; XPath xpath = null; @@ -495,13 +519,12 @@ public void testReadSwotArchoveMetadataFile_Pass_Cycle_LeadingZeros() throws IOE @Test public void testReadIsoMendsMetadataFileAdditionalFields_publishAll() throws ParseException, IOException, URISyntaxException, XPathExpressionException, ParserConfigurationException, SAXException { - // Simple "publishAll" is true - ClassLoader classLoader = getClass().getClassLoader(); File file = new File(classLoader.getResource("OPERA_L3_DSWx_HLS_T14RNV_20210906T170251Z_20221026T184342Z_L8_30_v0.0.iso.xml").getFile()); File cfgFile = new File(classLoader.getResource("OPERA_L3_DSWX-HLS_PROVISIONAL_V0_test_1.cmr.cfg").getFile()); MetadataFilesToEcho mfte = new MetadataFilesToEcho(true); + mfte.getGranule().setName("OPERA_L3_DSWx_HLS_T14RNV_20210906T170251Z_20221026T184342Z_L8_30_v0.0"); Document doc = null; XPath xpath = null; @@ -510,15 +533,21 @@ public void testReadIsoMendsMetadataFileAdditionalFields_publishAll() throws Par doc = mfte.makeDoc(file.getAbsolutePath()); xpath = mfte.makeXpath(doc); IsoGranule isoGranule = mfte.readIsoMendsMetadataFile("s3://mybucket/mygranule.nc", doc, xpath); - + // use a unrelated .mp file to patch required field so mfte.createJson() would work. + File file2 = new File(classLoader.getResource("JA1_GPN_2PeP374_172_20120303_112035_20120303_121638.nc.mp").getFile()); + try { + mfte.readCommonMetadataFile(file2.getAbsolutePath(), "s3://a/path/to/s3"); + } catch (Exception e) { + e.printStackTrace(); + fail(); + } + mfte.getGranule().setName("OPERA_L3_DSWx_HLS_T14RNV_20210906T170251Z_20221026T184342Z_L8_30_v0.0"); + JSONObject granuleJson = mfte.createJson(); // Verify the values here: - // Confirm additional attributes has been filled List aat = isoGranule.getAdditionalAttributeTypes(); assertEquals(aat.size(), 11); - List keys = aat.stream().map(AdditionalAttributeType::getName).collect(Collectors.toList()); - List checkForKey = Arrays.asList("HlsDataset", "SensorProductID", "Accode", @@ -531,12 +560,12 @@ public void testReadIsoMendsMetadataFileAdditionalFields_publishAll() throws Par "PercentCloudCover", "MGRS_TILE_ID" ); - if(!checkForKey.equals(keys)){ fail(String.format("List mismatch:\n" + Arrays.toString(keys.toArray()) + "\n" + Arrays.toString(checkForKey.toArray()))); } + assertTrue(UnitTestUtil.compareFileWithGranuleJson("ummgResults/additionalAttributes/OPERA_L3_DSWx_HLS_T14RNV_20210906T170251Z_20221026T184342Z_L8_30_v0.0_publishAll.json", granuleJson)); } /** @@ -567,7 +596,6 @@ public void testReadIsoMendsMetadataFileNoAdditionalFieldsMGRS() throws ParserCo public void testReadIsoMendsMetadataFileAdditionalFields_appendFieldToJSON() throws ParseException, IOException, URISyntaxException { // publish all is set to true and having a dedicated field added to JSON (CloudCover (JSON) mapped to PercentCloudCover (XML)) - ClassLoader classLoader = getClass().getClassLoader(); File file = new File(classLoader.getResource("OPERA_L3_DSWx_HLS_T14RNV_20210906T170251Z_20221026T184342Z_L8_30_v0.0.iso.xml").getFile()); File cfgFile = new File(classLoader.getResource("OPERA_L3_DSWX-HLS_PROVISIONAL_V0_test_2.cmr.cfg").getFile()); @@ -579,6 +607,7 @@ public void testReadIsoMendsMetadataFileAdditionalFields_appendFieldToJSON() thr mfte.readConfiguration(cfgFile.getAbsolutePath()); doc = mfte.makeDoc(file.getAbsolutePath()); xpath = mfte.makeXpath(doc); + mfte.getGranule().setName("OPERA_L3_DSWx_HLS_T14RNV_20210906T170251Z_20221026T184342Z_L8_30_v0.0"); IsoGranule isoGranule = mfte.readIsoMendsMetadataFile("s3://mybucket/mygranule.nc", doc, xpath); File file2 = new File(classLoader.getResource("JA1_GPN_2PeP374_172_20120303_112035_20120303_121638.nc.mp").getFile()); @@ -588,9 +617,7 @@ public void testReadIsoMendsMetadataFileAdditionalFields_appendFieldToJSON() thr e.printStackTrace(); fail(); } - // Verify the values here: - // Confirm additional attributes has been filled List aat = isoGranule.getAdditionalAttributeTypes(); assertEquals(aat.size(), 11); // 10 additional attributes + MGRS_TILE_ID @@ -620,9 +647,7 @@ public void testReadIsoMendsMetadataFileAdditionalFields_appendFieldToJSON() thr e.printStackTrace(); fail(); } - - mfte.getGranule().setName("some_random_granule_name"); - + mfte.getGranule().setName("OPERA_L3_DSWx_HLS_T14RNV_20210906T170251Z_20221026T184342Z_L8_30_v0.0"); JSONObject granule = mfte.createJson(); Gson gsonBuilder = new GsonBuilder().excludeFieldsWithoutExposeAnnotation() .registerTypeHierarchyAdapter(Collection.class, new UMMGCollectionAdapter()) @@ -632,7 +657,6 @@ public void testReadIsoMendsMetadataFileAdditionalFields_appendFieldToJSON() thr String jsonStr = gsonBuilder.toJson(granule); // Ensure jsonStr has cloud coverage field (value from PercentCloudCover in iso.xml) - JSONParser parser = new JSONParser(); JSONObject resultJSON = (JSONObject) parser.parse(jsonStr); @@ -647,13 +671,12 @@ public void testReadIsoMendsMetadataFileAdditionalFields_appendFieldToJSON() thr e.printStackTrace(); fail(); } + assertTrue(UnitTestUtil.compareFileWithGranuleJson("ummgResults/additionalAttributes/OPERA_L3_DSWx_HLS_T14RNV_20210906T170251Z_20221026T184342Z_L8_30_v0.0.json", granule)); } @Test public void testReadIsoMendsMetadataFileAdditionalFields_publishSpecific() throws ParseException, IOException, URISyntaxException { - // PublishAll is false and publish list is filled in - ClassLoader classLoader = getClass().getClassLoader(); File file = new File(classLoader.getResource("OPERA_L3_DSWx_HLS_T14RNV_20210906T170251Z_20221026T184342Z_L8_30_v0.0.iso.xml").getFile()); File cfgFile = new File(classLoader.getResource("OPERA_L3_DSWX-HLS_PROVISIONAL_V0_test_3.cmr.cfg").getFile()); @@ -661,12 +684,14 @@ public void testReadIsoMendsMetadataFileAdditionalFields_publishSpecific() throw Document doc = null; XPath xpath = null; + JSONObject granuleJson = null; try { mfte.readConfiguration(cfgFile.getAbsolutePath()); doc = mfte.makeDoc(file.getAbsolutePath()); xpath = mfte.makeXpath(doc); IsoGranule isoGranule = mfte.readIsoMendsMetadataFile("s3://mybucket/mygranule.nc", doc, xpath); - + // Use a pre-saved .mp file to patch the UMMG so the mfte.createJson() won't fail. createJson() is needed to test + // generated json with pre-saved ummg File file2 = new File(classLoader.getResource("JA1_GPN_2PeP374_172_20120303_112035_20120303_121638.nc.mp").getFile()); try { mfte.readCommonMetadataFile(file2.getAbsolutePath(), "s3://a/path/to/s3"); @@ -674,9 +699,9 @@ public void testReadIsoMendsMetadataFileAdditionalFields_publishSpecific() throw e.printStackTrace(); fail(); } - + mfte.getGranule().setName("OPERA_L3_DSWx_HLS_T14RNV_20210906T170251Z_20221026T184342Z_L8_30_v0.0"); + granuleJson = mfte.createJson(); // Verify the values here: - // Confirm additional attributes has been filled List aat = isoGranule.getAdditionalAttributeTypes(); assertEquals(aat.size(), 2); @@ -695,13 +720,12 @@ public void testReadIsoMendsMetadataFileAdditionalFields_publishSpecific() throw e.printStackTrace(); fail(); } + assertTrue(UnitTestUtil.compareFileWithGranuleJson("ummgResults/additionalAttributes/OPERA_L3_DSWx_HLS_T14RNV_20210906T170251Z_20221026T184342Z_L8_30_v0.0_publishSpecific.json", granuleJson)); } @Test public void testReadIsoMendsMetadataFileAdditionalFields_publishAllWithSpecific() throws ParseException, IOException, URISyntaxException { - // This case is when publishAll is True but somehow a publish list is set also; just publish all then - ClassLoader classLoader = getClass().getClassLoader(); File file = new File(classLoader.getResource("OPERA_L3_DSWx_HLS_T14RNV_20210906T170251Z_20221026T184342Z_L8_30_v0.0.iso.xml").getFile()); File cfgFile = new File(classLoader.getResource("OPERA_L3_DSWX-HLS_PROVISIONAL_V0_test_4.cmr.cfg").getFile()); @@ -709,6 +733,7 @@ public void testReadIsoMendsMetadataFileAdditionalFields_publishAllWithSpecific( Document doc = null; XPath xpath = null; + JSONObject granuleJson = null; try { mfte.readConfiguration(cfgFile.getAbsolutePath()); doc = mfte.makeDoc(file.getAbsolutePath()); @@ -722,9 +747,8 @@ public void testReadIsoMendsMetadataFileAdditionalFields_publishAllWithSpecific( e.printStackTrace(); fail(); } - + granuleJson = mfte.createJson(); // Verify the values here: - // Confirm additional attributes has been filled List aat = isoGranule.getAdditionalAttributeTypes(); assertEquals(aat.size(), 11); @@ -754,13 +778,13 @@ public void testReadIsoMendsMetadataFileAdditionalFields_publishAllWithSpecific( e.printStackTrace(); fail(); } + assertTrue(UnitTestUtil.compareFileWithGranuleJson("ummgResults/additionalAttributes/OPERA_L3_DSWx_HLS_T14RNV_20210906T170251Z_20221026T184342Z_L8_30_v0.0_publishAllWithSpecific.json", granuleJson)); } @Test public void testReadIsoMendsMetadataFileAdditionalFields_publishAllEmptyCatchError() throws ParseException, IOException, URISyntaxException { // This case is when publishAll key doesn't exist, should throw exception - ClassLoader classLoader = getClass().getClassLoader(); File file = new File(classLoader.getResource("OPERA_L3_DSWx_HLS_T14RNV_20210906T170251Z_20221026T184342Z_L8_30_v0.0.iso.xml").getFile()); File cfgFile = new File(classLoader.getResource("OPERA_L3_DSWX-HLS_PROVISIONAL_V0_test_5.cmr.cfg").getFile()); @@ -784,7 +808,6 @@ public void testReadIsoMendsMetadataFileAdditionalFields_publishAllEmptyCatchErr public void testReadIsoMendsMetadataFileAdditionalFields_publishAllEmptyCatchError_2() throws ParseException, IOException, URISyntaxException { // This case is when publishAll key doesn't exist, should throw exception - ClassLoader classLoader = getClass().getClassLoader(); File file = new File(classLoader.getResource("OPERA_L3_DSWx_HLS_T14RNV_20210906T170251Z_20221026T184342Z_L8_30_v0.0.iso.xml").getFile()); File cfgFile = new File(classLoader.getResource("OPERA_L3_DSWX-HLS_PROVISIONAL_V0_test_6.cmr.cfg").getFile()); @@ -806,9 +829,7 @@ public void testReadIsoMendsMetadataFileAdditionalFields_publishAllEmptyCatchErr @Test public void testReadIsoMendsMetadataFileAdditionalFields_publishAllEmptyCatchError_3() throws ParseException, IOException, URISyntaxException { - // This case is when publishAll key doesn't exist, should throw exception - ClassLoader classLoader = getClass().getClassLoader(); File file = new File(classLoader.getResource("OPERA_L3_DSWx_HLS_T14RNV_20210906T170251Z_20221026T184342Z_L8_30_v0.0.iso.xml").getFile()); File cfgFile = new File(classLoader.getResource("OPERA_L3_DSWX-HLS_PROVISIONAL_V0_test_7.cmr.cfg").getFile()); @@ -833,11 +854,10 @@ public void testReadIsoMendsMetadataFileAdditionalFields_publishAllEmptyCatchErr } catch (Exception e) { fail("Some issue when creating mfte"); } - + JSONObject granule = null; try{ mfte.getGranule().setName("some_random_granule_name"); - - JSONObject granule = mfte.createJson(); + granule = mfte.createJson(); Gson gsonBuilder = new GsonBuilder().excludeFieldsWithoutExposeAnnotation() .registerTypeHierarchyAdapter(Collection.class, new UMMGCollectionAdapter()) .registerTypeHierarchyAdapter(List.class, new UMMGListAdapter()) @@ -847,13 +867,13 @@ public void testReadIsoMendsMetadataFileAdditionalFields_publishAllEmptyCatchErr } catch (Exception e){ fail("Issue when generating JSON"); } + assertTrue(UnitTestUtil.compareFileWithGranuleJson("ummgResults/additionalAttributes/OPERA_L3_DSWx_HLS_T14RNV_20210906T170251Z_20221026T184342Z_L8_30_v0.0_publishAllEmptyCatchError_3.json", granule)); } @Test public void testReadIsoMendsMetadataFileAdditionalFields_appendFieldToJSON_String() throws ParseException, IOException, URISyntaxException { // publish all is set to true and having a dedicated field added to JSON (CloudCover (JSON) mapped to PercentCloudCover (XML)) - ClassLoader classLoader = getClass().getClassLoader(); File file = new File(classLoader.getResource("OPERA_L3_DSWx_HLS_T14RNV_20210906T170251Z_20221026T184342Z_L8_30_v0.0.iso.xml").getFile()); File cfgFile = new File(classLoader.getResource("OPERA_L3_DSWX-HLS_PROVISIONAL_V0_test_8.cmr.cfg").getFile()); @@ -861,6 +881,7 @@ public void testReadIsoMendsMetadataFileAdditionalFields_appendFieldToJSON_Strin Document doc = null; XPath xpath = null; + JSONObject granuleJson = null; try { mfte.readConfiguration(cfgFile.getAbsolutePath()); doc = mfte.makeDoc(file.getAbsolutePath()); @@ -874,9 +895,8 @@ public void testReadIsoMendsMetadataFileAdditionalFields_appendFieldToJSON_Strin e.printStackTrace(); fail(); } - + granuleJson = mfte.createJson(); // Verify the values here: - // Confirm additional attributes has been filled List aat = isoGranule.getAdditionalAttributeTypes(); assertEquals(aat.size(), 2); @@ -922,6 +942,7 @@ public void testReadIsoMendsMetadataFileAdditionalFields_appendFieldToJSON_Strin e.printStackTrace(); fail(); } + assertTrue(UnitTestUtil.compareFileWithGranuleJson("ummgResults/additionalAttributes/OPERA_L3_DSWx_HLS_T14RNV_20210906T170251Z_20221026T184342Z_L8_30_v0.0_appendFieldToJSON_String.json", granuleJson)); } @Test @@ -968,5 +989,214 @@ public void testCreateJsonSwotCalVal() throws IOException, ParseException, XPath assert -123.029 == east; assert 44.506 == south; assert 44.697 == north; + // load pre-saved file and compare with generated granule JSONObject + // SWOTCalVal_WM_ADCP_L0_RiverRay1_20220727T191701_20220727T192858_20220920T142800_swotCalVal_ummg.json + // load pre-saved file and perform json comparison + assertTrue(UnitTestUtil.compareFileWithGranuleJson("ummgResults/swotCalVal/SWOTCalVal_WM_ADCP_L0_RiverRay1_20220727T191701_20220727T192858_20220920T142800_swotCalVal_ummg.json", granule)); + } + @Test + public void testSWOTCreateJsonSWOTIsoXMLSpatialType() throws IOException, ParseException, XPathExpressionException, ParserConfigurationException, SAXException, URISyntaxException { + // Create isoXmlSpatial Hashtable which contains footprint, orbit then passed the hashtable to MetadataFilesToEcho contructor + MetadataAggregatorLambda lambda = new MetadataAggregatorLambda(); + org.json.simple.JSONArray array = new JSONArray(); + array.add("footprint"); + array.add("orbit"); + array.add("bbox"); + + HashSet h = lambda.createIsoXMLSpatialTypeSet(array); + assertTrue(h.contains(MENDsIsoXMLSpatialTypeEnum.FOOTPRINT)); + assertTrue(h.contains(MENDsIsoXMLSpatialTypeEnum.ORBIT)); + assertTrue(h.contains(MENDsIsoXMLSpatialTypeEnum.BBOX)); + assertFalse(h.contains(MENDsIsoXMLSpatialTypeEnum.NONE)); + + ClassLoader classLoader = getClass().getClassLoader(); + File file = new File(classLoader.getResource("swotIsoXMLSpatialTypeTestData/SWOT_L2_LR_SSH_Basic_006_143_20231107T150730_20231107T155607_PIB0_01.nc.iso.xml").getFile()); + + // constructor to set isIso =true and the isoXmlSpatialHashtable + MetadataFilesToEcho mfte = new MetadataFilesToEcho(true, h); + mfte.getGranule().setName("SWOT_L2_LR_SSH_Basic_006_143_20231107T150730_20231107T155607_PIB0_01"); + File cfgFile = new File(classLoader.getResource("MODIS_T-JPL-L2P-v2014.0.cmr.cfg").getFile()); + mfte.readConfiguration(cfgFile.getAbsolutePath()); + mfte.readIsoMetadataFile(file.getAbsolutePath(), "s3://fake_bucket/fake_dir/fake.nc.iso.xml"); + + JSONObject granule = mfte.createJson(); + JSONArray polygonPoints =((JSONArray)((JSONObject) ((JSONObject)((JSONArray)((JSONObject)((JSONObject)((JSONObject)granule + .get("SpatialExtent")) + .get("HorizontalSpatialDomain")) + .get("Geometry")) + .get("GPolygons")).get(0)).get("Boundary")).get("Points")); + Double latitude=(Double)((JSONObject)polygonPoints.get(0)).get("Latitude"); + Double longitude=(Double)((JSONObject)polygonPoints.get(0)).get("Longitude"); + assert latitude.doubleValue() ==-77.089598228; + assert longitude.doubleValue() == -121.56652283899999; + + latitude=(Double)((JSONObject)polygonPoints.get(27)).get("Latitude"); + longitude=(Double)((JSONObject)polygonPoints.get(27)).get("Longitude"); + assert latitude.doubleValue()==56.734470077; + assert longitude.doubleValue()==-21.668558564000023; + + latitude=(Double)((JSONObject)polygonPoints.get(64)).get("Latitude"); + longitude=(Double)((JSONObject)polygonPoints.get(64)).get("Longitude"); + assert latitude.doubleValue()==-77.089598228; + assert longitude.doubleValue()== -121.56652283899999; + + JSONObject orbit = ((JSONObject)((JSONObject)((JSONObject)granule + .get("SpatialExtent")) + .get("HorizontalSpatialDomain")) + .get("Orbit")); + assert ((Double)orbit.get("StartLatitude"))==-77.66; //-77.66 + assert ((Double)orbit.get("EndLatitude"))==77.66;// -> {Double@5567} 77.66 + assert ((Double)orbit.get("AscendingCrossing"))==-38.05; //-> {Double@5569} -38.05 + assertTrue(StringUtils.equals((String)orbit.get("StartDirection"), "A")); //-> A + assertTrue(StringUtils.equals((String)orbit.get("EndDirection"), "A")); //EndDirection -> A + + JSONObject bbox = (JSONObject)((JSONArray)((JSONObject)((JSONObject)((JSONObject)granule + .get("SpatialExtent")) + .get("HorizontalSpatialDomain")) + .get("Geometry")) + .get("BoundingRectangles")).get(0); + assert ((BigDecimal)bbox.get("WestBoundingCoordinate")).compareTo(new BigDecimal("-121.76947499999999990905052982270717620849609375")) ==0; + assert ((BigDecimal)bbox.get("SouthBoundingCoordinate")).compareTo(new BigDecimal("-78.271941999999995687176124192774295806884765625"))==0; + assert ((BigDecimal)bbox.get("EastBoundingCoordinate")).compareTo(new BigDecimal("45.675058000000035463017411530017852783203125"))==0; + assert ((BigDecimal)bbox.get("NorthBoundingCoordinate")).compareTo(new BigDecimal("78.272067999999990206561051309108734130859375"))==0; + + + // verify the pre-saved ummg.json file is equal to the granule json just built + assertTrue(UnitTestUtil.compareFileWithGranuleJson("ummgResults/swotIsoXMLSpatialType/SWOT_L2_LR_SSH_Basic_006_143_20231107T150730_20231107T155607_PIB0_01_footprintOrbitBBox.json", granule)); + /** + * Test isoXMLSpatial:[footprint] + */ + clearVariables4IsoXMLSpatialTest(array, h, granule); // clear variables first + array.add("footprint"); + h = lambda.createIsoXMLSpatialTypeSet(array); + assertTrue(h.contains(MENDsIsoXMLSpatialTypeEnum.FOOTPRINT)); + assertFalse(h.contains(MENDsIsoXMLSpatialTypeEnum.ORBIT)); + assertFalse(h.contains(MENDsIsoXMLSpatialTypeEnum.BBOX)); + assertFalse(h.contains(MENDsIsoXMLSpatialTypeEnum.NONE)); + mfte = new MetadataFilesToEcho(true, h); + mfte.getGranule().setName("SWOT_L2_LR_SSH_Basic_006_143_20231107T150730_20231107T155607_PIB0_01"); + cfgFile = new File(classLoader.getResource("MODIS_T-JPL-L2P-v2014.0.cmr.cfg").getFile()); + mfte.readConfiguration(cfgFile.getAbsolutePath()); + mfte.readIsoMetadataFile(file.getAbsolutePath(), "s3://fake_bucket/fake_dir/fake.nc.iso.xml"); + granule = mfte.createJson(); + polygonPoints =((JSONArray)((JSONObject) ((JSONObject)((JSONArray)((JSONObject)((JSONObject)((JSONObject)granule + .get("SpatialExtent")) + .get("HorizontalSpatialDomain")) + .get("Geometry")) + .get("GPolygons")).get(0)).get("Boundary")).get("Points")); + latitude=(Double)((JSONObject)polygonPoints.get(0)).get("Latitude"); + longitude=(Double)((JSONObject)polygonPoints.get(0)).get("Longitude"); + assert latitude.doubleValue() ==-77.089598228; + assert longitude.doubleValue() == -121.56652283899999; + + latitude=(Double)((JSONObject)polygonPoints.get(27)).get("Latitude"); + longitude=(Double)((JSONObject)polygonPoints.get(27)).get("Longitude"); + assert latitude.doubleValue()==56.734470077; + assert longitude.doubleValue()==-21.668558564000023; + + latitude=(Double)((JSONObject)polygonPoints.get(64)).get("Latitude"); + longitude=(Double)((JSONObject)polygonPoints.get(64)).get("Longitude"); + assert latitude.doubleValue()==-77.089598228; + assert longitude.doubleValue()== -121.56652283899999; + + orbit = ((JSONObject)((JSONObject)((JSONObject)granule + .get("SpatialExtent")) + .get("HorizontalSpatialDomain")) + .get("Orbit")); + assert orbit==null; + + bbox = (JSONObject) (((JSONObject)((JSONObject)((JSONObject) granule + .get("SpatialExtent")) + .get("HorizontalSpatialDomain")) + .get("Geometry")) + .get("BoundingRectangles")); + assert bbox == null; + // load pre-saved file and perform json comparison + assertTrue(UnitTestUtil.compareFileWithGranuleJson("ummgResults/swotIsoXMLSpatialType/SWOT_L2_LR_SSH_Basic_006_143_20231107T150730_20231107T155607_PIB0_01_footprint.json", granule)); + /** + * Test isoXMLSpatial:[bbox] + */ + clearVariables4IsoXMLSpatialTest(array, h, granule); // clear variables first + array.add("bbox"); + h = lambda.createIsoXMLSpatialTypeSet(array); + assertFalse(h.contains(MENDsIsoXMLSpatialTypeEnum.FOOTPRINT)); + assertFalse(h.contains(MENDsIsoXMLSpatialTypeEnum.ORBIT)); + assertTrue(h.contains(MENDsIsoXMLSpatialTypeEnum.BBOX)); + assertFalse(h.contains(MENDsIsoXMLSpatialTypeEnum.NONE)); + mfte = new MetadataFilesToEcho(true, h); + mfte.getGranule().setName("SWOT_L2_LR_SSH_Basic_006_143_20231107T150730_20231107T155607_PIB0_01"); + cfgFile = new File(classLoader.getResource("MODIS_T-JPL-L2P-v2014.0.cmr.cfg").getFile()); + mfte.readConfiguration(cfgFile.getAbsolutePath()); + mfte.readIsoMetadataFile(file.getAbsolutePath(), "s3://fake_bucket/fake_dir/fake.nc.iso.xml"); + granule = mfte.createJson(); + JSONArray GPolygons = (JSONArray)((JSONObject)((JSONObject)((JSONObject)granule + .get("SpatialExtent")) + .get("HorizontalSpatialDomain")) + .get("Geometry")) + .get("GPolygons"); + assert GPolygons ==null; + + orbit = ((JSONObject)((JSONObject)((JSONObject)granule + .get("SpatialExtent")) + .get("HorizontalSpatialDomain")) + .get("Orbit")); + assert orbit==null; + + bbox = (JSONObject)((JSONArray)((JSONObject)((JSONObject)((JSONObject)granule + .get("SpatialExtent")) + .get("HorizontalSpatialDomain")) + .get("Geometry")) + .get("BoundingRectangles")).get(0); + assert ((BigDecimal)bbox.get("WestBoundingCoordinate")).compareTo(new BigDecimal("-121.76947499999999990905052982270717620849609375")) ==0; + assert ((BigDecimal)bbox.get("SouthBoundingCoordinate")).compareTo(new BigDecimal("-78.271941999999995687176124192774295806884765625"))==0; + assert ((BigDecimal)bbox.get("EastBoundingCoordinate")).compareTo(new BigDecimal("45.675058000000035463017411530017852783203125"))==0; + assert ((BigDecimal)bbox.get("NorthBoundingCoordinate")).compareTo(new BigDecimal("78.272067999999990206561051309108734130859375"))==0; + // load pre-saved file and perform json comparison + assertTrue(UnitTestUtil.compareFileWithGranuleJson("ummgResults/swotIsoXMLSpatialType/SWOT_L2_LR_SSH_Basic_006_143_20231107T150730_20231107T155607_PIB0_01_bbox.json", granule)); + /** + * Test isoXMLSpatial:[orbit] + */ + clearVariables4IsoXMLSpatialTest(array, h, granule); // clear variables first + array.add("orbit"); + h = lambda.createIsoXMLSpatialTypeSet(array); + assertFalse(h.contains(MENDsIsoXMLSpatialTypeEnum.FOOTPRINT)); + assertTrue(h.contains(MENDsIsoXMLSpatialTypeEnum.ORBIT)); + assertFalse(h.contains(MENDsIsoXMLSpatialTypeEnum.BBOX)); + assertFalse(h.contains(MENDsIsoXMLSpatialTypeEnum.NONE)); + mfte = new MetadataFilesToEcho(true, h); + mfte.getGranule().setName("SWOT_L2_LR_SSH_Basic_006_143_20231107T150730_20231107T155607_PIB0_01"); + cfgFile = new File(classLoader.getResource("MODIS_T-JPL-L2P-v2014.0.cmr.cfg").getFile()); + mfte.readConfiguration(cfgFile.getAbsolutePath()); + mfte.readIsoMetadataFile(file.getAbsolutePath(), "s3://fake_bucket/fake_dir/fake.nc.iso.xml"); + granule = mfte.createJson(); + JSONObject geometry = ((JSONObject)((JSONObject)((JSONObject)granule + .get("SpatialExtent")) + .get("HorizontalSpatialDomain")) + .get("Geometry")); + assert geometry ==null; + + orbit = ((JSONObject)((JSONObject)((JSONObject)granule + .get("SpatialExtent")) + .get("HorizontalSpatialDomain")) + .get("Orbit")); + assert ((Double)orbit.get("StartLatitude"))==-77.66; //-77.66 + assert ((Double)orbit.get("EndLatitude"))==77.66;// -> {Double@5567} 77.66 + assert ((Double)orbit.get("AscendingCrossing"))==-38.05; //-> {Double@5569} -38.05 + assertTrue(StringUtils.equals((String)orbit.get("StartDirection"), "A")); //-> A + assertTrue(StringUtils.equals((String)orbit.get("EndDirection"), "A")); //EndDirection -> A + // No Geometry object since there is neither footprint nor bbox + bbox = (((JSONObject)((JSONObject)((JSONObject) granule + .get("SpatialExtent")) + .get("HorizontalSpatialDomain")) + .get("Geometry"))); + assert bbox == null; + // load pre-saved file and perform json comparison + assertTrue(UnitTestUtil.compareFileWithGranuleJson("ummgResults/swotIsoXMLSpatialType/SWOT_L2_LR_SSH_Basic_006_143_20231107T150730_20231107T155607_PIB0_01_orbit.json", granule)); + } + + private void clearVariables4IsoXMLSpatialTest(JSONArray isoXMLSpatialArray, HashSet isoXMLSpatialHashSet, JSONObject granule) { + isoXMLSpatialArray.clear(); + isoXMLSpatialHashSet.clear(); + granule.clear(); } -} +} \ No newline at end of file diff --git a/src/test/java/gov/nasa/cumulus/metadata/test/UMMTest.java b/src/test/java/gov/nasa/cumulus/metadata/test/UMMTest.java index 063ac8f..cbca1d3 100644 --- a/src/test/java/gov/nasa/cumulus/metadata/test/UMMTest.java +++ b/src/test/java/gov/nasa/cumulus/metadata/test/UMMTest.java @@ -23,6 +23,8 @@ import org.json.simple.JSONObject; import org.json.simple.parser.JSONParser; import org.json.simple.parser.ParseException; +import org.junit.After; +import org.junit.Before; import org.junit.Test; import org.mockito.MockedStatic; import org.xml.sax.SAXException; @@ -30,6 +32,27 @@ public class UMMTest { + MockedStatic mockedCMRRestClientProvider = null; + @Before + public void initialize() throws URISyntaxException, ParseException, IOException{ + System.out.println("MetadataFilesToEchoTest constructor is being called"); + UMMGranuleFile spiedUMMGranuleFile = Mockito.spy(UMMGranuleFile.class); + Mockito.doReturn(true) + .when(spiedUMMGranuleFile) + .isSpatialValid(any()); + CMRLambdaRestClient mockedEchoLambdaRestClient= Mockito.mock(CMRLambdaRestClient.class); + Mockito.doReturn(true) + .when(mockedEchoLambdaRestClient) + .isUMMGSpatialValid(any(), any(), any()); + + mockedCMRRestClientProvider = mockStatic(CMRRestClientProvider.class); + mockedCMRRestClientProvider.when(CMRRestClientProvider::getLambdaRestClient).thenReturn(mockedEchoLambdaRestClient); + } + + @After + public void cleanup(){ + mockedCMRRestClientProvider.close(); + } @Test public void testIsoRequiredFields() throws IOException, ParseException, XPathExpressionException, ParserConfigurationException, SAXException, URISyntaxException { /* @@ -449,7 +472,6 @@ public void testSentinelManifestOverIDL() String granuleId ="S6A_P4_2__LR_STD__ST_022_132_20210619T002429_20210619T012042_F02"; JSONObject umm = parseXfduManifest(testFile, testConfigFile, granuleId); - //SpatialExtent JSONObject hsd = (JSONObject) ((JSONObject) umm.get("SpatialExtent" )).get("HorizontalSpatialDomain" ); @@ -487,6 +509,8 @@ public void testSentinelManifestOverIDL() lastPoint = (JSONObject) pnts.get(29); assertEquals(Double.valueOf(56.013938), ((Double) lastPoint.get("Latitude" ))); assertEquals(Double.valueOf(-171.655155), ((Double) lastPoint.get("Longitude" ))); + + assertTrue(UnitTestUtil.compareFileWithGranuleJson("ummgResults/sentinel6/S6A_P4_2__LR_STD__ST_022_132_20210619T002429_20210619T012042_F02_overIde.json",umm)); } @Test @@ -499,7 +523,6 @@ public void testSentinelManifestL0TooFewCoordinates() String granuleId ="S6A_P4_2__LR_STD__ST_022_132_20210619T002429_20210619T012042_F02"; JSONObject umm = parseXfduManifest(testFile, testConfigFile, granuleId); - //SpatialExtent JSONObject hsd = (JSONObject) ((JSONObject) umm.get("SpatialExtent" )).get("HorizontalSpatialDomain" ); JSONArray boundingCoordinates = (JSONArray) ((JSONObject)hsd.get("Geometry")).get("BoundingRectangles"); @@ -545,6 +568,7 @@ public void testSentinelManifestNotOverIDL() JSONObject lastPoint = (JSONObject) pnts.get(31); assertEquals(Double.valueOf(-62.663981), ((Double) lastPoint.get("Latitude" ))); assertEquals(Double.valueOf(2.525361), ((Double) lastPoint.get("Longitude" ))); + assertTrue(UnitTestUtil.compareFileWithGranuleJson("ummgResults/sentinel6/S6A_P4_2__LR_STD__ST_022_131_20210618T232816_20210619T002429_F02_notOverIDL.json", umm)); } @Test @@ -742,48 +766,6 @@ public void testSentinelManifestNoProductName() assertNull(umm.get("AdditionalAttributes")); } - private JSONObject parseXfduManifest(String testFile, String testConfigFile, String granuleId) - throws XPathExpressionException, ParserConfigurationException, - IOException, SAXException, ParseException, java.text.ParseException, URISyntaxException { - String testDir = "src/test/resources"; - - String testFilePath = testDir + File.separator + testFile; - - String testConfigFilePath = testDir + File.separator + testConfigFile; - - MetadataFilesToEcho mtfe = new MetadataFilesToEcho(false); - - mtfe.readConfiguration(testConfigFilePath); - mtfe.readSentinelManifest(testFilePath); - - mtfe.getGranule().setName(granuleId); - - // Mock the isSpatial valid function within UMMGFile class - - UMMGranuleFile mockedUMMGranuleFile = Mockito.mock(UMMGranuleFile.class); - Mockito.spy(mockedUMMGranuleFile); - Mockito.doReturn(true) - .when(mockedUMMGranuleFile) - .isSpatialValid(any()); - - CMRLambdaRestClient mockedEchoLambdaRestClient= Mockito.mock(CMRLambdaRestClient.class); - Mockito.doReturn(true) - .when(mockedEchoLambdaRestClient) - .isUMMGSpatialValid(any(), any(), any()); - - MockedStatic mockedECHORestClientProvider = mockStatic(CMRRestClientProvider.class); - when(CMRRestClientProvider.getLambdaRestClient()).thenReturn(mockedEchoLambdaRestClient); - - //write UMM-G to file - mtfe.writeJson(testDir + "/" + granuleId + ".cmr.json"); - - //the CMR file should have the following values... - JSONParser parser = new JSONParser(); - Object obj = parser.parse(new FileReader(testDir + "/" + granuleId + ".cmr.json")); - // close the static mock. Otherwise, re-register static mock will cause exception. - mockedECHORestClientProvider.close(); - return (JSONObject) obj; - } @Test public void testGetUmmChecksumAlgorithm() { @@ -846,4 +828,28 @@ public void testCreateTrack() throws ParseException{ String tile = (String)tiles.get(1); assertTrue(StringUtils.equals(tile, "tile2-2")); } + + private JSONObject parseXfduManifest(String testFile, String testConfigFile, String granuleId) + throws XPathExpressionException, ParserConfigurationException, + IOException, SAXException, ParseException, java.text.ParseException, URISyntaxException { + String testDir = "src/test/resources"; + String testFilePath = testDir + File.separator + testFile; + String testConfigFilePath = testDir + File.separator + testConfigFile; + + MetadataFilesToEcho mtfe = new MetadataFilesToEcho(false); + + mtfe.readConfiguration(testConfigFilePath); + mtfe.readSentinelManifest(testFilePath); + + mtfe.getGranule().setName(granuleId); + //write UMM-G to file + mtfe.writeJson(testDir + "/" + granuleId + ".cmr.json"); + + //the CMR file should have the following values... + JSONParser parser = new JSONParser(); + Object obj = parser.parse(new FileReader(testDir + "/" + granuleId + ".cmr.json")); + return (JSONObject) obj; + } + + } diff --git a/src/test/java/gov/nasa/cumulus/metadata/test/UnitTestUtil.java b/src/test/java/gov/nasa/cumulus/metadata/test/UnitTestUtil.java new file mode 100644 index 0000000..eda4a77 --- /dev/null +++ b/src/test/java/gov/nasa/cumulus/metadata/test/UnitTestUtil.java @@ -0,0 +1,31 @@ +package gov.nasa.cumulus.metadata.test; + +import com.fasterxml.jackson.databind.ObjectMapper; +import org.apache.commons.io.FileUtils; +import org.json.simple.JSONObject; +import org.json.simple.parser.JSONParser; +import org.json.simple.parser.ParseException; + +import java.io.File; +import java.io.IOException; +import java.nio.charset.StandardCharsets; + +import static org.junit.Assert.assertEquals; + +public class UnitTestUtil { + public static boolean compareFileWithGranuleJson(String filePath, JSONObject granuleJson) throws + IOException, ParseException { + ClassLoader classLoader = UnitTestUtil.class.getClassLoader(); + File preSavedJsonFile = new File(classLoader.getResource(filePath).getFile()); + String readInJsonStr = FileUtils.readFileToString(preSavedJsonFile, StandardCharsets.UTF_8); + JSONParser parser = new JSONParser(); + ObjectMapper mapper = new ObjectMapper(); + JSONObject readInJsonObj = (JSONObject) parser.parse(readInJsonStr); + // remove ProviderDates structure because it always has most current datetime + // the ProviderDates saved in file is different than the provider dates generated on the fly + granuleJson.remove("ProviderDates"); + readInJsonObj.remove("ProviderDates"); + assertEquals(mapper.readTree(readInJsonObj.toJSONString()), mapper.readTree(granuleJson.toJSONString())); + return true; // if reached this point, return true + } +} diff --git a/src/test/resources/swotIsoXMLSpatialTypeTestData/SWOT_L2_LR_SSH_Basic_006_143_20231107T150730_20231107T155607_PIB0_01.nc.iso.xml b/src/test/resources/swotIsoXMLSpatialTypeTestData/SWOT_L2_LR_SSH_Basic_006_143_20231107T150730_20231107T155607_PIB0_01.nc.iso.xml new file mode 100644 index 0000000..581cf6a --- /dev/null +++ b/src/test/resources/swotIsoXMLSpatialTypeTestData/SWOT_L2_LR_SSH_Basic_006_143_20231107T150730_20231107T155607_PIB0_01.nc.iso.xml @@ -0,0 +1,2608 @@ + + + + + + + + + + SWOT_L2_LR_SSH_Basic_006_143_20231107T150730_20231107T155607_PIB0_01.nc + + + + eng + + + + utf8 + + + + dataset + + + + + + 2023-11-10T01:03:13.602794Z + + + + ISO 19115-2 Geographic Information - Metadata Part 2 Extensions for imagery and gridded data + + + ISO 19115-2:2009(E) + + + + + + + + + + + + + + + + + 2023-11-10T01:03:13.602794Z + + + creation + + + + + + + + + + + + + + + SWOT_L2_LR_SSH_Basic_006_143_20231107T150730_20231107T155607_PIB0_01.nc + + + gov.nasa.esdis.umm.producergranuleid + + + ProducerGranuleId + + + + + + + + + + + + + + PIB0 + + + gov.nasa.esdis.umm.crid + + + CRID + + + + + + + + ICV01 CollectionVersion filler + + + gov.nasa.esdis.umm.otherid + + + OtherId: ScienceAlgorithmVersionId + + + + + + + 4.3.0 + + + gov.nasa.esdis.umm.otherid + + + OtherId: PGEVersionId + + + + + + + 1.1 + + + gov.nasa.esdis.umm.otherid + + + OtherId: SASVersionId + + + + + + + 01 + + + gov.nasa.esdis.umm.otherid + + + OtherId: ProductCounter + + + + + + + + + + + + + + + + + asNeeded + + + ReprocessingPlanned: None + + + + + + + + + https://webmap.ornl.gov/sdat/pimg/TBD + + + Size: TBD> SizeUnit: KB Description: TBD + + + Format: PNG MimeType: image/png + + + + + + + + https://webmap.ornl.gov/sdat/pimg/TBD + + + Size: TBD> SizeUnit: KB Description: TBD + + + Format: PNG MimeType: image/png + + + + + + + + + + + SWOT + + + Surface Water Ocean Topography + + + + project + + + + + NASA Project Keywords + + + + + + NASA + + + User Support Office + + + + + + + https://support.earthdata.nasa.gov/ + + + Earthdata Support + + + File an issue or provide feedback + + + information + + + + + + + custodian + + + + + + + + + + + + + Commissioning Phase + + + Calibration Phase + + + Science Ops Phase + + + campaign + + + + + + + + + Space-based Platforms + + + Earth Observation Satellites + + + SWOT + + + platform + + + + + NASA Platform Keywords + + + + + + NASA + + + User Support Office + + + + + + + https://support.earthdata.nasa.gov/ + + + Earthdata Support + + + File an issue or provide feedback + + + information + + + + + + + custodian + + + + + + + + + + + + + Earth Remote Sensing Instruments + + + Active Remote Sensing + + + Imaging Radars + + + KaRIn + + + instrument + + + + + NASA Instrument Keywords + + + + + + NASA + + + User Support Office + + + + + + + https://support.earthdata.nasa.gov/ + + + Earthdata Support + + + File an issue or provide feedback + + + information + + + + + + + custodian + + + + + + + + + + + + + + + + + + PGE_L2_LR_SSH + + + gov.nasa.esdis.umm.collectionshortname + + + CollectionShortName + + + + + LargerWorkCitation + + + + + + + + + + ICV01 CollectionVersion filler + + + gov.nasa.esdis.umm.collectionversion + + + CollectionVersion + + + + + LargerWorkCitation + + + + + + + + + + + + + + + + + + + + https://swot.jpl.nasa.gov/ + + + SWOT Project Homepage + + + information + + + + + + + + + + + + + + + + + + + + + + + + + + + + + https://swot.jpl.nasa.gov/ + + + SWOT Project Homepage + + + information + + + + + + + + + + + + + + + + eng + + + + utf8 + + + + + + + + + + + + + + + + + + + + + + + -77.089598228 -121.56652283899999 -78.236115915 -121.56652283899999 -76.876353092 -95.245089678 -73.481988386 -76.96015316400002 -69.017288841 -65.63322022 -64.027313382 -58.444391250000024 -58.761539499 -53.60629767299997 -53.337452313 -50.161069277000024 -47.815098058 -47.586810222 -42.227832282 -45.583396859000004 -36.5956463 -43.967991487999996 -30.93139442 -42.62300134700001 -25.243922948 -41.46885623999998 -19.539745533 -40.44897850299998 -13.823991705 -39.52101994700001 -8.100972727 -38.65145055400001 -2.374539997 -37.81198303999997 0.488816703 -37.395484400999976 6.213560933 -36.55337174800002 11.932599736 -35.67772328000001 17.641983548 -34.74051516100002 23.337243263 -33.70876345900001 29.013029157 -32.54118567799998 34.662546094 -31.183259725000028 40.276622422 -29.559408804999975 45.842100123 -27.559952510000016 51.338911739 -25.018224615999998 56.734470077 -21.668558564000023 61.972216352 -17.066154213999994 66.946763054 -10.433090223000022 71.447935666 -0.39442901799998253 75.044865485 15.185708156 76.968276197 37.662916096 78.102910198 36.899181012 76.019975969 12.769937871 72.220320073 -3.1137959949999754 67.558606653 -12.942241278999973 62.468077627 -19.285798596999996 57.14621816 -23.631973963999997 51.688178369 -26.775112310999987 46.143853744 -29.154443990999994 40.541623404 -31.02701495299999 34.898867444 -32.552058708000004 29.226993856 -33.833589115999985 23.534015403 -34.94304256800001 17.825953694 -35.93198489600002 12.107646429 -36.83964491199998 6.383237199 -37.69765486900002 0.656492138 -38.533258386 -2.206626058 -38.950569207 -7.930093263 -39.79983851100002 -13.646733081 -40.69051906300001 -19.352469895 -41.65184012899999 -25.042615437 -42.71887793000002 -30.711458165 -43.93628115199999 -36.351610213 -45.36390657999999 -41.952914779 -47.08588716700001 -47.500530492 -49.226003091999985 -52.971396993 -51.975021656000024 -58.327328868 -55.64154334599999 -63.500646942 -60.749701372000004 -68.362496198 -68.224467973 -72.651811342 -79.67691136100001 -75.841080029 -97.33596427600003 -77.089598228 -121.56652283899999 + + + + + + + + + + + + + + + + -121.769475 + + + 45.675058000000035 + + + -78.271942 + + + 78.27206799999999 + + + + + + + + + + + + + AscendingCrossing: -38.05 StartLatitude: -77.66 StartDirection: A EndLatitude: 77.66 EndDirection: A + + + gov.nasa.esdis.umm.orbit + + + Orbit + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Cycle: 006, Pass: [143, Tiles: ] + + + gov.nasa.esdis.umm.swottrack + + + SWOTTrack + + + + + + + + + + + + + 2023-11-07T15:04:24.790250Z + 2023-11-07T15:56:22.407750Z + + + + + + + + + + + + + + + + + + + MeasuredParameters + + + physicalMeasurement + + + + + + + + N/A + + + + + + MeasuredParameters + + + + + + + + + + + + + qualityInformation + + + QAPercentMissingData + + + float + + + + + N/A + + + + + + + qualityInformation + + + + QAPercentOutOfBoundsData + + + float + + + N/A + + + N/A + + + + + N/A + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + https://daac.ornl.gov/daacdata/islscp_ii/vegetation/erbe_albedo_monthly_xdeg/data/erbe_albedo_1deg_1986.zip + + + + + Type: GET DATA Format: ZIP MimeType: application/zip Size: 395.673 SizeUnit: KB Description: This link provides direct download access to the granule. + + + download + + + + + + + + + + + + + + + + + dataset + + + + + + + + + + + + + + + + + ReprocessingActual: To be determined + + + + + + + + PGEVersionClass + + + + + + + PGEName: PGE_L2_LR_SSH PGEVersion: 4.3.0 + + + gov.nasa.esdis.umm.pgeversionclass + + + PGEVersionClass + + + + + + + + + + + + + + ProductionDateTime + + + 2023-11-10T01:03:13.602794Z + + + + + + + + GranuleInput + + + + + + SWOT_GranulePolygons_Nom_20230213T142900_v05.json + + + + + + + + + + + GranuleInput + + + + + + SWOT_INT_LR_XOverCal_20231106T233827_20231107T233918_PIB0_01.nc + + + + + + + + + + + GranuleInput + + + + + + SWOT_L2_LR_PreCalSSH_Basic_006_143_20231107T150730_20231107T155607_PIB0_01.nc + + + + + + + + + + + GranuleInput + + + + + + SWOT_L2_LR_PreCalSSH_Expert_006_143_20231107T150730_20231107T155607_PIB0_01.nc + + + + + + + + + + + GranuleInput + + + + + + SWOT_L2_LR_PreCalSSH_Unsmoothed_006_143_20231107T150440_20231107T155606_PIB0_01.nc + + + + + + + + + + + GranuleInput + + + + + + SWOT_L2_LR_PreCalSSH_WindWave_006_143_20231107T150730_20231107T155607_PIB0_01.nc + + + + + + + + + + + GranuleInput + + + + + + SWOT_NC_Compression_L2_LR_SSH_Basic_20210728T100000_v004.yaml + + + + + + + + + + + GranuleInput + + + + + + SWOT_NC_Compression_L2_LR_SSH_Expert_20210728T100000_v004.yaml + + + + + + + + + + + GranuleInput + + + + + + SWOT_NC_Compression_L2_LR_SSH_Unsmoothed_20210728T100000_v004.yaml + + + + + + + + + + + GranuleInput + + + + + + SWOT_NC_Compression_L2_LR_SSH_WindWave_20210728T100000_v004.yaml + + + + + + + + + + + GranuleInput + + + + + + SWOT_ORF_AXXCNE20231109_104300_20230720_200750_20231124_075610 + + + + + + + + + + + + + + + + + + + + + + + + + + + SWOT_L2_LR_SSH_Basic_006_143_20231107T150730_20231107T155607_PIB0_01.zip + + + + Size: unknown SizeUnit: KB ChecksumValue: unknown ChecksumAlgorithm: unknown Description: dataset in a ZIP file + + + application/zip + + + + + ZIP + + + + + + + + + + + SWOT_L2_LR_PreCalSSH_Basic_006_143_20231107T150730_20231107T155607_PIB0_01.nc + + + Size: 8769206 SizeUnit: B ChecksumValue: 260a4400494051d5f9dfa2c156c42a49 ChecksumAlgorithm: MD5 + + + application/x-netcdf + + + + + NETCDF-4 + + + + + + + + + + + SWOT_L2_LR_PreCalSSH_WindWave_006_143_20231107T150730_20231107T155607_PIB0_01.nc + + + Size: 12158279 SizeUnit: B ChecksumValue: 5fa9ba810f48b17b61aff2751cb8996c ChecksumAlgorithm: MD5 + + + application/x-netcdf + + + + + NETCDF-4 + + + + + + + + + + + SWOT_L2_LR_PreCalSSH_Expert_006_143_20231107T150730_20231107T155607_PIB0_01.nc + + + Size: 30961346 SizeUnit: B ChecksumValue: 00f52acdaec4951d332ebaf5e8b57fe6 ChecksumAlgorithm: MD5 + + + application/x-netcdf + + + + + NETCDF-4 + + + + + + + + + + + SWOT_L2_LR_PreCalSSH_Unsmoothed_006_143_20231107T150440_20231107T155606_PIB0_01.nc + + + Size: 596395433 SizeUnit: B ChecksumValue: c51c7be26daa992e034302a197d3f813 ChecksumAlgorithm: MD5 + + + application/x-netcdf + + + + + NETCDF-4 + + + + + + + + + + + SWOT_L2_LR_SSH_Basic_006_143_20231107T150730_20231107T155607_PIB0_01.nc.iso.xml + + + Size: unknown SizeUnit: unknown ChecksumValue: unknown ChecksumAlgorithm: unknown + + + text/xml + + + + + XML + + + + + + + + + + + SWOT_L2_LR_SSH_Basic_006_143_20231107T150730_20231107T155607_PIB0_01.rc.xml + + + Size: 3402 SizeUnit: B ChecksumValue: 7f84e4d63a7cdc6f192bd22d1d938d47 ChecksumAlgorithm: MD5 + + + text/xml + + + + + XML + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + SWOT + + + gov.nasa.esdis.umm.platformshortname + + + PlatformShortName + + + + + + + + + + + + + KaRIn + + + gov.nasa.esdis.umm.instrumentshortname + + + InstrumentShortName + + + + + + + + + + + + + + + + instrumentInformation + + + ICV23 KaRIn Instrument_Characteristics name 1 + + + + + ICV24 KaRIn Instrument_Characteristics value 1 + + + + + + + instrumentInformation + + + ICV25 KaRIn Instrument_Characteristics name 2 + + + + + ICV26 KaRIn Instrument_Characteristics value 2 + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/test/resources/ummgResults/additionalAttributes/OPERA_L3_DSWx_HLS_T14RNV_20210906T170251Z_20221026T184342Z_L8_30_v0.0.json b/src/test/resources/ummgResults/additionalAttributes/OPERA_L3_DSWx_HLS_T14RNV_20210906T170251Z_20221026T184342Z_L8_30_v0.0.json new file mode 100644 index 0000000..ba49337 --- /dev/null +++ b/src/test/resources/ummgResults/additionalAttributes/OPERA_L3_DSWx_HLS_T14RNV_20210906T170251Z_20221026T184342Z_L8_30_v0.0.json @@ -0,0 +1 @@ +{"MetadataSpecification":{"Version":"1.6.5","URL":"https:\/\/cdn.earthdata.nasa.gov\/umm\/granule\/v1.6.5","Name":"UMM-G"},"Platforms":[{"Instruments":[{"ShortName":""}],"ShortName":""}],"GranuleUR":"OPERA_L3_DSWx_HLS_T14RNV_20210906T170251Z_20221026T184342Z_L8_30_v0.0","PGEVersionClass":{"PGEName":"DSWX_HLS_PGE","PGEVersion":"1.0.0-rc.5"},"CollectionReference":{"Version":"0.0","ShortName":"OPERA_L3_DSWX-HLS_PROVISIONAL_V0"},"RelatedUrls":[{"Type":"GET DATA","Description":"The base directory location for the granule.","URL":"s3:\/\/a\/path\/to\/s3"}],"InputGranules":["\/home\/conda\/input_dir\/HLS.L30.T14RNV.2021249T170251.v2.0.B02.tif","\/home\/conda\/input_dir\/HLS.L30.T14RNV.2021249T170251.v2.0.B03.tif","\/home\/conda\/input_dir\/HLS.L30.T14RNV.2021249T170251.v2.0.B04.tif","\/home\/conda\/input_dir\/HLS.L30.T14RNV.2021249T170251.v2.0.B05.tif","\/home\/conda\/input_dir\/HLS.L30.T14RNV.2021249T170251.v2.0.B06.tif","\/home\/conda\/input_dir\/HLS.L30.T14RNV.2021249T170251.v2.0.B07.tif","\/home\/conda\/input_dir\/HLS.L30.T14RNV.2021249T170251.v2.0.Fmask.tif","\/home\/conda\/input_dir\/dem.vrt","\/home\/conda\/input_dir\/dem_0.tif","\/home\/conda\/input_dir\/landcover.tif","\/home\/conda\/input_dir\/worldcover.vrt","\/home\/conda\/input_dir\/worldcover_0.tif"],"TemporalExtent":{"RangeDateTime":{"EndingDateTime":"2012-03-03T12:16:38.727Z","BeginningDateTime":"2012-03-03T11:20:35.236Z"}},"ProviderDates":[{"Type":"Insert","Date":"2024-04-17T03:21:54.140Z"},{"Type":"Update","Date":"2024-04-17T03:21:54.150Z"}],"SpatialExtent":{"HorizontalSpatialDomain":{"Geometry":{"BoundingRectangles":[{"WestBoundingCoordinate":0.238,"SouthBoundingCoordinate":-66.147,"EastBoundingCoordinate":359.846,"NorthBoundingCoordinate":66.142}]},"Track":{"Cycle":374,"Passes":[{"Pass":172}]}}},"AdditionalAttributes":[{"Values":["HLS.L30.T14RNV.2021249T170251.v2.0"],"Name":"HlsDataset"},{"Values":["LC08_L1TP_027038_20210906_20210915_02_T1; LC08_L1TP_027039_20210906_20210915_02_T1"],"Name":"SensorProductID"},{"Values":["Lasrc; Lasrc"],"Name":"Accode"},{"Values":["135.857670779298"],"Name":"MeanSunAzimuthAngle"},{"Values":["32.3676212035439"],"Name":"MeanSunZenithAngle"},{"Values":["30.8893421483768"],"Name":"NBAR_SolarZenith"},{"Values":["106.186652634788"],"Name":"MeanViewAzimuthAngle"},{"Values":["5.12004424472291"],"Name":"MeanViewZenithAngle"},{"Values":["67"],"Name":"SpatialCoverage"},{"Values":["76"],"Name":"PercentCloudCover"},{"Values":["T14RNV"],"Name":"MGRS_TILE_ID"}],"DataGranule":{"ArchiveAndDistributionInformation":[],"DayNightFlag":"Unspecified","Identifiers":[{"Identifier":"OPERA_L3_DSWx_HLS_T14RNV_20210906T170251Z_20221026T184342Z_L8_30_v0.0","IdentifierType":"ProducerGranuleId"},{"Identifier":"0.5","IdentifierType":"Other","IdentifierName":"SASVersionId"},{"Identifier":"1.0.0-rc.5","IdentifierType":"Other","IdentifierName":"PGEVersionId"}],"ReprocessingPlanned":"","ProductionDateTime":"2016-03-16T03:02:03.000Z"},"CloudCover":76} \ No newline at end of file diff --git a/src/test/resources/ummgResults/additionalAttributes/OPERA_L3_DSWx_HLS_T14RNV_20210906T170251Z_20221026T184342Z_L8_30_v0.0_appendFieldToJSON_String.json b/src/test/resources/ummgResults/additionalAttributes/OPERA_L3_DSWx_HLS_T14RNV_20210906T170251Z_20221026T184342Z_L8_30_v0.0_appendFieldToJSON_String.json new file mode 100644 index 0000000..a1f5f68 --- /dev/null +++ b/src/test/resources/ummgResults/additionalAttributes/OPERA_L3_DSWx_HLS_T14RNV_20210906T170251Z_20221026T184342Z_L8_30_v0.0_appendFieldToJSON_String.json @@ -0,0 +1 @@ +{"MetadataSpecification":{"Version":"1.6.5","URL":"https:\/\/cdn.earthdata.nasa.gov\/umm\/granule\/v1.6.5","Name":"UMM-G"},"Platforms":[{"Instruments":[{"ShortName":""}],"ShortName":""}],"GranuleUR":null,"PGEVersionClass":{"PGEName":"DSWX_HLS_PGE","PGEVersion":"1.0.0-rc.5"},"CollectionReference":{"Version":"0.0","ShortName":"OPERA_L3_DSWX-HLS_PROVISIONAL_V0"},"RelatedUrls":[{"Type":"GET DATA","Description":"The base directory location for the granule.","URL":"s3:\/\/a\/path\/to\/s3"}],"InputGranules":["\/home\/conda\/input_dir\/HLS.L30.T14RNV.2021249T170251.v2.0.B02.tif","\/home\/conda\/input_dir\/HLS.L30.T14RNV.2021249T170251.v2.0.B03.tif","\/home\/conda\/input_dir\/HLS.L30.T14RNV.2021249T170251.v2.0.B04.tif","\/home\/conda\/input_dir\/HLS.L30.T14RNV.2021249T170251.v2.0.B05.tif","\/home\/conda\/input_dir\/HLS.L30.T14RNV.2021249T170251.v2.0.B06.tif","\/home\/conda\/input_dir\/HLS.L30.T14RNV.2021249T170251.v2.0.B07.tif","\/home\/conda\/input_dir\/HLS.L30.T14RNV.2021249T170251.v2.0.Fmask.tif","\/home\/conda\/input_dir\/dem.vrt","\/home\/conda\/input_dir\/dem_0.tif","\/home\/conda\/input_dir\/landcover.tif","\/home\/conda\/input_dir\/worldcover.vrt","\/home\/conda\/input_dir\/worldcover_0.tif"],"TemporalExtent":{"RangeDateTime":{"EndingDateTime":"2012-03-03T12:16:38.727Z","BeginningDateTime":"2012-03-03T11:20:35.236Z"}},"SensorProductID_CMR":"LC08_L1TP_027038_20210906_20210915_02_T1; LC08_L1TP_027039_20210906_20210915_02_T1","ProviderDates":[{"Type":"Insert","Date":"2024-04-17T17:16:54.163Z"},{"Type":"Update","Date":"2024-04-17T17:16:54.172Z"}],"SpatialExtent":{"HorizontalSpatialDomain":{"Geometry":{"BoundingRectangles":[{"WestBoundingCoordinate":0.238,"SouthBoundingCoordinate":-66.147,"EastBoundingCoordinate":359.846,"NorthBoundingCoordinate":66.142}]},"Track":{"Cycle":374,"Passes":[{"Pass":172}]}}},"AdditionalAttributes":[{"Values":["LC08_L1TP_027038_20210906_20210915_02_T1; LC08_L1TP_027039_20210906_20210915_02_T1"],"Name":"SensorProductID"},{"Values":["T14RNV"],"Name":"MGRS_TILE_ID"}],"DataGranule":{"ArchiveAndDistributionInformation":[],"DayNightFlag":"Unspecified","Identifiers":[{"Identifier":"OPERA_L3_DSWx_HLS_T14RNV_20210906T170251Z_20221026T184342Z_L8_30_v0.0","IdentifierType":"ProducerGranuleId"},{"Identifier":"0.5","IdentifierType":"Other","IdentifierName":"SASVersionId"},{"Identifier":"1.0.0-rc.5","IdentifierType":"Other","IdentifierName":"PGEVersionId"}],"ReprocessingPlanned":"","ProductionDateTime":"2016-03-16T03:02:03.000Z"}} \ No newline at end of file diff --git a/src/test/resources/ummgResults/additionalAttributes/OPERA_L3_DSWx_HLS_T14RNV_20210906T170251Z_20221026T184342Z_L8_30_v0.0_publishAll.json b/src/test/resources/ummgResults/additionalAttributes/OPERA_L3_DSWx_HLS_T14RNV_20210906T170251Z_20221026T184342Z_L8_30_v0.0_publishAll.json new file mode 100644 index 0000000..b572bca --- /dev/null +++ b/src/test/resources/ummgResults/additionalAttributes/OPERA_L3_DSWx_HLS_T14RNV_20210906T170251Z_20221026T184342Z_L8_30_v0.0_publishAll.json @@ -0,0 +1 @@ +{"InputGranules":["\/home\/conda\/input_dir\/HLS.L30.T14RNV.2021249T170251.v2.0.B02.tif","\/home\/conda\/input_dir\/HLS.L30.T14RNV.2021249T170251.v2.0.B03.tif","\/home\/conda\/input_dir\/HLS.L30.T14RNV.2021249T170251.v2.0.B04.tif","\/home\/conda\/input_dir\/HLS.L30.T14RNV.2021249T170251.v2.0.B05.tif","\/home\/conda\/input_dir\/HLS.L30.T14RNV.2021249T170251.v2.0.B06.tif","\/home\/conda\/input_dir\/HLS.L30.T14RNV.2021249T170251.v2.0.B07.tif","\/home\/conda\/input_dir\/HLS.L30.T14RNV.2021249T170251.v2.0.Fmask.tif","\/home\/conda\/input_dir\/dem.vrt","\/home\/conda\/input_dir\/dem_0.tif","\/home\/conda\/input_dir\/landcover.tif","\/home\/conda\/input_dir\/worldcover.vrt","\/home\/conda\/input_dir\/worldcover_0.tif"],"TemporalExtent":{"RangeDateTime":{"EndingDateTime":"2012-03-03T12:16:38.727Z","BeginningDateTime":"2012-03-03T11:20:35.236Z"}},"MetadataSpecification":{"Version":"1.6.5","URL":"https:\/\/cdn.earthdata.nasa.gov\/umm\/granule\/v1.6.5","Name":"UMM-G"},"Platforms":[{"Instruments":[{"ShortName":""}],"ShortName":""}],"GranuleUR":"OPERA_L3_DSWx_HLS_T14RNV_20210906T170251Z_20221026T184342Z_L8_30_v0.0","ProviderDates":[{"Type":"Insert","Date":"2024-04-17T16:41:18.842Z"},{"Type":"Update","Date":"2024-04-17T16:41:18.854Z"}],"SpatialExtent":{"HorizontalSpatialDomain":{"Geometry":{"BoundingRectangles":[{"WestBoundingCoordinate":0.238,"SouthBoundingCoordinate":-66.147,"EastBoundingCoordinate":359.846,"NorthBoundingCoordinate":66.142}]},"Track":{"Cycle":374,"Passes":[{"Pass":172}]}}},"AdditionalAttributes":[{"Values":["HLS.L30.T14RNV.2021249T170251.v2.0"],"Name":"HlsDataset"},{"Values":["LC08_L1TP_027038_20210906_20210915_02_T1; LC08_L1TP_027039_20210906_20210915_02_T1"],"Name":"SensorProductID"},{"Values":["Lasrc; Lasrc"],"Name":"Accode"},{"Values":["135.857670779298"],"Name":"MeanSunAzimuthAngle"},{"Values":["32.3676212035439"],"Name":"MeanSunZenithAngle"},{"Values":["30.8893421483768"],"Name":"NBAR_SolarZenith"},{"Values":["106.186652634788"],"Name":"MeanViewAzimuthAngle"},{"Values":["5.12004424472291"],"Name":"MeanViewZenithAngle"},{"Values":["67"],"Name":"SpatialCoverage"},{"Values":["76"],"Name":"PercentCloudCover"},{"Values":["T14RNV"],"Name":"MGRS_TILE_ID"}],"PGEVersionClass":{"PGEName":"DSWX_HLS_PGE","PGEVersion":"1.0.0-rc.5"},"DataGranule":{"ArchiveAndDistributionInformation":[],"DayNightFlag":"Unspecified","Identifiers":[{"Identifier":"OPERA_L3_DSWx_HLS_T14RNV_20210906T170251Z_20221026T184342Z_L8_30_v0.0","IdentifierType":"ProducerGranuleId"},{"Identifier":"0.5","IdentifierType":"Other","IdentifierName":"SASVersionId"},{"Identifier":"1.0.0-rc.5","IdentifierType":"Other","IdentifierName":"PGEVersionId"}],"ReprocessingPlanned":"","ProductionDateTime":"2016-03-16T03:02:03.000Z"},"CollectionReference":{"Version":"0.0","ShortName":"OPERA_L3_DSWX-HLS_PROVISIONAL_V0"},"RelatedUrls":[{"Type":"GET DATA","Description":"The base directory location for the granule.","URL":"s3:\/\/a\/path\/to\/s3"}]} \ No newline at end of file diff --git a/src/test/resources/ummgResults/additionalAttributes/OPERA_L3_DSWx_HLS_T14RNV_20210906T170251Z_20221026T184342Z_L8_30_v0.0_publishAllEmptyCatchError_3.json b/src/test/resources/ummgResults/additionalAttributes/OPERA_L3_DSWx_HLS_T14RNV_20210906T170251Z_20221026T184342Z_L8_30_v0.0_publishAllEmptyCatchError_3.json new file mode 100644 index 0000000..04d899f --- /dev/null +++ b/src/test/resources/ummgResults/additionalAttributes/OPERA_L3_DSWx_HLS_T14RNV_20210906T170251Z_20221026T184342Z_L8_30_v0.0_publishAllEmptyCatchError_3.json @@ -0,0 +1 @@ +{"InputGranules":["\/home\/conda\/input_dir\/HLS.L30.T14RNV.2021249T170251.v2.0.B02.tif","\/home\/conda\/input_dir\/HLS.L30.T14RNV.2021249T170251.v2.0.B03.tif","\/home\/conda\/input_dir\/HLS.L30.T14RNV.2021249T170251.v2.0.B04.tif","\/home\/conda\/input_dir\/HLS.L30.T14RNV.2021249T170251.v2.0.B05.tif","\/home\/conda\/input_dir\/HLS.L30.T14RNV.2021249T170251.v2.0.B06.tif","\/home\/conda\/input_dir\/HLS.L30.T14RNV.2021249T170251.v2.0.B07.tif","\/home\/conda\/input_dir\/HLS.L30.T14RNV.2021249T170251.v2.0.Fmask.tif","\/home\/conda\/input_dir\/dem.vrt","\/home\/conda\/input_dir\/dem_0.tif","\/home\/conda\/input_dir\/landcover.tif","\/home\/conda\/input_dir\/worldcover.vrt","\/home\/conda\/input_dir\/worldcover_0.tif"],"TemporalExtent":{"RangeDateTime":{"EndingDateTime":"2012-03-03T12:16:38.727Z","BeginningDateTime":"2012-03-03T11:20:35.236Z"}},"MetadataSpecification":{"Version":"1.6.5","URL":"https:\/\/cdn.earthdata.nasa.gov\/umm\/granule\/v1.6.5","Name":"UMM-G"},"Platforms":[{"Instruments":[{"ShortName":""}],"ShortName":""}],"GranuleUR":"some_random_granule_name","ProviderDates":[{"Type":"Insert","Date":"2024-04-17T17:13:08.992Z"},{"Type":"Update","Date":"2024-04-17T17:13:09.003Z"}],"SpatialExtent":{"HorizontalSpatialDomain":{"Geometry":{"BoundingRectangles":[{"WestBoundingCoordinate":0.238,"SouthBoundingCoordinate":-66.147,"EastBoundingCoordinate":359.846,"NorthBoundingCoordinate":66.142}]},"Track":{"Cycle":374,"Passes":[{"Pass":172}]}}},"AdditionalAttributes":[{"Values":["T14RNV"],"Name":"MGRS_TILE_ID"}],"PGEVersionClass":{"PGEName":"DSWX_HLS_PGE","PGEVersion":"1.0.0-rc.5"},"DataGranule":{"ArchiveAndDistributionInformation":[],"DayNightFlag":"Unspecified","Identifiers":[{"Identifier":"OPERA_L3_DSWx_HLS_T14RNV_20210906T170251Z_20221026T184342Z_L8_30_v0.0","IdentifierType":"ProducerGranuleId"},{"Identifier":"0.5","IdentifierType":"Other","IdentifierName":"SASVersionId"},{"Identifier":"1.0.0-rc.5","IdentifierType":"Other","IdentifierName":"PGEVersionId"}],"ReprocessingPlanned":"","ProductionDateTime":"2016-03-16T03:02:03.000Z"},"CollectionReference":{"Version":"0.0","ShortName":"OPERA_L3_DSWX-HLS_PROVISIONAL_V0"},"RelatedUrls":[{"Type":"GET DATA","Description":"The base directory location for the granule.","URL":"s3:\/\/a\/path\/to\/s3"}]} \ No newline at end of file diff --git a/src/test/resources/ummgResults/additionalAttributes/OPERA_L3_DSWx_HLS_T14RNV_20210906T170251Z_20221026T184342Z_L8_30_v0.0_publishAllWithSpecific.json b/src/test/resources/ummgResults/additionalAttributes/OPERA_L3_DSWx_HLS_T14RNV_20210906T170251Z_20221026T184342Z_L8_30_v0.0_publishAllWithSpecific.json new file mode 100644 index 0000000..559e2e1 --- /dev/null +++ b/src/test/resources/ummgResults/additionalAttributes/OPERA_L3_DSWx_HLS_T14RNV_20210906T170251Z_20221026T184342Z_L8_30_v0.0_publishAllWithSpecific.json @@ -0,0 +1 @@ +{"InputGranules":["\/home\/conda\/input_dir\/HLS.L30.T14RNV.2021249T170251.v2.0.B02.tif","\/home\/conda\/input_dir\/HLS.L30.T14RNV.2021249T170251.v2.0.B03.tif","\/home\/conda\/input_dir\/HLS.L30.T14RNV.2021249T170251.v2.0.B04.tif","\/home\/conda\/input_dir\/HLS.L30.T14RNV.2021249T170251.v2.0.B05.tif","\/home\/conda\/input_dir\/HLS.L30.T14RNV.2021249T170251.v2.0.B06.tif","\/home\/conda\/input_dir\/HLS.L30.T14RNV.2021249T170251.v2.0.B07.tif","\/home\/conda\/input_dir\/HLS.L30.T14RNV.2021249T170251.v2.0.Fmask.tif","\/home\/conda\/input_dir\/dem.vrt","\/home\/conda\/input_dir\/dem_0.tif","\/home\/conda\/input_dir\/landcover.tif","\/home\/conda\/input_dir\/worldcover.vrt","\/home\/conda\/input_dir\/worldcover_0.tif"],"TemporalExtent":{"RangeDateTime":{"EndingDateTime":"2012-03-03T12:16:38.727Z","BeginningDateTime":"2012-03-03T11:20:35.236Z"}},"MetadataSpecification":{"Version":"1.6.5","URL":"https:\/\/cdn.earthdata.nasa.gov\/umm\/granule\/v1.6.5","Name":"UMM-G"},"Platforms":[{"Instruments":[{"ShortName":""}],"ShortName":""}],"GranuleUR":null,"ProviderDates":[{"Type":"Insert","Date":"2024-04-17T16:56:47.572Z"},{"Type":"Update","Date":"2024-04-17T16:56:47.580Z"}],"SpatialExtent":{"HorizontalSpatialDomain":{"Geometry":{"BoundingRectangles":[{"WestBoundingCoordinate":0.238,"SouthBoundingCoordinate":-66.147,"EastBoundingCoordinate":359.846,"NorthBoundingCoordinate":66.142}]},"Track":{"Cycle":374,"Passes":[{"Pass":172}]}}},"AdditionalAttributes":[{"Values":["HLS.L30.T14RNV.2021249T170251.v2.0"],"Name":"HlsDataset"},{"Values":["LC08_L1TP_027038_20210906_20210915_02_T1; LC08_L1TP_027039_20210906_20210915_02_T1"],"Name":"SensorProductID"},{"Values":["Lasrc; Lasrc"],"Name":"Accode"},{"Values":["135.857670779298"],"Name":"MeanSunAzimuthAngle"},{"Values":["32.3676212035439"],"Name":"MeanSunZenithAngle"},{"Values":["30.8893421483768"],"Name":"NBAR_SolarZenith"},{"Values":["106.186652634788"],"Name":"MeanViewAzimuthAngle"},{"Values":["5.12004424472291"],"Name":"MeanViewZenithAngle"},{"Values":["67"],"Name":"SpatialCoverage"},{"Values":["76"],"Name":"PercentCloudCover"},{"Values":["T14RNV"],"Name":"MGRS_TILE_ID"}],"PGEVersionClass":{"PGEName":"DSWX_HLS_PGE","PGEVersion":"1.0.0-rc.5"},"DataGranule":{"ArchiveAndDistributionInformation":[],"DayNightFlag":"Unspecified","Identifiers":[{"Identifier":"OPERA_L3_DSWx_HLS_T14RNV_20210906T170251Z_20221026T184342Z_L8_30_v0.0","IdentifierType":"ProducerGranuleId"},{"Identifier":"0.5","IdentifierType":"Other","IdentifierName":"SASVersionId"},{"Identifier":"1.0.0-rc.5","IdentifierType":"Other","IdentifierName":"PGEVersionId"}],"ReprocessingPlanned":"","ProductionDateTime":"2016-03-16T03:02:03.000Z"},"CollectionReference":{"Version":"0.0","ShortName":"OPERA_L3_DSWX-HLS_PROVISIONAL_V0"},"RelatedUrls":[{"Type":"GET DATA","Description":"The base directory location for the granule.","URL":"s3:\/\/a\/path\/to\/s3"}]} \ No newline at end of file diff --git a/src/test/resources/ummgResults/additionalAttributes/OPERA_L3_DSWx_HLS_T14RNV_20210906T170251Z_20221026T184342Z_L8_30_v0.0_publishSpecific.json b/src/test/resources/ummgResults/additionalAttributes/OPERA_L3_DSWx_HLS_T14RNV_20210906T170251Z_20221026T184342Z_L8_30_v0.0_publishSpecific.json new file mode 100644 index 0000000..80e4873 --- /dev/null +++ b/src/test/resources/ummgResults/additionalAttributes/OPERA_L3_DSWx_HLS_T14RNV_20210906T170251Z_20221026T184342Z_L8_30_v0.0_publishSpecific.json @@ -0,0 +1 @@ +{"InputGranules":["\/home\/conda\/input_dir\/HLS.L30.T14RNV.2021249T170251.v2.0.B02.tif","\/home\/conda\/input_dir\/HLS.L30.T14RNV.2021249T170251.v2.0.B03.tif","\/home\/conda\/input_dir\/HLS.L30.T14RNV.2021249T170251.v2.0.B04.tif","\/home\/conda\/input_dir\/HLS.L30.T14RNV.2021249T170251.v2.0.B05.tif","\/home\/conda\/input_dir\/HLS.L30.T14RNV.2021249T170251.v2.0.B06.tif","\/home\/conda\/input_dir\/HLS.L30.T14RNV.2021249T170251.v2.0.B07.tif","\/home\/conda\/input_dir\/HLS.L30.T14RNV.2021249T170251.v2.0.Fmask.tif","\/home\/conda\/input_dir\/dem.vrt","\/home\/conda\/input_dir\/dem_0.tif","\/home\/conda\/input_dir\/landcover.tif","\/home\/conda\/input_dir\/worldcover.vrt","\/home\/conda\/input_dir\/worldcover_0.tif"],"TemporalExtent":{"RangeDateTime":{"EndingDateTime":"2012-03-03T12:16:38.727Z","BeginningDateTime":"2012-03-03T11:20:35.236Z"}},"MetadataSpecification":{"Version":"1.6.5","URL":"https:\/\/cdn.earthdata.nasa.gov\/umm\/granule\/v1.6.5","Name":"UMM-G"},"Platforms":[{"Instruments":[{"ShortName":""}],"ShortName":""}],"GranuleUR":"OPERA_L3_DSWx_HLS_T14RNV_20210906T170251Z_20221026T184342Z_L8_30_v0.0","ProviderDates":[{"Type":"Insert","Date":"2024-04-17T03:41:19.154Z"},{"Type":"Update","Date":"2024-04-17T03:41:19.163Z"}],"SpatialExtent":{"HorizontalSpatialDomain":{"Geometry":{"BoundingRectangles":[{"WestBoundingCoordinate":0.238,"SouthBoundingCoordinate":-66.147,"EastBoundingCoordinate":359.846,"NorthBoundingCoordinate":66.142}]},"Track":{"Cycle":374,"Passes":[{"Pass":172}]}}},"AdditionalAttributes":[{"Values":["76"],"Name":"PercentCloudCover"},{"Values":["T14RNV"],"Name":"MGRS_TILE_ID"}],"PGEVersionClass":{"PGEName":"DSWX_HLS_PGE","PGEVersion":"1.0.0-rc.5"},"DataGranule":{"ArchiveAndDistributionInformation":[],"DayNightFlag":"Unspecified","Identifiers":[{"Identifier":"OPERA_L3_DSWx_HLS_T14RNV_20210906T170251Z_20221026T184342Z_L8_30_v0.0","IdentifierType":"ProducerGranuleId"},{"Identifier":"0.5","IdentifierType":"Other","IdentifierName":"SASVersionId"},{"Identifier":"1.0.0-rc.5","IdentifierType":"Other","IdentifierName":"PGEVersionId"}],"ReprocessingPlanned":"","ProductionDateTime":"2016-03-16T03:02:03.000Z"},"CollectionReference":{"Version":"0.0","ShortName":"OPERA_L3_DSWX-HLS_PROVISIONAL_V0"},"RelatedUrls":[{"Type":"GET DATA","Description":"The base directory location for the granule.","URL":"s3:\/\/a\/path\/to\/s3"}]} \ No newline at end of file diff --git a/src/test/resources/ummgResults/from_mp_file/20170408033000-JPL-L2P_GHRSST-SSTskin-MODIS_T-N-v02.0-fv01.0.json b/src/test/resources/ummgResults/from_mp_file/20170408033000-JPL-L2P_GHRSST-SSTskin-MODIS_T-N-v02.0-fv01.0.json new file mode 100644 index 0000000..295fa4d --- /dev/null +++ b/src/test/resources/ummgResults/from_mp_file/20170408033000-JPL-L2P_GHRSST-SSTskin-MODIS_T-N-v02.0-fv01.0.json @@ -0,0 +1 @@ +{"TemporalExtent":{"RangeDateTime":{"EndingDateTime":"2017-04-08T03:35:09.000Z","BeginningDateTime":"2017-04-08T03:30:11.000Z"}},"MetadataSpecification":{"Version":"1.6.5","URL":"https:\/\/cdn.earthdata.nasa.gov\/umm\/granule\/v1.6.5","Name":"UMM-G"},"GranuleUR":null,"ProviderDates":[{"Type":"Insert","Date":"2024-04-17T00:39:27.396Z"},{"Type":"Update","Date":"2024-04-17T00:39:27.414Z"}],"SpatialExtent":{"HorizontalSpatialDomain":{"Geometry":{"BoundingRectangles":[{"WestBoundingCoordinate":-99.832,"SouthBoundingCoordinate":-84.107,"EastBoundingCoordinate":-2.176,"NorthBoundingCoordinate":-59.453}]}}},"DataGranule":{"ArchiveAndDistributionInformation":[],"DayNightFlag":"Unspecified","ProductionDateTime":"2017-06-05T22:23:46.000Z"},"CollectionReference":{"Version":"4.2","ShortName":"MODIS_T-JPL-L2P-v2014.0"},"RelatedUrls":[{"Type":"GET DATA","Description":"The base directory location for the granule.","URL":"s3:\/\/a\/path\/to\/s3"}]} \ No newline at end of file diff --git a/src/test/resources/ummgResults/from_mp_file/JA1_GPN_2PeP374_172_20120303_112035_20120303_121638_withcyclepass.json b/src/test/resources/ummgResults/from_mp_file/JA1_GPN_2PeP374_172_20120303_112035_20120303_121638_withcyclepass.json new file mode 100644 index 0000000..0d1b379 --- /dev/null +++ b/src/test/resources/ummgResults/from_mp_file/JA1_GPN_2PeP374_172_20120303_112035_20120303_121638_withcyclepass.json @@ -0,0 +1 @@ +{"TemporalExtent":{"RangeDateTime":{"EndingDateTime":"2012-03-03T12:16:38.727Z","BeginningDateTime":"2012-03-03T11:20:35.236Z"}},"MetadataSpecification":{"Version":"1.6.5","URL":"https:\/\/cdn.earthdata.nasa.gov\/umm\/granule\/v1.6.5","Name":"UMM-G"},"GranuleUR":null,"ProviderDates":[{"Type":"Insert","Date":"2024-04-17T01:17:07.865Z"},{"Type":"Update","Date":"2024-04-17T01:17:07.882Z"}],"SpatialExtent":{"HorizontalSpatialDomain":{"Geometry":{"BoundingRectangles":[{"WestBoundingCoordinate":0.238,"SouthBoundingCoordinate":-66.147,"EastBoundingCoordinate":359.846,"NorthBoundingCoordinate":66.142}]},"Track":{"Cycle":374,"Passes":[{"Pass":172}]}}},"DataGranule":{"ArchiveAndDistributionInformation":[],"DayNightFlag":"Unspecified","ProductionDateTime":"2016-03-16T03:02:03.000Z"},"CollectionReference":{"Version":"4.2","ShortName":"MODIS_T-JPL-L2P-v2014.0"},"RelatedUrls":[{"Type":"GET DATA","Description":"The base directory location for the granule.","URL":"s3:\/\/a\/path\/to\/s3"}]} \ No newline at end of file diff --git a/src/test/resources/ummgResults/from_mp_file/RSS_SMAP_SSS_L2C_r00870_20150401T004312_2015091_FNL_V04.0.json b/src/test/resources/ummgResults/from_mp_file/RSS_SMAP_SSS_L2C_r00870_20150401T004312_2015091_FNL_V04.0.json new file mode 100644 index 0000000..34208c5 --- /dev/null +++ b/src/test/resources/ummgResults/from_mp_file/RSS_SMAP_SSS_L2C_r00870_20150401T004312_2015091_FNL_V04.0.json @@ -0,0 +1 @@ +{"TemporalExtent":{"RangeDateTime":{"EndingDateTime":"2015-04-01T02:24:53.000Z","BeginningDateTime":"2015-04-01T00:43:12.000Z"}},"MetadataSpecification":{"Version":"1.6.5","URL":"https:\/\/cdn.earthdata.nasa.gov\/umm\/granule\/v1.6.5","Name":"UMM-G"},"OrbitCalculatedSpatialDomains":[{"OrbitNumber":870}],"GranuleUR":null,"ProviderDates":[{"Type":"Insert","Date":"2024-04-17T00:46:13.029Z"},{"Type":"Update","Date":"2024-04-17T00:46:13.041Z"}],"SpatialExtent":{"HorizontalSpatialDomain":{"Geometry":{"BoundingRectangles":[{"WestBoundingCoordinate":0.006,"SouthBoundingCoordinate":-86.607,"EastBoundingCoordinate":359.993,"NorthBoundingCoordinate":86.515}]}}},"DataGranule":{"ArchiveAndDistributionInformation":[],"DayNightFlag":"Unspecified","ProductionDateTime":"2019-07-28T13:29:28.000Z"},"CollectionReference":{"Version":"4.2","ShortName":"MODIS_T-JPL-L2P-v2014.0"},"RelatedUrls":[{"Type":"GET DATA","Description":"The base directory location for the granule.","URL":"s3:\/\/a\/path\/to\/s3"}]} \ No newline at end of file diff --git a/src/test/resources/ummgResults/from_mp_file/RSS_smap_SSS_L3_monthly_2015_04_FNL_v04.0_OrbitStartEnd.json b/src/test/resources/ummgResults/from_mp_file/RSS_smap_SSS_L3_monthly_2015_04_FNL_v04.0_OrbitStartEnd.json new file mode 100644 index 0000000..c99fac7 --- /dev/null +++ b/src/test/resources/ummgResults/from_mp_file/RSS_smap_SSS_L3_monthly_2015_04_FNL_v04.0_OrbitStartEnd.json @@ -0,0 +1 @@ +{"TemporalExtent":{"RangeDateTime":{"EndingDateTime":"2015-04-30T23:59:59.000Z","BeginningDateTime":"2015-04-01T00:00:00.000Z"}},"MetadataSpecification":{"Version":"1.6.5","URL":"https:\/\/cdn.earthdata.nasa.gov\/umm\/granule\/v1.6.5","Name":"UMM-G"},"OrbitCalculatedSpatialDomains":[{"EndOrbitNumber":1308,"BeginOrbitNumber":870}],"GranuleUR":"SMAP_RSS_L3_SSS_SMI_MONTHLY_V4","ProviderDates":[{"Type":"Insert","Date":"2024-04-17T00:53:28.476Z"},{"Type":"Update","Date":"2024-04-17T00:53:28.486Z"}],"SpatialExtent":{"HorizontalSpatialDomain":{"Geometry":{"BoundingRectangles":[{"WestBoundingCoordinate":0.125,"SouthBoundingCoordinate":-89.875,"EastBoundingCoordinate":359.875,"NorthBoundingCoordinate":89.875}]}}},"DataGranule":{"ArchiveAndDistributionInformation":[],"DayNightFlag":"Unspecified","ProductionDateTime":"2019-08-01T22:38:36.000Z"},"CollectionReference":{"Version":"4.2","ShortName":"MODIS_T-JPL-L2P-v2014.0"},"RelatedUrls":[{"Type":"GET DATA","Description":"The base directory location for the granule.","URL":"s3:\/\/a\/path\/to\/s3"}]} \ No newline at end of file diff --git a/src/test/resources/ummgResults/sentinel6/S6A_P4_2__LR_STD__ST_022_131_20210618T232816_20210619T002429_F02_notOverIDL.json b/src/test/resources/ummgResults/sentinel6/S6A_P4_2__LR_STD__ST_022_131_20210618T232816_20210619T002429_F02_notOverIDL.json new file mode 100644 index 0000000..705f2ac --- /dev/null +++ b/src/test/resources/ummgResults/sentinel6/S6A_P4_2__LR_STD__ST_022_131_20210618T232816_20210619T002429_F02_notOverIDL.json @@ -0,0 +1 @@ +{"TemporalExtent":{"RangeDateTime":{"EndingDateTime":"2021-06-19T00:24:29.471Z","BeginningDateTime":"2021-06-18T23:28:16.542Z"}},"MetadataSpecification":{"Version":"1.6.5","URL":"https:\/\/cdn.earthdata.nasa.gov\/umm\/granule\/v1.6.5","Name":"UMM-G"},"GranuleUR":"S6A_P4_2__LR_STD__ST_022_131_20210618T232816_20210619T002429_F02","ProviderDates":[{"Type":"Insert","Date":"2024-04-17T22:56:28.512Z"},{"Type":"Update","Date":"2024-04-17T22:56:28.514Z"}],"SpatialExtent":{"HorizontalSpatialDomain":{"Geometry":{"GPolygons":[{"Boundary":{"Points":[{"Latitude":-65.649768,"Longitude":-25.561001},{"Latitude":-66.644101,"Longitude":-25.454693},{"Latitude":-63.597255,"Longitude":2.884525},{"Latitude":-56.022254,"Longitude":22.501876},{"Latitude":-46.176484,"Longitude":34.738356},{"Latitude":-35.287184,"Longitude":42.821997},{"Latitude":-23.891329,"Longitude":48.714422},{"Latitude":-12.243013,"Longitude":53.479583},{"Latitude":-0.492119,"Longitude":57.755247},{"Latitude":11.245057,"Longitude":62.012329},{"Latitude":22.847334,"Longitude":66.712901},{"Latitude":34.159401,"Longitude":72.465261},{"Latitude":44.931266,"Longitude":80.267339},{"Latitude":54.690314,"Longitude":91.997549},{"Latitude":62.326143,"Longitude":110.882612},{"Latitude":65.638561,"Longitude":138.707184},{"Latitude":65.64749,"Longitude":140.321732},{"Latitude":66.647475,"Longitude":140.316202},{"Latitude":66.638546,"Longitude":138.701654},{"Latitude":63.319145,"Longitude":110.764513},{"Latitude":55.61772,"Longitude":91.623494},{"Latitude":45.700998,"Longitude":79.628972},{"Latitude":34.746947,"Longitude":71.65607},{"Latitude":23.301042,"Longitude":65.821751},{"Latitude":11.620689,"Longitude":61.08556},{"Latitude":-0.151127,"Longitude":56.81518},{"Latitude":-11.901085,"Longitude":52.539857},{"Latitude":-23.512671,"Longitude":47.788885},{"Latitude":-34.827746,"Longitude":41.933788},{"Latitude":-45.580038,"Longitude":33.935703},{"Latitude":-55.2425,"Longitude":21.87579},{"Latitude":-62.663981,"Longitude":2.525361},{"Latitude":-65.649768,"Longitude":-25.561001}]}}]},"Track":{"Cycle":22,"Passes":[{"Pass":131}]}}},"AdditionalAttributes":[{"Values":["S6A_P4_2__LR______20210618T232816_20210619T002429_20210619T220302_3373_022_131_065_EUM__OPE_ST_F02.SEN6"],"Name":"ProviderDataSource"}],"DataGranule":{"DayNightFlag":"Unspecified","ProductionDateTime":"2021-06-19T22:10:40.000Z"},"CollectionReference":{"Version":"E","ShortName":"JASON_CS_S6A_L0_ALT_ACQ"}} \ No newline at end of file diff --git a/src/test/resources/ummgResults/sentinel6/S6A_P4_2__LR_STD__ST_022_132_20210619T002429_20210619T012042_F02_overIde.json b/src/test/resources/ummgResults/sentinel6/S6A_P4_2__LR_STD__ST_022_132_20210619T002429_20210619T012042_F02_overIde.json new file mode 100644 index 0000000..5fdc9d2 --- /dev/null +++ b/src/test/resources/ummgResults/sentinel6/S6A_P4_2__LR_STD__ST_022_132_20210619T002429_20210619T012042_F02_overIde.json @@ -0,0 +1 @@ +{"TemporalExtent":{"RangeDateTime":{"EndingDateTime":"2021-06-19T01:20:42.499Z","BeginningDateTime":"2021-06-19T00:24:29.521Z"}},"MetadataSpecification":{"Version":"1.6.5","URL":"https:\/\/cdn.earthdata.nasa.gov\/umm\/granule\/v1.6.5","Name":"UMM-G"},"GranuleUR":"S6A_P4_2__LR_STD__ST_022_132_20210619T002429_20210619T012042_F02","ProviderDates":[{"Type":"Insert","Date":"2024-04-17T21:48:16.012Z"},{"Type":"Update","Date":"2024-04-17T21:48:16.014Z"}],"SpatialExtent":{"HorizontalSpatialDomain":{"Geometry":{"GPolygons":[{"Boundary":{"Points":[{"Latitude":66.644644,"Longitude":140.378601},{"Latitude":65.650321,"Longitude":140.272202},{"Latitude":62.660913,"Longitude":168.368305},{"Latitude":58.947656,"Longitude":180.0},{"Latitude":59.804021000000006,"Longitude":180.0},{"Latitude":63.594104,"Longitude":168.727685},{"Latitude":66.644644,"Longitude":140.378601}]}},{"Boundary":{"Points":[{"Latitude":59.804021000000006,"Longitude":-180.0},{"Latitude":58.947656,"Longitude":-180.0},{"Latitude":55.234399,"Longitude":-172.281509},{"Latitude":45.565597,"Longitude":-160.222191},{"Latitude":34.808176,"Longitude":-152.225714},{"Latitude":23.489431,"Longitude":-146.37198},{"Latitude":11.875462,"Longitude":-141.621838},{"Latitude":0.12445,"Longitude":-137.34684},{"Latitude":-11.647688,"Longitude":-133.076034},{"Latitude":-23.32745,"Longitude":-128.33854},{"Latitude":-34.770171,"Longitude":-122.502557},{"Latitude":-45.72047,"Longitude":-114.526255},{"Latitude":-55.63104,"Longitude":-102.528062},{"Latitude":-63.325503,"Longitude":-83.384567},{"Latitude":-66.639085,"Longitude":-55.450611},{"Latitude":-66.647778,"Longitude":-53.840211},{"Latitude":-65.647793,"Longitude":-53.834813},{"Latitude":-65.6391,"Longitude":-55.445213},{"Latitude":-62.332478,"Longitude":-83.266658},{"Latitude":-54.7035,"Longitude":-102.15434},{"Latitude":-44.950447,"Longitude":-113.888239},{"Latitude":-34.182329,"Longitude":-121.69358},{"Latitude":-22.87354,"Longitude":-127.447493},{"Latitude":-11.271951,"Longitude":-132.149308},{"Latitude":0.465463,"Longitude":-136.406782},{"Latitude":12.21734,"Longitude":-140.682094},{"Latitude":23.867966,"Longitude":-145.446393},{"Latitude":35.267412,"Longitude":-151.3374},{"Latitude":46.161783,"Longitude":-159.419345},{"Latitude":56.013938,"Longitude":-171.655155},{"Latitude":59.804021000000006,"Longitude":-180.0}]}}]},"Track":{"Cycle":22,"Passes":[{"Pass":132}]}}},"AdditionalAttributes":[{"Values":["S6A_P4_2__LR______20210619T002429_20210619T012042_20210619T221048_3373_022_132_066_EUM__OPE_ST_F02.SEN6"],"Name":"ProviderDataSource"}],"DataGranule":{"DayNightFlag":"Unspecified","ProductionDateTime":"2021-06-19T22:17:31.000Z"},"CollectionReference":{"Version":"E","ShortName":"JASON_CS_S6A_L0_ALT_ACQ"}} \ No newline at end of file diff --git a/src/test/resources/ummgResults/swotArchiveXml/SWOT_IVK_20210612T081400_20210612T072103_20210612T080137_O_APID1402.PTM_1.archive.json b/src/test/resources/ummgResults/swotArchiveXml/SWOT_IVK_20210612T081400_20210612T072103_20210612T080137_O_APID1402.PTM_1.archive.json new file mode 100644 index 0000000..06f1882 --- /dev/null +++ b/src/test/resources/ummgResults/swotArchiveXml/SWOT_IVK_20210612T081400_20210612T072103_20210612T080137_O_APID1402.PTM_1.archive.json @@ -0,0 +1 @@ +{"TemporalExtent":{"RangeDateTime":{"EndingDateTime":"2021-06-12T07:47:28.000Z","BeginningDateTime":"2021-06-12T07:33:57.000Z"}},"MetadataSpecification":{"Version":"1.6.5","URL":"https:\/\/cdn.earthdata.nasa.gov\/umm\/granule\/v1.6.5","Name":"UMM-G"},"GranuleUR":"SWOT_IVK_20210612T081400_20210612T072103_20210612T080137_O_APID1402","ProviderDates":[{"Type":"Insert","Date":"2024-04-17T00:08:56.756Z"},{"Type":"Update","Date":"2024-04-17T00:08:56.762Z"}],"SpatialExtent":{"HorizontalSpatialDomain":{"Geometry":{"BoundingRectangles":[{"WestBoundingCoordinate":-180.000,"SouthBoundingCoordinate":-90.000,"EastBoundingCoordinate":180.000,"NorthBoundingCoordinate":90.000}]},"Track":{"Cycle":22,"Passes":[{"Pass":33,"Tiles":["jasper 33"]}]}}},"AdditionalAttributes":[{"Values":["jasper 33"],"Name":"TILE"}],"DataGranule":{"ArchiveAndDistributionInformation":[],"DayNightFlag":"Unspecified","ProductionDateTime":"2021-06-12T08:14:00.000Z"},"CollectionReference":{"Version":"4.2","ShortName":"MODIS_T-JPL-L2P-v2014.0"},"RelatedUrls":[]} \ No newline at end of file diff --git a/src/test/resources/ummgResults/swotCalVal/SWOTCalVal_WM_ADCP_L0_RiverRay1_20220727T191701_20220727T192858_20220920T142800_swotCalVal_ummg.json b/src/test/resources/ummgResults/swotCalVal/SWOTCalVal_WM_ADCP_L0_RiverRay1_20220727T191701_20220727T192858_20220920T142800_swotCalVal_ummg.json new file mode 100644 index 0000000..0fca684 --- /dev/null +++ b/src/test/resources/ummgResults/swotCalVal/SWOTCalVal_WM_ADCP_L0_RiverRay1_20220727T191701_20220727T192858_20220920T142800_swotCalVal_ummg.json @@ -0,0 +1 @@ +{"TemporalExtent":{"RangeDateTime":{"EndingDateTime":"2022-07-27T19:28:58.000Z","BeginningDateTime":"2022-07-27T19:17:01.000Z"}},"MetadataSpecification":{"Version":"1.6.5","URL":"https:\/\/cdn.earthdata.nasa.gov\/umm\/granule\/v1.6.5","Name":"UMM-G"},"GranuleUR":"SWOTCalVal_WM_ADCP_L0_RiverRay1_20220727T191701_20220727T192858_20220920T142800","ProviderDates":[{"Type":"Insert","Date":"2024-04-16T01:22:44.289Z"},{"Type":"Update","Date":"2024-04-16T01:22:44.295Z"}],"SpatialExtent":{"HorizontalSpatialDomain":{"Geometry":{"BoundingRectangles":[{"WestBoundingCoordinate":-123.304,"SouthBoundingCoordinate":44.506,"EastBoundingCoordinate":-123.029,"NorthBoundingCoordinate":44.697}]}}},"DataGranule":{"ArchiveAndDistributionInformation":[],"DayNightFlag":"Unspecified","ProductionDateTime":"2022-09-20T14:28:00.000Z"},"CollectionReference":{"Version":"4.2","ShortName":"MODIS_T-JPL-L2P-v2014.0"},"RelatedUrls":[]} \ No newline at end of file diff --git a/src/test/resources/ummgResults/swotIsoXMLSpatialType/SWOT_L2_LR_SSH_Basic_006_143_20231107T150730_20231107T155607_PIB0_01_bbox.json b/src/test/resources/ummgResults/swotIsoXMLSpatialType/SWOT_L2_LR_SSH_Basic_006_143_20231107T150730_20231107T155607_PIB0_01_bbox.json new file mode 100644 index 0000000..762809f --- /dev/null +++ b/src/test/resources/ummgResults/swotIsoXMLSpatialType/SWOT_L2_LR_SSH_Basic_006_143_20231107T150730_20231107T155607_PIB0_01_bbox.json @@ -0,0 +1 @@ +{"InputGranules":["SWOT_GranulePolygons_Nom_20230213T142900_v05.json","SWOT_INT_LR_XOverCal_20231106T233827_20231107T233918_PIB0_01.nc","SWOT_L2_LR_PreCalSSH_Basic_006_143_20231107T150730_20231107T155607_PIB0_01.nc","SWOT_L2_LR_PreCalSSH_Expert_006_143_20231107T150730_20231107T155607_PIB0_01.nc","SWOT_L2_LR_PreCalSSH_Unsmoothed_006_143_20231107T150440_20231107T155606_PIB0_01.nc","SWOT_L2_LR_PreCalSSH_WindWave_006_143_20231107T150730_20231107T155607_PIB0_01.nc","SWOT_NC_Compression_L2_LR_SSH_Basic_20210728T100000_v004.yaml","SWOT_NC_Compression_L2_LR_SSH_Expert_20210728T100000_v004.yaml","SWOT_NC_Compression_L2_LR_SSH_Unsmoothed_20210728T100000_v004.yaml","SWOT_NC_Compression_L2_LR_SSH_WindWave_20210728T100000_v004.yaml","SWOT_ORF_AXXCNE20231109_104300_20230720_200750_20231124_075610"],"TemporalExtent":{"RangeDateTime":{"EndingDateTime":"2023-11-07T15:56:22.407Z","BeginningDateTime":"2023-11-07T15:04:24.790Z"}},"MetadataSpecification":{"Version":"1.6.5","URL":"https:\/\/cdn.earthdata.nasa.gov\/umm\/granule\/v1.6.5","Name":"UMM-G"},"Platforms":[{"Instruments":[{"ShortName":"KaRIn"}],"ShortName":"SWOT"}],"GranuleUR":"SWOT_L2_LR_SSH_Basic_006_143_20231107T150730_20231107T155607_PIB0_01","ProviderDates":[{"Type":"Insert","Date":"2024-04-15T23:29:43.669Z"},{"Type":"Update","Date":"2024-04-15T23:29:43.670Z"}],"MeasuredParameters":[{"QAStats":{"QAPercentMissingData":0.0,"QAPercentOutOfBoundsData":0.0},"ParameterName":"N\/A"}],"SpatialExtent":{"HorizontalSpatialDomain":{"Geometry":{"BoundingRectangles":[{"WestBoundingCoordinate":-121.76947499999999990905052982270717620849609375,"SouthBoundingCoordinate":-78.271941999999995687176124192774295806884765625,"EastBoundingCoordinate":45.675058000000035463017411530017852783203125,"NorthBoundingCoordinate":78.272067999999990206561051309108734130859375}]},"Track":{"Cycle":6,"Passes":[{"Pass":143}]}}},"PGEVersionClass":{"PGEName":"PGE_L2_LR_SSH","PGEVersion":"4.3.0"},"DataGranule":{"ArchiveAndDistributionInformation":[],"DayNightFlag":"Unspecified","Identifiers":[{"Identifier":"SWOT_L2_LR_SSH_Basic_006_143_20231107T150730_20231107T155607_PIB0_01.nc","IdentifierType":"ProducerGranuleId"},{"Identifier":"PIB0","IdentifierType":"CRID"},{"Identifier":"1.1","IdentifierType":"Other","IdentifierName":"SASVersionId"},{"Identifier":"4.3.0","IdentifierType":"Other","IdentifierName":"PGEVersionId"},{"Identifier":"ICV01 CollectionVersion filler","IdentifierType":"Other","IdentifierName":"ScienceAlgorithmVersionId"},{"Identifier":"01","IdentifierType":"Other","IdentifierName":"ProductCounter"}],"ReprocessingPlanned":"None","ProductionDateTime":"2023-11-10T01:03:13.602Z"},"CollectionReference":{"Version":"4.2","ShortName":"MODIS_T-JPL-L2P-v2014.0"},"RelatedUrls":[{"Type":"GET DATA","Description":"The base directory location for the granule.","URL":"s3:\/\/fake_bucket\/fake_dir\/fake.nc.iso.xml"}]} \ No newline at end of file diff --git a/src/test/resources/ummgResults/swotIsoXMLSpatialType/SWOT_L2_LR_SSH_Basic_006_143_20231107T150730_20231107T155607_PIB0_01_footprint.json b/src/test/resources/ummgResults/swotIsoXMLSpatialType/SWOT_L2_LR_SSH_Basic_006_143_20231107T150730_20231107T155607_PIB0_01_footprint.json new file mode 100644 index 0000000..10a32dd --- /dev/null +++ b/src/test/resources/ummgResults/swotIsoXMLSpatialType/SWOT_L2_LR_SSH_Basic_006_143_20231107T150730_20231107T155607_PIB0_01_footprint.json @@ -0,0 +1 @@ +{"InputGranules":["SWOT_GranulePolygons_Nom_20230213T142900_v05.json","SWOT_INT_LR_XOverCal_20231106T233827_20231107T233918_PIB0_01.nc","SWOT_L2_LR_PreCalSSH_Basic_006_143_20231107T150730_20231107T155607_PIB0_01.nc","SWOT_L2_LR_PreCalSSH_Expert_006_143_20231107T150730_20231107T155607_PIB0_01.nc","SWOT_L2_LR_PreCalSSH_Unsmoothed_006_143_20231107T150440_20231107T155606_PIB0_01.nc","SWOT_L2_LR_PreCalSSH_WindWave_006_143_20231107T150730_20231107T155607_PIB0_01.nc","SWOT_NC_Compression_L2_LR_SSH_Basic_20210728T100000_v004.yaml","SWOT_NC_Compression_L2_LR_SSH_Expert_20210728T100000_v004.yaml","SWOT_NC_Compression_L2_LR_SSH_Unsmoothed_20210728T100000_v004.yaml","SWOT_NC_Compression_L2_LR_SSH_WindWave_20210728T100000_v004.yaml","SWOT_ORF_AXXCNE20231109_104300_20230720_200750_20231124_075610"],"TemporalExtent":{"RangeDateTime":{"EndingDateTime":"2023-11-07T15:56:22.407Z","BeginningDateTime":"2023-11-07T15:04:24.790Z"}},"MetadataSpecification":{"Version":"1.6.5","URL":"https:\/\/cdn.earthdata.nasa.gov\/umm\/granule\/v1.6.5","Name":"UMM-G"},"Platforms":[{"Instruments":[{"ShortName":"KaRIn"}],"ShortName":"SWOT"}],"GranuleUR":"SWOT_L2_LR_SSH_Basic_006_143_20231107T150730_20231107T155607_PIB0_01","ProviderDates":[{"Type":"Insert","Date":"2024-04-15T23:00:42.217Z"},{"Type":"Update","Date":"2024-04-15T23:00:42.217Z"}],"MeasuredParameters":[{"QAStats":{"QAPercentMissingData":0.0,"QAPercentOutOfBoundsData":0.0},"ParameterName":"N\/A"}],"SpatialExtent":{"HorizontalSpatialDomain":{"Geometry":{"GPolygons":[{"Boundary":{"Points":[{"Latitude":-77.089598228,"Longitude":-121.56652283899999},{"Latitude":-78.236115915,"Longitude":-121.56652283899999},{"Latitude":-76.876353092,"Longitude":-95.245089678},{"Latitude":-73.481988386,"Longitude":-76.96015316400002},{"Latitude":-69.017288841,"Longitude":-65.63322022},{"Latitude":-64.027313382,"Longitude":-58.444391250000024},{"Latitude":-58.761539499,"Longitude":-53.60629767299997},{"Latitude":-53.337452313,"Longitude":-50.161069277000024},{"Latitude":-47.815098058,"Longitude":-47.586810222},{"Latitude":-42.227832282,"Longitude":-45.583396859000004},{"Latitude":-36.5956463,"Longitude":-43.967991487999996},{"Latitude":-30.93139442,"Longitude":-42.62300134700001},{"Latitude":-25.243922948,"Longitude":-41.46885623999998},{"Latitude":-19.539745533,"Longitude":-40.44897850299998},{"Latitude":-13.823991705,"Longitude":-39.52101994700001},{"Latitude":-8.100972727,"Longitude":-38.65145055400001},{"Latitude":-2.374539997,"Longitude":-37.81198303999997},{"Latitude":0.488816703,"Longitude":-37.395484400999976},{"Latitude":6.213560933,"Longitude":-36.55337174800002},{"Latitude":11.932599736,"Longitude":-35.67772328000001},{"Latitude":17.641983548,"Longitude":-34.74051516100002},{"Latitude":23.337243263,"Longitude":-33.70876345900001},{"Latitude":29.013029157,"Longitude":-32.54118567799998},{"Latitude":34.662546094,"Longitude":-31.183259725000028},{"Latitude":40.276622422,"Longitude":-29.559408804999975},{"Latitude":45.842100123,"Longitude":-27.559952510000016},{"Latitude":51.338911739,"Longitude":-25.018224615999998},{"Latitude":56.734470077,"Longitude":-21.668558564000023},{"Latitude":61.972216352,"Longitude":-17.066154213999994},{"Latitude":66.946763054,"Longitude":-10.433090223000022},{"Latitude":71.447935666,"Longitude":-0.39442901799998253},{"Latitude":75.044865485,"Longitude":15.185708156},{"Latitude":76.968276197,"Longitude":37.662916096},{"Latitude":78.102910198,"Longitude":36.899181012},{"Latitude":76.019975969,"Longitude":12.769937871},{"Latitude":72.220320073,"Longitude":-3.1137959949999754},{"Latitude":67.558606653,"Longitude":-12.942241278999973},{"Latitude":62.468077627,"Longitude":-19.285798596999996},{"Latitude":57.14621816,"Longitude":-23.631973963999997},{"Latitude":51.688178369,"Longitude":-26.775112310999987},{"Latitude":46.143853744,"Longitude":-29.154443990999994},{"Latitude":40.541623404,"Longitude":-31.02701495299999},{"Latitude":34.898867444,"Longitude":-32.552058708000004},{"Latitude":29.226993856,"Longitude":-33.833589115999985},{"Latitude":23.534015403,"Longitude":-34.94304256800001},{"Latitude":17.825953694,"Longitude":-35.93198489600002},{"Latitude":12.107646429,"Longitude":-36.83964491199998},{"Latitude":6.383237199,"Longitude":-37.69765486900002},{"Latitude":0.656492138,"Longitude":-38.533258386},{"Latitude":-2.206626058,"Longitude":-38.950569207},{"Latitude":-7.930093263,"Longitude":-39.79983851100002},{"Latitude":-13.646733081,"Longitude":-40.69051906300001},{"Latitude":-19.352469895,"Longitude":-41.65184012899999},{"Latitude":-25.042615437,"Longitude":-42.71887793000002},{"Latitude":-30.711458165,"Longitude":-43.93628115199999},{"Latitude":-36.351610213,"Longitude":-45.36390657999999},{"Latitude":-41.952914779,"Longitude":-47.08588716700001},{"Latitude":-47.500530492,"Longitude":-49.226003091999985},{"Latitude":-52.971396993,"Longitude":-51.975021656000024},{"Latitude":-58.327328868,"Longitude":-55.64154334599999},{"Latitude":-63.500646942,"Longitude":-60.749701372000004},{"Latitude":-68.362496198,"Longitude":-68.224467973},{"Latitude":-72.651811342,"Longitude":-79.67691136100001},{"Latitude":-75.841080029,"Longitude":-97.33596427600003},{"Latitude":-77.089598228,"Longitude":-121.56652283899999}]}}]},"Track":{"Cycle":6,"Passes":[{"Pass":143}]}}},"PGEVersionClass":{"PGEName":"PGE_L2_LR_SSH","PGEVersion":"4.3.0"},"DataGranule":{"ArchiveAndDistributionInformation":[],"DayNightFlag":"Unspecified","Identifiers":[{"Identifier":"SWOT_L2_LR_SSH_Basic_006_143_20231107T150730_20231107T155607_PIB0_01.nc","IdentifierType":"ProducerGranuleId"},{"Identifier":"PIB0","IdentifierType":"CRID"},{"Identifier":"1.1","IdentifierType":"Other","IdentifierName":"SASVersionId"},{"Identifier":"4.3.0","IdentifierType":"Other","IdentifierName":"PGEVersionId"},{"Identifier":"ICV01 CollectionVersion filler","IdentifierType":"Other","IdentifierName":"ScienceAlgorithmVersionId"},{"Identifier":"01","IdentifierType":"Other","IdentifierName":"ProductCounter"}],"ReprocessingPlanned":"None","ProductionDateTime":"2023-11-10T01:03:13.602Z"},"CollectionReference":{"Version":"4.2","ShortName":"MODIS_T-JPL-L2P-v2014.0"},"RelatedUrls":[{"Type":"GET DATA","Description":"The base directory location for the granule.","URL":"s3:\/\/fake_bucket\/fake_dir\/fake.nc.iso.xml"}]} \ No newline at end of file diff --git a/src/test/resources/ummgResults/swotIsoXMLSpatialType/SWOT_L2_LR_SSH_Basic_006_143_20231107T150730_20231107T155607_PIB0_01_footprintOrbitBBox.json b/src/test/resources/ummgResults/swotIsoXMLSpatialType/SWOT_L2_LR_SSH_Basic_006_143_20231107T150730_20231107T155607_PIB0_01_footprintOrbitBBox.json new file mode 100644 index 0000000..e96b3eb --- /dev/null +++ b/src/test/resources/ummgResults/swotIsoXMLSpatialType/SWOT_L2_LR_SSH_Basic_006_143_20231107T150730_20231107T155607_PIB0_01_footprintOrbitBBox.json @@ -0,0 +1,404 @@ +{ + "InputGranules": [ + "SWOT_GranulePolygons_Nom_20230213T142900_v05.json", + "SWOT_INT_LR_XOverCal_20231106T233827_20231107T233918_PIB0_01.nc", + "SWOT_L2_LR_PreCalSSH_Basic_006_143_20231107T150730_20231107T155607_PIB0_01.nc", + "SWOT_L2_LR_PreCalSSH_Expert_006_143_20231107T150730_20231107T155607_PIB0_01.nc", + "SWOT_L2_LR_PreCalSSH_Unsmoothed_006_143_20231107T150440_20231107T155606_PIB0_01.nc", + "SWOT_L2_LR_PreCalSSH_WindWave_006_143_20231107T150730_20231107T155607_PIB0_01.nc", + "SWOT_NC_Compression_L2_LR_SSH_Basic_20210728T100000_v004.yaml", + "SWOT_NC_Compression_L2_LR_SSH_Expert_20210728T100000_v004.yaml", + "SWOT_NC_Compression_L2_LR_SSH_Unsmoothed_20210728T100000_v004.yaml", + "SWOT_NC_Compression_L2_LR_SSH_WindWave_20210728T100000_v004.yaml", + "SWOT_ORF_AXXCNE20231109_104300_20230720_200750_20231124_075610" + ], + "TemporalExtent": { + "RangeDateTime": { + "EndingDateTime": "2023-11-07T15:56:22.407Z", + "BeginningDateTime": "2023-11-07T15:04:24.790Z" + } + }, + "MetadataSpecification": { + "Version": "1.6.5", + "URL": "https://cdn.earthdata.nasa.gov/umm/granule/v1.6.5", + "Name": "UMM-G" + }, + "Platforms": [ + { + "Instruments": [ + { + "ShortName": "KaRIn" + } + ], + "ShortName": "SWOT" + } + ], + "GranuleUR": "SWOT_L2_LR_SSH_Basic_006_143_20231107T150730_20231107T155607_PIB0_01", + "ProviderDates": [ + { + "Type": "Insert", + "Date": "2024-04-14T02:56:08.719Z" + }, + { + "Type": "Update", + "Date": "2024-04-14T02:56:08.721Z" + } + ], + "MeasuredParameters": [ + { + "QAStats": { + "QAPercentMissingData": 0.0, + "QAPercentOutOfBoundsData": 0.0 + }, + "ParameterName": "N/A" + } + ], + "SpatialExtent": { + "HorizontalSpatialDomain": { + "Geometry": { + "GPolygons": [ + { + "Boundary": { + "Points": [ + { + "Latitude": -77.089598228, + "Longitude": -121.56652283899999 + }, + { + "Latitude": -78.236115915, + "Longitude": -121.56652283899999 + }, + { + "Latitude": -76.876353092, + "Longitude": -95.245089678 + }, + { + "Latitude": -73.481988386, + "Longitude": -76.96015316400002 + }, + { + "Latitude": -69.017288841, + "Longitude": -65.63322022 + }, + { + "Latitude": -64.027313382, + "Longitude": -58.444391250000024 + }, + { + "Latitude": -58.761539499, + "Longitude": -53.60629767299997 + }, + { + "Latitude": -53.337452313, + "Longitude": -50.161069277000024 + }, + { + "Latitude": -47.815098058, + "Longitude": -47.586810222 + }, + { + "Latitude": -42.227832282, + "Longitude": -45.583396859000004 + }, + { + "Latitude": -36.5956463, + "Longitude": -43.967991487999996 + }, + { + "Latitude": -30.93139442, + "Longitude": -42.62300134700001 + }, + { + "Latitude": -25.243922948, + "Longitude": -41.46885623999998 + }, + { + "Latitude": -19.539745533, + "Longitude": -40.44897850299998 + }, + { + "Latitude": -13.823991705, + "Longitude": -39.52101994700001 + }, + { + "Latitude": -8.100972727, + "Longitude": -38.65145055400001 + }, + { + "Latitude": -2.374539997, + "Longitude": -37.81198303999997 + }, + { + "Latitude": 0.488816703, + "Longitude": -37.395484400999976 + }, + { + "Latitude": 6.213560933, + "Longitude": -36.55337174800002 + }, + { + "Latitude": 11.932599736, + "Longitude": -35.67772328000001 + }, + { + "Latitude": 17.641983548, + "Longitude": -34.74051516100002 + }, + { + "Latitude": 23.337243263, + "Longitude": -33.70876345900001 + }, + { + "Latitude": 29.013029157, + "Longitude": -32.54118567799998 + }, + { + "Latitude": 34.662546094, + "Longitude": -31.183259725000028 + }, + { + "Latitude": 40.276622422, + "Longitude": -29.559408804999975 + }, + { + "Latitude": 45.842100123, + "Longitude": -27.559952510000016 + }, + { + "Latitude": 51.338911739, + "Longitude": -25.018224615999998 + }, + { + "Latitude": 56.734470077, + "Longitude": -21.668558564000023 + }, + { + "Latitude": 61.972216352, + "Longitude": -17.066154213999994 + }, + { + "Latitude": 66.946763054, + "Longitude": -10.433090223000022 + }, + { + "Latitude": 71.447935666, + "Longitude": -0.39442901799998253 + }, + { + "Latitude": 75.044865485, + "Longitude": 15.185708156 + }, + { + "Latitude": 76.968276197, + "Longitude": 37.662916096 + }, + { + "Latitude": 78.102910198, + "Longitude": 36.899181012 + }, + { + "Latitude": 76.019975969, + "Longitude": 12.769937871 + }, + { + "Latitude": 72.220320073, + "Longitude": -3.1137959949999754 + }, + { + "Latitude": 67.558606653, + "Longitude": -12.942241278999973 + }, + { + "Latitude": 62.468077627, + "Longitude": -19.285798596999996 + }, + { + "Latitude": 57.14621816, + "Longitude": -23.631973963999997 + }, + { + "Latitude": 51.688178369, + "Longitude": -26.775112310999987 + }, + { + "Latitude": 46.143853744, + "Longitude": -29.154443990999994 + }, + { + "Latitude": 40.541623404, + "Longitude": -31.02701495299999 + }, + { + "Latitude": 34.898867444, + "Longitude": -32.552058708000004 + }, + { + "Latitude": 29.226993856, + "Longitude": -33.833589115999985 + }, + { + "Latitude": 23.534015403, + "Longitude": -34.94304256800001 + }, + { + "Latitude": 17.825953694, + "Longitude": -35.93198489600002 + }, + { + "Latitude": 12.107646429, + "Longitude": -36.83964491199998 + }, + { + "Latitude": 6.383237199, + "Longitude": -37.69765486900002 + }, + { + "Latitude": 0.656492138, + "Longitude": -38.533258386 + }, + { + "Latitude": -2.206626058, + "Longitude": -38.950569207 + }, + { + "Latitude": -7.930093263, + "Longitude": -39.79983851100002 + }, + { + "Latitude": -13.646733081, + "Longitude": -40.69051906300001 + }, + { + "Latitude": -19.352469895, + "Longitude": -41.65184012899999 + }, + { + "Latitude": -25.042615437, + "Longitude": -42.71887793000002 + }, + { + "Latitude": -30.711458165, + "Longitude": -43.93628115199999 + }, + { + "Latitude": -36.351610213, + "Longitude": -45.36390657999999 + }, + { + "Latitude": -41.952914779, + "Longitude": -47.08588716700001 + }, + { + "Latitude": -47.500530492, + "Longitude": -49.226003091999985 + }, + { + "Latitude": -52.971396993, + "Longitude": -51.975021656000024 + }, + { + "Latitude": -58.327328868, + "Longitude": -55.64154334599999 + }, + { + "Latitude": -63.500646942, + "Longitude": -60.749701372000004 + }, + { + "Latitude": -68.362496198, + "Longitude": -68.224467973 + }, + { + "Latitude": -72.651811342, + "Longitude": -79.67691136100001 + }, + { + "Latitude": -75.841080029, + "Longitude": -97.33596427600003 + }, + { + "Latitude": -77.089598228, + "Longitude": -121.56652283899999 + } + ] + } + } + ], + "BoundingRectangles": [ + { + "WestBoundingCoordinate": -121.76947499999999990905052982270717620849609375, + "SouthBoundingCoordinate": -78.271941999999995687176124192774295806884765625, + "EastBoundingCoordinate": 45.675058000000035463017411530017852783203125, + "NorthBoundingCoordinate": 78.272067999999990206561051309108734130859375 + } + ] + }, + "Orbit": { + "StartLatitude": -77.66, + "EndLatitude": 77.66, + "AscendingCrossing": -38.05, + "StartDirection": "A", + "EndDirection": "A" + }, + "Track": { + "Cycle": 6, + "Passes": [ + { + "Pass": 143 + } + ] + } + } + }, + "PGEVersionClass": { + "PGEName": "PGE_L2_LR_SSH", + "PGEVersion": "4.3.0" + }, + "DataGranule": { + "ArchiveAndDistributionInformation": [], + "DayNightFlag": "Unspecified", + "Identifiers": [ + { + "Identifier": "SWOT_L2_LR_SSH_Basic_006_143_20231107T150730_20231107T155607_PIB0_01.nc", + "IdentifierType": "ProducerGranuleId" + }, + { + "Identifier": "PIB0", + "IdentifierType": "CRID" + }, + { + "Identifier": "1.1", + "IdentifierType": "Other", + "IdentifierName": "SASVersionId" + }, + { + "Identifier": "4.3.0", + "IdentifierType": "Other", + "IdentifierName": "PGEVersionId" + }, + { + "Identifier": "ICV01 CollectionVersion filler", + "IdentifierType": "Other", + "IdentifierName": "ScienceAlgorithmVersionId" + }, + { + "Identifier": "01", + "IdentifierType": "Other", + "IdentifierName": "ProductCounter" + } + ], + "ReprocessingPlanned": "None", + "ProductionDateTime": "2023-11-10T01:03:13.602Z" + }, + "CollectionReference": { + "Version": "4.2", + "ShortName": "MODIS_T-JPL-L2P-v2014.0" + }, + "RelatedUrls": [ + { + "Type": "GET DATA", + "Description": "The base directory location for the granule.", + "URL": "s3://fake_bucket/fake_dir/fake.nc.iso.xml" + } + ] +} \ No newline at end of file diff --git a/src/test/resources/ummgResults/swotIsoXMLSpatialType/SWOT_L2_LR_SSH_Basic_006_143_20231107T150730_20231107T155607_PIB0_01_orbit.json b/src/test/resources/ummgResults/swotIsoXMLSpatialType/SWOT_L2_LR_SSH_Basic_006_143_20231107T150730_20231107T155607_PIB0_01_orbit.json new file mode 100644 index 0000000..e0705ba --- /dev/null +++ b/src/test/resources/ummgResults/swotIsoXMLSpatialType/SWOT_L2_LR_SSH_Basic_006_143_20231107T150730_20231107T155607_PIB0_01_orbit.json @@ -0,0 +1 @@ +{"InputGranules":["SWOT_GranulePolygons_Nom_20230213T142900_v05.json","SWOT_INT_LR_XOverCal_20231106T233827_20231107T233918_PIB0_01.nc","SWOT_L2_LR_PreCalSSH_Basic_006_143_20231107T150730_20231107T155607_PIB0_01.nc","SWOT_L2_LR_PreCalSSH_Expert_006_143_20231107T150730_20231107T155607_PIB0_01.nc","SWOT_L2_LR_PreCalSSH_Unsmoothed_006_143_20231107T150440_20231107T155606_PIB0_01.nc","SWOT_L2_LR_PreCalSSH_WindWave_006_143_20231107T150730_20231107T155607_PIB0_01.nc","SWOT_NC_Compression_L2_LR_SSH_Basic_20210728T100000_v004.yaml","SWOT_NC_Compression_L2_LR_SSH_Expert_20210728T100000_v004.yaml","SWOT_NC_Compression_L2_LR_SSH_Unsmoothed_20210728T100000_v004.yaml","SWOT_NC_Compression_L2_LR_SSH_WindWave_20210728T100000_v004.yaml","SWOT_ORF_AXXCNE20231109_104300_20230720_200750_20231124_075610"],"TemporalExtent":{"RangeDateTime":{"EndingDateTime":"2023-11-07T15:56:22.407Z","BeginningDateTime":"2023-11-07T15:04:24.790Z"}},"MetadataSpecification":{"Version":"1.6.5","URL":"https:\/\/cdn.earthdata.nasa.gov\/umm\/granule\/v1.6.5","Name":"UMM-G"},"Platforms":[{"Instruments":[{"ShortName":"KaRIn"}],"ShortName":"SWOT"}],"GranuleUR":"SWOT_L2_LR_SSH_Basic_006_143_20231107T150730_20231107T155607_PIB0_01","ProviderDates":[{"Type":"Insert","Date":"2024-04-15T23:59:46.728Z"},{"Type":"Update","Date":"2024-04-15T23:59:46.738Z"}],"MeasuredParameters":[{"QAStats":{"QAPercentMissingData":0.0,"QAPercentOutOfBoundsData":0.0},"ParameterName":"N\/A"}],"SpatialExtent":{"HorizontalSpatialDomain":{"Orbit":{"StartLatitude":-77.66,"EndLatitude":77.66,"AscendingCrossing":-38.05,"StartDirection":"A","EndDirection":"A"},"Track":{"Cycle":6,"Passes":[{"Pass":143}]}}},"PGEVersionClass":{"PGEName":"PGE_L2_LR_SSH","PGEVersion":"4.3.0"},"DataGranule":{"ArchiveAndDistributionInformation":[],"DayNightFlag":"Unspecified","Identifiers":[{"Identifier":"SWOT_L2_LR_SSH_Basic_006_143_20231107T150730_20231107T155607_PIB0_01.nc","IdentifierType":"ProducerGranuleId"},{"Identifier":"PIB0","IdentifierType":"CRID"},{"Identifier":"1.1","IdentifierType":"Other","IdentifierName":"SASVersionId"},{"Identifier":"4.3.0","IdentifierType":"Other","IdentifierName":"PGEVersionId"},{"Identifier":"ICV01 CollectionVersion filler","IdentifierType":"Other","IdentifierName":"ScienceAlgorithmVersionId"},{"Identifier":"01","IdentifierType":"Other","IdentifierName":"ProductCounter"}],"ReprocessingPlanned":"None","ProductionDateTime":"2023-11-10T01:03:13.602Z"},"CollectionReference":{"Version":"4.2","ShortName":"MODIS_T-JPL-L2P-v2014.0"},"RelatedUrls":[{"Type":"GET DATA","Description":"The base directory location for the granule.","URL":"s3:\/\/fake_bucket\/fake_dir\/fake.nc.iso.xml"}]} \ No newline at end of file