File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change 11import warnings
2+ from copy import deepcopy
23from typing import Sequence
34
45import astropy .units as u
56import numpy as np
7+ from astropy .nddata import StdDevUncertainty
68from astropy .stats import gaussian_fwhm_to_sigma , gaussian_sigma_to_fwhm
79from astropy .modeling import models
810from astropy .table import QTable
@@ -53,6 +55,10 @@ def find_arc_lines(
5355 if fwhm .unit != spectrum .spectral_axis .unit :
5456 raise ValueError ("fwhm must have the same units as spectrum.spectral_axis." )
5557
58+ if spectrum .uncertainty is None :
59+ spectrum = deepcopy (spectrum )
60+ spectrum .uncertainty = StdDevUncertainty (np .sqrt (np .abs (spectrum .flux .value )))
61+
5662 detected_lines = find_lines_threshold (spectrum , noise_factor = noise_factor )
5763 detected_lines = detected_lines [detected_lines ['line_type' ] == 'emission' ]
5864
You can’t perform that action at this time.
0 commit comments