[ncl-talk] loop_query

Kunal Bali kunal.bali9 at gmail.com
Fri Mar 31 11:01:08 MDT 2017


Sorry for creating the confusion.

I changed the script as you suggested me and then run the attached script.
But after running this, I am getting the file only of the single day
instead of all 30 files separately.



Kunal Bali
Research Scholar
Radio & Atmospheric Science Division
CSIR - National Physical Laboratory
New Delhi - 110012
India





On Fri, Mar 31, 2017 at 10:15 PM, Mary Haley <haley at ucar.edu> wrote:

> Kunal,
>
> I'm a little confused by what you are asking for.  You said you wanted to
> extract all 30 days of data instantly, which is what the previous
> "addfiles" example was meant to show.  You don't need a loop to extract all
> the data.
>
> Did you actually try my suggestion of changing your script to use
> "addfiles" instead of "addfile"?  If so, and you are still having a
> problem, then it would help to see the new version of your script.
>
> Maybe my confusion is with what you want to do with the data after you
> extract all 30 days of data. Please be more specific if possible.
>
> Thanks,
>
> --Mary
>
>
> On Thu, Mar 30, 2017 at 10:19 PM, Kunal Bali <kunal.bali9 at gmail.com>
> wrote:
>
>> Dear Mary,
>>
>> Thanks for the suggestions.
>> But still, it's extracting one file at a time, not extracting all the
>> 30-day files separately of UK and NEP (as mentioned in the script).
>>
>>
>>
>> Kunal Bali
>>
>>
>>
>>
>>
>> On Fri, Mar 31, 2017 at 3:09 AM, Mary Haley <haley at ucar.edu> wrote:
>>
>>> Kunal,
>>>
>>> You should be able to use "addfiles" to open all your files, and then
>>> read your data using the special [:] syntax:
>>>
>>>   dir    = "/home/kunal/"
>>>   fnames = systemfunc("ls " + dir + "DAY_*.nc")
>>>   a      = addfiles(fnames,"r")
>>>   data = a[:]->bcfire
>>>
>>> For more information see our addfiles examples page:
>>>
>>> http://www.ncl.ucar.edu/Applications/addfiles.shtml
>>>
>>> --Mary
>>>
>>>
>>>
>>>
>>>
>>>
>>> On Thu, Mar 30, 2017 at 12:42 PM, Kunal Bali <kunal.bali9 at gmail.com>
>>> wrote:
>>>
>>>> Dear NCL users
>>>>
>>>>
>>>> I have the data of 30 days. I want to extract this data with the
>>>> loop.The attached script is based on to extract the data of a single day.
>>>> So it's a tedious job to extract all the 30 days data one by one. So could
>>>> anyone tell me that how to start the loop in the attached file so the I can
>>>> get 30 days extracted data instantly.
>>>>
>>>> Thank You
>>>>
>>>> Regards
>>>> Kunal Bali
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> ncl-talk mailing list
>>>> ncl-talk at ucar.edu
>>>> List instructions, subscriber options, unsubscribe:
>>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>>
>>>>
>>>
>>
>> _______________________________________________
>> ncl-talk mailing list
>> ncl-talk at ucar.edu
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170331/502ceae1/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kunal.ncl
Type: application/octet-stream
Size: 6869 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170331/502ceae1/attachment-0001.obj 


More information about the ncl-talk mailing list