OTB  9.0.0
Orfeo Toolbox
Classes | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
otb::SarSensorModel Class Reference

#include <otbSarSensorModel.h>

+ Collaboration diagram for otb::SarSensorModel:

Classes

struct  LineSampleYZ
 
struct  ZeroDopplerInfo
 

Public Types

using DurationType = MetaData::Duration
 
using OrbitIterator = std::vector< Orbit >::const_iterator
 
using Point2DType = itk::Point< double, 2 >
 
using Point3DType = itk::Point< double, 3 >
 
using TimeType = MetaData::TimePoint
 
using Vector3DType = itk::Point< double, 3 >
 

Public Member Functions

bool BurstExtraction (const unsigned int burst_index, std::pair< unsigned long, unsigned long > &lines, std::pair< unsigned long, unsigned long > &samples, bool allPixels=false)
 
double CalculateRangeTime (Point3DType const &ecefGround, Point3DType const &sensorPos) const
 
bool Deburst (std::vector< std::pair< unsigned long, unsigned long >> &lines, std::pair< unsigned long, unsigned long > &samples, bool onlyValidSample=false)
 
bool DeburstAndConcatenate (std::vector< std::pair< unsigned long, unsigned long > > &linesBursts, std::vector< std::pair< unsigned long, unsigned long > > &samplesBursts, unsigned int &linesOffset, unsigned int first_burstInd, bool inputWithInvalidPixels=false)
 
LineSampleYZ Doppler0ToLineSampleYZ (Point3DType const &ecefGround, ZeroDopplerInfo const &zdi, double rangeTime) const
 
void LineSampleHeightToWorld (const Point2DType &imPt, double heightAboveEllipsoid, Point3DType &worldPt) const
 
void LineSampleToWorld (const Point2DType &imPt, Point3DType &worldPt) const
 
bool LineToSatPositionAndVelocity (double line, Point3DType &satellitePosition, Point3DType &satelliteVelocity) const
 
SarSensorModeloperator= (const SarSensorModel &)=delete
 
bool Overlap (std::pair< unsigned long, unsigned long > &linesUp, std::pair< unsigned long, unsigned long > &linesLow, std::pair< unsigned long, unsigned long > &samplesUp, std::pair< unsigned long, unsigned long > &samplesLow, unsigned int burstIndUp, bool inputWithInvalidPixels=false)
 
 SarSensorModel (const ImageMetadata &imd, unsigned int polynomial_degree=8)
 
 SarSensorModel (const SarSensorModel &)=delete
 
 SarSensorModel (std::string productType, SARParam sarParam, Projection::GCPParam gcps, unsigned int polynomial_degree=8)
 
void UpdateImageMetadata (ImageMetadata &imd)
 
bool WorldToAzimuthRangeTime (const Point3DType &inGeoPoint, TimeType &azimuthTime, double &rangeTime, Point3DType &sensorPos, Vector3DType &sensorVel) const
 
void WorldToLineSample (const Point3DType &inGeoPoint, Point2DType &outLineSample) const
 
void WorldToLineSampleYZ (const Point3DType &inGeoPoint, Point2DType &cr, Point2DType &yz) const
 
bool WorldToSatPositionAndVelocity (const Point3DType &inGeoPoint, Point3DType &satellitePosition, Point3DType &satelliteVelocity) const
 
ZeroDopplerInfo ZeroDopplerLookup (Point3DType const &inEcefPoint) const
 
TimeType ZeroDopplerTimeLookup (Point3DType const &ecefGround) const
 
std::tuple< TimeType, OrbitIterator, OrbitIteratorZeroDopplerTimeLookupInternal (Point3DType const &ecefGround) const
 
virtual ~SarSensorModel ()=default
 

Static Public Member Functions

static void DeburstLineToImageLine (const std::vector< std::pair< unsigned long, unsigned long > > &lines, unsigned long deburstLine, unsigned long &imageLine)
 
static bool ImageLineToDeburstLine (const std::vector< std::pair< unsigned long, unsigned long > > &lines, unsigned long imageLine, unsigned long &deburstLine)
 

