Closed leewujung closed 9 months ago
Notes while going through code:
Here I use the file test_data/ek60/L0003-D20040909-T161906-EK60.raw
.
For more info about this file, see my previous investigation here and here.
I "short-circuited" _append_channel_ping_data
to force saving all parsed data to under parser.ping_data_dict
(as recommended below), just so that I can see how things look easily, and create a mock data generator.
This quick patch type of change is here (I think we should completely remove zarr_vars
and associated stuff): https://github.com/leewujung/echopype/commit/e2a002996f3dafebf6d668e9b16df853330b5345
Right now the power, angle, and complex samples are all directed to be saved in parser.zarr_datagrams
after parser.parse_raw
-- I think this is unnecessary and messy. It helps with data integrity and therefore later maintenance to keep these variables along with others in parser.ping_data_dict
.
zarr_vars
in all occurrence of the use of _append_channel_ping_data
in parse_base.py
. zarr_vars
in _append_channel_ping_data
. It does not make sense to redirect those variables to parser.zarr_datagrams
. Better to keep a declaration up front for which variables should be handled with swap=True
and select from parser.ping_data_dict
zarr_datagrams
where each ping is stored as a list with all power/angle/complex data in it, in parser.ping_data_dict
it will be parser.ping_data_dict["power"]
like below:
here that number 1 is the first channel (it's a sequential integer) and it is a list of data from each ping (which could be different lengths)
Combine rectangularize_data
and rectangularize_transmit_ping_data
: once the above messy zarr datagram handling is removed, we do not need a separate function just for the transmit RAW4 datagram content.
Change _append_channel_ping_data
argument rx
to raw_type
. The current rx=True
will become raw_type="transmit"
, and rx=False
will become raw_type="receive"
. This is to make it more clear what this variable is handling, instead of default to rx
implicitly.
This Issue is related to #966
This issue is to pick up from #1070 to replace the current
parsed2zarr
mechanism to ensure code is bug-free and easy to maintain in the future.I am referencing my https://github.com/OSOceanAcoustics/echopype/pull/1070#issuecomment-1730079171 here:
@lsetiawan and I have done some investigation and determined a clean path forward.