os-climate / physrisk

Physical climate risk calculation engine
Apache License 2.0
29 stars 39 forks source link

Access to average flood depth meters data #212

Open lotuslu999 opened 8 months ago

lotuslu999 commented 8 months ago

Describe the bug Due to business needs, I have been trying to output the average flood depth meters data from the codes but I could not manage to do so. I understand that the hazard data gives me a list of flood depths ('intensities') and a list of corresponding 'return periods', which the documentation on Physrisk os-climate.org indicates is a graph that can be transformed to a probability distribution and can be potentially used to compute a mathematical expectation for the flood depth. However, I'm also aware that there's a way to directly extract the average flood depths meters from the codes (maybe as a result of the hazard model) but I did not have the luck in finding it. Would really appreciate it if you could provide any ideas.

Expected behavior I would expect there's some function or database in the codes that can give me the average flood depth meters data by location by running it, i.e. we'd love to be able to get an average flood depth for each (latitude, longitude) pair.

Additional context In terms of data access rights, I now have access to S3 bucket.

HeatherAck commented 8 months ago

Adding @joemoorhouse and @sandoema for review of bug

sandoema commented 8 months ago

Ideally these technical queries are handled through the weekly physical risk office hours meeting at 4pm UK time every Wednesday (found on the community calendar). Are you able to attend this ? If not, drop me and Joe an email please.

joemoorhouse commented 8 months ago

Hi @lotuslu999, sorry for the late reply (I seemed to miss this one first time around)! It's not quite clear to me if you are interested in this through the code or via the API, but I think the former. The event distribution is in the HazardEventDistrib class https://github.com/os-climate/physrisk/blob/main/src/physrisk/kernel/hazard_event_distrib.py. This is also exposed in the AssetImpactResult class to help drill down into what is going on. You are quite right that we only have a mean_impact method on the impact distribution: https://github.com/os-climate/physrisk/blob/main/src/physrisk/kernel/impact_distrib.py not the hazard distribution, but we can add if that's useful. So I propose we add a mean_intensity method to HazardEventDistrib. Is that what you had in mind, just to check I have understood the request? I changed label to enhancement.