-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NPI-3683 SP3 consistency check streamlining #70
Merged
Merged
Changes from 1 commit
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
05b0c93
NPI-3683 added a function for removing satellites from the internal …
treefern 1c6b980
NPI-3683 added simple check and logging of SP3 file version detected …
treefern 5bcca65
NPI-3683 added test for bug where EV and EP rows were being included …
treefern 94a9b23
NPI-3683 updated remove_offline_sats() to update internal representat…
treefern cd716e1
NPI-3683 small docstring and comment clarity improvements
treefern 2597f9a
NPI-3683 switch over to utility functions for unique SV and epoch lists
treefern 74a1f30
NPI-3683 update comments for clarity
treefern 8f348a3
NPI-3683 stop setting SP3 header ORB_TYPE to INT when removing offlin…
treefern 0f04022
NPI-3683 within read_sp3() change order of dataframe restructuring, a…
treefern ff187f9
NPI-3683 update filter_by_svs() to update internal header to reflect …
treefern 4e2d491
NPI-3683 bug fix - update in place vs return new result
treefern 955b41a
NPI-3683 add return type hint prompted by PR feedback
treefern 201024b
Merge branch 'main' into NPI-3683-sp3-consistency-check-streamlining
treefern File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next
Next commit
NPI-3683 added a function for removing satellites from the internal h…
…eader representation, to help maintain consistency of that header data. This is useful for example when removing offline sats.
- Loading branch information
commit 05b0c93db422f35dde2af5eed1a8d6d8bde3f2ff
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -193,6 +193,32 @@ def sp3_clock_nodata_to_nan(sp3_df: _pd.DataFrame) -> None: | |
sp3_df.loc[nan_mask, ("EST", "CLK")] = _np.nan | ||
|
||
|
||
def remove_svs_from_header(sp3_df: _pd.DataFrame, sats_to_remove: set[str]): | ||
""" | ||
Utility function to update the internal representation of an SP3 header, when SVs are removed from the SP3 | ||
DataFrame. This is useful e.g. when removing offline satellites. | ||
:param _pd.DataFrame sp3_df: SP3 DataFrame on which to update the header (in place). | ||
:param list[str] sats_to_remove: list of SV names to remove from the header. | ||
""" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. doc string missing output parameter There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is none; this function operates on the |
||
num_to_remove: int = len(sats_to_remove) | ||
|
||
# Update header SV count (bunch of type conversion because header is stored as strings) | ||
sp3_df.attrs["HEADER"].HEAD.SV_COUNT_STATED = str(int(sp3_df.attrs["HEADER"].HEAD.SV_COUNT_STATED) - num_to_remove) | ||
|
||
# Remove sats from the multi-index which contains SV_INFO and HEAD. This does both SV list and accuracy code list. | ||
sp3_df.attrs["HEADER"].drop(level=1, labels=sats_to_remove, inplace=True) | ||
|
||
# Notes on the multi-index update: | ||
|
||
# The hierarchy here is: | ||
# dict (HEADER) > series (unnamed) > HEAD (part of multi-index) > str (SV_COUNT_STATED) | ||
# So we operate on the overall Series in the dict. | ||
|
||
# In the above statement, Level 1 gets us to the 'column' names (like G02), not the 'section' names (like SV_INFO). | ||
# Labels will apply to anything at that level (including things in HEAD - but those columns should never share a | ||
# name with an SV). | ||
|
||
|
||
def remove_offline_sats(sp3_df: _pd.DataFrame, df_friendly_name: str = ""): | ||
""" | ||
Remove any satellites that have "0.0" or NaN for all three position coordinates - this indicates satellite offline. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing output type hint