sot / proseco

Probabilistic star evaluation and catalog optimization
https://sot.github.io/proseco
BSD 3-Clause "New" or "Revised" License
1 stars 0 forks source link

Use faster algorithm to compute p(1_or_fewer) #28

Open taldcroft opened 6 years ago

taldcroft commented 6 years ago

Currently this uses the generalized routine that computes p(N_or_fewer) for N from 0 to 7 using a loop from 0 .. 255 to enumerate all possibilities. All we need is N=1, so I think this can be made much faster.

See: https://github.com/sot/chandra_aca/blob/652bb052/chandra_aca/star_probs.py#L147

Of course some profiling should be done to demonstrate that this function contributes to overall time.

taldcroft commented 6 years ago

During profiling this function didn't jump out as a hot stop, though I wasn't explicitly looking for it. Might be more important now that the de-tablification significantly reduced run time for spoiler and imposters, so the relative time for computing calc_p_safe has gone up.