Closed agrouaze closed 2 years ago
The problem is that for a multidataset, the returned geometry is a union from all geometries, that are unorderded:
https://github.com/umr-lops/xsar/blob/develop/src/xsar/sentinel1_meta.py#L364-L369
There is s1meta.manifest_attrs['footprints']
that should be an ordered list.
Can you try with
[i.centroid.coords[0] for i in xsar.Sentinel1Meta(train).manifest_attrs['footprints']`]
This works, thanks
Perhaps that there is a way to make it clearer for the user.
currently, s1meta.subdatasets
and s1meta.manifest_attrs['footprints']
are zippable list.
We might consider to make s1meta.subdatasets
be a geodataframe, with index from subdatasets
, and geometry from manifest_attrs['footprints']
The above solution won't works with TOPS SLC products, because there is only one footprint in s1meta.manifest_attrs['footprints']
( the global one ).
What we can do for TOPS SLC is:
cc @agrouaze
In #81, I've choose to recursively open all TOPS _IW_SLC_
subdatasets, to get their individual footprint.
This slow down a little the product opening, but I think it's an acceptable solution, as the subdataset count is low (3)
@owenodriscoll , can you try my fork (pip install git+https://github.com/oarcher/xsar
)?
You should now use
[i.centroid.coords[0] for i in xsar.Sentinel1Meta(train).subdatasets.geometry]
cc @rmarquarlops, I think you will have to update you code after this PR is merged
@oarcher the code works using your fork, cheers
issue spotted by https://github.com/owenod1 `Salut, when using xsar's .footprint function on sentinel-1 WV train metadata the returned imagette footprints appear to follow a different sorting than the file listing (e.g. footprints 3,4 and 5 belongs to imagettes 23, 21 and 22). When retrieving the imagette footprints from the subdataset directly the footprints are sorted correctly but this requires to open the subdatasets individually. Is there a xsar way to connect the correct footprints directly to files without having to open the individual subdatasets?
example of the issue:
here a correct decreasing latitude is shown for descending train when loading the footprints individually, but when loading the footprints from the metadata directly the latitudes (and thus the footprints) follow an incorrect pattern `