-
-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
jde_utc_days Error #261
Comments
Thanks for reporting this, is very much looks like a bug to me. There
shouldn't be anything special with the year 1607, so I also expect the date
to be printed correctly.
When do you need this bug fixed? I'm unable to work on hifitime this week,
and the best schedule for me would be to fix this with version 4 of the
library.
…On Mon, Nov 27, 2023, 09:15 adcl-0 ***@***.***> wrote:
if I create Epoch for dates of 2023 the represantation of date when
printed is okay and the jde_utc is also correct.
but when I do that same for dates of year 1608 the representation of dates
is wrong but jde calculation is still correct.
but as soon as i try the same for years 1607 and before both the jde
calculation as well as the date representation is wrong.
is it a bug or something I am not able to understand.
I haven't tried the python library I just tried the rust
Thanks
Following is an example code and the result :
use hifitime;
pub fn jde_test() {
let mut test: hifitime::Epoch;
println!("Dates and JDE for year 1607");
for i in 25..=31 {
test = hifitime::Epoch::from_gregorian_utc(1607, 12, i, 0, 0, 0, 0);
println!("{} - {}", test, test.to_jde_utc_days());
}
println!("Dates and JDE for year 1608");
for i in 1..=5 {
test = hifitime::Epoch::from_gregorian_utc(1608, 1, i, 0, 0, 0, 0);
println!("{} - {}", test, test.to_jde_utc_days());
}
println!("Dates and JDE for year 2023");
for i in 1..=5 {
test = hifitime::Epoch::from_gregorian_utc(2023, 1, i, 0, 0, 0, 0);
println!("{} - {}", test, test.to_jde_utc_days());
}}
Dates and JDE for year 1607
-3277145-01-01T00:00:00 UTC - -1194435819.5
-3277145-01-01T00:00:00 UTC - -1194435818.5
-3277145-01-01T00:00:00 UTC - -1194435817.5
-3277145-01-01T00:00:00 UTC - -1194435816.5
-3277145-01-01T00:00:00 UTC - -1194435815.5
-3277145-01-01T00:00:00 UTC - -1194435814.5
-3277145-01-01T00:00:00 UTC - -1194435813.5
Dates and JDE for year 1608
1592-01-01T00:00:00 UTC - 2308369.5
1592-01-01T00:00:00 UTC - 2308370.5
1592-01-01T00:00:00 UTC - 2308371.5
1592-01-01T00:00:00 UTC - 2308372.5
1592-01-01T00:00:00 UTC - 2308373.5
Dates and JDE for year 2023
2023-01-01T00:00:00 UTC - 2459945.5
2023-01-02T00:00:00 UTC - 2459946.5
2023-01-03T00:00:00 UTC - 2459947.5
2023-01-04T00:00:00 UTC - 2459948.5
2023-01-05T00:00:00 UTC - 2459949.5
—
Reply to this email directly, view it on GitHub
<#261>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABEZV2F75P2S5LM65WCQHEDYGS4CJAVCNFSM6AAAAAA74JIXE6VHI2DSMVQWIX3LMV43ASLTON2WKOZSGAYTENRSHE2DINQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Fix it as soon as you can please. |
Okay.
Are you needing the fix for the JDE computation in UTC or also for the
calendar representation? Could you also check the bug happens with the TAI
representation? TAI and UTC are identical before 1972.
…On Mon, Nov 27, 2023, 10:39 adcl-0 ***@***.***> wrote:
Fix it as soon as you can please.
Thanks
—
Reply to this email directly, view it on GitHub
<#261 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABEZV2AWD7W5XUSJODQXGADYGTF47AVCNFSM6AAAAAA74JIXE6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMRYGMYTOMRYGU>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
for now I am using my own calculations for jde and sidereal times, I need these to calculate nutation and precession mainly. |
When it's about to overflow, we would immediately set the duration to MIN or MAX. But in fact, we can try to convert everything to i128 and then see if it fits in the duration. Add test for #261 (does not pass yet)
Just to let you know, I've started working on this. I've fixed the negative years you were seeing, but the computed years is still incorrect. |
With the large update done in preparation to version 4, the years and month seem correct for the year 1607, but not the days, so I'm working on that. |
if I create Epoch for dates of 2023 the represantation of date when printed is okay and the jde_utc is also correct.
but when I do that same for dates of year 1608 the representation of dates is wrong but jde calculation is still correct.
but as soon as i try the same for years 1607 and before both the jde calculation as well as the date representation is wrong.
is it a bug or something I am not able to understand.
I haven't tried the python library I just tried the rust
Thanks
Following is an example code and the result :
The text was updated successfully, but these errors were encountered: