[ncl-talk] avoiding loops
Micah Sklut
micahs2005 at gmail.com
Sun Sep 22 07:38:30 MDT 2019
Hi Rashed,
I’m using addfiles to add all of the files, but I want to take the 384
hours of Data and make one array that has the hourly data concatenated for
each latitude and longitude.
As far as I can see, loops are the only way to go. I just need a lot of
memory to pull it off.
On Sun, Sep 22, 2019 at 8:02 AM Rashed Mahmood <rashidcomsis at gmail.com>
wrote:
> Hi Micah,
> Did you try using the addfiles function in NCL:
>
> https://www.ncl.ucar.edu/Document/Functions/Built-in/addfiles.shtml
>
> For example:
>
> fils = *systemfunc* <https://www.ncl.ucar.edu/Document/Functions/Built-in/systemfunc.shtml> ("ls *.nc") ; file paths
> f = *addfiles* (fils, "r")
>
>
> You would need to make sure that "ls *.nc" results in the correct order
> with respect to time and day.
>
> Cheers,
> Rashed
>
>
>
>
> On Sat, Sep 21, 2019 at 1:53 PM Micah Sklut via ncl-talk <
> ncl-talk at ucar.edu> wrote:
>
>> Hi,
>>
>> I have a task to take GFS data and concatenate variables across all the
>> forecast hours, for each grid point.
>>
>> For example, taking a temperature variable for each grid point, for all
>> latitude and longitudes, and creating a string that represents the values
>> for each forecast hour.
>> So, if we have for latitude y, and longitude x, there would be a string
>> value like "70.5,71.5,71.5,72.0,...nHours". The end product will be a line
>> for each grid point for the variables i"m looking at that will be written
>> to a file to be imported into a database.
>>
>> Creating loops through all hours, latitudes, and longitudes will get the
>> job done, but is expensive and was looking to see if there were any NCL
>> functions that would help here.
>>
>> Thank you.
>>
>> _______________________________________________
>> ncl-talk mailing list
>> ncl-talk at ucar.edu
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
> --
Micah Sklut
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190922/047db314/attachment.html>
More information about the ncl-talk
mailing list