Re: sptial distribution

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Thu, 20 Jul 2006 14:35:50 -0600 (MDT)

Also, for efficiency purposes, you can get rid of do loops like:

  do ilon=0,lon_nbr-1
    lon(ilon) = -177.5+ilon*5.
  end do

with:

  lon = -177.5 + ispan(0,lon_nbr-1,1) * 5.

--Mary

On Thu, 20 Jul 2006, Michael Notaro wrote:

> I usually do this:
>
> lat!0="lat"
> lat&lat=lat
> lat_at_units="degrees_north"
> lon!0="lon"
> lon&lon=lon
> lon_at_units="degrees_east"
>
> data!0="lat"
> data!1="lon"
> data&lat=lat
> data&lon=lon
>
> I am sure there is a better way but it works at least.
> Mike
>
> On Jul 20, 2006, at 2:04 PM, cluo_at_uci.edu wrote:
>
>> Hi All,
>>
>> 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)
>>
>>
>>
>> _______________________________________________
>> ncl-talk mailing list
>> ncl-talk_at_ucar.edu
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk_at_ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Jul 20 2006 - 14:35:50 MDT

This archive was generated by hypermail 2.2.0 : Thu Jul 20 2006 - 14:36:52 MDT