-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add functions to compute, plot, store the local hazard exceedence intensity and RP maps #857
Conversation
… and local return period maps
@@ -1541,6 +1543,48 @@ def local_exceedance_inten(self, return_periods=(25, 50, 100, 250)): | |||
Reason: no negative intensity values were found in hazard.') | |||
inten_stats[inten_stats < 0] = 0 | |||
return inten_stats | |||
|
|||
def local_return_period(self, hazard_intensities): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a confusing method signature to me. Why would a method of the class Hazard require the user to supply hazard intensities? These are already an attribute of the object.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here the variable hazard_intensities does not refer to the intensities of the Hazard object but to the threshold intensities for which the return period per grid point should be calculated. To avoid confusion we could rename this to "threshold_intensities"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 threshold_intensities
would be much better. 😄
hazard_intensities : np.array | ||
Hazard intensities to consider. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Be careful, this might lead to very large memory usage. Hazard intensities are on purpose sparse matrices.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comment above, hazard_intensities usually only includes a few values.
@simonameiler looks like the branch is not yet up to date with the develop branch and, e.g., changes from have been reversed. |
Thank you for the hint. I handed the pull request off to @ValentinGebhart |
I don't know how to resolve the issue that, even after merging develop back into this branch, many of the changes made to develop are not transferred here. One solution would be to create a new branch from develop (say "feature/write_haz_rp_maps2") and add the new functions again there. Do you think that this is fine or do you see a better solution? @emanuel-schmid @chahank |
@ValentinGebhart : keeping it simple is good to me, so just making a new branch is fine for me. Just then delete the old one. |
PR completed in a different branch (PR #898). I saved a local copy of the functions here, if needed please contact me. |
Changes proposed in this PR:
write_netcdf_local_exceedance_inten
or raster fileswrite_raster_local_exceedance_inten.
local_return_period
and_loc_return_period
for given hazard intensities, incl. plotting functionplot_local_rp
.write_netcdf_local_return_periods
or raster fileswrite_raster_local_return_periods
.This PR fixes #854
PR Author Checklist
develop
)PR Reviewer Checklist