comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » help needed in timegen
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: help needed in timegen [message #94038 is a reply to message #94037] Thu, 29 December 2016 20:24 Go to previous message
gunvicsin11 is currently offline  gunvicsin11
Messages: 93
Registered: November 2012
Member
On Friday, December 30, 2016 at 7:03:28 AM UTC+5:30, Dick Jackson wrote:
> On Wednesday, 28 December 2016 20:22:46 UTC-8, gunvi...@gmail.com wrote:
>> On Wednesday, December 28, 2016 at 9:42:54 PM UTC+5:30, Jim P wrote:
>>> On Wednesday, December 28, 2016 at 4:37:36 AM UTC-7, fawltyl...@gmail.com wrote:
>>>> On Wednesday, December 28, 2016 at 11:10:06 AM UTC+1, sid wrote:
>>>> > Hi all,
>>>> >
>>>> > I have given below what I have done.
>>>> >
>>>> > print,julday(10,22,2014,14,00,32),format='(g)'
>>>> > 2456953.083703704
>>>> >
>>>> > mytimes=timegen(1,units='seconds',step_size=14,start=2456953 .083703704)
>>>> >
>>>> >
>>>> > The idea is to get julian at this date/time
>>>> > 10,22,2014,14,00,32 and
>>>> >
>>>> > 14 second after this, that is at 10,22,2014,14,00,46
>>>> >
>>>> > I expect the result to be 2456953.083865741.
>>>> >
>>>> > But If I do
>>>> > print, mytimes
>>>> > 2456953.0
>>>> >
>>>> > Please anybody let me know how to resolve this.
>>>> >
>>>> > thanks
>>>>
>>>> IDL> mytimes=timegen(2,units='seconds',step_size=14,start=2456953 .083703704d)
>>>> IDL> print, mytimes, format='(D20.10)'
>>>> 2456953.0837037046
>>>> 2456953.0838657417
>>>>
>>>> regards,
>>>> Lajos
>>>
>>> If you have IDL 8.5 or later, the new "implied print" syntax helps you get around the default formatting of the standard PRINT behavior.
>>>
>>> First option, simply type the variable name at the prompt.
>>>
>>> IDL> mytimes
>>> 2456953.0837037046 2456953.0838657417
>>>
>>> This is the same as using PRINT with the /IMPLIED keyword.
>>>
>>> IDL> print, mytimes, /implied
>>> 2456953.0837037046 2456953.0838657417
>>>
>>> The keyword can be unambiguously abbreviated to "/i":
>>>
>>> IDL> print, mytimes, /i
>>> 2456953.0837037046 2456953.0838657417
>>>
>>> There's less typing involved than with an explicit FORMAT string. (But also see the new C-style formatting in IDL 8.6.)
>>>
>>> Jim P.
>>
>> But if I need to get the values in the variable itself without printing, then what should I do,
>>
>> Because I am going to use the variable in a loop, I want the variable mytimes to have value with 2456953.083703704 format.
>
> The result from TIMEGEN does indeed have the precise values you want, it's just that if you 'print, mytimes' it is only *displaying* to eight digits of precision. Does that clear it up for you?
>
> Cheers,
> -Dick
>
> Dick Jackson Software Consulting Inc.
> Victoria, BC, Canada --- http://www.d-jackson.com

Thanks a lot, I got it now.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Circular statistics in IDL
Next Topic: help needed in the format of the output variable

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 09:37:59 PDT 2025

Total time taken to generate the page: 1.28094 seconds