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

Barry Lynn barry.h.lynn at gmail.com
Fri Nov 25 05:31:33 MST 2016


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/NclVariables.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.
> >
> > Thank you for solving this problem.
> >
> > Barry Lynn
> >
> > On Thu, Nov 24, 2016 at 3:13 AM, David Brown <dbrown at ucar.edu> wrote:
> >
> >> I am attaching a modified script that works on your data (except you
> need
> >> to figure out what you want to do about the titles). Most of your script
> >> was okay except for a few crucial points.
> >>
> >> Main points to remember:
> >> All the resource warning messages come from setting map resources for a
> >> plot that does not include a map -- the warnings are not fatal, these
> >> resources will simply be ignored. So don't copy the resources from the
> >> contour map to the plain contour. Instead start over with a new resource
> >> variable. You had
> >> zres = res     ; copies all the attributes of "res" to "zres"
> >> Instead
> >> zres = True
> >>
> >> Since you are doing a native plot (tfDoNDCOverlay = True) you also need
> to
> >> set this for the overlay plot (contour_z):
> >>
> >> zres at tfDoNDCOverlay = True
> >>
> >> Finally whenever you call the "draw" routine, you also need to call
> >> "frame", so:
> >>
> >> draw(contour_rh)
> >> frame(wks)
> >>
> >> Hope this helps.
> >>  -dave
> >>
> >>
> >>
> >>
> >> On Wed, Nov 23, 2016 at 12:58 PM, Barry Lynn <barry.h.lynn at gmail.com>
> >> wrote:
> >>
> >>> Dave: Please see below.
> >>>
> >>> But first: Here are the three components needed to test the program.
> >>>
> >>> 1) The file, 2) the ncl program, and 3 the get_ij.f, which has to be
> >>> wrapped.
> >>>
> >>> Dave: You wrote:  "The problem is that both your individual plots are
> >>> drawn using a map projection. You should draw the contour_z field
> >>> without the map
> >>> projection using "gsn_csm_contour". Then you will be able to do the
> >>> overlay without error."
> >>>
> >>> If I remove the "map" from the second gsn_csm_contour command, I just
> get
> >>> those warnings again and no overlay.
> >>>
> >>> Thank you,​
> >>>  namanl_218_20130208_1800_000.grb
> >>> <https://drive.google.com/file/d/0B3E3GjUeKpBdQWhSVFpISWM2SkE/
> view?usp=drive_web>
> >>> ​
> >>>
> >>> On Wed, Nov 23, 2016 at 9:26 PM, Barry Lynn <barry.h.lynn at gmail.com>
> >>> wrote:
> >>>
> >>>> Hello:
> >>>>
> >>>> I am trying to overlay the height field from the NAM on the relative
> >>>> humidity.
> >>>>
> >>>> I succeeded to zoom and project the NAM fields correctly, and I
> >>>> succeeded to make two separate plots, both of which were projected
> >>>> correctly.
> >>>>
> >>>> I consulted these two pages.
> >>>>
> >>>> http://www.ncl.ucar.edu/Applications/Scripts/lcnative_2.ncl
> >>>>
> >>>> and:
> >>>>
> >>>> http://www.ncl.ucar.edu/Applications/Scripts/conOncon_2.ncl
> >>>>
> >>>> I can create test.00001, and test.00002 using the attached ncl code.
> >>>>
> >>>> However, I cannot create the overlay.
> >>>>
> >>>> I try to do this using the last two lines of the code:
> >>>>
> >>>>   overlay(contour_rh,contour_z)
> >>>>   draw(contour_rh)
> >>>>
> >>>>
> >>>> But, I get this error.
> >>>>
> >>>> fatal:NhlAddOverlay: plot class mapPlotClass cannot be overlay plot
> >>>> member
> >>>>
> >>>> If I try to change gsn_csm_contour_map to gsn_csm_contour to then
> invoke
> >>>> the overlay procedure, I get:
> >>>>
> >>>>
> >>>>
> >>>> warning:mpProjection is not a valid resource in test_contour at this
> time
> >>>> warning:mpLimitMode is not a valid resource in test_contour at this
> time
> >>>> warning:mpLeftCornerLonF is not a valid resource in test_contour at
> this
> >>>> time
> >>>> warning:mpRightCornerLonF is not a valid resource in test_contour at
> >>>> this time
> >>>> warning:mpLeftCornerLatF is not a valid resource in test_contour at
> this
> >>>> time
> >>>> warning:mpRightCornerLatF is not a valid resource in test_contour at
> >>>> this time
> >>>> warning:mpLambertMeridianF is not a valid resource in test_contour at
> >>>> this time
> >>>> warning:mpLambertParallel1F is not a valid resource in test_contour at
> >>>> this time
> >>>> warning:mpLambertParallel2F is not a valid resource in test_contour at
> >>>> this time
> >>>> warning:mpOutlineDrawOrder is not a valid resource in test_contour at
> >>>> this time
> >>>> warning:mpFillOn is not a valid resource in test_contour at this time
> >>>> warning:mpOutlineBoundarySets is not a valid resource in test_contour
> at
> >>>> this time
> >>>> fatal:NhlAddOverlay: plot class mapPlotClass cannot be overlay plot
> >>>> member
> >>>>
> >>>> and the projection is lost.
> >>>>
> >>>> Your suggestions are appreciated.
> >>>>
> >>>> Barry Lynn
> >>>>
> >>>>
> >>>> --
> >>>> 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
> >>>>
> >>>
> >>>
> >>>
> >>> --
> >>> 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
> >>>
> >>> _______________________________________________
> >>> ncl-talk mailing list
> >>> ncl-talk at ucar.edu
> >>> List instructions, subscriber options, unsubscribe:
> >>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
> >>>
> >>>
> >>
> >
> >
> > --
> > 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
>
>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>



-- 
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/20161125/851d26c7/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.000003.png
Type: image/png
Size: 195990 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20161125/851d26c7/attachment-0002.png 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.000003.png
Type: image/png
Size: 193009 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20161125/851d26c7/attachment-0003.png 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: plot_native.ncl
Type: application/octet-stream
Size: 7008 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20161125/851d26c7/attachment-0002.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: get_ij.f
Type: application/octet-stream
Size: 932 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20161125/851d26c7/attachment-0003.obj 


More information about the ncl-talk mailing list