Skip to content

Conversation

@rad-eng-59
Copy link
Contributor

This PR computes frequency-dependent polarization-dependent RX channels imbalances and incorporate them into RX DBF process of pattern.py module as part EAP in RSLC workflow.

By adding this feature:

  1. Residual RX channel imbalances, both phase and magnitude, after applying Caltone is taken into account prior to DBF which leads to proper EL-dependent radiometric correction when EAP=ON in RSLC science products.
  2. Detect and remove undesired phase jumps due to delay/clock anomaly in one qFSP out of three showing up as an outlier. This will correct for undesired instrument-related phase jump within the swath between two passes in InSAR workflow.

Disclaimer: Not yet fully tested over a pair of L0Bs with phase jump issue!

Copy link
Contributor

@Tyler-g-hudson Tyler-g-hudson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some code organization and documentation commentary

Comment on lines +199 to +200
# XXX perhaps Caltone frequency can be parsed from L0B DRT
# rather than provided as an input!
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is resolving this within the scope of this PR, or would we need to wait until later?

self.finder[rxpol] = TimingFinder(self.pulse_times, rd_all[rxpol],
wd_all[rxpol], wl_all[rxpol])
wd_all[rxpol], wl_all[rxpol])
# XXX get range delay offset for band B in split-spectrum to
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this explanatory comment marked with XXX?



@dataclass(frozen=True)
class RX_CHANNEL_IMBALANCE_PRODUCT:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
class RX_CHANNEL_IMBALANCE_PRODUCT:
class RxChannelImbalanceProduct:

All-caps names like these are typically reserved for constants in Python, is there a reason why you named the class in this way?

time_delays_sec: np.ndarray
max_amp_ratio: float

def __post_init__(self):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe check the array dtypes here to ensure they're complex/int/float respectively?

Comment on lines +38 to +39
# XXX Size of all arrays must be 12 for L-band NISAR but
# not enforced due to failure of special cases such as unit test
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe warn if this isn't the case?

caltone_freq = parse_caltone_freq_from_drt(raw, txrx_pol)
warn(f'Caltone frequency is extracted from {txrx_pol[1]}-pol DRT '
f'-> {caltone_freq * 1e-6:.3f} (MHz)')
# XXX check if product from the second band so we can modify
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This appears to be a descriptive comment, why is it marked with # XXX?

lna_caltone_ratio, dif_chirp_caltone_freq)
if _is_product_from_second_band(raw, freq_band, txrx_pol):
warn(f'correcting LNA/CALTONE for band={freq_band} and pol={txrx_pol}')
# if there is then get diff of frequency bands A dn B
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# if there is then get diff of frequency bands A dn B
# if there is then get diff of frequency bands A and B

Comment on lines +321 to +325
if freq_band == "B" and len(raw.frequencies) == 2:
if txrx_pol in raw.polarizations['A']:
return True
return False
return False
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if freq_band == "B" and len(raw.frequencies) == 2:
if txrx_pol in raw.polarizations['A']:
return True
return False
return False
if freq_band == "B" and len(raw.frequencies) == 2:
if txrx_pol in raw.polarizations['A']:
return True
return False

Nitpick: Only one return False is necessary since the code will exit the conditional block anyway

Comment on lines +333 to +335
get time delays for a qfSP with phase anomaly only for
12 channel NISAR L-band product.
For other case, it will be set to zero!
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
get time delays for a qfSP with phase anomaly only for
12 channel NISAR L-band product.
For other case, it will be set to zero!
If the product is a 12-channel NISAR L-band product,
return the time delays for a qFSP with phase anomaly.
Else, return zeros.

Comment on lines +379 to +381
# XXX to avoid unit test failure and old sim L0B
# a warning will be issued and all values will be set
# to unity!
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar concern to other XXX comments - is this behavior undesirable? Do we intend to change it later?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants