I usually use at least two grids. My understanding is that @DDN [@DIN] needs to apply a weight, most of the time is the cosine effect. If there is only one grid, pyferret will possibly only consider the one grid's value only.
Yes, but the point is that the weight is continuous. Suppose that our SST is defined at lat = 1°, 3°, 5°, . . . at an interval of 2° . Then,
SST[y=0:yhi@DIN]
is a continuous function of yhi. Below is a figure showing this function (when SST is uniformly 1). The horizontal axis of the plot is yhi. If you increase yhi slightly, the integral increases slightly because Ferret adjusts the weight.
The problem is that Ferret seems to stop adjusting the weight when yhi < 2° as the figure shows. In particular, one would expect that SST[y=0:0@DIN] is zero.
This can be a source of error when you use Ferret programmatically to calculate integrals. For example, I can imagine a calculation like this
repeat/range=1:`iend`/name=ii (
let yhi = curvey[i=`ii`]
let xx = xvals[i=`ii`]
list/append/nohead/file=integral.txt/format=(G0,1X,G0) xx, SST[i=`ii`, y=0:`yhi`@DIN]
)
to calculate the integral of SST from the equator to a curve (x, curvey(x) ) as a function of x.
Regards,
Ryo
-------------------------------------------------
! --- script to generate the data for the plot below ---
set data coads_climatology ! grid spacing is 2°
let _ones_ = 1 + 0*y[gy=SST]
repeat/range=0:40/name=yy (let yhi=`yy/4`; let val = ones[y=0:`yhi`@DIN]; say/quiet `yhi` `val`)
[Caution: Email from External Sender. Do not click or open links or attachments unless you know this sender.]
Dear Ferreters,
Does @DIN have a minimum range? It seems that it stops shrinking when the integration range shrinks below the gridsize.
For a test, I define a variable which is always one and print the values of the integration over y=0:ylim, where ylim = 0, 0.5, 1, 1.5, . . . .
set data coads_climatology ! grid spacing is 2°
let _ones_ = 1 + 0*y[gy=SST]
repeat/range=0:8/name=yy (let val = ones[y=0:`yy/2`@DIN]; say `val`)
I find that the value of the integral is constant when ylim <= dely and then it starts to linearly grow after that.
Perhaps this isn't intended?
Best regards,
Ryo
--