Fix and simplify how user supplied reference pixel is validated #367
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a small PR that simplifies the way that the user supplied reference pixel is validated (confirmed to be within spatial extent). Without this fix, PyRate does not work if trying to crop in combination to supplying reference pixel coordinates - a very common user case.
It is associated with this issue: #360
Recommended Review Strategy
On your own testing dataset, run PyRate with the different combinations of cropping and user supplied reference pixel coordinates to confirm it is working for you and has also not broken anything.
The Problem
PyRate gives configuration options for the user to determine where the reference pixel will be
refx
andrefy
in longitude and latitude. There is also the option to crop the dataset with user defined coordinates so that PyRate only processes a smaller extent withifgcropopt: 3
. It is common for a user to use both of these options. The reference pixel selection is done during the correct step, whilst the cropping is conducted prior, in the prepifg step.refpix.py
called__validate_supplied_lat_lon()
. It is designed to confirm that the user supplied coordinates for the reference pixel are within the interferogram extent.get_analysis_extent()
which sits inside ofprepifg_helper.py
.It results in this error:
Solution
As the above user supplied cropping coordinates check is not relevant during this step, I have removed the call to the
get_analysis_extent()
from theprepifg_helper.py
and implemented a validation of the user supplied reference pixel by getting dataset extents independently from within the__validate_supplied_lat_lon()
function itself.In Summary
Old code:
PyRate/pyrate/core/refpixel.py
Lines 389 to 411 in 8203989
New code:
PyRate/pyrate/core/refpixel.py
Lines 390 to 419 in 73a0d75