IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changes between Version 1 and Version 2 of DVO_format


Ignore:
Timestamp:
May 29, 2009, 1:40:54 PM (17 years ago)
Author:
beaumont
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • DVO_format

    v1 v2  
    254254measurements = mrdfits('n0000/0148.cpm',1, range=[lo,hi])
    255255}}}
     256
     257 * Convert between the UNIX time in the .cpm table to Julian Date
     258{{{
     259;+
     260; PURPOSE:
     261;  Convert linux time (the number of seconds since UTC Jan 1 1970) to
     262;  julian date (the number of days since Jan 1 4713 BC).
     263;
     264; CATEGORY:
     265;  time
     266;
     267; CALLING SEQUENCE:
     268;  result = linux2jd(linuxTime)
     269;
     270; INPUT:
     271;  The linuxTime, in seconds
     272;
     273; OUTPUT:
     274;  The julian date, in days
     275;
     276; MODIFICATION HISTORY:
     277;  March 2009 Written by Chris Beaumont
     278;  April 8 2009: Fixed bug which treated j2000 as j2001
     279;-
     280function linux2jd, linuxTime
     281compile_opt idl2
     282on_error, 2
     283
     284;- check inputs
     285if n_params() ne 1 then begin
     286   print, 'linux2jd calling sequence:'
     287   print, ' jd = linux2jd(linux time)'
     288   return, !values.f_nan
     289endif
     290
     291;- reference numbers
     292j2000 = 946684800D        ;-linux time at 2000
     293juldate, [2000,1,1], jd0  ;-reduced julian date at 2000
     294jd0 += 2400000D           ;-conversion to normal jd
     295
     296return, jd0 + (linuxTime - j2000) / 86400
     297end
     298
     299}}}