Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
diapotb
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Remote Modules
diapotb
Commits
933ab313
"README.md" did not exist on "7565301cfd831624d63cc1e95ca74338536b9699"
Commit
933ab313
authored
5 years ago
by
Gaëlle USSEGLIO
Browse files
Options
Downloads
Patches
Plain Diff
ENH : StripMap chain with Cosmo
parent
bec902fd
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!16
Merge branch Cosmo
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/otbSARCorrelationGridImageFilter.txx
+23
-3
23 additions, 3 deletions
include/otbSARCorrelationGridImageFilter.txx
python_src/diapOTB.py
+36
-2
36 additions, 2 deletions
python_src/diapOTB.py
with
59 additions
and
5 deletions
include/otbSARCorrelationGridImageFilter.txx
+
23
−
3
View file @
933ab313
...
@@ -302,7 +302,7 @@ namespace otb
...
@@ -302,7 +302,7 @@ namespace otb
//////////////////// Requested region for slave ////////////////////
//////////////////// Requested region for slave ////////////////////
//int max_shift = 10;
//int max_shift = 10;
int max_shift =
5
0;
int max_shift =
20
0;
int firstL, firstC, lastL, lastC;
int firstL, firstC, lastL, lastC;
// Transform back into slave region index space with an maximum shift between master and slave
// Transform back into slave region index space with an maximum shift between master and slave
ImageInIndexType slaveIndex;
ImageInIndexType slaveIndex;
...
@@ -350,7 +350,7 @@ namespace otb
...
@@ -350,7 +350,7 @@ namespace otb
masterRequestedRegion.PadByRadius( m_PatchSizePerDim / 2 );
masterRequestedRegion.PadByRadius( m_PatchSizePerDim / 2 );
slaveRequestedRegion.PadByRadius( m_PatchSizePerDim / 2 );
slaveRequestedRegion.PadByRadius( m_PatchSizePerDim / 2 );
// Crop the fixed region at the fixed's largest possible region
// Crop the fixed region at the fixed's largest possible region
(or buffered)
if ( masterRequestedRegion.Crop(masterPtr->GetLargestPossibleRegion()))
if ( masterRequestedRegion.Crop(masterPtr->GetLargestPossibleRegion()))
{
{
masterPtr->SetRequestedRegion( masterRequestedRegion );
masterPtr->SetRequestedRegion( masterRequestedRegion );
...
@@ -511,6 +511,7 @@ namespace otb
...
@@ -511,6 +511,7 @@ namespace otb
m_slaveExtractPieceTab[i]->SetRegions(slaveRegion);
m_slaveExtractPieceTab[i]->SetRegions(slaveRegion);
m_slaveExtractPieceTab[i]->Allocate();
m_slaveExtractPieceTab[i]->Allocate();
}
}
}
}
/**
/**
...
@@ -521,7 +522,7 @@ namespace otb
...
@@ -521,7 +522,7 @@ namespace otb
SARCorrelationGridImageFilter< TImageIn, TImageOut >
SARCorrelationGridImageFilter< TImageIn, TImageOut >
::AfterThreadedGenerateData()
::AfterThreadedGenerateData()
{
{
// Get the number of threads
// Get the number of threads
unsigned int nbThreads = this->GetNumberOfThreads();
unsigned int nbThreads = this->GetNumberOfThreads();
for (unsigned int i = 0; i < nbThreads; i++)
for (unsigned int i = 0; i < nbThreads; i++)
...
@@ -670,6 +671,25 @@ namespace otb
...
@@ -670,6 +671,25 @@ namespace otb
slaveCurrentRegion.SetIndex(currentSlaveIndex);
slaveCurrentRegion.SetIndex(currentSlaveIndex);
}
}
// Check Size
if (slaveCurrentRegion.GetIndex()[0] + slaveCurrentRegion.GetSize()[0] > slavePtr->GetLargestPossibleRegion().GetSize()[0]
|| slaveCurrentRegion.GetIndex()[1] + slaveCurrentRegion.GetSize()[1] > slavePtr->GetLargestPossibleRegion().GetSize()[1])
{
for(unsigned int i = 0; i < ImageInType::ImageDimension; i++)
{
if (slaveCurrentRegion.GetIndex()[i] + slaveCurrentRegion.GetSize()[i] > slavePtr->GetLargestPossibleRegion().GetSize()[i])
{
currentSlaveSize[i] = slavePtr->GetLargestPossibleRegion().GetSize()[i] - slaveCurrentRegion.GetIndex()[i];
if (slaveCurrentRegion.GetIndex()[i] >= slavePtr->GetLargestPossibleRegion().GetSize()[i])
{
currentSlaveSize[i] = 0;
}
}
}
slaveCurrentRegion.SetSize(currentSlaveSize);
}
// Rescale values to adapt the deformation
// Rescale values to adapt the deformation
double rescale_range = masterCurrentRegion.GetSize()[0];
double rescale_range = masterCurrentRegion.GetSize()[0];
double rescale_azimut = masterCurrentRegion.GetSize()[1];
double rescale_azimut = masterCurrentRegion.GetSize()[1];
...
...
This diff is collapsed.
Click to expand it.
python_src/diapOTB.py
+
36
−
2
View file @
933ab313
...
@@ -35,7 +35,7 @@ from jsonschema import validate
...
@@ -35,7 +35,7 @@ from jsonschema import validate
import
os
import
os
import
sys
import
sys
import
argparse
import
argparse
import
h5py
import
otbApplication
as
otb
import
otbApplication
as
otb
...
@@ -158,7 +158,41 @@ if __name__ == "__main__":
...
@@ -158,7 +158,41 @@ if __name__ == "__main__":
master_Image_base
=
os
.
path
.
basename
(
master_Image
)
master_Image_base
=
os
.
path
.
basename
(
master_Image
)
slave_Image_base
=
os
.
path
.
basename
(
slave_Image
)
slave_Image_base
=
os
.
path
.
basename
(
slave_Image
)
# Check extension (if .h5 => HDF5 file => Cosmo Sensor)
master_ext
=
master_Image
.
split
(
"
.
"
)[
-
1
:]
slave_ext
=
slave_Image
.
split
(
"
.
"
)[
-
1
:]
print
(
"
master_ext =
"
+
master_ext
[
0
]
+
"
\n
"
)
print
(
"
salve_ext =
"
+
slave_ext
[
0
]
+
"
\n
"
)
if
(
master_ext
[
0
]
==
"
h5
"
)
or
(
slave_ext
[
0
]
==
"
h5
"
)
:
master_H5
=
h5py
.
File
(
master_Image
,
'
r
'
)
slave_H5
=
h5py
.
File
(
slave_Image
,
'
r
'
)
lDataSet_master
=
list
(
master_H5
.
keys
())
lDataSet_slave
=
list
(
slave_H5
.
keys
())
if
len
(
lDataSet_master
)
!=
1
or
len
(
lDataSet_slave
)
!=
1
:
print
(
"
H5 input files does not contain the expected dataset
\n
"
)
quit
()
if
lDataSet_master
[
0
]
!=
"
S01
"
or
lDataSet_slave
[
0
]
!=
"
S01
"
:
print
(
"
H5 input files does not contain the expected dataset
\n
"
)
quit
()
master_S01
=
dict
(
master_H5
[
'
S01
'
])
slave_S01
=
dict
(
slave_H5
[
'
S01
'
])
if
not
'
SBI
'
in
master_S01
or
not
'
SBI
'
in
slave_S01
:
print
(
"
H5 input files does not contain the expected dataset
\n
"
)
quit
()
# Change the name of master and slave image to read directly the //S01/SBI
master_Image
=
"
HDF5:
"
+
master_Image
+
"
://S01/SBI
"
slave_Image
=
"
HDF5:
"
+
slave_Image
+
"
://S01/SBI
"
print
(
"
master_Image =
"
+
master_Image
+
"
\n
"
)
print
(
"
slave_Image =
"
+
slave_Image
+
"
\n
"
)
####################### Pre Processing Chain ##########################
####################### Pre Processing Chain ##########################
######## SARDoppler Application #######
######## SARDoppler Application #######
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment