TIME2JD [message #92684] |
Mon, 08 February 2016 02:03  |
Sapna Mishra
Messages: 66 Registered: December 2015
|
Member |
|
|
Hello everyone,
I have a time t='18:57:06.65' how can I use it to calculate JD.
i don't have any information about date. i used anytim2jd.pro but it is saying wrong format of time.
Kindly anyone suggest me with format or with another .pro file.
|
|
|
|
|
Re: TIME2JD [message #92687 is a reply to message #92686] |
Mon, 08 February 2016 03:46   |
greg.addr
Messages: 160 Registered: May 2007
|
Senior Member |
|
|
If you don't care about the day (e.g. if all your times come from the same day), then pick an arbitrary month, day, year, and use this:
Result = JULDAY(Month, Day, Year, Hour, Minute, Second)
|
|
|
Re: TIME2JD [message #92689 is a reply to message #92687] |
Mon, 08 February 2016 09:41   |
Michael Galloy
Messages: 1114 Registered: April 2006
|
Senior Member |
|
|
On 2/8/16 4:46 AM, greg.addr@googlemail.com wrote:
>
> If you don't care about the day (e.g. if all your times come from the
> same day), then pick an arbitrary month, day, year, and use this:
>
> Result = JULDAY(Month, Day, Year, Hour, Minute, Second)
>
Just to be clear about this, you could calculate a Julian day given an
arbitrary date, but then only the fractional part of that Julian day
would be useful (and you would probably want to subtract 0.5 as well).
I'm not sure why any of that would be useful though. The Julian day is a
number of days from a specific time in the past. Are you just trying to
calculate the fractional day for a given time?
In any case, for a basic explanation, check the IDL documentation for
JULDAY and Wikipedia:
https://en.wikipedia.org/wiki/Julian_day
Mike
--
Michael Galloy
www.michaelgalloy.com
Modern IDL: A Guide to IDL Programming (http://modernidl.idldev.com)
|
|
|
|
Re: TIME2JD [message #92694 is a reply to message #92693] |
Mon, 08 February 2016 21:31   |
Jim Pendleton
Messages: 165 Registered: November 2011
|
Senior Member |
|
|
On Monday, February 8, 2016 at 10:19:56 PM UTC-7, Sapna Mishra wrote:
> Yeah Mike,
> I am actually interested in the fractional part. I am dealing with fits file of the same date having different UT, actually I want to extract UT of each file and calculate JD, which I was expecting to be different for each files(talking about fractional part). But all the routines in IDL (including julday.pro) are giving me JD upto one decimal place which is almost similar for each file.
> Can any one suggest me any routine which can provide me JD upto high precision (like upto 4-5 decimal place)
> Also I want to ask can anyone tell how to deal with float variables in unix shell scripts???
Are you confusing the printed output format with the actual precision of the data? The JULDAY() function returns a double-precision number. If you're simply looking at the output from PRINT, that's only going to display 8 digits. But if you use a better FORMAT statement with PRINT, or you use implied print, you'll see many more digits.
IDL> print, julday()
2457427.4
IDL> help, julday()
<Expression> DOUBLE = 2457427.4
IDL> julday()
2457427.4363425933
And a little later in elapsed time...
IDL> print, julday(), format = '(d)'
2457427.4374884265000000
Jim P.
|
|
|
|