[ncl-talk] Can't overlay maps on a NAM (native grid)

Barry Lynn barry.h.lynn at gmail.com
Sat Nov 26 11:01:30 MST 2016


Giannis:

Thank you!

On Sat, Nov 26, 2016 at 6:47 PM, <gtego at physics.auth.gr> wrote:

> Hi,
>
> Ι don't mind at all, feel free to copy it.
>
> I should have done it anyway!
>
> Giannis
>
>
>
> Quoting Barry Lynn <barry.h.lynn at gmail.com>:
>
> Hi Ioannis:
>>
>> Thank you.
>>
>> Do you mind if we copy NCL-Talk so people note that you kindly answered?
>>
>> Barry
>>
>>
>>
>>
>>
>> On Sat, Nov 26, 2016 at 5:41 PM, <gtego at physics.auth.gr> wrote:
>>
>> Hi,
>>>
>>> this is what I have found trying to answer your questions (which were
>>> also
>>> my questions recently :-) )
>>>
>>> a very usefull function to interpret the position of each object is the
>>> following:
>>>
>>> drawNDCGrid(wks)
>>>
>>> (add also   load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"
>>> at the beggining of the file)
>>>
>>> It displays the auxiliarly grid of the Normalized Device Coordinates of
>>> the plotting space.
>>>
>>> I placed the function (for testing purposes) just before line
>>> "  contour_rh = gsn_csm_contour_map(wks,rh_plane,res)"
>>> in your script.
>>>
>>> If you do that you will see that the plot has a height of 0.6 units
>>> (normalized....) from 0.2 to 0.8.
>>> You will also see that the text "Relative humidity" is placed at 0.85 in
>>> the vertical grid.
>>> By using gsnLeftStringOrthogonalPosF  (needed only in the Relative
>>> Humidity part of the script) you can move the text up of down.
>>>
>>> For example if you want to move the text to the lower part of the plot
>>> (located at 0.2) you have to move it down (thus you will use - minus) by
>>> 0.85-0.2 = 0.65units. But those units must be expressed in plot hight
>>> units...
>>> So you will divide 0.65 by 0.60 and you will get 1.0833333333.
>>>
>>> So setting  res at gsnLeftStringOrthogonalPosF = -1.0833333 will move the
>>> text down to the lower left corner of the plot.
>>>
>>> The same applies to the horizontal position.
>>>
>>> So far all the above had worked for me. I haven't gone deep into the
>>> source code to prove they are true though.
>>>
>>> I found very helpfull the pdf at the link below:
>>> https://www.dkrz.de/Nutzerportal/doku/vis/vis-sw/de-ncl/de-
>>> DKRZ_NCL_Supplements_Doc_layout.pdf
>>> by Karin Meier-Fleischer
>>>
>>> Ioannis Tegoulias
>>>
>>>
>>>
>>> Quoting Barry Lynn <barry.h.lynn at gmail.com>:
>>>
>>> Hi:
>>>
>>>>
>>>> Thank you for the suggestion.
>>>>
>>>> The first attachment show what the old code produced.
>>>>
>>>> The second the new with my interpreted changes based on your
>>>> suggestion. I
>>>> added those resources to res and zres.
>>>>
>>>> The result was that now I see "Relative Humidity" on the left and gpm on
>>>> the right.  Before, there was "Relative Humidity" and "Geopotential
>>>> Height"
>>>> on the left.
>>>>
>>>> I really would like to push Relative Humidity down to the label bar, but
>>>> am
>>>> also curious what I've done incorrectly in trying to place the labels on
>>>> the left and right sides.
>>>>
>>>> Thank you
>>>> P.S. the get_ij,f needs to be "WRAPPED."
>>>>
>>>> On Fri, Nov 25, 2016 at 1:41 PM, <gtego at physics.auth.gr> wrote:
>>>>
>>>> Hi!
>>>>
>>>>>
>>>>> The resources
>>>>>
>>>>>    gsnLeftStringParallelPosF
>>>>>    gsnLeftStringOrthogonalPosF
>>>>>
>>>>>    gsnRightStringParallelPosF
>>>>>    gsnRightStringOrthogonalPosF
>>>>>
>>>>> set the horizontal and vertical position for the "long_name" and
>>>>> "unit" respectively.
>>>>>
>>>>> Setting them (Parallel~ 0.5 and Orthogonal~ -1.5) before plotting the
>>>>> Relative Humidity plot does the job.
>>>>>
>>>>>
>>>>> Giannis Tegoulias
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> Quoting Barry Lynn <barry.h.lynn at gmail.com>:
>>>>>
>>>>> > Hi:
>>>>> >
>>>>> > I haven't been able to move the title Relative Humidity to the label
>>>>> bar
>>>>> > below. Nor, can I move it to the right.  Part of the problem is that
>>>>> I
>>>>> > don't know how to reference them, so setting their position with
>>>>> title
>>>>> > position information doesn't help.
>>>>> >
>>>>> > The name Relative Humidity, like the name Geopotential Height, comes
>>>>> from
>>>>> > the attribute list.
>>>>> >
>>>>> > Usually, titles (data attributes) are automatically placed correctly
>>>>> on
>>>>> the
>>>>> > page.
>>>>> >
>>>>> > I have consulted pages like:
>>>>> >
>>>>> > https://www.ncl.ucar.edu/Applications/title.shtml
>>>>> >
>>>>> > and I have read about variable attributes,
>>>>> >
>>>>> > https://www.ncl.ucar.edu/Document/Manuals/Ref_Manual/NclVari
>>>>> ables.shtml
>>>>> >
>>>>> > *Moreover: the page that deals with Overlays shows an example where
>>>>> the
>>>>> > variable names are space correctly, but never referenced (or their
>>>>> > positions defined).*
>>>>> >
>>>>> > http://www.ncl.ucar.edu/Applications/Scripts/overlay_1.ncl
>>>>> >
>>>>> > I have made other searches using various key words, but this
>>>>> situation
>>>>> > seems to be unusual (as resulting from the use of overlay).
>>>>> >
>>>>> > I realize that this may be a trivial thing, but it is not unimportant
>>>>>
>>>>
>
>
>


-- 
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/20161126/f7102219/attachment.html 


More information about the ncl-talk mailing list