Commit 15e44c25 authored by Gaëlle USSEGLIO's avatar Gaëlle USSEGLIO
Browse files

Merge branch 'user_improvements' into 'master'

User improvements

See merge request remote_modules/diapotb!39
parents e0ab86e0 607c3e00
......@@ -2,58 +2,140 @@
This is a module for the Diapason processing with OTB
The module must be used with OTB Orfeo Toolbox (https://www.orfeo-toolbox.org/).
It is designed to work with OTB v6.2 (or higher).
It is designed to work with OTB v7.0 (or higher).
This module can be built as a remote module or as a standalone module
# Getting Started
DiapOTB is an OTB's official remote module. Its applications and processing chains are directly included inside OTB's package.
Thus, two main ways can be used to install DiapOTB :
* From OTB standalone package (the easy way)
* From scratch (source code)
## Installation
1. Clone the repository
### Installation from OTB standalone package
This installation provides standalone binaries for several OS. You can choose the wanted binaries at https://www.orfeo-toolbox.org/download/
On all platforms, the OTB standalone package contains everything: applications for command line and graphical user interface, python bindings, Monteverdi and also official remote modules (with **DiapOTB**). This installation is extermely simplify by following given instructions : https://www.orfeo-toolbox.org/CookBook/Installation.html
### Installation from scratch
To install DiapOTB from scratch (from source code), binaries and libraries have to be overrided inside the existing installation of OTB. This override involves installing a “personal” OTB.
Therefore, two main steps are required for a complete installation of DiapOTB form scratch :
**1. OTB installation**
Find further information at https://www.orfeo-toolbox.org/CookBook/CompilingOTBFromSource.html
`
NB: A Superbuild is available for OTB installation to handle dependencies. With this build, dependencies are directly downloading inside a given repository (-DDOWNLOAD_LOCATION) before being installed.
`
* Clone the repository and choose a branch (usually develop by default)
```
git clone https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb.git
git checkout <develop>
```
* Create a build directory (choose a place)
```
% mkdir build
% cd build
```
* Setup environment for all dependencies and cmake
* Configure for a normal build
Cmake command makes configuration with an example given below (<install_OTB_directory> represents the selected repository for the OTB installation and <root_OTB> the root for the source code):
```
% CC=$GCCHOME/bin/gcc CXX=$GCCHOME/bin/g++ cmake <root_OTB> -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER:FILEPATH=$GCCHOME/bin/g++ -DCMAKE_C_COMPILER:FILEPATH=$GCCHOME/bin/gcc -DCMAKE_CXX_FLAGS="-std=c++14" -DCMAK
E_INSTALL_PREFIX=<install_directory> -DOTB_USE_QWT=ON -DOTB_USE_OPENGL=ON -DOTB_USE_GLEW=ON -DOTB_USE_GLUT=ON -DOTB_USE_QT=ON -DOTB_USE_MUPARSER=ON -DOTB_USE_MUPAR
SERX=ON -DOTB_WRAP_PYTHON=ON -DOTB_USE_LIBSVM=ON -DBUILD_TESTING=OFF -DOTB_I18N_MERGE_TS=OFF -DOTB_USE_CURL=OFF -DOTB_USE_GLFW=OFF -DOTB_USE_GSL=OFF -DOTB_USE_LIBKML=OFF -DOTB_USE_OPENCV=OFF -DOTB_USE_SHARK=OFF
-DOTB_USE_SPTW=OFF
```
`
NB: Configuration is sligthly different with superbuild. Please, find futher information at https://www.orfeo-toolbox.org/CookBook/CompilingOTBFromSource.html?highlight=superbuild
`
* Compile and install
```
% make
% make install
```
**2. DiapOTB installation**
* Clone the repository
```
%git clone
% git clone
For OTB Gitlab : git clone https://gitlab.orfeo-toolbox.org/remote_modules/diapotb.git
```
2. Go to source directory
* Go to source directory
```
%cd DiapOTBModule
% cd DiapOTB
```
3. Create build directory
* Create build directory
```
% mkdir build
% cd build
```
4. Setup OTB environment
* Setup environment for all dependencies and cmake
* Setup OTB environment by setting the following variables (with x.x = OTB version)
```
% export OTB_DIR=<install_OTB_directory>/lib/cmake/OTB-x.x
% export LD_LIBRARY_PATH=<install_OTB_directory>/lib:$ LD_LIBRARY_PATH
```
5. Configure, compile and install
* Configure, compile and install (<install_DiapOTB_directory> represents the selected repository for the OTB installation)
```
% CC=${GCCHOME}/bin/gcc CXX=${GCCHOME}/bin/g++ cmake -DOTB_BUILD_MODULE_AS_STANDALONE=ON -DCMAKE_INSTALL_PREFIX=<install_directory> -DCMAKE_BUILD_TYPE=<Release or Debug> ..
% CC=${GCCHOME}/bin/gcc CXX=${GCCHOME}/bin/g++ cmake -DOTB_BUILD_MODULE_AS_STANDALONE=ON -DCMAKE_INSTALL_PREFIX=<install_DiapOTB_directory> -DCMAKE_BUILD_TYPE=<Release or Debug> ..
% make
% make install
```
6. Configure with tests, compile and run tests
* Prepare execution by setting:
```
% CC=${GCCHOME}/bin/gcc CXX=${GCCHOME}/bin/g++ cmake -DBUILD_TESTING=ON -DOTB_BUILD_MODULE_AS_STANDALONE=ON -DCMAKE_INSTALL_PREFIX=<install_directory> -DCMAKE_BUILD_TYPE=<Release or Debug> ..
% make
% ctest
% export OTB_APPLICATION_PATH=<install_OTB_directory>/lib/otb/applications:<install_DiapOTB_directory>/lib
% export LD_LIBRARY_PATH=<install_OTB_directory>/lib/:<install_DiapOTB_directory>/lib/:$LD_LIBRARY_PATH
% export PYTHONPATH=<install_OTB_directory>/lib:<install_OTB_directory>/lib/otb/python:$PATH
% export PATH=<install_OTB_directory>/bin:$PATH
```
Other environment variables can be setted such as OTB_GEOID_FILE or ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS.
## Usage to launch one application (ex : SARMultiLook)
### C++ application
1. Load environment
1. Load environment with
* otbenv for the first kind of installation (standalone package)
* by setting the following variable for the installation from scratch
```
export OTB_APPLICATION_PATH=<install_directory>/lib:$OTB_APPLICATION_PATH
export LD_LIBRARY_PATH=<install_directory>/lib/:$LD_LIBRARY_PATH
% export OTB_APPLICATION_PATH=<install_OTB_directory>/lib/otb/applications:<install_DiapOTB_directory>/lib
% export LD_LIBRARY_PATH=<install_OTB_directory>/lib/:<install_DiapOTB_directory>/lib/:$LD_LIBRARY_PATH
% export PYTHONPATH=<install_OTB_directory>/lib:<install_OTB_directory>/lib/otb/python:$PATH
% export PATH=<install_OTB_directory>/bin:$PATH
```
A file (diapOTBEnv.sh) was creating into install_directory during the installation.
This file can be used to load the environment. Other environment variables can be
setted such as OTB_GEOID_FILE or ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS.
Other environment variables can be setted such as OTB_GEOID_FILE or ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS.
2. Get help
```
......@@ -62,26 +144,30 @@ otbApplicationLauncherCommandLine SARMultiLook
3. Execute
```
otbApplicationLauncherCommandLine SARMultiLookApp -in ./Data_In/sar/Reunion/S1A_S4_SLC__without_calibration.SAFE/measurement/s1a-s4-slc-vv-20160818t014650-20160818t014715-012648-013db1-002.tiff -out ./Data_Out/out_SAR_Diap/s1a-s4-ml-vv.tif -mlran 3 -mlazi 3 -mlgain 0.1
otbApplicationLauncherCommandLine SARMultiLookApp -incomplex ./Data_In/sar/Reunion/S1A_S4_SLC__without_calibration.SAFE/measurement/s1a-s4-slc-vv-20160818t014650-20160818t014715-012648-013db1-002.tiff -out ./Data_Out/out_SAR_Diap/s1a-s4-ml-vv.tif -mlran 3 -mlazi 3 -mlgain 0.1
```
### Python
1. Load environment
1. Load environment
* otbenv for the first kind of installation (standalone package)
* by setting the following variable for the installation from scratch
```
export OTB_APPLICATION_PATH=<install_directory>/lib:$OTB_APPLICATION_PATH
export LD_LIBRARY_PATH=<install_directory>/lib/:$LD_LIBRARY_PATH
% export OTB_APPLICATION_PATH=<install_OTB_directory>/lib/otb/applications:<install_DiapOTB_directory>/lib
% export LD_LIBRARY_PATH=<install_OTB_directory>/lib/:<install_DiapOTB_directory>/lib/:$LD_LIBRARY_PATH
% export PYTHONPATH=<install_OTB_directory>/lib:<install_OTB_directory>/lib/otb/python:$PATH
% export PATH=<install_OTB_directory>/bin:$PATH
```
A file (diapOTBEnv.sh) was creating into install_directory during the installation.
This file can be used to load the environment. Other environment variables can be
setted such as OTB_GEOID_FILE or ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS.
Other environment variables can be setted such as OTB_GEOID_FILE or ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS.
2. Write a Python file
```
import otbApplication as otb
app = otb.Registry.CreateApplication("SARMultiLook")
app.SetParameterString("in", "s1a-s4-slc-vv-20160818t014650-20160818t014715-012648-013db1-002.tiff")
app.SetParameterString("incomplex", "s1a-s4-slc-vv-20160818t014650-20160818t014715-012648-013db1-002.tiff")
app.SetParameterString("out", "output.tif")
app.SetParameterInt("mlran",3)
app.SetParameterInt("mlazi",3)
......@@ -96,19 +182,33 @@ python <script_python.py>
## Usage to launch DiapOTB processing
1. Load environment
1. Configure Python (if needed)
Some packages are required to run DiapOTB's processing chains with :
* GDAL
* h5py
* jsonschema
* numpy
2. Load environment
* otbenv for the first kind of installation (standalone package)
* by setting the following variable for the installation from scratch
```
source <install_directory>/diapOTBEnv.sh
% export OTB_APPLICATION_PATH=<install_OTB_directory>/lib/otb/applications:<install_DiapOTB_directory>/lib
% export LD_LIBRARY_PATH=<install_OTB_directory>/lib/:<install_DiapOTB_directory>/lib/:$LD_LIBRARY_PATH
% export PYTHONPATH=<install_OTB_directory>/lib:<install_OTB_directory>/lib/otb/python:$PATH
% export PATH=<install_OTB_directory>/bin:$PATH
```
Other environment variables can be setted such as OTB_GEOID_FILE or
ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS.
2. Configure your processing with a configuration file
Other environment variables can be setted such as OTB_GEOID_FILE or ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS.
3. Configure your processing with a configuration file
```
Example into <install_directory>/python_src/ex_config.ini
Example into <install_directory>/python_src/ex_config repository
or
Launch python <install_directory>/python_src/utils/generateConfigFile.py that corresponds to a user's Q&A.
```
3. Launch the processing
4. Launch the processing with for example
```
python $DIAPOTB_INSTALL/python_src/diapOTB.py <configuration_file>
python <install_directory>/python_src/diapOTB.py <configuration_file>
```
......@@ -24,6 +24,8 @@
#include "itkMacro.h"
#include "itkFFTNormalizedCorrelationImageFilter.h"
#include "otbMultiToMonoChannelExtractROI.h"
#include "otbSARStreamingMaximumMinimumImageFilter.h"
#include "otbSARTemporalCorrelationGridImageFilter.h"
......@@ -49,7 +51,8 @@ public:
typedef itk::FFTNormalizedCorrelationImageFilter<FloatImageType, FloatImageType> CorFilterType;
typedef otb::SARStreamingMaximumMinimumImageFilter< FloatImageType> MinMaxFilterType;
typedef otb::SARTemporalCorrelationGridImageFilter<FloatImageType, FloatVectorImageType> CorGridFilterType;
typedef otb::MultiToMonoChannelExtractROI<FloatVectorImageType::InternalPixelType,
FloatImageType::InternalPixelType> ExtractROIFilterType;
private:
void DoInit() override
......@@ -137,40 +140,67 @@ void DoExecute() override
otbAppLogINFO(<<"Grid Step for azimut : "<<grid_step_azi);
// Get master and slave image
FloatImageType::Pointer MasterPtr = GetParameterFloatImage("inmaster");
FloatImageType::Pointer SlavePtr = GetParameterFloatImage("inslave");
FloatVectorImageType::Pointer MasterPtr = GetParameterFloatVectorImage("inmaster");
FloatVectorImageType::Pointer SlavePtr = GetParameterFloatVectorImage("inslave");
// Check input size (Master size) to protect memory.
// If size > 15000 raise an exception and indicate more appropriate ml factors
if (MasterPtr->GetLargestPossibleRegion().GetSize()[0] > 15000 ||
MasterPtr->GetLargestPossibleRegion().GetSize()[1] > 15000)
{
// integer divisions
int intermediate_mlran = MasterPtr->GetLargestPossibleRegion().GetSize()[0]/15000 + 1;
int intermediate_mlazi = MasterPtr->GetLargestPossibleRegion().GetSize()[1]/15000 + 1;
// Initialize values
float shiftML_range = 0;
float shiftML_azimut = 0;
int startx = 0;
int starty = 0;
int sizex = std::min(MasterPtr->GetLargestPossibleRegion().GetSize()[0],
SlavePtr->GetLargestPossibleRegion().GetSize()[0]);
int sizey = std::min(MasterPtr->GetLargestPossibleRegion().GetSize()[1],
SlavePtr->GetLargestPossibleRegion().GetSize()[1]);
otbAppLogCRITICAL(<<"ML Factors are not appropriate for these estimations. Please use other factors such as : "<< intermediate_mlran << " x " << intermediate_mlazi );
// Extract ROI from Master and Slave Image to estimate global shifts without a too large amount
// of RAM => size = 3000*3000 at the center
if (sizex > 3000 &&
sizey > 3000)
{
startx = MasterPtr->GetLargestPossibleRegion().GetSize()[0]/2 - 1500;
starty = MasterPtr->GetLargestPossibleRegion().GetSize()[1]/2 - 1500;
itkExceptionMacro(<<"ML Factors are not appropriate for these estimations");
sizex = 3000;
sizey = 3000;
}
ExtractROIFilterType::Pointer extractROIFilter_master = ExtractROIFilterType::New();
m_Ref.push_back(extractROIFilter_master.GetPointer());
extractROIFilter_master->SetInput(MasterPtr);
extractROIFilter_master->SetChannel(1);
extractROIFilter_master->SetStartX(startx);
extractROIFilter_master->SetStartY(starty);
extractROIFilter_master->SetSizeX(sizex);
extractROIFilter_master->SetSizeY(sizey);
ExtractROIFilterType::Pointer extractROIFilter_slave = ExtractROIFilterType::New();
m_Ref.push_back(extractROIFilter_slave.GetPointer());
extractROIFilter_slave->SetInput(SlavePtr);
extractROIFilter_slave->SetChannel(1);
extractROIFilter_slave->SetStartX(startx);
extractROIFilter_slave->SetStartY(starty);
extractROIFilter_slave->SetSizeX(sizex);
extractROIFilter_slave->SetSizeY(sizey);
// Correlation Filter
CorFilterType::Pointer correlationFilter = CorFilterType::New();
m_Ref.push_back(correlationFilter.GetPointer());
correlationFilter->SetFixedImage(MasterPtr);
correlationFilter->SetMovingImage(SlavePtr);
correlationFilter->SetFixedImage(extractROIFilter_master->GetOutput());
correlationFilter->SetMovingImage(extractROIFilter_slave->GetOutput());
MinMaxFilterType::Pointer minMaxFilter = MinMaxFilterType::New();
minMaxFilter->SetInput(correlationFilter->GetOutput());
// Adapt streaming with ram parameter (default 256 MB)
minMaxFilter->GetStreamer()->SetAutomaticStrippedStreaming(GetParameterInt("ram"));
minMaxFilter->Update();
float shiftML_range = ((correlationFilter->GetOutput()->GetLargestPossibleRegion().GetSize()[0]/2.)-
minMaxFilter->GetIndexOfMax()[0]);
float shiftML_azimut = ((correlationFilter->GetOutput()->GetLargestPossibleRegion().GetSize()[1]/2.)
-minMaxFilter->GetIndexOfMax()[1]);
shiftML_range = ((correlationFilter->GetOutput()->GetLargestPossibleRegion().GetSize()[0]/2.)-
minMaxFilter->GetIndexOfMax()[0]);
shiftML_azimut = ((correlationFilter->GetOutput()->GetLargestPossibleRegion().GetSize()[1]/2.)
-minMaxFilter->GetIndexOfMax()[1]);
// Correlation Grid Filter
CorGridFilterType::Pointer filterCorrelationGrid = CorGridFilterType::New();
m_Ref.push_back(filterCorrelationGrid.GetPointer());
......@@ -188,8 +218,18 @@ void DoExecute() override
// Define the main pipeline
filterCorrelationGrid->SetMasterInput(MasterPtr);
filterCorrelationGrid->SetSlaveInput(SlavePtr);
ExtractROIFilterType::Pointer extractROIFilter_masterfull = ExtractROIFilterType::New();
m_Ref.push_back(extractROIFilter_masterfull.GetPointer());
extractROIFilter_masterfull->SetInput(MasterPtr);
extractROIFilter_masterfull->SetChannel(1);
ExtractROIFilterType::Pointer extractROIFilter_slavefull = ExtractROIFilterType::New();
m_Ref.push_back(extractROIFilter_slavefull.GetPointer());
extractROIFilter_slavefull->SetInput(SlavePtr);
extractROIFilter_slavefull->SetChannel(1);
filterCorrelationGrid->SetMasterInput(extractROIFilter_masterfull->GetOutput());
filterCorrelationGrid->SetSlaveInput(extractROIFilter_slavefull->GetOutput());
SetParameterOutputImage("out", filterCorrelationGrid->GetOutput());
}
// Vector for filters
......
......@@ -24,6 +24,8 @@
#include "itkMacro.h"
#include "itkFFTNormalizedCorrelationImageFilter.h"
#include "otbMultiToMonoChannelExtractROI.h"
#include "otbSARStreamingMaximumMinimumImageFilter.h"
#include <iostream>
......@@ -47,6 +49,8 @@ public:
// Filters
typedef itk::FFTNormalizedCorrelationImageFilter<FloatImageType, FloatImageType> CorFilterType;
typedef otb::SARStreamingMaximumMinimumImageFilter< FloatImageType> MinMaxFilterType;
typedef otb::MultiToMonoChannelExtractROI<FloatVectorImageType::InternalPixelType,
FloatImageType::InternalPixelType> ExtractROIFilterType;
private:
void DoInit() override
......@@ -129,46 +133,73 @@ void DoExecute() override
otbAppLogINFO(<<"RAM : "<< GetParameterInt("ram"));
// Get master and slave image
FloatImageType::Pointer MasterPtr = GetParameterFloatImage("inmaster");
FloatImageType::Pointer SlavePtr = GetParameterFloatImage("inslave");
FloatVectorImageType::Pointer MasterPtr = GetParameterFloatVectorImage("inmaster");
FloatVectorImageType::Pointer SlavePtr = GetParameterFloatVectorImage("inslave");
// Initialize values
float shiftML_range = 0;
float shiftML_azimut = 0;
float shiftSLC_range = 0;
float shiftSLC_azimut = 0;
int startx = 0;
int starty = 0;
int sizex = std::min(MasterPtr->GetLargestPossibleRegion().GetSize()[0],
SlavePtr->GetLargestPossibleRegion().GetSize()[0]);
int sizey = std::min(MasterPtr->GetLargestPossibleRegion().GetSize()[1],
SlavePtr->GetLargestPossibleRegion().GetSize()[1]);
// Check input size (Master size) to protect memory.
// If size > 15000 raise an exception and indicate more appropriate ml factors
if (MasterPtr->GetLargestPossibleRegion().GetSize()[0] > 15000 ||
MasterPtr->GetLargestPossibleRegion().GetSize()[1] > 15000)
// Extract ROI from Master and Slave Image to estimate global shifts without a too large amount
// of RAM => size = 3000*3000 at the center
if (sizex > 3000 &&
sizey > 3000)
{
// integer divisions
int intermediate_mlran = MasterPtr->GetLargestPossibleRegion().GetSize()[0]/15000 + 1;
int intermediate_mlazi = MasterPtr->GetLargestPossibleRegion().GetSize()[1]/15000 + 1;
startx = MasterPtr->GetLargestPossibleRegion().GetSize()[0]/2 - 1500;
starty = MasterPtr->GetLargestPossibleRegion().GetSize()[1]/2 - 1500;
otbAppLogCRITICAL(<<"ML Factors are not appropriate for these estimations. Please use other factors such as : "<< intermediate_mlran << " x " << intermediate_mlazi );
itkExceptionMacro(<<"ML Factors are not appropriate for these estimations");
sizex = 3000;
sizey = 3000;
}
ExtractROIFilterType::Pointer extractROIFilter_master = ExtractROIFilterType::New();
m_Ref.push_back(extractROIFilter_master.GetPointer());
extractROIFilter_master->SetInput(MasterPtr);
extractROIFilter_master->SetChannel(1);
extractROIFilter_master->SetStartX(startx);
extractROIFilter_master->SetStartY(starty);
extractROIFilter_master->SetSizeX(sizex);
extractROIFilter_master->SetSizeY(sizey);
ExtractROIFilterType::Pointer extractROIFilter_slave = ExtractROIFilterType::New();
m_Ref.push_back(extractROIFilter_slave.GetPointer());
extractROIFilter_slave->SetInput(SlavePtr);
extractROIFilter_slave->SetChannel(1);
extractROIFilter_slave->SetStartX(startx);
extractROIFilter_slave->SetStartY(starty);
extractROIFilter_slave->SetSizeX(sizex);
extractROIFilter_slave->SetSizeY(sizey);
// Correlation Filter
CorFilterType::Pointer correlationFilter = CorFilterType::New();
m_Ref.push_back(correlationFilter.GetPointer());
correlationFilter->SetFixedImage(MasterPtr);
correlationFilter->SetMovingImage(SlavePtr);
correlationFilter->SetFixedImage(extractROIFilter_master->GetOutput());
correlationFilter->SetMovingImage(extractROIFilter_slave->GetOutput());
MinMaxFilterType::Pointer minMaxFilter = MinMaxFilterType::New();
minMaxFilter->SetInput(correlationFilter->GetOutput());
// Adapt streaming with ram parameter (default 256 MB)
minMaxFilter->GetStreamer()->SetAutomaticStrippedStreaming(GetParameterInt("ram"));
minMaxFilter->Update();
shiftSLC_range = ((correlationFilter->GetOutput()->GetLargestPossibleRegion().GetSize()[0]/2.)-
minMaxFilter->GetIndexOfMax()[0]) * static_cast<float>(factorML_ran);
shiftSLC_azimut = ((correlationFilter->GetOutput()->GetLargestPossibleRegion().GetSize()[1]/2.)
-minMaxFilter->GetIndexOfMax()[1]) * static_cast<float>(factorML_azi);
float shiftSLC_range = ((correlationFilter->GetOutput()->GetLargestPossibleRegion().GetSize()[0]/2.)-
minMaxFilter->GetIndexOfMax()[0]) * static_cast<float>(factorML_ran);
float shiftSLC_azimut = ((correlationFilter->GetOutput()->GetLargestPossibleRegion().GetSize()[1]/2.)
-minMaxFilter->GetIndexOfMax()[1]) * static_cast<float>(factorML_azi);
float shiftML_range = ((correlationFilter->GetOutput()->GetLargestPossibleRegion().GetSize()[0]/2.)-
minMaxFilter->GetIndexOfMax()[0]);
float shiftML_azimut = ((correlationFilter->GetOutput()->GetLargestPossibleRegion().GetSize()[1]/2.)
-minMaxFilter->GetIndexOfMax()[1]);
shiftML_range = ((correlationFilter->GetOutput()->GetLargestPossibleRegion().GetSize()[0]/2.)-
minMaxFilter->GetIndexOfMax()[0]);
shiftML_azimut = ((correlationFilter->GetOutput()->GetLargestPossibleRegion().GetSize()[1]/2.)
-minMaxFilter->GetIndexOfMax()[1]);
// Assigne Outputs
SetParameterFloat("shiftranslc", shiftSLC_range);
......
File added
GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]]
\ No newline at end of file
File added
File added
......@@ -231,12 +231,15 @@ namespace otb
int firstL_master = 0;
if (m_FirstLCOffset)
{
int firstC = std::max (1 + m_WinCor_ran, 1 + m_WinCor_ran - m_RoughShift_ran + m_WinAround_ShiftRan);
int firstL = std::max (1 + m_WinCor_azi, 1 + m_WinCor_azi - m_RoughShift_azi + m_WinAround_ShiftAzi);
int lastC = std::min(slavePtr->GetLargestPossibleRegion().GetSize()[0] - m_RoughShift_ran -
int abs_RoughShift_ran = std::abs(m_RoughShift_ran);
int abs_RoughShift_azi = std::abs(m_RoughShift_azi);
int firstC = std::max (1 + m_WinCor_ran, 1 + m_WinCor_ran - abs_RoughShift_ran + m_WinAround_ShiftRan);
int firstL = std::max (1 + m_WinCor_azi, 1 + m_WinCor_azi - abs_RoughShift_azi + m_WinAround_ShiftAzi);
int lastC = std::min(slavePtr->GetLargestPossibleRegion().GetSize()[0] - abs_RoughShift_ran -
m_WinAround_ShiftRan - m_WinCor_ran,
masterPtr->GetLargestPossibleRegion().GetSize()[0]- m_WinCor_ran);
int lastL = std::min(slavePtr->GetLargestPossibleRegion().GetSize()[1] - m_RoughShift_azi -
int lastL = std::min(slavePtr->GetLargestPossibleRegion().GetSize()[1] - abs_RoughShift_azi -
m_WinAround_ShiftAzi- m_WinCor_azi,
masterPtr->GetLargestPossibleRegion().GetSize()[1] - m_WinCor_azi);
......@@ -328,15 +331,17 @@ namespace otb
int firstC_Grid = 0;
int firstL_Grid = 0;
int abs_RoughShift_ran = std::abs(m_RoughShift_ran);
int abs_RoughShift_azi = std::abs(m_RoughShift_azi);
if (m_FirstLCOffset)
{
int firstC = std::max (1 + m_WinCor_ran, 1 + m_WinCor_ran - m_RoughShift_ran + m_WinAround_ShiftRan);
int firstL = std::max (1 + m_WinCor_azi, 1 + m_WinCor_azi - m_RoughShift_azi + m_WinAround_ShiftAzi);
int lastC = std::min(slavePtr->GetLargestPossibleRegion().GetSize()[0] - m_RoughShift_ran -
int firstC = std::max (1 + m_WinCor_ran, 1 + m_WinCor_ran - abs_RoughShift_ran + m_WinAround_ShiftRan);
int firstL = std::max (1 + m_WinCor_azi, 1 + m_WinCor_azi - abs_RoughShift_azi + m_WinAround_ShiftAzi);
int lastC = std::min(slavePtr->GetLargestPossibleRegion().GetSize()[0] - abs_RoughShift_ran -
m_WinAround_ShiftRan - m_WinCor_ran,
masterPtr->GetLargestPossibleRegion().GetSize()[0]- m_WinCor_ran);
int lastL = std::min(slavePtr->GetLargestPossibleRegion().GetSize()[1] - m_RoughShift_azi -
int lastL = std::min(slavePtr->GetLargestPossibleRegion().GetSize()[1] - abs_RoughShift_azi -
m_WinAround_ShiftAzi- m_WinCor_azi,
masterPtr->GetLargestPossibleRegion().GetSize()[1] - m_WinCor_azi);
......@@ -390,11 +395,11 @@ namespace otb
ImageInSizeType slaveSize;
// Set the max_shift (margin)
firstL = masterRequestedIndex[1] - m_RoughShift_azi - m_WinAround_ShiftAzi - m_WinCor_azi;
firstC = masterRequestedIndex[0] - m_RoughShift_ran - m_WinAround_ShiftRan - m_WinCor_ran;
lastL = masterRequestedIndex[1] + masterRequestedSize[1] + m_RoughShift_azi + m_WinAround_ShiftAzi +
firstL = masterRequestedIndex[1] - abs_RoughShift_azi - m_WinAround_ShiftAzi - m_WinCor_azi;
firstC = masterRequestedIndex[0] - abs_RoughShift_ran - m_WinAround_ShiftRan - m_WinCor_ran;
lastL = masterRequestedIndex[1] + masterRequestedSize[1] + abs_RoughShift_azi + m_WinAround_ShiftAzi +
m_WinCor_azi;
lastC = masterRequestedIndex[0] + masterRequestedSize[0] + m_RoughShift_ran + m_WinAround_ShiftRan + m_WinCor_ran;
lastC = masterRequestedIndex[0] + masterRequestedSize[0] + abs_RoughShift_ran + m_WinAround_ShiftRan + m_WinCor_ran;
// Check the limits
if (firstC < 0)
......@@ -518,12 +523,15 @@ namespace otb
if (m_FirstLCOffset)
{
int firstC = std::max (1 + m_WinCor_ran, 1 + m_WinCor_ran - m_RoughShift_ran + m_WinAround_ShiftRan);
int firstL = std::max (1 + m_WinCor_azi, 1 + m_WinCor_azi - m_RoughShift_azi + m_WinAround_ShiftAzi);
int lastC = std::min(slavePtr->GetLargestPossibleRegion().GetSize()[0] - m_RoughShift_ran -
int abs_RoughShift_ran = std::abs(m_RoughShift_ran);
int abs_RoughShift_azi = std::abs(m_RoughShift_azi);
int firstC = std::max (1 + m_WinCor_ran, 1 + m_WinCor_ran - abs_RoughShift_ran + m_WinAround_ShiftRan);
int firstL = std::max (1 + m_WinCor_azi, 1 + m_WinCor_azi - abs_RoughShift_azi + m_WinAround_ShiftAzi);
int lastC = std::min(slavePtr->GetLargestPossibleRegion().GetSize()[0] - abs_RoughShift_ran -
m_WinAround_ShiftRan - m_WinCor_ran,
masterPtr->GetLargestPossibleRegion().GetSize()[0]- m_WinCor_ran);
int lastL = std::min(slavePtr->GetLargestPossibleRegion().GetSize()[1] - m_RoughShift_azi -
int lastL = std::min(slavePtr->GetLargestPossibleRegion().GetSize()[1] - abs_RoughShift_azi -
m_WinAround_ShiftAzi- m_WinCor_azi,
masterPtr->GetLargestPossibleRegion().GetSize()[1] - m_WinCor_azi);
......
......@@ -43,7 +43,8 @@
"additionalProperties": false,
"properties": {"clean": {"type": "string", "default": "yes"},
"burst_index": {"type": "string", "default": "0-8"},
"optram": {"type": "number", "default": 4000}}
"optram": {"type": "number", "default": 4000},
"tmpdir_into_outputdir": {"type": "string", "default": "no"}}
}
},
"additionalProperties": false,
......
......@@ -35,7 +35,8 @@
{
"type": "object",
"additionalProperties": false,
"properties": {"burst_index": {"type": "string", "pattern":"^[-0-9]+$"}}
"properties": {"burst_index": {"type": "string", "pattern":"^[-0-9]+$"},
"optram": {"type": "number", "default": 4000}}
}
},
"additionalProperties": false,
......
......@@ -39,6 +39,12 @@
"additionalProperties": false,
"properties": {"satellite": {"type": "string"},
"mode": {"type": "string"}}
},
"parameter":
{
"type": "object",
"additionalProperties": false,
"properties": {"optram": {"type": "number", "default": 4000}}
}
},
"additionalProperties": false,
......
This diff is collapsed.
This diff is collapsed.
......@@ -63,91 +63,117 @@ if __name__ == "__main__":
dataConfig = func_utils.load_configfile(args.configfile)
# Get dictionaries
dict_Global = dataConfig['Global']
dict_PreProcessing = dataConfig['Pre_Processing']
dict_Metadata_Correction = dataConfig['Metadata_Correction']
dict_DInSAR = dataConfig['DIn_SAR']
dict_PostProcessing = dataConfi