In [3]:
from correlcalc import *

In [4]:
bins=np.arange(0.002,0.082,0.002)

In [5]:
%%time
correldr72=tpcf('/Users/rohin/Downloads/DR7-Full.ascii',bins,mask='/Users/rohin/Documents/ipy_notebooks/galsurveystudy/masks/window.dr72safe0.ply',randfact=2)


Calculating Correlation function with the following parameters
data file=
/Users/rohin/Downloads/DR7-Full.ascii
random file=
None
Random catalog size factor(if random file is None)=
2
mask/window file=
/Users/rohin/Documents/ipy_notebooks/galsurveystudy/masks/window.dr72safe0.ply
Cosmology=
lcdm
Geometry=
flat
Correl method=
dp
---------------
Entered data ascii file
      ra            dec           z          M_g       ...  ilss  icomb  sector
------------- --------------- --------- -------------- ... ------ ------ ------
56.1604523761 -0.221359772462 0.4501842 -22.0970516205 ...  32763  33480    784
 58.247844859  0.216329004672 0.3671646 -21.8688602448 ... 303471 311902   3790
 54.445380928  0.619974218725 0.4133244 -21.7306137085 ...  43630  44552    779
54.4879828915  0.485825651457 0.3224697 -21.8775806427 ...  43622  44544    779
54.4932987631  0.483249792951 0.3226457 -21.6763000488 ...  43622  44544    779
55.5558858448  0.582441686132 0.2334688 -21.5131568909 ...  43723  44650    784
55.5686146471  0.608277412471 0.3136448 -21.5073776245 ...  43727  44654    784
55.5972002797  0.434026434704 0.3517163 -21.5829257965 ...  43731  44658    784
55.7617273511  0.495315330472  0.403208 -21.3501148224 ...  43740  44667    784
55.8125115924  0.521042073319 0.3769101 -21.6775398254 ...  43740  44667    784
          ...             ...       ...            ... ...    ...    ...    ...
162.115406511   9.12498011516 0.2217769 -21.5991649628 ... 322639 331488   3787
162.204837648     9.136054829 0.2285027 -21.6524200439 ... 633991 650894   3789
162.407014385   9.24223618476 0.2233595 -21.6275596619 ... 633995 650898   3789
162.631596919   9.11224932272 0.3507926 -21.7870635986 ... 633997 650900   3789
162.792857827   9.06585769142 0.2211935 -22.1479187012 ... 634001 650905   8537
162.752716952   9.23526068256 0.3132616 -21.6552429199 ... 634000 650903   3789
162.013077975   9.58703483653 0.2450086 -21.6949653625 ... 323046 331902   3787
162.142350287   9.94163874778 0.3369665 -21.4902000427 ... 634079 650985   3788
162.160914924   9.86128115397 0.3681125 -21.9206676483 ... 634079 650985   3788
162.249397448   9.95005411419 0.2213098 -21.5619354248 ... 634081 650987   3789
 162.61877369    9.9153390136 0.3470703 -21.6079502106 ... 634087 650993   3789
Length = 105831 rows
Generating random catalog of 211662 size in file randcat.dat... 
Mangle
	file:       /Users/rohin/Documents/ipy_notebooks/galsurveystudy/masks/window.dr72safe0.ply
	area:       7732.34 sqdeg
	npoly:      159666
	pixeltype:  'u'
	pixelres:   -1
	real:       10
	npix:       0
	snapped:    0
	balkanized: 0
	weightfile: 
	verbose:    0

Calculating 2pCF...
Using Davis-Peebles method
Calculating DD...
 DD=
[  2.54153208e-05   4.15482200e-05   6.35191056e-05   9.15283330e-05
   1.25238762e-04   1.65286995e-04   2.12084635e-04   2.63913839e-04
   3.22521915e-04   3.85466740e-04   4.56312926e-04   5.32382819e-04
   6.12278393e-04   7.02831555e-04   7.97553611e-04   8.98999361e-04
   1.00641274e-03   1.11713680e-03   1.23238654e-03   1.35220892e-03
   1.48000784e-03   1.61360653e-03   1.74775218e-03   1.88660404e-03
   2.03010836e-03   2.17501553e-03   2.32609265e-03   2.48501041e-03
   2.64082963e-03   2.79740688e-03   2.95429662e-03   3.11798809e-03
   3.28869111e-03   3.45615898e-03   3.62485220e-03   3.79353952e-03
   3.97061802e-03   4.15378915e-03   4.33693689e-03]
Calculating DR...
 DR=
