Skip to content

Commit

Permalink
Change average_along_slit to allow all NDStacker combine options, not…
Browse files Browse the repository at this point in the history
… just mean
  • Loading branch information
DBerke committed Jan 17, 2024
1 parent 300662b commit 48652b1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion gempy/library/tracing.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,8 @@ def average_along_slit(ext, center=None, offset_from_center=None,
# of S/N than the VAR plane
# FixMe: "variance=variance" breaks test_gmos_spect_ls_distortion_determine.
# Use "variance=None" to make them pass again.
data, mask, variance = NDStacker.mean(data, mask=mask, variance=None)
data, mask, variance = NDStacker.combine(data, mask=mask, variance=None,
combiner=combiner)

return data, mask, variance, extract_slice

Expand Down Expand Up @@ -467,6 +468,8 @@ def average_along_slit(ext, center=None, offset_from_center=None,
data_out[i], mask_out[i], variance_out[i] = sum1d(nddata, n1, n2)

# Divide by number of pixels summed to get the mean.
# FIXME: This should ideally respect the "combiner" argument, and handle
# all the combine methods NDStacker does. (mean, median, wtmean, lmedian)
data_out /= nsum
variance_out /= nsum ** 2

Expand Down

0 comments on commit 48652b1

Please sign in to comment.