def process_file(path, wl_min, wl_max, n_samples, check_he2=False):
hdulist = fits.open(path)
wls = 10**hdulist[1].data['loglam']
fxs = hdulist[1].data['flux']
z = hdulist[2].data['z']
wls = wls / (1 + z)
if wl_min < wls[0] or wl_max > wls[-1]:
return None
remove_slope(wls, fxs)
wls, fxs = gaussian_smooth(wls, fxs)
wls, fxs = crop_data(wls, fxs, wl_min, wl_max)
wls, fxs = standardize_domain(wls, fxs, wl_min, wl_max, n_samples)
if check_he2:
if is_he2(wls, fxs):
print('including ' + path)
return fxs
print('excluding ' + path)
return None
return fxs
评论列表
文章目录