From 74ba39b490a92596bcb5f5ca733d27ead43136e3 Mon Sep 17 00:00:00 2001 From: Paul Thevenon Date: Tue, 26 May 2026 23:33:10 +0200 Subject: [PATCH 1/4] - revert to 1s search for first epoch, as INTERVAL is an optional RINEX header --- src/prx/user.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/prx/user.py b/src/prx/user.py index 24a4154..e7d7da1 100644 --- a/src/prx/user.py +++ b/src/prx/user.py @@ -244,7 +244,7 @@ def bootstrap_coarse_receiver_position(filepath_obs, filepath_nav): n_obs = len(obs.sv.values) else: n_obs = 0 - first_epoch = first_epoch + pd.Timedelta(seconds=obs.interval) + first_epoch = first_epoch + pd.Timedelta(seconds=1) time_of_flight = [ pd.Timedelta( From f096330d86fc61c766a2f0e2df60818b7e3e291d Mon Sep 17 00:00:00 2001 From: Paul Thevenon Date: Wed, 27 May 2026 00:06:07 +0200 Subject: [PATCH 2/4] - drop missing measurement --- src/prx/user.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/prx/user.py b/src/prx/user.py index e7d7da1..1c4a849 100644 --- a/src/prx/user.py +++ b/src/prx/user.py @@ -308,7 +308,7 @@ def bootstrap_coarse_receiver_position(filepath_obs, filepath_nav): ], how="left", on="sv", - ) + ).dropna() obs_df = obs_df.rename(columns={"observation_value": "C_obs_m"}) # add missing columns with 0 value, since approximate position is unknown obs_df = pd.concat( @@ -316,9 +316,9 @@ def bootstrap_coarse_receiver_position(filepath_obs, filepath_nav): obs_df, pd.DataFrame( { - "sagnac_effect_m": np.zeros(len(obs.sv)), - "iono_delay_m": np.zeros(len(obs.sv)), - "tropo_delay_m": np.zeros(len(obs.sv)), + "sagnac_effect_m": np.zeros(len(obs_df)), + "iono_delay_m": np.zeros(len(obs_df)), + "tropo_delay_m": np.zeros(len(obs_df)), "constellation": "G", } ), From 16b7cfcaf4fbdd14a9be958bce48a72171d8ea2d Mon Sep 17 00:00:00 2001 From: Paul Thevenon Date: Fri, 29 May 2026 00:53:14 +0200 Subject: [PATCH 3/4] format --- src/prx/user.py | 48 ++++++++++++++++++++++++++---------------------- 1 file changed, 26 insertions(+), 22 deletions(-) diff --git a/src/prx/user.py b/src/prx/user.py index 1c4a849..41aac3a 100644 --- a/src/prx/user.py +++ b/src/prx/user.py @@ -284,31 +284,35 @@ def bootstrap_coarse_receiver_position(filepath_obs, filepath_nav): ) # create obs df by merging query and sat_states - obs_df = query[ - [ - "time_of_reception_in_receiver_time", - "sv", - "observation_value", - ] - ].merge( - sat_states[ + obs_df = ( + query[ [ - "sat_code_bias_m", - "sat_clock_offset_m", - "sat_clock_drift_mps", + "time_of_reception_in_receiver_time", "sv", - "sat_pos_x_m", - "sat_pos_y_m", - "sat_pos_z_m", - "sat_vel_x_mps", - "sat_vel_y_mps", - "sat_vel_z_mps", - "relativistic_clock_effect_m", + "observation_value", ] - ], - how="left", - on="sv", - ).dropna() + ] + .merge( + sat_states[ + [ + "sat_code_bias_m", + "sat_clock_offset_m", + "sat_clock_drift_mps", + "sv", + "sat_pos_x_m", + "sat_pos_y_m", + "sat_pos_z_m", + "sat_vel_x_mps", + "sat_vel_y_mps", + "sat_vel_z_mps", + "relativistic_clock_effect_m", + ] + ], + how="left", + on="sv", + ) + .dropna() + ) obs_df = obs_df.rename(columns={"observation_value": "C_obs_m"}) # add missing columns with 0 value, since approximate position is unknown obs_df = pd.concat( From 092789b3577e9b0694184dbd8c24c9983636cc7e Mon Sep 17 00:00:00 2001 From: Paul Thevenon Date: Mon, 1 Jun 2026 09:36:36 +0200 Subject: [PATCH 4/4] review --- src/prx/user.py | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/src/prx/user.py b/src/prx/user.py index 41aac3a..10b98b7 100644 --- a/src/prx/user.py +++ b/src/prx/user.py @@ -315,23 +315,11 @@ def bootstrap_coarse_receiver_position(filepath_obs, filepath_nav): ) obs_df = obs_df.rename(columns={"observation_value": "C_obs_m"}) # add missing columns with 0 value, since approximate position is unknown - obs_df = pd.concat( - [ - obs_df, - pd.DataFrame( - { - "sagnac_effect_m": np.zeros(len(obs_df)), - "iono_delay_m": np.zeros(len(obs_df)), - "tropo_delay_m": np.zeros(len(obs_df)), - "constellation": "G", - } - ), - ], - axis=1, - ) + obs_df["sagnac_effect_m"] = 0 + obs_df["iono_delay_m"] = 0 + obs_df["tropo_delay_m"] = 0 + obs_df["constellation"] = "G" - solution = spp_pt_lsq( - obs_df, - ) + solution = spp_pt_lsq(obs_df) return solution[0:3].squeeze()