How to extract the overlap of two samples from Cobaya and draw the contour plot?
Posted: October 07 2023
Good afternoon,
Thank you for welcoming me into the CosmoCoffee forum! I have a question about Cobaya.
I have to check the distribution that results from the overlap of two or more samples drawn from Cobaya package (for simplicity, let's consider only two for the moment). For the first distribution, the code is the following:
while for the second the code is similar
When I run the codes and plot the distributions I obtain the overlap of the whole contours, e.g. in the following case with multiple distributions:
What I would like to obtain is only the sub-distribution given by the overlap of all the contours so that I can plot it alone. I draw it in black in the following image.
Can you please clarify me how to do it? Thank you in advance!
Thank you for welcoming me into the CosmoCoffee forum! I have a question about Cobaya.
I have to check the distribution that results from the overlap of two or more samples drawn from Cobaya package (for simplicity, let's consider only two for the moment). For the first distribution, the code is the following:
Code: Select all
gdsamples1of3 = MCSamplesFromCobaya(updated_info, products.products()["sample"],ignore_rows=0.3)
gdplot = gdplt.getSubplotPlotter(width_inch=5)
p1 = gdsamples1of3.getParams()
O_m1=p1.O_m
H01=p1.H0
gdsamples1of3.addDerived(O_m1, name='O_m1', label=r"\Omega_{0m}")
gdsamples1of3.addDerived(H01, name='H01', label=r"H_0(Km \: s^{-1} \: Mpc^{-1})")
gdplot.triangle_plot(gdsamples1of3, ["O_m1","H01"], filled=True)
Code: Select all
gdsamples2of3 = MCSamplesFromCobaya(updated_info, products.products()["sample"],ignore_rows=0.3)
gdplot = gdplt.getSubplotPlotter(width_inch=5)
p1 = gdsamples2of3.getParams()
O_m1=p1.O_m
H01=p1.H0
gdsamples2of3.addDerived(O_m1, name='O_m1', label=r"\Omega_{0m}")
gdsamples2of3.addDerived(H01, name='H01', label=r"H_0(Km \: s^{-1} \: Mpc^{-1})")
gdplot.triangle_plot(gdsamples2of3, ["O_m1","H01"], filled=True)
Code: Select all
plot=g.plot_2d([gdsamples1of3,gdsamples2of3,gdsamples3of3,gdsamplesfull],'O_m1','H01',filled=False,colors=['cyan','orange','lime','red'],lims=[0, 1, 64, 76])
What I would like to obtain is only the sub-distribution given by the overlap of all the contours so that I can plot it alone. I draw it in black in the following image.
Can you please clarify me how to do it? Thank you in advance!