1 Jul 01:20
Plotting large images
I am trying to use imshow to plot some semi-large fits images.
Here is the code:
from math import *
import numpy as np
from matplotlib import pyplot as plt
from matplotlib import cm as cm
import pyfits
cat = "/Volumes/Sweden/PS1SC/Data/PS20090603-3/MD09/skycell.092/"
fname = "o4985g0263o.warp.MD09.skycell.092"
hdu = pyfits.open(cat+fname+".fits")
print hdu.info()
img = hdu[1].data.astype("int")
plt.figure(figsize=[12,12])
plt.imshow(img,cmap=cm.cool)
plt.savefig("test.png")
Which gives the result:
Filename: /Volumes/Sweden/PS1SC/Data/PS20090603-3/MD09/skycell.092/
o4985g0263o.warp.MD09.skycell.092.fits
No. Name Type Cards Dimensions Format
0 PRIMARY PrimaryHDU 6 () int16
1 CompImageHDU 101 (6000, 6000) float32
None
Python(23117,0xa04f2720) malloc: *** mmap(size=1152000000) failed
(error code=12)
(Continue reading)
RSS Feed