Skip to content

Commit

Permalink
Get min and max instead of specific indices
Browse files Browse the repository at this point in the history
  • Loading branch information
rosteen committed Oct 16, 2024
1 parent 06d31b4 commit e362fdd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions specutils/manipulation/resample.py
Original file line number Diff line number Diff line change
Expand Up @@ -461,8 +461,8 @@ def resample1d(self, orig_spectrum, fin_spec_axis):
if self.extrapolation_treatment == 'zero_fill':
fill_val = 0

origedges = orig_spectrum.spectral_axis.bin_edges
off_edges = (fin_spec_axis < origedges[0]) | (origedges[-1] < fin_spec_axis)
orig_edges = orig_spectrum.spectral_axis.bin_edges
off_edges = (fin_spec_axis < np.min(orig_edges)) | (np.max(orig_edges) < fin_spec_axis)
out_flux_val[off_edges] = fill_val
if new_unc is not None:
new_unc.array[off_edges] = fill_val
Expand Down

0 comments on commit e362fdd

Please sign in to comment.