Skip to content

Commit

Permalink
Merge pull request #802 from NOAA-OWP/new-public-5day-services
Browse files Browse the repository at this point in the history
This PR implements two new public 5 day services: 
* 5 Day MRF NBM Max Flood Inundation Extent
* 5 Day NBM High Flow Magnitude
  • Loading branch information
nickchadwick-noaa authored Aug 9, 2024
2 parents 77b6828 + 8935fe4 commit b427295
Show file tree
Hide file tree
Showing 8 changed files with 2,162 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
DROP TABLE IF EXISTS publish.mrf_nbm_5day_max_high_flow_magnitude_public;

SELECT
feature_id_str,
strm_order,
name,
huc6,
state,
nwm_vers,
reference_time,
maxflow_5day_cfs,
recur_cat_5day,
high_water_threshold,
flow_2yr,
flow_5yr,
flow_10yr,
flow_25yr,
flow_50yr,
update_time,
geom
INTO publish.mrf_nbm_5day_max_high_flow_magnitude_public
FROM publish.mrf_nbm_10day_max_high_flow_magnitude AS main
JOIN derived.channels_conus AS channels ON main.feature_id = channels.feature_id
WHERE public_fim_domain = True;

INSERT INTO publish.mrf_nbm_5day_max_high_flow_magnitude_public (
reference_time,
update_time
) VALUES (
to_char('1900-01-01 00:00:00'::timestamp without time zone, 'YYYY-MM-DD HH24:MI:SS UTC'),
to_char(now()::timestamp without time zone, 'YYYY-MM-DD HH24:MI:SS UTC')
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
-- We'll temporarily increase work_mem to 512MB, to help with performance on PostGIS spatial joins (default is 4MB)
SET work_mem TO '1024MB';
DROP TABLE IF EXISTS publish.mrf_nbm_max_inundation_5day_public;

SELECT
inun.feature_id_str,
inun.geom,
inun.streamflow_cfs,
inun.reference_time,
to_char(now()::timestamp without time zone, 'YYYY-MM-DD HH24:MI:SS UTC') AS update_time
INTO publish.mrf_nbm_max_inundation_5day_public
FROM publish.mrf_nbm_max_inundation_5day as inun
JOIN derived.channels_conus AS channels ON inun.feature_id = channels.feature_id
WHERE public_fim_domain = True;
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,11 @@ postprocess_sql:
- sql_file: mrf_nbm_10day_max_high_flow_magnitude
target_table: publish.mrf_nbm_10day_max_high_flow_magnitude

product_summaries:
- sql_file: 5day_public_subset
target_table:
- publish.mrf_nbm_5day_max_high_flow_magnitude_public

services:
- mrf_nbm_10day_max_high_flow_magnitude_noaa
- mrf_nbm_5day_max_high_flow_magnitude
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ fim_configs:
target_table: publish.mrf_nbm_max_inundation_10day

product_summaries:
- sql_file: 5day_public_subset
target_table:
- publish.mrf_nbm_max_inundation_5day_public
- sql_file: 3day_src_skill
target_table:
- publish.mrf_nbm_max_inundation_3day_src_skill
Expand All @@ -79,4 +82,5 @@ product_summaries:
- publish.mrf_nbm_max_inundation_10day_hucs

services:
- mrf_nbm_10day_max_inundation_extent_noaa
- mrf_nbm_10day_max_inundation_extent_noaa
- mrf_nbm_5day_max_inundation_extent
Loading

0 comments on commit b427295

Please sign in to comment.