New colormaps for ncview

Discussion on computers, ROMS installation and compiling

Moderators: arango, robertson

Post Reply
Message
Author
User avatar
shchepet
Posts: 188
Joined: Fri Nov 14, 2003 4:57 pm

New colormaps for ncview

#1 Unread post by shchepet »

This post is for people who like to use "ncview" as a quick tool to visualize
netCDF files, such as ROMS output (or of any other origin), and who wants to
customize color palettes built-in into by this tool.

Ncview is designed by David Pierce,
http://meteora.ucsd.edu/~pierce/home_page.html
and it source code is available from
http://meteora.ucsd.edu/~pierce/ncview_home_page.html
so in most cases it is just a "configure --> make --> make install" thing
[provided that you have C-compiler, netCDF library installed, and few other
things like netpbm package (comes with Linux) and the associated header
files].


I designed several new colormaps, and made them into .h files, the they
behave like built-in when ncview source is modified a little bit to make it
aware of the new maps. I made them available as
http://www.atmos.ucla.edu/~alex/ROMS/nc ... aps.tar.gz
For those who are interested, I suggest first to get ncview from the original
web page of David Pierce (current versions are 1.93g and 2.0beta4), compile
and make sure that it works. Then obtain my file, ncview_colormaps.tar.gz,
unpack it, and make few changes in the main source file ncview.c.


Content of file ncview_colormaps.tar.gz

Code: Select all

   ncview.c
   colormaps_bright.h
   colormaps_rainbow.h
   colormaps_banded.h
   colormaps_blue_red.h
   colormaps_jaison.h
   colormaps_jaisn2.h
   colormaps_blu_red.h
   colormaps_jaisnc.h
   colormaps_jaisnb.h
   colormaps_jaisnd.h
   colormaps_jet.h
   colormaps_wheel.h
   colormaps_roullet.h
   colormaps_manga.h
where "ncview.c" is the modified ncview.c from version 1.93g. Very simple,
I just touched it in three places and placed comments with my name,
"Shchepetkin" so you can obviously see what are the changes.
It is self-explanatory. If you use version 1.93g, you may just substitute
the file; if you use another version -- do not substitute, but copy paste
the changes.

All other files are color palettes -- basically C-declarations of initialized
arrays. Place them into the same directory as ncview.c. This is safe: none
of the names of colormaps coincides wit the original filenames.

Then recompile, reinstall, enjoy.

jcwarner
Posts: 1200
Joined: Wed Dec 31, 2003 6:16 pm
Location: USGS, USA

Re: New colormaps for ncview

#2 Unread post by jcwarner »

we had our administrator install these new colormaps. They work great! Thanks Sasha.
Do you have a favorite for SST?

User avatar
shchepet
Posts: 188
Joined: Fri Nov 14, 2003 4:57 pm

Re: New colormaps for ncview

#3 Unread post by shchepet »

Lucky you, -- you have system administrator.

Well, these are colors ... so they are just a matter of taste.

"bright" is general purpose and works for local SST. On a large scale model, that is the whole Pacific
"banded" can show more detail, while keeping wide range; "rainbow" is overused here in UCLA, so I start
hating it; it shows good contrast, but may spuriously highlight fronts; "jaisn[b-c-d]" and "red_blu" are
most logical for anomalies and vorticity (with neutral color white, and easy to interpret by cold and
warm colors), although red-white-blue is heavily abused by climate people. They are also printer friendly.
The difference between b-c-d is 15-degree offset in centering;
"jet" is obviously for Matlab addicts;
"wheel" (a periodic rainbow) is useful for tidal phase, then 0 and 360 means the same.


What else?

All of the above are analytical functions created by the same Fortran code with numerous CPP switches;

User avatar
arango
Site Admin
Posts: 1367
Joined: Wed Feb 26, 2003 4:41 pm
Location: DMCS, Rutgers University
Contact:

Re: New colormaps for ncview

#4 Unread post by arango »

I have not seen this yet but I noticed that you are not including the zebra palette (it is nonlinear) and great for salinity sometimes:
S10m_760_001.gif
S10m_760_001.gif (57.71 KiB) Viewed 13425 times
I also like the GEBCO palette for topography (ocean and land):
bath.gif
bath.gif (177.67 KiB) Viewed 13425 times

jcwarner
Posts: 1200
Joined: Wed Dec 31, 2003 6:16 pm
Location: USGS, USA

Re: New colormaps for ncview

#5 Unread post by jcwarner »

Hernan-
are those color schemes default in ncview, or did you add them?

User avatar
arango
Site Admin
Posts: 1367
Joined: Wed Feb 26, 2003 4:41 pm
Location: DMCS, Rutgers University
Contact:

Re: New colormaps for ncview

#6 Unread post by arango »

I don't know. This is plotted with ROMS plotting package. I also have Matlab scripts for these palettes.
zebra.m
(933 Bytes) Downloaded 1532 times
gebco.m
(1.27 KiB) Downloaded 1567 times

feroda

Re: New colormaps for ncview

#7 Unread post by feroda »

It seems the figures posted by Herman are plotted by ROMS Plotting Package. On seeing the sections(marked by 1,2,3,4,5,6) on the second figure, I think of one question that has always been in my mind-- Can the plotting package plots sections that are curve or connecting any two locations, instead of exactly zonal or meridional ones?

ocefpaf
Posts: 2
Joined: Thu Apr 30, 2009 12:36 pm
Location: SMAST

Re: New colormaps for ncview

#8 Unread post by ocefpaf »

[quote="shchepet"]Lucky you, -- you have system administrator.

For those that are not that lucky but are using OpenSuse, this repository contains ncview already patched with the extra colormaps+netcdf4:

http://download.opensuse.org/repositori ... SUSE_11.2/

BTW thanks shchepet for the colormaps!

Post Reply