Skip to content
Snippets Groups Projects

Optimize coordinate transformations in SARSensorModel

Merged Cédric Traizet requested to merge optimize_sarmodel into develop

Summary

transformation between geographical coordinates and ECEF coordinates takes a lot of time in SarSensorModel computations. In the current implementation, a transform object is created for each transformation, this is very inefficient. Instead, the same transformation object can be created at class construction and used in each transformation.

Copyright

The copyright owner is CNES and has signed the ORFEO ToolBox Contributor License Agreement.


Check before merging:

  • All discussions are resolved
  • At least 2 :thumbsup: votes from core developers, no :thumbsdown: vote.
  • The feature branch is (reasonably) up-to-date with the base branch
  • Dashboard is green
  • Copyright owner has signed the ORFEO ToolBox Contributor License Agreement
  • Optionally, run git diff develop... -U0 --no-color | clang-format-diff.py -p1 -i on latest changes and commit
Edited by Cédric Traizet

Merge request reports

Merge request pipeline #8824 passed

Merge request pipeline passed for d3b6a6f7

Approval is optional

Merged by Cédric TraizetCédric Traizet 3 years ago (Oct 11, 2021 2:30pm UTC)

Merge details

  • Changes merged into develop with d29183f7.
  • Deleted the source branch.

Pipeline #8864 passed

Pipeline passed for d29183f7 on develop

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Cédric Traizet changed the description

    changed the description

  • Cédric Traizet changed milestone to %8.0.0

    changed milestone to %8.0.0

  • added 1 commit

    • d3b6a6f7 - PERF: use the same transform objects for all coordinate transformation of the...

    Compare with previous version

  • For future optimizations, it'll be nice to also have

    CoordinateTransformation::Transform(std::size_t N, double /*inout*/ *x, double /*inout*/ *y, double /*inout*/ *z)
    {
      assert(x);
      assert(y);
      assert(z);
      if (m_Transform->Transform(N, x, y, z) == 0) {
        std::ostringstream oss;
        oss << "(TransformFailureException) "
            << "Transform: " << this << ", "<< N << " 3D parameters";
        throw std::runtime_error(oss.str());
      }
    }
    
    // + The forward call in GeocentricTransform
    
    // + The same forward call as SarSensorModel::EcefToWorld and SarSensorModel::WorldToEcef
    // And possibly in other places.

    At this point it's easier to stay low level (I've hesitated to introduce otb::Span, but we'd actually need an SOA-kind-of span for a better API) and let developers of filter/applications take care of allocating and caching a (different) temporary structure for transforming regions in one call (in each thread).

    I also don't know whether it would make sense to use the other overloads that return an array of boolean flags telling us which transformations succeeded or failed.

    BTW, I'm not sure that interrupting everything by throwing is the best choice if most pixels but a few could not be transformed.

  • Cédric Traizet mentioned in commit d29183f7

    mentioned in commit d29183f7

Please register or sign in to reply
Loading