GFDRR / CCDR-tools

Geoanalytics for climate and disaster risk screening
https://gfdrr.github.io/CCDR-tools/
12 stars 8 forks source link

Coastal flood - wrong CSV output #8

Closed matamadio closed 2 years ago

matamadio commented 2 years ago

The Gpkg is correct, while the csv assign numbers to wrong units. Happens for Function selection. I don't see how they can be different since is the same dataframe.

    if analysis_type == "Function":
        no_geom.to_csv(os.path.join(OUTPUT_DIR, f"{country}_CF_{adm_name}_{exp_cat}_EAI.csv"), index=False)
        result_df.to_file(os.path.join(OUTPUT_DIR, f"{country}_CF_{adm_name}_{exp_cat}_EAI.gpkg"))
ConnectedSystems commented 2 years ago

Weird! Which notebook does this occur in?

ConnectedSystems commented 2 years ago

Nevermind, saw you put it in the title

matamadio commented 2 years ago

Coastal flood is the same code as river flood, adapted to work on different source. But that shouldn't affect results. Checking other countries.

ConnectedSystems commented 2 years ago

Hmm, could you attach example CSV results with the incorrect values, and let me know what the correct/expected value is?

Looking over the code I don't see anything wrong.

Also, are you looking at the CSV in Excel? Could it be applying some strange auto-format?

matamadio commented 2 years ago

Other countries were fine. Going to run the code again and see if the error replicates.

matamadio commented 2 years ago

Bugged output https://github.com/GFDRR/CCDR-tools/tree/sandbox/Top-down/notebooks/test_results

matamadio commented 2 years ago

Sorry - Bug was in my brain.