[Thread Prev][Thread Next][Index]

Re: [ferret_users] inverting cmocean color bar



Hi Saurabh,

PyFerret palettes have the colors expressed as percentages, and they need to have a lot fewer colors than these; I see there are 256 or even 512 colors in some of them.  Because PyFerret interpolates between the color levels we do not need nearly that many. You can choose to keep every 4th or 5th value, probably being careful to keep the first and last colors defined in the original palette.  Here's the information about creating new color palettes:

https://ferret.pmel.noaa.gov/Ferret/documentation/users-guide/customizing-plots/COLOR#_VPINDEXENTRY_819

When you are satisfied with the new palette files, please share them back here and we can include them in the pyferret distribution.

Ansley

On 3/5/2020 1:04 PM, saurabh rathore wrote:
Thank you, Gert and Ryo for sharing the files and the command to invert it. I found PyFerret have cmocean color bars but recently cmocean have included more color palettes which are not in the PyFerret yet. So I was thinking to play with the cmocean color palettes and make the new additions compatible to PyFerret. I tried that but failed. May I know what are the steps to convert cmocean color palettes to pyferret compatible .spk file?

here is the link for the ferret spk files and the cmocean developer rgb files.



cheers, saurabh


On Thu, Mar 5, 2020 at 2:31 PM Ryo Furue <furue@xxxxxxxxxx> wrote:
Hi Saurabh,

On Thu, Mar 5, 2020 at 9:29 AM saurabh rathore <rohitsrb2020@xxxxxxxxx> wrote:

I am using cmocean color bar and I like to plot the color bar in reverse direction means upside down. I tried a lot using Matlab also to flip it upside down but unsuccessful and too much of time-consuming. So is it possible to invert the colour the cmocean color bar like blue_orange to orange_blue?


I'm attaching my script which does that.

$ ruby ferret-invert-spk.rb your-rainbow.spk my-grayscale.spk . . .

I hope it works for you.

Cheers,
Ryo


--


REGARDS

Saurabh Rathore
Research Scholar (PhD.)
Centre For Oceans, Rivers, Atmosphere & Land Science Technology
Indian Institute Of Technology, Kharagpur
contact :- 91- 8345984434

[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement