widget_Calibrate.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:CRIkit2 作者: CoherentRamanNIST 项目源码 文件源码
def fcn(self, data_in):
        """
        Returns a shifted version of the input spectrum to mimic the effect
        of calibration. (Real calibration doesn't shift the spectrum, but 
        rather the independent variable)

        """
        orig_wn = _calib_pix_wn(self.parameters['orig_calib_dict'])[0]
        new_wn = _calib_pix_wn(self.parameters['new_calib_dict'])[0]

        if data_in.ndim == 1:
            spl = _UnivariateSpline(new_wn, data_in, s=0, ext=0)
            output = spl(orig_wn)
        elif data_in.ndim == 2:
            output = _np.zeros(data_in.shape)
            for num, spect in enumerate(data_in):
                spl = _UnivariateSpline(new_wn, spect, s=0, ext=0)
                output[num,:] = spl(orig_wn)
        return output
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号