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

Providing NAs when estimates of relative fecundity are not available #132

Closed agruss2 closed 6 years ago

agruss2 commented 7 years ago

As indicated in the "fishbase-mapping.csv" file, when an estimate of relative fecundity is not available for a given functional group X, the API should provide a "NA" for the parameter "species.relativefecundity.spX" (which is provided in the "osm_param-species.csv" file). Many thanks.

jhpoelen commented 7 years ago

Please provide steps to reproduce.

agruss2 commented 7 years ago

@jhpoelen Sorry, I did not understand your comment. Could you please clarify what you need. Thanks!

agruss2 commented 7 years ago

@jhpoelen As indicated in the "fishbase-mapping.csv" file, relative fecundity in OSMOSE is the annual number of eggs per gram of mature female. This is a parameter that can easily be obtained from queries in FishBase/SeaLifeBase; for a given focal functional group the RelFecundity and SpawningCycles parameters can be extracted from FishBase/SeaLifeBase and multiplied together to get an estimate of annual number of eggs per gram of mature female. Definitions of RelFecundity and SpawningCycles can be found at: ropensci/fishbaseapi/blob/master/docs/docs-sources/fecundity.csv

The last test that I ran was for the Iceland Shelf/Sea ecosystem. Here is the "osm_param-species.csv" that I obtained for this ecosystem: osm_param-species.xlsx As you can see, the parameter "species.relativefecundity.sp*" was set to 0.0 for 7 focal functional groups (SP0, SP6, SP14, SP15, SP16, SP17, and SP20), while it would have been set to NA for these 7 functional groups.

Could you please make sure that, when it is not possible to generate an estimate of relative fecundity for a given functional group X from the information stored in FishBase/SeaLifeBase, the API associates a "NA" to parameter "species.relativefecundity.spX"? Please let me know if something is not clear. Thanks a lot.

jhpoelen commented 6 years ago

@agruss2 thanks for providing the details.

The behavior you observed is consistent with the defaults provided for fecundity.SpawningCycles and fecundity.RelFecundityMean in the fishbase-mapping.csv -

fecundity,SpawningCycles,fecundity.SpawningCycles,0.0,Number of spawning cycles per year
fecundity,RelFecundityMean,fecundity.RelFecundityMean,0.0,no. of mature oocytes per gram total weight

Because the species.relativefecundity.sp is a calculated value using ( fecundity.SpawningCycles * fecundity.RelFecundityMean), the "0.0" defaults for respective input parameters, resulted in a "0.0" instead of the expected NA.

I'll update the defaults to help provide the expected results.

jhpoelen commented 6 years ago

After applying the discussed changes, I observed the expected "NA" in the osm_param-species.csv configuration file generated from Iceland Shelf/Sea. See attached. Please confirm by closing this issue.

osm_param-species.csv.txt

agruss2 commented 6 years ago

I just ran a test for the Iceland Shelf/Sea ecosystem and I can confirm that the present issue has been solved. I am therefore going to close it. Many thanks.