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

Handling additional leading string packet in AD2CP files #734

Closed
leewujung opened this issue Jun 21, 2022 · 0 comments
Closed

Handling additional leading string packet in AD2CP files #734

leewujung opened this issue Jun 21, 2022 · 0 comments
Labels
bug Something isn't working data conversion

Comments

@leewujung
Copy link
Member

leewujung commented Jun 21, 2022

Currently the parser/set_grouper assumed having 1 leading string packet to parse the config parameters. However, for deployed files like those from glider, the first packet is often written (optionally) with an identifier of the mission/dive/etc. The current operation to parse config params therefore operates on the wrong string packet in this situation (should operate on the second one, which is the default AD2CP config string packet).

It seems that the config param string packet always start with "GETCLOCKSTR", so checking this can allow finding the correct string packet to parse params.

A bug related to this is that currently the Echosounder mode pulse compression setting (on which echogram) relies on parsing the config params. When the wrong string packet is used, the pulse compressed channel is set to the wrong one.

Related code sections:

def get_pulse_compressed(self) -> int:
for i in range(1, 3 + 1):
if "GETECHO" in self.config and self.config["GETECHO"][f"PULSECOMP{i}"] > 0: # type: ignore # noqa
return i
return 0

self.pulse_compressed = self.parser_obj.get_pulse_compressed()

pulse_compressed = np.zeros(3)
pulse_compressed[self.pulse_compressed - 1] = 1
ds["pulse_compressed"] = (("echogram",), pulse_compressed)

@leewujung leewujung added the bug Something isn't working label Jun 21, 2022
@leewujung leewujung moved this to Todo in Echopype Jun 21, 2022
leewujung added a commit to imranmaj/echopype that referenced this issue Jun 21, 2022
Repository owner moved this from Todo to Done in Echopype Jul 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working data conversion
Projects
Status: Done
Development

No branches or pull requests

1 participant