-
Notifications
You must be signed in to change notification settings - Fork 0
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
18 atm1b data #31
Conversation
28b8310
to
ea775c8
Compare
"ITRF88").""" | ||
"ITRF88"). | ||
|
||
ITRF2020 is recognized as "ITRF20". |
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.
This is maddening
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.
🙀
895c84a
to
720bd7b
Compare
"ITRF2020" is not recognized, even though the ITRF seems to be designated as "ITRF2020"... https://itrf.ign.fr/en/solutions/itrf2020
…values. TODO: new tests to cover changes
720bd7b
to
a958395
Compare
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) ```
@@ -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. |
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.
💯
fn_date = "20" + fn_date | ||
if not m: | ||
err_msg = f"Failed to extract date from BLATM1B v1 file: {fn}" | ||
raise RuntimeError(err_msg) |
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.
💯
src/nsidc/iceflow/data/atm1b.py
Outdated
try: | ||
itrf_str = { | ||
"ITRF05": "ITRF2005", | ||
"ITRF08": "ITRF2008", | ||
"ITRF2000": "ITRF20", | ||
}[itrf_str] | ||
except KeyError: | ||
pass |
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.
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) |
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.
I don't know if this is more readable or not 🙃
src/nsidc/iceflow/data/atm1b.py
Outdated
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. |
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.
It'd be nice to have a rangedict
data structure :)
"ITRF88").""" | ||
"ITRF88"). | ||
|
||
ITRF2020 is recognized as "ITRF20". |
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.
🙀
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
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