NRCan / CanFlood

Flood Risk modelling toolbox for Canada
MIT License
29 stars 7 forks source link

[CLOSED] Assertion Error - for Run Risk1 and Run Risk2 #7

Closed dhanyatha-harish-ibigroup closed 3 years ago

dhanyatha-harish-ibigroup commented 3 years ago

Issue by mbrwn Wednesday Feb 24, 2021 at 21:39 GMT # Sample: Friday Sep 13, 2013 at 22:58 GMT Originally opened as https://github.com/IBIGroupCanWest/CanFlood/issues/76


Following Tutorial 2a but with my own datasets. All steps were successful (with some trial-and-error) until this point. Validation of R1 was successful. Then when tried to run R1 got error: image Run of L2 worked ok with the same files/set-up. Then run of R2 got this error: image

dhanyatha-harish-ibigroup commented 3 years ago

Comment by cefect Wednesday Feb 24, 2021 at 23:25 GMT # Sample: Friday Sep 13, 2013 at 22:58 GMT


For the first problem, it looks like you're trying to pass an L2 inventory (w/ tag and cap values) through the L1 model. Try removing 'f0_tag' and 'f0_cap' from the inventory to make it an L1 inventory. This error catch is there to make sure an L1 model isn't run when an L2 is expected by the user (but perhaps it should be switched to a warning).

For the second problem, it looks like you're trying to run the risk calculator w/ only 2 events. Section 4.2.3 'Events without Failure' tries to explain this, but the ead algorithm needs at least 3 events to run (but even this will give you a very coarse answer.. we usually try to have at least 8 to get a good representation of the risk). If you're fine with just impact values (not interested in calculating risk), then then you can just use the 'dmgs' output from the 'Impacts (L2)' (although the fancy results analysis tools mostly work on risk results for now).

Hopefully this helps

dhanyatha-harish-ibigroup commented 3 years ago

Comment by mbrwn Thursday Feb 25, 2021 at 15:57 GMT # Sample: Friday Sep 13, 2013 at 22:58 GMT


Thanks that does help. Yes I think for the R1 error it should be a warning instead. So the same dataset can be used for simple analysis/output and more detailed analysis/output.

I added more hazard rasters (5 in total) and redid all steps. L1 analysis ran ok. R2 analysis now gives a different error: image

Adding a note in the user manual explicitly telling the user that 3 hazard rasters are needed for a R2 analysis would be helpful/more user friendly.

dhanyatha-harish-ibigroup commented 3 years ago

Comment by cefect Thursday Feb 25, 2021 at 16:47 GMT # Sample: Friday Sep 13, 2013 at 22:58 GMT


The 'rtail' error is thrown because the risk curve can not be extrapolated into the range of calculated values. If your smallest event is indeed a 2-year.. then I'd hope these impacts are quite small, and you could apply an rtail=None (no extrapolation). Alternatively, select a larger rtail value (or 'extrapolate' ) in the control file. This parameter is described in Section 4.2 Parameter Summary.

As for your other points: 1) I've removed the error catch.. and risk (L1) models should now run with 2 events (didn't test L2) 2) I've loosened the expectations on the inventory, and L1 models now run with extra nest fields (e.g., a L2 inventory can be used in L1 analysis)

You should see these reflected in the next release.

On a side note.. I'm not thrilled with the reporting of warnings as it is now... I'll chat with the team and see if we can switch to some sort of pop-up message.

dhanyatha-harish-ibigroup commented 3 years ago

Comment by mbrwn Thursday Feb 25, 2021 at 19:56 GMT # Sample: Friday Sep 13, 2013 at 22:58 GMT


Thanks for your help! Changing rtail=none worked.

I have 2, 5, 10, 25, 50 and 100 yr hazard rasters. Asset flooding only occurs during 25, 50 and 100 yr. So I tried resolving this issue two ways to compare results: 1) only sample the hazard raster that result in impacts (25, 50 and 100 yr) and keep rtail = 0.5 default. image

2) sample all 6 hazard rasters and change rtail = none. image