Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
2287299
added a parser for BI500 files
praneethratna Jan 2, 2024
ac1b3d3
added index file input based on directory contents
praneethratna Jan 3, 2024
d01a559
fixed errors with ParseBI500 class
praneethratna Jan 5, 2024
ef1697e
minor change
praneethratna Jan 5, 2024
32760c0
parsing -Info file during parse_raw
praneethratna Jan 5, 2024
2a38c06
minor improvements to ParseBI500 class
praneethratna Jan 5, 2024
8c409ea
convert values
praneethratna Jul 18, 2026
f72c819
pre-commit fix
praneethratna Jul 18, 2026
dca0bfc
add SetGroupsBI500
praneethratna Jul 22, 2026
bf4dbc4
Remove unrelated plot
praneethratna Jul 22, 2026
ee91e25
add a simple test
praneethratna Jul 23, 2026
0dbadf0
Merge remote-tracking branch 'upstream/main' into review-bi500
LOCEANlloydizard Jul 29, 2026
06e17a1
Update BI500 test data usage
LOCEANlloydizard Jul 29, 2026
ae299c3
Merge remote-tracking branch 'upstream/main' into review-bi500
LOCEANlloydizard Jul 31, 2026
98d2422
Expose calibrated BI500 products in ds_cal
LOCEANlloydizard Aug 1, 2026
60965da
Add BI500 echo range coordinates
LOCEANlloydizard Aug 2, 2026
6fd4b54
add tests and minor refactor
praneethratna Aug 4, 2026
5463104
Remove unrelated tests
praneethratna Aug 4, 2026
9f1eb03
minor test addition
praneethratna Aug 4, 2026
b73c33e
fix test
praneethratna Aug 4, 2026
fceebe8
Merge upstream/main into parser_BI500
LOCEANlloydizard Aug 6, 2026
d3b32d0
Merge remote-tracking branch 'upstream/main' into review-bi500
LOCEANlloydizard Aug 7, 2026
1ad23d3
back to depth and add multi-channel handling
LOCEANlloydizard Aug 8, 2026
fcc1f58
restore unrelated open_raw changes
LOCEANlloydizard Aug 8, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 35 additions & 7 deletions echopype/convert/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
from typing import TYPE_CHECKING, Dict, List, Literal, Optional, Tuple, Union

import fsspec
from xarray import DataTree
from xarray import Dataset, DataTree

# fmt: off
# black and isort have conflicting ideas about how this should be formatted
from ..core import SONAR_MODELS
from .set_groups_bi500 import SetGroupsBI500

if TYPE_CHECKING:
from ..core import EngineHint, PathHint, SonarModelsHint
Expand Down Expand Up @@ -264,7 +265,8 @@ def _check_file(
Parameters
----------
raw_file : str
path to raw data file
path to raw data file, or for BI500, the directory containing
the associated BI500 file set
sonar_model : str
model of the sonar instrument
xml_path : str
Expand All @@ -279,7 +281,8 @@ def _check_file(
Returns
-------
raw_file : str
path to existing raw data file
path to raw data file, or for BI500, the directory containing
the associated BI500 file set
xml : str
path to existing xml file
empty string if no xml file is required for the specified model
Expand Down Expand Up @@ -354,16 +357,20 @@ def open_raw(
use_swap: Union[bool, Literal["auto"]] = False,
max_chunk_size: str = "100MB",
channels: Optional[List[str]] = None,
) -> EchoData:
"""Create an EchoData object containing parsed data from a single raw data file.
) -> Union[EchoData, Tuple[EchoData, Dataset]]:
"""Create an EchoData object containing parsed data from a raw data source.

The EchoData object can be used for adding metadata and ancillary data
as well as to serialize the parsed data to zarr or netcdf.

For BI500, this function returns ``(echodata, ds_cal)``, where ``ds_cal``
contains the calibrated products generated by the BI500 system.

Parameters
----------
raw_file : str
path to raw data file
path to raw data file, or for BI500, the directory containing
the associated BI500 file set
sonar_model : str
model of the sonar instrument

Expand All @@ -375,6 +382,7 @@ def open_raw(
- ``AZFP6``: ASL Environmental Sciences AZFP echosounder (ULS6)
- ``AD2CP``: Nortek Signature series ADCP
(tested with Signature 500 and Signature 1000)
- ``BI500``: Bergen Integrator BI500 data

xml_path : str
path to XML config file used by AZFP (ULS5 only)
Expand All @@ -392,7 +400,7 @@ def open_raw(
When set to ``True`` (or when set to "auto" and large memory footprint is needed,
this function will create a temporary zarr store at the operating system's
temporary directory.
max_mb : int
max_chunk_size : str, default "100MB"
The maximum data chunk size in Megabytes (MB), when offloading
variables with a large memory footprint to a temporary zarr store
channels : list of str, optional
Expand All @@ -404,6 +412,11 @@ def open_raw(
Returns
-------
EchoData object
For all sonar models except BI500.
tuple of EchoData and xarray.Dataset
For BI500, returns ``(echodata, ds_cal)``. ``ds_cal`` contains
calibrated BI500 products including ``Sv``, ``Sv_bottom``, ``depth``,
``depth_bottom``, and single-target variables.

Raises
------
Expand Down Expand Up @@ -519,6 +532,15 @@ def open_raw(
sonar_model=sonar_model,
date_created=parser.config_datagram["timestamp"],
)
elif sonar_model == "BI500":
date_created = SetGroupsBI500._build_ping_time(
[parser.parameters["start_date"][0]],
[parser.parameters["start_time"][0]],
)[0]
tree_dict["/"] = setgrouper.set_toplevel(
sonar_model=sonar_model,
date_created=date_created,
)
else:
tree_dict["/"] = setgrouper.set_toplevel(
sonar_model=sonar_model, date_created=parser.ping_time[0]
Expand Down Expand Up @@ -564,4 +586,10 @@ def open_raw(
echodata._set_tree(tree)
echodata._load_tree()

# BI500 values are already calibrated by the EK500/BI500 system.
# Return these products separately from the EchoData metadata object.
if sonar_model == "BI500":
ds_cal = setgrouper.set_calibrated()
return echodata, ds_cal

return echodata
Loading
Loading