Closed leewujung closed 2 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! 😄
@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:
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. :)
Notes for desired plots:
backscatter_r
in beam group.MVBS
/ Sv
, then plot those directly.Note for water_level parameter in platform group for depth_offset. See #259 for related issue.
Forgot that there was this one that can now be closed! :D
We'll add a thin wrapper to the xarray plotting function to plot basic echograms (Sv or MVBS).
x-axis:
ping_time
) ory-axis: three options here:
Efficiency: we'll need to decide when the echogram becomes too large to be plotted directly using matplotlib and need to use tools like datashader. Need to experiment with loading/plotting many files. With the reduced size of MVBS it's likely not an issue, but for plotting the calibrated Sv or raw data, it can be slow depending on the ping rate and data time span.
Colormap: colormap is an issue here. The fisheries acoustics community is used the so called EK500 colormap (below), and Matlab users are very much used to jet. We should promote colorblind-friendly colormaps. Magma seems to work well among the matplotlib choices.
EK500 colormap RGB values, from IMOS BASOOP. We should make this an option for plotting echogram.
something like this: