diff --git a/python/packages/nisar/antenna/beamformer.py b/python/packages/nisar/antenna/beamformer.py index 4acc7cf9b..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