Repository navigation
Refactor for Nortek classic reader - #473
Merged
Merged
Conversation
…metadata from coordinates
Contributor
|
ready for review |
jmcvey3
commented
Nov 11, 2026
| "pct_of_mean_pressure", | ||
| "pct_of_min_re", | ||
| ][int(wave_meas_mode[2])] | ||
| cfg_u |
jmcvey3
commented
Nov 11, 2026
| "0x81": "read_aqd_mag", # Aquadopp with magnetometer | ||
| } | ||
|
|
||
| size_map = { |
jmcvey3
commented
Nov 11, 2026
|
|
||
| # Run the appropriate initialization routine (e.g. init_ADV). | ||
| getattr(self, "init_" + self._inst)() | ||
| # No apparent way to determine how many samples are in a file |
Contributor
Author
There was a problem hiding this comment.
Update this comment
jmcvey3
commented
Nov 11, 2026
| self._init_data(defs.vec_data) | ||
| self._dtypes += ["vec_data"] | ||
|
|
||
| # The size byte in read_vec is |
jmcvey3
commented
Nov 11, 2026
| for idx in range(nbeams): | ||
| dv["amp"][idx, :, c] = tmp[idx * nbins : (idx + 1) * nbins] | ||
| self.checksum(byts) | ||
|
|
Contributor
Author
There was a problem hiding this comment.
Add comment for fill byte being included if n_bins is odd
Contributor
Author
Thanks @akeeste! I added some comments that I need to clean up when I get back to this (probably Friday), and then I'll merge |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A co-worker found a bug in the reader after setting up the ADV to save 100 Mb files. But, in doing so, it looks like the instrument chops up a data-packet between sequential files, erroring the reader out. (So in the future, I'd advise not setting a max file size).
This refactor does a better job scanning the file for the total number of pings, and then cleans up a lot of the poorly written code. I'd still like to rewrite the "read" functions in nortek.py because they're still difficult to read, but that is a larger job.