【发布时间】:2022-01-08 12:54:03
【问题描述】:
我想以适合的格式绘制此图像。
但我得到了这个
我尝试使用 imshow 更改坐标轴,但效果并没有更好。这是我正在使用的代码。
import matplotlib.pyplot as plt
from astropy.visualization import astropy_mpl_style
plt.style.use(astropy_mpl_style)
from astropy.utils.data import get_pkg_data_filename
from astropy.io import fits
image_file = get_pkg_data_filename('Or.fits')
fits.info(image_file)
image_data = fits.getdata(image_file, ext=0)
print(image_data.shape)
plt.figure()
plt.imshow(image_data, cmap='gray')
plt.colorbar()
【问题讨论】:
-
你能分享数据吗? (如果是公开的,请发送链接)或者 image_data 的样子?
-
您的图像可能使用 10^24 作为不良数据标记。将 imshow 的 vmin 和 vmax 设置为您的数据范围内的某个值。或者如下所示,使用对数规范。
-
你试过 AplPy 吗?
标签: python matplotlib astropy fits