From 8a8dc347830959d48af3bcec47a7341a5a327209 Mon Sep 17 00:00:00 2001 From: Nathan <95725385+treefern@users.noreply.github.com> Date: Thu, 6 Mar 2025 07:27:16 +0000 Subject: [PATCH] NPI-3793 Fix misleading and likely invalid operator use in set operations, plus add clarifying comment for some Numpy custom operator usage --- gnssanalysis/gn_diffaux.py | 2 +- gnssanalysis/gn_io/sinex.py | 2 +- gnssanalysis/gn_utils.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gnssanalysis/gn_diffaux.py b/gnssanalysis/gn_diffaux.py index a90a116..1240d17 100644 --- a/gnssanalysis/gn_diffaux.py +++ b/gnssanalysis/gn_diffaux.py @@ -472,7 +472,7 @@ def sisre( _logging.info(msg="plotting RAC difference") _gn_plot.racplot(rac_unstack=rac_unstack, output=plot if isinstance(plot, str) else None) - if (clk_a is not None) & (clk_b is not None): # check if clk data is present + if (clk_test is not None) and (clk_baseline is not None): # check if clk data is present clk_diff = ( compare_clk( clk_a, clk_b, norm_types=norm_types, ext_dt=rac_unstack.index, ext_svs=rac_unstack.columns.levels[1] diff --git a/gnssanalysis/gn_io/sinex.py b/gnssanalysis/gn_io/sinex.py index 1100c72..ce22c9a 100644 --- a/gnssanalysis/gn_io/sinex.py +++ b/gnssanalysis/gn_io/sinex.py @@ -845,7 +845,7 @@ def llh2snxdms(llh): ll_stack = _pd.concat([llh_degminsec_df.LON, llh_degminsec_df.LAT], axis=0) ll_stack = ll_stack.D.str.rjust(4).values + ll_stack.M.str.rjust(3).values + ll_stack.S.str.rjust(5).values buf = ll_stack[:n_rows] + ll_stack[n_rows:] + llh_degminsec_df.HEI.str.rjust(8).values - + # The following is a Numpy OR operator (not a standard Python bitwise OR): buf[(height > 8000) | (height < -2000)] = " 000 00 00.0 00 00 00.0 000.0" # | zero_mask return buf diff --git a/gnssanalysis/gn_utils.py b/gnssanalysis/gn_utils.py index bd76cb0..f46029f 100644 --- a/gnssanalysis/gn_utils.py +++ b/gnssanalysis/gn_utils.py @@ -467,7 +467,7 @@ def log2snx(logglob, rnxglob, outfile, frame_snx, frame_dis, frame_psd, datetime from .gn_io import igslog if isinstance(rnxglob, list): - if (len(rnxglob) == 1) & ( + if (len(rnxglob) == 1) and ( rnxglob[0].find("*") != -1 ): # it's rnx_glob expression (may be better to check if star is present) rnxglob = rnxglob[0]