umr-lops / xsar

Synthetic Aperture Radar (SAR) Level-1 GRD python mapper for efficient xarray/dask based processing
https://cyclobs.ifremer.fr/static/sarwing_datarmor/xsar/
MIT License
24 stars 8 forks source link

pixel spacing as attribut of `xsar` datasets #100

Closed agrouaze closed 2 years ago

agrouaze commented 2 years ago

This issue is to spot the fact that 1) currently there is 2 way to fetch the pixel spacing values of the products, and they do not gives the same values: On one side we have the Sentinel1Dataset attribute pixel_atrack_m and pixel_xtrack_m computed like this:

    def pixel_atrack_m(self):
        """atrack pixel spacing, in meters (relative to dataset)"""
        return self.len_atrack_m / self.dataset.atrack.size

And on the other hand we have the information given by Sentinel1Meta.image: slant_pixel_spacing and ground_pixel_spacing. These last variables are coming from the annotations and given at mid sub-swath. For user wanting to have very precise range pixel spacing, there is a variable: range_ground_spacing. 2) Only the pixel_atrack_m and pixel_xtrack_m re available in the attribute of the xsar datasets, which could be a problem for external libraries; see xsarsea discussion

oarcher commented 2 years ago

So we have s1meta.pixel_xtrack_m that is self.image['ground_pixel_spacing'][0] at sensor level (full resolution).

I agree that we should use this value at dataset level. Something like: s1meta.pixel_xtrack_m * xtrack_step

where xtrack_step is the resolution, in pixels. (i.e something like np.unique(np.round(np.diff(self._dataset['xtrack'].values), 1))[0] )