Re: sec_to_dt has gone missing! [message #13235] |
Fri, 30 October 1998 00:00 |
Nigel Wade
Messages: 286 Registered: March 1998
|
Senior Member |
|
|
David Fanning wrote:
>
> Note: A copy of this article was e-mailed to the original poster.
>
> Nigel Wade (nmw@ion.le.ac.uk) writes:
>
> > In the documentation for IDL 5.1 the function SEC_TO_DT is
mentioned.
> > When I try to use it, it doesn't exist.
> >
> > I've searched the installation directories and can find no mention
of
> > this function anywhere except in the documentation.
> >
> > Does it really exist? Has anyone got it in their distribution?
>
> Mine works:
>
> IDL> print, sec_to_dt(100000)
> % Compiled module: SEC_TO_DT.
> % Compiled module: IDLDT__DEFINE.
> % Compiled module: DT_ADD.
> % Compiled module: JUL_TO_DT.
> % Compiled module: CALDAT.
> % Compiled module: VAR_TO_DT.
> % Compiled module: JULDAY.
> { -4713 1 2 15 46 40.0000 2.1574074 0}
>
> IDL> print, !version
> { x86 Win32 Windows 5.1.1 Jul 20 1998}
This is significant ^^^^^
>
> Cheers,
>
> David
>
> ----------------------------------------------------------
> David Fanning, Ph.D.
> Fanning Software Consulting
> E-Mail: davidf@dfanning.com
> Phone: 970-221-0438, Toll-Free Book Orders: 1-888-461-0155
> Coyote's Guide to IDL Programming: http://www.dfanning.com/
I guess someone forgot to include it in 5.1.
I've just downloaded 5.1.1 and it is in there.
--
-----------------------------------------------------------
Nigel Wade, System Administrator, Space Plasma Physics Group,
University of Leicester, Leicester, LE1 7RH, UK
E-mail : nmw@ion.le.ac.uk
Phone : +44 (0)116 2523568, Fax : +44 (0)116 2523555
|
|
|
Re: sec_to_dt has gone missing! [message #13236 is a reply to message #13235] |
Fri, 30 October 1998 00:00  |
Kevin Ivory
Messages: 71 Registered: January 1997
|
Member |
|
|
>> Nigel Wade (nmw@ion.le.ac.uk) writes:
>>> In the documentation for IDL 5.1 the function SEC_TO_DT is mentioned.
>>> When I try to use it, it doesn't exist.
>>
> David Fanning wrote:
>> Mine works:
David Foster wrote:
> Mine is broken:
It is complete and working in IDL 5.1.1 for Linux, so I'll simply attach
a copy of the file (the code is only a few lines) to the end of this
message.
Kevin
--
Kevin Ivory Tel: +49 5556 979 434
Max-Planck-Institut fuer Aeronomie Fax: +49 5556 979 240
Max-Planck-Str. 2 mailto:Kevin.Ivory@linmpi.mpg.de
D-37191 Katlenburg-Lindau, GERMANY http://www.gwdg.de/~kivory2/
------------- cut here -------------------------------------------------
;$Id: sec_to_dt.pro,v 1.1 1998/04/27 22:08:38 slett Exp $
;
; Copyright (c) 1997-1998, Research Systems, Inc. All rights reserved.
; Unauthorized reproduction prohibited.
FUNCTION SEC_TO_DT, seconds, Base=base, Date_fmt=date_fmt
;+
; NAME:
; SEC_TO_DT
;
;
; PURPOSE:
; Convert time from seconds-since-base to an IDLDT structure
;
;
; CATEGORY:
; MISC
;
;
; CALLING SEQUENCE:
; result = SEC_TO_DT( seconds)
;
;
; INPUTS:
; seconds: a floating point scalar, giving the number of seconds
; elapsed from the base date.
;
;
; OPTIONAL INPUTS:
;
;
;
; KEYWORD PARAMETERS:
; BASE: A keyword in string format (see STR_TO_DT), giving the
; base date. The default value is calculated from !DT_BASE.
; (Please see IDLDT__DEFINE for a description of !DT_BASE)
;
; Date_Fmt: An integer indicating the format of the BASE keyword.
; (Please see STR_TO_DT for an explanation of Date_Fmt)
; OUTPUTS:
; Returns an IDLDT structure with the date corresponding to
; the base date plus the seconds parameter.
;
;
; OPTIONAL OUTPUTS:
;
;
;
; COMMON BLOCKS:
;
;
;
; SIDE EFFECTS:
;
;
;
; RESTRICTIONS:
;
;
;
; PROCEDURE:
;
;
;
; EXAMPLE:
; PRINT, SEC_TO_DT( 245004.0)
;
;
; MODIFICATION HISTORY:
;
;-
tmp = {idldt}
IF keyword_set( base ) THEN BEGIN
ret_val = STR_TO_DT( base, Date_fmt=date_fmt )
ENDIF ELSE BEGIN
ret_val = !dt_base
ENDELSE
ret_val = DT_ADD( ret_val, second = seconds)
RETURN, ret_val
END
|
|
|
Re: sec_to_dt has gone missing! [message #13246 is a reply to message #13235] |
Thu, 29 October 1998 00:00  |
David Foster
Messages: 341 Registered: January 1996
|
Senior Member |
|
|
David Fanning wrote:
>
> Nigel Wade (nmw@ion.le.ac.uk) writes:
>
>> In the documentation for IDL 5.1 the function SEC_TO_DT is mentioned.
>> When I try to use it, it doesn't exist.
>
> Mine works:
>
> IDL> print, sec_to_dt(100000)
> % Compiled module: SEC_TO_DT.
> % Compiled module: IDLDT__DEFINE.
> % Compiled module: DT_ADD.
> % Compiled module: JUL_TO_DT.
> % Compiled module: CALDAT.
> % Compiled module: VAR_TO_DT.
> % Compiled module: JULDAY.
> { -4713 1 2 15 46 40.0000 2.1574074 0}
>
> IDL> print, !version
> { x86 Win32 Windows 5.1.1 Jul 20 1998}
Mine is broken:
IDL> print, sec_to_dt(100000)
% Variable is undefined: SEC_TO_DT.
% Execution halted at: $MAIN$
IDL> print, !version
{ sparc sunos unix 5.1 Apr 13 1998}
IDL>
Dave
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
David S. Foster Univ. of California, San Diego
Programmer/Analyst Brain Image Analysis Laboratory
foster@bial1.ucsd.edu Department of Psychiatry
(619) 622-5892 8950 Via La Jolla Drive, Suite 2240
La Jolla, CA 92037
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
|
|
|
Re: sec_to_dt has gone missing! [message #13248 is a reply to message #13246] |
Thu, 29 October 1998 00:00  |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
Note: A copy of this article was e-mailed to the original poster.
Nigel Wade (nmw@ion.le.ac.uk) writes:
> In the documentation for IDL 5.1 the function SEC_TO_DT is mentioned.
> When I try to use it, it doesn't exist.
>
> I've searched the installation directories and can find no mention of
> this function anywhere except in the documentation.
>
> Does it really exist? Has anyone got it in their distribution?
Mine works:
IDL> print, sec_to_dt(100000)
% Compiled module: SEC_TO_DT.
% Compiled module: IDLDT__DEFINE.
% Compiled module: DT_ADD.
% Compiled module: JUL_TO_DT.
% Compiled module: CALDAT.
% Compiled module: VAR_TO_DT.
% Compiled module: JULDAY.
{ -4713 1 2 15 46 40.0000 2.1574074 0}
IDL> print, !version
{ x86 Win32 Windows 5.1.1 Jul 20 1998}
Cheers,
David
----------------------------------------------------------
David Fanning, Ph.D.
Fanning Software Consulting
E-Mail: davidf@dfanning.com
Phone: 970-221-0438, Toll-Free Book Orders: 1-888-461-0155
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|