[Thread Prev][Thread Next][Index]
Re: [ferret_users] high-to-low range for REPEAT over pseudo-variable
- To: ferret_users@xxxxxxxx
- Subject: Re: [ferret_users] high-to-low range for REPEAT over pseudo-variable
- From: "Ansley C. Manke" <ansley.b.manke@xxxxxxxx>
- Date: Thu, 3 Sep 2020 12:24:04 -0700
- Arc-authentication-results: i=2; mx.google.com; dkim=pass header.i=@noaa.gov header.s=google header.b=emtjuZmH; spf=pass (google.com: domain of ansley.b.manke@xxxxxxxx designates 209.85.220.41 as permitted sender) smtp.mailfrom=ansley.b.manke@xxxxxxxx; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=noaa.gov
- Arc-authentication-results: i=1; mx.google.com; dkim=pass header.i=@noaa.gov header.s=google header.b=emtjuZmH; spf=pass (google.com: domain of ansley.b.manke@xxxxxxxx designates 209.85.220.41 as permitted sender) smtp.mailfrom=ansley.b.manke@xxxxxxxx; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=noaa.gov
- Arc-message-signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-archive:list-help:list-post:list-id:mailing-list:precedence :content-language:content-transfer-encoding:in-reply-to:mime-version :user-agent:date:message-id:from:references:to:subject :dkim-signature; bh=S7YBTQDlRVlqQ/mVZwL76uGMBo1c/9xAcX6paekhmKo=; b=mTNiqxjLldHsmYnqkoM+fBZKAM1C2vBa3xMj/Gvp3kVG/Am065c6ZT2xlfTXgJLKhi LstQ7eOZrdRUn58WqGkymF+jOQLUH45ULwvf4KJn0sJkHJnj8ypz7C53JkdOvZqEJ02N OLSZ14eoMRLRLD45QC1HQeS7O/70ZcFgwpBzO7GZGsrCS0bh6QdmcXkh8W0GdYPiq9lC 1JLQs5/VHljWbtU0OhNEo6QOloQXwLFklLZcO2EXzIfFBF9KS9zQBtENtAKa1LGJpSHP Sgt+L2LvayIP1ty810aNbe882zNHh8LYLGOC+jmvpUA9MBX13dYSzh5mfMKgSupfoZjY RCHg==
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-language:content-transfer-encoding:in-reply-to:mime-version :user-agent:date:message-id:from:references:to:subject :dkim-signature; bh=S7YBTQDlRVlqQ/mVZwL76uGMBo1c/9xAcX6paekhmKo=; b=tS/+oqUSb4RaygB17XMYPBX/LSBTpYNUKwxOXneF0dA86rQ46MNzuJ6QCNf5nHxeZ5 qzeHqFF1h7q4qbsAyjcvirhuxhuNEuxnzfZmW1K42VQqtXq4tlSeDZXHAHIHkV7P6tUo cC6awe0tUbCvFUbJhfEzbGBEXi5bhvr3V1GDlMsZHCp47AgYV5G1J2T4EOIkdApNhm5e WGn+MQ2eIIsnxrIEaePnG3QRc05k+8GGnadBfyxkO+qejMzjyC0Pl8QfWC/YZPA9Dl8M usVyLqhX+EJnYKvmm4vYmBxCuoQBZ2uAWxgu6sTCHqddfrEgDdQ9/vT/43lQuEm1MrVD SaSw==
- Arc-seal: i=2; a=rsa-sha256; t=1599161049; cv=pass; d=google.com; s=arc-20160816; b=f1GYipqCl9L6AsWYLo1Cz2srtA028nckWXk6e7HD6JhStKRbbe+f5gOQnhe5lXQlVM Fsq7fj0WZmDoAdakFOs37D3CR//8QZ0cVGcJjww9ONyDV7scFy2cjuHWfVMXuPBiujli /FNoi+pyalEuRYtWrLukJQequs4cBksB4/lKmYBClgYmgLQjLOpkyzRilddT6QWfXZvp V5X5NorRdKEEwUuJRVlbdQF3qEMt9tRKNd9qNAeWlcq5ozF+35xkA7nK5Tj6DhDl0HNP b7x3xi4YYUBByfSV7NBkhxtNxHqPdU+4OOj9T1AHblghMfpSnADQshf/3dfGOe9B0eRH Ax/A==
- Arc-seal: i=1; a=rsa-sha256; t=1599161048; cv=none; d=google.com; s=arc-20160816; b=hEyyUhFJVEGuJYtsQNBffn88BIzt+UN/5OnauI+hqLQSu2bMuWDoecLq9211OxJu03 DwgOEUzoCPZlH6FoBBgxRMIa8++gblaIdGL5QKG88hEdvKbTfaSmtkuGACE/63wMbIh/ A6S22lDhO9TnSgq86c/+IeHEzN0WQj0MQzYzmIWE6xlday5r8k4mSD4g5RI2PUwE5W+l VYDRlQnBDLRWPxXZ9QkhBhlJ8Awyxvhr9yiYoBaa3Miqg3r2rqYy+8CERRX/a0NQ6C/J mJz+GsAobRnC0CnboJWh4dcWCFIRvBd4eVchLoS1JtvnePfTEn/x8voJen3moBLQm77H vuFw==
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=noaa.gov; s=google; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:list-post:list-help:list-archive; bh=S7YBTQDlRVlqQ/mVZwL76uGMBo1c/9xAcX6paekhmKo=; b=ouhdi0EliPm1vA5RUxWD81KiK7I817pNMonwE8BGhkfOud3nDbJMltAumYtPnrViL0 MKi+AJ30g6q7Dn00dgJXrP6Jo53NDj6deKgnHrIWhqpYIzihuQHx/h6lkH/fHWT5GGCZ R0EWUjGaUwI+/h2EhdWxEH2ZO3+1T3MQFIH1nNk0fnY9tKJdXFx1FEUcxK7lfQJzpD2E 86v5GwZH61G4s4SJkT22DXnWLK/C7p4h9TkUgFYsYoR9QX/y5DgBPKiiiceA5YmvZnh7 UorqatAF/FmtaP9gQHeX0cM9WKgsLIDUN6lunrexFPHtDwGzt8GyW7dblr9YzgKo58Zd qmpQ==
- In-reply-to: <20200903160121.5056bd16@gfi063209.klientdrift.uib.no>
- 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
- References: <20200903160121.5056bd16@gfi063209.klientdrift.uib.no>
- Sender: owner-ferret_users@xxxxxxxx
- User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0
Hi Marco,
I think you've got it right.
REPEAT/i=1:2 is going to repeat over the x-axis context of the
variables in the repeat loop. And it turns out that Ferret context
handling does just what you're showing in your examples. Here are some
more,
yes? let var = xsequence({2,4,6,8})
yes? list/i=2:1 var
VARIABLE : XSEQUENCE({2,4,6,8})
SUBSET : 2 points (X)
1 / 1: 2.000
2 / 2: 4.000
! You can't do this:
yes? list/i=4:2:-1 var
**ERROR: invalid command: delta non-positive on X axis of EX#1
! but repeat does allow a negative increment.
yes? repeat/i=4:2:-1 (list/nohead var)
!-> REPEAT: I=4
8.000
!-> REPEAT: I=3
6.000
!-> REPEAT: I=2
4.000
The REPEAT/RANGE syntax is set up to not interact with the context of
the variables, so as you thought it's interpreting a loop range of
/i=0:1 to not have any range. This seems like the right behavior, if a
little unexpected. I'll add a note in the documentation about it.
Ansley
On 9/3/2020 7:01 AM, Marco van Hulten wrote:
Hi all,
When I use a negative/empty repeat range, nothing is done (as is with
FOR loops in other programming languages), but if a pseudo-variable is
used, it happily counts (starting from the lowest number):
yes? repeat/range=1:0/name=ii ( say JA )
yes? repeat/i=1:0 ( say JA )
JA
JA
yes? let lolo = XSequence({ 1, 9 })
yes? repeat/i=1:2 ( list/noh lolo )
1.000
9.000
yes? repeat/i=2:1 ( list/noh lolo )
1.000
9.000
yes? repeat/i=2:1:-1 ( list/noh lolo )
9.000
1.000
Why is this?
Maybe the abstract i axis does not have a direction and Ferret is
making a best guess (assuming you don't want an empty range)?
—Marco
--
Ansley Manke
Science Data Integration Group
NOAA Pacific Marine Environmental Laboratory
7600 Sand Point Way NE
Seattle WA 98115
I am currently teleworking and am available Tue-Wed-Thu.
[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce /
NOAA /
OAR /
PMEL /
Ferret
Privacy Policy | Disclaimer | Accessibility Statement