Coder Social home page Coder Social logo

insalmo's People

Contributors

colinsheppard avatar sfrailsback avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

insalmo's Issues

Trout spawning area calc.

Trout.m line 1291: move statement “fishFeedingStrategy = Guarding” up to after line 1277 (before the cell is told to calculate available spawning area).

Fix TimeSeriesInputManager use of .csv files

TimeSeriesInputManager reads .csv files, but only by determining from the file name whether the file is or is not .csv. That seems a little dangerous to me; in fact, if you change the flow file name from ".csv" to ".dat" it reads all the flows as zeros and keeps going.

I was hoping that the user didnt have to care whether it's csv or not, the code would just deal with it.

TroutModelSwarm number size

TroutModelSwarm.m readFishInitializationFiles: Change this declaration: char number[4]; to this: char number[10];

PolyCell area calc.

In PolyCell.m, delete line 634 (which multiplies cell area by 10,000). It’s wrong because we already converted polygon coordinates from meters to cm.

Restore writeFrame method in ObserverSwarm

ObserverSwarm –writeFrame: un-comment the block “if([habitatRasterList getCount] > 0)”. Uncomment “id raster = nil;”.
ObserverSwarm –buildObjects: after this statement:
[habitatRasterMap at: habitatSpace insert: polyWorldRaster];
add this one: [habitatRasterList addLast: polyWorldRaster];

Submitted for inSTREAM too.

Add "fracFemale" to spawner initialization file

We need to specify what fraction of initial spawners each year is female- apparently it varies a lot and there is often data on it.
a) Add a new variable to the spawner initialization file, fracFemale. Make it the 3rd value on each line (after number of spawners).
b) When creating spawners, calculate exactly how many are female and male, instead of assigning sex randomly. Check the value of fracFemale to make sure it is between zero and 1.0. (0.0 and 1.0 are allowed.)

Hydraulic file reader

Incorporate the checks mentioned in the inSTREAM documentation. (or suggest other ones). See Sect. 3.4 of attached documentation (in email from Steve 4/12/11).

Clean up Observer.Setup

Observer.Setup: raster zoom factor and rasterResolution seem to do nothing and need to be cleaned out.

We want to get rid of rasterResolution because it is never used for anything. rasterResolution is used to set a variable polyRasterSize but that variable is never used. rasterResolution is also passed from TroutObserverSwarm to TroutModelSwarm (in two places) and frmo there to HabitatManager to HabitatSpace to PolyCell. But none of these seem to use it.

Raster zoom factor: So, our display rasters are Swarm class ZoomRaster, which supposedly lets you zoom in and out but we never implemented the code (which would be pretty complicated, apparently) to draw stuff correctly. I think the best thing would be to change its class to Raster and get rid of ZoomFactor. THIS CHANGE WAS MADE 5/10/2011

Make multi-year runs work

When the model runs for > 1 year, the adults for 2nd+ years are not initialized. This should require just a bit of complexity added to troutModelSwarm createInitialSpawners...

Clean up breakout reporter

Change the name of the create method for fixed columns from "createBegin" to:
createBeginWithFixedColumns:
forList: etc.

Change the name of the create method for CSV from "createBegin" to:
createBeginWithCSV: etc.

And a fix: If you use the non-CSV create method, the breakout columns are still written with commas. Headers and data columns are written correctly with fixed column width. I am pretty sure the problem is in the new code for writing output from anAverager in the method -output. Need to either use floatFormatString (which is different for CSV vs. columns) or else add some logic using isCSV.

Remove Barrier code

The code for barriers will not work in this version. We need to:
a) If barriers appear in Reach.Setup per sect. 20.2.3 of inSTREAM documentation, then raise an error that says barriers don't work in this version.
b) Remove Barrier.hm from code directory and Makefile

Refactor Trout to Fish

refactor ... I would like to change the class "Trout" to "Fish", in part so that when you pop up a probe to a fish it doesn't say "Trout". (Makes it look like we copied the code...) I am a little worried that globally replacing "Trout" with "Fish" may create some duplicate variable and method names, etc. Maybe try it but be careful.

