pyresample icon indicating copy to clipboard operation
pyresample copied to clipboard

Introduce the GCPDefinition

Open mraspaud opened this issue 2 years ago • 5 comments

Add a new class called GCPDefinition (inherits from SwathDefinition) which provides access to the underlying gcps.

Use cases:

  • faster loading of coarse lon/lats (for the boundary)

  • if you want to write data with tiepoints

  • interpolate a fraction of what is needed.

  • [ ] Closes #xxxx

  • [x] Tests added

  • [ ] Tests passed

  • [ ] Passes git diff origin/main **/*py | flake8 --diff

  • [ ] Fully documented

mraspaud avatar Nov 16 '22 07:11 mraspaud

@BENR0 ^

mraspaud avatar Nov 16 '22 07:11 mraspaud

Codecov Report

Merging #476 (71a019c) into main (1268d90) will increase coverage by 0.01%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #476      +/-   ##
==========================================
+ Coverage   94.28%   94.29%   +0.01%     
==========================================
  Files          69       70       +1     
  Lines       12394    12417      +23     
==========================================
+ Hits        11686    11709      +23     
  Misses        708      708              
Flag Coverage Δ
unittests 94.29% <100.00%> (+0.01%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pyresample/geometry.py 87.22% <100.00%> (+0.05%) :arrow_up:
pyresample/test/test_gcp_def.py 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

codecov[bot] avatar Nov 16 '22 07:11 codecov[bot]

Coverage Status

Coverage increased (+0.01%) to 93.802% when pulling 71a019c3a7e33a37db59c94e279ba881cc18b328 on mraspaud:feature-tiepoint-def into 1268d904c9bcd01342173dcee73809da59cc79c1 on pytroll:main.

coveralls avatar Nov 16 '22 07:11 coveralls

I'm not sure I understand all of the use cases for GCPs, but I thought they were a sparse version representing something much larger. How does this work here with your definition? Put another way, I thought the user would give GCPs and like an overall shape of the area and that would be used to generate the full lons/lats on the fly. Where is get_coarse_bbox_lonlats going to be used? It isn't used currently, right? How useful is it when we have access to the full lons/lats already? How will the user control whether "coarse" bounding boxes are good enough for their use case?

Yes, very good questions indeed.

  1. This is just a proof of concept when testing SwathDefinition html representations (for speed) so it's not really used anywhere yet.
  2. Indeed, we could make the GCPDefinition have interpolation functions. However a problem is how would it know what interpolation scheme to use? One solution would be a callback to the interpolation function for example.
  3. The coarse bbox is basically just a quick test for now. I have no idea how we could quantify the quality of that, or fitness to give use case...

mraspaud avatar Nov 17 '22 10:11 mraspaud

I think another use case that was mentioned by @mraspaud was to be able to write geotiffs with only tiepoints.

BENR0 avatar Nov 17 '22 11:11 BENR0