Skip to content

Commit

Permalink
Trim down clk unit test data
Browse files Browse the repository at this point in the history
  • Loading branch information
EugeneDu-GA committed Sep 6, 2024
1 parent 68ae7cc commit 535eece
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 73 deletions.
22 changes: 11 additions & 11 deletions tests/test_clk.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ def test_clk_read(self):
clk_df_igs = clk.read_clk(clk_path=file_paths[0])
clk_df_gfz = clk.read_clk(clk_path=file_paths[1])

self.assertEqual(len(clk_df_igs), 124, msg="Check that data generally read into df as expected")
self.assertEqual(len(clk_df_gfz), 120, msg="Check that data generally read into df as expected")
self.assertEqual(len(clk_df_igs), 93, msg="Check that data generally read into df as expected")
self.assertEqual(len(clk_df_gfz), 90, msg="Check that data generally read into df as expected")
self.assertEqual(clk_df_igs.index[0][1], 760708800, msg="Check that first epoch is expressed correctly")
self.assertEqual(clk_df_gfz.index[0][1], 760708800, msg="Check that first epoch is expressed correctly")
self.assertEqual(clk_df_igs["EST"].iloc[0], 0.0001688124131169, msg="Check first datapoint is correct")
self.assertEqual(clk_df_gfz["EST"].iloc[0], 0.0001688146518940, msg="Check first datapoint is correct")
self.assertEqual(clk_df_igs["EST"].iloc[-1], -0.000610556369094, msg="Check last datapoint is correct")
self.assertEqual(clk_df_gfz["EST"].iloc[-1], -0.000610554231912, msg="Check last datapoint is correct")
self.assertEqual(clk_df_gfz["EST"].iloc[0], 0.000168814651894, msg="Check first datapoint is correct")
self.assertEqual(clk_df_igs["EST"].iloc[-1], -0.0006105557076344, msg="Check last datapoint is correct")
self.assertEqual(clk_df_gfz["EST"].iloc[-1], -0.000610553573006, msg="Check last datapoint is correct")

def test_compare_clk(self):
file_paths = ["/fake/dir/file0.clk", "/fake/dir/file1.clk"]
Expand All @@ -48,21 +48,21 @@ def test_compare_clk(self):
result_epoch_only = gn_diffaux.compare_clk(clk_a=clk_df_igs, clk_b=clk_df_gfz, norm_types=["epoch"])
result_sv_only = gn_diffaux.compare_clk(clk_a=clk_df_igs, clk_b=clk_df_gfz, norm_types=["sv"]) # G01 ref
result_G06 = gn_diffaux.compare_clk(clk_a=clk_df_igs, clk_b=clk_df_gfz, norm_types=["G06"])
result_all = gn_diffaux.compare_clk(clk_a=clk_df_igs, clk_b=clk_df_gfz, norm_types=["daily", "epoch", "G04"])
result_daily_epoch_G04 = gn_diffaux.compare_clk(clk_a=clk_df_igs, clk_b=clk_df_gfz, norm_types=["daily", "epoch", "G04"])
result_epoch_G07 = gn_diffaux.compare_clk(clk_a=clk_df_igs, clk_b=clk_df_gfz, norm_types=["epoch", "G07"])
result_daily_G08 = gn_diffaux.compare_clk(clk_a=clk_df_igs, clk_b=clk_df_gfz, norm_types=["daily", "G08"])
result_G09_G11 = gn_diffaux.compare_clk(clk_a=clk_df_igs, clk_b=clk_df_gfz, norm_types=["G09", "G11"])

