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
07d10825
Commit
07d10825
authored
3 years ago
by
Abdussalam SALEH MGHIR
Browse files
Options
Downloads
Patches
Plain Diff
ENH : polynomial coefs save inside vectors instead of multiple independent attributes (SARDeramp)
parent
09810305
No related branches found
No related tags found
2 merge requests
!52
Merge for v1.1.0
,
!43
Add TSX to SARDeramp
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/otbSARDerampTSXImageFilter.h
+12
-13
12 additions, 13 deletions
include/otbSARDerampTSXImageFilter.h
include/otbSARDerampTSXImageFilter.txx
+30
-25
30 additions, 25 deletions
include/otbSARDerampTSXImageFilter.txx
with
42 additions
and
38 deletions
include/otbSARDerampTSXImageFilter.h
+
12
−
13
View file @
07d10825
...
@@ -55,9 +55,9 @@
...
@@ -55,9 +55,9 @@
namespace
otb
namespace
otb
{
{
/** \class SARDerampImageFilter
/** \class SARDerampImageFilter
* \brief Deramps or Reramps a
burst from Sentinel-1 IW
product.
* \brief Deramps or Reramps a
TSX
product.
*
*
* This filter deramps or reramps an input burst.
* This filter deramps or reramps an input
mono-
burst.
*
*
* \ingroup DiapOTBModule
* \ingroup DiapOTBModule
*/
*/
...
@@ -158,29 +158,28 @@ protected:
...
@@ -158,29 +158,28 @@ protected:
// method to get FM parameter
double
getFM
();
double
getFM
();
// method to get the estimated frequency and time values from Doppler Centroid
double
getFDC
(
double
indC
,
char
index
);
double
getFDC
(
double
indC
,
char
index
);
TimeType
getTDC
(
double
fdc
,
char
index
);
TimeType
getTDC
(
double
fdc
,
char
index
);
// method to get the difference in azimuth time
TimeType
getAzTimeL
(
double
indL
);
TimeType
getAzTimeL
(
double
indL
);
// method to compute and get the phi angle
double
getPhi
(
double
indL
,
double
indC
);
double
getPhi
(
double
indL
,
double
indC
);
// method to initialize all the parameters needed to get the phi
void
ThreadInit
(
ImageKeywordlist
inputKWL
);
void
ThreadInit
(
ImageKeywordlist
inputKWL
);
private
:
private
:
SARDerampTSXImageFilter
(
const
Self
&
);
// purposely not implemented
SARDerampTSXImageFilter
(
const
Self
&
);
// purposely not implemented
void
operator
=
(
const
Self
&
);
// purposely not
void
operator
=
(
const
Self
&
);
// purposely not
// Set Polynomial Coefficient for Centroid and FMRate polynomes
// Set Polynomial Coefficient for Centroid and FMRate polynomes
void
setPolynomeFMRate
(
ImageKeywordlist
const
&
kwl
);
void
setPolynomeFMRate
(
ImageKeywordlist
const
&
kwl
,
std
::
vector
<
FMRateRecordType
>
&
FMRateRecords
);
void
setPolynomeDCF
(
ImageKeywordlist
const
&
kwl
);
void
setPolynomeDCF
(
ImageKeywordlist
const
&
kwl
,
std
::
vector
<
DCFRecordType
>
&
DCFRecords
);
// Parameters coefficients for Doppler FM Rate
double
m_FM1_C0
;
double
m_FMN_C0
;
// Parameters coefficients for Doppler Centroid Frequency
// List of polynoms for FMRate and Doppler Centroid
double
m_DCF1_C0
,
m_DCF1_C1
,
m_DCF1_Tau0
;
std
::
vector
<
FMRateRecordType
>
FMRatePolynoms
;
double
m_DCFN_C0
,
m_DCFN_C1
,
m_DCFN_Tau0
;
std
::
vector
<
DCFRecordType
>
DCFPolynoms
;
TimeType
m_TDC1_raw
,
m_TDCN_raw
;
// Parameter average
// Parameter average
double
m_FM
;
double
m_FM
;
...
...
This diff is collapsed.
Click to expand it.
include/otbSARDerampTSXImageFilter.txx
+
30
−
25
View file @
07d10825
...
@@ -49,9 +49,6 @@ namespace otb
...
@@ -49,9 +49,6 @@ namespace otb
*/
*/
template <class TImage>
template <class TImage>
SARDerampTSXImageFilter< TImage >::SARDerampTSXImageFilter()
SARDerampTSXImageFilter< TImage >::SARDerampTSXImageFilter()
: m_FM1_C0(0), m_DCF1_C0(0), m_DCF1_C1(0), m_DCF1_Tau0(0),
m_FMN_C0(0), m_DCFN_C0(0), m_DCFN_C1(0), m_DCFN_Tau0(0),
m_FM(0), m_PRF(0), m_TDC1_raw(0), m_TDCN_raw(0)
{
{
// Inputs required and/or needed
// Inputs required and/or needed
this->SetNumberOfRequiredInputs(1);
this->SetNumberOfRequiredInputs(1);
...
@@ -68,10 +65,11 @@ namespace otb
...
@@ -68,10 +65,11 @@ namespace otb
}
}
template<class TImage>
template<class TImage>
void
void
SARDerampTSXImageFilter< TImage >
SARDerampTSXImageFilter< TImage >
::setPolynomeFMRate(ImageKeywordlist const& kwl)
::setPolynomeFMRate(ImageKeywordlist const& kwl
, std::vector<FMRateRecordType> & FMRateRecords
)
{
{
char fmRatePrefix_[1024];
char fmRatePrefix_[1024];
std::size_t nbLists(0);
std::size_t nbLists(0);
...
@@ -84,20 +82,23 @@ namespace otb
...
@@ -84,20 +82,23 @@ namespace otb
const int pos1 = sprintf(fmRatePrefix_, "%s%zu.", FM_PREFIX.c_str(), 1);
const int pos1 = sprintf(fmRatePrefix_, "%s%zu.", FM_PREFIX.c_str(), 1);
assert(pos1 > 0 && (unsigned long) pos1 < sizeof(fmRatePrefix_));
assert(pos1 > 0 && (unsigned long) pos1 < sizeof(fmRatePrefix_));
const std::string FMPrefix1(fmRatePrefix_, pos1);
const std::string FMPrefix1(fmRatePrefix_, pos1);
this->m_FM1_C0 = std::stod(kwl.GetMetadataByKey(FMPrefix1 + "1.azi_fm_rate_coef"));
FMRateRecordType fmRateRecord1;
fmRateRecord1.coef0FMRate = std::stod(kwl.GetMetadataByKey(FMPrefix1 + "1.azi_fm_rate_coef"));
FMRateRecords.push_back(fmRateRecord1);
//set coefficient for last polynome FMRate
//set coefficient for last polynome FMRate
const int posn = sprintf(fmRatePrefix_, "%s%zu.", FM_PREFIX.c_str(), nbLists);
const int posn = sprintf(fmRatePrefix_, "%s%zu.", FM_PREFIX.c_str(), nbLists);
assert(posn > 0 && (unsigned long) posn < sizeof(fmRatePrefix_));
assert(posn > 0 && (unsigned long) posn < sizeof(fmRatePrefix_));
const std::string FMPrefixn(fmRatePrefix_, posn);
const std::string FMPrefixn(fmRatePrefix_, posn);
this->m_FMN_C0 = std::stod(kwl.GetMetadataByKey(FMPrefixn + "1.azi_fm_rate_coef"));
FMRateRecordType fmRateRecordn;
fmRateRecordn.coef0FMRate = std::stod(kwl.GetMetadataByKey(FMPrefixn + "1.azi_fm_rate_coef"));
FMRateRecords.push_back(fmRateRecordn);
}
}
template<class TImage>
template<class TImage>
void
void
SARDerampTSXImageFilter< TImage >
SARDerampTSXImageFilter< TImage >
::setPolynomeDCF(ImageKeywordlist const& kwl)
::setPolynomeDCF(ImageKeywordlist const& kwl
, std::vector<DCFRecordType> & DCFRecords
)
{
{
char dcfPrefix_[1024];
char dcfPrefix_[1024];
std::size_t nbLists(0);
std::size_t nbLists(0);
...
@@ -110,21 +111,26 @@ namespace otb
...
@@ -110,21 +111,26 @@ namespace otb
const int pos1 = sprintf(dcfPrefix_, "%s%zu.", DCF_PREFIX.c_str(), 1);
const int pos1 = sprintf(dcfPrefix_, "%s%zu.", DCF_PREFIX.c_str(), 1);
assert(pos1 > 0 && (unsigned long) pos1 < sizeof(dcfPrefix_));
assert(pos1 > 0 && (unsigned long) pos1 < sizeof(dcfPrefix_));
const std::string DCFPrefix1(dcfPrefix_, pos1);
const std::string DCFPrefix1(dcfPrefix_, pos1);
DCFRecordType dcfRecord1;
this->m_TDC1_raw
= ossimplugins::time::toModifiedJulianDate(kwl.GetMetadataByKey(DCFPrefix1 + "dop_coef_time"));
dcfRecord1.azimuthDCFTime
= ossimplugins::time::toModifiedJulianDate(kwl.GetMetadataByKey(DCFPrefix1 + "dop_coef_time"));
this->m_DCF1_C0
= std::stod(kwl.GetMetadataByKey(DCFPrefix1 + "1.dop_coef"));
dcfRecord1.coef0DCF
= std::stod(kwl.GetMetadataByKey(DCFPrefix1 + "1.dop_coef"));
this->m_DCF1_C1
= std::stod(kwl.GetMetadataByKey(DCFPrefix1 + "2.dop_coef"));
dcfRecord1.coef1DCF
= std::stod(kwl.GetMetadataByKey(DCFPrefix1 + "2.dop_coef"));
this->m_DCF1_Tau0
= std::stod(kwl.GetMetadataByKey(DCFPrefix1 + "slant_range_time"));
dcfRecord1.tau0DCF
= std::stod(kwl.GetMetadataByKey(DCFPrefix1 + "slant_range_time"));
DCFRecords.push_back(dcfRecord1);
//set coefficients for last polynome DCF
//set coefficients for last polynome DCF
const int posn = sprintf(dcfPrefix_, "%s%zu.", DCF_PREFIX.c_str(), nbLists);
const int posn = sprintf(dcfPrefix_, "%s%zu.", DCF_PREFIX.c_str(), nbLists);
assert(posn > 0 && (unsigned long) posn < sizeof(dcfPrefix_));
assert(posn > 0 && (unsigned long) posn < sizeof(dcfPrefix_));
const std::string DCFPrefixn(dcfPrefix_, posn);
const std::string DCFPrefixn(dcfPrefix_, posn);
DCFRecordType dcfRecordn;
this->m_TDCN_raw = ossimplugins::time::toModifiedJulianDate(kwl.GetMetadataByKey(DCFPrefixn + "dop_coef_time"));
dcfRecordn.azimuthDCFTime = ossimplugins::time::toModifiedJulianDate(kwl.GetMetadataByKey(DCFPrefixn + "dop_coef_time"));
this->m_DCFN_C0 = std::stod(kwl.GetMetadataByKey(DCFPrefixn + "1.dop_coef"));
dcfRecordn.coef0DCF = std::stod(kwl.GetMetadataByKey(DCFPrefixn + "1.dop_coef"));
this->m_DCFN_C1 = std::stod(kwl.GetMetadataByKey(DCFPrefixn + "2.dop_coef"));
dcfRecordn.coef1DCF = std::stod(kwl.GetMetadataByKey(DCFPrefixn + "2.dop_coef"));
this->m_DCFN_Tau0 = std::stod(kwl.GetMetadataByKey(DCFPrefixn + "slant_range_time"));
dcfRecordn.tau0DCF = std::stod(kwl.GetMetadataByKey(DCFPrefixn + "slant_range_time"));
DCFRecords.push_back(dcfRecordn);
}
}
...
@@ -138,7 +144,7 @@ namespace otb
...
@@ -138,7 +144,7 @@ namespace otb
{
{
double FM(0);
double FM(0);
FM = (
m_FM1_C0 + m_FMN_C0
)/2;
FM = (
this->FMRatePolynoms.front().coef0FMRate + this->FMRatePolynoms.back().coef0FMRate
)/2
.
;
return FM;
return FM;
...
@@ -175,10 +181,10 @@ namespace otb
...
@@ -175,10 +181,10 @@ namespace otb
double slant_range_time = this->m_FirstRangeTime + (indC / this->m_RangeSamplingRate);
double slant_range_time = this->m_FirstRangeTime + (indC / this->m_RangeSamplingRate);
if(index == '1'){
if(index == '1'){
fdc =
m_DCF1_C0 + m_DCF1_C1*(slant_range_time - m_DCF1_Tau0
);
fdc =
this->DCFPolynoms.front().coef0DCF + this->DCFPolynoms.front().coef1DCF*(slant_range_time - this->DCFPolynoms.front().tau0DCF
);
}
}
else if(index == 'N'){
else if(index == 'N'){
fdc =
m_DCFN_C0 + m_DCFN_C1*(slant_range_time - m_DCFN_Tau0
);
fdc =
this->DCFPolynoms.back().coef0DCF + this->DCFPolynoms.back().coef1DCF*(slant_range_time - this->DCFPolynoms.back().tau0DCF
);
}
}
...
@@ -200,10 +206,10 @@ namespace otb
...
@@ -200,10 +206,10 @@ namespace otb
if(index == '1'){
if(index == '1'){
tdc =
m_TDC1_raw
- seconds(fdc/m_FM);
tdc =
this->DCFPolynoms.front().azimuthDCFTime
- seconds(fdc/m_FM);
}
}
else if(index == 'N'){
else if(index == 'N'){
tdc =
m_TDCN_raw
- seconds(fdc/m_FM);
tdc =
this->DCFPolynoms.back().azimuthDCFTime
- seconds(fdc/m_FM);
}
}
...
@@ -219,8 +225,7 @@ namespace otb
...
@@ -219,8 +225,7 @@ namespace otb
SARDerampTSXImageFilter<TImage>
SARDerampTSXImageFilter<TImage>
::getPhi(double indL, double indC)
::getPhi(double indL, double indC)
{
{
// Zero Doppler azimuth Time
// Difference in azimuth time
//double aziTime = this->getAzTimeL(indL); // zero-Doppler azimuth time centered in the middle of the burst
double azi_diff = indL/this->m_PRF;
double azi_diff = indL/this->m_PRF;
// FDC
// FDC
double fdc1 = this->getFDC(indC,'1');
double fdc1 = this->getFDC(indC,'1');
...
@@ -252,8 +257,8 @@ namespace otb
...
@@ -252,8 +257,8 @@ namespace otb
this->m_FirstRangeTime = std::stod(inputKWL.GetMetadataByKey("support_data.slant_range_to_first_pixel"));
this->m_FirstRangeTime = std::stod(inputKWL.GetMetadataByKey("support_data.slant_range_to_first_pixel"));
this->m_RangeSamplingRate = std::stod(inputKWL.GetMetadataByKey("support_data.range_sampling_rate"));
this->m_RangeSamplingRate = std::stod(inputKWL.GetMetadataByKey("support_data.range_sampling_rate"));
this->setPolynomeFMRate(inputKWL);
this->setPolynomeFMRate(inputKWL
,this->FMRatePolynoms
);
this->setPolynomeDCF(inputKWL);
this->setPolynomeDCF(inputKWL
,this->DCFPolynoms
);
this->m_PRF = std::stod(inputKWL.GetMetadataByKey("support_data.pulse_repetition_frequency"));
this->m_PRF = std::stod(inputKWL.GetMetadataByKey("support_data.pulse_repetition_frequency"));
this->m_FM = this->getFM();
this->m_FM = this->getFM();
...
...
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