Page 1 of 1

figue reading dates for an x y plot

Posted: Sun Aug 17, 2025 1:07 pm
by Leandro
Hi Marc,

Came across creating xy plots with dates using figue but doesn't seem to point to the proper absolute time reference. In my file I have x in the format yyyyMMddhhmmssz (as per -h) and I use the starting time as input to the command -x-abs-time-ref. It is read and plotted in figue but absolute time is offset. That said, could you please advise what the reference should be or if this is a bug? Thanks as always!
File is attached Test.txt

Re: figue reading dates for an x y plot

Posted: Wed Sep 10, 2025 7:28 am
by admin
Hi Leandro,

figue reads time as a number of seconds since a reference time specified with option '-x-abs-time-ref'. Hence to plot your data the command line should be:

Code: Select all

cat Test.txt | gptime -i "yyyyMMddhhmmss" -o time_t -c 1 | figue -c -x-abs-time-ref 19700101000000
gptime is a tool provided with geopsypack that can convert time formats ('-i'=input format, '-o'=output format). '-c 1' is to modify only the first column. time_t returns the number of seconds since 1970-01-01.

Code: Select all

$ head -n 3 Test.txt
20240503040335  -3.94   1
20240503041359  -3.94   1
20240503042423  -4.19   1
$ head -n 3 Test.txt | gptime -i "yyyyMMddhhmmss" -o time_t -c 1
1714709015.000000       -3.94   1
1714709639.000000       -3.94   1
1714710263.000000       -4.19   1
Any other time reference is possible. A reference date closer to the actual times ensures a better precisions (if nanoseconds are required).

Code: Select all

cat Test.txt | gptime -i "yyyyMMddhhmmss" -o "seconds since 20240101" -c 1 | figue -c -x-abs-time-ref 20240101000000