GeoscienceAustralia / PyRate

A Python tool for estimating velocity and time-series from Interferometric Synthetic Aperture Radar (InSAR) data.
https://geoscienceaustralia.github.io/PyRate/
Apache License 2.0
203 stars 71 forks source link

Fix wrong sign in Y-intercept output file #368

Closed adeane-ga closed 2 years ago

adeane-ga commented 2 years ago

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.

See this issue for more details: https://github.com/GeoscienceAustralia/PyRate/issues/353

Description

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.

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

adeane-ga commented 2 years ago

I have broken a test, I will fix this and rerun CI.

adeane-ga commented 2 years ago

Tests passed, good to go.

s-m-t-c commented 2 years ago

Looks good, thanks Al.