Skip to content

Commit f70eb7e

Browse files
committed
allow minimum and masking depth on rofi pattern generation
1 parent 45ff09b commit f70eb7e

1 file changed

Lines changed: 24 additions & 1 deletion

File tree

rof_pattern_generation/generate_rofi_pattern.py

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,27 @@ def main():
128128
required=True,
129129
help="Path to the model topography file, which is used to generate the model mask.",
130130
)
131+
parser.add_argument(
132+
"--minimum-depth",
133+
type=float,
134+
default=0,
135+
help=(
136+
"MINIMUM_DEPTH in metres. When a topography file is "
137+
"provided, any grid cell with depth <= MINIMUM_DEPTH is treated as land "
138+
"unless --masking-depth is also supplied."
139+
),
140+
)
141+
parser.add_argument(
142+
"--masking-depth",
143+
type=float,
144+
default=None,
145+
help=(
146+
"MASKING_DEPTH in metres. If set, cells with depth <= MASKING_DEPTH "
147+
"become land, while cells with MASKING_DEPTH < depth < MINIMUM_DEPTH remain wet "
148+
"but their depth will be raised to MINIMUM_DEPTH at runtime. "
149+
"If omitted, MINIMUM_DEPTH alone controls the land-sea mask."
150+
),
151+
)
131152

132153
regrid_aq.parse_cli()
133154

@@ -162,7 +183,9 @@ def main():
162183

163184
# find the ocean mask using the bathymetry
164185
topo = xr.open_dataset(regrid.args.topog_file)
165-
mask = mom6_mask_detection(topo)
186+
mask = mom6_mask_detection(
187+
topo, minimum_depth=args.minimum_depth, masking_depth=args.masking_depth
188+
)
166189

167190
# After doing the regridding, map any runoff on land cells into the ocean
168191
weights_da = move_runoff_on_land(

0 commit comments

Comments
 (0)