diff --git a/geometric_features/aggregation/__init__.py b/geometric_features/aggregation/__init__.py index e58f5005..7cce56c1 100644 --- a/geometric_features/aggregation/__init__.py +++ b/geometric_features/aggregation/__init__.py @@ -1,7 +1,7 @@ from geometric_features.aggregation.ocean import basins, subbasins, \ antarctic, greenland, ice_shelves, ismip6, arctic as arctic_ocean, \ transport, arctic_transport, moc -from geometric_features.aggregation.seaice import arctic as arctic_seaice +from geometric_features.aggregation.seaice import qgreenland, arctic as arctic_seaice def get_aggregator_by_name(region_group): @@ -60,6 +60,9 @@ def get_aggregator_by_name(region_group): 'MOC Basins': {'prefix': 'mocBasins', 'date': '20210623', 'function': moc}, + 'Historical Sea Ice': {'prefix': 'historicalSeaIce', + 'date': '20241018', + 'function': qgreenland}, 'Transport Transects': {'prefix': 'transportTransects', 'date': '20210323', 'function': transport}, diff --git a/geometric_features/aggregation/seaice/__init__.py b/geometric_features/aggregation/seaice/__init__.py index 5f00cb4f..b2315d2b 100644 --- a/geometric_features/aggregation/seaice/__init__.py +++ b/geometric_features/aggregation/seaice/__init__.py @@ -1 +1,2 @@ from geometric_features.aggregation.seaice.arctic_regions import arctic +from geometric_features.aggregation.seaice.historical_sea_ice import qgreenland diff --git a/geometric_features/aggregation/seaice/historical_sea_ice.py b/geometric_features/aggregation/seaice/historical_sea_ice.py new file mode 100644 index 00000000..b388ded5 --- /dev/null +++ b/geometric_features/aggregation/seaice/historical_sea_ice.py @@ -0,0 +1,33 @@ +def qgreenland(gf): + """ + Aggregate Greenland continental shelf regions similar to ISMIP6 + Parameters + ---------- + gf : geometric_features.GeometricFeatures + An object that knows how to download and read geometric features + Returns + ------- + fc : geometric_features.FeatureCollection + The new feature collection with antarctic regions + """ + # Authors + # ------- + # Alex Hager + + regions = ['April Historical Median Sea Ice Extent', + 'August Historical Median Sea Ice Extent', + 'December Historical Median Sea Ice Extent', + 'February Historical Median Sea Ice Extent', + 'January Historical Median Sea Ice Extent', + 'July Historical Median Sea Ice Extent', + 'June Historical Median Sea Ice Extent', + 'March Historical Median Sea Ice Extent', + 'May Historical Median Sea Ice Extent', + 'November Historical Median Sea Ice Extent', + 'October Historical Median Sea Ice Extent', + 'September Historical Median Sea Ice Extent' + ] + fc = gf.read(componentName='seaice', objectType='region', + featureNames=regions) + + return fc diff --git a/geometric_features/geometric_features.py b/geometric_features/geometric_features.py index b48299e6..060f85da 100644 --- a/geometric_features/geometric_features.py +++ b/geometric_features/geometric_features.py @@ -80,7 +80,7 @@ def read(self, componentName, objectType, featureNames=None, tags=None, Parameters ---------- - componentName : {'bedmachine', 'bedmap2', 'iceshelves', 'landice', 'natural_earth', 'ocean'} + componentName : {'bedmachine', 'bedmap2', 'iceshelves', 'landice', 'natural_earth', 'ocean','seaice'} The component from which to retrieve the geometric features objectType : {'point', 'transect', 'region'} @@ -173,7 +173,7 @@ def _download_geometric_features(self, componentName, objectType, Parameters ---------- - componentName : {'bedmachine', 'bedmap2', 'iceshelves', 'landice', 'natural_earth', 'ocean'} + componentName : {'bedmachine', 'bedmap2', 'iceshelves', 'landice', 'natural_earth', 'ocean','seaice'} The component from which to retrieve the geometric features objectType : {'point', 'transect', 'region'} @@ -223,7 +223,7 @@ def _get_feature_names(self, componentName, objectType, featureNames, Parameters ---------- - componentName : {'bedmachine', 'bedmap2', 'iceshelves', 'landice', 'natural_earth', 'ocean'} + componentName : {'bedmachine', 'bedmap2', 'iceshelves', 'landice', 'natural_earth', 'ocean','seaice'} The component from which to retrieve the geometric features objectType : {'point', 'transect', 'region'} @@ -298,7 +298,7 @@ def _get_file_name(componentName, objectType, featureName): Parameters ---------- - componentName : {'bedmachine', 'bedmap2', 'iceshelves', 'landice', 'natural_earth', 'ocean'} + componentName : {'bedmachine', 'bedmap2', 'iceshelves', 'landice', 'natural_earth', 'ocean','seaice'} The component from which to retrieve the geometric features objectType : {'point', 'transect', 'region'} diff --git a/geometric_features/test/test_aggregation.py b/geometric_features/test/test_aggregation.py index 2e712675..ae68506f 100644 --- a/geometric_features/test/test_aggregation.py +++ b/geometric_features/test/test_aggregation.py @@ -4,7 +4,7 @@ from geometric_features import GeometricFeatures from geometric_features.aggregation import get_aggregator_by_name, basins, \ subbasins, antarctic, ice_shelves, ismip6, arctic_ocean, transport, \ - arctic_transport, moc, arctic_seaice + arctic_transport, moc, arctic_seaice, qgreenland @pytest.mark.usefixtures('loaddatadir') @@ -14,7 +14,7 @@ def test_get_aggregator_by_name(self): gf = GeometricFeatures() names = ['Antarctic Regions', 'Arctic Ocean Regions', 'Greenland Regions', 'Arctic Sea Ice Regions', 'Ocean Basins', 'Ice Shelves', - 'Ocean Subbasins', 'ISMIP6 Regions', 'MOC Basins', + 'Ocean Subbasins', 'ISMIP6 Regions', 'MOC Basins', 'Historical Sea Ice', 'Transport Transects', 'Arctic Transport Transects'] for name in names: @@ -60,3 +60,7 @@ def test_transport(self): def test_arctic_transport(self): gf = GeometricFeatures() arctic_transport(gf) + + def test_qgreenland(self): + gf = GeometricFeatures() + qgreenland(gf)