Skip to content

Commit

Permalink
change the order in _save_groups_to_file so they are the same as the …
Browse files Browse the repository at this point in the history
…EchoData structure (#779)
  • Loading branch information
b-reyes committed Aug 11, 2022
1 parent de13aea commit 96ed2fd
Showing 1 changed file with 30 additions and 30 deletions.
60 changes: 30 additions & 30 deletions echopype/convert/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,15 +107,6 @@ def _save_groups_to_file(echodata, output_path, engine, compress=True):
# Top-level group
io.save_file(echodata["Top-level"], path=output_path, mode="w", engine=engine)

# Provenance group
io.save_file(
echodata["Provenance"],
path=output_path,
group="Provenance",
mode="a",
engine=engine,
)

# Environment group
if "time1" in echodata["Environment"]:
io.save_file(
Expand All @@ -136,6 +127,36 @@ def _save_groups_to_file(echodata, output_path, engine, compress=True):
group="Environment",
)

# Platform group
io.save_file(
echodata["Platform"], # TODO: chunking necessary? time1 and time2 (EK80) only
path=output_path,
mode="a",
engine=engine,
group="Platform",
compression_settings=COMPRESSION_SETTINGS[engine] if compress else None,
)

# Platform/NMEA group: some sonar model does not produce NMEA data
if echodata["Platform/NMEA"] is not None:
io.save_file(
echodata["Platform/NMEA"], # TODO: chunking necessary?
path=output_path,
mode="a",
engine=engine,
group="Platform/NMEA",
compression_settings=COMPRESSION_SETTINGS[engine] if compress else None,
)

# Provenance group
io.save_file(
echodata["Provenance"],
path=output_path,
group="Provenance",
mode="a",
engine=engine,
)

# Sonar group
io.save_file(
echodata["Sonar"],
Expand Down Expand Up @@ -190,27 +211,6 @@ def _save_groups_to_file(echodata, output_path, engine, compress=True):
compression_settings=COMPRESSION_SETTINGS[engine] if compress else None,
)

# Platform group
io.save_file(
echodata["Platform"], # TODO: chunking necessary? time1 and time2 (EK80) only
path=output_path,
mode="a",
engine=engine,
group="Platform",
compression_settings=COMPRESSION_SETTINGS[engine] if compress else None,
)

# Platform/NMEA group: some sonar model does not produce NMEA data
if echodata["Platform/NMEA"] is not None:
io.save_file(
echodata["Platform/NMEA"], # TODO: chunking necessary?
path=output_path,
mode="a",
engine=engine,
group="Platform/NMEA",
compression_settings=COMPRESSION_SETTINGS[engine] if compress else None,
)

# Vendor_specific group
if "ping_time" in echodata["Vendor_specific"]:
io.save_file(
Expand Down

0 comments on commit 96ed2fd

Please sign in to comment.