-
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
Added a new parser for parsing BI500 files #1252
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1252 +/- ##
===========================================
- Coverage 83.52% 46.77% -36.75%
===========================================
Files 64 63 -1
Lines 5686 5772 +86
===========================================
- Hits 4749 2700 -2049
- Misses 937 3072 +2135
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Hi @praneethratna & @leewujung: I copied your parse_bi500.py and core.py to my ~/echopype/convert/ and ~/echopype directories and ran my code:
You'll notice that I use pathlib's Path for my files. I like it, but to get the filename into echopype, I need to cast it as a string. The reason I mention this is that I ran into some errors based on the file name in parse_bi500.py code and core.py. I think they came up because the BI500 files do not have a "true" suffix, which seems necessary for some of the initial file name and file path checking that is done in parse_bi500 and maybe Here is what I did to get around these errors:
You'll notice that I needed to set all the different parameters before going to the "file" lines (the last two lines) because the parameters didn't get set and those "file" functions needed them set. In addition, in the
I seems I needed to do this because the BI500 files don't have a suffix. I've gotten over the initial humps, but now I get some other errors that may be better for you to look into. Here are the error messages:error Traceback (most recent call last) ~/.local/lib/python3.10/site-packages/echopype/utils/prov.py in inner(*args, **kwargs) ~/.local/lib/python3.10/site-packages/echopype/convert/api.py in open_raw(raw_file, sonar_model, xml_path, convert_params, storage_options, use_swap, max_chunk_size) ~/.local/lib/python3.10/site-packages/echopype/convert/parse_bi500.py in parse_raw(self) error: unpack requires a buffer of 1324 bytes These errors seem to be associated with the actual reading and parsing of the data file. If this is unclear, I can send my revised parse_bi500.py and core.py code. Thanks! |
Hey @jmjech Thanks for testing out the code locally on sample data and informing me about the errors.
You can now pull the latest code changes and everything should work fine on the parser part. Since, we don't have
where |
Hi @praneethratna. I successfully imported BI500 data and was able to produce a couple of echograms! One thing that needs to be done is convert the values that have been read from the data file to dB. You do that by multiplying by 10*log_base_10(2)/256. |
Draft PR for BI500 parser code.
CC @leewujung @jmjech