#cond=[cond1 and cond2 and cond3 and cond4 for cond1, cond2, cond3, # cond4 in zip(x>=xmin, x<xmax, y>=ymin, y<ymax)] cond = [ cond1 and cond3 and cond4 for cond1, cond3, cond4 in zip(x == xmin, y >= ymin, y < ymax) ] grid.append(galaxies.compress(cond)) # Put the grid together F = pyl.figure(1, figsize=(4, 6)) grid1 = axes_grid.ImageGrid(F, 111, nrows_ncols=(9, 6), axes_pad=0.05, add_all=True, share_all=True, aspect=True, direction='column') from random import choice base = './../../images_v5/GS_2.5as/gs_all_' for i in range(len(grid)): print len(grid[i]) if len(grid[i]) > 1: galaxy = choice(grid[i]) ID = int(galaxy.ID) while os.path.isfile(base + str(galaxy) + '_I.fits'): print 'choose again', ID galaxy = choice(grid[i])
import pylab as pyl import pyfits as pyf import cPickle as pickle from mpl_toolkits.axes_grid1 import axes_grid from colsort import colsort import img_scale F = pyl.figure(1, figsize=(6, 4)) grid = axes_grid.ImageGrid(F, 131, nrows_ncols=(3, 3), axes_pad=0.05, add_all=True, share_all=True, aspect=True, direction='row') grid2 = axes_grid.ImageGrid(F, 132, nrows_ncols=(4, 3), axes_pad=0.05, add_all=True, share_all=True, aspect=True, direction='row') grid3 = axes_grid.ImageGrid(F, 133, nrows_ncols=(3, 3), axes_pad=0.05, add_all=True,
print len(picked), ID picked.append(ID) else: pass return picked # Put the grid together F = pyl.figure(1, figsize=(6, 4)) F2 = pyl.figure(2, figsize=(6, 4)) grid1 = axes_grid.ImageGrid(F, 111, nrows_ncols=(5, 7), axes_pad=0.05, add_all=True, share_all=True, aspect=True, direction='column', label_mode='all') grid2 = axes_grid.ImageGrid(F2, 234, nrows_ncols=(4, 5), axes_pad=0.05, add_all=True, share_all=True, aspect=True, direction='column', label_mode='all')
ymin = bins_y[j + 1] cond = [ cond1 and cond2 and cond3 and cond4 for cond1, cond2, cond3, cond4 in zip( x >= xmin, x < xmax, y >= ymin, y < ymax) ] grid.append(galaxies.compress(cond)) # Put the grid together F = pyl.figure(1, figsize=(6, 4)) grid1 = axes_grid.ImageGrid(F, 211, nrows_ncols=(6, 15), axes_pad=0.05, add_all=True, share_all=True, aspect=True, direction='column') grid2 = axes_grid.ImageGrid(F, 212, nrows_ncols=(6, 15), axes_pad=0.05, add_all=True, share_all=True, aspect=True, direction='column') from random import choice base = './../../images_v5/GS_2.5as/gs_all_'
import img_scale import pyfits as pyf import pylab as pyl from mpl_toolkits.axes_grid1 import axes_grid from scipy.stats import scoreatpercentile F = pyl.figure(1, figsize=(6, 4)) grid = axes_grid.ImageGrid(F, 111, nrows_ncols=(3, 4), axes_pad=0.05, add_all=True, share_all=True, direction='column', label_mode='all') galaxies = [ 397, 1073, 1589, 3736, 8030, 8740, 10832, 14447, 15769, 16934, 21852, 18801 ] #949, 1961, 3608, 4956, 10426] def mk_image(galaxy): base = './../../images_v5/GS_2.5as_matched/gs_all_' i_img = pyf.getdata(base + str(galaxy) + '_I.fits') j_img = pyf.getdata(base + str(galaxy) + '_J.fits') h_img = pyf.getdata(base + str(galaxy) + '_H.fits') x = pyl.hstack(i_img) i_lim = scoreatpercentile(x, 99)
import pylab as pyl import pyfits as pyf import cPickle as pickle from mpl_toolkits.axes_grid1 import axes_grid from colsort import colsort import img_scale F = pyl.figure(1, figsize=(4, 6)) grid = axes_grid.ImageGrid(F, 121, nrows_ncols=(5, 3), axes_pad=0.05, add_all=True, share_all=True, aspect=True, direction='row') grid2 = axes_grid.ImageGrid(F, 122, nrows_ncols=(5, 3), axes_pad=0.05, add_all=True, share_all=True, aspect=True, direction='row') base = './../../images_v5/GS_2.5as_matched/gs_all_' galaxies = pickle.load(open('galaxies.pickle', 'rb')) galaxies = filter(lambda galaxy: galaxy.ston_I > 30, galaxies)