-
Notifications
You must be signed in to change notification settings - Fork 74
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
Add echodata.align_to_ping_time()
?
#1354
Comments
Hi, I installed the latest version of Echopype a couple of days ago and converted the raw EK80 data files to netCDF4 format, and now get a new error (shown below) but the situation is similar. When I run the code using only one of the files, the Echopype computes Sv without issue. It is when I have two files that the error occurs. I haven't tried with three or more, but I'm assuming the error would be consistent with two or more files. This is the link to the .raw data files: https://drive.google.com/drive/folders/1B5c_7Oi-cqkotauj9DcaU1yh_jDjm7Yy. Here is my code:
This is the error - it is a very long error:ValueError Traceback (most recent call last) ~/.local/lib/python3.10/site-packages/echopype/calibrate/api.py in compute_Sv(echodata, **kwargs) ~/.local/lib/python3.10/site-packages/echopype/calibrate/api.py in _compute_cal(cal_type, echodata, env_params, cal_params, ecs_file, waveform_mode, encode_mode) ~/.local/lib/python3.10/site-packages/echopype/calibrate/calibrate_ek.py in init(self, echodata, env_params, cal_params, waveform_mode, encode_mode, ecs_file, **kwargs) ~/.local/lib/python3.10/site-packages/echopype/calibrate/env_params.py in get_env_params_EK(sonar_type, beam, env, user_dict, freq) ~/.local/lib/python3.10/site-packages/echopype/calibrate/env_params.py in harmonize_env_param_time(p, ping_time) ~/.local/lib/python3.10/site-packages/echopype/utils/align.py in align_to_ping_time(external_da, external_time_name, ping_time_da, method) ~/.local/lib/python3.10/site-packages/xarray/core/dataarray.py in interp(self, coords, method, assume_sorted, kwargs, **coords_kwargs) ~/.local/lib/python3.10/site-packages/xarray/core/dataset.py in interp(self, coords, method, assume_sorted, kwargs, method_non_numeric, **coords_kwargs) ~/.local/lib/python3.10/site-packages/xarray/core/missing.py in interp(var, indexes_coords, method, **kwargs) ~/.local/lib/python3.10/site-packages/xarray/core/missing.py in interp_func(var, x, new_x, method, kwargs) ~/.local/lib/python3.10/site-packages/xarray/core/missing.py in _interpnd(var, x, new_x, func, kwargs) ~/.local/lib/python3.10/site-packages/scipy/interpolate/_rgi.py in interpn(points, values, xi, method, bounds_error, fill_value) ~/.local/lib/python3.10/site-packages/scipy/interpolate/_rgi.py in init(self, points, values, method, bounds_error, fill_value, solver, solver_args) ~/.local/lib/python3.10/site-packages/scipy/interpolate/_rgi.py in _check_fill_value(self, values, fill_value) ValueError: fill_value must be either 'None' or of a type compatible with values Thanks, |
Oh huh...this is strange. I think this may be a problem with |
@jmjech just sent a request for permission to view these RAW files |
@ctuguinay : you should have access now. let me know if not. |
@jmjech So there are a few things I observed - Not sure if you already tried it, but it is possible to run I was also able to replicate this harmonization error with the combined Echodata object and I figured out that it was the sound absorption variable that failed this interpolation: This is most likely due to the sound absorption variable from the combined Echodata object already having ping time in it before harmonization with ping time has even occurred: And turns out that dropping this ping time dimension results in the harmonization function passing: So I need to figure out why this sound absorption variable even has the ping time dimension in the case when we are working on an Echodata object that is the combination of multiple Echodata objects (it should only have |
@ctuguinay: Thanks for the tip on concatenating the data array/set! I will try that soon. Good luck with figuring it out. |
@jmjech : Chiming in here -- could we ask @spacetimeengineer to give this a shot? I think this will be a good way to get into the Echopype codebase, and @ctuguinay has done the investigative work to figure out where the problem lies. |
@leewujung : I thought about that. He is currently working on issue #995 to get into the code, so I thought I wouldn't distract him. But, I agree that this is a good issue to dig even more into the code. I spent a day working on it and it helped me understand the flow of the program. |
@ctuguinay had the idea of adding
echodata.align_to_ping_time()
to handle the timestamp alignment that we now have in the code for in:ping_time
)ping_time
)I think this is a really interesting idea and am just recording my thoughts below. Essentially right now in the
consolidate
subpackage we have functions to add ancillary data into the Sv dataset once it is calibrated, and in Echolevels we call these Level 2 datasets. If we haveechodata.align_to_ping_time()
then theEchoData
object may actually qualify as Level 2 in addition to the Sv.One good thing about this is that we can have all the messy timestamp handling in one place, instead of interspersed in the code in various places when it's needed:
echopype/consolidate/ek_depth_utils.py::_var_time2_to_ping_time
echopype/calibrate/evn_params.py::harmonize_env_param_time
The text was updated successfully, but these errors were encountered: