[ncl-talk] reading list of files with few missing files

Dennis Shea shea at ucar.edu
Thu Aug 1 15:41:24 MDT 2019


*This is pure dog-work programming. *

NTIM - maximum number of hourly time steps**IF** all files were available.

So if you had January and February (leap year) data files.

NTIM = 31*24 + 29*24 = 1440

*IF* the yyyy_mm_ddhh files are (say) (lat,lon) => (nlat,mlon), create a
'super array'

 NTIM = 1440
 DATA = new ( (/NTIM,nlat,mlon/), typeof(data), getVarFillValue(data))  ;
super array
 DATA!0 =  "YMDH"

  fili = systemfunc(...)
  nfili = dimsizes(fili)

  do nf=0,nfili-1
       f = addfile(...fili(nf),"r")
       x = f->X
                              ; nt is the appropriate index into super array
      DATA(nt,:,:) = (/ x /)
   end do

  DATA = linmsg_n(DATA,0,0)


On Thu, Aug 1, 2019 at 9:49 AM Ipsita Putatunda <ipsita.putatunda at gmail.com>
wrote:

> Hi Dennis,
> The link opened after removing the "test". But my issue is reading the
> hourly files, which are missing; not the variables.
> Suppose I have the files as below-
> 1980_01_0100.nc
> 1980_01_0102.nc
> 1980_01_0103.nc
> 1980_01_0105.nc
> 1980_01_0107.nc etc......
> In that case how the interpolation will work to read the files and making
> 3 hourly files? Hope I make you understand my problem.
>
> Thanks,
> Ipsita
>
> On Thu, Aug 1, 2019 at 8:21 PM Rick Brownrigg <brownrig at ucar.edu> wrote:
>
>> Hi Ipsita,
>>
>> Try removing the "test." from the first part of that URL -- that's an
>> internal testing site for preparing documentation.
>>
>> RIck
>>
>> On Thu, Aug 1, 2019 at 8:15 AM Ipsita Putatunda via ncl-talk <
>> ncl-talk at ucar.edu> wrote:
>>
>>> Hi Dennis,
>>> I tried several times but the link you have shared is not opening. I
>>> have hourly data files for 30 years. In some cases there are 3 successive
>>> hourly files, and in some cases it is missing. In that case how can I put
>>> it in a loop for 30 years?
>>>
>>> Thanks,
>>> Ipsita
>>>
>>> On Thu, Aug 1, 2019 at 5:24 PM Dennis Shea <shea at ucar.edu> wrote:
>>>
>>>> There is no magic ...
>>>>
>>>> If you do not have 3 successive hourly files then you should perform
>>>> linear interpolation"
>>>>
>>>> *http://test.www.ncl.ucar.edu/Document/Functions/Built-in/linmsg_n.shtml*
>>>> <http://test.www.ncl.ucar.edu/Document/Functions/Built-in/linmsg_n.shtml>
>>>>
>>>> If in some cases you have* 0 *files then the derived values are just
>>>> place holders.
>>>>
>>>> On Thu, Aug 1, 2019 at 12:57 AM Ipsita Putatunda via ncl-talk <
>>>> ncl-talk at ucar.edu> wrote:
>>>>
>>>>> Dear NCl users,
>>>>> I have hourly files, which I want to convert in 3 hourly files by
>>>>> averaging. But for everyday the hourly files are not continuous, and there
>>>>> are some missing hourly files. That is why the number of files present in
>>>>> each three hours is varying from 0 to 3. Hence using systemfunc function is
>>>>> giving error, where there are missing files.
>>>>> Can anyone please suggest me how can I get a 3 hourly average in this
>>>>> case.
>>>>>
>>>>> Thanks in advance,
>>>>> Ipsita
>>>>> _______________________________________________
>>>>> 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/20190801/e506c4e7/attachment.html>


More information about the ncl-talk mailing list