Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
"""
try:
cent = centroid(spectrum, region=None) # we may want to adjust this for continuum subtraction
except Exception as e:
logging.debug(e)
cent = "Error"
try:
snr_val = snr(spectrum)
except Exception as e:
logging.debug(e)
snr_val = "N/A"
try:
fwhm_val = fwhm(spectrum)
except Exception as e:
logging.debug(e)
fwhm_val = "Error"
try:
ew = equivalent_width(spectrum)
except Exception as e:
logging.debug(e)
ew = "Error"
try:
total = line_flux(spectrum)
except Exception as e:
logging.debug(e)
total = "Error"
'fwhm_L': lambda s: fwhm(s) / np.sqrt(2),
'fwhm_G': lambda s: fwhm(s) / np.sqrt(2)