Skip to content

Commit

Permalink
SRC Subdivision one job only for lambda
Browse files Browse the repository at this point in the history
  • Loading branch information
GregoryPetrochenkov-NOAA committed Feb 12, 2025
1 parent aac80fa commit 56ddafb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tools/probabilistic_inundation.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,12 +356,13 @@ def inundate_probabilistic(
mannings_df.to_csv(manning_path, index=False)

# Subdivide the channels
# Keep it to one job for use in Lambda
suffix = "prob_adjusted"
run_prep(
fim_dir=hydrofabric_dir,
mann_n_table=manning_path,
output_suffix=suffix,
number_of_jobs=num_jobs,
number_of_jobs=1,
verbose=False,
src_plot_option=False,
process_huc=huc,
Expand Down Expand Up @@ -444,6 +445,7 @@ def inundate_probabilistic(
merge_ds = xr.concat(xrs, dim="band")
max_ds = merge_ds.max(dim='band').assign_coords({"band": 1})
max_ds = max_ds.rio.write_nodata(0)
max_ds.rio.to_raster(os.path.join(base_output_path, output_file_name.replace(".gpkg", ".tif")))
polygon = max_ds.gval.vectorize_data()
polygon.to_file(os.path.join(base_output_path, output_file_name))

Expand Down

0 comments on commit 56ddafb

Please sign in to comment.