[  4.70272829e-06   1.24079921e-05   2.35968989e-05   3.79929804e-05
   5.52970901e-05   7.56104317e-05   9.89092110e-05   1.24755355e-04
   1.53536402e-04   1.85124899e-04   2.20239270e-04   2.58559968e-04
   3.00309087e-04   3.44998911e-04   3.92824037e-04   4.43021085e-04
   4.97122884e-04   5.54014767e-04   6.12964202e-04   6.75910753e-04
   7.38844626e-04   8.04559298e-04   8.71957645e-04   9.43526854e-04
   1.01451956e-03   1.08613582e-03   1.16212682e-03   1.23842671e-03
   1.31540912e-03   1.39423744e-03   1.47132664e-03   1.55606405e-03
   1.63436198e-03   1.71722528e-03   1.79907823e-03   1.88064530e-03
   1.96444625e-03   2.04800105e-03   2.13396330e-03]
Calculating Poisson error
Two-point correlation=
(array([ 4.40437788,  2.34850471,  1.69184124,  1.40908537,  1.26483458,
        1.18603427,  1.14423543,  1.11545099,  1.10062181,  1.08219824,
        1.07189629,  1.05903034,  1.0388274 ,  1.03719934,  1.03030756,
        1.02924735,  1.02447477,  1.01643867,  1.01053591,  1.00057317,
        1.00313812,  1.00557813,  1.00440032,  0.99952342,  1.00105395,
        1.00252629,  1.00158244,  1.00658658,  1.00761085,  1.00640636,
        1.00791349,  1.0037659 ,  1.01221709,  1.01264157,  1.01483856,
        1.0171478 ,  1.02124035,  1.02821632,  1.03233902]), array([ 1072.00771424,   519.48702315,   337.75147618,   251.81083499,
         202.37977321,   170.03472522,   147.237307  ,   130.21825912,
         116.96832068,   106.05438264,    96.99215886,    89.23818528,
          82.39597435,    76.84363517,    71.89221897,    67.6792123 ,
          63.81522537,    60.32979351,    57.27147409,    54.40421426,
          52.06895825,    49.9276084 ,    47.94513402,    46.03478457,
          44.41188304,    42.93851746,    41.50113544,    40.25258697,
          39.06693521,    37.93508635,    36.9417912 ,    35.884736  ,
          35.08837782,    34.23494098,    33.46532933,    32.75030994,
          32.07664253,    31.46965988,    30.86061696]))
CPU times: user 3h 43min 13s, sys: 2min 47s, total: 3h 46min 1s
Wall time: 3h 42min 5s

In [6]:
import matplotlib.pyplot as plt

In [7]:
%matplotlib inline

In [8]:
binMpc=3000*bins

In [10]:
plt.plot(binMpc[1:],correldr72[0],'ro-')


Out[10]:
[<matplotlib.lines.Line2D at 0x115143490>]

In [13]:
plt.yscale('log')
plt.plot(binMpc[4:],correldr72[0][3:],'ro-')


Out[13]:
[<matplotlib.lines.Line2D at 0x14bb95d10>]

In [15]:
plt.yscale('log')
plt.xscale('log')
plt.plot(binMpc[3:],correldr72[0][2:],'ro-')


Out[15]:
[<matplotlib.lines.Line2D at 0x1154e5490>]

In [ ]:
%%time
correldr72ls=tpcf('/Users/rohin/Downloads/DR7-Full.ascii',bins, randfile='/Users/rohin/Documents/ipy_notebooks/correlcalc-nb/randcat.dat',method='ls')


Calculating Correlation function with the following parameters
data file=
/Users/rohin/Downloads/DR7-Full.ascii
random file=
/Users/rohin/Documents/ipy_notebooks/correlcalc-nb/randcat.dat
Random catalog size factor(if random file is None)=
2
mask/window file=
None
Cosmology=
lcdm
Geometry=
flat
Correl method=
ls
---------------
Entered data ascii file
      ra            dec           z          M_g       ...  ilss  icomb  sector
------------- --------------- --------- -------------- ... ------ ------ ------
56.1604523761 -0.221359772462 0.4501842 -22.0970516205 ...  32763  33480    784
 58.247844859  0.216329004672 0.3671646 -21.8688602448 ... 303471 311902   3790
 54.445380928  0.619974218725 0.4133244 -21.7306137085 ...  43630  44552    779
54.4879828915  0.485825651457 0.3224697 -21.8775806427 ...  43622  44544    779
54.4932987631  0.483249792951 0.3226457 -21.6763000488 ...  43622  44544    779
55.5558858448  0.582441686132 0.2334688 -21.5131568909 ...  43723  44650    784
55.5686146471  0.608277412471 0.3136448 -21.5073776245 ...  43727  44654    784
55.5972002797  0.434026434704 0.3517163 -21.5829257965 ...  43731  44658    784
55.7617273511  0.495315330472  0.403208 -21.3501148224 ...  43740  44667    784
55.8125115924  0.521042073319 0.3769101 -21.6775398254 ...  43740  44667    784
          ...             ...       ...            ... ...    ...    ...    ...
