astropy パッケージのファイル操作に問題があり、助けが必要です。
私は基本的に、ファイル形式に適合する画像を取得し、補正係数の入力を開始する必要がある新しいファイルと、補正係数と元の画像と共に使用して補正画像を生成できる新しい画像を作成したいと考えています。これらはそれぞれ同じ寸法になります。
これから始めます:
from astropy.io import fits
# Compute the size of the images (you can also do this manually rather than calling these keywords from the header):
#URL: /Users/UCL_Astronomy/Documents/UCL/PHASG199/M33_UVOT_sum/UVOTIMSUM/M33_sum_epoch1_um2_norm.img
nxpix_um2_ext1 = fits.open('...')[1]['NAXIS1']
nypix_um2_ext1 = fits.open('...')[1]['NAXIS2']
#nxpix_um2_ext1 = 4071 #hima_sk_um2[1].header['NAXIS1'] # IDL: nxpix_uw1_ext1 = sxpar(hima_sk_uw1_ext1,'NAXIS1')
#nypix_um2_ext1 = 4321 #hima_sk_um2[1].header['NAXIS2'] # IDL: nypix_uw1_ext1 = sxpar(hima_sk_uw1_ext1,'NAXIS2')
# Make a new image file with the same dimensions (and headers, etc) to save the correction factors:
coicorr_um2_ext1 = ??[nxpix_um2_ext1,nypix_um2_ext1]
# Make a new image file with the same dimensions (and headers, etc) to save the corrected image:
ima_sk_coicorr_um2_ext1 = ??[nxpix_um2_ext1,nypix_um2_ext1]
これを行うために欠けている明らかな知識を誰か教えてもらえますか...最後の2行は、何が欠けているかを概説するためのものです。含めました?? おそらく何か他のものが必要であることを知らせるために、おそらくfits.writeto()または同様のもの...