[Thread Prev][Thread Next][Index]
Re: [ferret_users] if-then, evaluation and transformation problem
Hello,
Op zo 25 okt 2015 21:42:54 CET schreef Jorg D. (Dr.):
> I would read this as follows: the result from myvar,return=isReady is
> just one value/point that depends on myvar. The transformation
> however, happens in the first instance at every point of myvar - so I
> think, ferret tries to apply a array evaluation on a scalar
> condition. I think the example if 1 then say `myvar[i=@ngd]` is
> different, as 1 does not depend on myvar.
Thank you, Joerg. It does appear to be something like this, but it is
not clear to me why Ferret tries to apply the array evaluation on a
scalar condition. In any case, I will put in this extra evaluation:
if `myvar,return=isReady` then let myvar_isReady = 1
There is still this problem (that I indeed put in my previous e-mail
as secondary, but in retrospect it is more important):
STOP IS_DO_GC_FCN cs_type(res_cx) is neither ptype_string nor
ptype_float
In more detail, for restricting coordinate data to the vacinity of a
limited set of station coordinates, I am defining a 2-D array, as
suggested earlier by Russ Fiedler. This is what happens:
yes? sh var lon_2d
LON_2D = 0*LONGITUDE + YSEQUENCE(TRANSLONGITUDE)
yes? stat Longitude
LONGITUDE
X: 0.5 to 27366.5
Y: N/A
Z: N/A
T: N/A
E: N/A
F: N/A
DATA SET: /home/biomac2/mvhulten/static_data/IDP2014_v2_global_Ferret.csv
Total # of data points: 27366 (27366*1*1*1*1*1)
# flagged as bad data: 0
Minimum value: 0
Maximum value: 360
Mean value: 197.49 (unweighted average)
Standard deviation: 129.32
yes? stat TransLongitude
MYLONGITUDE + 0*TRANSLATITUDE
X: 0.5 to 27.5
Y: N/A
Z: N/A
T: N/A
E: N/A
F: N/A
DATA SET: N/A
Total # of data points: 27 (27*1*1*1*1*1)
# flagged as bad data: 0
Minimum value: -30
Maximum value: -30
Mean value: -30 (unweighted average)
Standard deviation: 0
yes? stat lon_2d
STOP IS_DO_GC_FCN cs_type(res_cx) is neither ptype_string nor ptype_float
A simple version does not reproduce this problem:
yes? let short = {1., 2., 3.}
yes? let long = {1,2,3,4,5,6,7,8,9,0}
yes? let lon_2d = 0*long + ysequence(short)
yes? stat lon_2d
0*LONG + YSEQUENCE(SHORT)
X: 0.5 to 10.5
Y: 0.5 to 3.5
Z: N/A
T: N/A
E: N/A
F: N/A
DATA SET: N/A
Total # of data points: 30 (10*3*1*1*1*1)
# flagged as bad data: 0
Minimum value: 1
Maximum value: 3
Mean value: 2 (unweighted average)
Standard deviation: 0.83045
yes?
What difference between this example and my case could be relevant for
the problem?
Marco
--
Laboratoire des Sciences du Climat et l'Environnement (LSCE)
Tel: +33 1 6908 3876
http://www.lsce.ipsl.fr/Pisp/marco.van-hulten/
[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce /
NOAA /
OAR /
PMEL /
Ferret
Privacy Policy | Disclaimer | Accessibility Statement