Skip to content

Commit

Permalink
Merge pull request #845 from NOAA-OWP/2.1.7-fixes
Browse files Browse the repository at this point in the history
2.1.7 fixes

Fixed various syntax errors and mis-named files for the 2.1.7 deployment
  • Loading branch information
nickchadwick-noaa authored Aug 23, 2024
2 parents ee3ab4b + 953df58 commit 49d397d
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ WITH rapid_onset AS (
)
SELECT feature_id, forecast_hour, streamflow AS flow,
( -- Use the lag funtion to calucate percent change for each reach / forecast hour timestep
(streamflow) - (lag(streamflow, 1) OVER (PARTITION BY feature_id ORDER BY forecast_hour)))/ --Numerator: current streamflow - last hour streamflow
(streamflow) - (lag(streamflow, 1) OVER (PARTITION BY feature_id ORDER BY forecast_hour))/ --Numerator: current streamflow - last hour streamflow
(lag(streamflow, 1) OVER (PARTITION BY feature_id ORDER by forecast_hour)) -- Denominator: last hour streamflow
) AS pct_chg
FROM forecasts_full
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ SELECT channels.feature_id,
channels.strm_order,
channels.name,
channels.huc6,
"AK" as state,
'AK' AS state,
high_flow_mag.nwm_vers,
high_flow_mag.reference_time,
high_flow_mag.max_flow,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ JOIN derived.recurrence_flows_ak AS rf ON forecasts.feature_id = rf.feature_id
-- Join in high water arrival time for return time (the yaml config file ensures that arrival time finishes first for this, but we'll join on reference_time as well to ensure)
JOIN publish.srf_15hr_high_water_arrival_time_alaska AS arrival_time ON forecasts.feature_id = arrival_time.feature_id and forecasts.reference_time = arrival_time.reference_time

GROUP BY forecasts.feature_id, forecasts.reference_time, forecasts.nwm_vers, arrival_time.below_bank_return_hour, max_flows.discharge_cfs, channels.geom, channels.strm_order, channels.name, channels.huc6;
GROUP BY forecasts.feature_id, forecasts.reference_time, forecasts.nwm_vers, arrival_time.below_bank_return_hour, arrival_time.below_bank_return_time, max_flows.discharge_cfs, channels.geom, channels.strm_order, channels.name, channels.huc6, rf.high_water_threshold;
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,21 @@ DROP TABLE IF EXISTS publish.mrf_nbm_max_inundation_5day_public;

SELECT
inun.feature_id_str,
inun.geom,
ST_Intersection(inun.geom, fim_domain.geom) as 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;
JOIN derived.channels_conus channels
ON channels.feature_id = inun.feature_id
AND channels.public_fim_domain = TRUE
JOIN derived.public_fim_domain AS fim_domain ON TRUE;

INSERT INTO publish.mrf_nbm_max_inundation_5day_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
Expand Up @@ -4,7 +4,7 @@ product_type: "vector"
run: true

ingest_files:
- file_format: common/data/model/com/nwm/{{variable:NWM_DATAFLOW_VERSION}}/nwm.{{datetime:%Y%m%d}}/medium_range_alaska_mem1/nwm.t{{datetime:%H}}z.medium_range_blend.channel_rt.f{{range:3,243,3,%03d}}.alaska.nc
- file_format: common/data/model/com/nwm/{{variable:NWM_DATAFLOW_VERSION}}/nwm.{{datetime:%Y%m%d}}/medium_range_alaska_mem1/nwm.t{{datetime:%H}}z.medium_range.channel_rt_1.f{{range:3,243,3,%03d}}.alaska.nc
file_step: None
file_window: None
target_table: ingest.nwm_channel_rt_mrf_gfs_ak
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@
},
"layerType" : "Operational",
"showLegends" : true,
"visibility" : false,
"visibility" : true,
"displayCacheType" : "Permanent",
"maxDisplayCacheAge" : 5,
"showPopups" : true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@
"layerType" : "Operational",
"minScale" : 400000,
"showLegends" : true,
"visibility" : false,
"visibility" : true,
"displayCacheType" : "Permanent",
"maxDisplayCacheAge" : 5,
"showPopups" : true,
Expand Down

0 comments on commit 49d397d

Please sign in to comment.