Skip to content
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

MNT: Skip missing value lines from CelesTrak files #72

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions pymsis/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ def _load_f107_ap_data() -> dict[str, npt.NDArray]:
if "PRM" in line:
# We don't want the monthly predicted values
continue
if ",,,,,,,," in line:
# We don't want lines with missing values
continue
fout.write(line.encode("utf-8"))
fout.seek(0)
arr = np.loadtxt(
Expand Down
1 change: 1 addition & 0 deletions tests/f107_ap_test_data.txt
Original file line number Diff line number Diff line change
Expand Up @@ -365,4 +365,5 @@ DATE,BSRN,ND,KP1,KP2,KP3,KP4,KP5,KP6,KP7,KP8,KP_SUM,AP1,AP2,AP3,AP4,AP5,AP6,AP7,
2000-12-29,2285,19,10,33,17,10,3,10,13,20,117,4,18,6,4,2,4,5,7,6,0.3,1,151,999,175.5,OBS,173.7,174.3,168.4,170.4
2000-12-30,2285,20,13,7,7,10,10,7,0,10,63,5,3,3,4,4,3,0,4,3,0.1,0,152,182.1,176.1,INT,173.5,174.8,168.2,170.9
2000-12-31,2285,21,13,0,3,10,7,0,0,3,37,5,0,2,4,3,0,0,2,2,0.0,0,119,169.5,163.9,PRD,173.3,175.0,168.1,171.0
2001-01-01,2285,21,,,,,,,,,,,,,,,,,,,,,0,169.5,163.9,OBS,173.3,175.0,168.1,171.0
2040-12-01,2825,21,,,,,,,,,,,,,,,,,,,,,0,69.7,67.73,PRM,68.5,68.3,66.8,67.7
Loading