Private Member Functions

double ApplyCoordinateConversion (double in, const TimeType &azimuthTime, const std::vector< CoordinateConversionRecord > &records) const
 
double AzimuthTimeToLine (const TimeType &azimuthTime) const
 
itk::Point< double, 3 > EcefToWorld (const itk::Point< double, 3 > &ecefPoint) const
 
const GCPfindClosestGCP (const Point2DType &imPt, const Projection::GCPParam &gcpParam) const
 
std::pair< Point3DType, Vector3DTypeinterpolateSensorPosVel (TimeType azimuthTime) const
 
std::pair< Point3DType, Vector3DTypeinterpolateSensorPosVel (TimeType azimuthTime, OrbitIterator itrecord1) const
 
TimeType LineToAzimuthTime (double line) const
 
void OptimizeTimeOffsetsFromGcps ()
 
Point3DType projToSurface (const GCP &gcp, const Point2DType &imPt, std::function< double(double, double)> heightFunction) const
 
OrbitIterator searchLagrangianNeighbourhood (TimeType azimuthTime) const
 
double SlantRangeToGroundRange (double slantRange, const TimeType &azimuthTime) const
 
itk::Point< double, 3 > WorldToEcef (const itk::Point< double, 3 > &worldPoint) const
 

Private Attributes

DurationType m_AzimuthTimeOffset
 
otb::GeocentricTransform< otb::TransformDirection::INVERSE, double >::Pointer m_EcefToWorldTransform
 
TimeType m_FirstLineTime
 
Projection::GCPParam m_GCP
 
bool m_IsGrd
 
TimeType m_LastLineTime
 
LagrangianOrbitInterpolator m_OrbitInterpolator
 
unsigned int m_polynomial_degree
 
std::string m_ProductType
 
double m_RangeTimeOffset
 
SARParam m_SarParam
 
otb::GeocentricTransform< otb::TransformDirection::FORWARD, double >::Pointer m_WorldToEcefTransform
 

Detailed Description

Definition at line 36 of file otbSarSensorModel.h.

Member Typedef Documentation

◆ DurationType

Definition at line 47 of file otbSarSensorModel.h.

◆ OrbitIterator

using otb::SarSensorModel::OrbitIterator = std::vector<Orbit>::const_iterator

Definition at line 49 of file otbSarSensorModel.h.

◆ Point2DType

using otb::SarSensorModel::Point2DType = itk::Point<double, 2>

Definition at line 41 of file otbSarSensorModel.h.

◆ Point3DType

using otb::SarSensorModel::Point3DType = itk::Point<double, 3>

Definition at line 42 of file otbSarSensorModel.h.

◆ TimeType

Definition at line 46 of file otbSarSensorModel.h.

◆ Vector3DType

using otb::SarSensorModel::Vector3DType = itk::Point<double, 3>

Definition at line 44 of file otbSarSensorModel.h.

Constructor & Destructor Documentation

◆ SarSensorModel() [1/3]

otb::SarSensorModel::SarSensorModel ( std::string  productType,
SARParam  sarParam,
Projection::GCPParam  gcps,
unsigned int  polynomial_degree = 8 
)

◆ SarSensorModel() [2/3]

otb::SarSensorModel::SarSensorModel ( const ImageMetadata imd,
unsigned int  polynomial_degree = 8 
)
explicit

◆ ~SarSensorModel()

virtual otb::SarSensorModel::~SarSensorModel ( )
virtualdefault

◆ SarSensorModel() [3/3]

otb::SarSensorModel::SarSensorModel ( const SarSensorModel )
delete

Member Function Documentation

◆ ApplyCoordinateConversion()

double otb::SarSensorModel::ApplyCoordinateConversion ( double  in,
const TimeType azimuthTime,
const std::vector< CoordinateConversionRecord > &  records 
) const
private

◆ AzimuthTimeToLine()

double otb::SarSensorModel::AzimuthTimeToLine ( const TimeType azimuthTime) const
private

Convert azimuth time to fractional line.

