Skip to content

Commit 84e15cb

Browse files
authored
Selection effects (#19)
* Test data generator with magnitude selection * Fix normalization * Update plot * Remove unneeded import * Adjust plot range * Fix testdata generation * Add hubble diagramm * Add Hubble-free selection effect model * Add test data normalization option * Add nominal m_cut parameter * Initial refactor structure * Refactor classic h0 free scm * Refactor nh h0 free scm * Refactor classic nh h0 free scm * Refactor classic nh h0 scm * Refactor classic nh h0 scm * Refactor simple h0 scm * Refactor simple h0 scm * Refactor h0 scm * Refactor classic h0 scm * Add selection effect models to hubble scm * Fix priors * Update bootstrap for new model system * Minor fixes for hubble scm * Some fixes for hubbe scm test data * Fix selection effect model for hubble scm * Fix systematic uncertainties * Add z_pv file support * Add selection values to data collection * Minor fix * Remove selection effects model from calibs * Update pv uncertainty * Add option to not store chains * Add interactive plot mode * Minor fixes * Fix units * Remove TkAgg import
1 parent d0638fa commit 84e15cb

22 files changed

+1586
-1261
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,7 @@ sccala-dev
33
build
44
_build
55
src/sccala_sniip.egg-info
6+
7+
src/sccala/scmlib/models/*
8+
!src/sccala/scmlib/models/*.*
9+

src/sccala/asynphot/aks_correction.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ def get_sn_phot(photometry_file):
4141
)
4242
data.sort_values(by=["mjd"])
4343
tels = data["telescope"].unique().tolist()
44-
assert (
45-
len(tels) == 1
46-
), "More than one telescope found. Please correct each telescope separately."
44+
assert len(tels) == 1, (
45+
"More than one telescope found. Please correct each telescope separately."
46+
)
4747

4848
phot_data = data.pivot_table(
4949
index=["mjd"], columns=["band"], values=["mag", "emag"]
@@ -267,10 +267,6 @@ def aks_correction(
267267
aks_corr_phot, aks_corr_phot_err
268268
"""
269269

270-
try:
271-
matplotlib.use("TkAgg")
272-
except ImportError:
273-
pass
274270
# SN data
275271
a_v, z_hel, mjd_explo = get_sn_info(snname, modelpath=modelpath)
276272

src/sccala/collect_scm_data.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ def main(args):
2525
rho = args.rho
2626
rho_calib = args.rho_calib
2727
error_mode = args.error_mode
28+
m_cut_nom = args.m_cut_nom
29+
sig_cut_nom = args.sig_cut_nom
30+
pv_red_file = args.pv_red_file
2831

2932
df = sl.load_data(
3033
sne_list,
@@ -43,6 +46,9 @@ def main(args):
4346
rho=rho,
4447
rho_calib=rho_calib,
4548
error_mode=error_mode,
49+
m_cut_nom=m_cut_nom,
50+
sig_cut_nom=sig_cut_nom,
51+
pv_red_file=pv_red_file,
4652
)
4753

4854
return df
@@ -140,6 +146,21 @@ def cli():
140146
default="mean",
141147
choices=["mean", "max", "min"],
142148
)
149+
parser.add_argument(
150+
"--m_cut_nom",
151+
help="Nominal value of the magnitude cut. Used for the full sample.",
152+
default=18.5,
153+
)
154+
parser.add_argument(
155+
"--sig_cut_nom",
156+
help="Nominal value of the magnitude cut uncertainty. Used for the full sample.",
157+
default=0.5,
158+
)
159+
parser.add_argument(
160+
"-p",
161+
"--pv_red_file",
162+
help="Path to the file containing redshifts corrected for peculiar velocities.",
163+
)
143164

144165
args = parser.parse_args()
145166

0 commit comments

Comments
 (0)