[ncl-talk] Overlaying shapefile to the wrf plot
Rick Brownrigg
brownrig at ucar.edu
Tue Apr 9 07:04:34 MDT 2019
Hi,
Please reply to the ncl-talk -- I'm not expert with WRF and the group
offers a broader body of knowledge.
There are these two examples:
http://ncl.ucar.edu/Applications/wrfgsn.shtml#ex1
Particularly the "nogsn" example. It looks like maybe:
i) draw "contour"
ii) add the shapefile polylines to contour, like you have it now
iii) call wrf_map_overlay with just "contour" as the plot (not along with
the shapefile lines like you had initially)
iv) the calls to draw(contour) and frame(wks) should now be unnecessary.
If that doesn't work, perhaps take a look at the gsn-version of plotting
given in the link above.
Rick
On Tue, Apr 9, 2019 at 12:07 AM Ganesan M <ganeshcuraj at gmail.com> wrote:
> Hello Rick,
>
> Thanks for the clarification, I rearranged and tried plotting as you
> suggested. The problem now is that, polylines function takes only 4
> arguments; here we are giving 5 arguments and the error is shown as,
>
> fatal:syntax error: function gsn_add_shapefile_polylines expects 4
> arguments, got 5
> fatal:error at line 55 in file WRF_shp_overlay.ncl
>
> fatal:syntax error: function gsn_add_shapefile_polylines expects 4
> arguments, got 5
> fatal:error at line 56 in file WRF_shp_overlay.ncl
>
> fatal:Syntax Error in block, block not executed
> fatal:error at line 61 in file WRF_shp_overlay.ncl
>
> Now I tried removing an argument like lnres and plotted, it is overlaying
> the plot but not in an expected way, I have attached output file below for
> your reference, I think we are missing some command related to wrf so as to
> make it a domain overlay. I am not able to get it. kindly help me resolve
> this issue.
>
> Thank you. Regards
> Ganesan M.
>
>
> On Tue, 9 Apr 2019 at 02:45, Rick Brownrigg <brownrig at ucar.edu> wrote:
>
>> Hi,
>>
>> Its a little bit confusing. I see you are trying to use
>> wrf_map_overlays() to overlay the shapefiles on your contour plot. This
>> function is used to overlay plots that have been created by the various
>> wrf_ plotting routines (wrf_contour, wrf_vector, etc). onto a map
>> background.
>>
>> Polylines, polygons, extra text, etc. are drawn onto an *existing* plot
>> and that's why you are getting the error message -- argument 1 should be
>> the name of that plot. I think you need to rearrange things something like:
>>
>> res = opts
>> res at gsnDraw = False ;; these two lines are superfluous, as
>> wrf_contour doesn't draw immediately. They are required for gsn_xxx
>> plotting routines
>> res at gsnFrame = False ;; because those routines draw immediately, not
>> leaving a chance to draw polylines on top. These 2 prevent that auto draw.
>> .....
>> contour = wrf_contour(.....)
>> ind0_id = gsn_add_shapefile_polylines(wks,contour,
>> ind0_shp_name,mpres,lnres)
>> ind1_id = gsn_add_shapefile_polylines(wks,contour,
>> ind1_shp_name,mpres,lnres)
>> draw(contour)
>> frame(wks)
>>
>> Rick
>>
>> On Fri, Apr 5, 2019 at 6:17 AM Ganesan M <ganeshcuraj at gmail.com> wrote:
>>
>>> I am new to ncl, I am trying to plot wrf model output wind speed over
>>> Indian region. now normally the plots are generated, at this point I am
>>> trying to overlay India shapefile to the generated plot to see the state
>>> boundaries. but I am getting errors as follows,
>>>
>>> fatal:Argument type mismatch on argument (1) of
>>> (gsn_add_shapefile_polylines) can not coerce
>>> fatal:["Execute.c":8578]:Execute: Error occurred at or near line 24 in
>>> file WRF_vector_contour.ncl
>>>
>>> I am not able to figure where I am going wrong here.
>>>
>>> I need to know, whether there is any pre-buit ncl script to load, as to
>>> show the India map with state boundaries. Is there any way to overlay the
>>> shapefile while the plotting the wrf variables?
>>> I am attaching the ncl script that I am working on, please help me with
>>> this issue.
>>>
>>> Thank you. Regards
>>> Ganesan M.
>>> _______________________________________________
>>> ncl-talk mailing list
>>> ncl-talk at ucar.edu
>>> List instructions, subscriber options, unsubscribe:
>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190409/344eec7e/attachment.html>
More information about the ncl-talk
mailing list