sertit / eoreader

Remote-sensing opensource python library reading optical and SAR sensors, loading and stacking bands, clouds, DEM and spectral indices in a sensor-agnostic way.
https://eoreader.readthedocs.io/en/latest/
Apache License 2.0
284 stars 22 forks source link

ENH: [SAR] Don't use SNAP #2

Open remi-braun opened 3 years ago

remi-braun commented 3 years ago

Calibration

RADARSAT-2

Sentinel-1

https://sentinels.copernicus.eu/documents/247904/685163/S1-Radiometric-Calibration-V1.0.pdf/66e69a62-11ae-4160-916b-f2b97cb8a350?t=1432307754000

TerraSAR-X

COSMO Skymed

Terrain-Correction

RADARSAT-2

Use RPCs: https://gis.stackexchange.com/questions/303233/error-in-orthorectification-of-radarsat-2-scenes-with-gdal-and-rpc-dem-informa

Should be implementable like DIMAP orthorectification:

        kwargs = {"RPC_DEM": dem_path, "RPC_DEM_MISSING_VALUE": 0}
        # TODO:  add "refine_gcps" ? With which tolerance ? (ie. '-refine_gcps 500 1.9')
        #  (https://gdal.org/programs/gdalwarp.html#cmdoption-gdalwarp-refine_gcps)

        # Reproject
        # WARNING: may not give correct output resolution
        out_arr, dst_transform = warp.reproject(
            src_arr,
            rpcs=rpcs,
            src_crs=WGS84,
            dst_crs=self.crs(),
            resolution=self.resolution,
            src_nodata=0,
            dst_nodata=0,  # input data should be in integer
            num_threads=MAX_CORES,
            resampling=Resampling.bilinear,
            **kwargs,
        )

We just need to extract RPCs from product.xml

Sentinel-1

Use GCPS, retrievable with opening directly the .SAFE product

TerraSAR-X

Simply use TDX1_SAR__MGD_SE___SM_S_SRA_20201016T231611_20201016T231616.xml

COSMO Skymed

Use GCPS, retrievable with opening directly band from tyhe .h5 file: COSMO/CSKS4_DGM_B_HI_04_HH_RA_FF_20201008224042_20201008224049.h5://S01/SBI

LinearToFromdB

TODO

Despeckle

TODO

Specific S1

ThermalNoiseRemoval

TODO

Apply-Orbit-File

TODO

Remove Remove-GRD-Border-Noise

TODO

remi-braun commented 2 years ago

1st step should be the Despeckling operation as:

Look at findpeaks which have filters deriving from pyradar. Or maybe reimplement them ?

remi-braun commented 2 years ago

Maybe look at sarsen :)

Scartography commented 2 years ago

Not ideal but freshly released: https://github.com/bopen/xarray-sentinel

remi-braun commented 2 years ago

Thanks for the insight! 😄 I think sarsen is from the same team but a bit lower level, so I maybe easier to be used by EOReader.

This issue will be really hard to complete, especially if ESA will keep to add new SAR constellations at this rate 😅

remi-braun commented 2 years ago

Orthorectifying RADARSAT data: https://gis.stackexchange.com/questions/303233/error-in-orthorectification-of-radarsat-2-scenes-with-gdal-and-rpc-dem-informa (classic RPC ortho)