Giter VIP home page Giter VIP logo

Comments (14)

jmert avatar jmert commented on July 29, 2024 1

Like I said a couple of comments ago, way back when it either didn't exist or didn't satisfy my needs. I've been carrying around my own implementation of Healpix calculations for a long time.

In fairness, though, the goals are still kind of different. ziotom78/Healpix.jl is aimed at being a Julia replacement for what I typically call libhealpix, the original Fortran/C++ implementation. That includes a bunch of things I don't care about like reading/writing FITS formatted maps, the NESTED scheme pixelization, representing HEALPix maps with specialized data structures, etc. My needs are much more constrained, mostly related to calculating the spherical coordinates for RING scheme indices, and I've tried to do it in a way which supports any number type (so that something like automatic differentiation or dual number types should in principle work).

from cmb.jl.

jmert avatar jmert commented on July 29, 2024

I've sorta already done that once before in the context of representing a large matrix operator which operates on a HEALPix map and produces an RA/Dec map — see

struct HealpixPixelization{V} <: AbstractPixelization
nside::Int64
pixels::V
function HealpixPixelization(nside::Integer, pixels::AbstractVector)
npix = nside2npix(nside)
minpix, maxpix = extrema(pixels)
checkhealpix(nside, minpix)
checkhealpix(nside, maxpix)
return new{typeof(pixels)}(Int64(nside), pixels)
end
function HealpixPixelization(nside::Integer)
n = convert(Int64, nside)
pix = zero(n):nside2npix(n)-1
return new{typeof(pix)}(n, pix)
end
end

It explicitly doesn't store data inline because its role is to describe the subset of pixels which are relevant for interpreting the columns of the matrix operator.

from cmb.jl.

milankl avatar milankl commented on July 29, 2024

Okay that's fantastic. Many thanks for it. I'll start playing around with it. For that I'll probably manually copy over your code given that the package here is not registered. However, I'd be more then welcome to create a dependency if you decide to register CMB.jl

from cmb.jl.

jmert avatar jmert commented on July 29, 2024

CMB is a bad name to register in the General registry, and the purpose of this package is I think too specific to ever really consider registering it as a whole — the purpose has always been to recreate a specific calculation in Julia which was a big component of my thesis work (which was in a collaboration doing experimental cosmology).

(And I guess for a bit more context on why I didn't use Healpix.jl, it's because my work on a version of this package started back in 2014 — although current git history doesn't go back that far since I've branched/recreated/restarted this project a couple of times — when Healpix.jl was either non-existent or didn't meet my needs.)

from cmb.jl.

milankl avatar milankl commented on July 29, 2024

Would you in general be interested to put healpix.jl from this repository into jmert/HEALPix.jl and register it as v0.1? All the functionality in there and documentation is great, and we'd like to use it. But for the dependency it should be registered as an official package. It doesn't need to be v1 or in some form stable, if you feel like releasing a breaking change then I'm sure you'd very good reasons to do so.

from cmb.jl.

milankl avatar milankl commented on July 29, 2024

I understand the conflict with CMB.jl and it being more your work in progress repository, but I think the spin-offs (HEALPix.jl or SphericalHarmonicTransforms.jl) are general enough to make them interesting to a wider audience outside of astronomy/cosmology, like weather and climate people.

from cmb.jl.

jmert avatar jmert commented on July 29, 2024

I'm certainly open to splitting the code into jmert/Healpix.jl and registering it in my registry — the barrier to doing that is very low. The obvious conflict with registering in General is that it'd need a new name.

from cmb.jl.

milankl avatar milankl commented on July 29, 2024

I think HEALPix.jl is great to be honest, it even has a wiki entry https://en.wikipedia.org/wiki/HEALPix

from cmb.jl.

jmert avatar jmert commented on July 29, 2024

What I mean is that https://github.com/JuliaRegistries/General/tree/master/H/Healpix already exists and points to ziotom78/Healpix.jl. I'd need to rename to something else to get it registered in General.

from cmb.jl.

jmert avatar jmert commented on July 29, 2024

I just realized I misinterpreted the title of this issue as "Why not use ziotom78/Healpix.jl?" rather than "Can you split CMB.jl's Healpix module to a new Healpix.jl?". Sorry for the confusion there.

from cmb.jl.

milankl avatar milankl commented on July 29, 2024

I didn't know of ziotom78's implementation 🙈 what was your reason to write your own?

from cmb.jl.

jmert avatar jmert commented on July 29, 2024

@milankl I've finally had an afternoon to return to this issue. I've extracted the Healpix module from this package and made it available via a new package (https://github.com/jmert/Healpix.jl), which again is not part of the Julia General registry, instead requiring use of my personal registry or adding by git path explicitly.

from cmb.jl.

milankl avatar milankl commented on July 29, 2024

Thanks Justin, this is great. In the meantime we used Healpix.jl, but then realised that the functions of that package we actually need are so few that we just implemented them ourselves to avoid a big dependency. Maybe you find that interesting, SpeedyWeather.jl now runs with the standard HEALPix grid and a variant we call the HEALPix4 grid, which only has 4 base pixels instead of 12. The reason is that we usually want 4x as many longitudes at the Equator as there are latitudes - which you don't get with HEALPix, but with HEALPix4. However, I'm not sure what happens if we don't follow that rule in our application. Quick overview

image

Btw, just to be open about this: Given that your grid-flexible transform implementation has massively influenced ours, when we start writing a paper about HEALPix grids for spectral weather models then I'd like to invite you as a co-author.

from cmb.jl.

jmert avatar jmert commented on July 29, 2024

Thanks Justin, this is great. In the meantime we used Healpix.jl, but then realised that the functions of that package we actually need are so few that we just implemented them ourselves to avoid a big dependency. Maybe you find that interesting, SpeedyWeather.jl now runs with the standard HEALPix grid and a variant we call the HEALPix4 grid, which only has 4 base pixels instead of 12. The reason is that we usually want 4x as many longitudes at the Equator as there are latitudes - which you don't get with HEALPix, but with HEALPix4. However, I'm not sure what happens if we don't follow that rule in our application. Quick overview

image

In case you haven't come across this reference before, https://arxiv.org/abs/astro-ph/0412607 describes how HEALPix in its base-12 pixel format is just one realization of a class of similar pixelizations — your choice to reduce the number of base latitudes can be described within their scheme (IIRC).

Btw, just to be open about this: Given that your grid-flexible transform implementation has massively influenced ours, when we start writing a paper about HEALPix grids for spectral weather models then I'd like to invite you as a co-author.

I'd be honored! I look forward to reading and learning!

from cmb.jl.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.