figue reading dates for an x y plot

This forum is dedicated to discuss all problems and suggestions related to the use of geopsy database and its plugins (array processing, H/V,...).
Post Reply
Leandro
Posts: 8
Joined: Fri Jun 28, 2024 4:20 pm

figue reading dates for an x y plot

Post 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
Attachments
Test.txt
(61.58 KiB) Downloaded 277 times
admin
Site Admin
Posts: 841
Joined: Mon Aug 13, 2007 11:48 am
Location: ISTerre
Contact:

Re: figue reading dates for an x y plot

Post 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
Post Reply