Closed TestSubjector closed 7 years ago
Thanks for the list!
Regarding the required functions:
tdb2tdt
is proprietary (maybe ERFA.jl
has something for that)setdefaultvalue
is probably unnecessary@evalpoly
should be a drop-in replacement of poly
textopen
and textclose
may not be necessary (but didn't look thoroughly)Julia's @evalpoly should be a drop-in replacement of poly
@evalpoly(z, c...) generates code at compile-time so it requires length of c (the coefficients) at that stage only.
One trick that can be used to avoid that is to have something like @eval @evalpoly(z, $(c...))
where eval forces the evaluation of the argument.
textopen and textclose may not be necessary (but didn't look thoroughly)
Yeap, not required. Just listing for reference.
@evalpoly(z, c...) generates code at compile-time so it requires length of c (the coefficients) at that stage only.
Yes, but in fm_unred
the coefficients are known.
Yes, but in fm_unred the coefficients are known.
Not in (for some reason the poly procedure was not listed as a dependency there)ismeuv
though.
The c1
and c2
vectors in ismeuv
are constant, aren't they?
The c1 and c2 vectors in ismeuv are constant, aren't they?
My bad. Got confused a bit regarding how @evalpoly
works.
The main problem I was having was with regards to the coefficient's length
julia> d = [1,2,3]
julia> @evalpoly(4, d)
ERROR: BoundsError: attempt to access (:d,) at index [0]
julia> @evalpoly(4, d...)
ERROR: BoundsError: attempt to access (:(d...),) at index [0]
However, inserting the coefficients as literal works
julia> @evalpoly(4, d[1], d[2], d[3])
57
Reference: https://stackoverflow.com/questions/28077057/julia-evalpoly-macro-with-varargs
Yes, you can't splat an iterable in a macro call, because at compile time it's a single expression.
You don't even need to allocate a useless array, just do
julia> @evalpoly 4 1 2 3
57
If the length of the coefficient vector is known when you write down the code, @evalpoly
is extremely efficient.
Everything date-related should be covered by AstronomicalTime.jl.
All listed functions have been ported, we can close this. Thanks for your work @TestSubjector!
This is an issue to track most of the important astronomical utilities, not present in the package.
Additionally, a few of these routines call other procedures, some of which are not there in the package. As AstroLib.jl's functions are not a drop-in replacement of IDL AstroLib's procedures, these 'required' procedures may not be necessary. However they are listed below for reference.
@evalpoly
) ~textopen (called by uvbybeta)~ (not required, simply use println( )) ~textclose (called by uvbybeta)~ (not required, simply use println( ))