Code Monkey home page Code Monkey logo

orographic-precipitation's People

Contributors

benbovy avatar estebanace avatar hannahsophiadavies avatar jeanbraun avatar rlange2 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

orographic-precipitation's Issues

Scaling precipitation to FastScape

Hello @benbovy. I made a modification to the orographic_precipitation FastScape extension such that flowacc is properly scaled. For this I introduced a rainfall_frequency input parameter that is the number of storm of 1 hour duration per day. Note that the flow accumulation routine multiplies the runoff (in mm/hr) by the cell area (in m^2) such that the resulting flowacc is in mm m^2/hr (and not in mm^3/hr as specified in the current version). Therefore in order to get the flowacc in m^3/yr as expected in the SPL, one needs to scale it by:
self.flowacc *= 8.76*self.rainfall_frequency
I have also modified the test by adding a parameter rainfall_frequency in the file fixture_orographic_precipitation.py that contains the input parameters.
Unfortunately I forgot to create a new branch and I think I have overwritten the master branch on the GitHub repo. Sorry...
Jean.

Initial Update

The bot created this issue to inform you that pyup.io has been set up on this repo.
Once you have closed it, the bot will open pull requests for updates as soon as they are available.

Update tests

TODO:

  • simplify the structure (no need of fixtures if it's just for the input parameters of a single test).
  • test the actual logic implemented in compute_orographic_precip. Is there any ideal topography where we can compare the result against an analytical solution (e.g., with a gaussian pulse like shown in README)? Probably worth checking the paper.
  • add tests for the two process classes in fastscape_ext. Testing OrographicPrecipitation could be very similar than the test for compute_orographic_precip. No need to test the whole logic of OrographicDrainageDischarge (its base class will be tested upstream in fastscape), just ensure that values are converted as expected.

Variable (non-orographic) precipitation

We've discussed with @hannahsophiadavies the possibility to use a field of spatially variable precipitation rate as input. Technically, I think it should just work using the compute_orographic_precip function. However, this is currently not supported in the fastscape extension as OrographicPrecipitation.precip_base only accepts a scalar value:

precip_base = xs.variable(description="background, non-orographic precipitation rate",
attrs={"units": "mm/h"})

All it needs is the precip_base variable to accept both a scalar and a 2D field using dims=[(), ('y', 'x')].

Other variables might be concerned too:

  • rainfall_frequency could also accept a 2D field? (note: it should be moved to the OrographicDrainageDischarge process - #4 (comment))
  • What about wind_speed and wind_dir? It looks like it would work with 2d arrays instead of scalars just like for precip_base. I've no idea whether or not this makes any sense regarding the theory (model assumptions), though.

Someone interested in putting together a pull-request?

cc @EstebanAce

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.