fastscape-lem / orographic-precipitation Goto Github PK
View Code? Open in Web Editor NEWLT Model of Orographic Precipitation - A Python Implementation
License: MIT License
LT Model of Orographic Precipitation - A Python Implementation
License: MIT License
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.
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.
TODO:
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.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.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:
orographic-precipitation/orographic_precipitation/fastscape_ext.py
Lines 43 to 44 in 6133c97
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))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
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.