[Thread Prev][Thread Next][Index]
Re: [ferret_users] how to do embedded expression inside an embedded expression with grave accent
- To: Xiaoyu Bai <xbai1@xxxxxxxx>
- Subject: Re: [ferret_users] how to do embedded expression inside an embedded expression with grave accent
- From: William Kessler <william.s.kessler@xxxxxxxx>
- Date: Wed, 10 Oct 2018 10:15:36 -0700
- Arc-authentication-results: i=2; mx.google.com; dkim=pass header.i=@noaa.gov header.s=google header.b=i32ZMebl; spf=pass (google.com: domain of william.s.kessler@xxxxxxxx designates 209.85.220.41 as permitted sender) smtp.mailfrom=william.s.kessler@xxxxxxxx; dmarc=pass (p=QUARANTINE 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=i32ZMebl; spf=pass (google.com: domain of william.s.kessler@xxxxxxxx designates 209.85.220.41 as permitted sender) smtp.mailfrom=william.s.kessler@xxxxxxxx; dmarc=pass (p=QUARANTINE 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:to :references:message-id:content-transfer-encoding:cc:date:in-reply-to :subject:mime-version:from:dkim-signature; bh=7bDANCOexMB5gTcYOfP8ABPy1mey2IVppTnCHrYa2Ik=; b=qy4MZ7B9KnVN/qgND4IhOc1HYR6CryDXL6PHMs+0ZcwjAv20oDB8Id21rwfNoepQJY /yoVCHm8W+qBHPQPZoV7xlgneKNjqyz9qbWs221XLDJ6YtwkByNcgDi+XTSWRNlvu0Tj IK2sl/ARtvtwNgTh6P5ZW8s70AZoNbPqQrBz7uN8Biwkqg+cCmpQNBKHQgf6idvdQ9uh ArkLwokjgPwcMWKVPa8j28MCGZWVoSxtIT3rTQ9c7gYtTaWxH8DH4uWtnknHnn0NKkrL DH3bYkSC6xFwRGlgl6RPj8dt7wBy1Oa1lYfKZe6nBZY50BqpWhdty2SviJV4GeH2BfPq e2BQ==
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:subject:mime-version:from:dkim-signature; bh=7bDANCOexMB5gTcYOfP8ABPy1mey2IVppTnCHrYa2Ik=; b=TRnfTbo1lx35FsZY2QDNETErN790Fn3dlmcQUAZVhcmY8Hpf/xcZWBphSrT+r37BfW MphQnT9wYgS4jFXlbQVueUiOw2DDZRaNzZZvT1mrXS61RMs4/t02EEpIMCgCDbsxTrz/ t3gkj/Mn0oNQ9yNl4LmMva5PnkF7eh+dwOLL0i8bxnMMMuz5f/Wc4Q2gyK9fUV3Tz8Cz o60ncBOvmahaDX3qh3K9o0yyGOFoRyVvEtXHEd307mOVNiavcAAwDAo1MhlwmBlxJxRj xVy60pcv+VSB/0GSM3JUYwgKaiYgmoJSdFZp/Me3reGygsIy1IgwEmuVJiJYnvrJQulN LTQw==
- Arc-seal: i=2; a=rsa-sha256; t=1539191739; cv=pass; d=google.com; s=arc-20160816; b=cXW7tNFdmnmFCAu/4cRr800F5Ql28C/1Wv51bc8oujRxkhkcccVaZnJ6F7YsALeBmx r6c9H/CIWLuIN1Yzmw/bcCb/F0Web7FmvYwgVEX/j97J7ybHTreiZWSNXBK2lk7LQCPR zhYSjJ0/Pw1+SoKUJcGb9+rQEYUne5pn4MhBM+mi8bcMkSm76qqnW4BgP+d8ROWruGR2 GrZFpUQvsz1Aux+lZpvLsKamKejq6YeZukoCKyE1BbiAHJLS4K8slIuSmKDjHW4zZQ/x ea0ieNoK7X0r/g4Hfw3x064ne0kdlTM4GLZxB8Y1NGhgq6Xnrk3OEvH1DX07oy5X/8hg uLMg==
- Arc-seal: i=1; a=rsa-sha256; t=1539191739; cv=none; d=google.com; s=arc-20160816; b=B/UxSYjiQlhM0SpQ1gIAAf0IVwbVfXWsmU+/tAjZQJ7ARg9Ns0xAkNnRt8B+0Q2fSL wgHyRzh9SqRBek5DnpLWkKLhY9lBm245xczEuvp3MTxHSD6AXZMWXkeiCgUIQkt5pLhT qqE79iHSNEgGhOo+AnhGvGhdxqunaum27mOzf1pr771A8C47hX4jLLd2atuQzpZcz7Ux QgiGefFHVQ6RsJIH6LWLMarSdWAnO/CLixyVgM40I/wdABKdcjKtNXaKV+0e0XVuiRK9 oHl4/0CJ/OyTITec06aebz0+cVZjrhG1GiRvd3kkQYOUiKt4qsAq2AG5iXUmVxsN25bQ Jj5Q==
- Cc: satyeshghetiya@xxxxxxxxx, Ferret <ferret_users@xxxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=noaa.gov; s=google; h=from:mime-version:subject:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:list-post:list-help:list-archive; bh=7bDANCOexMB5gTcYOfP8ABPy1mey2IVppTnCHrYa2Ik=; b=kSoOF5otm20diioXRjzp9HcGdalt6qftFkV+03LIK5gKjry0+9vjCd6KA+tuF3KGOH zu0VrksnqGPfzQjS24oEQGMLDoC40cL+ZZZVz5T9f9GibB4Q58Zl1L5EfpzsCsCse3ie fPa/Obk4M3bYlrCXBxHR5C42wo32f4vixoxKknNWL+dJWsbxbxDOAmwAkIcivn4x4+Vv jRYqRXfEJmspg4dTqH+aJhqRa79DQprMY3QXXkCoFA1f2eppnobjJhRZJ60tJrkTEjBs bRsKDt2/VdRBiAmIZGcSl7NwJwF8mzy8dUxBCO8y/gXJb1o6pyen+bK0RgZHwC6r1yCY cE1Q==
- In-reply-to: <CAKE4FWqb7okVM9xJNU1ZPSzrGi=C293ycjaYvvc70-ZwYnaaCw@mail.gmail.com>
- 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: <CAKE4FWpX5nFs-soEQ6c-QKY8C7G615UJOVPuQ=aGZrH2is3THg@mail.gmail.com> <CALC=m4od6aYPKYoiDZM1JKq=XieLToaN1XX+GCCgOtFuTDcGSQ@mail.gmail.com> <CAKE4FWrELJCcgH7zn=XmVBe9RS5QUb-zT1fraBg7R5zZuYc=eg@mail.gmail.com> <CALC=m4pRFgKaB44X3H2uYd2PNXWTu2qjGEhxdN+JZKvCetbLEg@mail.gmail.com> <CAKE4FWqb7okVM9xJNU1ZPSzrGi=C293ycjaYvvc70-ZwYnaaCw@mail.gmail.com>
- Sender: owner-ferret_users@xxxxxxxx
I'm not sure I understand your question exactly, but I think a defined symbol has highest priority. Ferret will simply drop that symbol into any command. And note that symbols can be embedded (see example).
If you only have 7 of these then the symbols can be defined manually:
def sym root "/home/xbai1/Tracmip/family1/"
def sym f1 "whatever_your_first_filename_is.nc"
def sym f2 "whatever_your_second_filename_is.nc"
...
def sym f7 "whatever_your_last_filename_is.nc"
repeat/range=1:7:1/name=fnum (let dummy=`fnum`; def sym sfnum `dummy`; use "($root)($f($sfnum))"; ... )
I'm not sure why, but this kind of syntax inside a repeat loop requires defining a new dummy variable to use for symbol definition.
Billy
> On Oct 10, 2018, at 9:36 AM, Xiaoyu Bai <xbai1@xxxxxxxx> wrote:
>
> repeat/range=1:7/name=aa (use file_name_`aa`.nc) is a good idea. I have a handicap that I use let files_CNRM=spawn("ls -1 /home/xbai1/Tracmip/family1/*CNRM*.nc") to identify my files before I read them in. Ferret doesn't let me to use syntax `spawn("ls -1 /home/xbai1/Tracmip/family1/*CNRM*.nc")` because grave accent has the highest priority. 😹
>
> Thanks a lot.
> Xiaoyu
>
> On Wed, Oct 10, 2018 at 11:52 AM Satyesh Ghetiya <satyeshghetiya@xxxxxxxxx> wrote:
> Hi,
>
>
> On Wed, Oct 10, 2018 at 9:05 PM Xiaoyu Bai <xbai1@xxxxxxxx> wrote:
> Hi Ghetiya,
>
> Yes, I wan to read all the files in through the repeat loop. When you say nested loop, do you mean let datset=0; repeat/range=1:8 (let datset=`datset+1`; use `files_CNRM[X=datset]`)? It didn't work.
>
> ^ Yes, you are correct, I also encountered similar problem, it seems ferret is not taking nested definition of variable.
> The error message is like **ERROR: command syntax: DATSET // SET DAT/FORM=CDF `files_CNRM[X=datset]`. I feel datset needs a pair of grave accent to make it as an variable. However, ferret considers the nearest two grave accents as a pair.
> I might need to read my files in one by one instead of using repeat loop.
>
> ^ But once I used syntax like this which worked: repeat/range=1:7/name=aa (use file_name_`aa`.nc;)
> Anyway if not, then yes for now, you may have to use one by one.
> Thank you very much and have a nice day.
>
> Welcome.
>
> On Wed, Oct 10, 2018 at 12:53 AM Satyesh Ghetiya <satyeshghetiya@xxxxxxxxx> wrote:s
> Hi,
> I also faced similar problem, but every time I am by passing using two grave accent by using some other repeat loop (nested) or by using some other variable.
> Are you wanting to use, in loop, 7 data sets ?
>
> On Wed, Oct 10, 2018 at 1:53 AM Xiaoyu Bai <xbai1@xxxxxxxx> wrote:
> Dear ferreters,
>
> I have a syntax that's like repeat/range=1:7/name=datset use `files_CNRM[x=`datset`]`. However, ferret reads it like `files_CNRM[x=` and `]`. So I am wondering how to make this syntax work.
>
> Thank you very much.
> --
> Xiaoyu
>
>
> --
> G Satyesh
>
>
>
> --
> Xiaoyu
>
>
> --
> G Satyesh
>
>
>
> --
> Xiaoyu
[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce /
NOAA /
OAR /
PMEL /
Ferret
Privacy Policy | Disclaimer | Accessibility Statement