From 1cb214febcd104f1755bc9182497c6298cf78964 Mon Sep 17 00:00:00 2001 From: Brian Hawkins <1729052+bhawkins@users.noreply.github.com> Date: Thu, 4 Jun 2026 12:54:50 -0700 Subject: [PATCH 1/2] handle cases where first pulse isn't BCAL --- python/packages/nisar/antenna/beamformer.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/python/packages/nisar/antenna/beamformer.py b/python/packages/nisar/antenna/beamformer.py index 4acc7cf9b..582f74485 100644 --- a/python/packages/nisar/antenna/beamformer.py +++ b/python/packages/nisar/antenna/beamformer.py @@ -828,6 +828,12 @@ def compute_transmit_pattern_weights(tx_trm_info, norm=False): tx_weights[bcal_lines_idx[-1], 0]) tx_weights[bcal_lines_idx[-1]:] /= bcal_rel + # handle case where first line isn't BCAL + bcal_rel = (tx_weights[bcal_lines_idx[0]] / + tx_weights[bcal_lines_idx[0], 0]) + tx_weights[:bcal_lines_idx[0]] /= bcal_rel + + # Now fill in noise-only range lines with nearest neighbor values # from HCAL ones func_nearest = interp1d(hcal_lines_idx, tx_weights[hcal_lines_idx], From c10b384dc8027a93c40f5659ce6424620d07e0c0 Mon Sep 17 00:00:00 2001 From: Brian P Hawkins <1729052+bhawkins@users.noreply.github.com> Date: Thu, 4 Jun 2026 21:18:07 +0000 Subject: [PATCH 2/2] Handle initial BCAL case before over-writing it. --- python/packages/nisar/antenna/beamformer.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/python/packages/nisar/antenna/beamformer.py b/python/packages/nisar/antenna/beamformer.py index 582f74485..bea3a5a05 100644 --- a/python/packages/nisar/antenna/beamformer.py +++ b/python/packages/nisar/antenna/beamformer.py @@ -815,6 +815,11 @@ def compute_transmit_pattern_weights(tx_trm_info, norm=False): if np.isclose(abs(tx_weights[bcal_lines_idx]).min(), 0): raise RuntimeError('Zero-value BCAL data is encountered!') + # handle case where first line isn't BCAL + bcal_rel = (tx_weights[bcal_lines_idx[0]] / + tx_weights[bcal_lines_idx[0], 0]) + tx_weights[:bcal_lines_idx[0]] /= bcal_rel + for line_start, line_stop in zip(bcal_lines_idx[:-1], bcal_lines_idx[1:]): # normalize BCAL wrt to the first TX channel to get relative @@ -828,12 +833,6 @@ def compute_transmit_pattern_weights(tx_trm_info, norm=False): tx_weights[bcal_lines_idx[-1], 0]) tx_weights[bcal_lines_idx[-1]:] /= bcal_rel - # handle case where first line isn't BCAL - bcal_rel = (tx_weights[bcal_lines_idx[0]] / - tx_weights[bcal_lines_idx[0], 0]) - tx_weights[:bcal_lines_idx[0]] /= bcal_rel - - # Now fill in noise-only range lines with nearest neighbor values # from HCAL ones func_nearest = interp1d(hcal_lines_idx, tx_weights[hcal_lines_idx],