-
Notifications
You must be signed in to change notification settings - Fork 76
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
Add function to interpolate location to calibrated dataset #749
Conversation
for more information, see https://pre-commit.ci
@lsetiawan : When I added the typing of EchoData somehow I am getting circular import error! Do you have ideas on where that may come from? I thought I have exactly the same thing ( |
echopype/utils/common.py
Outdated
history = ( | ||
f"{datetime.datetime.utcnow()} +00:00. " "Interpolated from Platform latitude/longitude." | ||
) |
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.
@emiliom : is this appropriate (for now)?
Since common is imported under the utils echopype/echopype/utils/__init__.py Lines 1 to 5 in 27a9b82
within echopype/echopype/echodata/echodata.py Line 18 in 27a9b82
This is the issue. Probably shouldn't be importing EchoData class within utils common since, it is a "common" module that can be used in any of the other modules. Best to reserve this to module to not pull from other modules. |
echopype/utils/common.py
Outdated
@@ -34,3 +39,50 @@ def swap_dims_channel_frequency(ds: xr.Dataset) -> xr.Dataset: | |||
"Duplicated transducer nominal frequencies exist in the file. " | |||
"Operation is not valid." | |||
) | |||
|
|||
|
|||
def add_location(ds: xr.Dataset, echodata: EchoData = None, nmea_sentence: Optional[str] = None): |
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.
Should this be in the preprocess
module instead? After all it enhances the spatial coherence of the data? 😄
echopype/echopype/preprocess/api.py
Line 2 in 12693a7
Functions for enhancing the spatial and temporal coherence of data. |
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.
Oh that is very true! I agree with this and will move it.
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 guess I had forgotten that I've written those sentences...
I agree with this! I wonder where these functions can go (swapping freq/channel, adding lat/lon, adding depth, etc -- basically higher level processing functions). I sticked |
I think higher level functions that can users will/can use should be in the |
Codecov Report
@@ Coverage Diff @@
## dev #749 +/- ##
===========================================
- Coverage 82.33% 19.74% -62.59%
===========================================
Files 46 48 +2
Lines 4240 4264 +24
===========================================
- Hits 3491 842 -2649
- Misses 749 3422 +2673
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more |
… for propagating fixed-location (mooring) lat-lon coordinate
I'm submitting a PR (leewujung#6) to your PR for your evaluation, with the following changes:
See what you think. Otherwise, I think it's ready to go. FYI I did a manual, visual evaluation of the lat-lon interpolation, comparing the results against the original lat-lon data. It looks good. |
Support for fixed-location case and test for missing or all-nan coord variables
for more information, see https://pre-commit.ci
This is kinda of a confusion/misnomer: what's added was the mechanism to test for missing or all-nan Platform coordinate variables, but not "tests" for them. We still need tests for these. I will open up a new issue for completing the more comprehensive tests, and delegate that to someone, so that I can focus on adding the actual functions. |
This addresses #725 .
Tasks
utils.common
(temporary position until we decide where these higher-product-level utilities would go)[ ] add tests to Sv and MVBS data