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

Basic echogram plots #78

Closed leewujung closed 2 years ago

leewujung commented 4 years ago

We'll add a thin wrapper to the xarray plotting function to plot basic echograms (Sv or MVBS).

lsetiawan commented 3 years ago

Just found this issue, was thinking of creating this by getting values from pictures online haha. Here's a python version of the above function (I've divided the above values by 255):

from matplotlib.colors import ListedColormap

cm_data = [[1.0, 1.0, 1.0],
 [0.6235294117647059, 0.6235294117647059, 0.6235294117647059],
 [0.37254901960784315, 0.37254901960784315, 0.37254901960784315],
 [0.0, 0.0, 1.0],
 [0.0, 0.0, 0.4980392156862745],
 [0.0, 0.7490196078431373, 0.0],
 [0.0, 0.4980392156862745, 0.0],
 [1.0, 1.0, 0.0],
 [1.0, 0.4980392156862745, 0.0],
 [1.0, 0.0, 0.7490196078431373],
 [1.0, 0.0, 0.0],
 [0.6509803921568628, 0.3254901960784314, 0.23529411764705882],
 [0.47058823529411764, 0.23529411764705882, 0.1568627450980392]]

ek500_cmap = ListedColormap(cm_data)

I tried it and looks great! 😄

Screenshot from 2021-05-24 11-58-55

leewujung commented 3 years ago

@lsetiawan the colormap looks great, just a detail that requires a small tweak: The first and the last color code should be treated as below or above the vmin and vmax, like below:

Screen Shot 2021-05-24 at 2 11 07 PM

I think it'll be better to use the RGB values and explicitly divide 255 so that it can be easily reproduced.

We also need to fix the vertical axis via a couple helper functions. :)

lsetiawan commented 3 years ago

Notes for desired plots:

  1. If user passes in EchoData, plot the backscatter_r in beam group.
  2. If user passes MVBS / Sv, then plot those directly.
  3. Add a custom EK500 colormap along with the cmocean colormaps.
lsetiawan commented 3 years ago

Note for water_level parameter in platform group for depth_offset. See #259 for related issue.

leewujung commented 2 years ago

Forgot that there was this one that can now be closed! :D