Implement a new tropical cyclone rain model#85
Conversation
|
Hey everyone, the new rain module is ready for review! Please note that running the notebook and the tests will require data sets that are included in the Furthermore, the implementation is based on a proprietary MATLAB implementation. If you would like to have a look at the original code, please drop me a message, and I can send you the MATLAB source code via mail. |
# Conflicts: # climada_petals/hazard/tc_rainfield.py
| The implementation of the R-CLIPER model currently does not allow modifications, so that | ||
| `model_kwargs` is ignored with `model="R-CLIPER"`. While the TCR model can be configured in | ||
| several ways, it is usually safe to go with the default settings. Here is the complete list | ||
| of `model_kwargs` and their meaning with `model="TCR"` (in alphabetical order): |
There was a problem hiding this comment.
I'd expect the explanation of what model_kwargs is about in the function's parameters description just below, under model_kwargs.
There was a problem hiding this comment.
Good point, I moved the description accordingly.
| Path to a GeoTIFF file containing digital elevation model data (in m). If not | ||
| specified, a topography at 0.1 degree resolution provided with CLIMADA is used. | ||
| Default: None | ||
| matlab_ref_mode : bool, optional |
There was a problem hiding this comment.
Why do we need this. If you are sure it's a bug, it's better if it's gone, no? I'd rather add in the docstring that this is the original implementation, with a bug fix, and explain what the bug fix is.
There was a problem hiding this comment.
I agree that bugs should just be fixed if we are sure that they are bugs. I updated the description of the parameter.
Background: When I originally implemented this, I found quite a few strange "issues" in the MATLAB code. And it took some time to write them down and get feedback from the original authors about these "issues". I didn't want to remove the issues unless the original authors definitely confirm that they are unintended ("bugs"). When I wrote this docstring I still didn't have feedback from the authors. Today, the situation is different: I know that some of the issues really were bugs. Those bugs are now fixed in my implementation and the original authors also decided to fix them in their implementation. But some of the "issues" were actually deliberate decisions by the original authors that I, personally, don't like (for example, using a parameter value that is not documented anywhere in the literature, not even in their own papers), and, at the same time, only make a comparably small difference. For testing purposes, I still think that it's useful to be able to replicate the behavior of the reference implementation. That's why I keep this parameter, but make clear what it actually does.
|
Thanks @tovogt , I screened through the code and ran the tutorial. I cannot check it thoroughly but I wanted to provide a user type of feedback. Code: It looks great, I just had a couple of documentation-related comments. Tutorial: I could run it but I had to specifiy the paths of the required additional files (c_drag_500, topography_land_360 and tcrain_examples) via the model_kwargs arguments as my machine was looking for data under the 'Users/user_name/climada/...' folder instead of the CLIMADA project's folder. I am not completely sure, but my understanding is that 'Users/user_name/climada/...' is where these data are supposed to be by default? Anyway, beside that, it ran flawlessly and the text is also very clear with a good balance of explanation and links for further knowledge. A couple of more points :
|
|
Thanks for your feedback!
EDIT: I was finally able to reproduce the topography file from SRTM using gdalwarp and the "average" interpolation option. This is now also mentioned in several docstrings: climada_petals/climada_petals/hazard/tc_rainfield.py Lines 111 to 115 in d649a5a |
Super ! thanks for addressing these points and especially for figuring out where the elevation data come from. All good for me regarding this PR. |
|
I'm a wee bit uneasy about the data files being part of the repository. Alternatively we could get them from the data-api, maybe? |
|
Yes, sounds great! Please go ahead and copy the files to the data-api and tell me how I can access them from within the code, or just push your proposed changes. |
…equivalents downloaded from the data-api
Changes proposed in this PR:
climada_petals.hazard.tc_rainfieldmodule.climada_petals/data/tc_rainfield/tcrain_examples.nc(80 KB): Two TC tracks with additional variables extracted from ERA5. The data is used in the tutorial notebook as well as in the unit tests.climada_petals/data/tc_rainfield/c_drag_500.tif(~1 MB): A global gridded data set of the surface drag coefficient for gradient winds (from ERA5). The resolution is sufficient for almost all applications of the model, and it's still very small.climada_petals/data/tc_rainfield/topography_land_360as.tif(~3 MB): A global gridded data set of surface elevation at 0.1 degree resolution (derived from SRTM). The resolution is fine for applications of TCR, but is too low for many other applications, such as surge or flood simulations. It's public domain and comparably small, so I think we can distribute it with CLIMADA.As of July 6, this PR is ready to be reviewed. I'm looking forward to your feedback!
PR Author Checklist
develop)PR Reviewer Checklist