Skip to content

Combine single and tricolor echogram plotting #230

Closed

Description

@leewujung

In the main branch, the code for single echogram and tricolor echogram plotting are separated. @shivam096 has previously done some work (which lives in the refactor_main branch) but that has not been merged into main. This issue to ensure that the existing code in refactor_main is revived (since it's been almost a year) and merged into main, with demo notebooks in the docs updated with the new function calls.

Activity

  1. added theissue type on Mar 6, 2026
  2. leewujung commented on Mar 6, 2026

    @leewujung
    MemberAuthor

    @iamluan: this should be a relatively small task, but would get you familiar with the current logic in the codebase.

    cc @LOCEANlloydizard for visibility.

  3. iamluan commented on Mar 8, 2026

    @iamluan

    I've reviewed PR #193, which addresses the issue you mentioned. Since main and refactor_main have diverged significantly since then, I think we might create a new PR based on the original PR to integrate the creation of the single echogram and tricolor echogram.
    I have tested the echogram example with the code in refactor_main and encountered an error with colormaps, as shown below.

    raise ValueError(f"Supplied cmap {cmap} not found among {providers_checked} colormaps.")
    ValueError: Supplied cmap #FFFFFF not found among matplotlib, bokeh, or colorcet colormaps.
    

    The code that produces this error is from the notebook in the main docs/source/version_0.1.0/echogram_examples.ipynb

    eg = MVBS_ds.eshader.echogram2(
        channel = [
            'GPT  18 kHz 009072058c8d 1-1 ES18-11',
            'GPT  38 kHz 009072058146 2-1 ES38B',
            'GPT 120 kHz 00907205a6d0 4-1 ES120-7C',
            ],
        cmap = [
            "#FFFFFF", "#9F9F9F", "#5F5F5F", "#0000FF", "#00007F", "#00BF00", "#007F00", 
            "#FFFF00", "#FF7F00", "#FF00BF", "#FF0000", "#A6533C",  "#783C28",
        ], 
        vmin = -80, 
        vmax = -30,
    )
    panel.Row(eg)
    

    I will investigate the error further. If you have any thoughts on this, please let me know. Thanks @leewujung

  4. leewujung commented on Mar 8, 2026

    @leewujung
    MemberAuthor

    @iamluan : Hmm, interesting -- please take a look at this colormap code in echopype, which should be what's used here. Seems better if that's in a single place. Since echopype is already a requirement, seems straightforward to just use this new colormap from there.

    Within this current issue I think we can just use what's in echopype. However, beyond this particular colormap (ek500) the considerations are a bit different. I just added some thoughts in the new issue echostack-org/.github#6 for new colormaps, and pinging mentor @LOCEANlloydizard there since we had some prior discussions about it. Feel free to contribute your thoughts there! Thanks!

  5. LOCEANlloydizard commented on Mar 9, 2026

    @LOCEANlloydizard
    Collaborator

    Hi both, indeed we should use the colormap in echopype. There is an example of its use here if that helps, @iamluan. Answering in echostack-org/.github#6 to discuss the broader scope! Cheers!

  6. iamluan commented on Mar 24, 2026

    @iamluan

    Continue to the ValueError: Supplied cmap #FFFFFF not found among matplotlib, bokeh, or colorcet colormaps.. This happens because of line 114 in the code below: opts_dict["cmap"] has the value #FFFFFF; it should be a list of hex color strings as input. To fix this issue, we can add the following line within the if-else block at the beginning of the function: cmaps = [cmap]*len(channels).

    https://github.com/OSOceanAcoustics/echoshader/blob/90992a362b2d135c16c49bfb0112099e172c83ed/echoshader/plots/echogram.py#L112-L115

  7. LOCEANlloydizard commented on Aug 5, 2026

    @LOCEANlloydizard
    Collaborator

    Superseded by #262

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions