[Thread Prev][Thread Next][Index]
[ferret_users] Masking in list command works for floats, not strings
- To: ferret users <ferret_users@xxxxxxxx>
- Subject: [ferret_users] Masking in list command works for floats, not strings
- From: "Riede, Hella" <hella.riede@xxxxxxx>
- Date: Tue, 27 Jun 2017 16:38:59 +0000
- Accept-language: en-US, de-DE
- Arc-authentication-results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of hella.riede@xxxxxxx designates 192.67.218.51 as permitted sender) smtp.mailfrom=hella.riede@xxxxxxx
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:content-language:accept-language:message-id:date :thread-index:thread-topic:subject:to:from :arc-authentication-results; bh=WDZlSw3AJyh+WS3zsRsJNjCfyqSJBS2eT39G7D36Zms=; b=su6yii58oz/p3egsb43EMHpnfg44aF+XrHZB2taPaPuI8Jco4M9/k6E+Mw0qSsDAVo PnkLeGQwgQX4H+QZH3j7nwcha7E+moakKO2pcZQCzTDcOMteNno4EnZak/ti/lgKs+Om wAfoOVb29w4hPP1joMJyEkggagcxJDCmee3Ll4CBwZc+Bo4muSmPIDaqPZVAllZOF9dI /u+OewksQeCRJMCE5ubU3K5FMg+S/Qp3KCdYVrEklUfkDHPj7zq+yHSbuzcBWbVy3lbi 9NRneV7hRu7/QyIMzhKe3cIH83H1XD9ji9gZEAyQ6mqXbUb0YRNccKDjdeXSg/Lfy8XI qK0Q==
- Arc-seal: i=1; a=rsa-sha256; t=1498581550; cv=none; d=google.com; s=arc-20160816; b=davAk+FHoILfx76sOxUQVll1zdnFjheVsvOERUiHYF0ca1wj6ZRxCNJ8/muG406+mq AnChZKK9ieDcWI1N65OM9xahKC9cSzPcZw2xxtk0IQDX/HatIKkM+T+XVXs+WXSzL5Hh nMpGN/xjMvFfsU/nFscUMirv5DCs5V2Bx25B410MyWHZ6Tk19/1YzmjDMVYKc+71pLw0 0vsV646tpN5TnG7YIqMorkym08miH17LjmBMKZPVMEochLkSUQhIQWQwT11H4xS7V495 bcW3LjVsrRuAmWg/F/A7NXLPUm8h+kCErF4F+AD7fYRKB1g7ONTx//UeJ2TyHQc6SWPW z5+A==
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=noaa-gov.20150623.gappssmtp.com; s=20150623; h=from:to:subject:thread-topic:thread-index:date:message-id :accept-language:content-language:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive; bh=WDZlSw3AJyh+WS3zsRsJNjCfyqSJBS2eT39G7D36Zms=; b=kD8NWvnPkGglj0Pyt05S0NrS5pq17NLYLOc4BSZX/+00or93f3XnalLUYT49oP6cYm jgCMKCBJOZ/f0G80mIdKd17PBq3yxEjELkFe/yD21jad6385oCyv9Qf2VQnBwyC1VMpa 52BZYcv3J8JlG4jPbMr20NFDQ8tqJ0ymg9M6w3/ca+suRvtB3w/DNVqmNRBj/BdvDrpF kP2exz0HBmUTOqfUlR4QKkbs4g6bWie59H4YVf6foOPY0idhouRmhOwn1ShSp3u7KWY/ Ln5jx1PMQ0bioJGjBHyTlbFn9TlsCfN8MaDTIHy99o7qsCTYpSjbDL5S7Cqkml5WeoIF nChw==
- List-archive: <https://groups.google.com/a/noaa.gov/group/ferret_users/>
- List-help: <https://support.google.com/a/noaa.gov/bin/topic.py?topic=25838>, <mailto:ferret_users+help@noaa.gov>
- List-id: <ferret_users.noaa.gov>
- List-post: <https://groups.google.com/a/noaa.gov/group/ferret_users/post>, <mailto:ferret_users@noaa.gov>
- Mailing-list: list ferret_users@xxxxxxxx; contact ferret_users+owners@xxxxxxxx
- Sender: owner-ferret_users@xxxxxxxx
- Thread-index: AQHS72NKl8qVM0gqnEeRSg8WXMjiog==
- Thread-topic: Masking in list command works for floats, not strings
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
Attachment:
mask_string.jnl
Description: mask_string.jnl
[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce /
NOAA /
OAR /
PMEL /
Ferret
Privacy Policy | Disclaimer | Accessibility Statement