8000 Logscale colormap support · Issue #135 · mcidasv/mcidasv · GitHub
[go: up one dir, main page]

Skip to content

Logscale colormap support #135

Open
Open

Description

@ghansham

Dear All

Do we have direct support for logscale colormaps support? The chlorophyll colormaps used in modis. Viirs, amd other ocean color missions are generally logscale.

As far as I remember VisAD has this support?
Kindly correct me.
It's about bringing this functionality into mcidas-v GUI.
Any thoughts on this?

Regards
Ghansham

Activity

  1. rmcarp commented on Aug 13, 2025

    @rmcarp
    Contributor

    Hi Ghansham,

    There's no way currently through the Color Table Editor to do a logarithmic stretch. This is a part of Inquiry 1153. In the past we've suggested the following approaches to users looking to do a logarithmic stretch:

    1. Display the log of the data. In this case, the color table will be logarithmic to match the data values. Here's a function you could try:
    def logData(data):
        # replace any zero data values with NaN
        missData = setToMissing(data,0)
        # run log function on setToMissing output
        lData = log(missData)
        return lData
    

    In this function, values of 0 are set to "missing" so the enhancement stretches from the true min to max values of the output data object.

    1. You can approximate a logarithmic stretch using piecewise linear stretching. You would just need to make sure you have enough breakpoints at the correct locations to make things look correct.

    I'm not overly familiar with standalone VisAD, but from what I've seen it looks like you can manually build a color table with log-spaced entries, but this isn't built into McIDAS-V's Color Table Editor.

    Thanks,
    Bob

  2. ghansham commented on Aug 14, 2025

    @ghansham
    Author

    Okay Sir. Thanks

  3. ghansham commented on Aug 14, 2025

    @ghansham
    Author

    https://github.com/visad/visad/blob/master/core/src/visad/BaseColorControl.java

    There is a concept of function in VisAD basecolorcontrol class which can be used to implement this functionality. Only UI part is missing in mcidas-v
    We can add an optional in UI for logscale and supply log function to set colorcontrol accordingly.

    https://github.com/visad/visad/blob/156206052e72eaba306948bb4f9c5a961479a84d/core/src/visad/BaseColorControl.java#L298

    Will try if some prototype is demonstrable

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0