In [2]:
from astropy.cosmology import Planck13 as cosmo
import numpy as np
%matplotlib inline
import matplotlib.pyplot as plt
from astropy import units as u

Assume that the galaxy has a physical size of the order of 1kpc. We can find the angle subtended by it in a particular cosmology. If this is too small, we should not be able to resolve it.


In [3]:
l = 1.0* u.kpc
z = np.arange(0.05, 1.4, 0.1)
dA = cosmo.angular_diameter_distance(z)
angle = l/dA + np.zeros(len(z))

In [4]:
plt.plot(z, angle*180./np.pi*3600, 'o')
plt.ylabel('angular diameter (sec)')
plt.xlabel('z')


Out[4]:
<matplotlib.text.Text at 0x106ec5890>

Galaxy Catalogs

I have changed the galaxy catalogs by inserting a '#' at the beginning of the header line


In [5]:
from basicio import io
from astropy.table import Table

In [6]:
import os
desdata = os.getenv('DESData')
print desdata


/Users/rbiswas/data/DES/

In [7]:
fname = os.path.join(desdata, 'SVA1GOLD','C1_SVA1GOLD_v0.cat')
print fname
rec = io.file2recarray(file=fname, headerstring='#')


/Users/rbiswas/data/DES/SVA1GOLD/C1_SVA1GOLD_v0.cat

In [8]:
t = Table(rec)

In [9]:
binindex = np.array(np.floor(np.asarray(t['PHOTOZ'])/0.1), dtype='i8')
uniqueinds = np.unique(binindex)

In [10]:
newcol = Table.Column(binindex, name='binindex', dtype=np.dtype('i8'))
t.add_column(newcol)

In [11]:
x = t.group_by('binindex')

In [12]:
x.groups[14]['PHOTOZ'].max()


Out[12]:
1.49993

In [13]:
import pandas as pd

In [14]:
df = pd.DataFrame(rec)

In [15]:
plt.hist(x.groups[14]['A_IMAGE'], histtype='step')
plt.hist(x.groups[0]['A_IMAGE'], histtype='step')


Out[15]:
(array([ 988.,  292.,   54.,   10.,    4.,    1.,    2.,    0.,    2.,    3.]),
 array([  0.70319998,   9.6414333 ,  18.57966661,  27.51789993,
         36.45613325,  45.39436656,  54.33259988,  63.27083319,
         72.20906651,  81.14729983,  90.08553314]),
 <a list of 1 Patch objects>)

In [16]:
bins = plt.hist(x.groups[0]['A_IMAGE'], histtype='step', color='k', lw =2.0, normed=True, bins=40, label='0.0-0.1')
bins = plt.hist(x.groups[5]['A_IMAGE'], histtype='step', color='b', lw =2.0, normed=True, bins=40, label='0.5-0.6')
bins = plt.hist(x.groups[10]['A_IMAGE'], histtype='step', color='r', lw =2.0, normed=True, bins=40, label='1.0-1.1')
plt.xlabel('A_IMAGE')
plt.ylabel('PDF')
plt.legend(loc='best')


Out[16]:
<matplotlib.legend.Legend at 0x10a441750>

Historgram of galaxy 'A_IMAGE' at three redshift bins. This is normal, showing that galaxies at small redshifts appear larger while galaxies at high redshifts look smaller.


In [17]:
bins = plt.hist(x.groups[0]['A_IMAGE'], histtype='step', color='k', lw=2.0, normed=False, bins=np.arange(0.,5.,0.1))
bins = plt.hist(x.groups[5]['A_IMAGE'], histtype='step', color='b', lw=2.0, normed=False, bins=np.arange(0.,5,0.1))
bins = plt.hist(x.groups[10]['A_IMAGE'], histtype='step', color='r', lw=2.0, normed=False, bins=np.arange(0.,5,0.1))
plt.xlabel('A_IMAGE')
plt.ylabel('numbers')


Out[17]:
<matplotlib.text.Text at 0x108949990>

So, that seems like about 0.7 arc sec is about the size of the PSF, so there is nothing at smaller sizes

Scratch


In [22]:
factor = 1./3600.* np.pi /180.
x0 = factor*x.groups[0]['A_IMAGE']* cosmo.angular_diameter_distance(0.05).value
xp5 = factor*x.groups[0]['A_IMAGE']* cosmo.angular_diameter_distance(0.55).value
x1 = factor*x.groups[0]['A_IMAGE']* cosmo.angular_diameter_distance(1.05).value

In [24]:
bins = plt.hist(x0, histtype='step', color='k', lw =2.0, normed=True, bins=50)
bins = plt.hist(xp5, histtype='step', color='b', lw =1.0, normed=True, bins=50)
bins = plt.hist(x1, histtype='step', color='r', lw =2.0, normed=True, bins=50)
plt.xlabel('A_IMAGE')
plt.ylabel('PDF')
plt.xlim(0.,0.1)


Out[24]:
(0.0, 0.1)

In [88]:
x0


Out[88]:
<Column name='A_IMAGE' unit=None format=None description=None>
array([  974.74926758,  1111.17810059,   754.47186279, ...,   550.88293457,
         156.3401947 ,  1983.84350586], dtype=float32)

In [ ]: