在您的示例中,您可以打开文件,就地修改数据数组,然后使用其.writeto上的方法将其写入新文件,或者如果您打开它,则mode='update'可以就地修改现有文件。例如hdul = fits.open('old.fits') # modify the data in the primary HDU; this is just an in-memory operation and will not change the data on disk...
vi file1 file2... 现在退出所处的 vi 会话,并创建一个用于编辑的新文件。 输入:wq来退出 vi...
I could open the saved Spectrum1D object saved in the "fits-writer" format with astropy's astropy.io.fits machinery though, however the loaded object looks a bit unnatural at first and appears as something as a astropy.io.fits.fitsrec.FITS_rec object like the following: FITS_rec([(3500...
I have used astroquery to download a table from Vizier but when I try to write out the table I get the error: File "/Users/rgm/anaconda2/envs/py36/lib/python3.6/site-packages/astropy/io/fits/card.py", line 990, in _format_image 'too long'.format(self.keyword)) ValueError: The ...
它支持各种常见的天文学数据格式,如FITS、VO、ASCII等,并提供了方便的数据访问和操作方法。 天体物理学计算:Astropy包含了许多常用的天体物理学计算函数和模型,如恒星光度计算、星际介质模拟、星系演化模型等。这些功能可以帮助天文学家进行各种天体物理学研究和分析。 图像处理和可视化:Astropy提供了丰富的图像处理和...
cat.writeFITSTable(outfile, tab)ifnotos.path.exists(outfile):raiseAssertionError() os.remove(outfile) 开发者ID:PaulHancock,项目名称:Aegean,代码行数:11,代码来源:test_catalogs.py 示例9: apply_format ▲点赞 5▼ # 需要导入模块: import astropy [as 别名]# 或者: from astropy importtable[as 别...
self._fileobj.write('\n') self._writeln(f' fitsdiff:{__version__}') self._writeln(f' a:{self.filenamea}\n b:{self.filenameb}')ifself.ignore_hdus: ignore_hdus =' '.join(sorted(self.ignore_hdus)) self._writeln(' HDU(s) not to be compared:\n{}'.format(wrapper.fill(ign...
boss = fits.open(get_pkg_data_filename('t/boss_traceset.fits')) return 浏览完整代码 来源:test_trace.py 项目:weaverba137/pydl 示例8 def test_file(filename): filename = get_pkg_data_filename(filename) regs = read_ds9(filename, errors='warn') coordsys = os.path.basename(filename...
writeto('read_modify_and_exported_checksum.fits', checksum=True, overwrite=True) show_checksums('read_modify_and_exported_checksum.fits') Running this on main gives: --- Original, export without checksum No checksum keywords found --- Original, export with checksum ZHECKSUM= 'M1PqM1OnM1On...
:param fname: The filename to read in (should be a fits file) :param badregions: a list of regions to exclude (contains strong telluric or stellar line residuals) :param interp_regions: a list of regions to interpolate over :param extensions: A boolean flag for whether the fits file ...