Finding Galaxies within 100 kpc of Q1532+0613

This will demonstrate how scikit's image processing library scikit-image is useful to my data for Q1532+0613.¶

The data was taken by the Gemini North during the 2015A observing run (GN-2015A-Q77). The data can be accessed here¶

In [76]:

# Import matplotlib (plotting), skimage (image processing) and interact (user interfaces)# This enables their use in the Notebook.%matplotlib inline
importastropy.io.fitsasfits#from skimage import datafromskimage.featureimportblob_dohfromskimage.colorimportrgb2grayfromipywidgetsimportinteract,fixed# Extract the first 500px square of the Hubble Deep Field.#path = 'blog/posts/Gemini_Data/Imaging'#image = path+#image = data.hubble_deep_field()[0:500, 0:500]image,header=fits.getdata('/home/ec2-user/blog/posts/Gemini_Data/Imaging/obj_stacked_r.fits',0,header=True)image=image/image.max()image_gray=rgb2gray(image)defplot_blobs(max_sigma=30,threshold=0.1,gray=False):""" Plot the image and the blobs that have been found. """blobs=blob_doh(image_gray,max_sigma=max_sigma,threshold=threshold)fig,ax=plt.subplots(figsize=(8,8))ax.set_title('Galaxies in the Hubble Deep Field')ifgray:ax.imshow(image_gray,interpolation='nearest',cmap='gray_r')circle_color='red'else:ax.imshow(image,interpolation='nearest')circle_color='yellow'forblobinblobs:y,x,r=blobc=plt.Circle((x,y),r,color=circle_color,linewidth=2,fill=False)ax.add_patch(c)

In [74]:

# Use interact to explore the galaxy detection algorithm.interact(plot_blobs,max_sigma=(10,40,2),threshold=(0.005,0.02,0.001));