Re: Change mpLimitMode

From: David Brown <dbrown_at_nyahnyahspammersnyahnyah>
Date: Tue Oct 16 2012 - 16:30:34 MDT

You have attached the 2d coordinate attributes to the 'speed' variable but you need (also) to attach them to u and v variables. Alternatively you can set

res@vfXArray = lon2d ; vector field coordinate resources
res@vfYArray = lat2d

 -dave

On Oct 16, 2012, at 10:07 AM, Yann Bertrand wrote:

> hello,
> I managed to create a map with a wind grib file as input (WRF NNM)
> it works fine! but I want to know how to create a map of a subdomain of my domain pricipal.
> If I change corners (lat,lon) I get the right map in the background (the right subdomain) but the vectors are those of the primary domain.
> How can I get the correct vectors in the subdomain?
> Thanks in advance.
>
> .................
>
> f = addfile ("mygrib.grib2", "r")
> wks = gsn_open_wks("ps","out")
>
> u = f->UGRD_P0_L103_GLC0
> v = f->VGRD_P0_L103_GLC0
> speed = sqrt(u^2+v^2)*1.943846
> lat2d = f->gridlat_0
> lon2d = f->gridlon_0
>
> speed@lat2d = lat2d
> speed@lon2d = lon2d
> corners : ( 44.3, -3.5, 44.17, 45.9 )
> res@mpLimitMode = "Corners" ; choose range of map
>
> ;full map (display correctly the whole grib2 datas)
> ;res@mpLeftCornerLatF = lat2d@corners(0)
> ;res@mpLeftCornerLonF = lon2d@corners(0)
> ;res@mpRightCornerLatF = lat2d@corners(2)
> ;res@mpRightCornerLonF = lon2d@corners(2)
>
> ;My subdomain (vectors not working)
> res@mpLeftCornerLatF = 50.3
> res@mpLeftCornerLonF = -3.5
> res@mpRightCornerLatF = 46.1
> res@mpRightCornerLonF = 1
>
> res@mpProjection = "LambertConformal"
>
> plot = gsn_csm_vector_scalar_map(wks,u,v,speed,res)
>
>
>
> Variable: u
> Type: float
> Total Size: 35956 bytes
> 8989 values
> Number of Dimensions: 2
> Dimensions and sizes: [ygrid_0 | 89] x [xgrid_0 | 101]
> Coordinates:
> Number Of Attributes: 14
> center : US National Weather Service - NCEP (WMC)
> production_status : Operational products
> long_name : U-component of wind
> units : m s-1
> _FillValue : 1e+20
> coordinates : gridlat_0 gridlon_0
> grid_type : Lambert Conformal can be secant or tangent, conical or bipolar
> parameter_discipline_and_category : Meteorological products, Momentum
> parameter_template_discipline_category_number : ( 0, 0, 2, 2 )
> level_type : Specified height level above ground (m)
> level : 10
> forecast_time : 1
> forecast_time_units : hours
> initial_time : 10/15/2012 (12:00)
>
>
>
>
>
>
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Oct 16 16:30:42 2012

This archive was generated by hypermail 2.1.8 : Tue Oct 23 2012 - 11:10:04 MDT