lpsinger / observing-scenarios-simulations

Gravitational wave observing scenarios simulations
4 stars 7 forks source link

O3 - NSBH Anual detection rate faile "plots-and-tables.ipynb " #18

Closed weizmannk closed 1 year ago

weizmannk commented 1 year ago

ValueError Traceback (most recent call last) File ~/Projets/LVK-collaboration/GitLabStock/observing-scenarios-simulations/plot_farah_userguide.py:603, in 600 data = table[fieldname] 601 lo, mid, hi = bootstrap.ci(data, statfunc, quantiles) --> 603 mid, lo, hi = format_witherrorbars(mid, lo, hi) 604 mathtext = '{}^{{+{}}}{{-{}}}'.format(mid, hi, lo) 605 print('${}$'.format(mathtext), file=f) ValueError: not enough values to unpack (expected 3, got 1)

This happens in ## Tabulated statistics during the 'Annual number of detections' , with pop = NSBH, fieldname = 'rate'

1) elif fieldname == 'rate': lo, mid, hi = poisson_lognormal_rate_quantiles(quantiles, mu, sigma)

print( lo, mid, hi ) = (0, 0, 0)

2) I believe that happens because , mu is negatif , ( mu =-2.04, sigma = 0.53).? mu = fiducial_log_rate + np.log(len(table) / rate) with rate = 16459.93759702272 , log(len(table)/rate) = -5.34 and fiducial_log_rat = 3.3

3) This function " def format_with_errorbars(mid, lo, hi) " return only str(mid), when smallest ==0 , so this return only one one value , that which generates ValueError:

weizmannk commented 1 year ago

@lpsinger could you please take a look ? Thank you

lpsinger commented 1 year ago

Are you working from the branch for #13?

weizmannk commented 1 year ago

yes, it's that. The rate is determine by using all the distribution ( farah ) https://git.ligo.org/lscsoft/ligo.skymap/-/blob/main/ligo/skymap/tool/bayestar_inject.py/#L495

After the split could we use the same rate to determine the mu = fiducial_log_rate + np.log(len(table) / rate), of each sub-population??

lpsinger commented 1 year ago

Should be fixed on that branch now.