Skip to content

Commit

Permalink
Merge branch 'main' into jp3858-exp_to_source
Browse files Browse the repository at this point in the history
  • Loading branch information
melanieclarke authored Feb 27, 2025
2 parents 26a9ce5 + c8781a4 commit 2eae615
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
1 change: 1 addition & 0 deletions changes/9227.outlier_detection.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix bad input type to median computation for coron data
10 changes: 4 additions & 6 deletions jwst/outlier_detection/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,12 @@ def create_cube_median(cube_model, maskpt):
log.info("Computing median")

weight_threshold = compute_weight_threshold(cube_model.wht, maskpt)
masked_cube = np.ma.masked_array(
cube_model.data, np.less(cube_model.wht, weight_threshold)
).filled(np.nan)

# not safe to use overwrite_input=True here because we are operating on model.data directly
return nanmedian3D(
np.ma.masked_array(
cube_model.data, np.less(cube_model.wht, weight_threshold), fill_value=np.nan
),
overwrite_input=False,
)
return nanmedian3D(masked_cube, overwrite_input=False)


def median_without_resampling(
Expand Down

0 comments on commit 2eae615

Please sign in to comment.