New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add parallax correction via new ParallaxCorrectionModifier
#1904
Conversation
Started working on unit tests for the parallax correction. Not much content yet. Everything is likely to change completely. Added a dummy implementation, failing, just so that the unit test gets beyond the initial import.
…rection Merge history of monti pytroll parallax branch into satpy to preserve history of parallax.py
Merge first version of parallax.py into satpy, adding (some) docstrings and fixing pep8 issues. From here we can try to make a composite out of it and match it up with the unit test already added.
Adapt a dependency from the parallax module adopted from meteoswiss. I expect adding this module is temporary. I don't really know what it's for.
To AUTHORS.md, add Jussi Leinonen due to his parallax contributions. Also add affiliation for DWD authors (request from DWD).
Add unit tests for the low-level parallax_correct function, according to an interface I believe it should have, but that it doesn't have. Most of the unit tests are failing. The higher level class is not unit tested yet because I don't understand what it's supposed to do exactly. Probably much of it needs to be deleted.
Add more unit tests for the parallax correction. Started with unit tests for the class. They're failing, but I don't know why.
Remove some unused code. Will remove more later.
My understanding so far. Consider:
The forward parallax correction can calculate that for position A", a cloud seen at height h is in reality position A, and that at location A, a cloud at height h is in reality at location A'. We can create a
This reassignment of pixels, if I understand correctly, is done by this PR by calculating an inverse transformation using a convolution (I don't understand the details yet here), resampling to this, and then reassigning the original base area: corrector = ParallaxCorrection(base_area)
plax_corr_area = corrector(cloud_top_height) # SwathDefinition of same size as base_area
local_scene = global_scene.resample(plax_corr_area)
local_scene[some_dataset].attrs["area"] = base_area This somewhat abuses the concept of resampling and I don't understand it fully yet, but it appears to work for a high resolution area, as the images in the previous comment show... Thoughts welcome! |
Add another parallax correction unit test that uses a much tighter area.
I pushed an alternative implementation as Changes:
Things remaining to do/consider:
|
Merge the simplification and improvement from the previous commit by Jussi back into parallax.py, and delete the unused and unneedded projection.py as well as an unused convolve import.
Parameterise some of the fixtures used in the parallax unit tests. Still needs some more testing but we're making progress.
We also need to test what happens at the antimeridian. And at the poles? Although most critical for geostationary applications in (northern) Europe, people may want to use it for polar orbiters too. |
Add more unit tests for the parallax correction, or rather more parameters to use in the unit tests. The parallax correction fails at the antimeridian.
In the parallax correction documentation, describe the version when it was added in the text.
Put the note on units in the docstring rather than in a comment.
In docstrings, write out the word "degrees" rather than using the symbol "°".
Add some more flexibility in the ParallaxCorrection class.
Allow user to set the radii of influence in the two nearest neighbour resampling steps in the parallax correction.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just have three minor comments (on top of the one left from before), then I think we can merge. Great job!
Remove a duplicate line from the modifiers documentation. Change the maybe_attempt_tle parameter in ``utils.get_satpos`` to ``use_tle``.
In test_utils, adapt unit test for the changed parameter name in get_satpos.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Simplify the documentation for the forward_parallax function based on a suggestion by @ghiggi.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @gerritholl. Here are the other comments. I forgot to submit the review :P
Add utility function for parallax displacement, as suggested by @ghiggi. Rename the function `forward_parallax` to be called `get_parallax_corrected_lonlats`. Various smaller edits/changes in documentation and variable names.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
ParallaxCorrectionModifier
It. is. done. 🎉 |
Thank you @gerritholl for driving this to its completion, and thanks to everyone involved for taking the time to make this PR better! |
Add a parallax correction to Satpy.
This is a team effort based on work by Simon Proud (@simonrp84), Xin Zhang (@zxdawn), Ulrich Hamann (@uhamann), Jussi Leinonen (@jleinonen), myself, and others.
We have made good progress during the Pytroll Contributor Week 29 November - 3 December 2021. More work was done in December 2021 and January 2022.
AUTHORS.md
if not there alreadyParallaxCorrectionModifier
#1904 (comment).Deferred:
benchmark
directory?) with real scenes (could be a different PR)