OSOceanAcoustics / echopype

Enabling interoperability and scalability in ocean sonar data analysis
https://echopype.readthedocs.io/
Apache License 2.0
94 stars 73 forks source link

Problem plotting echogram #1087

Closed Cristia7 closed 4 months ago

Cristia7 commented 1 year ago

the same type files a part can convert with more ping another part can't with less ping code as follow

`from echopype import open_raw import echopype.visualize as epviz import matplotlib.pyplot as plt

ed = open_raw(raw_file="file_name.raw",sonar_model='EK80') epviz.create_echogram(ed,vmax=-80, vmin=-200,channel='WBT 738177-15 ES38-7_ES') plt.show()`

leewujung commented 1 year ago

@Cristia7 : I saw that you created 3 issues in a roll but they do not provide enough information for us to help you. Please go back to the issue template and fill the required info either in a new issue or put the required info here. Thanks!

Cristia7 commented 1 year ago

Sorry, I am not proficient in using github I have modified the issue according to the specifications

General description of problem

The same type files A part can convert with more ping another part can’t with less ping

Computing environment

Echopype version:0.6.4.1 Installed:pip Operating system:win11

Minimum example

The following code reproduces the errors I encountered: ‘’’from echopype import open_raw import echopype.visualize as epviz import matplotlib.pyplot as plt ed = open_raw(raw_file="file_name.raw",sonar_model='EK80') epviz.create_echogram(ed,vmax=-80, vmin=-200,channel='WBT 738177-15 ES38-7_ES') plt.show()’’’

Error message printouts

There was no error when running the code, but the data in the parsed file is empty

Provide an example file

Link to an example raw file: https://pan.baidu.com/s/1Yaag3A5yjvntzM8DnPwLrg?pwd=ic4t Raw file sensor model: Simrad EK80

leewujung commented 1 year ago

@Cristia7: No problem, thanks for the added info. Could you update to v0.7.1? Once you get the EchoData object (ed), try:

ed["Sonar/Beam_group1"]["backscatter_r"].sel(channel="WBT 738177-15 ES38-7_ES").plot(x="ping_time")

Do you get anything? If so we can look into if the viz module has some bugs (and we also need to update that part of documentation...)

Cristia7 commented 1 year ago

I have updated to 0.7.1 and get ed after that run this code ed["Sonar/Beam_group1"] ["backscatter_r"]. sel (channel="WBT 738177-15 ES38-7-ES"). plot (x="ping_time") but The problem still exists I think the problem arises in this part: ed=open_raw(raw_file='files_name',sonar_model='EK80') because after run this code to obtain ed I also run

ed.to_netcdf(save_path='files_name')
ed.to_zarr(save_path='files_name')

There is no correct information in the obtained NC file and zarr file. so I suspect that the open_raw part is not obtain the .raw information correctly

Cristia7 commented 1 year ago

I have tried other files that can be interpret .nc .zarrfiles are right . both ed["Sonar/Beam_group1"] ["backscatter_r"]. sel (channel="WBT 738177-15 ES38-7-ES"). plot (x="ping_time")and epviz.create_echogram(ed,channel='WBT 738177-15 ES38-7_ES')able to draw correct images

leewujung commented 1 year ago

I have updated to 0.7.1 and get ed after that run this code ed["Sonar/Beam_group1"] ["backscatter_r"]. sel (channel="WBT 738177-15 ES38-7-ES"). plot (x="ping_time") but The problem still exists

Could you elaborate on what you meant by but the problem still exists? What is the problem here?

Cristia7 commented 1 year ago

The graph drawn is a bar chart, not the required thermal diagram

76a4db331bb862007dd3fddc0731835
leewujung commented 1 year ago

Well, that's what x="ping_time" is for and it's commented out in your code.

leewujung commented 1 year ago

Also, since the values are so small, take a log would be useful:

np.log10(ed["Sonar/Beam_group1"]["backscatter_r"]. sel(channel="WBT 738177-15 ES38-7-ES")).plot (x="ping_time")
Cristia7 commented 1 year ago

When x is included in my code, this situation occurs

4644f86690a8c849aa2abbb83e71d86

TypeError: Axes.hist() got multiple values for argument 'x'

leewujung commented 6 months ago

@Cristia7 : I am not sure what the exact problem is for this issue, as it does not seem to be a code problem but in plotting. Any update?

leewujung commented 4 months ago

Closing this now due to inaction. Feel free to open up new issues if you still run into problems.