[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Orekit Users] Time question - julian date
- To: orekit-users@orekit.org
- Subject: Re: [Orekit Users] Time question - julian date
- From: beowulf zhang <beowulf.zhang@gmail.com>
- Date: Sat, 28 May 2011 21:01:34 +0800
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type:content-transfer-encoding; bh=oU2iQDruL/sF6B0Ysu+CR48NuDIL1klrJvyhdGZQUzE=; b=pByiICeI3JQ4KuxxrLMH0bEViiFvbkg5Rdg7zXiumUgeYlfYo6twoQt9Nro3428DPM 7nc/ubv11WKGi5sW+CmxM8FqFY85X2A9vXHthYZQa1C4pom4+KzioZ1j+Tyk77Xx1Zub fuFQg7DaP+07jlVeMAZFKmaLcRuIVyGu9iyMM=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=pnCgiEXPVHYeTGRKAkycJSbQOBIAVzzDliPuuqABU4VviZKtp6b6N7CFvuIYJL5qzR UyP3ZpMmkfj9joMFQYaugc7wlpkQF27JTzIxjn1zScbUy6O0sRniPZFCXD6K5wpU+Saz 44oh3MRx2PWUjmD4pB4/9/aawCsl1Xdiln3fE=
- In-reply-to: <20110527191625.37794qngq5munh49@messagerie.si.c-s.fr>
- References: <BANLkTik8dg_k_D-XN+_RK-9iAyz9xWs+ZQ@mail.gmail.com> <BANLkTi=d54OgC+v0jJ-N3dghAA3kNgeRHA@mail.gmail.com> <BANLkTin+i5RLbsAHY3p09KE2HAqUXNR+Zg@mail.gmail.com> <BANLkTik2BLdqDhUDgG8d0_Us0HczFTaakA@mail.gmail.com> <20110527191625.37794qngq5munh49@messagerie.si.c-s.fr>
The absolute class not have the constructor:
AbsoluteDate t = new AbsoluteDate(DateComponents.JULIAN_EPOCH, my_jd, utc);
I use the code:
DateComponents dc = new DateComponents(DateComponents.JULIAN_EPOCH, 2456413);
TimeComponents tc = new TimeComponents(0.5*86400);
AbsoluteDate jdEpoch = new AbsoluteDate(dc, tc, utc);
but I get:
2013-04-30T12:00:00.000
not
01-May-2013 00:00:00
could you tell me the reason?
2011/5/28, MAISONOBE Luc <luc.maisonobe@c-s.fr>:
> Petrus Hyvönen <petrus.hyvonen@gmail.com> a écrit :
>
>> Hi,
>>
>> Haven't managed to try that algorithm, but downloaded the SPG4 package
>> from
>> Vallado, and I get same Julian Date there as my previous algoritm.
>>
>> If I create a own date reference on:
>> ad_jd = AbsoluteDate(-4712,01,01,12,00,00.000,utc)
>>
>> and use;
>> epoch_date=AbsoluteDate(ad_jd,my_jd,utc)
>>
>> I get conversions from julian date to .. time ... same as the Vallado
>> routines.
>>
>> Why is orekit using a reference point at -4712-01-01T11:59:27.816 ? Is it
>> different timescales?
>
> Yes, Orekit uses the TT time scale for this referene date.
> In fact, julian day is mainly used only as a number of day reference,
> and the time is added later, and can theoretically be expressed in
> different time scales, mostly TT or UTC. This means that simply saying
> a date is 2455709.29166667 is ambiguous, one should say in which time
> scales the fractional part is considered.
>
> As the other reference epoch are precisely defined in TT (J2000 is the
> best example), and as TT is the most widely used time scale for
> defining references in IAU recommendations, we have chosen in Orekit
> to use the same TT time scale for all these references. This is
> specified in the javadoc for J2000 (see
> <https://www.orekit.org/static/apidocs/org/orekit/time/AbsoluteDate.html#J2000_EPOCH>)
> but obviously it is not explained in the javadoc for JULIAN_EPOCH, my
> bad.
>
> We could perhaps provide two reference epoch, one JULIAN_EPOCH_TT and
> one JULIAN_EPOCH_UTC, but this may also confuse users.
>
> Another way to achieve what you want could be something like:
>
> AbsoluteDate t = new AbsoluteDate(DateComponents.JULIAN_EPOCH, my_jd, utc);
>
> Luc
>
>>
>> Best regards
>> /Petrus
>>
>>
>>
>> On Fri, May 20, 2011 at 5:53 PM, beowulf zhang
>> <beowulf.zhang@gmail.com>wrote:
>>
>>> This algorithm is in the JAT. link is http://jat.sourceforge.net/
>>>
>>> 2011/5/20, beowulf zhang <beowulf.zhang@gmail.com>:
>>> > I can't find the reason of this question, but I give you a piece of
>>> > program that could give correct answer.
>>> >
>>> > /** Create a CalDate object using MJD. From Montenbruck C++ code.
>>> > * @param mjd Modified Julian Date.
>>> > */
>>> > public CalDate(double mjd){
>>> > long a,b,c,d,e,f;
>>> > double Hours,x;
>>> >
>>> > // Convert Julian day number to calendar date
>>> > a = (long)(mjd+2400001.0);
>>> >
>>> > if ( a < 2299161 ) { // Julian calendar
>>> > b = 0;
>>> > c = a + 1524;
>>> > }
>>> > else { // Gregorian calendar
>>> > b = (long)((a-1867216.25)/36524.25);
>>> > c = a + b - (b/4) + 1525;
>>> > }
>>> >
>>> > d = (long)( (c-122.1)/365.25 );
>>> > e = 365*d + d/4;
>>> > f = (long)( (c-e)/30.6001 );
>>> >
>>> > long temp = (long)(30.6001*f);
>>> > this.Day = (int)(c - e - temp);
>>> > temp = (long)(f/14);
>>> > this.Month = (int)(f - 1 - 12*temp);
>>> > temp = (long)((7+Month)/10);
>>> > this.Year = (int)(d - 4715 - temp);
>>> >
>>> > Hours = 24.0*(mjd-Math.floor(mjd));
>>> >
>>> > this.Hour = (int)Hours;
>>> > x = (Hours-Hour)*60.0;
>>> > this.Min = (int) x;
>>> > this.Sec = (x-Min)*60.0;
>>> > this.DOY = day2doy(this.Year, this.Month, this.Day);
>>> > }
>>> >
>>> >
>>> > 2011/5/19, Petrus Hyvönen <petrus.hyvonen@gmail.com>:
>>> >> Hi,
>>> >>
>>> >> This maybe is a FAQ but anyway...
>>> >>
>>> >> I'm trying to create an absolute date based on a julian date created
>>> >> in
>>> >> another software.
>>> >>
>>> >> My julian date is 2.456413500000000e+006, corresponding to 01-May-2013
>>> >> 00:00:00 UTC according to that software and some web conversion i
>>> checked
>>> >> it
>>> >> with.
>>> >>
>>> >> with orekit i do:
>>> >> ad_jd = AbsoluteDate.JULIAN_EPOCH
>>> >> ad_jd =
>>> >> -4712-01-01T11:59:27.816
>>> >>
>>> >> AbsoluteDate(ad_jd,t*24*3600)
>>> >> ans =
>>> >> 2013-04-30T23:58:53.816
>>> >>
>>> >> There must be some kind of time scale or different references here I
>>> >> suppose, how can convert this properly?
>>> >>
>>> >> Best regards
>>> >> /Petrus
>>> >>
>>> >
>>>
>>
>>
>>
>> --
>> _____________________________________________
>> Petrus Hyvönen, Uppsala, Sweden
>> Mobile Phone/SMS:+46 73 803 19 00
>>
>
>
>
> ----------------------------------------------------------------
> This message was sent using IMP, the Internet Messaging Program.
>
>
>