This is a small PR with a very small code change. It relates to the output files in the velocity_dir where the Y-intercept file linear_intercept.tif is not sign-reversed like the other output files when the user set config parameter signal_polarity: -1 is set.
A part of the PyRate output is a GeoTIFF of Y-Intercept values (linear_intercept.tif) for each pixel to accompany the GeoTIFF containing rate values estimated by PyRate from the per pixel cumulative time series.
There is an option in PyRate configuration file to reverse the sign of the line-of-sight values so that the time series makes physical sense signal_polarity: -1.
The sign change occurs in the merge step and seems to operate only on the time series data and the rate output but not on the Y-Intercept output.
This means that when users are plotting PyRate results, there is a mismatch between the Rate and Y-Intercept.
Recommended Review Strategy
This is a very small PR, so just looking at the code change might suffice if you wish. Otherwise, you could run some tests by turning signal_polarity to 1 and -1 respectively and compare to make sure that linear_intercept.tif has opposite signs in each case.
Expected Behavior
When the signal_polarity: -1 option applied, the change of sign should work consistently across all outputs.
Solution
I have simply added the linear_intercept array to the list of files that the sign change occurs on.
Currently the LOS projection and the signal polarity change all occur in the same equation for all conditional options.
Ideally I would restructure the code in this section to simplify the LOS projections and signal polarity conversion by separating these so it is easier to track what is happening (this is out of scope for this quick-fix PR).
See below on line 325 where currently the LOS projection and sign conversion happen:
This is a small PR with a very small code change. It relates to the output files in the
velocity_dir
where the Y-intercept filelinear_intercept.tif
is not sign-reversed like the other output files when the user set config parametersignal_polarity: -1
is set.See this issue for more details: https://github.com/GeoscienceAustralia/PyRate/issues/353
Description
linear_intercept.tif
) for each pixel to accompany the GeoTIFF containing rate values estimated by PyRate from the per pixel cumulative time series.signal_polarity: -1
.Recommended Review Strategy This is a very small PR, so just looking at the code change might suffice if you wish. Otherwise, you could run some tests by turning
signal_polarity
to1
and-1
respectively and compare to make sure thatlinear_intercept.tif
has opposite signs in each case.Expected Behavior When the signal_polarity: -1 option applied, the change of sign should work consistently across all outputs.
Solution I have simply added the
linear_intercept
array to the list of files that the sign change occurs on.In Summary
Old Code: https://github.com/GeoscienceAustralia/PyRate/blob/8203989e7d9b675491e79610cff04728d8dc3973/pyrate/merge.py#L282
New Code: https://github.com/GeoscienceAustralia/PyRate/blob/2a2451858561e2dc17c0d318cd588ed9d3b22b9b/pyrate/merge.py#L282
Additional Notes
https://github.com/GeoscienceAustralia/PyRate/blob/8203989e7d9b675491e79610cff04728d8dc3973/pyrate/merge.py#L290-L328