[Thread Prev][Thread Next][Index]

Re: [ferret_users] DAYS1900 function



Hi Patrick,
DAYS1900 is a function internal to Ferret; it doesn't have anything to do with vis5d. It just computes values based on the definition of calendar time, and no problems are caused by negative times. You have used it correctly; in your axis definition, you subtracted the function value for your starting time coordinate, DAYS1900(1860,1,1), so that your time axis has positive time-coordinate values.

To see a demonstration of the results of DAYS1900 for dates before 1900, try the definitions in your example but with start_year = 1899, and list the result for 2 years:

yes? LET start_year = 1899
yes? LET nyears = 2
yes? LET indices = L[L=1:`nyears*12`]

yes? LET month = MOD(indices-1,12)+1
yes? LET year = start_year + INT((indices-1)/12)

yes? list year, DAYS1900(year,month,1)

             T: 0.5 to 24.5
 Column  1: YEAR is START_YEAR + INT((INDICES-1)/12)
 Column  2: EX#2 is DAYS1900(YEAR,MONTH,1)
            YEAR   EX#2
1    /  1:  1899. -365.0
2    /  2:  1899. -334.0
3    /  3:  1899. -306.0
4    /  4:  1899. -275.0
5    /  5:  1899. -245.0
6    /  6:  1899. -214.0
7    /  7:  1899. -184.0
8    /  8:  1899. -153.0
9    /  9:  1899. -122.0
10   / 10:  1899.  -92.0
11   / 11:  1899.  -61.0
12   / 12:  1899.  -31.0
13   / 13:  1900.    0.0
14   / 14:  1900.   31.0
15   / 15:  1900.   59.0
16   / 16:  1900.   90.0
17   / 17:  1900.  120.0
18   / 18:  1900.  151.0
19   / 19:  1900.  181.0
20   / 20:  1900.  212.0
21   / 21:  1900.  243.0
22   / 22:  1900.  273.0
23   / 23:  1900.  304.0
24   / 24:  1900.  334.0

Brockmann Patrick wrote:
Hi all,

I would like to compute boundaries of a truemonth (cal=gregorian)
starting in 1860.

I use  the following lines (inspired from truemonth example in documentation)

LET start_year = 1860
LET nyears = 5
LET indices = L[L=1:`nyears*12`]
LET month = MOD(indices-1,12)+1
LET year = start_year + INT((indices-1)/12)

DEFINE AXIS/UNITS="seconds"/T0="01-JAN-1860"/EDGES truemonth = (DAYS1900(year,month,1)-DAYS1900(1860,1,1))*24*60*60

It works well.
But one can notice that I have used the function DAYS1900 with a year argument of 1860.

Is the function still correct in this case ?

It seems that this function calls a Vis5D function to make the computation. I cannot find it.

DATE1900(formatted date) Scalar function: converts a formatted date into Julian days since 1-Jan-1900.

Thanks
Patrick


[Thread Prev][Thread Next][Index]

Contact Us
Dept of Commerce / NOAA / OAR / PMEL / TMAP

Privacy Policy | Disclaimer | Accessibility Statement