[ncl-talk] *******Position of shape-file move to the right by narrowing the lat/lon*******

Adam Phillips asphilli at ucar.edu
Tue Apr 9 10:27:16 MDT 2024


Hi Setareh,
Note that in the example I pointed you to that mpMinLatF/mpMaxLonF etc are
not the resources that are used. You need to set the special
Xstart/Xend/Ystart/Yend resources and pass them to wrf_map_resources:
;---Draw subsetted domain over zoomed in map
  res at ZoomIn = True        ; Tell wrf_map_resources we want to zoom in.
  res at Xstart = 42     ; Set these four special WRF resources
  res at Xend   = 61       ; required for zooming.
  res at Ystart = 30
  res at Yend   = 40
  res = wrf_map_resources(a,res)   ; must call this again after setting
ZoomIn/X/Ystart/end
  plot = gsn_csm_contour_map(wks,h,res)

  shapefile_name1 = "Ostan.shp"
  shapefile_name2 = "City-Poligon6.shp"
  lnres = True
  lnres at gsLineThicknessF = 4.0
  lnres at gsLineColor = "Black"
  shape1 = gsn_add_shapefile_polylines(wks,plot,shapefile_name1,lnres)
  shape2 = gsn_add_shapefile_polylines(wks,plot,shapefile_name2,lnres)
  draw(plot)
  frame(wks)

Best,
Adam

On Sat, Apr 6, 2024 at 5:14 AM Setareh Rahimi <setareh.rahimi at gmail.com>
wrote:

> Dear Adam,
>
> Thank you so much for your suggestion. I added the following lines
> (highlighted) to my script but I still have the same problem.
>
>   res at mpLimitMode          = "LatLon"          ; choose region of map
>
>   *res at ZoomIn               = True*
>
>   res at mpMaxLatF            = 40      ; choose subregion
>
>   res at mpMinLatF            = 30
>
>   res at mpMaxLonF            = 61
>
>   res at mpMinLonF            = 42
>
>
>  r*es = wrf_map_resources(f,res) **  ; must call this again after setting
> ZoomIn/X/Ystart/end*
>
> please check the attached and please advise me where I made the mistakes.
> Thanks,
>
> On Sat, Apr 6, 2024 at 3:25 AM Adam Phillips <asphilli at ucar.edu> wrote:
>
>> Hi Setareh,
>> See example #2 here for how to zoom in on a plot when you are
>> using wrf_map_resources:
>> https://www.ncl.ucar.edu/Applications/wrfzoom.shtml#ex2
>> Best,
>> Adam
>>
>> On Wed, Apr 3, 2024 at 4:26 AM Setareh Rahimi via ncl-talk <
>> ncl-talk at mailman.ucar.edu> wrote:
>>
>>> Dear NCL users,
>>>
>>> I tried to plot the total precipitation for 2021-03_12 (24 hours), using
>>> the attached script. However, once I tried to zoom in on the study area to
>>> better show the result by shortening the lat/lon range I noticed the
>>> position of the shapefile on the plot was not correct ( it moved to the
>>> right). How can I fix the shape file to the right position? ( please check
>>> the attached images).
>>>
>>> please help me to sole this issue.
>>> Thanks.
>>>
>>> --
>>> S.Rahimi
>>>
>>> _______________________________________________
>>> ncl-talk mailing list
>>> ncl-talk at mailman.ucar.edu
>>> List instructions, subscriber options, unsubscribe:
>>> https://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>
>>
>>
>> --
>> Adam Phillips
>> Associate Scientist IV, Climate Analysis Section
>> Climate and Global Dynamics Laboratory
>> National Center for Atmospheric Research
>> www.cgd.ucar.edu/staff/asphilli/
>>
>> <http://www.cgd.ucar.edu/staff/asphilli>
>>
>
>
> --
> S.Rahimi
>
>

-- 
Adam Phillips
Associate Scientist IV, Climate Analysis Section
Climate and Global Dynamics Laboratory
National Center for Atmospheric Research
www.cgd.ucar.edu/staff/asphilli/

<http://www.cgd.ucar.edu/staff/asphilli>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20240409/bb243673/attachment.htm>


More information about the ncl-talk mailing list