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

Write XTF example failing to write packets #25

Open
Tdarnell opened this issue Apr 21, 2023 · 1 comment
Open

Write XTF example failing to write packets #25

Tdarnell opened this issue Apr 21, 2023 · 1 comment

Comments

@Tdarnell
Copy link

Tdarnell commented Apr 21, 2023

Following the notebook example for writing XTF data gives the following error when modifying existing XTF packets:

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In[31], line 14
     12 # Write packets
     13 for packet in packets:
---> 14     f.write(packet.to_bytes())

TypeError: to_bytes() missing required argument 'length' (pos 1)

It seems the to_bytes method being used in builtins.pyi requires the following: length: SupportsIndex, byteorder: Literal["little", "big"]

this problem seems to come from my XTF files containing the following packets alongside sonar:

XTFHeaderType.navigation
42
XTFHeaderType.attitude
3
XTFHeaderType.sonar
0

I would like to modify the original data file then save a renamed copy, including these additional packets.

@oysstu
Copy link
Owner

oysstu commented Apr 25, 2024

It's been a while, but are you able to provide a small snippet that illustrates the problem?

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

No branches or pull requests

2 participants