Skip to content

Commit

Permalink
script to help making calibration table
Browse files Browse the repository at this point in the history
  • Loading branch information
Louis Thibaut committed Feb 6, 2025
1 parent caffcf2 commit f119146
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions project/ACT_DR6/python/planck/AxP_cal_table.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
"""
script to help making the calibration table to run it:
python AxP_cal_table.py global_dr6v4xlegacy_updated.dict global_dr6v4xnpipe_updated.dict
you have to have computed both npipe and legacy numbers
"""
from pspy import so_dict
import matplotlib.pyplot as plt
import numpy as np
import sys
import pickle

d_legacy = so_dict.so_dict()
d_legacy.read_from_file(sys.argv[1])

d_npipe = so_dict.so_dict()
d_npipe.read_from_file(sys.argv[2])

arrays = ["pa5_f090", "pa6_f090", "pa5_f150", "pa6_f150", "pa4_f220"]
methods = ["AxA-AxP", "AxA-PxP", "PxP-AxP"]
cal_folder = "calibration_results_planck_bias_corrected_fg_sub"

with open(f"dr6xlegacy/{cal_folder}/calibs_dict.pkl", "rb") as f:
cal_legacy = pickle.load(f)

with open(f"dr6xnpipe/{cal_folder}/calibs_dict.pkl", "rb") as f:
cal_npipe = pickle.load(f)

# These are the numbers applied to the release maps
map_cal = {}
map_cal["pa5_f090"] = 1.011
map_cal["pa6_f090"] = 1.009
map_cal["pa5_f150"] = 0.986
map_cal["pa6_f150"] = 0.970
map_cal["pa4_f220"] = 1.043

for ar in arrays:
str = ""
for method in methods:
cal, sigma = cal_legacy[method, ar]["calibs"]
cal *= d_legacy[f"cal_dr6_{ar}"]
str += f"& {cal:.4f} $\pm$ {sigma:.4f} "
for method in methods:
cal, sigma = cal_npipe[method, ar]["calibs"]
cal *= d_npipe[f"cal_dr6_{ar}"]
str += f"& {cal:.4f} $\pm$ {sigma:.4f} "

waf, f = ar.split("_")
print(f"{f} & {waf.upper()} {str}& {map_cal[ar]} \\")

0 comments on commit f119146

Please sign in to comment.