Search code examples
galsim

Inline display when using GalSim on iPython Notebook


It seems that all the demos write the image file to the system so that we can view it with DS9. Is there a way we can view the images we make inline on iPython Notebook, as we code? This would speed up my coding a lot.

Thank you!


Solution

  • GalSim Image objects store the pixel values in a numpy array: im.array. So if you're using an iPython notebook with %matplotlib inline, you can just do plt.imshow(im.array) to display an image of the data on the screen.