-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow ES70 files and handle datagram anomaly (#409)
* Allow data files of type ES70 The ES70 file format is identical to the ER60 and ES60 file format, so allow such files. Also remove a depreciation warning about the use of np.complex. * Decode from latin_1, not the default utf-8 * Cope with not finding the next datagram Sometimes files don't end properly (sometimes due to the software crashing while writing data). When than happens just take the data we have be done with that file. * Prevent a depreciated warning about np.complex * Partial fix to support EK/ES80 files that contain data from GPT transceivers * This ES/EK 60/70 text field is latin_1 encoding, not the decode() default of UTF-8 * Bug fix - files with no echo data in the first ping caused a crash If the first ping had no data in it, the data_list[0][0] reference would fail. Changed the code to more directly do what was desired (see if the data type was a complex data type). Also note that complex (or the depreciated np.complex) is the same data type as np.complex128, so removed 'complex' from the list. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Undo the previous commit (should not of gone on this branch or PR) * sigh... and fix the fix... * Bug fix - files with no echo data in the first ping caused a crash If the first ping had no data in it, the data_list[0][0] reference would fail. Changed the code to more directly do what was intended (see if the data type was a complex data type). Also note that complex (or the depreciated np.complex) is the same data type as np.complex128, so removed 'complex' from the list. * Fix error when Simrad file ends abruptly Sometimes Simrad files don't end properly (e.g., due to the software crashing while writing data). When than happens just take the data we have be done with that file. * Avoid 'not UTF-8' encoding error * Don't fail from NMEA parsing errors Catch pynmea2.checksumError exceptions instead of having the code end. Substitute 'None' for that NMEA message. * Catch all pynmea2 errors We don't really care about NMEA errors - just ignore them as there are always more coming... * oops, AttributeError is only raised by pynmea2, not defined by pynmea2 * Fix crash when there is no data in the first ping in a file This is a bit of a hack (it assumes that a file has at least 2 pings). It could possibly be solved closer to the actual file reading. * Fix crash when a file has no angle data Sometimes the angle data is a list with the first element an numpy array of size 0 then the remaining elements are None. Cope with this. * Better fix for commit 1c446f7 When there is no angle data for a particular ping, use a 2D empty array instead of a 1D array. This is to match the dimension of the angle data for the other pings (otherwise a crash happens when making the data have the same number of elements for all pings in the file). * [pre-commit.ci] pre-commit autoupdate (#455) updates: - [github.com/PyCQA/flake8: 3.9.2 → 4.0.1](PyCQA/flake8@3.9.2...4.0.1) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * add es70 to core and convert/api * factor out COMMON_KEYS for ER60/ES60/ES70 * add ES70 to sonar_models calling set_nmea * add correpsonding changes for ES80 in core and convert/api * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: leewujung <leewujung@gmail.com>
- Loading branch information
1 parent
4127af3
commit 4c77300
Showing
7 changed files
with
99 additions
and
77 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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