osmose-model / osmose-web-api

Web service that generates Osmose configuration files from data sources like Fishbase and SeaLifeBase. Used by https://www.config.osmose-model.org .
MIT License
2 stars 2 forks source link

Populate all the "reproduction-seasonality-sp*" config files #96

Closed agruss2 closed 7 years ago

agruss2 commented 7 years ago

@jhpoelen Could you please make sure that API now populates all the different "reproduction-seasonality-sp*" config files?

jhpoelen commented 7 years ago

Currently, only default values are populated.

From fishbase-mappings.csv I noticed the mapping

spawning,Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov and Dec,vector given in reproduction-seasonality-sp csv files,0.0833,Seasonality of reproduction = monthly proportions of annual spawning if the time step of the OSMOSE model is one month. These are parameters that can easily be obtained from queries in FishBase/SeaLifeBase's spawning table. Please mind the following issue: jhpoelen/fb-osmose-bridge/issues/3

Will need to implement a method to map a month vector to seasonality tables. Will get back to this later.

jhpoelen commented 7 years ago

Now, the reproduction seasonality takes the steps per year into account. Also, it takes the months from https://fishbase.ropensci.org/spawning (now explicitly defined in fishbase-mapping.csv) and picks appropriate time boxes per time slice. Right now, spawning value is selected from the last months that is contained within a specific time slice, for implementation, see https://github.com/jhpoelen/fb-osmose-bridge/blob/df13d5493af3827adf850e74a187651f439cbcf3/src/main/java/com/github/jhpoelen/fbob/ConfigUtil.java#L124 .

I took the simplest approach I could think of. Please let me know if you have some other ideas on how to merge the two ranges.

agruss2 commented 7 years ago

@jhpoelen The computations unfortunately do not work as expected. Please see the file attached here for sp0 (i.e., pelagicmd): reproduction-seasonality-sp0.xlsx The values provided in Column B should sum to 1. For instance, if the number of time steps per year is 12 (i.e., if the time step of the OSMOSE model is 1 month) and if we do not have any information on reproduction seasonality for sp0, then all the values in Column B should be 0.0833, and not 111. Please let me know what you think is happening here.

jhpoelen commented 7 years ago

@agruss2 at a quick glance, the number 111 is provided by fishbase (e.g. http://fishbase.org/Reproduction/SpawningList.php?ID=94&GenusName=Auxis&SpeciesName=rochei&fc=416&StockCode=107). It seems to be some kind of binary designation to indicate whether or not spawning occurs in a month. I'll make an effort to normalize, so that the proportions are normalized. Stay tuned...

jhpoelen commented 7 years ago

reproduction seasonality table values should now be normalized. Please verify.

agruss2 commented 7 years ago

@jhpoelen Thanks a lot, the present issue has been fully resolved; I am closing it today.