[Thread Prev][Thread Next][Index]
[ferret_users] Attempting to weight cell values by average cell area of grid
- To: ferret_users@xxxxxxxx
- Subject: [ferret_users] Attempting to weight cell values by average cell area of grid
- From: Michael Kent <mastermikeofct@xxxxxxxxx>
- Date: Tue, 03 Nov 2009 09:58:53 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=OQRcQ3VeDR2Cf54S4MOVIoXvnw7VB1d9dcITFjbLeuA=; b=S9Xa0dIOoySioi/PT+BAa/Pn6DHdKqo9KJ2/rhWrbNJPSdm0bFYfSvnxt6BimX5wsu mHSkART6kdRK8lz9UlebJcQ9gTNA9mz7G1d2ZR9uIUIk4J+cu4HWTuWCTgSn7MvqfKiA Z428Z5CYFyR3wD/zOI2rhF54bKHLy0IVOtRmY=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=k8xQgUTYELC9sQ0Laz+TJlnUJgTTToEHXjWaAU4ygKdCx0lqY6VH4IFpcAPDKHp9Kb k/JD1gfkyVKRaqLu5IZGD8uG4Hc451uxHedhrqMrYc820P4x53AltbjELfu8kxOloRNo psKp4hAeXEjP+Lj9zeD87oxYryAMxyxeUGMpc=
- Sender: owner-ferret_users@xxxxxxxx
Hello Everyone
I am using Ferret to pre-process my data that I got
from NCEP. I have already successfully calculated the
climatological anomalies, but I am having trouble
weighting the cell values by their areas.
My current thought has been to use a global variable with
its cell the values set to one. Then find each cell's area in
this region and divide it by the average cell area. This would
then give a global weighting variable which I could then apply
to my data. However my problem is that I can't yet
get the cell_area out of the loop, and ones[i=@din, j=@din]
returns the area for the entire globe. Please can someone help
me with weighting my grid values by the cell areas.
I have included the script, netcdf header information, and
the netcdf file (for 1 month). I am using Ferret v6.3
in Linux Ubuntu Intrepid.
Thanks in advance
Michael
test.jnl:
!==========
use "test.nc"
! Create a variable over the globe where each cell's value is one
let + (0*x[gx=air_subset] + 0*y[gy=air_subset])
let max_lon = 144
let max_lat = 73
REPEAT/j=1:`max_lat` ( ;\
REPEAT/i=1: `max_lon` ( ;\
let cell_area = ones[i=@din, j=@din] ;\
say `cell_area` ;\
) ;\
)
!==========
ncdump -h test.nv:
netcdf test {
dimensions:
LON = 144 ;
LAT = 73 ;
LEVEL = 17 ;
TIME = UNLIMITED ; // (1 currently)
bnds = 2 ;
variables:
double LON(LON) ;
LON:units = "degrees_east" ;
LON:long_name = "Longitude" ;
LON:point_spacing = "even" ;
LON:modulo = 360. ;
LON:axis = "X" ;
double LAT(LAT) ;
LAT:units = "degrees_north" ;
LAT:long_name = "Latitude" ;
LAT:point_spacing = "even" ;
LAT:axis = "Y" ;
double LEVEL(LEVEL) ;
LEVEL:units = "millibar" ;
LEVEL:long_name = "Level" ;
LEVEL:positive = "down" ;
LEVEL:point_spacing = "even" ;
LEVEL:axis = "Z" ;
double TIME(TIME) ;
TIME:units = "hours since 0001-01-01 00:00:00" ;
TIME:long_name = "Time" ;
TIME:time_origin = "01-JAN-0001 00:00:00" ;
TIME:axis = "T" ;
TIME:bounds = "TIME_bnds" ;
double TIME_bnds(TIME, bnds) ;
float AIR_SUBSET(TIME, LEVEL, LAT, LON) ;
AIR_SUBSET:missing_value = -1.e+34f ;
AIR_SUBSET:_FillValue = -1.e+34f ;
AIR_SUBSET:long_name = "AIR_ANOMALY[T=\"1-JAN-1957\":\"1-JAN-1957\"]" ;
AIR_SUBSET:history = "From air_anomaly" ;
// global attributes:
:history = "FERRET V6.3 3-Nov-09" ;
:Conventions = "CF-1.0" ;
}
Attachment:
test.nc
Description: Cdf file
[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce /
NOAA /
OAR /
PMEL /
TMAP
Privacy Policy | Disclaimer | Accessibility Statement