General description of problem
Required
I cannot convert AZFP data
Computing environment
Required
- Echopype version:echopype-0.8.3
- How echopype was installed (e.g., conda or pip): WinPython
- Operating system: windows
Minimum example
Required: A minimum code snippet that reproduces your problem.
The following code reproduces the errors I encountered:
import echopype as ep
import os
from datetime import datetime
src_dir = r'G:\2023200002-ANTARCTIC-PROVIDER\DATA-INNKOMMENDE\HYDROAKUSTIKK-ASL-AZFP\DATA'
dst_dir = r'E:\MyWork\Krill\2023200002-ANTARCTIC-PROVIDER\ASL_AZFP'
xml_fp = r'G:\2023200002-ANTARCTIC-PROVIDER\DATA-INNKOMMENDE\HYDROAKUSTIKK-ASL-AZFP\DATA\202002\20021418.XML'
post_fix = '01A'
for c in os.listdir(src_dir):
sub_c = os.path.join(src_dir, c)
for f in os.listdir(sub_c):
if f.find(post_fix)>0:
fp = os.path.join(sub_c, f)
fmtime = os.path.getmtime(fp)
mo_datetime = datetime.fromtimestamp(fmtime)
ftimestamp = datetime.strftime(mo_datetime, '%Y%m%%dT%H%M%S')
ed = ep.open_raw(fp, sonar_model='AZFP', xml_path=xml_fp)
nc_fp = os.path.join(dst_dir, f.replace(post_fix, '{:}.nc'.format(ftimestamp)))
ed.to_netcdf(save_path=nc_fp)
print('{:} converted'.format(f))
Error message printouts
Required: Copy-paste the entire error messages you encounter here.
Below is the error messages I received when running the above code:
TypeError: 'float' object is not subscriptable
Provide an example file
Required: An example file that allow reproducing the problem.
- Link to an example raw file: SOME_ONLINE_LOCATION. Smaller files are strongly preferred (e.g., <25MB for AZFP and EK60, <100MB for EK80).
- Raw file sensor model: (FOR EXAMPLE: Simrad EK60)
Troubleshooting
Optional but preferred: Explain any steps that you have taken to identify the cause of conversion error.
This is a float that has no reference [freq_ch]
v = (np.log10(v) - 2.5) * (8 * 65535) * self.parameters["DS"][freq_ch]

General description of problem
Required
I cannot convert AZFP data
Computing environment
Required
Minimum example
Required: A minimum code snippet that reproduces your problem.
The following code reproduces the errors I encountered:
import echopype as ep
import os
from datetime import datetime
src_dir = r'G:\2023200002-ANTARCTIC-PROVIDER\DATA-INNKOMMENDE\HYDROAKUSTIKK-ASL-AZFP\DATA'
dst_dir = r'E:\MyWork\Krill\2023200002-ANTARCTIC-PROVIDER\ASL_AZFP'
xml_fp = r'G:\2023200002-ANTARCTIC-PROVIDER\DATA-INNKOMMENDE\HYDROAKUSTIKK-ASL-AZFP\DATA\202002\20021418.XML'
post_fix = '01A'
for c in os.listdir(src_dir):
sub_c = os.path.join(src_dir, c)
for f in os.listdir(sub_c):
if f.find(post_fix)>0:
fp = os.path.join(sub_c, f)
fmtime = os.path.getmtime(fp)
mo_datetime = datetime.fromtimestamp(fmtime)
ftimestamp = datetime.strftime(mo_datetime, '%Y%m%%dT%H%M%S')
ed = ep.open_raw(fp, sonar_model='AZFP', xml_path=xml_fp)
nc_fp = os.path.join(dst_dir, f.replace(post_fix, '{:}.nc'.format(ftimestamp)))
ed.to_netcdf(save_path=nc_fp)
print('{:} converted'.format(f))
Error message printouts
Required: Copy-paste the entire error messages you encounter here.
Below is the error messages I received when running the above code:
TypeError: 'float' object is not subscriptable
Provide an example file
Required: An example file that allow reproducing the problem.
Troubleshooting
Optional but preferred: Explain any steps that you have taken to identify the cause of conversion error.
This is a float that has no reference [freq_ch]

v = (np.log10(v) - 2.5) * (8 * 65535) * self.parameters["DS"][freq_ch]