Parameters
[in]azimuthTimeThe azimuth time to convert
Returns
The estimated fractional line

◆ BurstExtraction()

bool otb::SarSensorModel::BurstExtraction ( const unsigned int  burst_index,
std::pair< unsigned long, unsigned long > &  lines,
std::pair< unsigned long, unsigned long > &  samples,
bool  allPixels = false 
)

This method will perform an extraction of one burst. It will return the lines and samples to extract in the image file.

Returns
true if the extraction operation succeeded. No changes is made to the object if the operation fails.
Parameters
burst_indexIndex of Burst.
linesA container for the lines to keep in the standalone burst.
samplesA container for the samples to keep in the standalone burst.

Referenced by otb::SarBurstExtractionImageFilter< TImage >::GenerateOutputInformation().

◆ CalculateRangeTime()

double otb::SarSensorModel::CalculateRangeTime ( Point3DType const &  ecefGround,
Point3DType const &  sensorPos 
) const

Calculate range time from pre computed information. For user code that may or may not need range time information independently of other information related to the zero doppler.

Parameters
[in]ecefGroundground point in XYZ cartesian coordinates
[in]sensorPossensor position associated to ecefGround
Returns
the related range time
Precondition
sensorPos shall match ground point.
Exceptions
None

◆ Deburst()

bool otb::SarSensorModel::Deburst ( std::vector< std::pair< unsigned long, unsigned long >> &  lines,
std::pair< unsigned long, unsigned long > &  samples,
bool  onlyValidSample = false 
)

Deburst metadata if possible and return lines to keep in image file

Referenced by otb::SarDeburstImageFilter< TImage >::GenerateOutputInformation().

◆ DeburstAndConcatenate()

bool otb::SarSensorModel::DeburstAndConcatenate ( std::vector< std::pair< unsigned long, unsigned long > > &  linesBursts,
std::vector< std::pair< unsigned long, unsigned long > > &  samplesBursts,
unsigned int &  linesOffset,
unsigned int  first_burstInd,
bool  inputWithInvalidPixels = false 
)

This method will perform a deburst and concatenation operation, and return the vector of lines and the vector of samples to keep in the image file. The lines and samples represents start/size into each independent bursts. Note that the deburst operation has no effect if theBurstRecords contains a single burst. Otherwise it will merge burst together into a single burst, and update GCPs accordingly.

Returns
true if the deburst operation succeeded. No changes is made to the object if the operation fails.
Parameters
linesA container for the lines ranges to keep in the deburst image.
samplesA container for the samples ranges to keep in the deburst image.
linesA Boolean to indicate only valids samples are required.

Referenced by otb::SarConcatenateBurstsImageFilter< TImage >::getDeburstLinesAndSamples().

◆ DeburstLineToImageLine()

static void otb::SarSensorModel::DeburstLineToImageLine ( const std::vector< std::pair< unsigned long, unsigned long > > &  lines,
unsigned long  deburstLine,
unsigned long &  imageLine 
)
static

This is a helper function to convert deburst line to input image line

Parameters
linesThe vector of lines range to keep
imageLineThe input deburst line
deburstLineThe output original image line

Referenced by otb::SarDeburstImageFilter< TImage >::OutputRegionToInputRegion().

◆ Doppler0ToLineSampleYZ()

LineSampleYZ otb::SarSensorModel::Doppler0ToLineSampleYZ ( Point3DType const &  ecefGround,
ZeroDopplerInfo const &  zdi,
double  rangeTime 
) const

Compute input image point (col,row) and YZ frame from Doppler0 precomputed information.

Unlike WorldToLineSampleYZ, this function starts from data already computed and cached by user code.

The main use case is when doppler0 information is already requested by user code as it could be directly injected to compute col/row/Y/Z instead of searching again for the doppler0 data related to ecefGround point.

