sot / chandra_aca

Chandra Aspect Camera Tools
https://sot.github.io/chandra_aca
BSD 2-Clause "Simplified" License
0 stars 0 forks source link

Binomial uncertainty #171

Closed javierggt closed 3 months ago

javierggt commented 3 months ago

Description

Add binomial uncertainty interval to star_probs.py

Interface impacts

Testing

Unit tests

Independent check of unit tests by [REVIEWER NAME]

Functional tests

This notebook: coverage.ipynb

javierggt commented 3 months ago

@taldcroft I think I addressed all your comments.

taldcroft commented 3 months ago

@javierggt - thanks, looking much better. Just one more nitpick, returning a scalar array is technically OK but just not nice.

In [2]: star_probs.binomial_confidence_interval(0, 1, 0.6)
Out[2]: (array(0.), array(0.), array(0.47203609))

If you look at acq_success_prob there is a decent idiom for dealing with this. The chandra_aca.transform.broadcast_arrays() function does the atleast_1d for the inputs and returns an is_scalar bool. Then at the end if is_scalar=True then return value[0].