Open abradley60 opened 1 month ago
I'm at the end of my workday so just noting my findings here. There appears to be two separate issues:
1) The nodata on the right side of the AM:
I think the missing data on the right side is due to the extent of the geoid that is being applied. The s3://aria-geoid/egm08_25.tif (referenced in the dem-stitcher code here) has the following extent:
The EGM2008 2.5' geoid model that can be accessed here appears to have identical values but a larger extent with an extra pixel at the border of the right side of the antimeridian (180)
Therefore, I think the values in the dem to the right of the antimeridian are being coverted to nodata, as there is missing data in the egm08_25.tif geoid file. Perhaps the geoid file should be updated?
2) Failing on the left side of the antimeridian:
I think this is due to the antimeridian crossing check here. Because the dem extent is slightly outside of the WGS84 range (+180,-180), it attempts to split the extent across the antimeridian, resulting in two extents, one of which is very small. Given the extent of the geoid is (-180.0208333333333428, 180.0208333333332860) these values could be used here instead when the function is called here.
i.e. for the geoid dateline crossing check, change:
if (xmin > -180) and (xmax < 180):
to
if (xmin > -180.0208333333333428) and (xmax < 180.020833333333286):
This solved the issue for me with the bounds_left = (-180, -78.176201, -177.884048, -75.697151)
Let me know if this is not clear, I can raise a PR tomorrow with some code changes that might be easier to follow. Thanks!
Thank you so much for the detailed explanation as well as the reproducible calls. Will have to look at it over the course of this week.
Sounds like Issue #100 might solve this if the buffered geoid does resolve this in this anti-meridian area.
At some point today - I am going to upload both the 2.5 and 1 degree geoids from agi-soft to our s3 bucket and share the links here.
The quickest fix would be to swap out the geoid hardcoded here: https://github.com/ACCESS-Cloud-Based-InSAR/dem-stitcher/blob/dev/dem_stitcher/geoid.py#L14-L19
I still think there might be a bug in the code though with respect to this based on what you are saying.
This probably has all come to pass because of the issue here: https://github.com/ACCESS-Cloud-Based-InSAR/dem-stitcher/issues/96
So to be clear, we were using the 1 degree geoid from agisoft, but it went down previously and that's "no bueno".
Thank you again.
It's taking some time on my part - sorry for the delay.
I uploaded the geoids (both 1 and 2.5 degrees) to the ARIA bucket.
I will create a PR and inspect it tomorrow (hopefully) or maybe Thursday.
They file names are:
us_nga_egm2008_25_4326__agisoft.tif
us_nga_egm2008_1_4326__agisoft.tif
Where I used rio warp <input> <output> --dst-crs EPSG:4326
as the software expects the geoid in 4326 (the bounds did not change).
Feel free to check too.
Thanks again.
Hi @cmarshak no problem at all, I have a working implementation in the meantime.
There are a number of other DEM handling steps our team are doing in order to get the desired format for our sentinel-1 processing. I am thinking it could make sense to add these directly to the dem-stitcher software. Other users may have the same requirements. I might raise a feature suggestion over the next week or two to discuss if your team is open to this?
That's good to hear. Thanks for your patience.
We use this software for our ARIA-S1-GUNWs, which are actively being processed and distributed via the DAAC. We don't have to worry about the anti-meridian issue you raise because ISCE2, which is what we use for the INSAR processing, does not work on the antimeridian anyways :) - see https://github.com/isce-framework/isce2/issues/634
Definitely want to address exposing the geoid parameter as mentioned in the issue above to allow other users to BYOG ('bring your own geoid').
The other bugs will take some time to address.
The bug
WGS84 Ellipsoidal height correction (
dst_ellipsoidal_height = True
) at the anti-meridian is failing on the antarctic coastline.To Reproduce
requirements
Query the coordinates of a scene known to cross the antimeridian in Antarctica using the asf-search package:
Note this scene crosses the antimeridian. However, it is a valid polygon that extends the width of the earth so it is not handled by the dem-stitcher software. If we were to pass the bounds of this to the
stitch_dem
function it will attempt to download a large number of tiles.Manually split the geometry to a set of bounds to the left and right of the antimeridian:
Download the left dem using dem-stitcher with
dst_ellipsoidal_height = True
Note, if we set
dst_ellipsoidal_height = False
the dem will download as expected.In the case of the right side of the antimeridian with
dst_ellipsoidal_height = True
, the function will work but the dem has some missing data near the antimeridian compared to the case wheredst_ellipsoidal_height = False
(see image below)I'm guessing this has something to do with the coverage of the geoid?
Additional context
I am processing sentinel-1 scenes over Antarctica and acquiring the cop 30m using the dem-stitcher software. This issue has occurred at the antimeridian, elsewhere the dem acquisition is working as expected