musecube.py 文件源码

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

项目:PyMUSE 作者: ismaelpessa 项目源码 文件源码
def get_smoothed_white(self, npix=2, save=True, show=False, **kwargs):
        """Gets an smoothed version (Gaussian of sig=npix)
        of the white image. If save is True, it writes a file
        to disk called `smoothed_white.fits`.
        **kwargs are passed down to scipy.ndimage.gaussian_filter()
        """
        hdulist = self.hdulist_white
        im = self.white_data
        if npix > 0:
            smooth_im = ndimage.gaussian_filter(im, sigma=npix, **kwargs)
        else:
            smooth_im = im
        if save:
            hdulist[1].data = smooth_im
            prihdr = hdulist[0].header
            comment = 'Spatially smoothed with a Gaussian kernel of sigma={} spaxels (by MuseCube)'.format(npix)
            # print(comment)
            prihdr['history'] = comment
            hdulist.writeto('smoothed_white.fits', clobber=True)
            if show:
                fig = aplpy.FITSFigure('smoothed_white.fits', figure=plt.figure())
                fig.show_grayscale(vmin=self.vmin,vmax=self.vmax)

        return smooth_im
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号