Skip to content
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

Redesign of AstroPeriod née Period and other small refactorings #63

Merged
merged 16 commits into from
Jul 30, 2021

Conversation

helgee
Copy link
Member

@helgee helgee commented Jul 22, 2021

Successful "Conference-Driven Development" 🤣

This a redesign of the AstroPeriod (formerly known as Period) type which makes it more compatible with the Epoch data model and also enables it to track its associated floating point error.

struct AstroPeriod{U<:TimeUnit, T}
    unit::U
    second::Int64
    fraction::T
    error::T
end

@helgee helgee requested review from giordano and bgodard July 22, 2021 10:49
@helgee helgee closed this Jul 22, 2021
@helgee helgee reopened this Jul 22, 2021
Copy link
Member

@giordano giordano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good as far as I can tell 🙂

end

function apply_offset(s1::Int64, f1, e1, s2::Int64, f2, e2)
isfinite(f1 + f2) || return handle_infinity(f1 + f2)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if that's relevant, but isfinite is false also for NaN.

Copy link
Member Author

@helgee helgee Jul 25, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting question 🤔

Here is Orekit's answer about what to do with NaN which is kind of unsatisfactory 🤣:

AbsoluteDate date = new AbsoluteDate(2021, 7, 4, 0, 59, 13.123, TimeScalesFactory.getTAI());
AbsoluteDate newDate = new AbsoluteDate(date, Double.NaN);

// Returns 2021-07-04T00:59:NaN

@helgee helgee linked an issue Jul 30, 2021 that may be closed by this pull request
@helgee helgee merged commit a891ffe into main Jul 30, 2021
@helgee helgee deleted the juliacon branch July 30, 2021 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect value when using TT time in a range expression
2 participants