Skip to content

Commit

Permalink
Merge d2c9419 into 669daee
Browse files Browse the repository at this point in the history
  • Loading branch information
crawfordsm committed Jul 14, 2014
2 parents 669daee + d2c9419 commit 2eb1623
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ccdproc/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1096,7 +1096,7 @@ def cosmicray_clean(ccd, thresh, cr_func, crargs={},
if newccd.mask is None:
newccd.mask = crarr
else:
newccd.mask = newccd.mask + crarr.mask
newccd.mask = newccd.mask + crarr

# grow the pixels
if gbox > 0:
Expand Down
15 changes: 15 additions & 0 deletions ccdproc/tests/test_cosmicray.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,21 @@ def test_cosmicray_clean_gbox(ccd_data):
assert abs(data.std() - scale) < 0.1
assert cc.mask.sum() > NCRAYS

@pytest.mark.data_scale(DATA_SCALE)
def test_cosmicray_clean_mask(ccd_data):
scale = DATA_SCALE # yuck. Maybe use pytest.parametrize?
threshold = 5
add_cosmicrays(ccd_data, scale, threshold, ncrays=NCRAYS)
cc = ccd_data # currently here because no copy command for NDData
cc.mask = (ccd_data.data==0)
cc = cosmicray_clean(cc, 5.0, cosmicray_median, crargs=(11,),
background=background_variance_box, bargs=(25,),
rbox=0, gbox=5)
data = np.ma.masked_array(cc.data, cc.mask)
assert abs(data.std() - scale) < 0.1
assert cc.mask.sum() > NCRAYS



@pytest.mark.data_scale(DATA_SCALE)
def test_cosmicray_clean(ccd_data):
Expand Down

0 comments on commit 2eb1623

Please sign in to comment.