Change so reference pixel is validated in function rather than callin… #357
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 pull request contains a simple change in the way PyRate validates the custom (user defined) reference pixel location.
Caveat: There was no test originally, so this issue was not picked up. I have also not created a test yet. I will aim to do that either before or after this gets merged.
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 410 in d7222c2
New Code:
PyRate/pyrate/core/refpixel.py
Lines 390 to 419 in 4aae0b9