marius311 / CMBLensing.jl

The automatically differentiable and GPU-compatible toolkit for CMB analysis.

Home Page:https://cosmicmar.com/CMBLensing.jl

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Make Nside a tuple by default

cailmdaley opened this issue · comments

Currently Nside=4 and Nside=(4,4) don't broadcast together; a possible solution would be to always convert Nside to a tuple. @marius311 suggested

Flat(;Nside, θpix=θpix₀, ∂mode=fourier∂, D=1) = Flat{Nside .* (1,1), θpix, ∂mode, D}

in flat_fftgrid.jl

Fixed on master:

julia> load_sim(Nside=128, θpix=1, pol=:I).f .+ load_sim(Nside=(128,128), θpix=1, pol=:I).f
8320-element 128×128-pixel 1.0-resolution FlatFourier{Array{ComplexF32, 2},ProjLambert{Float32}}:
        0.0f0 + 0.0f0im
 -109720.81f0 + 22605.188f0im
              
 -549.03394f0 + 17.136276f0im
  230.41385f0 + 396.14264f0im