danstich / shadia Goto Github PK
View Code? Open in Web Editor NEWshadia: dam passage performance standard models for R
Home Page: https://shadia-ui.github.io/index.html
License: GNU General Public License v3.0
shadia: dam passage performance standard models for R
Home Page: https://shadia-ui.github.io/index.html
License: GNU General Public License v3.0
Cannot currently pass multiple values per dam to the timing
argument in ...RiverModel
due to an error in data write.
Temporary workaround: can pass a vector, to be sampled randomly, which achieves the same result as passing a vector (these are sampled randomly by internal functions to evaluate all input combinations:
res1 <- connecticutRiverModel(
nRuns = 1,
nYears = 10,
timing = list(sample(c(1,2,3),1),1,1,1,1),
upstream = list(
holyoke = c(0.50, 0.60, 0.70),
cabot = 1,
spillway = 1,
gatehouse = 1,
vernon = 1
),
downstream = list(
holyoke = c(0.80, 0.90, 0.95),
cabot = 1,
gatehouse= 1,
vernon = 1
),
northfield = list(
turnersA = 0.95,
turnersJ = 0.95,
vernonA = 0.95,
vernonJ = 0.95
),
pSpillway = 1,
inRiverF = 0,
commercialF = 0,
bycatchF = 0,
indirect = 1,
latent = 1,
watershed = TRUE
)
Need to implement significant updates to the package prior to submission of new models to peer review. These will include issues
#18, #22, #24, #38, #46, #47
These and other changes will include:
[x] Change watershed
default value to FALSE
because this will be used more commonly moving forward
[ ] Implementation of the downstream delay parameter
[ ] Implementation of truck & transport and user-facing arguments
[ ] Implementation of juvenile stocking at arbitrary locations in the watershed and user-facing arguments
[x] Implementation of seasonal passage performance standard specification or derivation
[x] Separation of adult and juvenile downstream dam survival and user-facing argument for downstream_juv
[x] Memory management and speed improvements (reduction of redundant object returns)
[ ] Ability to read upstream and downstream passage efficiencies from .csv files
[x] Ability to specify starting population size as number of spawners instead of age-1 fish
[ ] Implementation of Salmon Falls River model
[ ] Add watershed output toggle to models other than mohawkHudsonRiverModel()
I want to generalize the application of the individual-based upstream migration model (moveC
) and delay calculations (delayC
) based on the number of routes (nRoutes
). Right now, we use logical queries based on river name, but several of the routines are identical based on number of routes.
Fish in the Connecticut River ABM are not passing upstream in the manner in which they should. Numbers in PUs 3-5 are shockingly low, and they do not match previous results from old code. This is probably a result of retroactively fitting this code into the PNR and MMR code. Need to have a look at this. Otherwise, the model is looking good.
Need to go through and integrate roxygen2 comments to compile documentation
Related to issue #24.
It appears that timing values for the first dam are not recycled at remaining dams as intended when watershed = TRUE
.
Temporary workaround: can pre-sample the value for timing and then pass to function using object name, like this:
# Sample timing
times <- sample(c(1,2,3),1)
# Run the model
res1 <- connecticutRiverModel(
nRuns = 1,
nYears = 2,
timing = list(times, times, times, times, times),
upstream = list(
holyoke = c(0.50, 0.60, 0.70),
cabot = 1,
spillway = 1,
gatehouse = 1,
vernon = 1
),
downstream = list(
holyoke = c(0.80, 0.90, 0.95),
cabot = 1,
gatehouse= 1,
vernon = 1
),
northfield = list(
turnersA = 0.95,
turnersJ = 0.95,
vernonA = 0.95,
vernonJ = 0.95
),
pSpillway = 1,
inRiverF = 0,
commercialF = 0,
bycatchF = 0,
indirect = 1,
latent = 1,
watershed = TRUE
)
Upstream and downstream passage efficiencies are not being filled correctly during data write. May be occurring in fillOutputVectors.R
or in writeData
functions. The passage efficiencies are being implemented in the individual-based migration model (moveC
) correctly as evidenced by movement of fish throughout the river.
As we add more data sets, the data set up is slowing down. A lot of the fat can be trimmed from some of the data sets to speed load because we don't use a lot of the data but manipulation is done in place for transparency. Can do ahead of time, comment out code, and leave in place unused for reproducibility.
This one is a long way off and fairly low priority right now. But, would be nice to standardize naming conventions between inputs and outputs of all river models.
Need to develop a direction/examples for parallel execution on remote clusters. Right now, it is up to the user to know how to do this.
Would like to add this as "number of adult spawners". John S suggested reverse-engineering stable age distribution from a Leslie matrix. Can be done pretty easy by importing from demogR
package as we do in anadrofish
.
Looks like a bug was introduced in one of the variable storage routines during transition to a package. I think this may be related to garbage collection in R/innerLoopSampling.R
. Need to look into it, because it causes cores to crash and execution is halted.
Need to remove unused parameters following code updates
Fish in the Susquehanna River model are not moving into NY waters in the 'North Branch' movement route (upstream_path == 4). Thought that it was due to temperatures or long distance from mouth of river, but I cranked up movement speed parameters and closed off other routes, and fish are still not making it. Might be fine, but need to take a closer look.
The number of spawners being returned in the first downstream production unit seems unrealistically high in this model. Possibly related to similar bug/data issue #42 in kennebecRiverModel()
Remove deprecated or unused R code from release version
Need to update and double-check comments in .R
files to make sure they are accurate.
Right now, changes to dam passage performance standards need to be specified in outer-loop-sampling.R
We need a way that these can be specified in the call to penobscotRiverModel()
once the package is loaded. Ideally, this would be able to incorporate:
Dam-specific upstream and downstream passage efficiencies for individual dams (or all dams set to be the same).
Some standardization so that it can be passed from river to river as we develop more models.
Need to run QC on Saco River temperature data (tempD_saco.rda
).
During first watershed application for a re-licensing, I noticed that the passage efficiencies for each dam were being randomly drawn from the values of the first dam, instead of all being set to the same randomly drawn value (intention).
I have added patches to all of the main ...RiverModel
functions to resolve the issue
Base population numbers appear to have increased in CT River model following package updates.
New models need testing to make sure things aren't crazy
High numbers of spawners predicted for first PU. Possibly related to #40
Starting population size for sensitivity analysis (popStart
) is not being output to sens
correctly for sensitivity analysis.
Need to add capacity for truck and transport and stocking scenarios to the Susquehanna River model.
Would like for this to be generalized so it is applicable to all river systems future and current.
Need: functionality for users to supply seasonal passage efficiencies that we can convert to time-based rates.
Justification: we traditionally think about upstream and downstream passage in terms of seasonal efficiency and most projection models make assumptions about bulk efficiency to simulate effects of dams (habitat access) on populations. The models in shadia
use individual-based migration models instead of (state-based) projection matrices. Upstream passage through dams is parameterized as a probability of passage per unit time (e.g. daily rates). This was done to align with how dam passage standards are prescribed and assessed (e.g. telemetry studies).
Need to clean up results so that:
populationSize
is calculated as the sum of males and females across production units before application of pre-spawn mortality, fishing mortality, and post-spawn mortality.
Production-unit population sizes are currently calculated after application of those rates.
Should re-code R files used in penobscotRiverModel()
and merrimackRiverModel()
so that the sum of production-unit spawners equals populationSize
.
Added a second passage route for Merrimack River. Following the addition, the population appears to blink out in < 20 years. Need to look at downstream survival calculation in downstreamMigration.R
.
Would like the ability to assign different passage times to each dam in a system so that individual performance standards for passage time can be evaluated.
Create wrapper for parallel execution on local work station
Double check to make sure that results across temporal and spatial replicates are equal
Need to add ability to specify downstream survival through dams separately for juveniles and adults. Not sure what the best way is to do this. Could use a multiplier, but that would not allow for dam-specific juvenile survival evaluation. Can add as user-specified arguments, but the functions for each of the river models are getting really cumbersome to write out with all of the optional arguments...
There are some odd transient dynamics occurring as a result of the new routine used to simulate the starting population.
Following conversations with Michael Bailey, US Fish and Wildlife Service, Nashua, NH:
We need to add a second migration route for the Merrimack River. The second route needs to come in at the Pawtucket Dam, where there are two options for upstream and downstream migration. Should be two paths up, and two paths down. The two routes split about 1 km apart (upstream to downstream). Habitat is the same in both routes-- just need to sum within PUs across routes.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.