From 4f2cd0ab9e6f01df442e22c7d8832e6f7a6c05a5 Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Tue, 20 Sep 2022 13:28:47 +0200 Subject: [PATCH 1/4] v0.2.0 and #12 --- CHANGELOG.md | 6 +++++- src/stactools/goes_glm/__init__.py | 2 +- src/stactools/goes_glm/stac.py | 6 ++---- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aafe866..62c7757 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [Unreleased] +## [0.2.0] + ### Added - New option `fixnetcdf` for Item creation (see issue [#17](https://github.com/stactools-packages/goes-glm/issues/17) for details) @@ -23,12 +25,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Handle missing `...frame_time_offset...` variables correctly - Handle inconsistencies in the `..._count` variables better -- Don't throw an error if the orbital slot is GOES-Test +- Try to guess the orbital slot based on the platform identifier and throw an error if the orbital slot is still invalid - Handle netCDF files with no events/flashes correctly +- Enabled GOES extension in `stac_extensions` ## [0.1.0] - First release [Unreleased]: +[0.2.0]: [0.1.0]: diff --git a/src/stactools/goes_glm/__init__.py b/src/stactools/goes_glm/__init__.py index 6c7a964..8035e2a 100644 --- a/src/stactools/goes_glm/__init__.py +++ b/src/stactools/goes_glm/__init__.py @@ -14,4 +14,4 @@ def register_plugin(registry: Registry) -> None: registry.register_subcommand(commands.create_goesglm_command) -__version__ = "0.1.0" +__version__ = "0.2.0" diff --git a/src/stactools/goes_glm/stac.py b/src/stactools/goes_glm/stac.py index e46e870..a8a6a71 100644 --- a/src/stactools/goes_glm/stac.py +++ b/src/stactools/goes_glm/stac.py @@ -93,8 +93,7 @@ def create_collection( collection = Collection( stac_extensions=[ - # todo: add extension again once released #12 - # constants.GOES_EXTENSION, + constants.GOES_EXTENSION, constants.PROCESSING_EXTENSION, ], id=id, @@ -284,8 +283,7 @@ def create_item( item = Item( stac_extensions=[ - # todo: add extension again once released #12 - # constants.GOES_EXTENSION, + constants.GOES_EXTENSION, constants.PROCESSING_EXTENSION, ], id=id, From a17c6a25c5ab5e9c14805b75766e22b58fc20e61 Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Thu, 22 Sep 2022 15:51:23 +0200 Subject: [PATCH 2/4] Add goes extension to stac_extensions in examples, minor fixes --- examples/collection.json | 7 ++++--- examples/item.json | 1 + examples/item2.json | 1 + examples/item3.json | 1 + src/stactools/goes_glm/stac.py | 3 ++- 5 files changed, 9 insertions(+), 4 deletions(-) diff --git a/examples/collection.json b/examples/collection.json index 473d509..ea8df65 100644 --- a/examples/collection.json +++ b/examples/collection.json @@ -8,19 +8,19 @@ "rel": "item", "href": "./item.json", "type": "application/geo+json", - "title": "OR_GLM-L2-LCFA_G16_s20203662359400_e20210010000004_c20210010000030" + "title": "OR_GLM-L2-LCFA_G16_s20203662359400_e20210010000004" }, { "rel": "item", "href": "./item2.json", "type": "application/geo+json", - "title": "OR_GLM-L2-LCFA_G17_s20221542100000_e20221542100200_c20221542100217" + "title": "OR_GLM-L2-LCFA_G17_s20221542100000_e20221542100200" }, { "rel": "item", "href": "./item3.json", "type": "application/geo+json", - "title": "OR_GLM-L2-LCFA_G17_s20221542100000_e20221542100200_c20221542100217" + "title": "OR_GLM-L2-LCFA_G17_s20221542100000_e20221542100200" }, { "rel": "root", @@ -62,6 +62,7 @@ } ], "stac_extensions": [ + "https://stac-extensions.github.io/goes/v1.0.0/schema.json", "https://stac-extensions.github.io/processing/v1.1.0/schema.json", "https://stac-extensions.github.io/scientific/v1.0.0/schema.json", "https://stac-extensions.github.io/table/v1.2.0/schema.json", diff --git a/examples/item.json b/examples/item.json index 5729246..212a71b 100644 --- a/examples/item.json +++ b/examples/item.json @@ -663,6 +663,7 @@ 66.56 ], "stac_extensions": [ + "https://stac-extensions.github.io/goes/v1.0.0/schema.json", "https://stac-extensions.github.io/processing/v1.1.0/schema.json", "https://stac-extensions.github.io/projection/v1.0.0/schema.json", "https://stac-extensions.github.io/table/v1.2.0/schema.json", diff --git a/examples/item2.json b/examples/item2.json index 36c6c0d..f206b2c 100644 --- a/examples/item2.json +++ b/examples/item2.json @@ -685,6 +685,7 @@ 66.56 ], "stac_extensions": [ + "https://stac-extensions.github.io/goes/v1.0.0/schema.json", "https://stac-extensions.github.io/processing/v1.1.0/schema.json", "https://stac-extensions.github.io/projection/v1.0.0/schema.json", "https://stac-extensions.github.io/table/v1.2.0/schema.json", diff --git a/examples/item3.json b/examples/item3.json index a4032d0..a08dd5d 100644 --- a/examples/item3.json +++ b/examples/item3.json @@ -606,6 +606,7 @@ 66.56 ], "stac_extensions": [ + "https://stac-extensions.github.io/goes/v1.0.0/schema.json", "https://stac-extensions.github.io/processing/v1.1.0/schema.json", "https://stac-extensions.github.io/projection/v1.0.0/schema.json", "https://stac-extensions.github.io/table/v1.2.0/schema.json", diff --git a/src/stactools/goes_glm/stac.py b/src/stactools/goes_glm/stac.py index 103654f..ae3e2f8 100644 --- a/src/stactools/goes_glm/stac.py +++ b/src/stactools/goes_glm/stac.py @@ -107,7 +107,8 @@ def create_collection( catalog_type=CatalogType.RELATIVE_PUBLISHED, ) - collection.add_link(Link(target=license, rel=RelType.LICENSE, title="License")) + if license is not None: + collection.add_link(Link(target=license, rel=RelType.LICENSE, title="License")) collection.add_link(constants.LINK_LANDING_PAGE) collection.add_link(constants.LINK_USER_GUIDE_MAIN) collection.add_link(constants.LINK_USER_GUIDE_L2_PRODUCTS) From 193887c6513f6e543da955f18519ffdd5b7f0086 Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Thu, 22 Sep 2022 19:05:21 +0200 Subject: [PATCH 3/4] Align with GOES extension --- CHANGELOG.md | 9 +++-- README.md | 5 +-- examples/collection.json | 2 +- examples/item.json | 29 ++++++++-------- examples/item2.json | 29 ++++++++-------- examples/item3.json | 27 +++++++-------- src/stactools/goes_glm/stac.py | 32 ++++++++++++------ ...59400_e20210010000004_c20210010000030.json | 29 ++++++++-------- ...1047000_e20182831047200_c20182831047223.nc | Bin 372205 -> 378653 bytes ...00000_e20221542100200_c20221542100217.json | 29 ++++++++-------- tests/data-files/collection.json | 2 +- tests/test_stac.py | 12 +++---- 12 files changed, 109 insertions(+), 96 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 55a06e9..442408f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,20 +14,25 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - New option `appendctime` for Item creation (see issue [#19](https://github.com/stactools-packages/goes-glm/issues/19) for details) - Handle GOES-Test correctly +### Changed + +- Use snake case instead of kebab case in all `goes:` field names +- `goes-glm:` prefiexed fields use now the `goes:` prefix + ### Deprecated - Nothing. ### Removed -- Nothing. +- `goes-glm:product_time` doesn't get exported any longer. Use STAC's native datetime fields instead. ### Fixed - Handle missing `...frame_time_offset...` variables correctly - Handle inconsistencies in the `..._count` variables better - Handle netCDF files with no events/flashes correctly -- Enabled GOES extension in `stac_extensions` +- Added GOES extension in `stac_extensions` ## [0.1.0] diff --git a/README.md b/README.md index 85aa825..dc66ddf 100644 --- a/README.md +++ b/README.md @@ -16,8 +16,9 @@ - [proj](https://github.com/stac-extensions/projection/) - [table](https://github.com/stac-extensions/table/) (for geoparquet only) - Extra fields: - - Prefix `goes:`: They have been defined in the [GOES extension](https://github.com/stac-extensions/goes/) so that they can be shared across multiple GOES products. - - Prefix `goes-glm:`: Variables with valid scalar values / without dimensions are added to the Item properties. The variable name is used as the property key after the prefix, e.g. `goes-glm:event_count`. + - Prefix `goes:`: As defined in the [GOES extension](https://github.com/stac-extensions/goes/). + All variables with valid scalar values / without dimensions are added to the Item properties with a `goes:` prefix. + The variable name is used as the property key after the prefix, e.g. `goes:event_count`. A stactools package for the Geostationary Lightning Mapper (GLM) dataset, which is on the GOES-16/R and GOES-17/S satellites. GLM detects all forms of lightning during both day and night, continuously, with a high spatial resolution and detection efficiency. diff --git a/examples/collection.json b/examples/collection.json index ea8df65..ac6e318 100644 --- a/examples/collection.json +++ b/examples/collection.json @@ -198,7 +198,7 @@ "processing:level": [ "L2" ], - "goes:orbital-slot": [ + "goes:orbital_slot": [ "West", "East", "Test" diff --git a/examples/item.json b/examples/item.json index 212a71b..cfa4637 100644 --- a/examples/item.json +++ b/examples/item.json @@ -14,21 +14,20 @@ "gsd": 8000, "processing:level": "L2", "processing:facility": "WCDAS", - "goes:orbital-slot": "East", - "goes:system-environment": "OR", - "goes-glm:product_time": 662731180.0, - "goes-glm:lightning_wavelength": 777.3699951171875, - "goes-glm:group_time_threshold": 0.0, - "goes-glm:flash_time_threshold": 3.3299999237060547, - "goes-glm:event_count": 11236, - "goes-glm:group_count": 3706, - "goes-glm:flash_count": 179, - "goes-glm:percent_navigated_L1b_events": 1.0, - "goes-glm:yaw_flip_flag": 0, - "goes-glm:nominal_satellite_subpoint_lat": 0.0, - "goes-glm:nominal_satellite_height": 35786.0234375, - "goes-glm:nominal_satellite_subpoint_lon": -75.19999694824219, - "goes-glm:percent_uncorrectable_L0_errors": 0.0, + "goes:orbital_slot": "East", + "goes:system_environment": "OR", + "goes:lightning_wavelength": 777.3699951171875, + "goes:group_time_threshold": 0.0, + "goes:flash_time_threshold": 3.3299999237060547, + "goes:event_count": 11236, + "goes:group_count": 3706, + "goes:flash_count": 179, + "goes:percent_navigated_L1b_events": 1.0, + "goes:yaw_flip_flag": 0, + "goes:nominal_satellite_subpoint_lat": 0.0, + "goes:nominal_satellite_height": 35786.0234375, + "goes:nominal_satellite_subpoint_lon": -75.19999694824219, + "goes:percent_uncorrectable_L0_errors": 0.0, "proj:epsg": 4326, "proj:centroid": { "lat": 0.0, diff --git a/examples/item2.json b/examples/item2.json index f206b2c..4c4d81a 100644 --- a/examples/item2.json +++ b/examples/item2.json @@ -14,21 +14,20 @@ "gsd": 8000, "processing:level": "L2", "processing:facility": "WCDAS", - "goes:orbital-slot": "West", - "goes:system-environment": "OR", - "goes-glm:product_time": 707562000.0, - "goes-glm:lightning_wavelength": 777.3699951171875, - "goes-glm:group_time_threshold": 0.0, - "goes-glm:flash_time_threshold": 3.3299999237060547, - "goes-glm:event_count": 1229, - "goes-glm:group_count": 811, - "goes-glm:flash_count": 117, - "goes-glm:percent_navigated_L1b_events": 1.0, - "goes-glm:yaw_flip_flag": 0, - "goes-glm:nominal_satellite_subpoint_lat": 0.0, - "goes-glm:nominal_satellite_height": 35786.0234375, - "goes-glm:nominal_satellite_subpoint_lon": -137.1999969482422, - "goes-glm:percent_uncorrectable_L0_errors": 0.0, + "goes:orbital_slot": "West", + "goes:system_environment": "OR", + "goes:lightning_wavelength": 777.3699951171875, + "goes:group_time_threshold": 0.0, + "goes:flash_time_threshold": 3.3299999237060547, + "goes:event_count": 1229, + "goes:group_count": 811, + "goes:flash_count": 117, + "goes:percent_navigated_L1b_events": 1.0, + "goes:yaw_flip_flag": 0, + "goes:nominal_satellite_subpoint_lat": 0.0, + "goes:nominal_satellite_height": 35786.0234375, + "goes:nominal_satellite_subpoint_lon": -137.1999969482422, + "goes:percent_uncorrectable_L0_errors": 0.0, "proj:epsg": 4326, "proj:centroid": { "lat": 0.0, diff --git a/examples/item3.json b/examples/item3.json index a08dd5d..a7f1816 100644 --- a/examples/item3.json +++ b/examples/item3.json @@ -14,20 +14,19 @@ "gsd": 8000, "processing:level": "L2", "processing:facility": "WCDAS", - "goes:orbital-slot": "Test", - "goes:system-environment": "OR", - "goes-glm:product_time": 592440420.0, - "goes-glm:lightning_wavelength": 777.3699951171875, - "goes-glm:group_time_threshold": 0.0, - "goes-glm:flash_time_threshold": 3.3299999237060547, - "goes-glm:event_count": 6687, - "goes-glm:group_count": 6171, - "goes-glm:flash_count": 123, - "goes-glm:percent_navigated_L1b_events": 1.0, - "goes-glm:nominal_satellite_subpoint_lat": 0.0, - "goes-glm:nominal_satellite_height": 35786.0234375, - "goes-glm:nominal_satellite_subpoint_lon": -89.5, - "goes-glm:percent_uncorrectable_L0_errors": 0.0, + "goes:orbital_slot": "Test", + "goes:system_environment": "OR", + "goes:lightning_wavelength": 777.3699951171875, + "goes:group_time_threshold": 0.0, + "goes:flash_time_threshold": 3.3299999237060547, + "goes:event_count": 6687, + "goes:group_count": 6171, + "goes:flash_count": 123, + "goes:percent_navigated_L1b_events": 1.0, + "goes:nominal_satellite_subpoint_lat": 0.0, + "goes:nominal_satellite_height": 35786.0234375, + "goes:nominal_satellite_subpoint_lon": -89.5, + "goes:percent_uncorrectable_L0_errors": 0.0, "proj:epsg": 4326, "proj:centroid": { "lat": 0.0, diff --git a/src/stactools/goes_glm/stac.py b/src/stactools/goes_glm/stac.py index ae3e2f8..b1c52a9 100644 --- a/src/stactools/goes_glm/stac.py +++ b/src/stactools/goes_glm/stac.py @@ -1,4 +1,5 @@ import logging +import math import os import re from datetime import datetime, timezone @@ -87,7 +88,7 @@ def create_collection( "instruments": constants.INSTRUMENTS, "gsd": [constants.RESOLUTION], "processing:level": [constants.PROCESSING_LEVEL], - "goes:orbital-slot": [e.value for e in constants.OrbitalSlot], + "goes:orbital_slot": [e.value for e in constants.OrbitalSlot], } ) @@ -247,8 +248,8 @@ def create_item( "gsd": constants.RESOLUTION, "processing:level": constants.PROCESSING_LEVEL, "processing:facility": dataset.production_site, - "goes:orbital-slot": slot, - "goes:system-environment": sys_env, + "goes:orbital_slot": slot, + "goes:system_environment": sys_env, } if slot == constants.OrbitalSlot.GOES_East: @@ -266,16 +267,27 @@ def create_item( centroid = {} for key, var in dataset.variables.items(): - if len(var.dimensions) != 0: + if len(var.dimensions) != 0 or var.name == "product_time": continue ma = var[...] - if var.name == "lat_field_of_view": - centroid["lat"] = ma.tolist() - elif var.name == "lon_field_of_view": - centroid["lon"] = ma.tolist() - elif ma.count() > 0: - properties[f"goes-glm:{var.name}"] = ma.tolist() + if ma.count() == 1: + val = ma.tolist() + name = f"goes:{var.name}" + if var.name == "lat_field_of_view": + centroid["lat"] = val + elif var.name == "lon_field_of_view": + centroid["lon"] = val + elif var.name.endswith("_count") or var.name == "yaw_flip_flag": + val = val + if val >= 0: + properties[name] = val + elif var.name.startswith("nominal_") or var.name.startswith("precent_"): + val = val + if not math.isclose(val, -999.0): + properties[name] = val + else: + properties[name] = val item = Item( stac_extensions=[ diff --git a/tests/data-files/OR_GLM-L2-LCFA_G16_s20203662359400_e20210010000004_c20210010000030.json b/tests/data-files/OR_GLM-L2-LCFA_G16_s20203662359400_e20210010000004_c20210010000030.json index 3c54394..a6c2947 100644 --- a/tests/data-files/OR_GLM-L2-LCFA_G16_s20203662359400_e20210010000004_c20210010000030.json +++ b/tests/data-files/OR_GLM-L2-LCFA_G16_s20203662359400_e20210010000004_c20210010000030.json @@ -14,21 +14,20 @@ "gsd": 8000, "processing:level": "L2", "processing:facility": "WCDAS", - "goes:orbital-slot": "East", - "goes:system-environment": "OR", - "goes-glm:product_time": 662731180.0, - "goes-glm:lightning_wavelength": 777.3699951171875, - "goes-glm:group_time_threshold": 0.0, - "goes-glm:flash_time_threshold": 3.3299999237060547, - "goes-glm:event_count": 11236, - "goes-glm:group_count": 3706, - "goes-glm:flash_count": 179, - "goes-glm:percent_navigated_L1b_events": 1.0, - "goes-glm:yaw_flip_flag": 0, - "goes-glm:nominal_satellite_subpoint_lat": 0.0, - "goes-glm:nominal_satellite_height": 35786.0234375, - "goes-glm:nominal_satellite_subpoint_lon": -75.19999694824219, - "goes-glm:percent_uncorrectable_L0_errors": 0.0, + "goes:orbital_slot": "East", + "goes:system_environment": "OR", + "goes:lightning_wavelength": 777.3699951171875, + "goes:group_time_threshold": 0.0, + "goes:flash_time_threshold": 3.3299999237060547, + "goes:event_count": 11236, + "goes:group_count": 3706, + "goes:flash_count": 179, + "goes:percent_navigated_L1b_events": 1.0, + "goes:yaw_flip_flag": 0, + "goes:nominal_satellite_subpoint_lat": 0.0, + "goes:nominal_satellite_height": 35786.0234375, + "goes:nominal_satellite_subpoint_lon": -75.19999694824219, + "goes:percent_uncorrectable_L0_errors": 0.0, "proj:epsg": 4326, "proj:centroid": { "lat": 0.0, diff --git a/tests/data-files/OR_GLM-L2-LCFA_G17_s20182831047000_e20182831047200_c20182831047223.nc b/tests/data-files/OR_GLM-L2-LCFA_G17_s20182831047000_e20182831047200_c20182831047223.nc index b5b7e01cfd52ca29345df940caf714730866397f..72a2668789b61230ae473a321edbf9237f5682ed 100644 GIT binary patch delta 2133 zcma)7eN0 zii2d)1$;5rKiq)m9E%QC$=1w;Ik!KYF$;>BF~P(wW*UPmRQ*d5>pkz?C%0|Ty`=BF zo^#&$eY|(?TVAXWrh} zZHsm1@>%_c!D&67;?Z0R5(vQhopY}@&H55aZ_$MhKE@n8JAOpD+7!X-%}PSu*uN5`J}v^ChYSKgN4 zFk&>gs??w(m>mU12s03_M!$ z9dW4Rg(h0{9jubkQa(%ma_F{Kji0L+86PCc@j>Ou2Q+gF7=U&#L^`%g z+9R%OhP$JSzK$GsXR>`;DD9icaW|3OHE{6f72RC}Fw5P^b==+kyYes{v?`8J3o`Yy zRn9`v?Qwt=69E7;_}TguFMNXu_Wq#Wk-5M_@Ea!BQ!%p;TwH2}pV$R>=xwXwta}rS z&CF8F9Xy$U3cP5+69C(qX@!)K=yF;S4UM7|FU7ND8#l!X|tc%znGJ}kr_s_YO&dVWE!7Zak~KQJN6Es|M6l&fF|mphHu|0Q>1 z&%&3PatqryA;H1a$4`1!A)E%>k)G@$UEcswK8y z9$V0Kdz@^+uNW*e delta 330 zcmbQ+C;s-f*aR7ow`*A$K)?V@GBErWUBSB1U>)n^R&KM&>m_734_2^%rIt)~ku7Ir zn(QNKAj||3f#?IVw0`c&nLZ(h#cQ)2`+DxlQzg9w85;xyKvJny5Z%YXx;cQl?OAT6 za>q}W7fs!qA(F~Ixl{?ETDu0K`T$t9z~nu$_AKXbPHCTBtB)+wlk;SI zS>9Ezp4$9hw*9{>BM>tIG4uBSvMh(9rq}bavQGA8lVIWro4#Nwi}dt3R#uMbCl9ll zZ$D7OqRzNPAU7^kaNvq&)(f>mr+ cs$)rDWcg^trZl;6gIN3gdY0|;>skHu0E&rX None: self.assertEqual(summaries["gsd"], [8000]) self.assertEqual(summaries["processing:level"], ["L2"]) self.assertEqual( - summaries["goes:orbital-slot"], ["West", "East", "Test"] + summaries["goes:orbital_slot"], ["West", "East", "Test"] ) self.assertTrue("item_assets" in collection_dict) @@ -200,15 +200,15 @@ def test_create_item(self) -> None: instrument = platform - 15 self.assertEqual(item.properties["instruments"], [f"FM{instrument}"]) self.assertEqual(item.properties["gsd"], 8000) - self.assertEqual(item.properties["goes:system-environment"], "OR") + self.assertEqual(item.properties["goes:system_environment"], "OR") if goes_test: - self.assertEqual(item.properties["goes:orbital-slot"], "Test") + self.assertEqual(item.properties["goes:orbital_slot"], "Test") elif platform == 16: - self.assertEqual(item.properties["goes:orbital-slot"], "East") + self.assertEqual(item.properties["goes:orbital_slot"], "East") elif platform == 17: - self.assertEqual(item.properties["goes:orbital-slot"], "West") + self.assertEqual(item.properties["goes:orbital_slot"], "West") else: - self.assertTrue("goes:orbital-slot" in item.properties) + self.assertTrue("goes:orbital_slot" in item.properties) self.assertEqual(item.properties["proj:epsg"], 4326) self.assertEqual(item.properties["processing:level"], "L2") From f4ed138087926248d93eb78a35fa64a445bd145d Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Fri, 23 Sep 2022 13:28:57 +0200 Subject: [PATCH 4/4] Fix missing stac_extension entries for goes, add missing license link to collection test --- ...G16_s20203662359400_e20210010000004_c20210010000030.json | 1 + ...G17_s20221542100000_e20221542100200_c20221542100217.json | 1 + tests/data-files/collection.json | 1 + tests/test_commands.py | 6 +++++- 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/data-files/OR_GLM-L2-LCFA_G16_s20203662359400_e20210010000004_c20210010000030.json b/tests/data-files/OR_GLM-L2-LCFA_G16_s20203662359400_e20210010000004_c20210010000030.json index a6c2947..55a9a70 100644 --- a/tests/data-files/OR_GLM-L2-LCFA_G16_s20203662359400_e20210010000004_c20210010000030.json +++ b/tests/data-files/OR_GLM-L2-LCFA_G16_s20203662359400_e20210010000004_c20210010000030.json @@ -662,6 +662,7 @@ 66.56 ], "stac_extensions": [ + "https://stac-extensions.github.io/goes/v1.0.0/schema.json", "https://stac-extensions.github.io/processing/v1.1.0/schema.json", "https://stac-extensions.github.io/projection/v1.0.0/schema.json", "https://stac-extensions.github.io/table/v1.2.0/schema.json", diff --git a/tests/data-files/OR_GLM-L2-LCFA_G17_s20221542100000_e20221542100200_c20221542100217.json b/tests/data-files/OR_GLM-L2-LCFA_G17_s20221542100000_e20221542100200_c20221542100217.json index 28d4977..778c67a 100644 --- a/tests/data-files/OR_GLM-L2-LCFA_G17_s20221542100000_e20221542100200_c20221542100217.json +++ b/tests/data-files/OR_GLM-L2-LCFA_G17_s20221542100000_e20221542100200_c20221542100217.json @@ -684,6 +684,7 @@ 66.56 ], "stac_extensions": [ + "https://stac-extensions.github.io/goes/v1.0.0/schema.json", "https://stac-extensions.github.io/processing/v1.1.0/schema.json", "https://stac-extensions.github.io/projection/v1.0.0/schema.json", "https://stac-extensions.github.io/table/v1.2.0/schema.json", diff --git a/tests/data-files/collection.json b/tests/data-files/collection.json index 9a52482..2474126 100644 --- a/tests/data-files/collection.json +++ b/tests/data-files/collection.json @@ -44,6 +44,7 @@ } ], "stac_extensions": [ + "https://stac-extensions.github.io/goes/v1.0.0/schema.json", "https://stac-extensions.github.io/processing/v1.1.0/schema.json", "https://stac-extensions.github.io/scientific/v1.0.0/schema.json", "https://stac-extensions.github.io/table/v1.2.0/schema.json", diff --git a/tests/test_commands.py b/tests/test_commands.py index 02349c2..2eed8b5 100644 --- a/tests/test_commands.py +++ b/tests/test_commands.py @@ -16,6 +16,7 @@ "OR_GLM-L2-LCFA_G16_s20203662359400_e20210010000004_c20210010000030", "OR_GLM-L2-LCFA_G17_s20221542100000_e20221542100200_c20221542100217", ] +LICENSE = "https://www.ncei.noaa.gov/access/metadata/landing-page/bin/iso?id=gov.noaa.ncdc:C01527" class CommandsTest(CliTestCase): @@ -28,7 +29,8 @@ def test_create_collection(self) -> None: destination = os.path.join(tmp_dir, "collection.json") result = self.run_command( - f"goes-glm create-collection {destination} --start_time 2022-01-01T00:00:00Z" + f"goes-glm create-collection {destination} " + f"--start_time 2022-01-01T00:00:00Z --license '{LICENSE}'" ) self.assertEqual(result.exit_code, 0, msg="\n{}".format(result.output)) @@ -51,6 +53,7 @@ def test_create_collection(self) -> None: ignore_order=True, exclude_regex_paths=r"root\['links'\]\[\d+\]\['href'\]", ) + print(diff) self.assertEqual(diff, {}) def test_create_item(self) -> None: @@ -96,4 +99,5 @@ def test_create_item(self) -> None: ignore_order=True, exclude_regex_paths=r"root\['(assets|links)'\]\[[\w']+\]\['href'\]", ) + print(diff) self.assertEqual(diff, {})