help needed in timegen [message #94027] |
Wed, 28 December 2016 02:10  |
gunvicsin11
Messages: 93 Registered: November 2012
|
Member |
|
|
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
|
|
|
Re: help needed in timegen [message #94028 is a reply to message #94027] |
Wed, 28 December 2016 03:37   |
Lajos Foldy
Messages: 176 Registered: December 2011
|
Senior Member |
|
|
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
|
|
|
Re: help needed in timegen [message #94030 is a reply to message #94028] |
Wed, 28 December 2016 08:12   |
Jim Pendleton
Messages: 165 Registered: November 2011
|
Senior Member |
|
|
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.
|
|
|
Re: help needed in timegen [message #94031 is a reply to message #94030] |
Wed, 28 December 2016 20:22   |
gunvicsin11
Messages: 93 Registered: November 2012
|
Member |
|
|
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.
|
|
|
Re: help needed in timegen [message #94037 is a reply to message #94031] |
Thu, 29 December 2016 17:33   |
Dick Jackson
Messages: 347 Registered: August 1998
|
Senior Member |
|
|
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
|
|
|
Re: help needed in timegen [message #94038 is a reply to message #94037] |
Thu, 29 December 2016 20:24  |
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.
|
|
|