comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: IDL missing date and data
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: IDL missing date and data [message #64899 is a reply to message #64898] Thu, 29 January 2009 04:41 Go to previous messageGo to previous message
loebasboy is currently offline  loebasboy
Messages: 26
Registered: August 2008
Junior Member
On 29 jan, 11:15, mbo <msty...@gmail.com> wrote:
> I am to creating a monthly time series data  from  daily averages data
> that spans from 1999 to 2008.
>
> However, there data gaps of about 2 to for 4 days for some of the
> monts. So that this data would look like this
>
> 20/07/1999       20
> 24/07/1999       40
>
> You would notice that there are 4 days missing but the data shows no
> gaps int it.
>
> How can I expand this kind of data to look like this
>
> 20/07/1999  20
> 21/07/1999  NaN
> 22/07/1999  NaN
> 23/07/1999 NaN
> 24/ 07/1999 40

First make a matrix with 2 columns with length of all days. The first
column consist of all the dates of days you need. I think you can
generate that with the TIMEGEN function. The second column all consist
of Nan values which you can create by using !values.f_nan . Then do a
for loop on the original matrix to fill in the data you have by
comparing the dates of the second matrix with the first matrix and
getting the index with a where function. Then fill in the second
matrix with that index and the right value. An easy, but maybe not
that efficient (cause of the for loop), solution.
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: IDL missing date and data
Next Topic: change mouse cursor in draw widget

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 21:28:37 PDT 2025

Total time taken to generate the page: 0.72256 seconds