polaris.mesh.spherical.unified.effective_ocean.build_effective_ocean_mask
- polaris.mesh.spherical.unified.effective_ocean.build_effective_ocean_mask(candidate_fraction, shared_ocean_mask, ocean_background, lat, lon, resolution, land_blockages=None, passages=None, seed_points=None, grow_threshold=0.35, passage_widen_factor=1.5, passage_widen_factor_high_lat=3.0, passage_widen_latitude_threshold=43.0)[source]
Build the effective ocean mask by emulating the MPAS cull.
- Parameters:
candidate_fraction (numpy.ndarray) – The candidate-ocean area fraction on the sizing grid (the conservative average of the source ocean mask, the same quantity that becomes
ocean_fracon the MPAS mesh), with dimensions(lat, lon)shared_ocean_mask (numpy.ndarray) – The flood-filled ocean mask from the shared coastline products on the same grid
ocean_background (numpy.ndarray) – The ocean background cell width in km on the same grid
lat (numpy.ndarray) – The latitude coordinate in degrees
lon (numpy.ndarray) – The longitude coordinate in degrees
resolution (float) – The grid resolution in degrees
land_blockages (numpy.ndarray, optional) – A boolean mask of rasterized critical land blockages (removed from the emulated ocean)
passages (numpy.ndarray, optional) – A boolean mask of rasterized critical ocean passages (widened and added to the emulated ocean)
seed_points (list of tuple, optional) –
(lon, lat)seed points in degrees for the flood fill; ifNone, no flood fill is performed and all mesh-scale ocean is retainedgrow_threshold (float, optional) – The hysteresis lower bound on the candidate fraction (< 0.5); connected regions above this threshold that touch the strict flood-filled ocean are added, covering cells whose fate at the strict 0.5 threshold depends on the exact MPAS cell tiling
passage_widen_factor (float, optional) – The passage swath width in units of the local ocean background cell width
passage_widen_factor_high_lat (float, optional) – The passage swath width factor poleward of
passage_widen_latitude_threshold(mimickingwiden_transect_edge_masksin the MPAS cull)passage_widen_latitude_threshold (float, optional) – The latitude in degrees poleward of which
passage_widen_factor_high_latapplies
- Returns:
fields (dict of str to numpy.ndarray) –
'effective_ocean_mask': the union of the shared and emulated ocean masks;'emulated_ocean_mask': the flood-filled, hysteresis-grown mesh-scale ocean mask;'mesh_scale_fraction': the mesh-scale candidate fraction;'passages_widened': the widened passage mask