From eaa7a8b27cd4aed30ac5dd635407717d8dafeb99 Mon Sep 17 00:00:00 2001 From: Eugene Du Date: Fri, 27 Sep 2024 02:29:51 +0000 Subject: [PATCH] Enable option for epochwise hlm or not in sp3_difference --- gnssanalysis/gn_diffaux.py | 4 +++- gnssanalysis/gn_io/sp3.py | 8 ++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/gnssanalysis/gn_diffaux.py b/gnssanalysis/gn_diffaux.py index 3ed84a0..c1807ca 100644 --- a/gnssanalysis/gn_diffaux.py +++ b/gnssanalysis/gn_diffaux.py @@ -710,6 +710,7 @@ def sp3_difference( test_sp3_file: _Path, svs: list[str], orb_hlm_mode: Literal[None, "ECF", "ECI"] = None, + epochwise_hlm: bool = False, clk_norm_types: list = [], ) -> _pd.DataFrame: """ @@ -720,6 +721,7 @@ def sp3_difference( :param _Path test_sp3_file: Path of the test SP3 file :param list[str] svs: List of satellites to process :param str orb_hlm_mode: Helmert transformation to apply to orbits. Can be None, "ECF", or "ECI". + :param bool epochwise_hlm: Epochwise HLM transformation. :param list clk_norm_types: Normalizations to apply to clocks. Available options include 'epoch', 'daily', 'sv', any satellite PRN, or any combination of them, defaults to empty list :return _pd.DataFrame: The Pandas DataFrame containing orbit and clock differences @@ -736,7 +738,7 @@ def sp3_difference( diff_est_df = test_sp3_df.loc[common_indices, "EST"] - base_sp3_df.loc[common_indices, "EST"] diff_xyz_df = diff_est_df.drop(columns=["CLK"]) * 1e3 - diff_rac_df = _gn_io.sp3.diff_sp3_rac(base_sp3_df, test_sp3_df, hlm_mode=orb_hlm_mode) # TODO Eugene: compare orbits by constellation + diff_rac_df = _gn_io.sp3.diff_sp3_rac(base_sp3_df, test_sp3_df, hlm_mode=orb_hlm_mode, epochwise_hlm=epochwise_hlm) # TODO Eugene: compare orbits by constellation diff_rac_df.columns = diff_rac_df.columns.droplevel(0) diff_rac_df = diff_rac_df * 1e3 diff --git a/gnssanalysis/gn_io/sp3.py b/gnssanalysis/gn_io/sp3.py index e918825..dbda862 100644 --- a/gnssanalysis/gn_io/sp3.py +++ b/gnssanalysis/gn_io/sp3.py @@ -847,8 +847,8 @@ def diff_sp3_rac( sp3_baseline: _pd.DataFrame, sp3_test: _pd.DataFrame, hlm_mode: Literal[None, "ECF", "ECI"] = None, + epochwise_hlm: bool = False, use_cubic_spline: bool = True, - epochwise: bool = False, ) -> _pd.DataFrame: """ Computes the difference between the two sp3 files in the radial, along-track and cross-track coordinates. @@ -856,8 +856,8 @@ def diff_sp3_rac( :param DataFrame sp3_baseline: The baseline sp3 DataFrame. :param DataFrame sp3_test: The test sp3 DataFrame. :param string hlm_mode: The mode for HLM transformation. Can be None, "ECF", or "ECI". + :param bool epochwise_hlm: Epochwise HLM transformation. :param bool use_cubic_spline: Flag indicating whether to use cubic spline for velocity computation. - :param bool epochwise: Epochwise orbit comparison. :return: The DataFrame containing the difference in RAC coordinates. """ hlm_modes = [None, "ECF", "ECI"] @@ -873,11 +873,11 @@ def diff_sp3_rac( hlm = None # init hlm var if hlm_mode == "ECF": - sp3_test, hlm = sp3_hlm_trans(sp3_baseline, sp3_test, epochwise) + sp3_test, hlm = sp3_hlm_trans(sp3_baseline, sp3_test, epochwise_hlm) sp3_baseline_eci = _gn_transform.ecef2eci(sp3_baseline) sp3_test_eci = _gn_transform.ecef2eci(sp3_test) if hlm_mode == "ECI": - sp3_test_eci, hlm = sp3_hlm_trans(sp3_baseline_eci, sp3_test_eci, epochwise) + sp3_test_eci, hlm = sp3_hlm_trans(sp3_baseline_eci, sp3_test_eci, epochwise_hlm) diff_eci = sp3_test_eci - sp3_baseline_eci