Re: yyyymmdd_to_yyyyfrac

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Wed Dec 29 2010 - 14:05:01 MST

I think the issue is simply that these numbers are too big to be contained in a float.

Trying reading them in as doubles instead.

    data = readAsciiTable("mytest",ncol,"double",0)

--Mary

On Dec 29, 2010, at 10:22 AM, Achraf Koulali Idrissi wrote:

> Hello,
>
> here is my way for reading data:
>
> data = readAsciiTable("mytest",ncol,"float",0)
> yyyymmdd = data(:,0)
>
> Thanks
> Achraf
>
> On Wed, Dec 29, 2010 at 12:13 PM, Mary Haley <haley@ucar.edu> wrote:
> Achraf,
>
> I need more information.
>
> How are you reading in that first column of data (i.e. what variable type did you use),
> and exactly how are you calling yyyymmdd_to_yyyyfrac?
>
> I tried to reproduce the problem, but I got different results from you:
>
> (0) 2007.986
> (1) 2007.989
> (2) 2007.992
> (3) 2007.995
> (4) 2007.997
>
>
> The "1979.604" value in your output below is way off. What version of NCL are you running? (ncl -V)
>
> --Mary
>
> On Dec 29, 2010, at 9:30 AM, Achraf Koulali Idrissi wrote:
>
> > Hello,
> >
> > I have a problem with the function : yyyymmdd_to_yyyyfrac
> >
> > It reads an extra day 32 of each month. here is my test :
> >
> > ----- input file
> >
> > 20071227 2.4076 0.0019 0.0011 0.0030 0.0007 0.0031
> > 20071228 2.3876 0.0019 -0.0016 0.0031 0.0044 0.0031
> > 20071229 2.3867 0.0019 -0.0037 0.0030 0.0030 0.0030
> > 20071230 2.3808 0.0021 -0.0028 0.0031 0.0048 0.0034
> > 20071231 2.3821 0.0019 -0.0033 0.0030 -0.0002 0.0031
> >
> > ----- result :
> >
> > Variable: yrfrac
> > Type: float
> > Total Size: 20 bytes
> > 5 values
> > Number of Dimensions: 1
> > Dimensions and sizes: [5]
> > Coordinates:
> > Number Of Attributes: 3
> > long_name : Time
> > units : YYYY + fractional portion of year
> > info : derived using: function yyyymmdd_to_yyyyFrac
> > (0) 2007.99
> > (1) 2007.99
> > (2) 2007.99
> > (3) 2007.996
> > (4) 1979.604
> >
> >
> > _______________________________________________
> > ncl-talk mailing list
> > List instructions, subscriber options, unsubscribe:
> > http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Dec 29 14:05:08 2010

This archive was generated by hypermail 2.1.8 : Tue Jan 04 2011 - 09:16:52 MST