Skip to content

Commit

Permalink
fwa update (#458)
Browse files Browse the repository at this point in the history
* remove precip/discharge/channel width scripts

* use fwapg generated discharge/precip/cw tables
  • Loading branch information
smnorris authored Feb 20, 2024
1 parent 4773b48 commit d3e0bea
Show file tree
Hide file tree
Showing 37 changed files with 57 additions and 1,680 deletions.
14 changes: 0 additions & 14 deletions db/tables/mean_annual_precip.sql

This file was deleted.

16 changes: 0 additions & 16 deletions db/tables/sources.sql

This file was deleted.

24 changes: 1 addition & 23 deletions model/01_access/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -281,30 +281,8 @@ $(ACCESS_MODELS): .make/model_access_%: sql/model_access_%.sql \

touch $@

# -------------------------------------------------------------------------------------
# download pre-computed precip/discharge/channel width and load to db
# (required for inclusion in bcfishpass.streams)
# this can be removed with fix of #344, or at least moving this download into fwapg
# -------------------------------------------------------------------------------------
.make/data:
mkdir -p data
wget -qNP data https://bcfishpass.s3.us-west-2.amazonaws.com/channel_width.csv
wget -qNP data https://bcfishpass.s3.us-west-2.amazonaws.com/mean_annual_precip.csv
wget -qNP data https://bcfishpass.s3.us-west-2.amazonaws.com/discharge.csv
$(PSQL) -f sql/load_map_mad_cw.sql
# because we are downloading these files rather than building from scratch,
# create the make targets so habitat script does not try and build
mkdir -p ../02_habitat_linear/precipitation/.make
touch ../02_habitat_linear/precipitation/.make/precip
mkdir -p ../02_habitat_linear/channel_width/.make
touch ../02_habitat_linear/channel_width/.make/channel_width
mkdir -p ../02_habitat_linear/discharge/.make
touch ../02_habitat_linear/discharge/.make/discharge
touch $@
# -------------------------------------------------------------------------------------

# intermediate target for proessing all of above, but not the model_access script
.make/model_access_prep: $(ACCESS_MODELS) .make/index_crossings .make/data
.make/model_access_prep: $(ACCESS_MODELS) .make/index_crossings
touch $@

# run the access model
Expand Down
4 changes: 0 additions & 4 deletions model/01_access/sql/load_map_mad_cw.sql

This file was deleted.

6 changes: 3 additions & 3 deletions model/01_access/sql/load_streams.sql
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ LEFT OUTER JOIN whse_basemapping.fwa_watersheds_upstream_area ua -- use left jo
ON l.watershed_feature_id = ua.watershed_feature_id
left outer join whse_basemapping.fwa_stream_networks_order_parent op on s.blue_line_key = op.blue_line_key
left outer join whse_basemapping.fwa_stream_networks_order_max om on s.blue_line_key_50k = om.blue_line_key
LEFT OUTER JOIN bcfishpass.mean_annual_precip p ON s.wscode_ltree = p.wscode_ltree AND s.localcode_ltree = p.localcode_ltree
LEFT OUTER JOIN bcfishpass.channel_width cw ON s.linear_feature_id = cw.linear_feature_id
LEFT OUTER JOIN bcfishpass.discharge mad ON s.linear_feature_id = mad.linear_feature_id
left outer join whse_basemapping.fwa_stream_networks_mean_annual_precip p on s.wscode_ltree = p.wscode_ltree and s.localcode_ltree = p.localcode_ltree
left outer join whse_basemapping.fwa_stream_networks_channel_width cw on s.linear_feature_id = cw.linear_feature_id
left outer join whse_basemapping.fwa_stream_networks_discharge mad on s.linear_feature_id = mad.linear_feature_id
WHERE
s.watershed_group_code = :'wsg'
AND s.wscode_ltree <@ '999' IS FALSE
Expand Down
34 changes: 0 additions & 34 deletions model/02_habitat_linear/Makefile

This file was deleted.

1 change: 0 additions & 1 deletion model/02_habitat_linear/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ Using files provided in subfolders in `parameters` as a guide, place parameters

To modify models beyond what is provided in the parameters files, edit `sql/model_habitat_<spp>.sql` as required.
To add a new model, create a new file for the species of interest `sql/model_habitat_<spp>.sql` and adapt existing model queries as required.
Consider also creating a view for map visualization, using various existing views `sql/map_<spp>_vw.sql` as a guide.


## Add areas of known spawning/rearing
Expand Down
100 changes: 0 additions & 100 deletions model/02_habitat_linear/channel_width/Makefile

This file was deleted.

93 changes: 0 additions & 93 deletions model/02_habitat_linear/channel_width/README.md

This file was deleted.

55 changes: 0 additions & 55 deletions model/02_habitat_linear/channel_width/sql/channel_width.sql

This file was deleted.

Loading

0 comments on commit d3e0bea

Please sign in to comment.