Skip to content

Commit

Permalink
Enable option for epochwise hlm or not in sp3_difference
Browse files Browse the repository at this point in the history
  • Loading branch information
EugeneDu-GA committed Sep 27, 2024
1 parent c859fdc commit eaa7a8b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 3 additions & 1 deletion gnssanalysis/gn_diffaux.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
"""
Expand All @@ -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
Expand All @@ -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

Expand Down
8 changes: 4 additions & 4 deletions gnssanalysis/gn_io/sp3.py
Original file line number Diff line number Diff line change
Expand Up @@ -847,17 +847,17 @@ 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.
: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"]
Expand All @@ -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

Expand Down

0 comments on commit eaa7a8b

Please sign in to comment.