Loading Makefile +10 −1 Original line number Diff line number Diff line Loading @@ -156,6 +156,9 @@ fig/flux_sigma_eta_ratio.pdf: python/plot_flux_sigma_eta_ratio.py fig/flux_sigma_eta_ratio_20250707.pdf: src/python/plot_flux_sigma_eta_ratio.py python3 $< $@ 0 #> table/table_flux_sigma_eta_ratio.tex fig/flux_sigma_eta_ratio_20250725.pdf: src/python/plot_flux_sigma_eta_ratio.py python3 $< $@ 0 | tee table/table_flux_sigma_eta_ratio_20250725.tex fig/flux_sigma_eta_ratio_u.pdf: python/plot_flux_sigma_eta_ratio.py python3 $< $@ 0 u > table/flux_sigma_eta_u.table fig/flux_sigma_eta_ratio_g.pdf: python/plot_flux_sigma_eta_ratio.py Loading Loading @@ -200,7 +203,7 @@ fig/plambda_qu_sf_ctn_ctk.pdf: python/plot_plambda_qu_sf_ctn_ctk.py python3 $< $@ fig/mbh_mstar.pdf: python/plot_mbh_mstar.py fig/mbh_mstar.pdf: src/python/plot_mbh_mstar.py python3 $< $@ fig/xray_luminosity_function.pdf: python/plot_xray_luminosity_function.py Loading Loading @@ -229,3 +232,9 @@ var/baseline_statistics.log: python/calculate_baseline_statistics.py numbers_truth_catalog: python3 python/get_numbers_truth_catalog.py diff: latexdiff --config="PICTUREENV=(?:tabular)[\\w\\d*@]*" \ paper/version_sent_to_coauthors/manuscript_viitanen.tex \ paper/version_after_coauthors/manuscript_viitanen.tex \ > paper/version_after_coauthors/diff.tex src/python/ivezic.py +2 −2 Original line number Diff line number Diff line Loading @@ -24,8 +24,8 @@ def compute_sigma2(magnitude, band, sigma_sys = 0.005, typical_m5 = True, airmas return sigma2 def load_Ivezic_19_tab2(): with open("data/Ivezic_19_tab_2.pickle", "rb") as f: def load_Ivezic_19_tab2(dirname="./"): with open(f"{dirname}data/Ivezic_19_tab_2.pickle", "rb") as f: dizionario = pickle.load(f) return dizionario Loading src/python/my_lsst.py +20 −0 Original line number Diff line number Diff line Loading @@ -100,6 +100,7 @@ visit = {k: v for k, v in zip("ugrizy", [56, 80, 184, 184, 160, 160])} # Reference: baseline v3.4 http://astro-lsst-01.astro.washington.edu:8080/allMetricResults?runId=4#QSO_Number # (2024-04-11) # New website: https://s3df.slac.stanford.edu/data/rubin/sim-data/ # TODO: update to baseline v4.0 qso_number_counts_cosmos = { "u": 8894, "g": 11763, Loading @@ -109,6 +110,16 @@ qso_number_counts_cosmos = { "y": 15500, } qso_number_counts_cosmos_baseline_v4p0 = { "u": 9169, "g": 11825, "r": 13479, "i": 14657, "z": 14521, "y": 15577, } limiting_magnitude_cosmos = { "u": 26.92, "g": 28.55, Loading @@ -118,6 +129,15 @@ limiting_magnitude_cosmos = { "y": 26.24, } limiting_magnitude_cosmos_baseline_v4p0 = { "u": 27.16, "g": 28.56, "r": 28.58, "i": 28.20, "z": 27.69, "y": 26.25, } def get_conf(zeropoint, lam, seeing, sky, psf): return f"""\ IMAGE_TYPE SKY Loading src/python/plot_flux_sigma_eta_ratio.py +11 −4 Original line number Diff line number Diff line import os import sys import time from astropy.table import Table import matplotlib.pyplot as plt Loading Loading @@ -37,7 +38,9 @@ except FileNotFoundError as e: from astropy.table import Table import pandas as pd import sqlite3 with sqlite3.connect("data/catalog/dr1_new_new/db/20250703/master.db") as con: #with sqlite3.connect("data/catalog/dr1_new_new/db/20250703/master.db") as con: with sqlite3.connect("data/catalog/dr1_new_new/db/20250725/master.db") as con: #with sqlite3.connect("data//media/aetviita/Uranus/data/agile/dr1/db/20250725/master.db") as con: #truth_table = Table.from_pandas(pd.read_sql_query("SELECT ID FROM Truth", con)) #object_table = Table.from_pandas(pd.read_sql_query("SELECT objectId FROM Object WHERE 1=detect_isPrimary", con)) #match_table = Table.from_pandas(pd.read_sql_query("SELECT objectId, match_id FROM MatchesTruth WHERE 1=match_candidate", con)) Loading @@ -56,12 +59,13 @@ except FileNotFoundError as e: (f"{band}_calibFlux_flag_object", f"{band}_calibFlux_flag"), (f"{band}_cModel_flag_object", f"{band}_cModel_flag"), (f"{band}_extendedness_object", f"{band}_extendedness"), ("detect_isPrimary_object", "detect_isPrimary"), ("match_truth_type_match", "match_truth_type"), ("detect_isPrimary_object", f"detect_isPrimary"), ("match_truth_type_match", f"match_truth_type"), ]: select.append(f"\"{column}\" AS \"{name}\"") select = ', '.join(select[:14]) t0 = time.time() df = pd.read_sql_query( f""" SELECT Loading @@ -71,11 +75,14 @@ except FileNotFoundError as e: JOIN Truth AS t ON (t.ID = m.match_id) WHERE 1=o.detect_isPrimary AND 1=m.match_candidate 1=m.match_candidate AND m.match_truth_type>=0 """, con ) table = Table.from_pandas(df) t1 = time.time() print(f"Table loaded in {t1 - t0} seconds") if False: Loading src/python/plot_mbh_mstar.py +3 −1 Original line number Diff line number Diff line Loading @@ -28,8 +28,10 @@ norm = mpl.colors.Normalize(vmin=-0.5, vmax=5.5) for i, z in enumerate([0.0, 1.0, 2.0, 3.0, 4.0, 5.0]): #log_mbh = mbh.get_log_mbh_continuity(log_mstar, z) #log_mbh = mbh.get_log_mbh_continuity_new(log_mstar, z) ls = "solid" if z < 4 else "dotted" log_mbh = mbh.get_log_mbh_continuity_new2(log_mstar, np.full_like(log_mstar, z)) ax.plot(log_mstar, log_mbh, color=cmap(norm(z)), lw=lw1, label="$z=%.1f$" % z) ax.plot(log_mstar, log_mbh, color=cmap(norm(z)), lw=lw1, label="$z=%.1f$" % z, ls=ls) # Plots the local Con Eq against literature Loading Loading
Makefile +10 −1 Original line number Diff line number Diff line Loading @@ -156,6 +156,9 @@ fig/flux_sigma_eta_ratio.pdf: python/plot_flux_sigma_eta_ratio.py fig/flux_sigma_eta_ratio_20250707.pdf: src/python/plot_flux_sigma_eta_ratio.py python3 $< $@ 0 #> table/table_flux_sigma_eta_ratio.tex fig/flux_sigma_eta_ratio_20250725.pdf: src/python/plot_flux_sigma_eta_ratio.py python3 $< $@ 0 | tee table/table_flux_sigma_eta_ratio_20250725.tex fig/flux_sigma_eta_ratio_u.pdf: python/plot_flux_sigma_eta_ratio.py python3 $< $@ 0 u > table/flux_sigma_eta_u.table fig/flux_sigma_eta_ratio_g.pdf: python/plot_flux_sigma_eta_ratio.py Loading Loading @@ -200,7 +203,7 @@ fig/plambda_qu_sf_ctn_ctk.pdf: python/plot_plambda_qu_sf_ctn_ctk.py python3 $< $@ fig/mbh_mstar.pdf: python/plot_mbh_mstar.py fig/mbh_mstar.pdf: src/python/plot_mbh_mstar.py python3 $< $@ fig/xray_luminosity_function.pdf: python/plot_xray_luminosity_function.py Loading Loading @@ -229,3 +232,9 @@ var/baseline_statistics.log: python/calculate_baseline_statistics.py numbers_truth_catalog: python3 python/get_numbers_truth_catalog.py diff: latexdiff --config="PICTUREENV=(?:tabular)[\\w\\d*@]*" \ paper/version_sent_to_coauthors/manuscript_viitanen.tex \ paper/version_after_coauthors/manuscript_viitanen.tex \ > paper/version_after_coauthors/diff.tex
src/python/ivezic.py +2 −2 Original line number Diff line number Diff line Loading @@ -24,8 +24,8 @@ def compute_sigma2(magnitude, band, sigma_sys = 0.005, typical_m5 = True, airmas return sigma2 def load_Ivezic_19_tab2(): with open("data/Ivezic_19_tab_2.pickle", "rb") as f: def load_Ivezic_19_tab2(dirname="./"): with open(f"{dirname}data/Ivezic_19_tab_2.pickle", "rb") as f: dizionario = pickle.load(f) return dizionario Loading
src/python/my_lsst.py +20 −0 Original line number Diff line number Diff line Loading @@ -100,6 +100,7 @@ visit = {k: v for k, v in zip("ugrizy", [56, 80, 184, 184, 160, 160])} # Reference: baseline v3.4 http://astro-lsst-01.astro.washington.edu:8080/allMetricResults?runId=4#QSO_Number # (2024-04-11) # New website: https://s3df.slac.stanford.edu/data/rubin/sim-data/ # TODO: update to baseline v4.0 qso_number_counts_cosmos = { "u": 8894, "g": 11763, Loading @@ -109,6 +110,16 @@ qso_number_counts_cosmos = { "y": 15500, } qso_number_counts_cosmos_baseline_v4p0 = { "u": 9169, "g": 11825, "r": 13479, "i": 14657, "z": 14521, "y": 15577, } limiting_magnitude_cosmos = { "u": 26.92, "g": 28.55, Loading @@ -118,6 +129,15 @@ limiting_magnitude_cosmos = { "y": 26.24, } limiting_magnitude_cosmos_baseline_v4p0 = { "u": 27.16, "g": 28.56, "r": 28.58, "i": 28.20, "z": 27.69, "y": 26.25, } def get_conf(zeropoint, lam, seeing, sky, psf): return f"""\ IMAGE_TYPE SKY Loading
src/python/plot_flux_sigma_eta_ratio.py +11 −4 Original line number Diff line number Diff line import os import sys import time from astropy.table import Table import matplotlib.pyplot as plt Loading Loading @@ -37,7 +38,9 @@ except FileNotFoundError as e: from astropy.table import Table import pandas as pd import sqlite3 with sqlite3.connect("data/catalog/dr1_new_new/db/20250703/master.db") as con: #with sqlite3.connect("data/catalog/dr1_new_new/db/20250703/master.db") as con: with sqlite3.connect("data/catalog/dr1_new_new/db/20250725/master.db") as con: #with sqlite3.connect("data//media/aetviita/Uranus/data/agile/dr1/db/20250725/master.db") as con: #truth_table = Table.from_pandas(pd.read_sql_query("SELECT ID FROM Truth", con)) #object_table = Table.from_pandas(pd.read_sql_query("SELECT objectId FROM Object WHERE 1=detect_isPrimary", con)) #match_table = Table.from_pandas(pd.read_sql_query("SELECT objectId, match_id FROM MatchesTruth WHERE 1=match_candidate", con)) Loading @@ -56,12 +59,13 @@ except FileNotFoundError as e: (f"{band}_calibFlux_flag_object", f"{band}_calibFlux_flag"), (f"{band}_cModel_flag_object", f"{band}_cModel_flag"), (f"{band}_extendedness_object", f"{band}_extendedness"), ("detect_isPrimary_object", "detect_isPrimary"), ("match_truth_type_match", "match_truth_type"), ("detect_isPrimary_object", f"detect_isPrimary"), ("match_truth_type_match", f"match_truth_type"), ]: select.append(f"\"{column}\" AS \"{name}\"") select = ', '.join(select[:14]) t0 = time.time() df = pd.read_sql_query( f""" SELECT Loading @@ -71,11 +75,14 @@ except FileNotFoundError as e: JOIN Truth AS t ON (t.ID = m.match_id) WHERE 1=o.detect_isPrimary AND 1=m.match_candidate 1=m.match_candidate AND m.match_truth_type>=0 """, con ) table = Table.from_pandas(df) t1 = time.time() print(f"Table loaded in {t1 - t0} seconds") if False: Loading
src/python/plot_mbh_mstar.py +3 −1 Original line number Diff line number Diff line Loading @@ -28,8 +28,10 @@ norm = mpl.colors.Normalize(vmin=-0.5, vmax=5.5) for i, z in enumerate([0.0, 1.0, 2.0, 3.0, 4.0, 5.0]): #log_mbh = mbh.get_log_mbh_continuity(log_mstar, z) #log_mbh = mbh.get_log_mbh_continuity_new(log_mstar, z) ls = "solid" if z < 4 else "dotted" log_mbh = mbh.get_log_mbh_continuity_new2(log_mstar, np.full_like(log_mstar, z)) ax.plot(log_mstar, log_mbh, color=cmap(norm(z)), lw=lw1, label="$z=%.1f$" % z) ax.plot(log_mstar, log_mbh, color=cmap(norm(z)), lw=lw1, label="$z=%.1f$" % z, ls=ls) # Plots the local Con Eq against literature Loading