162.115406511   9.12498011516 0.2217769 -21.5991649628 ... 322639 331488   3787
162.204837648     9.136054829 0.2285027 -21.6524200439 ... 633991 650894   3789
162.407014385   9.24223618476 0.2233595 -21.6275596619 ... 633995 650898   3789
162.631596919   9.11224932272 0.3507926 -21.7870635986 ... 633997 650900   3789
162.792857827   9.06585769142 0.2211935 -22.1479187012 ... 634001 650905   8537
162.752716952   9.23526068256 0.3132616 -21.6552429199 ... 634000 650903   3789
162.013077975   9.58703483653 0.2450086 -21.6949653625 ... 323046 331902   3787
162.142350287   9.94163874778 0.3369665 -21.4902000427 ... 634079 650985   3788
162.160914924   9.86128115397 0.3681125 -21.9206676483 ... 634079 650985   3788
162.249397448   9.95005411419 0.2213098 -21.5619354248 ... 634081 650987   3789
 162.61877369    9.9153390136 0.3470703 -21.6079502106 ... 634087 650993   3789
Length = 105831 rows
Entered random ascii file
   z        ra      dec   
-------- -------- --------
0.416207 5.855811 0.020213
0.341144 2.361823 0.268986
0.261839 2.273834 0.745777
0.169607 1.973207 0.725544
0.333105 3.760101 1.070893
0.311904 4.284316 0.372977
0.206441 2.559663 0.503025
0.256197 2.766006 0.373808
0.329596 2.265266 0.073565
0.205455 2.039053 0.743988
     ...      ...      ...
0.326323 2.916482 0.971383
 0.23779 2.810161 0.322325
0.454037 3.515311 0.847682
0.351001  0.77766 0.005123
0.392324 3.298096 0.717396
0.333392 3.347918 0.060013
0.242748 4.187738 0.250304
0.282276  3.13217 0.680416
 0.28862 4.154916 0.344521
0.368487 3.591032 0.037412
  0.2613 4.045266  0.76831
Length = 211662 rows
Calculating 2pCF...
Using Landy-Szalay method
Calculating DD...
 DD=
[  2.54153208e-05   4.15482200e-05   6.35191056e-05   9.15283330e-05
   1.25238762e-04   1.65286995e-04   2.12084635e-04   2.63913839e-04
   3.22521915e-04   3.85466740e-04   4.56312926e-04   5.32382819e-04
   6.12278393e-04   7.02831555e-04   7.97553611e-04   8.98999361e-04
   1.00641274e-03   1.11713680e-03   1.23238654e-03   1.35220892e-03
   1.48000784e-03   1.61360653e-03   1.74775218e-03   1.88660404e-03
   2.03010836e-03   2.17501553e-03   2.32609265e-03   2.48501041e-03
   2.64082963e-03   2.79740688e-03   2.95429662e-03   3.11798809e-03
   3.28869111e-03   3.45615898e-03   3.62485220e-03   3.79353952e-03
   3.97061802e-03   4.15378915e-03   4.33693689e-03]
Calculating RR...
 RR=
[ 0.01347367  0.02445165  0.03076853  0.03348795  0.03448188  0.03503104
  0.03535459  0.03578909  0.03610416  0.03594186  0.03528592  0.03453585
  0.034939    0.03359447  0.03177459  0.03110198  0.03086916  0.0309706
  0.03024271  0.02993218  0.03021612  0.03002924  0.02969542  0.0295443
  0.02924237  0.02847837  0.02861353  0.02776847  0.0269595   0.02598276
  0.0254345   0.02554942  0.0245019   0.02444267  0.02420214  0.02388953
  0.02349589  0.02345853  0.02541007]
Calculating DR...
 DR=
[  2.92918862e-06   8.57038224e-06   1.51995939e-05   2.29110629e-05
   3.00022752e-05   3.66660845e-05   4.35201582e-05   5.30036937e-05
   6.03517764e-05   6.19278196e-05   6.88861325e-05   7.64548809e-05
   8.52045457e-05   9.04657907e-05   9.33081505e-05   1.02120671e-04
   1.11427335e-04   1.17635795e-04   1.28207749e-04   1.42164731e-04
   1.50149231e-04   1.53626311e-04   1.67796772e-04   1.92563204e-04
   2.15203468e-04   2.28112790e-04   2.37308786e-04   2.55997246e-04
   3.06572457e-04   3.60316405e-04   3.54556374e-04   3.82706138e-04
   3.96584327e-04   4.21160762e-04   4.58409336e-04   4.36753116e-04
   4.47904122e-04   4.68687098e-04   5.14824754e-04]
