generated from NOAA-OWP/owp-open-source-project-template
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New service - Alaska AEP FIM (#1054)
Implements AEP FIM - Alaska static service Refs #917
- Loading branch information
1 parent
2c73d72
commit e58d4c1
Showing
14 changed files
with
2,869 additions
and
0 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
Core/LAMBDA/viz_functions/viz_fim_data_prep/hand_features_sql/rf_10_inundation_ak.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
SELECT | ||
crosswalk.hand_id, | ||
max_forecast.feature_id, | ||
CONCAT(LPAD(crosswalk.huc8::text, 8, '0'), '-', crosswalk.branch_id) as huc8_branch, | ||
LEFT(LPAD(crosswalk.huc8::text, 8, '0'), 6) as huc, | ||
crosswalk.hydro_id, | ||
ROUND(CAST(max_forecast.rf_10_0_17c * 0.0283168 as numeric), 2) AS streamflow_cms | ||
FROM derived.recurrence_flows_ak AS max_forecast | ||
JOIN derived.fim4_featureid_crosswalk AS crosswalk ON max_forecast.feature_id = crosswalk.feature_id | ||
LEFT OUTER JOIN publish.rf_10_inundation_ak AS fim ON max_forecast.feature_id = fim.feature_id | ||
WHERE | ||
crosswalk.huc8 IS NOT NULL AND | ||
crosswalk.lake_id = -999 AND | ||
fim.feature_id IS NULL AND | ||
crosswalk.branch_id != 0; |
15 changes: 15 additions & 0 deletions
15
Core/LAMBDA/viz_functions/viz_fim_data_prep/hand_features_sql/rf_25_inundation_ak.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
SELECT | ||
crosswalk.hand_id, | ||
max_forecast.feature_id, | ||
CONCAT(LPAD(crosswalk.huc8::text, 8, '0'), '-', crosswalk.branch_id) as huc8_branch, | ||
LEFT(LPAD(crosswalk.huc8::text, 8, '0'), 6) as huc, | ||
crosswalk.hydro_id, | ||
ROUND(CAST(max_forecast.rf_25_0_17c * 0.0283168 as numeric), 2) AS streamflow_cms | ||
FROM derived.recurrence_flows_ak AS max_forecast | ||
JOIN derived.fim4_featureid_crosswalk AS crosswalk ON max_forecast.feature_id = crosswalk.feature_id | ||
LEFT OUTER JOIN publish.rf_25_inundation_ak AS fim ON max_forecast.feature_id = fim.feature_id | ||
WHERE | ||
crosswalk.huc8 IS NOT NULL AND | ||
crosswalk.lake_id = -999 AND | ||
fim.feature_id IS NULL AND | ||
crosswalk.branch_id != 0; |
15 changes: 15 additions & 0 deletions
15
Core/LAMBDA/viz_functions/viz_fim_data_prep/hand_features_sql/rf_2_inundation_ak.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
SELECT | ||
crosswalk.hand_id, | ||
max_forecast.feature_id, | ||
CONCAT(LPAD(crosswalk.huc8::text, 8, '0'), '-', crosswalk.branch_id) as huc8_branch, | ||
LEFT(LPAD(crosswalk.huc8::text, 8, '0'), 6) as huc, | ||
crosswalk.hydro_id, | ||
ROUND(CAST(max_forecast.rf_2_0_17c * 0.0283168 as numeric), 2) AS streamflow_cms | ||
FROM derived.recurrence_flows_ak AS max_forecast | ||
JOIN derived.fim4_featureid_crosswalk AS crosswalk ON max_forecast.feature_id = crosswalk.feature_id | ||
LEFT OUTER JOIN publish.rf_2_inundation_ak AS fim ON max_forecast.feature_id = fim.feature_id | ||
WHERE | ||
crosswalk.huc8 IS NOT NULL AND | ||
crosswalk.lake_id = -999 AND | ||
fim.feature_id IS NULL AND | ||
crosswalk.branch_id != 0; |
15 changes: 15 additions & 0 deletions
15
Core/LAMBDA/viz_functions/viz_fim_data_prep/hand_features_sql/rf_50_inundation_ak.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
SELECT | ||
crosswalk.hand_id, | ||
max_forecast.feature_id, | ||
CONCAT(LPAD(crosswalk.huc8::text, 8, '0'), '-', crosswalk.branch_id) as huc8_branch, | ||
LEFT(LPAD(crosswalk.huc8::text, 8, '0'), 6) as huc, | ||
crosswalk.hydro_id, | ||
ROUND(CAST(max_forecast.rf_50_0_17c * 0.0283168 as numeric), 2) AS streamflow_cms | ||
FROM derived.recurrence_flows_ak AS max_forecast | ||
JOIN derived.fim4_featureid_crosswalk AS crosswalk ON max_forecast.feature_id = crosswalk.feature_id | ||
LEFT OUTER JOIN publish.rf_50_inundation_ak AS fim ON max_forecast.feature_id = fim.feature_id | ||
WHERE | ||
crosswalk.huc8 IS NOT NULL AND | ||
crosswalk.lake_id = -999 AND | ||
fim.feature_id IS NULL AND | ||
crosswalk.branch_id != 0; |
15 changes: 15 additions & 0 deletions
15
Core/LAMBDA/viz_functions/viz_fim_data_prep/hand_features_sql/rf_5_inundation_ak.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
SELECT | ||
crosswalk.hand_id, | ||
max_forecast.feature_id, | ||
CONCAT(LPAD(crosswalk.huc8::text, 8, '0'), '-', crosswalk.branch_id) as huc8_branch, | ||
LEFT(LPAD(crosswalk.huc8::text, 8, '0'), 6) as huc, | ||
crosswalk.hydro_id, | ||
ROUND(CAST(max_forecast.rf_5_0_17c * 0.0283168 as numeric), 2) AS streamflow_cms | ||
FROM derived.recurrence_flows_ak AS max_forecast | ||
JOIN derived.fim4_featureid_crosswalk AS crosswalk ON max_forecast.feature_id = crosswalk.feature_id | ||
LEFT OUTER JOIN publish.rf_5_inundation_ak AS fim ON max_forecast.feature_id = fim.feature_id | ||
WHERE | ||
crosswalk.huc8 IS NOT NULL AND | ||
crosswalk.lake_id = -999 AND | ||
fim.feature_id IS NULL AND | ||
crosswalk.branch_id != 0; |
15 changes: 15 additions & 0 deletions
15
.../LAMBDA/viz_functions/viz_fim_data_prep/hand_features_sql/rf_high_water_inundation_ak.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
SELECT | ||
crosswalk.hand_id, | ||
max_forecast.feature_id, | ||
CONCAT(LPAD(crosswalk.huc8::text, 8, '0'), '-', crosswalk.branch_id) as huc8_branch, | ||
LEFT(LPAD(crosswalk.huc8::text, 8, '0'), 6) as huc, | ||
crosswalk.hydro_id, | ||
ROUND(CAST(max_forecast.high_water_threshold * 0.0283168 as numeric), 2) AS streamflow_cms | ||
FROM derived.recurrence_flows_ak AS max_forecast | ||
JOIN derived.fim4_featureid_crosswalk AS crosswalk ON max_forecast.feature_id = crosswalk.feature_id | ||
LEFT OUTER JOIN publish.rf_high_water_inundation_ak AS fim ON max_forecast.feature_id = fim.feature_id | ||
WHERE | ||
crosswalk.huc8 IS NOT NULL AND | ||
crosswalk.lake_id = -999 AND | ||
fim.feature_id IS NULL AND | ||
crosswalk.branch_id != 0; |
24 changes: 24 additions & 0 deletions
24
...AMBDA/viz_functions/viz_fim_data_prep/reference_preprocessing_sql/rf_10_inundation_ak.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
-- No RAS2FIM cached features for Alaska yet, but keeping the script in case it is added later. | ||
|
||
DROP TABLE IF EXISTS publish.rf_10_inundation_ak; | ||
SELECT | ||
crosswalk.hydro_id, | ||
crosswalk.hydro_id::text AS hydro_id_str, | ||
ST_Transform(gc.geom, 3857) AS geom, | ||
crosswalk.feature_id, | ||
crosswalk.feature_id::text AS feature_id_str, | ||
ROUND(CAST(fs.rf_10_0_17c as numeric), 2) AS streamflow_cfs, | ||
gc.stage_ft as fim_stage_ft, | ||
mgc.max_rc_stage_ft, | ||
mgc.max_rc_discharge_cfs, | ||
mgc.model_version, | ||
'{fim_version}' as fim_version, | ||
to_char('1900-01-01 00:00:00'::timestamp without time zone, 'YYYY-MM-DD HH24:MI:SS UTC') AS reference_time, | ||
crosswalk.huc8 as huc8, | ||
crosswalk.branch_id as branch | ||
INTO publish.rf_10_inundation_ak | ||
FROM ras2fim.geocurves gc | ||
JOIN derived.recurrence_flows_ak fs ON fs.feature_id = gc.feature_id | ||
JOIN ras2fim.max_geocurves mgc ON gc.feature_id = mgc.feature_id | ||
JOIN derived.fim4_featureid_crosswalk AS crosswalk ON gc.feature_id = crosswalk.feature_id | ||
WHERE gc.discharge_cfs >= fs.rf_10_0_17c AND gc.previous_discharge_cfs < fs.rf_10_0_17c; |
24 changes: 24 additions & 0 deletions
24
...AMBDA/viz_functions/viz_fim_data_prep/reference_preprocessing_sql/rf_25_inundation_ak.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
-- No RAS2FIM cached features for Alaska yet, but keeping the script in case it is added later. | ||
|
||
DROP TABLE IF EXISTS publish.rf_25_inundation_ak; | ||
SELECT | ||
crosswalk.hydro_id, | ||
crosswalk.hydro_id::text AS hydro_id_str, | ||
ST_Transform(gc.geom, 3857) AS geom, | ||
crosswalk.feature_id, | ||
crosswalk.feature_id::text AS feature_id_str, | ||
ROUND(CAST(fs.rf_25_0_17c as numeric), 2) AS streamflow_cfs, | ||
gc.stage_ft as fim_stage_ft, | ||
mgc.max_rc_stage_ft, | ||
mgc.max_rc_discharge_cfs, | ||
mgc.model_version, | ||
'{fim_version}' as fim_version, | ||
to_char('1900-01-01 00:00:00'::timestamp without time zone, 'YYYY-MM-DD HH24:MI:SS UTC') AS reference_time, | ||
crosswalk.huc8 as huc8, | ||
crosswalk.branch_id as branch | ||
INTO publish.rf_25_inundation_ak | ||
FROM ras2fim.geocurves gc | ||
JOIN derived.recurrence_flows_ak fs ON fs.feature_id = gc.feature_id | ||
JOIN ras2fim.max_geocurves mgc ON gc.feature_id = mgc.feature_id | ||
JOIN derived.fim4_featureid_crosswalk AS crosswalk ON gc.feature_id = crosswalk.feature_id | ||
WHERE gc.discharge_cfs >= fs.rf_25_0_17c AND gc.previous_discharge_cfs < fs.rf_25_0_17c; |
24 changes: 24 additions & 0 deletions
24
...LAMBDA/viz_functions/viz_fim_data_prep/reference_preprocessing_sql/rf_2_inundation_ak.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
-- No RAS2FIM cached features for Alaska yet, but keeping the script in case it is added later. | ||
|
||
DROP TABLE IF EXISTS publish.rf_2_inundation_ak; | ||
SELECT | ||
crosswalk.hydro_id, | ||
crosswalk.hydro_id::text AS hydro_id_str, | ||
ST_Transform(gc.geom, 3857) AS geom, | ||
crosswalk.feature_id, | ||
crosswalk.feature_id::text AS feature_id_str, | ||
ROUND(CAST(fs.rf_2_0_17c as numeric), 2) AS streamflow_cfs, | ||
gc.stage_ft as fim_stage_ft, | ||
mgc.max_rc_stage_ft, | ||
mgc.max_rc_discharge_cfs, | ||
mgc.model_version, | ||
'{fim_version}' as fim_version, | ||
to_char('1900-01-01 00:00:00'::timestamp without time zone, 'YYYY-MM-DD HH24:MI:SS UTC') AS reference_time, | ||
crosswalk.huc8 as huc8, | ||
crosswalk.branch_id as branch | ||
INTO publish.rf_2_inundation_ak | ||
FROM ras2fim.geocurves gc | ||
JOIN derived.recurrence_flows_ak fs ON fs.feature_id = gc.feature_id | ||
JOIN ras2fim.max_geocurves mgc ON gc.feature_id = mgc.feature_id | ||
JOIN derived.fim4_featureid_crosswalk AS crosswalk ON gc.feature_id = crosswalk.feature_id | ||
WHERE gc.discharge_cfs >= fs.rf_2_0_17c AND gc.previous_discharge_cfs < fs.rf_2_0_17c; |
24 changes: 24 additions & 0 deletions
24
...AMBDA/viz_functions/viz_fim_data_prep/reference_preprocessing_sql/rf_50_inundation_ak.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
-- No RAS2FIM cached features for Alaska yet, but keeping the script in case it is added later. | ||
|
||
DROP TABLE IF EXISTS publish.rf_50_inundation_ak; | ||
SELECT | ||
crosswalk.hydro_id, | ||
crosswalk.hydro_id::text AS hydro_id_str, | ||
ST_Transform(gc.geom, 3857) AS geom, | ||
crosswalk.feature_id, | ||
crosswalk.feature_id::text AS feature_id_str, | ||
ROUND(CAST(fs.rf_50_0_17c as numeric), 2) AS streamflow_cfs, | ||
gc.stage_ft as fim_stage_ft, | ||
mgc.max_rc_stage_ft, | ||
mgc.max_rc_discharge_cfs, | ||
mgc.model_version, | ||
'{fim_version}' as fim_version, | ||
to_char('1900-01-01 00:00:00'::timestamp without time zone, 'YYYY-MM-DD HH24:MI:SS UTC') AS reference_time, | ||
crosswalk.huc8 as huc8, | ||
crosswalk.branch_id as branch | ||
INTO publish.rf_50_inundation_ak | ||
FROM ras2fim.geocurves gc | ||
JOIN derived.recurrence_flows_ak fs ON fs.feature_id = gc.feature_id | ||
JOIN ras2fim.max_geocurves mgc ON gc.feature_id = mgc.feature_id | ||
JOIN derived.fim4_featureid_crosswalk AS crosswalk ON gc.feature_id = crosswalk.feature_id | ||
WHERE gc.discharge_cfs >= fs.rf_50_0_17c AND gc.previous_discharge_cfs < fs.rf_50_0_17c; |
24 changes: 24 additions & 0 deletions
24
...LAMBDA/viz_functions/viz_fim_data_prep/reference_preprocessing_sql/rf_5_inundation_ak.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
-- No RAS2FIM cached features for Alaska yet, but keeping the script in case it is added later. | ||
|
||
DROP TABLE IF EXISTS publish.rf_5_inundation_ak; | ||
SELECT | ||
crosswalk.hydro_id, | ||
crosswalk.hydro_id::text AS hydro_id_str, | ||
ST_Transform(gc.geom, 3857) AS geom, | ||
crosswalk.feature_id, | ||
crosswalk.feature_id::text AS feature_id_str, | ||
ROUND(CAST(fs.rf_5_0_17c as numeric), 2) AS streamflow_cfs, | ||
gc.stage_ft as fim_stage_ft, | ||
mgc.max_rc_stage_ft, | ||
mgc.max_rc_discharge_cfs, | ||
mgc.model_version, | ||
'{fim_version}' as fim_version, | ||
to_char('1900-01-01 00:00:00'::timestamp without time zone, 'YYYY-MM-DD HH24:MI:SS UTC') AS reference_time, | ||
crosswalk.huc8 as huc8, | ||
crosswalk.branch_id as branch | ||
INTO publish.rf_5_inundation_ak | ||
FROM ras2fim.geocurves gc | ||
JOIN derived.recurrence_flows_ak fs ON fs.feature_id = gc.feature_id | ||
JOIN ras2fim.max_geocurves mgc ON gc.feature_id = mgc.feature_id | ||
JOIN derived.fim4_featureid_crosswalk AS crosswalk ON gc.feature_id = crosswalk.feature_id | ||
WHERE gc.discharge_cfs >= fs.rf_5_0_17c AND gc.previous_discharge_cfs < fs.rf_5_0_17c; |
24 changes: 24 additions & 0 deletions
24
...z_functions/viz_fim_data_prep/reference_preprocessing_sql/rf_high_water_inundation_ak.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
-- No RAS2FIM cached features for Alaska yet, but keeping the script in case it is added later. | ||
|
||
DROP TABLE IF EXISTS publish.rf_high_water_inundation_ak; | ||
SELECT | ||
crosswalk.hydro_id, | ||
crosswalk.hydro_id::text AS hydro_id_str, | ||
ST_Transform(gc.geom, 3857) AS geom, | ||
crosswalk.feature_id, | ||
crosswalk.feature_id::text AS feature_id_str, | ||
ROUND(CAST(fs.high_water_threshold as numeric), 2) AS streamflow_cfs, | ||
gc.stage_ft as fim_stage_ft, | ||
mgc.max_rc_stage_ft, | ||
mgc.max_rc_discharge_cfs, | ||
mgc.model_version, | ||
'{fim_version}' as fim_version, | ||
to_char('1900-01-01 00:00:00'::timestamp without time zone, 'YYYY-MM-DD HH24:MI:SS UTC') AS reference_time, | ||
crosswalk.huc8 as huc8, | ||
crosswalk.branch_id as branch | ||
INTO publish.rf_high_water_inundation_ak | ||
FROM ras2fim.geocurves gc | ||
JOIN derived.recurrence_flows_ak fs ON fs.feature_id = gc.feature_id | ||
JOIN ras2fim.max_geocurves mgc ON gc.feature_id = mgc.feature_id | ||
JOIN derived.fim4_featureid_crosswalk AS crosswalk ON gc.feature_id = crosswalk.feature_id | ||
WHERE gc.discharge_cfs >= fs.high_water_threshold AND gc.previous_discharge_cfs < fs.high_water_threshold; |
Oops, something went wrong.