NTNU-SmallSat-Lab / hypso-satpy

1 stars 0 forks source link

Fix mirrored captures #4

Closed CameronLP closed 9 months ago

CameronLP commented 9 months ago

Datacubes are currently mirrored in the cross track direction. The correct this, the datacube and lat/lon arrays need to be mirrored in:

CameronLP commented 9 months ago

Added the line datacube = datacube[:, ::-1, :] in the .BIP and latitudes = latitudes[:,::-1] and longitudes = longitudes[:,::-1] in the georeferencing code. The code now produces correctly oriented composites.

CameronLP commented 9 months ago

Follow up comment: moved the datacube = datacube[:, ::-1, :] to the run_corrections function in correction.py

DennisNTNU commented 9 months ago

It might be that this does not work for all captures, but I am note sure. If you notice an issue, then I might know how to fix it. So we can look at this when you encounter an issue.

CameronLP commented 9 months ago

@DennisNTNU this fixes an issue I found yesterday where all captures and their lat/lon arrays were being mirrored due to how the captures were loaded from .bip files and the georeferencing code. As a result non-resampled composites (as well as the underlying non-resampled datasets) were being mirrored horizontally.

The issue with individual captures being mirrored still remains, though it seems to be limited to captures from 2022. As a temporary work around I've added a "flip=True" argument to be set when a mirrored capture is loaded.

DennisNTNU commented 9 months ago

Oh I see, then I misunderstood!