[ncl-talk] Map_options_error
Karin Meier-Fleischer
meier-fleischer at dkrz.de
Tue Jul 14 06:01:15 MDT 2015
Hi Sebastian,
you are using min(lon), max(lon), min(lat) and max(lat) to define the
map border.
To see which min/max lat/lon values are in your data, do:
print(min(lon))
print(max(lon))
print(min(lat))
print(max(lat))
I don't know much about WRF files and the routine *wrf_user_getvar**,
*but maybe you should
use the same lat and lons of the variables u and v (XLAT, XLON) which
you use to define the
lon2d attributes for u and v. Maybe they are different to the lon and
lat values.
minlat = min(sfile->XLAT(0,:,:)
maxlat = max(sfile->XLAT(0,:,:)
minlon = min(sfile->XLAT(0,:,:)
maxlon = max(sfile->XLAT(0,:,:)
If you want to use mpMinLonF, mpMaxLonF, mpMinLatF and mpMaxLatF you should
set the resource mpLimitMode to "LatLon":
res at mpLimitMode = "LatLon"
See: http://ncl.ucar.edu/Document/Graphics/Resources/mp.shtml#mpMinLonF
Bye,
Karin
Am 14.07.15 um 01:07 schrieb Sebastian Otarola-Bustos:
> HI,
>
> I'm doing a vector animation over a map, and for some reason I still
> don't know. I cannot see the results because the map is much bigger
> than my domain. I also tried to fit these map to the maximum and
> minimum latitudes of my domains, but it seems that dont work. I'm
> showing you my script, any help would be really appreciated:
>
> Var =1
>
> lat = wrf_user_getvar(sfile,"lat",-1)
>
> lon = wrf_user_getvar(sfile,"lon",-1)
>
> times = wrf_user_getvar(sfile,"times",-1)
>
>
> u = sfile->U10
>
> v = sfile->V10
>
> u at units ="m/s"
>
> v at units ="m/s"
>
> u at lat2d = sfile->XLAT(0,:,:)
>
> u at lon2d = sfile->XLONG(0,:,:)
>
> v at lat2d = sfile->XLAT(0,:,:)
>
> v at lon2d = sfile->XLONG(0,:,:)
>
> speed = sqrt(u^2+v^2)
>
> speed at units = "m/s"
>
> speed at lat2d = sfile->XLAT(0,:,:)
>
> speed at lon2d = sfile->XLONG(0,:,:)
>
>
> minlat = min(lat)
>
> maxlat = max(lat)
>
> minlon = min(lon)
>
> maxlon = max(lon)
>
>
> dims = dimsizes(u)
>
> ntimes = dims(0)
>
> nlat = dims(1)
>
> nlon = dims(2)
>
>
>
> ;---Set some resources
>
> res = True
>
> res at gsnMaximize = True
>
> res at vcRefMagnitudeF = 10.0
>
> res at vcRefLengthF = 0.05
>
> res at vcGlyphStyle = "CurlyVector"
>
> res at vcMinDistanceF = 0.025
>
> res at vcRefAnnoOrthogonalPosF = 0.01
>
> res at vcLevelSelectionMode = "ExplicitLevels"
>
> res at vcLevels = ispan(0,20,5)
>
> res at mpMinLatF = minlat
>
> res at mpMaxLatF = maxlat
>
> res at mpMinLonF = minlon
>
> res at mpMaxLonF = maxlon
>
> res at mpCenterLonF = (minlon+maxlon)*0.5
>
> res at mpCenterLatF = (minlat+maxlat)*0.5
>
> res at pmTickMarkDisplayMode = "Always"
>
> res at lbLabelFontHeightF = 0.02
>
> do n=0,ntimes-1
> wks = gsn_open_wks("png","animate"+sprinti("%03i",n)) ;
> animate_00.png, animate_01.png, etc
> gsn_define_colormap(wks,"gui_default")
> print("Trabajando en el tiempo: " + times(n))
> res at gsnRightString = " Velocity(m/s): "+ times(n)
> res at gsnLeftString = " "
> res at gsnDraw = False
> res at gsnFrame = False
>
> plotB =gsn_csm_vector_map(wks,u(n,:,:),v(n,:,:),res)
>
> draw(plotB)
> frame(wks)
> delete(wks) ; Make sure PNG file is closed
> end do
>
>
>
> All the best,
> Sebastián.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150714/a99650eb/attachment.html
More information about the ncl-talk
mailing list