nicertimeconv performs basic time conversions for NICER-related timestamps. It converts between basic MET (mission elapsed time), UTC date, day-of-year date, and GPS time. The user specifies an input time and a desired output time format. By default, the output will give all possible conversions, but the user cna request a specific one.
nicertimeconv is not a standard HEASoft task. It does not have a parameter file, but rather is a basic command line program suitable for integrating into other tasks that need time conversion. All options and inputs must be specified on the command line (or as standard input as noted below).
The input can either come from standard input as an ASCII stream, or from the command line. If the input comes from standard input, then the parser scans each line for a value that looks like a time (see below) in the first column of the file; the time value is replaced with the converted value. Other parts of the file are left unchanged. Thus, this is a simple way to replace the "time column" of a text file with another format, as long as the time column is the first column of the file.
The allowed input time formats are:
The output formats are:
USAGE: nicertimeconv [-iso] [-doy] [-met] [-stdin] [time value][+offset] [time value] can be any of the following forms: YYYY-MM-DDThh:mm:ss - ISO-standard time YY-MM-DDThh:mm:ss - ISO-standard time with two digit year YYYY:DDD:hh:mm:ss - Day-of-year notation YY:DDD:hh:mm:ss - Day-of-year notation with two digit year numerical value - NICER mission elapsed time in seconds -now - use the current time +offset - number of seconds offset (+ or - allowed) NOTES: all times are in UTC specification of seconds is optional separator character between years days and months can be a colon(:), dash(-) or slash(/) -iso - output the time as ISO standard YYYY-MM-DDThh:mm:ss -doy - output the time as day-of-year YYYY-MM-DDThh:mm:ss -met - output the time as Mission elapsed time in seconds -gps - output the time as GPS seconds elapsed since 1980-01-06 If none of -iso -doy and -met are specified then all forms are printed in a more verbose form. -stdin - if set, then instead of using a value from the command line read standard input line by line and convert values
1. Convert the time 2018-02-04T01:02:03 to all possible outputs
$ nicertimeconv 2018-02-04T01:02:03 ISO = 2018-02-04T01:02:03 DOY = 2018:035:01:02:03 MET = 129171725 GPS = 1201741343
2. Convert the time 2018-02-04T01:02:03 to mission elapsed time.
$ nicertimeconv -met 2018-02-04T01:02:03 129171725
3. Convert the current time to UTC calendar date.
$ nicertimeconv -now -iso 2018-02-04T01:02:03
4. Apply a numerical offset 1000 seconds into the future
$ nicertimeconv 2018-02-04T01:02:03+1000 ISO = 2018-02-04T01:18:43 DOY = 2018:035:01:18:43 MET = 129172725 GPS = 1201742343
swifttime, sec2time, time2sec, ahtimeconv