Skip to content

Commit

Permalink
Merge branch 'main' into bug_sat_code_bias_discontinuity
Browse files Browse the repository at this point in the history
  • Loading branch information
plutonheaven authored Dec 6, 2024
2 parents 216e5d4 + f592d85 commit 0979305
Show file tree
Hide file tree
Showing 6 changed files with 164 additions and 161 deletions.
291 changes: 146 additions & 145 deletions poetry.lock

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ imohash = "^1.1.0"
georinex = { git = "https://github.com/geospace-code/georinex.git", rev = "95ef1d8e7150f998a1b5a429090cadb429128648" }
flake8 = "^7.1.1"
dotmap = "^1.3.30"
pytest = "^8.3.3"
pytest = "^8.3.4"
gitpython = "^3.1.41"
scipy = "^1.14.1"
matplotlib = "^3.9.2"
matplotlib = "^3.9.3"
pytest-xdist = "^3.5.0"
ruff = "^0.7.4"
ruff = "^0.8.1"
snakeviz = "^2.2.2"
astropy = "^6.1.6"
setuptools = "^75.5.0"
viztracer = "^0.17.1"
astropy = "^6.1.7"
setuptools = "^75.6.0"
viztracer = "^1.0.0"
plotly = "^5.24.1"
line-profiler = "^4.1.3"
requests = "^2.32.3"
Expand Down
4 changes: 2 additions & 2 deletions src/prx/atmospheric_corrections.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import prx.constants as constants


def compute_klobuchar_l1_correction(
def compute_l1_iono_delay_klobuchar(
tow_s, gps_a, gps_b, elevation_rad, azimuth_rad, lat_user_rad, lon_user_rad
):
"""compute the ionospheric corrections using the Klobuchar model
Expand Down Expand Up @@ -80,7 +80,7 @@ def compute_klobuchar_l1_correction(
return iono_correction_l1_m


def compute_unb3m_correction(
def compute_tropo_delay_unb3m(
latitude_user_rad, height_user_m, day_of_year, elevation_sat_rad
):
# This function is the python version of the matlab function UNB3M.m provided in the UNB3m_pack [1]
Expand Down
4 changes: 2 additions & 2 deletions src/prx/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ def build_records(
__,
__,
__,
) = atmo.compute_unb3m_correction(
) = atmo.compute_tropo_delay_unb3m(
latitude_user_rad * np.ones(days_of_year.shape),
height_user_m * np.ones(days_of_year.shape),
days_of_year,
Expand Down Expand Up @@ -485,7 +485,7 @@ def assign_carrier_frequencies(flat_obs):
flat_obs.loc[
mask,
"iono_delay_m",
] = -atmo.compute_klobuchar_l1_correction(
] = atmo.compute_l1_iono_delay_klobuchar(
time_of_emission_weeksecond_isagpst,
nav_header_dict[f"{year:03d}" + f"{doy:03d}"]["IONOSPHERIC CORR"][
"GPSA"
Expand Down
12 changes: 6 additions & 6 deletions src/prx/test/test_atmospheric_corrections.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ def test_get_klobuchar_parameters_from_rinex3(rnx3_input_for_test):
assert (gps_b == gps_b_expected).all()


def test_klobuchar_correction():
def test_klobuchar_delay():
threshold_iono_error_m = 0.001

# expected iono correction
iono_corr_magnitude = np.array(
iono_delay_magnitude = np.array(
[
[
3.11827805725116,
Expand Down Expand Up @@ -262,11 +262,11 @@ def test_klobuchar_correction():
)

# compute iono correction from Klobuchar model
iono_corr = atmo.compute_klobuchar_l1_correction(
iono_delay = atmo.compute_l1_iono_delay_klobuchar(
tow_s, gps_a, gps_b, el_s_rad, az_s_rad, lat_u_rad, lon_u_rad
)

assert np.max(np.fabs(iono_corr - iono_corr_magnitude)) < threshold_iono_error_m
assert (iono_delay > 0).all()
assert np.max(np.fabs(iono_delay - iono_delay_magnitude)) < threshold_iono_error_m


def test_unb3m_corrections():
Expand All @@ -292,6 +292,6 @@ def test_unb3m_corrections():
tropo_hydrostatic_mapping,
tropo_zwd_m,
tropo_wet_mapping,
) = atmo.compute_unb3m_correction(lat_rad, height_m, day_of_year, elevation_rad)
) = atmo.compute_tropo_delay_unb3m(lat_rad, height_m, day_of_year, elevation_rad)

assert (np.abs(tropo_delay_m - tropo_expected[:, 8]) < tol).all()
2 changes: 2 additions & 0 deletions src/prx/test/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,8 @@ def run_rinex_through_prx(rinex_obs_file: Path):

def test_spp_lsq_nist(input_for_test_nist):
df, metadata = run_rinex_through_prx(input_for_test_nist)
assert (df.iono_delay_m > 0).all()
assert (df.tropo_delay_m > 0).all()
df["sv"] = df["constellation"].astype(str) + df["prn"].astype(str)
df_first_epoch = df[
df.time_of_reception_in_receiver_time
Expand Down

0 comments on commit 0979305

Please sign in to comment.