Re: sptial distribution

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Thu, 20 Jul 2006 14:47:37 -0600 (MDT)

>I read data from ASC file. Then I define lat and lon and plot the data
>over the global region, but the distribution is wrong. This error is
>related to lat and lon of data I think. But I don't know how the lat and
>lon associate to data coordinates correctly?
>
>Thanks,
>
>Chao
>
>The part of script I used as follows:
>
>
>spe_nbr = 48
>lat_nbr = 46
>lon_nbr = 72
>data = asciiread("./annl_avg_emi95.dat" \
> , (/lon_nbr,lat_nbr,spe_nbr/),"float")
>
>;;;define lat and lon
>lat = new ((/lat_nbr/), float)
>lon = new ((/lon_nbr/), float)
>
>do ilon=0,lon_nbr-1
>lon(ilon) = -177.5+ilon*5.
>end do
>
>lat(0)=-89.0
>lat(lat_nbr-1)=89.0
>do ilat=1, lat_nbr-2
>lat(ilat)=-86.00 + 4.*(ilat-1)
>end do
>
>.
>.
>.
>
>plot(1) = gsn_csm_contour_map_ce(wks_id,data(;,;,0),res1)
>_______________________________________________

Here is what I suggest:

load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"

  lat = latGlobeFo (lat_nbr, "lat", "latitude", "degrees_north")
  lon = lonGlobeFo (lon_nbr, "lon", "longitude", "degrees_east")
  lon = (/ lon - 180. /) ; subtract 180 from all values
  lon&lon = lon ; update coordinates
  
  printVarSummary(lat)
  printVarSummary(lon)

http://www.ncl.ucar.edu/Document/Functions/Contributed/latGlobeFo.shtml
http://www.ncl.ucar.edu/Document/Functions/Contributed/lonGlobeFo.shtml

---
  data!0   = "lat"
  data!1   = "lon"
  data&lat =  lat
  data&lon =  lon
  
good luck
D
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Jul 20 2006 - 14:47:37 MDT

This archive was generated by hypermail 2.2.0 : Fri Jul 21 2006 - 08:53:09 MDT