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

Fix for SeaExplorer code to avoid interpolating over large gaps #150

Merged
merged 2 commits into from
Jun 13, 2023

Conversation

hvdosser
Copy link
Collaborator

This fix uses the same utils.findgaps function as the Slocum code, and only interpolates over gaps that are larger than the user-specified parameter maxgap.

…gaps

This fix uses the same `utils.findgaps` function as the Slocum code, and
only interpolates over gaps that are larger than the user-specified
parameter `maxgap`.
@codecov
Copy link

codecov bot commented Apr 21, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.02 🎉

Comparison is base (747863f) 79.62% compared to head (4d44e85) 79.65%.

❗ Current head 4d44e85 differs from pull request most recent head 6dcc100. Consider uploading reports for the commit 6dcc100 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #150      +/-   ##
==========================================
+ Coverage   79.62%   79.65%   +0.02%     
==========================================
  Files           7        7              
  Lines        1374     1376       +2     
==========================================
+ Hits         1094     1096       +2     
  Misses        280      280              
Impacted Files Coverage Δ
pyglider/seaexplorer.py 82.03% <100.00%> (+0.12%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@@ -387,6 +387,10 @@ def raw_to_timeseries(indir, outdir, deploymentyaml, kind='raw',
val = np.datetime64("1970-01-01") + val_us
else:
val = np.interp(time_timebase.astype(float), time_var.astype(float), var_non_nan)

# interpolate only over those gaps that are smaller than 'maxgap'
tg_ind = utils.find_gaps(time_var.astype(float),time_timebase.astype(float),maxgap)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I believe this should be de-intented by one level so that it also applies the max gap check to variables with the datetime dtype

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good call. Done.

@hvdosser hvdosser merged commit 1a37deb into c-proof:main Jun 13, 2023
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.

2 participants