Parameters
[in]ecefGroundground point in XYZ cartesian coordinates
[in]zdizero doppler information (azimuth time, sensor position + velocity)
[in]rangeTimeassociated range time
Precondition
the zdi data and rangeTime| shall have been obtained with ZeroDopplerLookupandCalculateRangeTimeon the sameecefGround` point.
Returns
input image point (col,row) and YZ frame.
Exceptions
None
See also
WorldToLineSampleYZ

◆ EcefToWorld()

itk::Point<double, 3> otb::SarSensorModel::EcefToWorld ( const itk::Point< double, 3 > &  ecefPoint) const
private

Coordinate transformation from ECEF to geographic

◆ findClosestGCP()

const GCP& otb::SarSensorModel::findClosestGCP ( const Point2DType imPt,
const Projection::GCPParam gcpParam 
) const
private

◆ ImageLineToDeburstLine()

static bool otb::SarSensorModel::ImageLineToDeburstLine ( const std::vector< std::pair< unsigned long, unsigned long > > &  lines,
unsigned long  imageLine,
unsigned long &  deburstLine 
)
static

This is a helper function to convert image line to deburst image line.

Parameters
linesThe vector of lines range to keep
imageLineThe input image line
deburstLineThe output deburst line
Returns
True if imageLine is within a preserved range, false otherwise

Referenced by otb::SarDeburstImageFilter< TImage >::GenerateOutputInformation().

◆ interpolateSensorPosVel() [1/2]

std::pair<Point3DType, Vector3DType> otb::SarSensorModel::interpolateSensorPosVel ( TimeType  azimuthTime) const
private

Interpolate sensor position and velocity at given azimuth time using lagragian interpolation of orbital records.

This overload will search (in O(N)) for the closest OrbitStateVector from ground point thanks to searchLagrangianNeighbourhood. This overload is time consuming and best avoided is possible.

Parameters
[in]azimuthTimeThe time at which to interpolate
Returns
interpolated sensor {position, velocity}

◆ interpolateSensorPosVel() [2/2]

std::pair<Point3DType, Vector3DType> otb::SarSensorModel::interpolateSensorPosVel ( TimeType  azimuthTime,
OrbitIterator  itrecord1 
) const
private

Interpolate sensor position and velocity at given azimuth time using lagragian interpolation of orbital records.

This overload will exploit the last OSV sample known to be before the azimuthTime. Prefer this overload when possible.

Parameters
[in]azimuthTimeThe time at which to interpolate
Returns
interpolated sensor {position, velocity}

◆ LineSampleHeightToWorld()

void otb::SarSensorModel::LineSampleHeightToWorld ( const Point2DType imPt,
double  heightAboveEllipsoid,
Point3DType worldPt 
) const

◆ LineSampleToWorld()

void otb::SarSensorModel::LineSampleToWorld ( const Point2DType imPt,
Point3DType worldPt 
) const

◆ LineToAzimuthTime()

TimeType otb::SarSensorModel::LineToAzimuthTime ( double  line) const
private

◆ LineToSatPositionAndVelocity()

bool otb::SarSensorModel::LineToSatPositionAndVelocity ( double  line,
Point3DType satellitePosition,
Point3DType satelliteVelocity 
) const

Transform line index to satellite position (x,y,z) and satellite velocity

◆ operator=()

SarSensorModel& otb::SarSensorModel::operator= ( const SarSensorModel )
delete

◆ OptimizeTimeOffsetsFromGcps()

void otb::SarSensorModel::OptimizeTimeOffsetsFromGcps ( )
private

◆ Overlap()

bool otb::SarSensorModel::Overlap ( std::pair< unsigned long, unsigned long > &  linesUp,
std::pair< unsigned long, unsigned long > &  linesLow,
std::pair< unsigned long, unsigned long > &  samplesUp,
std::pair< unsigned long, unsigned long > &  samplesLow,
unsigned int  burstIndUp,
bool  inputWithInvalidPixels = false 
)

This method will estimate the overlap area between two bursts and return the vector of lines and the vector of samples (with two elements : Burst Up and Burst Low). Note that this operation has no effect if theBurstRecords contains a single burst.

Returns
true if this operation succeeded. No changes is made to the object if the operation fails.
Parameters
linesUpA container for the lines ranges to keep into the first Burst
linesLowA container for the lines ranges to keep into the second Burst
samplesUpA container for the samples ranges to keep into the first Burst.
samplesDownA container for the samples ranges to keep into the second Burst.
burstIndUpIndex of the first Burst
inputWithInvalidPixelsA Boolean to indicate if invalids pixels are into inputs.

◆ projToSurface()

Point3DType otb::SarSensorModel::projToSurface ( const GCP gcp,
const Point2DType imPt,
std::function< double(double, double)>  heightFunction 
) const
private

◆ searchLagrangianNeighbourhood()

OrbitIterator otb::SarSensorModel::searchLagrangianNeighbourhood ( TimeType  azimuthTime) const
private

Linear search of the OrbitStateVector which is the closest from ground point.

This function is time consuming and best avoided is possible.

Returns
an OrbitIterator on the closest OSV (from the ground), with a supposition on the Lagrangian polynomial degree.
Exceptions
None

◆ SlantRangeToGroundRange()

double otb::SarSensorModel::SlantRangeToGroundRange ( double  slantRange,
const TimeType azimuthTime 
) const
private

◆ UpdateImageMetadata()

void otb::SarSensorModel::UpdateImageMetadata ( ImageMetadata imd)

◆ WorldToAzimuthRangeTime()

bool otb::SarSensorModel::WorldToAzimuthRangeTime ( const Point3DType inGeoPoint,
TimeType azimuthTime,
double &  rangeTime,
Point3DType sensorPos,
Vector3DType sensorVel 
) const

Helper function that returns every zero doppler related information for the input ground point in WGS84 coordinates (lat, lon, hgt).

Actually, it returns everything but the ground point in ECEF coordinates.

Alternately, user code can chose to use the more fine grained functions

Parameters
[in]inGeoPointground point in WGS84 (lat, lon, hgt) coordinates
[out]azimuthTimeazimuth time at zero doppler
[out]rangeTimerange time at zero doppler
[out]sensorPossensor position at zero doppler
[out]sensorVelsensor velocity at zero doppler
Returns
true, always...
Exceptions
itk::ExceptionObjectif there aren't enough OrbitStateVector samples to search in the orbit.
See also
otb::Projection::WorldToEcef(), ZeroDopplerLookup(), CalculateRangeTime().

◆ WorldToEcef()

itk::Point<double, 3> otb::SarSensorModel::WorldToEcef ( const itk::Point< double, 3 > &  worldPoint) const
private

Coordinate transformation from geographic to ECEF

◆ WorldToLineSample()

void otb::SarSensorModel::WorldToLineSample ( const Point3DType inGeoPoint,
Point2DType outLineSample 
) const

Transform world point (lat,lon,hgt) to input image point (col,row)

◆ WorldToLineSampleYZ()

void otb::SarSensorModel::WorldToLineSampleYZ ( const Point3DType inGeoPoint,
Point2DType cr,
Point2DType yz 
) const

Transform world point (lat,lon,hgt) to input image point (col,row) and YZ frame.

Unlike Doppler0ToLineSampleYZ, this function takes care of searching doppler 0 information related to the ground point inGeoPoint. However, intermediary data will be hidden and lost. Any call to other WorldTo... function will search for the same doppler0 information again and again...

As such, prefer using otb::Projection::WorldToEcef, ZeroDopplerLookup, and Doppler0ToLineSampleYZ manually if you need several of these information.

Parameters
[in]inGeoPointground point in WGS84 (lat, lon, hgt) coordinates
[out]crassociated col+row
[out]yzassociated coordinates in YZ frame
Exceptions
itk::ExceptionObjectif there aren't enough OrbitStateVector samples to search in the orbit.

◆ WorldToSatPositionAndVelocity()

bool otb::SarSensorModel::WorldToSatPositionAndVelocity ( const Point3DType inGeoPoint,
Point3DType satellitePosition,
Point3DType satelliteVelocity 
) const

Transform world point (lat,lon,hgt) to satellite position (x,y,z) and satellite velocity.

Warning
this function also computes the azimuthTime and the range time, but it only return sensor position and velocity. Prefer WorldToAzimuthRangeTime or the more fine grained ZeroDopplerLookup function.
Returns
true, always...
Exceptions
itk::ExceptionObjectif there aren't enough OrbitStateVector samples to search in the orbit.

◆ ZeroDopplerLookup()

ZeroDopplerInfo otb::SarSensorModel::ZeroDopplerLookup ( Point3DType const &  inEcefPoint) const

Computes Zero Doppler information. Given a ground position, looks for the associated azimuth time, and the associated position and velocity of the sensor.

Parameters
[in]inEcefPointGround position in ECEF coordinates
Returns
{azimuthTime, sensor position, sensor velocity} at zero doppler
Exceptions
itk::ExceptionObjectif orbit record vector contains less than 2 elements.

◆ ZeroDopplerTimeLookup()

TimeType otb::SarSensorModel::ZeroDopplerTimeLookup ( Point3DType const &  ecefGround) const

Computes Zero Doppler information. Given a ground position, estimates the associated azimuth time of the zero doppler.

Internally, this function calls ZeroDopplerTimeLookupInternal() but only return the azimuth time.

Parameters
[in]ecefGroundGround position in ECEF coordinates
Returns
Associated azimuth time.
Exceptions
itk::ExceptionObjectif orbit record vector contains less than 2 elements.

◆ ZeroDopplerTimeLookupInternal()

std::tuple<TimeType, OrbitIterator, OrbitIterator> otb::SarSensorModel::ZeroDopplerTimeLookupInternal ( Point3DType const &  ecefGround) const

Internal function that looks for zero doppler. Given a ground position, estimates the associated azimuth time of the zero doppler.

This internal function also provides iterators to OrbitStateVector samples in between which the sensor has been the closest to the ground point. These iterators will then permit to directly interpolate the sensor position and velocity (without looking for the OSV sample which is the closest from ground point, a second time).

Member Data Documentation

◆ m_AzimuthTimeOffset

DurationType otb::SarSensorModel::m_AzimuthTimeOffset
private

Definition at line 423 of file otbSarSensorModel.h.

◆ m_EcefToWorldTransform

otb::GeocentricTransform<otb::TransformDirection::INVERSE, double>::Pointer otb::SarSensorModel::m_EcefToWorldTransform
private

Definition at line 434 of file otbSarSensorModel.h.

◆ m_FirstLineTime

TimeType otb::SarSensorModel::m_FirstLineTime
private

Definition at line 420 of file otbSarSensorModel.h.

◆ m_GCP

Projection::GCPParam otb::SarSensorModel::m_GCP
private

Definition at line 417 of file otbSarSensorModel.h.

◆ m_IsGrd

bool otb::SarSensorModel::m_IsGrd
private

Definition at line 427 of file otbSarSensorModel.h.

◆ m_LastLineTime

TimeType otb::SarSensorModel::m_LastLineTime
private

Definition at line 421 of file otbSarSensorModel.h.

◆ m_OrbitInterpolator

LagrangianOrbitInterpolator otb::SarSensorModel::m_OrbitInterpolator
private

Definition at line 431 of file otbSarSensorModel.h.

◆ m_polynomial_degree

unsigned int otb::SarSensorModel::m_polynomial_degree
private

Definition at line 432 of file otbSarSensorModel.h.

◆ m_ProductType

std::string otb::SarSensorModel::m_ProductType
private

Definition at line 416 of file otbSarSensorModel.h.

◆ m_RangeTimeOffset

double otb::SarSensorModel::m_RangeTimeOffset
private

Definition at line 424 of file otbSarSensorModel.h.

◆ m_SarParam

SARParam otb::SarSensorModel::m_SarParam
private

Definition at line 418 of file otbSarSensorModel.h.

◆ m_WorldToEcefTransform

otb::GeocentricTransform<otb::TransformDirection::FORWARD, double>::Pointer otb::SarSensorModel::m_WorldToEcefTransform
private

Definition at line 435 of file otbSarSensorModel.h.


The documentation for this class was generated from the following file: