find maximum size of the lnp lists to initialize the arrays, rather than using the size for the first star
when assigning a star's lnp to the array, explicitly reference the size in the indexing
initialize the lnp array to -np.inf: for the shorter sparse likelihoods, these will remain -np.inf when doing lnp_vals -= np.max(lnp_vals), and when integrating the probability, np.exp(-np.inf) is 0, so they won't contribute to the result.
Addresses #9:
lnp
lists to initialize the arrays, rather than using the size for the first starlnp
to the array, explicitly reference the size in the indexinglnp
array to-np.inf
: for the shorter sparse likelihoods, these will remain-np.inf
when doinglnp_vals -= np.max(lnp_vals)
, and when integrating the probability,np.exp(-np.inf)
is 0, so they won't contribute to the result.