Skip to content
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

[8pt] Stage-based CatFIM creating weird boxes in gpkgs #1309

Open
EmilyDeardorff opened this issue Oct 7, 2024 · 3 comments · May be fixed by #1285
Open

[8pt] Stage-based CatFIM creating weird boxes in gpkgs #1309

EmilyDeardorff opened this issue Oct 7, 2024 · 3 comments · May be fixed by #1285
Assignees
Labels
bug Something isn't working CatFIM NWS Flood Categorical HAND FIM

Comments

@EmilyDeardorff
Copy link
Contributor

Stage-based CatFIM has recently started creating geopackages with weird box-y shapes alongside the inundation polygons.

Current behavior

The stage-based CatFIM output geopackage has the expected inundation polygons with large rectangular box shapes included.

Expected behavior

We would expect to see the smaller inundation polygon without the large rectangular box.

Screenshots

Weird boxes:
image

@EmilyDeardorff EmilyDeardorff added bug Something isn't working CatFIM NWS Flood Categorical HAND FIM labels Oct 7, 2024
@EmilyDeardorff
Copy link
Contributor Author

Notes

  • Only happening in stage-based CatFIM
  • The issue is happening during or before the creation of the merged inundation tif

Debugging Progress (as of 10/7/24)

Folder setup

  • Is it caused by not clearing the folder before re-running CatFIM?
    -> not the cause, tested with clean output folders and error still occurred
  • Is it caused by metadata pre-pull?
    -> not the cause, tested stage-based CatFIM with and without the metadata pre-pull and the error still occurred

Docker image

  • Is it caused by new docker image?
    -> probably not the cause, tested stage-based CatFIM on an older docker image (fim_4:dev_20240823_6321468) and the error still occurred

Fiona and Pyogrio

  • Is it caused by the addition of engine='fiona' in file saves?
    -> not the cause, tested stage-based CatFIM with this commented out and the error still occurred
  • Is it caused by the addition of gpd.options.io_engine = "pyogrio", added in this commit?
    -> not the cause, commented this line out of all three CatFIM scripts and the error still occurred

NoData Values

  • Is it caused by how we are handling nodata values?
    -> Still testing

this nodata stuff seems to be new…? from this commit

image

here, nodata is set to -1

whereas here(for stage-based), in dev, nodata is set to 10?
image

test with stage-based nodata val set to 10
image

it looks like the boxes are still formed with that code variation →
image

@RobHanna-NOAA
Copy link
Contributor

While unlikely... after Emily tries more of her code level tests, we could try taking a current docker container and manually rolling back some of the packages to see if that helps.

Also.. Emily is likely already on this, but in produce_tif_per_huc_per_mag_for_stage, we are really using a rather non-conventional to do it. Maybe we can look at some similar changes for making in things like agreedem.py. with rasterio.open(dem) as elev, rasterio.open(rivers_raster) as rivers: Might be worth just dumping this idea in and trying it. Obviously we don't need most of that code in agreedem.py but it does do dem masking a bit different and might give some clues (or even a fix).

@RobHanna-NOAA
Copy link
Contributor

Another idea to chase later is maybe how it mosiacs?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working CatFIM NWS Flood Categorical HAND FIM
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants