0

I have a .txt file in which the second column represents the measuring time in seconds (starting date of measurements is 04/01/15) during 367 days (end date of measurements is 04/01/16). The third and so on are measured variables.

In my analysis I need to have this second column in Julian days (when dealing with this type of date I usually use as "origin" 01/01/1992) in order to assess with other variables in other files that have already the date in Julian time. I could also use the calendar date instead if I had it!

Example of the file:

(First day)

091.00000   0.00    102.63  16.79   81.40   5.07    144.20  0.00
091.00069   60.00   102.63  16.80   81.30   5.86    136.00  0.00
091.00139   120.00  102.63  16.75   81.20   2.46    144.20  0.00

(...)

091.99931   86340.00    102.53  17.09   82.60   1.60    117.00  0.00

(Second day)

092.00000   0.00    102.53  16.96   82.60   1.56    115.00  0.00
092.00069   60.00   102.53  16.87   82.90   1.38    114.70  0.00
092.00139   120.00  102.53  17.01   82.90   1.13    110.30  0.00

(...)

092.99931   86340.00    102.44  17.38   87.10   1.75    116.00  0.00

This happens for all days during the entire 367 days (corresponding to a total of 526970 measurements) and I have this all together in one file. There might be missing data recording, so I can use missing values (NA) in those gaps.

I'm using R.

1 Answers1

0

The second column seems to be the number of seconds since the current day started. 24 hours / day * 3600 seconds per hour is 86400 seconds per day. So SecondColumn/86400 gives the decimals of the Julian date. The second columns doesn't hold information on the date itself.

Thierry
  • 18,049
  • 5
  • 48
  • 66
  • Ok, so the first column that I have is already the Julian date (0.9100000, 0.9100069,...). then I must be doing something wrong when I'm plotting the data with this column as x-axis. I basically use tm2_1min=dat2$V1 (first column) for x-axis and atmos_press_1min=dat2$V3 (third column) for one e.g. variable and then plot(tm2_1min,atmos_press_1min,type="l",xaxt = "n") with axis(side=1,at=datJ,lab=labJ) defined as datJ=seq(from=julian(04,01,2015, origin=c(1,1,1992)), to=julian(02,04,2016, origin=c(1,1,1992))) labJ=seq.dates("04/01/2015","02/04/2016",by="days") – Francisco Lopes Apr 20 '16 at 10:49
  • Hey, I've managed to resolve my problem. the Julia days that I have in the file start counting from 2015 and not from 1992 as I'm used to. In addition, when the counting reaches 365 it goes back again to 091.000 and R was causing trouble for that when I wanted to plot the data. So i just corrected the counting to keep going from 365 up to 456. I can plot nicely now the data. thanks for the hint btw. – Francisco Lopes Apr 20 '16 at 12:24