Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 50 additions & 5 deletions docs/aggregation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ Aggregate Existing Features
===========================

The :py:mod:`geometric_features.aggregation` module contains functions used to
aggregate existing features to make new, larger ones.
aggregate existing features to make new, larger ones. An example usage of these
aggregation functions is to create masks for regional averaging.


Aggregating Ocean Features
Expand All @@ -13,11 +14,55 @@ Aggregating Ocean Features
Ocean Sub-basins
~~~~~~~~~~~~~~~~

The only aggregation function that is currently available is
:py:func:`geometric_features.aggregation.ocean.subbasins`, which aggregates
oceanic regions to make the following ocean subbasins: North and South Atlantic,
North and South Pacific, Indian Basin, Arctic Basin, and Southern Ocean Basin.
The function :py:func:`geometric_features.aggregation.ocean.subbasins`
aggregates oceanic regions to make the following ocean subbasins: North and
South Atlantic, North and South Pacific, Indian Basin, Arctic Basin, and
Southern Ocean Basin.

.. image:: images/subbasins.png
:width: 500 px
:align: center

Ocean Basins
~~~~~~~~~~~~

The function :py:func:`geometric_features.aggregation.ocean.basins` aggregates
oceanic regions to make the following ocean basins: Atlantic, Pacific, Indian,
Arctic, Southern Ocean, Mediterranean, Global Ocean, Global Ocean 65N to 65S,
Global Ocean 15S to 15N.

Meridional Overturning Circulation Basins
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The function :py:func:`geometric_features.aggregation.ocean.moc` aggregates
basins for computing the MOC: Atlantic, IndoPacific, Pacific and Indian

Antarctic Regions
~~~~~~~~~~~~~~~~~

The function :py:func:`geometric_features.aggregation.ocean.antarctic` aggregates
regions of the Antarctic: Southern Ocean, Southern Ocean 60S,
Eastern Weddell Sea Shelf, Eastern Weddell Sea Deep, Western Weddell Sea Shelf,
Western Weddell Sea Deep, Weddell Sea Shelf, Weddell Sea Deep,
Bellingshausen Sea Shelf, Bellingshausen Sea Deep, Amundsen Sea Shelf,
Amundsen Sea Deep, Eastern Ross Sea Shelf, Eastern Ross Sea Deep,
Western Ross Sea Shelf, Western Ross Sea Deep, East Antarctic Seas Shelf,
East Antarctic Seas Deep.

Ice-shelf Regions
~~~~~~~~~~~~~~~~~

The function :py:func:`geometric_features.aggregation.ocean.ice_shelves`
aggregates ice shelves and ice-shelf regions. There are 106 regions, so they
won't all be listed. See the resulting feature collection or the code itself
for the full list.

Transport Transects
~~~~~~~~~~~~~~~~~~~

