comp.lang.idl-pvwave archive - RDF feed
type: channel
description: Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado
items: Re: plotting vs year-month-day

Re: plotting vs year-month-day
type: item
description: In article <C65tst.6xz@ra.nrl.navy.mil>, dere@cedar.nrl.navy.mil (Ken Dere) wrote: > > We have data that we would like to plot as a function of a running > calendar date where the axis will be labeled with the year and month, > with tick marks at the first day of each month. Leap years should be > treated properly. Somebody must know of such a routine. Any > information would be appreciated. There is a JULDAY program in User Library to compute astronomical Julian days. Not being an astronomer, I converted my own Fortran programs to compute day of the year (astronomers will probably jump on me for perverting the meaning of Julian day) given year, month, and date, and a similar program to compute month and date given year and Julian day (1-365 or 366). The programs are attached. No warranty is given. Improvements and bug reports welcome. The comments are not in standard IDL form. Sorry, still learning these things. Ken Bowman PRO MNTHDT, year, julday, month, date ; This subroutine computes the month and day of the month given the ; year and the Julian day ; Variables ; date = day of the month (integer) ; julday = Julian day ; jdtab = table of Julian day number of last day of month ; 0 not leap year ; leap = ; 1 leap year ; maxyr = latest valid year for this function (3999) ; minyr = earliest valid year for this function (1753) ; month = month of the year (integer 1 to 12) ; year = year (integer between minyr and maxyr) jdtab0 = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365] jdtab1 = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366] minyr = 1753 maxyr = 3999 ;Begin ;Check validity of year IF ((year LT minyr) OR (year GT maxyr)) THEN BEGIN ; PRINT, 'year = ',year ,' not in valid range ', minyr, maxyr month = 0 date = 0 RETURN ENDIF ;Determine whether leap year (1) or nonleap year (0) IF(year MOD 400 EQ 0) THEN leap = 1 ELSE $ IF(year MOD 100 EQ 0) THEN leap = 0 ELSE $ IF(year MOD 4 EQ 0) THEN leap = 1 ELSE $ leap = 0 IF(leap EQ 0) THEN BEGIN ;Ch…
creator: bowman
date: 1993-04-28T15:05:27-00:00

Re: plotting vs year-month-day
type: item
description: dere@cedar.nrl.navy.mil (Ken Dere) writes: > We have data that we would like to plot as a function of a running > calendar date where the axis will be labeled with the year and month, > with tick marks at the first day of each month. Leap years should be > treated properly. Somebody must know of such a routine. Any > information would be appreciated. > > --- The newest PV-WAVE (v4.?) has an option that does this. It is very easy and works very well. -- Doug Worth -- worth@acuson.com (worth@sono.sun.com, ..!sun!sono!worth) 415-694-5653 DISCLAIMER:: All thoughts and ideas expressed are mine and not Acusons Philosophy of Home Repair:: When all else fails....Get a bigger hammer
creator: worth
date: 1993-04-28T15:47:06-00:00