Skip to content

Commit

Permalink
docstring formatting and whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephen Bailey authored and Stephen Bailey committed Oct 5, 2024
1 parent 1ae5f61 commit f3bc12b
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions py/desispec/coaddition.py
Original file line number Diff line number Diff line change
Expand Up @@ -454,11 +454,11 @@ def _chi2_threshold(nspec, nsig):
corresponding to the tail probability of nsig sigma
Args:
nspec(int): number of pixels in the sample
nsig(float): how many sigma of tail probability to cut-off
nspec(int): number of pixels in the sample
nsig(float): how many sigma of tail probability to cut-off
Returns:
threshold(float): the chi^2 (not reduced one) value
threshold(float): the chi^2 (not reduced one) value
"""
threshold = scipy.stats.chi2(nspec - 1).isf(scipy.stats.norm.cdf(-nsig))
return threshold
Expand All @@ -479,14 +479,14 @@ def _iterative_masker(vec,
chi2
Args:
vec(ndarray): input vector
ivar(ndarray): inverse variances
cosmics_nsig(float): threshold in units of sigma
min_for_cosmics(int): what's the threshold in number of spectra when we stop trying to find more cosmics
threshold(float): optional threshold, if specified we ignore cosmic_nsig and chi2 statistics and just use static chi2 threshold
vec(ndarray): input vector
ivar(ndarray): inverse variances
cosmics_nsig(float): threshold in units of sigma
min_for_cosmics(int): what's the threshold in number of spectra when we stop trying to find more cosmics
threshold(float): optional threshold, if specified we ignore cosmic_nsig and chi2 statistics and just use static chi2 threshold
Returns:
badmask(ndarray): boolean mask of bad/cosmic pixels
badmask(ndarray): boolean mask of bad/cosmic pixels
"""
good = np.ones(len(vec), dtype=bool)
while True:
Expand All @@ -505,6 +505,7 @@ def _iterative_masker(vec,
if good.sum() < min_for_cosmics:
# there no point in proceeding with two pixels
break

return ~good


Expand Down

0 comments on commit f3bc12b

Please sign in to comment.