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

18 atm1b data #31

Merged
merged 19 commits into from
Oct 15, 2024
Merged

18 atm1b data #31

merged 19 commits into from
Oct 15, 2024

Conversation

trey-stafford
Copy link
Contributor

@trey-stafford trey-stafford commented Aug 28, 2024

Resolves #18

Adds support for ILATM1B v2 and BLATM1B v1.

Also adds some code to deal with ATM1B qfit files that lack a header. see #35.


📚 Documentation preview 📚: https://readthedocs-preview--31.org.readthedocs.build/en/31/

https://iceflow--31.org.readthedocs.build/en/31/

^RTD link generation should be fixed with #32 #33

"ITRF88")."""
"ITRF88").

ITRF2020 is recognized as "ITRF20".
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is maddening

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙀

File date is just that: a date with no time information. This constructs a
datetime object representing the beginning of the day.

```
>>> dt.datetime(2020, 1, 2)
datetime.datetime(2020, 1, 2, 0, 0)
```
CHANGELOG.md Outdated Show resolved Hide resolved
@@ -158,6 +159,7 @@ ignore = [
"SIM108", # Use ternary operator. Sometimes this is less readable.
"T201", # Remove 'print' statements. Sometimes these are handy.
"SIM105", # Use contextlib.suppress instead of try-except-pass. The recommended approach is slower and less flexible.
"RET505", # Unnecessary else/elif: sometimes this is just more readable & explicit.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

fn_date = "20" + fn_date
if not m:
err_msg = f"Failed to extract date from BLATM1B v1 file: {fn}"
raise RuntimeError(err_msg)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

Comment on lines 275 to 282
try:
itrf_str = {
"ITRF05": "ITRF2005",
"ITRF08": "ITRF2008",
"ITRF2000": "ITRF20",
}[itrf_str]
except KeyError:
pass
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
try:
itrf_str = {
"ITRF05": "ITRF2005",
"ITRF08": "ITRF2008",
"ITRF2000": "ITRF20",
}[itrf_str]
except KeyError:
pass
itrf_str = {
"ITRF05": "ITRF2005",
"ITRF08": "ITRF2008",
"ITRF2000": "ITRF20",
}.get(itrf_str, itrf_str)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if this is more readable or not 🙃

itrf = itrfs[0]
def _find(gdt, i, lower, upper) -> str | None:
# Binary search for the correct ITRF to make this fast. If we
# do a naive linear search, it can run up to 10x longer.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'd be nice to have a rangedict data structure :)

"ITRF88")."""
"ITRF88").

ITRF2020 is recognized as "ITRF20".
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙀

Base automatically changed from sketch-nb-vis to main October 14, 2024 17:03
We expect every qfit file to contain a header with the ITRF given within. The
code responsible for reading headers originally failed to read some qfit headers
du to different lengths of the header in bytes. Now that code is fixed and we
should always get the source ITRF from the data itself, not a hard-coded list.
Remove hard-coded ITRF ranges for ATM1B data
@trey-stafford trey-stafford merged commit b023ad9 into main Oct 15, 2024
4 checks passed
@trey-stafford trey-stafford deleted the 18-atm1b-data branch October 15, 2024 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for and test BLATM1B v1, ILATM1B v1 and v2
2 participants