From a92672d4d3c06788d8c01f0667bcd72968ffbd69 Mon Sep 17 00:00:00 2001 From: Trey Stafford Date: Mon, 10 Jul 2023 15:18:02 -0600 Subject: [PATCH] WIP - init config for CALM sites layer TODOs related to dataset citation and dataset description --- .../circumpolar_active_layer_monitoring.py | 47 +++++++++++++++++++ .../config/layers/Frozen ground/layers.py | 32 ++++++++++++- 2 files changed, 78 insertions(+), 1 deletion(-) create mode 100644 qgreenland/config/datasets/circumpolar_active_layer_monitoring.py diff --git a/qgreenland/config/datasets/circumpolar_active_layer_monitoring.py b/qgreenland/config/datasets/circumpolar_active_layer_monitoring.py new file mode 100644 index 00000000..ff07fd2c --- /dev/null +++ b/qgreenland/config/datasets/circumpolar_active_layer_monitoring.py @@ -0,0 +1,47 @@ +from qgreenland.models.config.asset import HttpAsset +from qgreenland.models.config.dataset import Dataset + +circumpolar_layer_monitoring = Dataset( + id="circumpolar_layer_monitoring", + assets=[ + HttpAsset( + id="only", + urls=[ + "https://www2.gwu.edu/~calm/data/CALM_Sites_wData.7z", + ], + ), + ], + metadata={ + "title": "Circumpolar Active Layer Monitoring Network-CALM: Long-Term Observations of the Climate-Active Layer-Permafrost System", + "abstract": ( + """The primary goal of the Circumpolar Active Layer Monitoring + (CALM) program is to observe the response of the active layer and + near-surface permafrost to climate change over long (multi-decadal) + time scales. The CALM observational network, established in the + 1990s, observes the long-term response of the active layer and + near-surface permafrost to changes and variations in climate at more + than 200 sites in both hemispheres. CALM currently has participants + from 15 countries. Majority of sites measure active-layer thickness + on grids ranging from 1 ha to 1 kmĀ², and observe soil + temperatures. Most sites in the CALM network are located in Arctic + and Subarctic lowlands. Southern Hemisphere component (CALM-South) + is being organized and currently includes sites in Antarctic and + South America. The broader impacts of this project are derived from + the hypothesis that widespread, systematic changes in the thickness + of the active layer could have profound effects on the flux of + greenhouse gases, on the human infrastructure in cold regions, and + on landscape processes. It is therefore critical that observational + and analytical procedures continue over decadal periods to assess + trends and detect cumulative, long-term changes. + + The CALM program began in 1991. It was initially affiliated with the + International Tundra Experiment and has been supported independently and + continuously since 1998 through grants from the U.S. National Science + Foundation*. CALM is funded by the NSF Project OPP-1836377.""" + ), + "citation": { + "text": ("""TODO..."""), + "url": "https://www2.gwu.edu/~calm/data/north.htm", + }, + }, +) diff --git a/qgreenland/config/layers/Frozen ground/layers.py b/qgreenland/config/layers/Frozen ground/layers.py index 3980632b..9018eed3 100644 --- a/qgreenland/config/layers/Frozen ground/layers.py +++ b/qgreenland/config/layers/Frozen ground/layers.py @@ -1,9 +1,14 @@ +from qgreenland.config.datasets.circumpolar_active_layer_monitoring import ( + circumpolar_layer_monitoring, +) from qgreenland.config.datasets.pangaea_ground_temperature import ( pangaea_ground_temperature as dataset, ) from qgreenland.config.helpers.steps.compress_and_add_overviews import ( compress_and_add_overviews, ) +from qgreenland.config.helpers.steps.decompress import decompress_step +from qgreenland.config.helpers.steps.ogr2ogr import ogr2ogr from qgreenland.config.helpers.steps.warp_and_cut import warp_and_cut from qgreenland.config.project import project from qgreenland.models.config.layer import Layer, LayerInput @@ -36,7 +41,7 @@ } -layers = [ +pangaea_layers = [ Layer( id=layer_id, title=params["title"], @@ -85,3 +90,28 @@ ) for layer_id, params in _layer_params.items() ] + + +calm_layer = Layer( + id="calm_network_sites", + title="CALM network sites", + description="""TODO...""", + tags=[], + style=None, + input=LayerInput( + dataset=circumpolar_layer_monitoring, + asset=circumpolar_layer_monitoring.assets["only"], + ), + steps=[ + decompress_step( + input_file="{input_dir}/CALM_Sites_wData.7z", decompress_type="7z" + ), + *ogr2ogr( + input_file="{input_dir}/CALM_SitesData.shp", + output_file="{output_dir}/calm_sites_data.gpkg", + # Some features fall outside of our project CRS so an error is + # raised without `skipfailures`. + ogr2ogr_args=("-skipfailures",), + ), + ], +)