8000 Fix docs for coastline alteration by xylar · Pull Request #546 · MPAS-Dev/MPAS-Tools · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix docs for coastline alteration #546

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 4, 2024
Merged
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
28 changes: 21 additions & 7 deletions conda_package/docs/ocean/coastline_alteration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,13 @@ An example of the typical workflow that uses this function would be:
import xarray

from geometric_features import GeometricFeatures
from mpas_tools.mesh import conversion
from mpas_tools.cime.constants import constants
from mpas_tools.mesh import mask
from mpas_tools.ocean.coastline_alteration import add_critical_land_blockages


earthRadius = constants['SHR_CONST_REARTH']

# an object used to read feature collections from the geometric_features
# package
gf = GeometricFeatures()
Expand All @@ -43,15 +46,19 @@ An example of the typical workflow that uses this function would be:
dsBaseMesh = xarray.open_dataset('base_mesh.nc')
# create a mask on the base mesh that is ones for land or grounded ice and
# zeros for ocean
dsLandMask = conversion.mask(dsBaseMesh, fcMask=fcLandCoverage)
dsLandMask = mask.compute_mpas_region_masks(dsBaseMesh,
fcMask=fcLandCoverage,
maskTypes=('cell',))

# get a collection of features from geometric_features that are meant for
# use as critical land blockages
fcCritBlockages = gf.read(componentName='ocean', objectType='transect',
tags=['Critical_Land_Blockage'])

# make masks from the transects
dsCritBlockMask = conversion.mask(dsBaseMesh, fcMask=fcCritBlockages)
dsCritBlockMask = mask.compute_mpas_transect_masks(dsBaseMesh,
fcMask=fcCritBlockages,
earthRadius=earthRadius)

# add the masks to the "land" mask
dsLandMask = add_critical_land_blockages(dsLandMask, dsCritBlockMask)
Expand Down Expand Up @@ -83,7 +90,7 @@ Here is an example workflow that removes land-locked cells:
import xarray

from geometric_features import GeometricFeatures
from mpas_tools.mesh import conversion
from mpas_tools.mesh import mask
from mpas_tools.ocean.coastline_alteration import \
add_land_locked_cells_to_mask

AC4E Expand All @@ -100,7 +107,9 @@ Here is an example workflow that removes land-locked cells:
dsBaseMesh = xarray.open_dataset('base_mesh.nc')
# create a mask on the base mesh that is ones for land or grounded ice and
# zeros for ocean
dsLandMask = conversion.mask(dsBaseMesh, fcMask=fcLandCoverage)
dsLandMask = mask.compute_mpas_region_masks(dsBaseMesh,
fcMask=fcLandCoverage,
maskTypes=('cell',))

# Find ocean cells that are land-locked, and alter the cell mask so that
# they are counted as land cells
Expand Down Expand Up @@ -128,9 +137,12 @@ An example workflow that includes transect-widening is:
import xarray

from geometric_features import GeometricFeatures
from mpas_tools.mesh import conversion
from mpas_tools.cime.constants import constants
from mpas_tools.mesh import mask
from mpas_tools.ocean.coastline_alteration import widen_transect_edge_masks

earthRadius = constants['SHR_CONST_REARTH']

# an object used to read feature collections from the geometric_features
# package
gf = GeometricFeatures()
Expand All @@ -143,7 +155,9 @@ An example workflow that includes transect-widening is:
tags=['Critical_Passage'])

# create masks from the transects
dsCritPassMask = conversion.mask(dsBaseMesh, fcMask=fcCritPassages)
dsCritPassMask = mask.compute_mpas_transect_masks(dsBaseMesh,
fcMask=fcCritPassages,
earthRadius=earthRadius)

# Alter critical passages to be at least two cells wide, to avoid sea ice
# blockage.
Expand Down
0