# Test index is as expected
self.assertEqual(result_default.index[0], 760708800)
# Test that a sample value is as expected from each result above
self.assertEqual(result_default["G01"].iloc[0], -5.765210013022134e-12, msg="Check datapoint is correct")
self.assertEqual(result_daily_only["G03"].iloc[0], 3.630389999037531e-11, msg="Check datapoint is correct")
self.assertEqual(result_default["G01"].iloc[0], -4.56406886282918e-12, msg="Check datapoint is correct")
self.assertEqual(result_daily_only["G03"].iloc[0], 2.9891233314493365e-11, msg="Check datapoint is correct")
self.assertEqual(result_epoch_only["G04"].iloc[0], 2.7128617820053325e-12, msg="Check datapoint is correct")
self.assertEqual(result_sv_only["G05"].iloc[0], 1.1623200004470119e-10, msg="Check datapoint is correct")
self.assertEqual(result_G06["G06"].iloc[0], 0.0, msg="Check datapoint is correct")
self.assertEqual(result_all["G07"].iloc[0], 1.8542842513736592e-11, msg="Check datapoint is correct")
self.assertEqual(result_daily_epoch_G04["G07"].iloc[0], 1.3071733365871419e-11, msg="Check datapoint is correct")
self.assertEqual(result_epoch_G07["G08"].iloc[0], -3.3217389966032004e-11, msg="Check datapoint is correct")
self.assertEqual(result_daily_G08["G09"].iloc[-1], -1.823927510760659e-12, msg="Check datapoint is correct")
self.assertEqual(result_daily_G08["G09"].iloc[-1], 1.3818666534399365e-12, msg="Check datapoint is correct")
self.assertEqual(result_G09_G11["G11"].iloc[-1], 0.0, msg="Check datapoint is correct")
self.assertEqual(result_G09_G11["G01"].iloc[-1], 9.547399990820354e-11, msg="Check datapoint is correct")
self.assertEqual(result_G09_G11["G01"].iloc[-1], 8.94520000606358e-11, msg="Check datapoint is correct")
62 changes: 1 addition & 61 deletions tests/test_datasets/clk_test_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,37 +114,7 @@
AS G30 2024 02 09 00 10 0.000000 2 -4.350363429954e-04 2.131942441540e-11
AS G31 2024 02 09 00 10 0.000000 2 -2.277024601944e-04 1.328644624770e-11
AS G32 2024 02 09 00 10 0.000000 2 -6.105557076344e-04 1.769249605350e-11
AS G01 2024 02 09 00 15 0.000000 2 1.688137235940e-04 1.596660637360e-11
AS G03 2024 02 09 00 15 0.000000 2 1.809525669410e-04 1.340220091920e-11
AS G04 2024 02 09 00 15 0.000000 2 2.869801245460e-04 1.144642316460e-11
AS G05 2024 02 09 00 15 0.000000 2 -1.610891984260e-04 1.196805388960e-11
AS G06 2024 02 09 00 15 0.000000 2 4.144296101980e-04 1.806694486250e-11
AS G07 2024 02 09 00 15 0.000000 2 -5.740639300248e-05 1.509323941230e-11
AS G08 2024 02 09 00 15 0.000000 2 -1.661068319960e-04 2.129636993100e-11
AS G09 2024 02 09 00 15 0.000000 2 8.585309873352e-05 9.170569016020e-12
AS G10 2024 02 09 00 15 0.000000 2 -7.256809395108e-05 1.220554556870e-11
AS G11 2024 02 09 00 15 0.000000 2 -5.693209718500e-04 1.387732760100e-11
AS G12 2024 02 09 00 15 0.000000 2 -4.761137444880e-04 2.675386132300e-11
AS G13 2024 02 09 00 15 0.000000 2 6.237672339090e-04 1.393513105030e-11
AS G14 2024 02 09 00 15 0.000000 2 3.207395756580e-04 1.200389595510e-11
AS G15 2024 02 09 00 15 0.000000 2 1.257410000920e-04 1.586703179290e-11
AS G16 2024 02 09 00 15 0.000000 2 -3.667782020170e-04 8.828976408050e-12
AS G17 2024 02 09 00 15 0.000000 2 7.175766626740e-04 1.120953574690e-11
AS G18 2024 02 09 00 15 0.000000 2 -5.513573922370e-04 1.676817390440e-11
AS G19 2024 02 09 00 15 0.000000 2 4.380300556340e-04 1.076589892980e-11
AS G20 2024 02 09 00 15 0.000000 2 3.882165980450e-04 2.097682240230e-11
AS G21 2024 02 09 00 15 0.000000 2 1.356071246060e-04 1.435784194310e-11
AS G22 2024 02 09 00 15 0.000000 2 3.434852220662e-05 1.745583948080e-11
AS G23 2024 02 09 00 15 0.000000 2 1.521890348460e-04 1.472246162440e-11
AS G24 2024 02 09 00 15 0.000000 2 -4.285557356210e-04 1.883896437530e-11
AS G25 2024 02 09 00 15 0.000000 2 4.879975106290e-04 1.932941086560e-11
AS G26 2024 02 09 00 15 0.000000 2 1.921989092190e-04 1.147060818210e-11
AS G27 2024 02 09 00 15 0.000000 2 -2.340959874731e-06 1.916985023380e-11
AS G28 2024 02 09 00 15 0.000000 2 -1.247754306860e-04 2.378098361670e-11
AS G29 2024 02 09 00 15 0.000000 2 -6.073265100030e-04 1.122943718950e-11
AS G30 2024 02 09 00 15 0.000000 2 -4.350348588860e-04 1.907215367590e-11
AS G31 2024 02 09 00 15 0.000000 2 -2.277027375110e-04 1.580708131870e-11
AS G32 2024 02 09 00 15 0.000000 2 -6.105563690940e-04 1.707684061960e-11"""
"""

