Hi,
This is because of the /L=1 on the second command. What this is
doing is averaging over only one time step. You can see this in
the annotation in the upper left of each plot. The first plot,
fill/k=1 uwnd[d=2,l=@ave] is labeled with the full time range
30-NOV-2012 to 28-Feb-2013.
The second, fill/l=1/k=1 u18 is
labeled with 30-NOV-2012 to 01-DEC-2012. You will get the same
plot if you remove the /L=1.
(Also I notice you replied to an existing thread, so your
question was asked under the topic "masking in list command...".
I have started a new topic by changing the subject line.)
Ansley
On 7/5/2017 11:30 AM, Stephy Ann Libera
wrote:
Hi Sir,
I had recently encountered an error in my analysis, which I
found out to be a very interesting variation in saving values
into a variable after averaging. ( I admit that this has not
occurred to me before when I had averaged and saved but this
time this has happened) the saved value in the variable
becomes error, while directly using the averaged value gives
correct value.
I am attaching the codes as well as the figures regarding it.
I used the data s13.nc which is the zonal wind
data,
plot1:
yes? fill/k=1 uwnd[d=2,l=@ave]
plot2:
let
u18=uwnd[d=2,l=@ave]
yes? fill/l=1/k=1 u18,
ideally the two
plots have to be same but they aren't
Stephy Ann Libera
Physical oceanography
CUSAT
On 5 Jul 2017 23:14, "Ansley C. Manke"
< ansley.b.manke@xxxxxxxx>
wrote:
Hi,
This is definitely a bug. We have a fix for it which will be
included in the next release.
On 7/3/2017 2:13 PM, Riede, Hella wrote:
Thanks,
Ansley.
Usually, I first define a variable, then list it in a
simple way, so that's OK as a workaround for me.
However, there doesn't seem to be a workaround for this
one as all variables are defined before listing already:
can var/all
let test = {1,1,0}
let strings = {"a","b","c"}
let masked = if (test) then strings
let masked2 = xsequence(masked)
list masked2
VARIABLE : XSEQUENCE(MASKED)
SUBSET : 3 points (X)
1 / 1: 1.859-316
2 / 2: 1.877-316
3 / 3: 1.877-316
(Last example in mask_string.jnl, see attachment. An extra
'faulty' listing is too big / takes too long for my real
dataset.)
Thanks in advance for a hint on this one.
Best wishes,
Hella
On 06/27/2017 11:35 PM, Ansley C. Manke wrote:
Hi Hella,
Thank you for the example. In principle, specifying an
_expression_ as
the argument to a command:
yes? list if (test) then strings
should be equivalent to defining a variable with that
same _expression_
and sending that to the command:
yes? let masked = if (test) then strings
yes? list masked
However there winds up being a slight variation in how
the computation
is done with occasionally different and incorrect
results. (Here we're
seeing pointers to the strings which should be
returned!) We had a
similar bug report a year or two back which I think has
been fixed; I'll
check into this.
Ansley
On 6/27/2017 9:38 AM, Riede, Hella wrote:
Dear
ferreters,
I discovered listing while masking seems to work. But
not in all cases (see also attached script file with
more examples and comments):
yes? let test = {1,1,0}
!! problem with masked strings -> unexpected values
yes? let strings = {"a","b","c"}
yes? list if (test) then strings
VARIABLE : IF (TEST) THEN STRINGS
SUBSET : 3 points (X)
1 / 1: 2.109-316
2 / 2: 2.109-316
3 / 3: 2.109-316
!! repeat the listing, and the values change every
time
!! define a masked variable instead, then list - works
yes? let masked = if (test) then strings
yes? list masked
VARIABLE : IF (TEST) THEN STRINGS
SUBSET : 3 points (X)
1 / 1:"a"
2 / 2:"b"
3 / 3:""
!! OR do the same listing for a float first
yes? let floats = {2,3,4}
yes? list if (test) then floats
VARIABLE : IF (TEST) THEN FLOATS
SUBSET : 3 points (X)
1 / 1: 2.000
2 / 2: 3.000
3 / 3: ....
!! now, also for strings listing while masking works
yes? list if (test) then strings
VARIABLE : IF (TEST) THEN STRINGS
SUBSET : 3 points (X)
1 / 1:"a"
2 / 2:"b"
3 / 3:""
In an interactive ferret session, I first had defined
a masked variable for strings (in this example
'masked'), and had also listed it for testing. After
that I discovered that listing while masking works too
(of course I didn't know it only worked because I had
defined and listed the 'masked' variable before, in
the same session). So later in my ferret script I
omitted defining the 'masked' variable, and used the
listing while masking. The script did not crash, but
gave me unexpected values like the ones above, instead
of proper strings.
Would be good to fix this, or - if the syntax of
listing while masking is not supported - to catch
these cases and throw an error.
The story goes on, however, see attached script as it
seems not possible to mask a string variable and then
make an xsequence out of it - unless you do for
instance the "faulty listing while masking" from above
before the "right" listing.
Best wishes,
Hella
PyFerret v7.11 (beta/optim), Linux 4.4.0-72-generic -
04/19/17
|