Skip to content

Commit

Permalink
low res planck example data
Browse files Browse the repository at this point in the history
  • Loading branch information
xzackli committed Apr 16, 2021
1 parent 036fc02 commit 93df1a4
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 5 deletions.
11 changes: 6 additions & 5 deletions Artifacts.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[pixwin]
git-tree-sha1 = "d11923cfa0b2d87d5bb8898ea574b8a9b2a114fc"
[plancklowres]
git-tree-sha1 = "55aefe5af2a7c81db192de15d553ab00da56ca58"
lazy = true

[[pixwin.download]]
url = "https://github.com/xzackli/HEALPix_data/raw/master/pixwin.tar.gz"
sha256 = "986792ca52a53d8cf34b2e0fa18d5c1a9aebdfd0167edfb1fc472daf1965ab07"
[[plancklowres.download]]
url = "https://github.com/xzackli/PSPipePlanckRender.jl/releases/download/v0.1/plancklowres.tar.gz"
sha256 = "8e420d81db37d3d2ae93390e927cd20400a08bef018ca8ed81e079bbd3b0f4e7"
1 change: 1 addition & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ FillArrays = "1a297f60-69ca-5386-bcde-b61e274b549b"
Healpix = "9f4e344d-96bc-545a-84a3-ae6b9e1b672b"
IdentityRanges = "bbac6d45-d8f3-5730-bfe4-7a449cd117ca"
Lazy = "50d2b5c4-7a5e-59d5-8109-a42b560f39c0"
LazyArtifacts = "4af54fe1-eca0-43a8-85a7-787d91b784e3"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
OffsetArrays = "6fe1bfb0-de20-5000-8ca7-80f57d26f881"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Expand Down
7 changes: 7 additions & 0 deletions examples/dev_plancklowres.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
using Healpix
using AngularPowerSpectra

AngularPowerSpectra.util_planck256_dir()

m₁ = util_planck256_polmap("100", "1")
m₂ = util_planck256_polmap("100", "2")
4 changes: 4 additions & 0 deletions src/AngularPowerSpectra.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import DataStructures: DefaultDict
import Combinatorics: permutations, combinations, with_replacement_combinations
import Healpix: Map, PolarizedMap, Alm, RingOrder, alm2cl, map2alm, numberOfAlms,
RingInfo, getringinfo!, almIndex, alm2map, nside2npix, pix2ang, pix2vecRing
import Healpix: readMapFromFITS
import WignerFamilies: wigner3j_f!, WignerF, WignerSymbolVector, get_wigner_array
import FillArrays: Zeros, Ones
import OffsetArrays: OffsetArray, OffsetVector
Expand All @@ -22,6 +23,7 @@ using Random
using CSV, DataFrames
using Lazy: @forward
using ReferenceImplementations
using LazyArtifacts
# import LoopVectorization: @avx


Expand All @@ -32,6 +34,8 @@ include("workspace.jl")
include("modecoupling.jl")
include("covariance.jl")
include("beam.jl")
include("exampledata.jl")


export mcm, decouple_covmat, mask!, map2cl, alm2cl
export @spectra
Expand Down
32 changes: 32 additions & 0 deletions src/exampledata.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# example data (udgrade to nside 256 of the Planck 2018 maps)

function util_planck256_dir()
rootpath = artifact"plancklowres"
return rootpath
end


function util_planck256_map(freq, split, col, type::Type=Float64)
rootpath = artifact"plancklowres"
fname = "nside256_HFI_SkyMap_$(freq)_2048_R3.01_halfmission-$(split).fits"
return readMapFromFITS(joinpath(rootpath, "plancklowres", "maps", fname), col, type)
end

function util_planck256_polmap(freq, split, type::Type=Float64)
return PolarizedMap(
util_planck256_map(freq, split, 1, type),
util_planck256_map(freq, split, 2, type),
util_planck256_map(freq, split, 3, type))
end

function util_planck256_maskT(freq, split, type::Type=Float64)
rootpath = artifact"plancklowres"
fname = "nside256_COM_Mask_Likelihood-temperature-$(freq)-hm$(split)_2048_R3.00.fits"
return readMapFromFITS(joinpath(rootpath, "plancklowres", "masks", fname), 1, type)
end

function util_planck256_maskP(freq, split, type::Type=Float64)
rootpath = artifact"plancklowres"
fname = "nside256_COM_Mask_Likelihood-polarization-$(freq)-hm$(split)_2048_R3.00.fits"
return readMapFromFITS(joinpath(rootpath, "plancklowres", "masks", fname), 1, type)
end

0 comments on commit 93df1a4

Please sign in to comment.