Closed adeane-ga closed 2 years ago
I have tested this feature with varying combinations of cropping and reference pixel options. Happy to merge this.
Initially I had an issue in the stacking step which implied that the cropping wasn't working correctly but a clean reinstall managed to fix this. Other users weren't able to recreate this.
IndexError: boolean index did not match indexed array along dimension 1; dimension is 60 but corresponding boolean dimension is 50
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: https://github.com/GeoscienceAustralia/PyRate/issues/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: https://github.com/GeoscienceAustralia/PyRate/blob/8203989e7d9b675491e79610cff04728d8dc3973/pyrate/core/refpixel.py#L389-L411
New code: https://github.com/GeoscienceAustralia/PyRate/blob/73a0d7572f4b785b47f7847890a1c38e06f2eeb9/pyrate/core/refpixel.py#L390-L419