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

Convert datetime to julian automatically in sunpos #91

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

LilithHafner
Copy link
Contributor

Implements #90 for the case of sunpos (perhaps there are other cases that should also be implemented). Because of the ::DateTime type signature it is hard to misuse these methods (i.e. you can't accidentally pass a Julian date into them) so I think the cost of adding the implicit conversions is low. Especially compared to the convenience and risk of misusing explicit conversions. If AstroLib ever drops its dependency on Dates, these can move to a package extension. It's possible to implement this ever so slightly faster and with less code re-use to avoid allocating a vector to store the Julian dates I propose adding that optimization iff someone identifies this as a performance bottle neck.

src/sunpos.jl Outdated Show resolved Hide resolved
@LilithHafner
Copy link
Contributor Author

Oh, this also assumes the DateTime's timezone is UTC which might not be okay.

src/sunpos.jl Outdated Show resolved Hide resolved
@LilithHafner
Copy link
Contributor Author

ct2lst handles DateTimes by requiring a time zone (0 for UTC)

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.

2 participants