From 4cbe12d01aabe99ddc52dcf8baad9d681729e4c7 Mon Sep 17 00:00:00 2001 From: Marc Trachy Date: Wed, 29 Jul 2026 13:58:59 +0000 Subject: [PATCH] Tx antenna PVPs with NaNs --- CHANGELOG.md | 1 + sarkit/verification/_cphd_consistency.py | 18 ++++++++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0bfeba8..eefa7cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Warnings logged when not all CRSD support arrays written +- Allow NaN in TxACX, TxACY, TxEB PVPs to indicate no transmit pulse for the vector ## [1.10.0] - 2026-06-25 diff --git a/sarkit/verification/_cphd_consistency.py b/sarkit/verification/_cphd_consistency.py index 0429040..e560502 100644 --- a/sarkit/verification/_cphd_consistency.py +++ b/sarkit/verification/_cphd_consistency.py @@ -925,13 +925,17 @@ def check_tx_acxy(self, channel_id, channel_node): pvp = self._get_channel_pvps(channel_id) assert {"TxACX", "TxACY"}.issubset(pvp.dtype.names) with self.need("TxACX is unit length"): - assert np.linalg.norm(pvp["TxACX"], axis=-1) == con.Approx(1.0) + assert np.nan_to_num( + np.linalg.norm(pvp["TxACX"], axis=-1), nan=1.0 + ) == con.Approx(1.0) with self.need("TxACY is unit length"): - assert np.linalg.norm(pvp["TxACY"], axis=-1) == con.Approx(1.0) + assert np.nan_to_num( + np.linalg.norm(pvp["TxACY"], axis=-1), nan=1.0 + ) == con.Approx(1.0) with self.need("TxACX and TxACY are orthogonal"): - assert np.vecdot(pvp["TxACX"], pvp["TxACY"]) == con.Approx( - 0.0, atol=1e-6 - ) + assert np.nan_to_num( + np.vecdot(pvp["TxACX"], pvp["TxACY"]), nan=0.0 + ) == con.Approx(0.0, atol=1e-6) @per_channel def check_txeb(self, channel_id, channel_node): @@ -940,7 +944,9 @@ def check_txeb(self, channel_id, channel_node): pvp = self._get_channel_pvps(channel_id) assert "TxEB" in pvp.dtype.names with self.need("TxEB is less than unit length"): - assert np.linalg.norm(pvp["TxEB"], axis=-1) <= con.Approx(1.0) + assert np.nan_to_num( + np.linalg.norm(pvp["TxEB"], axis=-1), nan=0.0 + ) <= con.Approx(1.0) @per_channel def check_rcv_acxy(self, channel_id, channel_node):