[ncl-talk] Make White: Isolated the Problem with color bar

Barry Lynn barry.h.lynn at gmail.com
Fri Sep 29 02:45:42 MDT 2017


HI:

I think I have isolated the problem.

(And, as I wrote in the previous e-mail -- I am sorry you had to do extra
work to decipher the code I sent (the last e-mail was part of a chain, and
I should have repeated pertinent information within).

Anyway, in the program attached, there is a line:

gsn_define_colormap(wks,"rainbow")

when commented out, you get mod_2.pdf (shades of blue).  When uncommented,
you get mod.pdf (a color bar the same as the "incorrect" one we tried to
figure out yesterday in the original program).

As noted, the mod.pdf has the same color bar as the one I mentioned
yesterday.  It is different than the color bar I get when plotting the
observations (previous e-mail).  However, the program that plots the radar
observations doesn't have the gfs_define_colormap -- yet it works fine
whether I use NCV_jet or define the colors explicitly.

So, I think the issue is how to reference the color bar table when using
this WRF program.

Thank you/Have a nice weekend,

Barry

P.S. I am plotting a random field, although I still read the file I sent
you yesterday.




On Fri, Sep 29, 2017 at 5:02 AM, Barry Lynn <barry.h.lynn at gmail.com> wrote:

> HI Mary, Kevin:
>
> Thank you for your help.
>
> I am sorry about the file, but the original one was 380 GB.  When I ran
> the program with just the file I uploaded, I just changed the file name,
> and outputted a single panel.  This was enough to see the problem, and I
> should have made this more clear in the *last *e-mail in the chain.
>
> Anyway, more important is that when I run your program on my computer with
> WPS 6.3, I get a different color bar.
>
> I get the same color bar as before: wrong.
>
> The strange thing is that if I ​
>  KOKX_V06_20130209_000138.nc
> <https://drive.google.com/file/d/0B3E3GjUeKpBdYVEzN3ZxU0V2VHc/view?usp=drive_web>
> ​use the same color bar label in the program  that plots radar obs (I
> uploaded this in the first e-mail I sent), I get the correct color bar.
>
> I have uploaded one file with observed radar and modified the loop to plot
> a single panel (the others will be missing) -- if you want to compare
> programs.
>
> I hope this isn't too much of a conundrum!
>
> (P.S: I suppose I could try to modify the program that works to plot WRF
> data, instead.)
>
> [wrf at mn03 NAM_02_08_2013]$ which wps
>
> /usr/bin/which: no wps in (/usr/local/ncl/6.3.0/bin:/
> usr/local/ncl/6.2.1/bin:/usr/local/ncarg-4.4.2/bin:/opt/
> mvapich2-x/intel/bin:/usr/local/bin:/usr/lib64/qt-3.3/
> bin:/opt/intel/composer_xe_2013_sp1.2.144/bin/intel64:/
> bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/haim/bin)
>
> On Fri, Sep 29, 2017 at 2:01 AM, Mary Haley <haley at ucar.edu> wrote:
>
>> Barry,
>>
>> Thanks for providing the extra files. What version of NCL are you using?
>>
>> Kevin and I looked at this, but there are a number of problems that makes
>> this hard to debug.
>>
>> - When running the script on the data you provided, the field was
>> constant. I tried also tried to use QCLOUD, but it was also all 0.0
>>
>> - You appear to be using your own modified version of WRFUserARW.ncl, so
>> we commented this out and used the one that comes with NCL
>>
>> - As you pointed out, there's only one time step, so we had to modify the
>> script so itime = 0.  This causes a problem because now there are not 6
>> plots to panel. We had to modify the code to copy the one plot to an array
>> of 6 plots.
>>
>>  - We removed a lot of the commented code just to make it easier to see
>> what was going on.  There was also some code in there that should be there,
>> like:
>>
>>    grid at lat2d = xlat2d_m     ; this is for plotting
>>
>>
>>    grid at lon2d = xlon2d_m   ; using gsn_csm routines
>>
>> but this didn't hurt anything since you are not using gsn_csm routines.
>> Still, it's very important to keep an eye on code like this because it
>> could potentially affect your results.
>>
>> Even with these problems, we were able to get six plots, and you can see
>> the first color in the labelbar is white and the last color is the dark red
>> you expected.
>>
>> Are you sure that the image you included was generated from the script
>> that you attached in your email?  The reason I ask this is because this
>> line alone:
>>
>>       cmap(0,:) = 1.   ; Make first color white
>>
>>
>>
>> should have forced the first color in your labelbar to be white no matter
>> what else happened.  Also, the fact that you are using NCV_jet, which has
>> dark red as the last color, but you are seeing orange instead, leads me to
>> believe that perhaps a different color map is being used, and/or the
>> NCV_jet color table was modified, and/or the same script was not used.
>>
>> Please run the attached modified script on the same data set that you
>> provided us, and let me know if you get the attached image.
>>
>> In the future, please try to provide a script that works with the data
>> that you provide.  We had to do a number of modifications to get this code
>> to work.
>>
>> Thanks for your consideration.
>>
>> --Mary
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> On Thu, Sep 28, 2017 at 12:32 PM, Barry Lynn <barry.h.lynn at gmail.com>
>> wrote:
>>
>>> Hi:
>>>
>>> I downloaded the wrf output file to my computer and just uploaded it to
>>> your site.  The program data, which uses wrf variables to set the map, was
>>> not easy to create a smaller version of.
>>>
>>> Thank you for your patience while I sorted this out.
>>>
>>> wrfout_d01_2013-02-08_00:00:00.gz
>>>
>>> On Thu, Sep 28, 2017 at 8:30 PM, Barry Lynn <barry.h.lynn at gmail.com>
>>> wrote:
>>>
>>>> Hi:
>>>>
>>>> I can excerpt the required variables from the file, and upload them
>>>> from my computer (where ftp is working).
>>>>
>>>> However, I may wait until tomorrow (my time) to do it.
>>>>
>>>> So, if you don't have a wrf output handy, I will do this.
>>>>
>>>> Thank you for the help!
>>>>
>>>> Barry
>>>>
>>>> On Thu, Sep 28, 2017 at 8:16 PM, Barry Lynn <barry.h.lynn at gmail.com>
>>>> wrote:
>>>>
>>>>> Just in case, you need this program as well (WRAPIT...)
>>>>>
>>>>> On Thu, Sep 28, 2017 at 8:15 PM, Barry Lynn <barry.h.lynn at gmail.com>
>>>>> wrote:
>>>>>
>>>>>> Hi Adam:
>>>>>>
>>>>>> Thank you for mentioning this.
>>>>>>
>>>>>> I will need to ask my system administrator to add this as an option;
>>>>>> right now I can't use this command.
>>>>>>
>>>>>> However, this won't be until Monday, at the earliest.
>>>>>>
>>>>>> If there is a way to sftp that would be possible.
>>>>>>
>>>>>> Barry
>>>>>>
>>>>>> On Thu, Sep 28, 2017 at 7:46 PM, Adam Phillips <asphilli at ucar.edu>
>>>>>> wrote:
>>>>>>
>>>>>>> Hi Barry,
>>>>>>> (offline from ncl-talk)
>>>>>>> I was just able to logon to the ftp site by using ncftp (which
>>>>>>> automatically logs you on anonymously). I can't try with ftp as my servers
>>>>>>> (strangely) no longer seem to have ftp. So give ncftp a shot if you can. If
>>>>>>> you continue to have trouble I can speak with our systems folks. I know
>>>>>>> they've clamped down protocols a bit as some folks were abusing our ftp
>>>>>>> server.
>>>>>>> Adam
>>>>>>>
>>>>>>> On Thu, Sep 28, 2017 at 10:31 AM, Barry Lynn <barry.h.lynn at gmail.com
>>>>>>> > wrote:
>>>>>>>
>>>>>>>> Hi:
>>>>>>>>
>>>>>>>> Thank you for taking a look.
>>>>>>>>
>>>>>>>> It is WPS 6.3.
>>>>>>>>
>>>>>>>> I am trying to ftp to the ftp site, but after opening once, it
>>>>>>>> won't open again (and it didn't accept my password).
>>>>>>>>
>>>>>>>> ftp ftp.cgd.ucar.edu (can't enter).
>>>>>>>>
>>>>>>>> You can take any wrf output file (the only thing is that you need
>>>>>>>> to make sure that lats/lons settings are within the domain.  The other
>>>>>>>> thing is to set fft_zh to QCLOUD, for example.
>>>>>>>>
>>>>>>>> The plot doesn't matter, just that it should read one time step and
>>>>>>>> make the color bar incorrectly.
>>>>>>>>
>>>>>>>> Barry
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> On Thu, Sep 28, 2017 at 6:13 PM, Mary Haley <haley at ucar.edu> wrote:
>>>>>>>>
>>>>>>>>> Hi Barry,
>>>>>>>>>
>>>>>>>>> I couldn't reproduce your problem using a toy script. What version
>>>>>>>>> of NCL are you using?
>>>>>>>>>
>>>>>>>>> Can you upload the wrf output file so I can try running your
>>>>>>>>> script?
>>>>>>>>>
>>>>>>>>> http://www.ncl.ucar.edu/ftp_files.shtml
>>>>>>>>>
>>>>>>>>> Thanks,
>>>>>>>>>
>>>>>>>>> --Mary
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Thu, Sep 28, 2017 at 8:21 AM, Barry Lynn <
>>>>>>>>> barry.h.lynn at gmail.com> wrote:
>>>>>>>>>
>>>>>>>>>> Hi:
>>>>>>>>>>
>>>>>>>>>> I need to follow up.
>>>>>>>>>>
>>>>>>>>>> radar_panel.. plots nc data from the Weather Climate and Tool Kit
>>>>>>>>>> (anyone is welcome to use -- but I am not finished with that part of the
>>>>>>>>>> program to remove attenuation).
>>>>>>>>>>
>>>>>>>>>> The other program plots WRF radar data.
>>>>>>>>>>
>>>>>>>>>> I have attached data from the mapping of radar observations
>>>>>>>>>> (KOKX) and the WRF output.
>>>>>>>>>>
>>>>>>>>>> The radar observations have white space around a 150 km radius
>>>>>>>>>> because the data is undefined.
>>>>>>>>>>
>>>>>>>>>> I tried to do the same for the WRF output following Mary's
>>>>>>>>>> suggestion. However, there are two problems: i) even though I use the same
>>>>>>>>>> "NCV_jet" and ispan values in each, the color bar in the WRF mapping is not
>>>>>>>>>> the same (it needs to be redder on the right hand side).  ii) I would
>>>>>>>>>> expect white coloring in the first (leftmost) part of the colorbar, but
>>>>>>>>>> this doesn't seem to work correctly either. Both problems are probably
>>>>>>>>>> related.
>>>>>>>>>>
>>>>>>>>>> Thank you,
>>>>>>>>>>
>>>>>>>>>> Barry
>>>>>>>>>>
>>>>>>>>>> On Sun, Aug 6, 2017 at 9:53 AM, Michael Weston <
>>>>>>>>>> mjweston at masdar.ac.ae> wrote:
>>>>>>>>>>
>>>>>>>>>>> Thank you Mary!
>>>>>>>>>>>
>>>>>>>>>>> That is a much better approach :)
>>>>>>>>>>> Regards
>>>>>>>>>>> Michael
>>>>>>>>>>>
>>>>>>>>>>> On 04/08/2017 20:05, Mary Haley wrote:
>>>>>>>>>>>
>>>>>>>>>>> Hi Mike (and Barry),
>>>>>>>>>>>
>>>>>>>>>>> Just an FYI: I don't think you need to use cnFillColors. You can
>>>>>>>>>>> simply read the colormap you want, set the first color to white, and then
>>>>>>>>>>> load this new colormap using cnFillPalette:
>>>>>>>>>>>
>>>>>>>>>>>     cmap = read_colormap_file("BlueYellowRed")
>>>>>>>>>>>     cmap(0,:) = 1.   ; Make first color white
>>>>>>>>>>>
>>>>>>>>>>>     res at cnLevelSelectionMode = "ExplicitLevels"    ; set
>>>>>>>>>>> explicit contour levels
>>>>>>>>>>>     res at cnLevels        = (/0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1/)
>>>>>>>>>>>  ; 10 levels
>>>>>>>>>>>     res at cnFillPalette  = cmap
>>>>>>>>>>>
>>>>>>>>>>> If you want the first color to be transparent rather than white,
>>>>>>>>>>> then use:
>>>>>>>>>>>
>>>>>>>>>>>     cmap(0,3) = 0,0   ; Make first color transparent
>>>>>>>>>>>
>>>>>>>>>>> Cheers,
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> --
>>>>>>>>>>>
>>>>>>>>>>> *Michael* *Weston*
>>>>>>>>>>> Research Engineer
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> *A Part of Khalifa University of Science and Technology*
>>>>>>>>>>>
>>>>>>>>>>> PO Box 54224, Abu Dhabi,
>>>>>>>>>>> United Arab Emirates
>>>>>>>>>>> Office   +971 2 810 9510 <+971%202%20810%209510>
>>>>>>>>>>>
>>>>>>>>>>> Email   mjweston at masdar.ac.ae
>>>>>>>>>>>  http://www.masdar.ac.ae
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> *Please consider the environment before printing this email*
>>>>>>>>>>>
>>>>>>>>>>> This transmission is confidential and intended solely for the
>>>>>>>>>>> person or organization to whom it is addressed. It may contain privileged
>>>>>>>>>>> and confidential information. If you are not the intended recipient, you
>>>>>>>>>>> should not copy, distribute or take any action in reliance on it. If you
>>>>>>>>>>> have received this transmission in error, please notify us immediately by
>>>>>>>>>>> e-mail at *info at masdar.ae <info at masdar.ae>**.*
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> --
>>>>>>>>>> Barry H. Lynn, Ph.D
>>>>>>>>>> Senior Lecturer,
>>>>>>>>>> The Institute of the Earth Science,
>>>>>>>>>> The Hebrew University of Jerusalem,
>>>>>>>>>> Givat Ram, Jerusalem 91904, Israel
>>>>>>>>>> Tel: 972 547 231 170
>>>>>>>>>> Fax: (972)-25662581
>>>>>>>>>>
>>>>>>>>>> C.E.O, Weather It Is, LTD
>>>>>>>>>> Weather and Climate Focus
>>>>>>>>>> http://weather-it-is.com
>>>>>>>>>> Jerusalem, Israel
>>>>>>>>>> Local: 02 930 9525
>>>>>>>>>> Cell: 054 7 231 170
>>>>>>>>>> Int-IS: x972 2 930 9525
>>>>>>>>>> US 914 432 3108 <(914)%20432-3108>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>> Barry H. Lynn, Ph.D
>>>>>>>> Senior Lecturer,
>>>>>>>> The Institute of the Earth Science,
>>>>>>>> The Hebrew University of Jerusalem,
>>>>>>>> Givat Ram, Jerusalem 91904, Israel
>>>>>>>> Tel: 972 547 231 170
>>>>>>>> Fax: (972)-25662581
>>>>>>>>
>>>>>>>> C.E.O, Weather It Is, LTD
>>>>>>>> Weather and Climate Focus
>>>>>>>> http://weather-it-is.com
>>>>>>>> Jerusalem, Israel
>>>>>>>> Local: 02 930 9525
>>>>>>>> Cell: 054 7 231 170
>>>>>>>> Int-IS: x972 2 930 9525
>>>>>>>> US 914 432 3108 <(914)%20432-3108>
>>>>>>>>
>>>>>>>> _______________________________________________
>>>>>>>> ncl-talk mailing list
>>>>>>>> ncl-talk at ucar.edu
>>>>>>>> List instructions, subscriber options, unsubscribe:
>>>>>>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> Adam Phillips
>>>>>>> Associate Scientist,  Climate and Global Dynamics Laboratory, NCAR
>>>>>>> www.cgd.ucar.edu/staff/asphilli/   303-497-1726 <(303)%20497-1726>
>>>>>>>
>>>>>>> <http://www.cgd.ucar.edu/staff/asphilli>
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Barry H. Lynn, Ph.D
>>>>>> Senior Lecturer,
>>>>>> The Institute of the Earth Science,
>>>>>> The Hebrew University of Jerusalem,
>>>>>> Givat Ram, Jerusalem 91904, Israel
>>>>>> Tel: 972 547 231 170
>>>>>> Fax: (972)-25662581
>>>>>>
>>>>>> C.E.O, Weather It Is, LTD
>>>>>> Weather and Climate Focus
>>>>>> http://weather-it-is.com
>>>>>> Jerusalem, Israel
>>>>>> Local: 02 930 9525
>>>>>> Cell: 054 7 231 170
>>>>>> Int-IS: x972 2 930 9525
>>>>>> US 914 432 3108 <(914)%20432-3108>
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Barry H. Lynn, Ph.D
>>>>> Senior Lecturer,
>>>>> The Institute of the Earth Science,
>>>>> The Hebrew University of Jerusalem,
>>>>> Givat Ram, Jerusalem 91904, Israel
>>>>> Tel: 972 547 231 170
>>>>> Fax: (972)-25662581
>>>>>
>>>>> C.E.O, Weather It Is, LTD
>>>>> Weather and Climate Focus
>>>>> http://weather-it-is.com
>>>>> Jerusalem, Israel
>>>>> Local: 02 930 9525
>>>>> Cell: 054 7 231 170
>>>>> Int-IS: x972 2 930 9525
>>>>> US 914 432 3108 <(914)%20432-3108>
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Barry H. Lynn, Ph.D
>>>> Senior Lecturer,
>>>> The Institute of the Earth Science,
>>>> The Hebrew University of Jerusalem,
>>>> Givat Ram, Jerusalem 91904, Israel
>>>> Tel: 972 547 231 170
>>>> Fax: (972)-25662581
>>>>
>>>> C.E.O, Weather It Is, LTD
>>>> Weather and Climate Focus
>>>> http://weather-it-is.com
>>>> Jerusalem, Israel
>>>> Local: 02 930 9525
>>>> Cell: 054 7 231 170
>>>> Int-IS: x972 2 930 9525
>>>> US 914 432 3108 <(914)%20432-3108>
>>>>
>>>
>>>
>>>
>>> --
>>> Barry H. Lynn, Ph.D
>>> Senior Lecturer,
>>> The Institute of the Earth Science,
>>> The Hebrew University of Jerusalem,
>>> Givat Ram, Jerusalem 91904, Israel
>>> Tel: 972 547 231 170
>>> Fax: (972)-25662581
>>>
>>> C.E.O, Weather It Is, LTD
>>> Weather and Climate Focus
>>> http://weather-it-is.com
>>> Jerusalem, Israel
>>> Local: 02 930 9525
>>> Cell: 054 7 231 170
>>> Int-IS: x972 2 930 9525
>>> US 914 432 3108 <(914)%20432-3108>
>>>
>>
>>
>
>
> --
> Barry H. Lynn, Ph.D
> Senior Lecturer,
> The Institute of the Earth Science,
> The Hebrew University of Jerusalem,
> Givat Ram, Jerusalem 91904, Israel
> Tel: 972 547 231 170
> Fax: (972)-25662581
>
> C.E.O, Weather It Is, LTD
> Weather and Climate Focus
> http://weather-it-is.com
> Jerusalem, Israel
> Local: 02 930 9525
> Cell: 054 7 231 170
> Int-IS: x972 2 930 9525
> US 914 432 3108 <(914)%20432-3108>
>



-- 
Barry H. Lynn, Ph.D
Senior Lecturer,
The Institute of the Earth Science,
The Hebrew University of Jerusalem,
Givat Ram, Jerusalem 91904, Israel
Tel: 972 547 231 170
Fax: (972)-25662581

C.E.O, Weather It Is, LTD
Weather and Climate Focus
http://weather-it-is.com
Jerusalem, Israel
Local: 02 930 9525
Cell: 054 7 231 170
Int-IS: x972 2 930 9525
US 914 432 3108
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170929/4e4bd426/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: masdarlogo.jpg
Type: image/jpeg
Size: 5411 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170929/4e4bd426/attachment-0001.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mod.pdf
Type: application/pdf
Size: 51994 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170929/4e4bd426/attachment-0002.pdf>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mod_2.pdf
Type: application/pdf
Size: 53115 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170929/4e4bd426/attachment-0003.pdf>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: start_over.ncl
Type: application/octet-stream
Size: 3468 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170929/4e4bd426/attachment-0001.obj>


More information about the ncl-talk mailing list