Skip to content

Commit

Permalink
Add historical sea ice extent aggregator
Browse files Browse the repository at this point in the history
  • Loading branch information
alexolinhager committed Oct 30, 2024
1 parent 357e27d commit d970640
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 6 deletions.
5 changes: 4 additions & 1 deletion geometric_features/aggregation/__init__.py
Original file line number Diff line number Diff line change
@@ -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):
Expand Down Expand Up @@ -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},
Expand Down
1 change: 1 addition & 0 deletions geometric_features/aggregation/seaice/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
from geometric_features.aggregation.seaice.arctic_regions import arctic
from geometric_features.aggregation.seaice.historical_sea_ice import qgreenland
33 changes: 33 additions & 0 deletions geometric_features/aggregation/seaice/historical_sea_ice.py
Original file line number Diff line number Diff line change
@@ -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
8 changes: 4 additions & 4 deletions geometric_features/geometric_features.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'}
Expand Down Expand Up @@ -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'}
Expand Down Expand Up @@ -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'}
Expand Down Expand Up @@ -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'}
Expand Down
2 changes: 1 addition & 1 deletion geometric_features/test/test_aggregation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit d970640

Please sign in to comment.