@@ -30,7 +30,6 @@ def correct_spt_transfer_function(lb, ps, spec_name, Bbl):
3030
3131 name = spec_name .replace ("spt_" , "" )
3232 fa , fb = name .split ("x" )
33- print (fa , fb )
3433
3534 tf = {}
3635 for mode in ["tt" , "te" , "et" , "ee" ]:
@@ -57,7 +56,6 @@ def correct_spt_additive_bias(lb, ps, spec_name, Bbl):
5756
5857 name = spec_name .replace ("spt_" , "" )
5958 fa , fb = name .split ("x" )
60- print (fa , fb )
6159
6260 additive_bias = {}
6361 for mode in ["tt" , "te" , "et" , "ee" ]:
@@ -118,16 +116,16 @@ def correct_spt_additive_bias(lb, ps, spec_name, Bbl):
118116
119117for spec in ["TB" , "EB" , "BB" ]:
120118 for spec_name in spec_name_list :
121- plt .plot (l_th [:3500 ], ps_th [spec ][:3500 ], color = "black" )
122- plt .plot (lb , Db_dict_bias_tf_corr [spec_name ][spec ], label = f"{ spec } { spec_name } (uncorrected)" )
123- plt .legend ()
124- plt .savefig (f"{ plot_dir } /{ spec_name } _{ spec } .png" , bbox_inches = "tight" )
125- plt .clf ()
126- plt .close ()
127-
119+ plt .plot (l_th [:3500 ], ps_th [spec ][:3500 ], color = "black" )
120+ plt .plot (lb , Db_dict_bias_tf_corr [spec_name ][spec ], label = f"{ spec } { spec_name } (uncorrected)" )
121+ plt .legend ()
122+ plt .savefig (f"{ plot_dir } /{ spec_name } _{ spec } .png" , bbox_inches = "tight" )
123+ plt .clf ()
124+ plt .close ()
128125
129126for spec in ["TT" , "TE" , "EE" ]:
130127 for spec_name in spec_name_list :
128+ fig , ax = plt .subplots (3 , sharex = True , figsize = (9 , 8 ), gridspec_kw = {'hspace' :0.1 })
131129
132130 spec_to_plot = f"{ spec } { camphuis_conv [spec_name ]} "
133131 ix_of_spec = candl_like .spec_order .index (spec_to_plot )
@@ -143,30 +141,31 @@ def correct_spt_additive_bias(lb, ps, spec_name, Bbl):
143141 lb_redo , Db_redo = lb [id_redo ], Db_dict [spec_name ][spec ][id_redo ]
144142 Db_redo_tf_corr , Db_redo_bias_tf_corr = Db_dict_tf_corr [spec_name ][spec ][id_redo ], Db_dict_bias_tf_corr [spec_name ][spec ][id_redo ]
145143
146- plt .figure (figsize = (12 ,8 ))
147-
148- plt .subplot (311 )
149144 if spec in ["TT" , "EE" ]:
150- plt .semilogy ()
151- plt .errorbar (l_spt , Db , sigmab , lw = 0.5 , marker = "o" , ms = 3 , elinewidth = 1 , label = f"SPT { spec_name } " )
152- plt .xlabel (r"$\ell$" , fontsize = 14 )
153- plt .ylabel (r"$D_\ell$" , fontsize = 14 )
154- plt .plot (lb_redo , Db_redo_bias_tf_corr , label = f"SPT redo { spec_name } , bias tf corrected" )
155-
156- plt .legend ()
157- plt .subplot (312 )
158- plt .errorbar (l_spt , l_spt * 0 )
159- plt .errorbar (l_spt , Db - Db_redo_bias_tf_corr , sigmab , lw = 0.5 , marker = "o" , ms = 3 , elinewidth = 1 , label = f"SPT - SPT redo, bias tf corrected { spec_name } " )
160- plt .legend ()
161- plt .xlabel (r"$\ell$" , fontsize = 14 )
162- plt .ylabel (r"$D_\ell - D^{\rm redo}_\ell$" , fontsize = 14 )
163-
164- plt .subplot (313 )
165- plt .errorbar (l_spt , Db / Db_redo_bias_tf_corr , lw = 0.5 , marker = "o" , ms = 3 , elinewidth = 1 , label = f"SPT/ SPT redo { spec_name } " )
166- plt .xlabel (r"$\ell$" , fontsize = 14 )
167- plt .ylabel (r"$D_\ell / D^{\rm redo}_\ell$" , fontsize = 14 )
168-
169- plt .ylim (0.95 , 1.05 )
145+ ax [0 ].semilogy ()
146+ ax [0 ].errorbar (l_spt , Db , sigmab , lw = 0.5 , marker = "o" , ms = 3 , elinewidth = 1 , label = f"SPT { spec_name } " )
147+ ax [0 ].set_xlabel (r"$\ell$" , fontsize = 14 )
148+ ax [0 ].set_ylabel (r"$D_\ell$" , fontsize = 14 )
149+ ax [0 ].plot (lb_redo , Db_redo_bias_tf_corr , label = f"SPT redo { spec_name } , bias tf corrected" )
150+ ax [0 ].legend ()
151+
152+ try :
153+ l_res , dl_res = np .loadtxt (f"mcms/res_bbl_{ spec } _{ camphuis_conv [spec_name ]} .txt" ).T
154+ ax [1 ].plot (l_res , dl_res , label = "Res Bbls" , color = 'red' )
155+ except :
156+ log .info (f"Couldn't plot { spec_to_plot } Bbl res" )
157+
158+ ax [1 ].errorbar (l_spt , l_spt * 0 )
159+ ax [1 ].errorbar (l_spt , Db - Db_redo_bias_tf_corr , sigmab , lw = 0.5 , marker = "o" , ms = 3 , elinewidth = 1 , label = f"SPT - SPT redo, bias tf corrected { spec_name } " )
160+ ax [1 ].legend ()
161+ ax [1 ].set_xlabel (r"$\ell$" , fontsize = 14 )
162+ ax [1 ].set_ylabel (r"$D_\ell - D^{\rm redo}_\ell$" , fontsize = 14 )
163+
164+ ax [2 ].errorbar (l_spt , Db / Db_redo_bias_tf_corr , lw = 0.5 , marker = "o" , ms = 3 , elinewidth = 1 , label = f"SPT/ SPT redo { spec_name } " )
165+ ax [2 ].set_xlabel (r"$\ell$" , fontsize = 14 )
166+ ax [2 ].set_ylabel (r"$D_\ell / D^{\rm redo}_\ell$" , fontsize = 14 )
167+
168+ ax [2 ].set_ylim (0.95 , 1.05 )
170169 plt .savefig (f"{ plot_dir } /{ spec_name } _{ spec } .png" , bbox_inches = "tight" )
171170 plt .clf ()
172171 plt .close ()
0 commit comments