The function :py:func:`geometric_features.aggregation.ocean.transport`
aggregates transport transects: Africa-Ant, Agulhas, Antilles Inflow,
Barents Sea Opening, Bering Strait, Davis Strait, Drake Passage,
Florida-Bahamas, Florida-Cuba, Fram Strait", Indonesian Throughflow,
Lancaster Sound, Mona Passage", Mozambique Channel, Nares Strait, Tasmania-Ant
Windward Passage.
6 changes: 6 additions & 0 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,9 @@ Aggregation
aggregation
aggregation.ocean
aggregation.ocean.subbasins
aggregation.ocean.basins
aggregation.ocean.moc
aggregation.ocean.arctic
aggregation.ocean.antarctic
aggregation.ocean.ice_shelves
aggregation.ocean.transport
5 changes: 5 additions & 0 deletions geometric_features/aggregation/ocean/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
from geometric_features.aggregation.ocean.subbasin_regions import subbasins
from geometric_features.aggregation.ocean.ocean_basins import basins
from geometric_features.aggregation.ocean.antarctic_regions import antarctic
from geometric_features.aggregation.ocean.ice_shelf_regions import ice_shelves
from geometric_features.aggregation.ocean.moc_basins import moc
from geometric_features.aggregation.ocean.transport_transects import transport
32 changes: 32 additions & 0 deletions geometric_features/aggregation/ocean/antarctic_regions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
def antarctic(gf):
"""
Aggregate Antarctic regions similar to Timmermann et al. (2013)

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
# -------
# Xylar Asay-Davis

regions = ['Southern Ocean', 'Southern Ocean 60S',
'Eastern Weddell Sea Shelf', 'Eastern Weddell Sea Deep',
'Western Weddell Sea Shelf', 'Western Weddell Sea Deep',
'Weddell Sea Shelf', 'Weddell Sea Deep',
'Bellingshausen Sea Shelf', 'Bellingshausen Sea Deep',
'Amundsen Sea Shelf', 'Amundsen Sea Deep',
'Eastern Ross Sea Shelf', 'Eastern Ross Sea Deep',
'Western Ross Sea Shelf', 'Western Ross Sea Deep',
'East Antarctic Seas Shelf', 'East Antarctic Seas Deep']

fc = gf.read(componentName='ocean', objectType='region',
featureNames=regions)

return fc
171 changes: 171 additions & 0 deletions geometric_features/aggregation/ocean/ice_shelf_regions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
from geometric_features import FeatureCollection


def ice_shelves(gf):
"""
Aggregate 106 Antarctic ice shelves and ice-shelf regions

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 ice shelves
"""
# Authors
# -------
# Xylar Asay-Davis

iceShelfNames = ['Abbot',
'Amery',
'Atka',
'Aviator',
'Bach',
'Baudouin',
'Borchgrevink',
'Brahms',
'Brunt_Stancomb',
'Campbell',
'Cheetham',
'Conger_Glenzer',
'Cook',
'Cosgrove',
'Crosson',
'Dennistoun',
'Dibble',
'Dotson',
'Drygalski',
'Edward_VIII',
'Ekstrom',
'Ferrigno',
'Filchner',
'Fimbul',
'Fitzgerald',
'Frost',
'GeikieInlet',
'George_VI',
'Getz',
'Gillet',
'Hamilton',
'Hannan',
'HarbordGlacier',
'Helen',
'Holmes',
'HolmesWest',
'Hull',
'Jelbart',
'Land',
'Larsen_B',
'Larsen_C',
'Larsen_D',
'Larsen_E',
'Larsen_F',
'Larsen_G',
'Lazarev',
'Lillie',
'Mariner',
'Matusevitch',
'Mendelssohn',
'Mertz',
'Moscow_University',
'Moubray',
'Mulebreen',
'Myers',
'Nansen',
'Nickerson',
'Ninnis',
'Nivl',
'Noll',
'Nordenskjold',
'Pine_Island',
'PourquoiPas',
'Prince_Harald',
'Publications',
'Quar',
'Rayner_Thyer',
'Rennick',
'Richter',
'Riiser-Larsen',
'Ronne',
'Western_Ross',
'Eastern_Ross',
'Shackleton',
'Shirase',
'Slava',
'SmithInlet',
'Stange',
'Sulzberger',
'Suvorov',
'Swinburne',
'Thwaites',
'Tinker',
'Totten',
'Tracy_Tremenchus',
'Tucker',
'Underwood',
'Utsikkar',
'Venable',
'Verdi',
'Vigrid',
'Vincennes',
'Voyeykov',
'West',
'Wilkins',
'Wilma_Robert_Downer',
'Withrow',
'Wordie',
'Wylde',
'Zubchatyy']

combinedIceShelves = {'Filchner-Ronne': ['Filchner', 'Ronne'],
'Ross': ['Western_Ross', 'Eastern_Ross'],
'Antarctica': ['AntarcticPenninsulaIMBIE',
'WestAntarcticaIMBIE',
'EastAntarcticaIMBIE'],
'Peninsula': ['AntarcticPenninsulaIMBIE'],
'West Antarctica': ['WestAntarcticaIMBIE'],
'East Antarctica': ['EastAntarcticaIMBIE']}

nIMBIEBasins = 27
for basinNumber in range(1, nIMBIEBasins + 1):
basinName = 'Antarctica_IMBIE{}'.format(basinNumber)
combinedIceShelves['IMBIE{}'.format(basinNumber)] = [basinName]

# create a FeatureCollection containing all ice shelves and combined
# ice-shelf regions
fc = FeatureCollection()

# build analysis regions from combining ice shelves from regions with the
# appropriate tags
for shelfName in combinedIceShelves:
subNames = combinedIceShelves[shelfName]
print(shelfName)

print(' * merging features')
fcShelf = gf.read(componentName='iceshelves', objectType='region',
tags=subNames, allTags=False)

print(' * combining features')
fcShelf = fcShelf.combine(featureName=shelfName)

# merge the feature for the basin into the collection of all basins
fc.merge(fcShelf)

# build ice shelves from regions with the appropriate tags
for shelfName in iceShelfNames:
print(shelfName)

print(' * merging features')
fcShelf = gf.read(componentName='iceshelves', objectType='region',
tags=[shelfName])

print(' * combining features')
fcShelf = fcShelf.combine(featureName=shelfName)

# merge the feature for the basin into the collection of all basins
fc.merge(fcShelf)

return fc
Loading