How to stop fits files from being imported upside down python

浪尽此生 提交于 2019-12-11 15:51:53

问题


When importing a fits image in python it gets imported upside down.

This is the code i'm using:

import numpy as np
from astropy.io get fits
import matplotlib.pyplot as plt

im = fits.getdata('myimage.fits')

plt.imshow(im, cmap='gray')
plt.colorbar()

Again I just want to view the image and it opens upside down. When I open it in an image viewer I have on my computer it looks fine so I know I didn't save it upside down. Is there any way to prevent this from happening?


回答1:


You can specify the keyword argument origin= 'lower' or origin='upper' in your call to imshow.



来源:https://stackoverflow.com/questions/59073379/how-to-stop-fits-files-from-being-imported-upside-down-python

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!