[ANN] AstroLib.jl: IDL Astronomy User's Library (AstroLib) in Julia

50 views
Skip to first unread message

Mosè Giordano

unread,
Mar 12, 2016, 1:01:56 PM3/12/16
to Julia Astro
Dear all,

I am really happy to announce AstroLib.jl, a bundle of simple generic functions useful in astronomical and astrophysical context.  It is mainly thought as a translation of famous IDL AstroLib to Julia, but in the future it may also include other functions not included in that package.

You can find AstroLib.jl at https://github.com/giordano/AstroLib.jl and you can probably also install it with Pkg.add ("AstroLib") (it did not show up yet in http://pkg.julialang.org/ but it is present in METADATA.jl).

IDL AstroLib comprises almost 500 routines, currently AstroLibs.jl has just 5 functions, there is a lot to do!

I started learning Julia a few days ago and this is the first code I write in this language, I would really appreciate comments and suggestions about it.  For example, since the library is set to have hundreds of functions, I am not yet sure it is a good idea to have the package as a single monolithic module or rather split into many submodules, so that users can choose to import only the wanted submodule or the whole module when all or many submodules are needed.

Also volunteers to help translating the functions are more than welcome.

Bye,
Mosè

Kyle Barbary

unread,
Mar 12, 2016, 2:53:46 PM3/12/16
to julia...@googlegroups.com

Hi Mosè,

Welcome to Julia! Looks like you’ve gotten up to speed with the language very fast. Here are some comments after a quick look at AstroLib.jl:

For functions like aitoff, to achieve performance and get the “vectorized” version to return two vectors rather than a vector of tuples, I would explicitly write the vectorized method. Something like this:

function aitoff{T<:Number}(l::AbstractVector{T}, b::AbstractVector{T})
    @assert length(l) == length(b)
    x = similar(l)
    y = similar(l)
    for i in eachindex(l)
        x[i], y[i] = aitoff(l[i], b[i])
    end
    return x, y
end

For functions taking only one argument, check out the @vectorize_1arg method.

As you probably realize, some functionality in the IDL library AstroLib has overlap with existing Julia packages. For example, FITSIO.jl would be a natural place for FITS-related functionality; it would be great if you could contribute any missing FITS-related functionality there.

Best,
— Kyle


--
You received this message because you are subscribed to the Google Groups "Julia Astro" group.
To unsubscribe from this group and stop receiving emails from it, send an email to julia-astro...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mosè Giordano

unread,
Mar 12, 2016, 3:23:17 PM3/12/16
to Julia Astro
Hi Kyle,

thanks for the tips, much appreciated!

Yes, I know about FITSIO.jl and I'm not going to duplicate the effort ;-)  My intention was, at most, to have in AstroLib.jl some wrappers around FITSIO.jl functions with syntax similar to original AstroLib procedures, in order to smoothen transition from IDL, but not rewrite new functions from scratch.

Cheers,
Mosè

Mosè Giordano

unread,
Jun 16, 2016, 7:20:10 AM6/16/16
to Julia Astro
Hi all,

I'm pride to announce that AstroLib.jl has been moved to JuliaAstro project: https://github.com/JuliaAstro/AstroLib.jl

Since my last message in this thread, dozens of new functions have been added to the package. The full documentation is available at https://astrolibjl.readthedocs.io/

My goal for this package is to be complementary to other packages and avoid overlaps as much as possible. For example, Kyle pointed out to me that calz_unred function may be moved to DustExtinction.jl and precession functions to SkyCoords.jl.  Do you have other similar suggestions?

Do you have any suggestion in general about AstroLib?  For example, as a long-term project I was thinking about providing a new time-related data type, in order to enable easy conversion between different timescales and time formats of astronomical interest.  ERFA.jl may be used to perform some conversions.  What do you think?

Bye,
Mosè
Reply all
Reply to author
Forward
0 new messages