我编写了用于校准图像(暗框和平场)的脚本......这是代码的一部分
for n in range(len(img)):
with pyfits.open(img[n], mode='update', memmap=True) as im:
imgg = im[0].data
header = im[0].header
imgg.astype(float)
imgg = (imgg - dd) / df
imgg[np.isnan(imgg)] = 1
imgg.astype(int)
plt.imshow(imgg, cmap=plt.cm.Greys_r, vmin=0.5, vmax=1.5)
plt.show()
Run Code Online (Sandbox Code Playgroud)
深色框架和平场图像的代码进行校正...这部分当我使用的绘图vmin和vmax,我得到正确的图片,但我不知道该怎么vmin和vmax工作。我需要在图像数据 ( imgg)上应用它,因为当我保存数据时,我得到的图像没有vmin和vmax...
有什么建议?
第二个问题......我如何保存适合文件中的数据更改?当我im.close()只在一个文件上使用这项工作但不循环工作时。
谢谢
编辑
好的,这里是完整的脚本
import numpy as np
import pyfits
from matplotlib import pyplot as plt
import glob
dark=glob.glob('.../ha/dark/*.fits')
flat=glob.glob('.../ha/flat/*.fits')
img=glob.glob('.../ha/*.fits')
sumd0 = pyfits.open(dark[0])
sumdd=sumd0[0].data
sumdd.astype(float)
for …Run Code Online (Sandbox Code Playgroud)