From 2c4f3abfd162ae7a6cad49936c1aa11831eb0648 Mon Sep 17 00:00:00 2001 From: jaimerzp Date: Mon, 18 Nov 2024 15:09:28 +0000 Subject: [PATCH] negative zs bug --- src/tracers.jl | 6 ++++++ test/test_output.npz | Bin 69358 -> 69358 bytes 2 files changed, 6 insertions(+) diff --git a/src/tracers.jl b/src/tracers.jl index 4a1a435..81c8171 100755 --- a/src/tracers.jl +++ b/src/tracers.jl @@ -28,6 +28,9 @@ Returns: - `NumberCountsTracer::NumberCountsTracer` : Number counts tracer structure. """ NumberCountsTracer(cosmo::Cosmology, z, nz; b=1.0) = begin + sel = @. (z > 0.0) + z = z[sel] + nz = nz[sel] nz_norm = integrate(z, nz, SimpsonEven()) chi = cosmo.chi(z) hz = Hmpc(cosmo, z) @@ -58,6 +61,9 @@ end WeakLensingTracer(cosmo::Cosmology, z, nz; IA_params = [0.0, 0.0], m=0.0) = begin + sel = @. (z > 0.0) + z = z[sel] + nz = nz[sel] cosmo_type = cosmo.settings.cosmo_type res = length(z) nz_norm = integrate(z, nz, SimpsonEven()) diff --git a/test/test_output.npz b/test/test_output.npz index 9520d46cdc722e409c5a8238dcfc5609608e2392..754369e2548777cdb40167f700278b64204007d8 100644 GIT binary patch delta 1849 zcmYjQYfzMB6!zWymStg~65_Jl3@O2p{5d}sj1=8fQ$_byY!v&?hn5|&zy6f_k7QJ&il@t z;pWb8%585*Irla21y$&keMAye!H9X+NTxU`@0og^JZ+ z1q(h7PejxjZpD>S6%tbnr%X6cn%N*UBnkskQEUPB8A@QG4!D^9t{;ViOc~1 z>8pO1=z!-o-M!v0?=3naY6t*6!l49n_VA%zJ z!?23}DZ%0l zpIvv*j&HlaN0;{ZfKI{d7JAD6Y5;*kt&xSfrWOciO)S*+fkHm-4)oXcvo#+3ATp2F z4)_Y@e!Or(@c`auK4$PVu!jcGi83=2^#isrFen_tn(Q9hqDK&R-bZOd_%M4wGb1pE z&@jq83?0Wt!{aDTJ7I)NAjJJ=V6Ocl&3M=tOG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