Skip to content

Commit 143115b

Browse files
authored
Merge pull request #23 from GeoscienceAustralia/NPI-3311-clk-diff-fix
NPI-3311 Fix the clk_diff variable in SISRE function
2 parents c5e5179 + 9faba14 commit 143115b

1 file changed

Lines changed: 15 additions & 10 deletions

File tree

gnssanalysis/gn_diffaux.py

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ def compare_clk(
326326
clk_a = _gn_io.clk.get_AS_entries(clk_a)
327327
clk_b = _gn_io.clk.get_AS_entries(clk_b)
328328

329-
if not isinstance(norm_types,list): # need list for 'sv' to be correctly converted to array of SVs to use for norm
329+
if not isinstance(norm_types, list): # need list for 'sv' to be correctly converted to array of SVs to use for norm
330330
norm_types = list(norm_types)
331331

332332
if ext_dt is None:
@@ -365,9 +365,9 @@ def compare_clk(
365365
)
366366

367367
# get the sv to use for norm and overwrite norm_type value with sv prn code
368-
_logging.info('---removing common mode from clk 1---')
368+
_logging.info("---removing common mode from clk 1---")
369369
_gn_io.clk.rm_clk_bias(clk_a_unst, norm_types=norm_types)
370-
_logging.info('---removing common mode from clk 2---')
370+
_logging.info("---removing common mode from clk 2---")
371371
_gn_io.clk.rm_clk_bias(clk_b_unst, norm_types=norm_types)
372372
return clk_a_unst - clk_b_unst
373373

@@ -434,7 +434,7 @@ def sisre(
434434
sisre : DataFrame or Series depending in the output_mode selection
435435
output_mode = 'rms' : Series of RMS SISRE values, value per GNSS.
436436
output_mode = 'gnss' : DataFrame of epoch-wise RMS SISRE values per GNSS.
437-
output_mode = 'sv' : DataFrame of epoch-wise SISRE values per SV. NOTE: SV here refers to Satellite
437+
output_mode = 'sv' : DataFrame of epoch-wise SISRE values per SV. NOTE: SV here refers to Satellite
438438
Vehicle ID (1-1 mappable to Pseudo-Random Noise identifier i.e. PRN). It does NOT
439439
refer to Satellite Vehicle Number (which is permanent).
440440
"""
@@ -448,9 +448,9 @@ def sisre(
448448
)
449449

450450
if write_rac_file:
451-
rtn_filename = rac.attrs["sp3_a"]+ " - " + rac.attrs["sp3_b"] + hlm_mode if hlm_mode is not None else ""
451+
rtn_filename = rac.attrs["sp3_a"] + " - " + rac.attrs["sp3_b"] + hlm_mode if hlm_mode is not None else ""
452452
print(rtn_filename)
453-
rac.to_csv(path_or_buf = rtn_filename,header=True,index=True)
453+
rac.to_csv(path_or_buf=rtn_filename, header=True, index=True)
454454

455455
rac_unstack = rac.EST_RAC.unstack() * 1000 # km to meters,
456456
# sync is being done within the function.
@@ -465,8 +465,11 @@ def sisre(
465465
_gn_plot.racplot(rac_unstack=rac_unstack, output=plot if isinstance(plot, str) else None)
466466

467467
if (clk_a is not None) & (clk_b is not None): # check if clk data is present
468-
clk_diff = compare_clk(
469-
clk_a, clk_b, norm_types=norm_type, ext_dt=rac_unstack.index, ext_svs=rac_unstack.columns.levels[1]
468+
clk_diff = (
469+
compare_clk(
470+
clk_a, clk_b, norm_types=norm_type, ext_dt=rac_unstack.index, ext_svs=rac_unstack.columns.levels[1]
471+
)
472+
* _gn_const.C_LIGHT
470473
) # units are meters
471474
if clean:
472475
if cutoff is not None:
@@ -475,7 +478,7 @@ def sisre(
475478
common_epochs_RAC_T = rac_unstack.index.intersection(
476479
clk_diff.index.values
477480
) # RAC epochs not present in clk_diff
478-
481+
479482
# NOTE: SV here refers to Satellite Vehicle ID, not to be confused with the *permanent* Satellite
480483
# Vehicle Number.
481484
# The columns here have been cleared of unused levels in sp3.diff_sp3_rac(). If this were not done, we would
@@ -517,7 +520,9 @@ def sisre(
517520
return _gn_aux.rms(rms_sisre, axis=0)
518521

519522

520-
def diffsp3(sp3_a_path, sp3_b_path, tol, log_lvl, clk_a_path, clk_b_path, hlm_mode=None, plot=False, write_rac_file=False):
523+
def diffsp3(
524+
sp3_a_path, sp3_b_path, tol, log_lvl, clk_a_path, clk_b_path, hlm_mode=None, plot=False, write_rac_file=False
525+
):
521526
"""Compares two sp3 files and outputs a dataframe of differences above tolerance if such were found"""
522527
sp3_a, sp3_b = _gn_io.sp3.read_sp3(sp3_a_path), _gn_io.sp3.read_sp3(sp3_b_path)
523528

0 commit comments

Comments
 (0)