diapotb issueshttps://gitlab.orfeo-toolbox.org/remote_modules/diapotb/-/issues2024-03-01T13:59:10Zhttps://gitlab.orfeo-toolbox.org/remote_modules/diapotb/-/issues/38OTB V8 SARCartesianMean & OrthoRectification validation2024-03-01T13:59:10ZAlexis SanchezOTB V8 SARCartesianMean & OrthoRectification validation## **SARCartesianMean**
Tests with same inputs on a TREX computation node (RH8, cpu 2022)
| V7 | V8 | V8 _(with values on the same scale)_ |
| ------ | ------ |------ |
| ![cartmean_v7](/uploads/645652f74a7ee0b2e2d0c4b616eb84d4/ca...## **SARCartesianMean**
Tests with same inputs on a TREX computation node (RH8, cpu 2022)
| V7 | V8 | V8 _(with values on the same scale)_ |
| ------ | ------ |------ |
| ![cartmean_v7](/uploads/645652f74a7ee0b2e2d0c4b616eb84d4/cartmean_v7.PNG) | ![cartmean_v8](/uploads/b5ac49e561b957647573b037f70594dc/cartmean_v8.PNG) | ![cartmean_v8_scaled](/uploads/eebcfb413a023f265deb33f29df38434/cartmean_v8_scaled.PNG) |
**otbcli_CompareImages results between V7 and V8 SARCartesianMean :**
| Variable | band1 | band 2 | band 3 | band 4 |
| ------ | ------ | ------ | ------ | ------ |
| mse | 1765970048 | 3775515904 | 819023552 | 0.0001564451959 |
| mae | 528.1376343 | 768.7820435 | 358.1038513 | 0.0001564451959 |
| psnr | 38.12303162 | 38.12473297 | 38.37815857 | 38.05637741 |
| Number of Pixel different (count) | 590176128 | 308131072 | 393952640 | 114571 |
## **OrthoRectification**
| V7 | V8 |
| ------ | ------ |
| ![ortho_complet_v7](/uploads/8c28ec1c9e6e004a81cc7abb6f544ac1/ortho_complet_v7.PNG) | ![ortho_complet_v8](/uploads/002148bd753b025c100b7dc25916b811/ortho_complet_v8.PNG) |
| ![ortho_diff2_v7](/uploads/162e0f095adbe33aeaf9e455c0065897/ortho_diff2_v7.PNG) | ![ortho_diff2_v8](/uploads/f9d25e387ee38751427521c6761d123b/ortho_diff2_v8.PNG) |
|![ortho_v7](/uploads/a23b59b8fab7834c152fa0f8ed4fe1b7/ortho_v7.PNG) | ![ortho_v8](/uploads/51586e9457b03ba8db026fee80779d26/ortho_v8.PNG) |
**otbcli_CompareImages results between V7 and V8 OrthoRectification:**
| Variable | band1 | band 2 | band 3 | band 4 |
| ------ | ------ | ------ | ------ | ------ |
| mse | 0.2615825534 | 0.542629838 | 0.002940441249 | 0.0003084974596 |
| mae | 0.08626469225 | 0.2986503243 | 0.02318748087 | 0.0004334210535 |
| psnr | 60.66061783 | 22.08388329 | 28.58383179 | 38.51995468 |
| Number of Pixel different (count) | 96732896 | 96733040 | 96733032 | 452747 |https://gitlab.orfeo-toolbox.org/remote_modules/diapotb/-/issues/37OTB V8 SAR chain validation2024-03-01T13:59:32ZAlexis SanchezOTB V8 SAR chain validation**Comparison table between V7 and V8 _(computation node on TREX)_:**
| Application | Execution time **V7** | Execution time **V8** | Similar results? |
| ---- | :------: | :------: | :------: |
| otbcli_SARDoppler0 | 35s | 23s...**Comparison table between V7 and V8 _(computation node on TREX)_:**
| Application | Execution time **V7** | Execution time **V8** | Similar results? |
| ---- | :------: | :------: | :------: |
| otbcli_SARDoppler0 | 35s | 23s | :heavy_check_mark: |
| otbcli_SARMultiLook | 19s | 8s | :heavy_check_mark: |
| otbcli_SARDEMProjection | 32s | 8s | :heavy_check_mark: |
| otbcli_SARCartesianMeanEstimation | 1m 25s | 1m 32s | See issue #38 |
| otbcli_SARFineDeformationGrid| 3m 11s | 3m 02s | :heavy_check_mark: légères différences |
| otbcli_SARCoRegistration | 31s | 29s | :heavy_check_mark: |
| otbcli_SARRobustInterferogram | 10m 30s | 13m 04s | :heavy_check_mark: |
| otbcli_SARTopographicPhase | 1m 24s | 1m 11s | - |
| otbcli_SARCompensatedComplex | 1m 56s | 1m 29s | - |
| otbcli_SARPhaseFiltering | 1m 53s | **15m 56s** | - |
| otbcli_SARAddBandInterferogram | 1m 38s | 1m 57s | - |
| otbcli_OrthoRectification | 1m 53s | 1m 33s | See issue #38 |
<br>
**otbcli_SARFineDeformationGrid - difference between v7 and v8 results:**
| V7 | V8 |
| :------: | :------: |
| ![TREX_V7_fineDeformationGrid](/uploads/5f33324fbd30f5517fa0b3a6d4e1f71d/TREX_V7_fineDeformationGrid.PNG) | ![TREX_V8_fineDeformationGrid](/uploads/8728ef65cddba29356221cf62648a11a/TREX_V8_fineDeformationGrid.PNG) |
<br>
**Warnings encountered when running the SAR V8 chain:**
- otbcli_SARRobustInterferogram:
`WARNING --> Input image has SAR sensor metadata, but OTB was not able to read it: /work/scratch/data/romaint/otb-build-dir/otb-8.1/otb/Modules/Core/Metadata/src/otbSARMetadata.cxx:43: otb::ERROR: Unable to find 'SAR.AzimuthTimeInterval' in the input keywordlist`
- otbcli_SARTopographicPhase:
`WARNING --> Input image has SAR sensor metadata, but OTB was not able to read it: /work/scratch/data/romaint/otb-build-dir/otb-8.1/otb/Modules/Core/Metadata/src/otbSARMetadata.cxx:43: otb::ERROR: Unable to find 'SAR.AzimuthTimeInterval' in the input keywordlist`
- otbcli_SARCompensatedComplex:
`WARNING --> Input image has SAR calibration metadata, but OTB was not able to read it: /work/scratch/data/romaint/otb-build-dir/otb-8.1/otb/Modules/Core/Metadata/src/otbSARMetadata.cxx:43: otb::ERROR: Unable to find 'SARCalib.RadiometricCalibrationIncidenceAngle' in the input keywordlist`
- otbcli_SARAddBandInterferogram:
`WARNING --> Input image has SAR calibration metadata, but OTB was not able to read it: /work/scratch/data/romaint/otb-build-dir/otb-8.1/otb/Modules/Core/Metadata/src/otbSARMetadata.cxx:43: otb::ERROR: Unable to find 'SARCalib.RadiometricCalibrationIncidenceAngle' in the input keywordlist`Alexis SanchezAlexis Sanchezhttps://gitlab.orfeo-toolbox.org/remote_modules/diapotb/-/issues/36Adapt SARMetadataCorrection to OTB v82024-03-01T13:55:00ZValentin GeninAdapt SARMetadataCorrection to OTB v8Given the nature of the application `SARMetadataCoorection`, porting it for OTB v8 requires specific focus and attention.
The application can creates new GCP and/or Orbits data and update the image metadata with the new data.
## get...Given the nature of the application `SARMetadataCoorection`, porting it for OTB v8 requires specific focus and attention.
The application can creates new GCP and/or Orbits data and update the image metadata with the new data.
## getCorners
Get the corners of the image and estimate informations. With OTB v7, it uses the keyword dictionary to access the data. But with OTB v8, we can use the function `GetSARParam` from `ImageMetadata`to get all the corners coordinates. Later on the function, we need the azimuth and range attributes. We can also access these datas with `GetSARParam`.
## getGCP
Get the GCPs and register them for future operations. All the GCPs datas can be access by using `GetGCPParam`.
## createGCPAndUpdateMD
Create new GCPs data and update the metadata. With OTB v7, keywords were used to update the metadata. With OTB v8, we create a GCPParam structure with new data and then update the image metadata with the new GCPParam struct.
## updateGCPAndMD
Update only the height coords of GCPs. We can use `GetGCPParam` to get the current GCPs data, then update the Z coordinate. We then update the image metadata with the updated GCPs.
## selectOrbits
Select fine orbits for an image. We can use `GetSARParam` to get the Orbits data.
## createOrbitsAndUpdateMD
Create new Orbits and update the metadata. Similar to `createGCPAndUpdateMD`, we can create a new Orbits struct and then update the metadata with it.Valentin GeninValentin Geninhttps://gitlab.orfeo-toolbox.org/remote_modules/diapotb/-/issues/35Adapt diapotb.py chain to OTB v82024-03-01T13:53:48ZValentin GeninAdapt diapotb.py chain to OTB v8Adapt all applications used by the diapotb.py chain :
- [x] SARDoppler0
- [x] SARMultiLook
- [x] SARDEMProjection
- [x] SARCartesianMeanEstimation
- [x] SARFineDeformationGrid
- [x] SARCoRegistration
- [x] SARRobustInterferogram
- [x] S...Adapt all applications used by the diapotb.py chain :
- [x] SARDoppler0
- [x] SARMultiLook
- [x] SARDEMProjection
- [x] SARCartesianMeanEstimation
- [x] SARFineDeformationGrid
- [x] SARCoRegistration
- [x] SARRobustInterferogram
- [x] SARTopographicPhase
- [x] SARCompensatedComplex
- [x] SARPhaseFiltering
- [x] SARAddBandInterferogram
- [ ] ~~SAROrthoInterferogram~~Valentin GeninValentin Geninhttps://gitlab.orfeo-toolbox.org/remote_modules/diapotb/-/issues/34Adapt SARDoppler0 to OTB v82024-03-01T13:53:33ZValentin GeninAdapt SARDoppler0 to OTB v8## Sentinel 1
*V7* :
Command : `otbcli_SARDoppler0 -insar s1a-s4-slc-vv-20160818t014650-20160818t014715-012648-013db1-002.tiff -outfile doppler_file_v7.txt`
Results :
```
AZIMUTH DOPPLER NUMBER OF COLUMN : 1
AZIMUTH DOPPLER NUMBER O...## Sentinel 1
*V7* :
Command : `otbcli_SARDoppler0 -insar s1a-s4-slc-vv-20160818t014650-20160818t014715-012648-013db1-002.tiff -outfile doppler_file_v7.txt`
Results :
```
AZIMUTH DOPPLER NUMBER OF COLUMN : 1
AZIMUTH DOPPLER NUMBER OF LINE : 1
AZIMUTH DOPPLER VALUE : 0.046743372345
```
*V8* :
Command : `otbcli_SARDoppler0 -insar s1a-s4-slc-vv-20160818t014650-20160818t014715-012648-013db1-002.tiff -outfile doppler_file_v8.txt`
Results :
```bash
AZIMUTH DOPPLER NUMBER OF COLUMN : 1
AZIMUTH DOPPLER NUMBER OF LINE : 1
AZIMUTH DOPPLER VALUE : 0.046743372345
```
## TSX
*V7* :
Command : `otbcli_SARDoppler0 -insar IMAGE_HH_SRA_strip_013.cos -outfile doppler_file_v7.txt`
Results :
```bash
AZIMUTH DOPPLER NUMBER OF COLUMN : 1
AZIMUTH DOPPLER NUMBER OF LINE : 1
AZIMUTH DOPPLER VALUE : -0.015991515518
```
*V8* :
Command : `otbcli_SARDoppler0 -insar IMAGE_HH_SRA_strip_013.cos -outfile doppler_file_v8.txt`
Results :
```bash
AZIMUTH DOPPLER NUMBER OF COLUMN : 1
AZIMUTH DOPPLER NUMBER OF LINE : 1
AZIMUTH DOPPLER VALUE : -0.015991515518
```
## COSMO
*V7* :
Command : `otbcli_SARDoppler0 -insar HDF5:./CSKS2_SCS_U_S2_24_HH_RA_SF_20181224045655_20181224045703.h5://S01/SBI -outfile testDoppler_v7.txt`
Results :
```bash
AZIMUTH DOPPLER NUMBER OF COLUMN : 1
AZIMUTH DOPPLER NUMBER OF LINE : 1
AZIMUTH DOPPLER VALUE : -0.4081429927
```
*V8* :
Command : `otbcli_SARDoppler0 -insar HDF5:./CSKS2_SCS_U_S2_24_HH_RA_SF_20181224045655_20181224045703.h5://S01/SBI -outfile testDoppler_v8.txt`
Results :
```bash
AZIMUTH DOPPLER NUMBER OF COLUMN : 1
AZIMUTH DOPPLER NUMBER OF LINE : 1
AZIMUTH DOPPLER VALUE : -0.4081429927
```Valentin GeninValentin Geninhttps://gitlab.orfeo-toolbox.org/remote_modules/diapotb/-/issues/33Adapt SARMultiLook to OTB v82024-03-01T13:53:13ZValentin GeninAdapt SARMultiLook to OTB v8## Sentinel 1A
Report : [Sentinel1.txt](/uploads/abd4c9f562c36eb2d5e63fab26f1b98f/Sentinel1.txt)
V7 :
![Sentinel1_MLQLv7](/uploads/a5ed34472d7bb8dc41defbc6d7e124fc/Sentinel1_MLQLv7.PNG)
V8 :
![Sentinel1_MLQLv8](/uploads/7bbfbdb411ca0...## Sentinel 1A
Report : [Sentinel1.txt](/uploads/abd4c9f562c36eb2d5e63fab26f1b98f/Sentinel1.txt)
V7 :
![Sentinel1_MLQLv7](/uploads/a5ed34472d7bb8dc41defbc6d7e124fc/Sentinel1_MLQLv7.PNG)
V8 :
![Sentinel1_MLQLv8](/uploads/7bbfbdb411ca0468d7fc50863b87cab7/Sentinel1_MLQLv8.PNG)
## CSK REUNION
Reprt : [CSK_REUNION.txt](/uploads/270bc964b7facfd4dacd1c2af259c318/CSK_REUNION.txt)
V7 :
![CSK_REUNION_MLQL_v7](/uploads/a86495b835502992c2b18344aa09b43a/CSK_REUNION_MLQL_v7.PNG)
V8 :
![CSK_REUNION_MLQL_v8](/uploads/7bb479938c1295502186316959226978/CSK_REUNION_MLQL_v8.PNG)
Big difference in metadata with gdalinfo, but it is to be expected given gdal is handling the metadata in V8. Otherwise the results in pictures look the same.Valentin GeninValentin Geninhttps://gitlab.orfeo-toolbox.org/remote_modules/diapotb/-/issues/32Split repositories (Application and python chains)2022-08-10T11:56:08ZGaëlle USSEGLIOSplit repositories (Application and python chains)Split diapotb in two repositories :
- diapotb : C++ applications only
- pydiapotb : python chains based on diapotb
Among the steps :
- [x] Move `python_src` to pydiapotb
- [x] Move python documentation (wiki in `doc_cookbook`) in pydiap...Split diapotb in two repositories :
- diapotb : C++ applications only
- pydiapotb : python chains based on diapotb
Among the steps :
- [x] Move `python_src` to pydiapotb
- [x] Move python documentation (wiki in `doc_cookbook`) in pydiapotb
- [x] Clean diapotb repository :
- [x] Remove `python_src`
- [x] Remove python doc
- [x] Update v2.0.0 without `python_src` (fast-forward MR)
- [ ] Merge on master/main branches and regenerate new wikishttps://gitlab.orfeo-toolbox.org/remote_modules/diapotb/-/issues/31Improve logger2022-08-05T15:37:55ZGaëlle USSEGLIOImprove loggerImprove python logger (`info.log`):
- [ ] New format for log file
- [ ] Add input json information into `info.log`Improve python logger (`info.log`):
- [ ] New format for log file
- [ ] Add input json information into `info.log`https://gitlab.orfeo-toolbox.org/remote_modules/diapotb/-/issues/30Remove old APIs for v2.0.02022-08-05T15:38:32ZGaëlle USSEGLIORemove old APIs for v2.0.0Legacy APIs remain in `python_src`. For instance, `Metadata_Correction` chain is not used anymore.
This chain could be removed from json schemas and json examples.Legacy APIs remain in `python_src`. For instance, `Metadata_Correction` chain is not used anymore.
This chain could be removed from json schemas and json examples.https://gitlab.orfeo-toolbox.org/remote_modules/diapotb/-/issues/29Adapt SARDEMProjection to OTB v82022-08-05T15:38:51ZGaëlle USSEGLIOAdapt SARDEMProjection to OTB v8## Updates
- [x] Remove `-infilemetadata` parameters (never used)
- [x] Use only `DEMHandler`
- [x] Update metadata API : https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/-/wikis/Migration-guide-OTBv8#migration-example
- [x] Replace `...## Updates
- [x] Remove `-infilemetadata` parameters (never used)
- [x] Use only `DEMHandler`
- [x] Update metadata API : https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/-/wikis/Migration-guide-OTBv8#migration-example
- [x] Replace `SarSensorModelAdapter` by `SarSensorModel` and `Projection`
Updates in :
* `app/SARDEMProjection.cxx`
* `include/otbSARDEMProjectionImageFilter.h` and `include/otbSARDEMProjectionImageFilter.txx`
* `include/otbSARStreamingDEMInformationFilter.h` and `include/otbSARStreamingDEMInformationFilter.txx`
## Validation
#### S4Reunion
SARDEMProjection runs on S1A_S4_SLC__1SDV_20160818T014650_20160818T014715_012648_013DB1_0969.SAFE/measurement/s1a-s4-slc-vv-20160818t014650-20160818t014715-
012648-013db1-002.tiff with hgt SRTM.
The application `CompareImages` is used to compare each band.
* Channel 1 : Colunm index
```
mse: 1.947610259
mae: 1.039623499
psnr: 88.24280548
count: 25917872
```
* Channel 2 : Row index
```
mse: 0.001763480017
mae: 0.03501946107
psnr: 122.7921371
count: 25917880
```
* Channel 3 : Y
```
mse: 23.06080055
mae: 3.562137604
psnr: 67.44171143
count: 25747802
```
* Channel 4 : Z
```
mse: 0.1460494846
mae: 0.2795257568
psnr: 112.1210709
count: 24516222
```
* Channel 5 : x
```
mse: 6.54592371
mae: 1.893627286
psnr: 94.15983582
count: 24545922
```
* Channel 6 : y
```
mse: 13.90474606
mae: 2.756762266
psnr: 90.45545197
count: 24027916
```
* Channel 7 : z
```
mse: 2.816115141
mae: 1.256804109
psnr: 101.8111038
count: 23902828
```
Cartesian coordinates are quite close. Projection gives similar result on row index and is slightly different on colunm (around 0.5 pixel on ROI).
### IW IRAN
SARDEMProjection runs on S1A_IW_SLC__1SDV_20171107T025348_20171107T025415_019153_02069A_D2C6.SAFE/measurement/s1a-iw3-slc-vv-20171107t025348-20171107t025413-019153-02069a-006.tiff with hgt SRTM (30 m).
The application `CompareImages` is used to compare each band.
**We notice a huge difference on channel 1** :
```
mse: 8.015870874e+15
mae: 89531400
psnr: -62.15629578
count: 77778000
```
Row index seem equivalent:
```
mse: 0.0003446307383
mae: 0.01601495408
psnr: 122.8530045
count: 77065848
```
Even the `gain` is different => probably caused by sarSensorModel function : `WorldToLineSampleYZ and `WorldToSatPositionAndVelocity`
## Performance
#### S4Reunion
On a whole HAL compute node (g2019).
* ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS = 80
* In v7.4 :
```
real 0m21.409s
user 1m38.930s
sys 0m1.182s
```
* In v8 :
```
real 0m22.000s
user 0m59.138s
sys 0m1.176s
```
* ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS = 8
* In v7.4 :
```
real 0m32.615s
user 1m48.372s
sys 0m1.066s
```
* In v8 :
```
real 0m24.870s
user 0m58.507s
sys 0m0.985s
```
#### IW_IRAN
On a whole HAL compute node (g2019).
* ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS = 8
* In v7.4 :
```
real 1m59.197s
user 5m30.751s
sys 0m5.130s
```
* In v8 :
```
real 1m34.613s
user 3m6.947s
sys 0m4.791s
```Gaëlle USSEGLIOGaëlle USSEGLIOhttps://gitlab.orfeo-toolbox.org/remote_modules/diapotb/-/issues/28Adapt SARAltAmbig to OTB v82022-02-14T13:17:31ZGaëlle USSEGLIOAdapt SARAltAmbig to OTB v8## Validation
### S4Reunion
In v7.4 :
```
Latitude of the target = -21.23
Longitude of the target = 55.7
Altitude of the target = 2200
GROUND COORDINATES = 3352947.394358 4915237.207691 -2295947.108267
IMAGE ...## Validation
### S4Reunion
In v7.4 :
```
Latitude of the target = -21.23
Longitude of the target = 55.7
Altitude of the target = 2200
GROUND COORDINATES = 3352947.394358 4915237.207691 -2295947.108267
IMAGE ORBIT
s1b-s4-slc-vv-20160929t014610-20160929t014634-002277-003d71-002 2277
s1a-s4-slc-vv-20160818t014650-20160818t014715-012648-013db1-002 12648
MASTER ORBIT SLAVE ORBIT Incidence ALT AMBIG Radial Lateral
12648 2277 37.177622 1928.600 -30.900 -7.460
Ground target --> Satellite Vectors :
Image Orbit North Projection East Projection Vertical Projection
2277 -0.143829 0.586481 0.797091
12648 -0.143821 0.586476 0.797096
```
In v8 :
```
Latitude of the target = -21.23
Longitude of the target = 55.7
Altitude of the target = 2200
GROUND COORDINATES = 3352947.394354 4915237.207686 -2295947.108297
IMAGE ORBIT
s1b-s4-slc-vv-20160929t014610-20160929t014634-002277-003d71-002 2277
s1a-s4-slc-vv-20160818t014650-20160818t014715-012648-013db1-002 12648
MASTER ORBIT SLAVE ORBIT Incidence ALT AMBIG Radial Lateral
12648 2277 37.177622 1928.573 -30.901 -7.460
Ground target --> Satellite Vectors :
Image Orbit North Projection East Projection Vertical Projection
2277 -0.143829 0.586481 0.797091
12648 -0.143821 0.586476 0.797096
```
Diapason results : [ref_diapason.txt](/uploads/c49c6b774bbf6cb7b33e96fe6352e3a0/ref_diapason.txt)
### PAZReunion
In v7.4 :
```
Latitude of the target = -21.23
Longitude of the target = 55.7
Altitude of the target = 2200
GROUND COORDINATES = 3352947.394358 4915237.207691 -2295947.108267
IMAGE ORBIT
IMAGE_VV_SRA_spot_044 14369
IMAGE_VV_SRA_spot_044 14703
MASTER ORBIT SLAVE ORBIT Incidence ALT AMBIG Radial Lateral
14369 14703 37.125468 35.269 116.650 -168.166
Ground target --> Satellite Vectors :
Image Orbit North Projection East Projection Vertical Projection
14369 -0.129980 0.588891 0.797692
14703 -0.130021 0.589099 0.797531
```
In v8 :
```
Latitude of the target = -21.23
Longitude of the target = 55.7
Altitude of the target = 2200
GROUND COORDINATES = 3352947.394354 4915237.207686 -2295947.108297
IMAGE ORBIT
IMAGE_VV_SRA_spot_044 14369
IMAGE_VV_SRA_spot_044 14703
MASTER ORBIT SLAVE ORBIT Incidence ALT AMBIG Radial Lateral
14369 14703 37.125468 35.269 116.650 -168.165
Ground target --> Satellite Vectors :
Image Orbit North Projection East Projection Vertical Projection
14369 -0.129980 0.588891 0.797692
14703 -0.130022 0.589099 0.797531
```
### CSKReunion
In v7.4 :
```
Latitude of the target = -21.23
Longitude of the target = 55.7
Altitude of the target = 2200
GROUND COORDINATES = 3352947.394358 4915237.207691 -2295947.108267
IMAGE ORBIT
CSKS2_SCS_B_HI_15_VV_RA_SF_20170223023902_20170223023910 49829
CSKS1_SCS_B_HI_15_VV_RA_SF_20170522023843_20170522023850 53858
MASTER ORBIT SLAVE ORBIT Incidence ALT AMBIG Radial Lateral
53858 49829 48.794461 -238.793 75.715 44.531
Ground target --> Satellite Vectors :
Image Orbit North Projection East Projection Vertical Projection
49829 -0.182413 -0.729512 0.659195
53858 -0.182459 -0.729534 0.659158
```
In v8 :
```
Latitude of the target = -21.23
Longitude of the target = 55.7
Altitude of the target = 2200
GROUND COORDINATES = 3352947.394354 4915237.207686 -2295947.108297
IMAGE ORBIT
CSKS2_SCS_B_HI_15_VV_RA_SF_20170223023902_20170223023910 49829
CSKS1_SCS_B_HI_15_VV_RA_SF_20170522023843_20170522023850 53858
MASTER ORBIT SLAVE ORBIT Incidence ALT AMBIG Radial Lateral
53858 49829 48.794461 -238.788 75.716 44.531
Ground target --> Satellite Vectors :
Image Orbit North Projection East Projection Vertical Projection
49829 -0.182414 -0.729512 0.659195
53858 -0.182459 -0.729534 0.659158
```
## Conclusions
For the same point : (55.7, -21.23, 2200), ground coordinates seems to be equivalent.
At the end, we retrieve for the three sensors close values for `Incidence`, `ALT AMBIG`, `Radial` and `Lateral`.
Thanks to these results, projection functions used by `SARAltAmbig` can be considered as checked. FYI, `SARAltAmbig` uses :
* `WorldToEcef` from `Projection`
* `WorldToSatPositionAndVelocity` from `SarSensorModel`https://gitlab.orfeo-toolbox.org/remote_modules/diapotb/-/issues/27Adapt SAR applications to OTB 8.02023-06-16T12:51:15ZGaëlle USSEGLIOAdapt SAR applications to OTB 8.0Adapt all SAR applications to OTB 8.0 (branch [diapotb-2.0](https://gitlab.orfeo-toolbox.org/remote_modules/diapotb/-/tree/diapotb-2.0))
See https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/-/wikis/Migration-guide-OTBv8
- [x] SARAltAm...Adapt all SAR applications to OTB 8.0 (branch [diapotb-2.0](https://gitlab.orfeo-toolbox.org/remote_modules/diapotb/-/tree/diapotb-2.0))
See https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/-/wikis/Migration-guide-OTBv8
- [x] SARAltAmbig (#28)
- [ ] SARDEMProjection (#29)
- [ ] SARMultiLook
- [ ] SARESD
- [ ] SARCartesianMeanEstimation
- [ ] SARAmplitudeEstimation
- [ ] SARDEMToAmplitude
- [ ] SARDeramp
- [ ] SARCompensatedComplex
- [ ] SARTopographicPhase
- [ ] SARInterferogram
- [ ] SARRobustInterferogram
- [ ] SARCoRegistration
- [ ] SARDEMGrid
- [ ] SARCorrectionGrid
- [ ] SARCorrelationGrid
- [ ] SARCorrelationRough
- [ ] SARFineDeformationGrid
- [ ] SARDoppler0
- [ ] SARGridOffset
- [ ] SARGridStatistics
- [ ] SARMetadataCorrection
- [ ] SARPhaseFiltering
- [ ] SARAddBandInterferogramValentin GeninValentin Geninhttps://gitlab.orfeo-toolbox.org/remote_modules/diapotb/-/issues/26Adapt python scripts2022-01-14T09:52:22ZGaëlle USSEGLIOAdapt python scripts[generateConfigFile](https://gitlab.orfeo-toolbox.org/remote_modules/diapotb/-/blob/python_TSX/python_src/utils/generateConfigFile.py) needs to be adapted to the new python APIs.
`func_utils` import is not correct anymore and the new `...[generateConfigFile](https://gitlab.orfeo-toolbox.org/remote_modules/diapotb/-/blob/python_TSX/python_src/utils/generateConfigFile.py) needs to be adapted to the new python APIs.
`func_utils` import is not correct anymore and the new `ConfigFile` has to be used instead.https://gitlab.orfeo-toolbox.org/remote_modules/diapotb/-/issues/25Add and improve tests2022-08-05T15:39:21ZGaëlle USSEGLIOAdd and improve testsSome unit tests are already present :
* For C++ applications based on `ctest` : 51 tests with test/ directory and tests on applications.
* For python_src based on `pytest` (in python_TSX branch, for now) : with complete runs of two use...Some unit tests are already present :
* For C++ applications based on `ctest` : 51 tests with test/ directory and tests on applications.
* For python_src based on `pytest` (in python_TSX branch, for now) : with complete runs of two use cases and test on subchain (with mocks)
In order to improve coverage, several tests must be added :
* For C++ applications :
- [ ] Add tests for TSX products : SARDeramp
- [ ] Use git-lfs to avoid test dependancies (see #15)
* For python_src:
- [x] Tests on TSX processing
- [x] from internal_processings package
- [x] resamping
- [ ] filtering
- [x] for each subchain by mocking internal processing)
- [x] Tests for PostProcessing chain
- [x] Tests on ConfigFile classhttps://gitlab.orfeo-toolbox.org/remote_modules/diapotb/-/issues/24Warning print in SARDEMProjection2022-08-05T15:40:10ZGaëlle USSEGLIOWarning print in SARDEMProjectionA warning is printed at each execution of `SARDEMProjection`:
```
Warning 1: demProj_IMAGE_VV_SRA_spot_036_14483.tif, band 5: Setting nodata to 2.32743193498402141e-310 on band 5, but band 1 has nodata at -32768. The TIFFTAG_GDAL_NODATA...A warning is printed at each execution of `SARDEMProjection`:
```
Warning 1: demProj_IMAGE_VV_SRA_spot_036_14483.tif, band 5: Setting nodata to 2.32743193498402141e-310 on band 5, but band 1 has nodata at -32768. The TIFFTAG_GDAL_NODATA only support one value per dataset. This value of 2.32743193498402141e-310 will be used for all bands on re-opening
```
This warning is from gdal. In `SARDEMProjection`. nodata is set to -32768 for the first bands that represents Line/colunms of SAR image in DEM geometry to match with DEM no_data. The next bands represent cartesian coordinates and do not need a particular walue for no_data.https://gitlab.orfeo-toolbox.org/remote_modules/diapotb/-/issues/23ERROR print during execution : Not a TIFF or MDI file, bad magic number2022-08-05T15:40:27ZGaëlle USSEGLIOERROR print during execution : Not a TIFF or MDI file, bad magic numberIn a few executions an error is printed when the DEM is used:
```
ERROR 1: <dem_path>.hgt:Not a TIFF or MDI file, bad magic number 22076 (0x563c)
```
This error does not seem to be critical. Execution keeps going and results are provid...In a few executions an error is printed when the DEM is used:
```
ERROR 1: <dem_path>.hgt:Not a TIFF or MDI file, bad magic number 22076 (0x563c)
```
This error does not seem to be critical. Execution keeps going and results are provided.
A rebuild of hgt does not fix this error.
Similar problems were found here : https://forum.esa-sen2agri.org/t/l2a-processing-error-not-a-tiff-file-bad-magic-number-0-0x0/507https://gitlab.orfeo-toolbox.org/remote_modules/diapotb/-/issues/22Conflicts between OrthoRectification and SARCartesianMeanEstimation2022-01-10T08:06:23ZGaëlle USSEGLIOConflicts between OrthoRectification and SARCartesianMeanEstimationThe application `SARCartesianMeanEstimation` can send a seg fault or freeze if `OrthoRectification` is called before inside the same process.
A fix was to call in SARDEMProjection filter `DEMHandler->ClearDEMs()` to clear DEMs in the si...The application `SARCartesianMeanEstimation` can send a seg fault or freeze if `OrthoRectification` is called before inside the same process.
A fix was to call in SARDEMProjection filter `DEMHandler->ClearDEMs()` to clear DEMs in the singleton.https://gitlab.orfeo-toolbox.org/remote_modules/diapotb/-/issues/21ossimGeoidEgm96 in SARDEMProjection2022-08-05T15:41:00ZGaëlle USSEGLIOossimGeoidEgm96 in SARDEMProjectionA ossimGeoidEgm96 is used instead of DEMHandler in SARDEMProjection.
This purpose was to improve performance, only. When a emg96 is provided, results between ossimGeoidEgm96 and DEMHandler are equal (cf : otbSARGeoidProjectionTest)
On ...A ossimGeoidEgm96 is used instead of DEMHandler in SARDEMProjection.
This purpose was to improve performance, only. When a emg96 is provided, results between ossimGeoidEgm96 and DEMHandler are equal (cf : otbSARGeoidProjectionTest)
On HAL (a whole g2019 node), we have :
* S4Reunion (diapOTB.py) : 15min for ossimGeoidEgm96 vs 16min30s for DEMHandler
* IW_IRAN (burst 3-4 with SARMultiSlc_S1IW.py) : 9min30s for ossimGeoidEgm96 vs 16m51.229s
S1IW calls SARDEMProjection for each burst => a higher impact on performance.
Results are equivalent.https://gitlab.orfeo-toolbox.org/remote_modules/diapotb/-/issues/20Improve SARMultiLook application2022-08-05T15:41:15ZGaëlle USSEGLIOImprove SARMultiLook applicationSARMultiLook applies an quadractic average on two dimensions (range and azimut).
A gain filter comes at the end. This [filter](https://gitlab.orfeo-toolbox.org/remote_modules/diapotb/-/blob/master/app/otbSARMultiLook.cxx#L159) converts...SARMultiLook applies an quadractic average on two dimensions (range and azimut).
A gain filter comes at the end. This [filter](https://gitlab.orfeo-toolbox.org/remote_modules/diapotb/-/blob/master/app/otbSARMultiLook.cxx#L159) converts each pixel into `unsigned char` dynamic (between 0 to 255). This legacy behaviour can be changed to spread the [dynamic](https://gitlab.orfeo-toolbox.org/remote_modules/diapotb/-/blob/master/include/otbSARGainImageFilter.h#L48).https://gitlab.orfeo-toolbox.org/remote_modules/diapotb/-/issues/19metadata model in OTB v82022-08-05T15:41:28ZGaëlle USSEGLIOmetadata model in OTB v8OTB v8 has a new metadata management which will lead to significant changes in diapotb.
A metadata model based on GDAL and not on OSSIM/OssimPlugins anymore, will be available in OTB v8.
Several impacts can be quoted :
* Ossim dependan...OTB v8 has a new metadata management which will lead to significant changes in diapotb.
A metadata model based on GDAL and not on OSSIM/OssimPlugins anymore, will be available in OTB v8.
Several impacts can be quoted :
* Ossim dependancy is removed, see : #7
* New management based on GDAL :
* New keywords and APIs
* Metadata included in tiff image (or with .aux.xml) instead of geom file
See : https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/-/wikis/Migration-guide-OTBv8
## Impact on applications
Several applications used metadata to get or set information.
The main refactoring for metadata inside DiapOTB will be to get/set keys with right names and by using `Set/GetImageMetadata` instead of `Set/GetImageKeywordlist`.
Some examples available in https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/-/wikis/Migration-guide-OTBv8#migration-example
In OTB v8, keys are several kinds :
* `MDNum` for numeric keys (`double`)
* `MDStr` for string keys
* `MDTimes` for dates, the Time struct is defined [here](https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/-/blob/develop/Modules/Core/Metadata/include/otbMetaDataKey.h#L233)
* `MDGeom` for models (RPC model, Sar model, GCPs ...)
* `MDL1D` et `MDL2D` for LUTS, the LUT struct is defined
Quote all key names used in DiapOTB (from legacy imagekeywordlist):
* azimuthFmRate.*:
* in *SARParam.azimuthFmRates*
* dopplerCentroid.* :
* in *SARParam.dopplerCentroids*
* support_data.azimuth_steering_rate :
* in *SARParam.azimuthSteeringRate*
* support_data.line_time_interval :
* not always 1/PRF (ie : TSX) => perhaps keep both line_time_interval and PRF in *SarParams.azimuthTimeInterval*
* support_data.radar_frequency :
* in v8 *RadarFrequency*
* support_data.geom.bursts.* :
* *SARParam.burstRecords*
* support_data.range_sampling_rate :
* *SARParam.rangeSamplingRate*
* support_data.slant_range_to_first_pixel:
* *SARParam.nearRangeTime*
* support_data.first_line_time :
* in v8 *AcquisitionStartTime*
* support_data.last_line_time:
* in v8 *AcquisitionStopTime*
* support_data.abs_orbit :
* in v8 *OrbitNumber*
* support_data.range_spacing :
* in v8 *PixelSpacing*
* sensor:
* in v8 *Mission*
* manifest_data.instrument:
* in v8 *Instrument*
* support_data.orbit_pass:
* in v8 *OrbitDirection*
* support_data.acquisition_mode:
* in v8 *Mode*
* support_data.invalid_pixels (from SARBurstExtraction)
* in v8 [invalid_pixels](https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/-/blob/release-8.0/Modules/Radiometry/SARCalibration/include/otbSarBurstExtractionImageFilter.hxx#L129)
* support_data.number_samples:
* in v8 *NumberOfColumns*
* number_lines :
* in v8 *NumberOfLines*
* number_samples :
* in v8 *NumberOfColumns*
* ul_lon/lat, ur_lon/lat ...:
* *SARParam.ulSceneCoord* (or ur/lr/ll)
* support_data.azimuth_bandwidth:
* *SARParam.azimuthBandwidth*
Tips: an easy way to match every metadata is to look at `ParseGeom` function in each *MetadataInterface. For instance : for [Sentinel1](https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/-/blob/release-8.0/Modules/Core/Metadata/src/otbSentinel1ImageMetadataInterface.cxx#L813)
## Impact on python_src
Python chains used some of metadata to check sensor, to apply some processing or update some metadata.
In v7, Several ways are used to retrieve/use metadata :
* Retrieve metadata as a dict from `ReadImageInfo` application with keywordlist = True
* Update metdata though a new geom file thanks to `SARMetadataCorrection`. A extended filename is used to take the new geom into account
* Read/Write geom file to get all metadata with expected time struct with python functions : [read/write](https://gitlab.orfeo-toolbox.org/remote_modules/diapotb/-/blob/python_TSX/python_src/diapotb/lib/internal_processing/core/utils.py#L112)