图片数据的尺寸无效

时间:2019-05-02 21:03:42

标签: python arrays image fits

我想绘制200mb以上的图像(.fit,.png,.jpg,.bmp),然后将我的数据(纬度,经度)放在python桌面离线应用中。现在,我无法打开图像。我有两个问题:

1。如何打开大图像文件?

2。我没有使用这些文件,而是听到了地图拼贴。但是我不知道这是一个好主意。如果可以,如何使用和下载?

import matplotlib.pyplot as plt    
from astropy.io import fits
from modest_image import ModestImage, imshow

ax = plt.gca()

#bmp=614mb,jpg=18mb,png=98mb,tif=148mb, fits=225mb(istanbul)

huge_array = fits.open('C:\\Users\\abim\\Desktop\\istanbul_osm_.fits', memmap=True, ignore_missing_end=True)[0].data
artist = imshow(ax, huge_array, vmin=0, vmax=10)
plt.show()

错误:

WARNING: Unexpected extra padding at the end of the file.  This padding may not be preserved when saving changes. [astropy.io.fits.header]
Traceback (most recent call last):
  File "C:\Users\abim\Desktop\map\96.py", line 21, in <module>
artist = imshow(ax, huge_array, vmin=0, vmax=10)
  File "C:\Users\abim\AppData\Local\Programs\Python\Python37\lib\site-packages\modest_image\modest_image.py", line 224, in imshow
im.set_data(X)
  File "C:\Users\abim\AppData\Local\Programs\Python\Python37\lib\site-packages\modest_image\modest_image.py", line 60, in set_data
raise TypeError("Invalid dimensions for image data")
TypeError: Invalid dimensions for image data

谢谢。

0 个答案:

没有答案