[Thread Prev][Thread Next][Index]
Re: Integration in ferret
Hi Bernadette,
The general approach to integrating over irregular limits is to use a mask as
follows.
LET MY_Z_UPPER_LIMITS = some-function-of-Y, only
LET MASKED_U = IF Z[g=my_var] LT MY_Z_UPPER_LIMITS THEN U
The omited ELSE clause means that points whose Z coordinate exceeds
MY_Z_UPPER_L:IMIT are masked out.
Now you simple integrate using
MASKED_U[Z=0:`max`@DIN] where `max` is the full Z range
Notes:
* You can omit the "0:`max` if the Z limits are undefined -- it will
default to integrating over the full (masked) region
* Using "... ELSE 0" in the definition of MASKED_U would be equivalent for
purposes of integrations ... though clearly not so for averaging.
- steve
====================================================
Bernadette Fritzsch wrote:
> Hi,
>
> i have a dataset with a 2D array u(y,z) and i want to plot a new data
> which is defined :
>
> new(y,z) = Integral of u(y,z') dz' with z'=0...z
>
> i tried it with the @DIN transformation:
> let new = u[z=1:k@DIN]
>
> but because of the variing limits in z it does not work. Trying to use
> some masking for the data failed for the same reason of the variing limits
> for integration.
>
> Anyone can help me?
>
> Thanks!
>
> Bernadette
--
| NOAA/PMEL | ph. (206) 526-6080
Steve Hankin | 7600 Sand Point Way NE | FAX (206) 526-6744
| Seattle, WA 98115-0070 | hankin@pmel.noaa.gov
[Thread Prev][Thread Next][Index]
Dept of Commerce /
NOAA /
OAR /
PMEL /
TMAP
Contact Us | Privacy Policy | Disclaimer | Accessibility Statement