# second dataset is a truncated version of file GFZ0OPSRAP_20240400000_01D_05M_CLK.CLK
clk_test_data_truncated_gfz_rapid = b""" 3.00 C RINEX VERSION / TYPE
Expand Down Expand Up @@ -252,34 +222,4 @@
AS G30 2024 2 9 0 10 0.000000 1 -0.435033874242E-03
AS G31 2024 2 9 0 10 0.000000 1 -0.227700021100E-03
AS G32 2024 2 9 0 10 0.000000 1 -0.610553573006E-03
AS G01 2024 2 9 0 15 0.000000 1 0.168816014253E-03
AS G03 2024 2 9 0 15 0.000000 1 0.180954795343E-03
AS G04 2024 2 9 0 15 0.000000 1 0.286982426031E-03
AS G05 2024 2 9 0 15 0.000000 1 -0.161087023568E-03
AS G06 2024 2 9 0 15 0.000000 1 0.414431975012E-03
AS G07 2024 2 9 0 15 0.000000 1 -0.574040845527E-04
AS G08 2024 2 9 0 15 0.000000 1 -0.166104492753E-03
AS G09 2024 2 9 0 15 0.000000 1 0.858554613229E-04
AS G11 2024 2 9 0 15 0.000000 1 -0.569318585717E-03
AS G12 2024 2 9 0 15 0.000000 1 -0.476111286219E-03
AS G13 2024 2 9 0 15 0.000000 1 0.623769929104E-03
AS G14 2024 2 9 0 15 0.000000 1 0.320741819071E-03
AS G15 2024 2 9 0 15 0.000000 1 0.125743274278E-03
AS G16 2024 2 9 0 15 0.000000 1 -0.366775910845E-03
AS G17 2024 2 9 0 15 0.000000 1 0.717578972359E-03
AS G18 2024 2 9 0 15 0.000000 1 -0.551355149292E-03
AS G19 2024 2 9 0 15 0.000000 1 0.438032352044E-03
AS G20 2024 2 9 0 15 0.000000 1 0.388218720341E-03
AS G21 2024 2 9 0 15 0.000000 1 0.135609372944E-03
AS G22 2024 2 9 0 15 0.000000 1 0.343509390844E-04
AS G23 2024 2 9 0 15 0.000000 1 0.152191398767E-03
AS G24 2024 2 9 0 15 0.000000 1 -0.428553408229E-03
AS G25 2024 2 9 0 15 0.000000 1 0.488000004866E-03
AS G26 2024 2 9 0 15 0.000000 1 0.192201360859E-03
AS G27 2024 2 9 0 15 0.000000 1 -0.233847779881E-05
AS G28 2024 2 9 0 15 0.000000 1 -0.124773068532E-03
AS G29 2024 2 9 0 15 0.000000 1 -0.607324461069E-03
AS G30 2024 2 9 0 15 0.000000 1 -0.435032370385E-03
AS G31 2024 2 9 0 15 0.000000 1 -0.227700285233E-03
AS G32 2024 2 9 0 15 0.000000 1 -0.610554231912E-03
"""
3 changes: 2 additions & 1 deletion tests/test_datasets/sp3_test_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@
VG01 26855.435366 -6704.236117 -3062.394499 999999.999999
PG02 11149.555664 21314.099837 11331.977499 123456.999999
VG02 -12578.915944 -7977.396362 26581.116225 999999.999999
EOF"""
EOF
"""

# second dataset is a truncated version of file COD0OPSFIN_20242010000_01D_05M_ORB.SP3
sp3_test_data_truncated_cod_final = b"""#dP2024 7 19 0 0 0.00000000 2 d+D IGS20 FIT AIUB
Expand Down

0 comments on commit 535eece

Please sign in to comment.