我正在尝试编写一个脚本,该脚本不仅可以读取 FITS 文件,而且可以打印并将数据保存到表中。到目前为止,我的代码读取文件似乎没有问题;打印它们似乎是问题所在。到目前为止,这是我的代码(当我运行此代码时,我收到错误消息“找不到此格式的有效行”:
;Planck File read (used to read in and print individual fits files)
pro planck_file_read
readcol,'COM_PCCS_857_R1.20.fits',name,glon,glat,ra,dec,detflux,detflux_err,aperflux,aperflux_err,psfflux,psfflux_err,gauflux,gauflux_err,gau_semi1,gau_semi1_err,gau_semi2,gau_semi2_err,gau_theta,gau_theta_err,gau_fwhm_eff,extended,cirrus_n,ext_val,ercsc
openw,lun,'fits_857.tbl',/get_lun,width=400
printf,lun,'; ; name GLON GLAT RA DEC DETFLUX DETFLUXERR APERFLUX APERFLUXERR PSFFLUX PSFFLUXERR GAUFLUX GAUFLUXERR GAUSEMI1 GAUSEMI1ERR GAUSEMI2 GAUSEMI2ERR GAUTHETA GAUTHETAERR GAUFWHMEFF EXTENDED CIRRUSN EXTVAL ERCSC
printf,lun,'; ; DEG DEG DEG DEG MJY MJY MJY MJY MJY MJY MJY MJY ARCMIN ARCMIN ARCMIN ARCMIN DEG DEG ARCMIN NONE NONE NONE NONE
for i=0,n_elements(fits_name)-1 do printf,lun,name[i],glon[i],glat[i],ra[i],dec[i],detflux[i],detflux_err[i],aperflux[i],aperflux_err[i],psfflux[i],psfflux_err[i],gauflux[i],gauflux_err[i],gau_semi1[i],gau_semi1_err[i],gau_semi2[i],gau_semi2_err[i],gau_theta[i],gau_theta_err[i],gau_fwhm_eff[i],extended[i],cirrus_n[i],ext_val[i],ercsc[i]
free_lun,lun
end