def calculate_wavelength_new(x, solar_spec, fibers, fibn, group,
smooth_length=21, init_lims=None, order=3,
init_sol=None, debug=False, interactive=False,
nbins=21, wavebuff=100, plotbuff=85,
fixscale=True, use_leastsq=False, res=1.9):
L = len(x)
if init_lims is None:
init_lims = [np.min(solar_spec[:,0]), np.max(solar_spec[:,0])]
if init_sol is not None:
init_wave_sol = np.polyval(init_sol, 1. * x / L)
y_sun = solar_spec[:,1]
lowfib = np.max([0,fibn-group])
highfib = np.min([len(fibers)-1,fibn+group])
y = np.array([biweight_filter(fibers[i].spectrum, smooth_length)
/ fibers[i].spectrum
for i in xrange(lowfib,highfib)])
y = biweight_location(y,axis=(0,))
bins = np.linspace(init_lims[0], init_lims[1], nbins)
bins = bins[1:-1]
scale = 1.*(init_lims[1] - init_lims[0])/L
wv0 = init_lims[0]
wave0_save = []
scale_save = []
x_save = []
wave_save = []
评论列表
文章目录