lauraduncanson / icesat2_boreal

Biomass modeling and mapping of forest biomass in the boreal using NASA's ICESat-2
13 stars 6 forks source link

Rotated images when writing images to index with rio-cogeo #62

Closed nmt28 closed 1 year ago

nmt28 commented 1 year ago

I have imported imagery from GEE into MAAP. This imagery then needs to be window read and mosaicked into our custom tile index. The code is working well, however the output tiffs appear to be rotated or flipped. I have used this code previously so not sure why this is happening. It is possible that I have just specified an incorrect variable somewhere but I am not sure where.

Expected behavior:

output tiffs of 3000x3000 (3 bands)

Observed behavior:

output tiffs of 3000 (3 bands) but rotated/flipped so that images do not match underlying basemap. It is possible that the tiles could be in the wrong location and not just shifted

The code is at: https://github.com/lauraduncanson/icesat2_boreal/blob/master/notebooks/radar_integration/create_s1rtc_gee.ipynb

Note, we do not have imagery to the full index extent so as a quick and dirty solution to avoid redundant processing, the code writes .txt files where there is no imagery. This was done as the process takes longer than the ADE stays open, thus this allows me to check against a dir of existing files.

Here is an example issue. You should be able to see that this image doesn't match the underlying imagery. There is water in the scene but does not match up with the water in the underlying image. Not sure if this is due to a rotation or a complete mis-georeferencing. I imagine the issue might be transform related. I'm also not sure why the image is a triangle and not a square

Screenshot 2023-05-08 at 3 06 29 PM
nmt28 commented 1 year ago

Im able to close this out actually. We don't need to worry about this step as we already have the build_stack.py code for this