Juveniles appear at upstream end of 3A ??

Juvenile salmon seem to appear at the upstream (left) end of reach 3A when they shouldn't: There are no redds in that end of the reach and they cannot move there from upstream. Run with ~5 adults initialized. How do they get there?

This was fixed by commit e4ff8eb

Test and fix optional output files

See which of the optional output files listed in Sect. 24 of the inSTREAM manual need fixing-- e.g., they no longer work, or need their format updated to remove "transect number" etc.

Same or similar fixes will be needed in inSTREAM.

Things still to do:

FoodAvailability: Add the reach name as a column just before cell number (now that we have multiple reaches).

For the following, if it is easy to add the metadata (run time & date) at the top please do:
Spawn_Cell (Trout.h)
MoveTest (Trout.h)
ReadyToSpawn (Trout.h)
CellDepthAreaVelocity (HabitatManager.h)

For the Habitat.rpt (#define HABITAT_REPORT_ON in HabitatManager.h):

  • make it .csv
  • add metadata

Finally, for all these could you change the file names from *.csv to *Out.csv. That way we can delete them all (without deleting the .csv input files) via "rm *Out.csv"

Thanks!

Error in moving downstream ... input or code?

07/21/2007 Scenario 1 Replicate 2 Number of live fish = 1
07/22/2007 Scenario 1 Replicate 2 Number of live fish = 1
This happened in running standard input, 2 replicates.

07/23/2007 Scenario 1 Replicate 2 Number of live fish = 1
07/24/2007 Scenario 1 Replicate 2 Number of live fish = 1
07/25/2007 Scenario 1 Replicate 2 Number of live fish = 1
WARNING: Trout >>>> moveToMaximizeExpectedMaturity >>>> habDownstreamLinksToUS all have zero depth >>>> juvenile staying in reach ClearCreek-3A
*** event raised for error: InvalidCombination
UniformUnsignedDist: Requested random number with range 4294967295,
but your generator only supports a range of 4294967294
*** execution terminating due to error
Symbol.m:187 -[Error(c) _raiseEvent:]
Aborted

Refactor ReddSumperImp to ReddSuperimp

Here's a cleanup you could please do to inSALMO to keep it from driving people nuts in Windows. I globally changed "ReddSuperImp_" to "ReddSuperimp_" (small "i" instead of "I", because when one fish builds a redd on top of another redd, it is "superimposition", although nontechnically it is also a super imposition.)

But somehow there are still two files in there called ReddSuperImpXXX.h. When you un-tar the package in Windows, it overwrites the good file ReddSuperimpxxx with the old file ReddSuperImpXXX. THen it won't compile.

So if you could just find and delete the two files with capital I in their name...

Implement faster depth and velocity updates?

FishCell has unused method calcDepthAndVelocityWithIndex. Why don’t we use it? (To understand this, see documentation for EcoSwarm InterpolationTable)

Applies also to inSTREAM.

Standard Input Files

Is there a place in the repository for the standard input files? Could be a separate branch or something for each model. That would be nice.

Prune screen output

You could also trim out some of the print statements that aren't really necessary any more. It's nice to see the major steps as the model gets built, and a few lines at the end of a run to know whether the experiment is all done, but other stuff we could get rid of.

Multi-year runs

multi-year runs don’t work: the model doesn't create the adults for years after the first. Is this easy to fix (should be)?

Fix hydraulic file reader: tabs at end of line and error checking

This may have already been fixed: HydraulicFileReader crashes if there is white space (tabs, at least) at the end of a line.

Also: the documentation says that the code makes these checks, not all of which are implemented yet:
The software makes several checks when reading in the cell hydraulics
file:
• The cell numbers must correspond with those in the cell geometry
file: each cell defined in the geometry file receives hydraulic input
and there are no cells in the hydraulic file but not in the geometry file.
• The flows on line 3 must be in order of increasing magnitude.
• The number of values on each row of hydraulic input (file lines 5 and
higher) must equal one (the cell number) plus two times the number
of flows defined line 3.
• There must be no negative velocities.
• Any negative depth values are set to zero (some hydraulic models as-
sign negative depths to locations above the water level).

(submitted for inSTREAM too.)

Model.Setup

get rid of the population initialization date variable in Model.Setup

Also: the color variables for tagging cells, dry cells, etc. should be in Observer.Setup instead of Model.Setup.
You will have to check what code you will have to add or remove so those values get to wherever they are used.
(Added SFR 4/22/2011)

Clean up moveSpawnersToLiveFish

TroutModelSwarm.m for inSALMO: in moveSpawnersToLiveFish and createSpawners, determine whether it's time for a spawner to appear via [spawner getArrivalTime] not month and day. (Artifact of problems SteveJ had.)

Clean up FishCell vs. PolyCell

Both FishCell and PolyCell have methods getPolyCellDepth. Put in FishCell.Velocity update is in FishCell but depth update is in PolyCell. Put both in FishCell. PolyCell should only have geometry and color stuff. Look for other redundancies/confusion. (FishCell is a subclass of PolyCell.)

Also applies to inSTREAM.

troutModelSwarm -drop method

The troutModelSwarm -drop method does not drop all the new stuff added for salmon. One example I noted was the outmigrantReporter. I suppose you could grep for "create" to see what we create, and see what of it is not dropped. Should be only a few things that are clearly salmon-related.

Include date criteria for spawning

Re-instate date criteria in spawning. Needs to be added to code and parameter file; parameter table in document. Is included in document.

Clean up drop in HabitatSpace, PolyCell

HabitatSpace drop: It looks like we’re trying to drop a lot of stuff that is never used (cornerCoords etc.) or drop stuff twice. And in PolyCell -drop we’re trying to drop something we’re not using, which causes warning statements at end of run.

Clean out junk we do't need, etc.

Submitted for instream too.

Breakout reporter formatting

Add a check that changes the format for floats to exponential if the number is too small or too big to fit in floating point format.

Get rid of piscivorous fish density stuff

Remove code for calculating number of piscivorous trout.

FishCell.m initializeSurvProb: remove logistic prob for piscivorous fish density from aquatic predation survival.
FishCell.hm: Remove method get piscivorousFishDensity.
HabitatSpace.hm: Remove methods calcPiscivorousFishDensity, incrementNumPiscivorousFish, updateHabSurvProbForAqPred, calcPiscivorousFishDensity, getPiscivorousFishDensity; iVars numPiscivorousFish, piscivorousFishDensity
?? FishCell updateHabSurvForAqPred
Trout moveToMaximizeSurvival and moveInReachToMaximizeSurvival: remove code to set piscivory and call [troutModel updateHabSurvProbs]
ModelSwarm.hm: remove method toggleFishForHabSurvUpdate. Remove iVars minSpeciesMinPiscLength, fishForHabSurvUpdate

Retain scientific notation in optional output files

In the optional output files (not: live fish; dead fish; redds; outmigrants), revert to the previous output format: scientific notation for floats. With these files, we are not worried about readability but need the full precision for code-testing.

Cells do not know habShelterSpeedFrac

The method FishCell setHabShelterSpeedFrac is not called, so the cell variable habShelterSpeedFrac is never updated from its initial value of zero. Best solution seems to be to get rid of this cell variable and have FishCell just get this reach variable from its space.

ReddSuperimpFunc

replace ReddSuperimpFunc.m with one that considers available unguarded gravel. Update documentation. Steve will send this file separately, see email around 4/13/11.

Cell data file use .csv

Can the cell data file (cellHabVarsFile) be in .csv format? Apparently not: HabitatSpace - readPolyCellDataFile. I suppose it should, to be consistent with other files. (But not the cell geometry file; it's in a ARC-GIS format.)

Redds.out

Output file Redds.out: (a) get rid of header for “Transect Number” (transects no longer exist in this version. they were eliminated from the output lines but not the header). (b) make the output .csv format.

There also seems to be a header for spawnerLength but no corresponding data output. Include length results. (Added SFR 4/21/11)

SFR 4/23: I did everything except convert the output format to .csv

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.