Calculating Poisson error
Two-point correlation=
(array([ 1.00145149,  1.00099819,  1.00107642,  1.00136486,  1.00189184,
        1.00262495,  1.00353686,  1.00441214,  1.00558989,  1.00727873,
        1.00902742,  1.0109878 ,  1.01264688,  1.01553529,  1.01922723,
        1.02233806,  1.0253832 ,  1.02847427,  1.03227128,  1.03567664,
        1.03904239,  1.04350274,  1.04755475,  1.05082123,  1.05470492,
        1.06035423,  1.06470628,  1.07105237,  1.07521225,  1.07992894,
        1.08827317,  1.09207942,  1.10185017,  1.10693746,  1.11189231,
        1.12223069,  1.13086584,  1.13711065,  1.13015655]), array([ 397.00618399,  310.4348607 ,  251.07963444,  209.19364774,
        178.88388826,  155.7687308 ,  137.57601781,  123.38317506,
        111.67668586,  102.23844311,   94.04906402,   87.15602615,
         81.33793027,   76.02646217,   71.49986977,   67.44877466,
         63.8438606 ,   60.68988634,   57.89062074,   55.35882898,
         53.00224271,   50.87171771,   48.97738548,   47.2158077 ,
         45.60262582,   44.17847418,   42.80995535,   41.54578559,
         40.38241904,   39.32517632,   38.42025644,   37.46631158,
         36.65136985,   35.83890977,   35.07733723,   34.45643044,
         33.81637511,   33.15925652,   32.34595452]))
CPU times: user 1h 12min 49s, sys: 18 s, total: 1h 13min 7s
Wall time: 11h 46min 26s

In [ ]:
%%time
correldr72=tpcf('/Users/rohin/Downloads/DR7-Full.ascii',bins,mask='/Users/rohin/Documents/ipy_notebooks/galsurveystudy/masks/window.dr72safe0.ply',randfact=3)


Calculating Correlation function with the following parameters
data file=
/Users/rohin/Downloads/DR7-Full.ascii
random file=
None
Random catalog size factor(if random file is None)=
3
mask/window file=
/Users/rohin/Documents/ipy_notebooks/galsurveystudy/masks/window.dr72safe0.ply
Cosmology=
lcdm
Geometry=
flat
Correl method=
dp
---------------
Entered data ascii file
      ra            dec           z          M_g       ...  ilss  icomb  sector
------------- --------------- --------- -------------- ... ------ ------ ------
56.1604523761 -0.221359772462 0.4501842 -22.0970516205 ...  32763  33480    784
 58.247844859  0.216329004672 0.3671646 -21.8688602448 ... 303471 311902   3790
 54.445380928  0.619974218725 0.4133244 -21.7306137085 ...  43630  44552    779
54.4879828915  0.485825651457 0.3224697 -21.8775806427 ...  43622  44544    779
54.4932987631  0.483249792951 0.3226457 -21.6763000488 ...  43622  44544    779
55.5558858448  0.582441686132 0.2334688 -21.5131568909 ...  43723  44650    784
55.5686146471  0.608277412471 0.3136448 -21.5073776245 ...  43727  44654    784
55.5972002797  0.434026434704 0.3517163 -21.5829257965 ...  43731  44658    784
55.7617273511  0.495315330472  0.403208 -21.3501148224 ...  43740  44667    784
55.8125115924  0.521042073319 0.3769101 -21.6775398254 ...  43740  44667    784
          ...             ...       ...            ... ...    ...    ...    ...
162.115406511   9.12498011516 0.2217769 -21.5991649628 ... 322639 331488   3787
162.204837648     9.136054829 0.2285027 -21.6524200439 ... 633991 650894   3789
162.407014385   9.24223618476 0.2233595 -21.6275596619 ... 633995 650898   3789
162.631596919   9.11224932272 0.3507926 -21.7870635986 ... 633997 650900   3789
162.792857827   9.06585769142 0.2211935 -22.1479187012 ... 634001 650905   8537
162.752716952   9.23526068256 0.3132616 -21.6552429199 ... 634000 650903   3789
162.013077975   9.58703483653 0.2450086 -21.6949653625 ... 323046 331902   3787
162.142350287   9.94163874778 0.3369665 -21.4902000427 ... 634079 650985   3788
162.160914924   9.86128115397 0.3681125 -21.9206676483 ... 634079 650985   3788
162.249397448   9.95005411419 0.2213098 -21.5619354248 ... 634081 650987   3789
 162.61877369    9.9153390136 0.3470703 -21.6079502106 ... 634087 650993   3789
Length = 105831 rows
Generating random catalog of 317493 size in file randcat.dat... 

In [ ]: