| | 1 | == Time Fields in DVO == |
| | 2 | |
| | 3 | mextract and imextract both have fields which represent a time value. When extracting these fields into vectors, the user has options to control the units and format of the resulting vectors. The vector is a floating-point value, with a reference date define by the DVO variable $TIMEREF. The units of the vector may be one of the following values: sec, min, hours, days (note that 'seconds' and 'minutes' invalid and are silently ignored). |
| | 4 | |
| | 5 | If TIMEREF is not set, it defaults to 1970/01/01,00:00:00. Some examples of TIMEREF: |
| | 6 | |
| | 7 | {{{ |
| | 8 | $TIMEREF = 2001/01/01,00:00:00 |
| | 9 | $TIMEREF = 2009/07/01,00:00:00 |
| | 10 | }}} |
| | 11 | |
| | 12 | There are two special words for TIMEREF: 'now' and 'today'. The value of 'now' make the reference the time of the query; the value of 'today' make the reference UT midnight of the day of the query. |
| | 13 | |
| | 14 | Be careful when you set TIMEREF. if you just do: $TIMEREF = |
| | 15 | 2001/01/01, it will treat that as a math expression, and set the |
| | 16 | reference to 2001 seconds since 1970/01/01... |
| | 17 | |
| | 18 | There are two special words for TIMEFORMAT: 'jd' and 'mjd'. With these options, TIMEREF is ignored and the date is returned as a JD or MJD. |
| | 19 | |
| | 20 | The dvo (or mana, etc) function 'ctimes' allows for on-the-fly conversions between human readable time/date values and the formated values. for example: |
| | 21 | {{{ |
| | 22 | dvo: $TIMEREF = 2009/10/20,00 |
| | 23 | dvo: echo $TIMEREF |
| | 24 | 2009/10/20,00 |
| | 25 | |
| | 26 | dvo: ctimes -ref 0.0 |
| | 27 | time: 2009/10/20,00:00:00 |
| | 28 | |
| | 29 | dvo: $TIMEFORMAT = sec |
| | 30 | dvo: ctimes -abs 2009/10/20,01:00:00 |
| | 31 | time: 3600.000000 |
| | 32 | |
| | 33 | dvo: $TIMEFORMAT = min |
| | 34 | dvo: ctimes -abs 2009/10/20,01:00:00 |
| | 35 | time: 60.000000 |
| | 36 | |
| | 37 | dvo: $TIMEFORMAT = hours |
| | 38 | dvo: ctimes -abs 2009/10/20,01:00:00 |
| | 39 | time: 1.000000 |
| | 40 | |
| | 41 | dvo: $TIMEFORMAT = days |
| | 42 | dvo: ctimes -abs 2009/10/20,01:00:00 |
| | 43 | time: 0.041667 |
| | 44 | |
| | 45 | dvo: $TIMEFORMAT = jd |
| | 46 | dvo: ctimes -abs 2009/10/20,01:00:0 |
| | 47 | time: 2455124.541667 |
| | 48 | |
| | 49 | dvo: $TIMEFORMAT = mjd |
| | 50 | dvo: ctimes -abs 2009/10/20,01:00:0 |
| | 51 | }}} |
| | 52 | |