[Thread Prev][Thread Next][Index]
Re: Thinking like a Ferret
On Fri, 24 Jan 2003, Bruce or Jennifer Ford wrote:
> I have some simple calculations that I can't seem to get scalar
> values for. For instance, using NetCDF global files, how can I get a scalar
> value (to use in curve-fitting coefficient calculations to place a best-fit
> line on a scatter plot) for:
>
> sum of x*y (x*y for each gridpoint, then sum them. It's the summing for a
> scalar that is problematic)
>
> n (count the number of gridpoints in a given region return a scalar)
Hi Bruce,
I'd echo Lynn deWitt's earlier suggestion -- check out
$FER_DIR/go/regresst.jnl
and the corresponding x,y,z versions. The sum of products you describe is
contained in their variable PQAVE. Although these scripts compute
regressions along only a single dimension, they can easily be generalized
to multiple dimensions -- just change the [t=@ave] stuff to
[x=@ave,y=@ave,t=@ave] etc.
The number of valid values (gridpoints) in the current SET region for a
variable V is, for example,
v[x=@ngd,y=@ngd]
and the number of "missing" values is
v[x=@nbd,y=@nbd]
with the total number of points the sum of these.
Andrew
+--------------------------------------------------------+
| Dr. Andrew T. Wittenberg | GFDL/NOAA |
| atw@gfdl.noaa.gov | Princeton, NJ |
+--------------------------------------------------------+
[Thread Prev][Thread Next][Index]
Dept of Commerce /
NOAA /
OAR /
PMEL /
TMAP
Contact Us | Privacy Policy | Disclaimer | Accessibility Statement