PyRate icon indicating copy to clipboard operation
PyRate copied to clipboard

Bug: pixels at reference area location are masked out.

Open adeane-ga opened this issue 4 years ago • 1 comments

Problem To place all interferograms in reference to a common area, a reference pixel is chosen so that the phase from this pixel is subtracted from the whole interferogram. A kernal is used for this, where the median phase of the kernal is used as the value to subtract from the interferogram.

  • This subtraction will rightfully make the pixels in the kernal area equal to 0 (as expected).
  • Unrelated, and during the correct step, there is a module that implements Atmospheric Phase Screen (APS) correction. The algorithm in this module relies on complete 2D data (no NaNs).
  • In the APS module NaNs are converted to 0.0 for this step.
  • But after completed, all pixels that are 0.0 are converted back to NaNs (masking).
  • Unfortunately, this includes pixels within the reference area because their value was legitimately 0.0 due to the reference phase subtraction.
  • This results in the reference area having pixels that are masked when they should not be,

Visual example:

image

This is currently only occurring with higher resolution processing. But could be occurring elsewhere.

adeane-ga avatar Oct 18 '21 06:10 adeane-ga

This is a persistent issue, first noted by @chandra2ga in multi-looked data analysis.

The easiest fix is in the APS module - keep an array that marks the location of NaNs prior to zero conversion and then use this to re-insert the NaNs in the output after APS filtering. This should then not affect the reference pixel area.

mcgarth avatar Oct 29 '21 04:10 mcgarth