In [1]:
x = arange(10)
y = arange(20)
z = arange(30)

In [2]:
c_[x,y,z]


---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-2-848595eaffe0> in <module>()
----> 1 c_[x,y,z]

/Users/Benjamin/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/numpy/lib/index_tricks.pyc in __getitem__(self, key)
    336                 objs[k] = objs[k].astype(final_dtype)
    337 
--> 338         res = _nx.concatenate(tuple(objs), axis=self.axis)
    339         return self._retval(res)
    340 

ValueError: all the input array dimensions except for the concatenation axis must match exactly

In [3]:
r_[x,y,z]


Out[3]:
array([ 0,  1,  2,  3,  4,  5,  6,  7,  8,  9,  0,  1,  2,  3,  4,  5,  6,
        7,  8,  9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,  0,  1,  2,  3,
        4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
       21, 22, 23, 24, 25, 26, 27, 28, 29])

In [4]:
x = arange(10)
y = arange(10)
z = arange(10)

In [5]:
c_[x,y,z]


Out[5]:
array([[0, 0, 0],
       [1, 1, 1],
       [2, 2, 2],
       [3, 3, 3],
       [4, 4, 4],
       [5, 5, 5],
       [6, 6, 6],
       [7, 7, 7],
       [8, 8, 8],
       [9, 9, 9]])

In [6]:
cc = c_[x,y,z]

In [7]:
cc.shape


Out[7]:
(10, 3)

In [8]:
import largescalestructure

In [9]:
import largescalestructure as lss

In [10]:
import datapath
import fitsio
clusters = fitsio.read('/Users/Benjamin/AstroData/Clusters/redmapper_dr8_public_v5.2_catalog.fits')

In [11]:
ra = clusters['RA']
dec = clusters['DEC']

In [12]:
xx = clusters['PZ']
xmaxindx = argmax(xx, axis=1)
yy = clusters['PZBINS']
z = yy[np.arange(25325),xmaxindx]
zcoord = c_[z,ra,dec]

In [13]:
reload(lss)


Out[13]:
<module 'largescalestructure' from 'largescalestructure.py'>

In [14]:
lss.comoving_neighbors(zcoord,zcoord,nthneighbor=2,maxscale=5.)


---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-14-26382999b41c> in <module>()
----> 1 lss.comoving_neighbors(zcoord,zcoord,nthneighbor=2,maxscale=5.)

/Users/Benjamin/Code/BGT-Cosmology/Spectroscopy/largescalestructure.py in comoving_neighbors(zcoord1, zcoord2, nthneighbor, maxscale)
     49     """
     50     """
---> 51     coord1 = radecz_to_comoving(zcoord1)
     52     coord2 = radecz_to_comoving(zcoord2)
     53     kdt = KDT(coord2)

/Users/Benjamin/Code/BGT-Cosmology/Spectroscopy/largescalestructure.py in radecz_to_comoving(zcoord)
     42     """
     43     # use transverse comoving distance dM instead?
---> 44     dc = cosmo.comoving_distance(zcoord[:,0])
     45     scoord = c_[dc, zcoord[:,1], zcoord[:2]]
     46     return spherical_to_cartesian(scoord)

TypeError: comoving_distance() takes exactly 2 arguments (1 given)

In [15]:
reload(lss)


Out[15]:
<module 'largescalestructure' from 'largescalestructure.py'>

In [16]:
lss.comoving_neighbors(zcoord,zcoord,nthneighbor=2,maxscale=5.)


---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-16-26382999b41c> in <module>()
----> 1 lss.comoving_neighbors(zcoord,zcoord,nthneighbor=2,maxscale=5.)

/Users/Benjamin/Code/BGT-Cosmology/Spectroscopy/largescalestructure.py in comoving_neighbors(zcoord1, zcoord2, nthneighbor, maxscale)
     50     """
     51     """
---> 52     coord1 = radecz_to_comoving(zcoord1)
     53     coord2 = radecz_to_comoving(zcoord2)
     54     kdt = KDT(coord2)

/Users/Benjamin/Code/BGT-Cosmology/Spectroscopy/largescalestructure.py in radecz_to_comoving(zcoord)
     44     # use transverse comoving distance dM instead?
     45     dc = cosmo.comoving_distance(zcoord[:,0], _CosPar)
---> 46     scoord = c_[dc, zcoord[:,1], zcoord[:2]]
     47     return spherical_to_cartesian(scoord)
     48 

NameError: global name 'c_' is not defined

In [17]:
reload(lss)


Out[17]:
<module 'largescalestructure' from 'largescalestructure.py'>

In [18]:
lss.comoving_neighbors(zcoord,zcoord,nthneighbor=2,maxscale=5.)


---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-18-26382999b41c> in <module>()
----> 1 lss.comoving_neighbors(zcoord,zcoord,nthneighbor=2,maxscale=5.)

/Users/Benjamin/Code/BGT-Cosmology/Spectroscopy/largescalestructure.py in comoving_neighbors(zcoord1, zcoord2, nthneighbor, maxscale)
     50     """
     51     """
---> 52     coord1 = radecz_to_comoving(zcoord1)
     53     coord2 = radecz_to_comoving(zcoord2)
     54     kdt = KDT(coord2)

/Users/Benjamin/Code/BGT-Cosmology/Spectroscopy/largescalestructure.py in radecz_to_comoving(zcoord)
     44     # use transverse comoving distance dM instead?
     45     dc = cosmo.comoving_distance(zcoord[:,0], _CosPar)
---> 46     scoord = np.c_[dc, zcoord[:,1], zcoord[:2]]
     47     return spherical_to_cartesian(scoord)
     48 

/Users/Benjamin/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/numpy/lib/index_tricks.pyc in __getitem__(self, key)
    336                 objs[k] = objs[k].astype(final_dtype)
    337 
--> 338         res = _nx.concatenate(tuple(objs), axis=self.axis)
    339         return self._retval(res)
    340 

ValueError: all the input array dimensions except for the concatenation axis must match exactly

In [19]:
zcoord.shape


Out[19]:
(25325, 3)

In [20]:
reload(lss)


Out[20]:
<module 'largescalestructure' from 'largescalestructure.py'>

In [21]:
lss.comoving_neighbors(zcoord,zcoord,nthneighbor=2,maxscale=5.)


---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-21-26382999b41c> in <module>()
----> 1 lss.comoving_neighbors(zcoord,zcoord,nthneighbor=2,maxscale=5.)

/Users/Benjamin/Code/BGT-Cosmology/Spectroscopy/largescalestructure.py in comoving_neighbors(zcoord1, zcoord2, nthneighbor, maxscale)
     60         raise ValueError('invalid nnearest {0}'.format(nthneighbor))
     61 
---> 62     ds = linalg.norm(scoord1[:,1:3]-scoord2[indx2,1:3])
     63     indx1 = np.arange(coord1.size/3)
     64     if maxscale != None:

NameError: global name 'scoord1' is not defined

In [22]:
reload(lss)


Out[22]:
<module 'largescalestructure' from 'largescalestructure.py'>

In [23]:
indx1, indx2, ds = lss.comoving_neighbors(zcoord,zcoord,nthneighbor=2,maxscale=5.)


---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-23-2c6df29afe90> in <module>()
----> 1 indx1, indx2, ds = lss.comoving_neighbors(zcoord,zcoord,nthneighbor=2,maxscale=5.)

/Users/Benjamin/Code/BGT-Cosmology/Spectroscopy/largescalestructure.py in comoving_neighbors(zcoord1, zcoord2, nthneighbor, maxscale)
     52     ccoord1 = radecz_to_comoving(zcoord1)
     53     ccoord2 = radecz_to_comoving(zcoord2)
---> 54     kdt = KDT(coord2)
     55     if nthneighbor == 1:
     56         indx2 = kdt.query(coord1)[1]

NameError: global name 'coord2' is not defined

In [24]:
reload(lss)


Out[24]:
<module 'largescalestructure' from 'largescalestructure.py'>

In [25]:
indx1, indx2, ds = lss.comoving_neighbors(zcoord,zcoord,nthneighbor=2,maxscale=5.)

In [26]:
indx1.shape


Out[26]:
()

In [28]:
lss.cosmo.comoving_distance(1.0, lss._CosPar)


Out[28]:
3303.8288058874682

In [29]:
Pi


---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-29-38a0d74848bd> in <module>()
----> 1 Pi

NameError: name 'Pi' is not defined

In [30]:
pi


Out[30]:
3.141592653589793

In [31]:
np.pi


Out[31]:
3.141592653589793

In [32]:
reload(lss)


Out[32]:
<module 'largescalestructure' from 'largescalestructure.py'>

In [33]:
indx1, indx2, ds = lss.comoving_neighbors(zcoord,zcoord,nthneighbor=2,maxscale=5.)

In [34]:
indx1.shape


Out[34]:
()

In [35]:
ds


Out[35]:
array([], dtype=float64)

In [36]:
zcoord[0:10,:]


Out[36]:
array([[  9.55104157e-02,   2.39583329e+02,   2.72334129e+01],
       [  2.32500643e-01,   2.50082548e+02,   4.67115314e+01],
       [  1.81948349e-01,   1.97872957e+02,  -1.34111628e+00],
       [  1.70400381e-01,   1.37303121e+02,   1.09747469e+01],
       [  3.95684958e-01,   8.03426455e+00,   1.81070239e+01],
       [  3.21887910e-01,   1.50558906e+02,   2.05379494e+01],
       [  2.31705472e-01,   2.03833723e+02,   4.10011464e+01],
       [  4.38676506e-01,   3.40832476e+02,  -9.59192011e+00],
       [  1.27487645e-01,   1.26371092e+02,   4.71335713e+01],
       [  2.83148289e-01,   1.98771816e+02,   5.18174456e+01]])

In [37]:
ra[0:10]


Out[37]:
array([ 239.58332907,  250.08254839,  197.87295717,  137.30312092,
          8.03426455,  150.55890608,  203.83372268,  340.83247584,
        126.37109234,  198.77181589])

In [38]:
zcoord.shape


Out[38]:
(25325, 3)

In [39]:
ra.shape
dec.shape


Out[39]:
(25325,)

In [40]:
dec[0:10]


Out[40]:
array([ 27.23341292,  46.71153135,  -1.34111628,  10.97474695,
        18.10702394,  20.53794937,  41.00114644,  -9.59192011,
        47.1335713 ,  51.81744556])

In [41]:
zcoord = c_[z,ra,dec]

In [42]:
zcoord[0:10,:]


Out[42]:
array([[  9.55104157e-02,   2.39583329e+02,   2.72334129e+01],
       [  2.32500643e-01,   2.50082548e+02,   4.67115314e+01],
       [  1.81948349e-01,   1.97872957e+02,  -1.34111628e+00],
       [  1.70400381e-01,   1.37303121e+02,   1.09747469e+01],
       [  3.95684958e-01,   8.03426455e+00,   1.81070239e+01],
       [  3.21887910e-01,   1.50558906e+02,   2.05379494e+01],
       [  2.31705472e-01,   2.03833723e+02,   4.10011464e+01],
       [  4.38676506e-01,   3.40832476e+02,  -9.59192011e+00],
       [  1.27487645e-01,   1.26371092e+02,   4.71335713e+01],
       [  2.83148289e-01,   1.98771816e+02,   5.18174456e+01]])

In [43]:
reload(lss)


Out[43]:
<module 'largescalestructure' from 'largescalestructure.py'>

In [44]:
indx1, indx2, ds = lss.comoving_neighbors(zcoord,zcoord,nthneighbor=2,maxscale=5.)


---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
<ipython-input-44-2c6df29afe90> in <module>()
----> 1 indx1, indx2, ds = lss.comoving_neighbors(zcoord,zcoord,nthneighbor=2,maxscale=5.)

/Users/Benjamin/Code/BGT-Cosmology/Spectroscopy/largescalestructure.py in comoving_neighbors(zcoord1, zcoord2, nthneighbor, maxscale)
     61 
     62     ds = linalg.norm(ccoord1[:,1:3]-ccoord2[indx2,1:3])
---> 63     print ds[0:10]
     64     indx1 = np.arange(ds.size/3)
     65     if maxscale != None:

IndexError: invalid index to scalar variable.

In [45]:
c = np.array([[ 1, 2, 3],
              [-1, 1, 4]])

In [46]:
c.shape


Out[46]:
(2, 3)

In [47]:
linalg.norm(c,axis=1)


Out[47]:
array([ 3.74165739,  4.24264069])

In [48]:
sqrt(1.+2.*2.+3.*3.)


Out[48]:
3.7416573867739413

In [49]:
reload(lss)


Out[49]:
<module 'largescalestructure' from 'largescalestructure.py'>

In [50]:
indx1, indx2, ds = lss.comoving_neighbors(zcoord,zcoord,nthneighbor=2,maxscale=5.)


---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
<ipython-input-50-2c6df29afe90> in <module>()
----> 1 indx1, indx2, ds = lss.comoving_neighbors(zcoord,zcoord,nthneighbor=2,maxscale=5.)

/Users/Benjamin/Code/BGT-Cosmology/Spectroscopy/largescalestructure.py in comoving_neighbors(zcoord1, zcoord2, nthneighbor, maxscale)
     63     if maxscale != None:
     64        iselect = ds < maxscale
---> 65        indx1 = indx1[iselect]
     66        indx2 = indx2[iselect]
     67        ds = ds[iselect]

IndexError: index 8796 is out of bounds for axis 1 with size 8442

In [51]:
reload(lss)


Out[51]:
<module 'largescalestructure' from 'largescalestructure.py'>

In [52]:
indx1, indx2, ds = lss.comoving_neighbors(zcoord,zcoord,nthneighbor=2,maxscale=5.)

In [53]:
indx1.shape


Out[53]:
(150,)

In [54]:
ds


Out[54]:
array([ 3.46533383,  4.42312121,  4.42312121,  4.25705911,  4.97565976,
        2.96249142,  4.85800635,  4.66168699,  3.85744672,  2.96249142,
        4.20091305,  3.85744672,  4.6950601 ,  3.24351513,  3.67013876,
        4.25705911,  2.72708363,  4.85800635,  2.72708363,  4.39165978,
        3.24351513,  4.39165978,  4.66168699,  3.86875094,  4.89224123,
        4.94841325,  4.4644582 ,  4.13398469,  2.67200495,  4.13398469,
        4.47545444,  4.12676278,  2.80956211,  3.37867759,  3.80358559,
        4.15852464,  4.64373171,  4.89224123,  3.49936085,  4.95701699,
        2.80956211,  3.00202083,  4.96129858,  2.19209222,  3.68142286,
        4.39259491,  4.4644582 ,  2.67200495,  4.29382589,  2.3228261 ,
        3.24117094,  4.62637828,  2.19209222,  3.66440019,  4.97565976,
        4.99998884,  3.89356437,  4.8599131 ,  4.59218948,  4.63958876,
        4.07143483,  4.02788235,  3.80358559,  3.98158233,  4.58355231,
        4.42190474,  4.55908483,  4.22119563,  4.0604631 ,  4.85546582,
        2.3228261 ,  4.42190474,  4.74140222,  4.62637828,  4.08862467,
        4.49614013,  3.00202083,  4.98605211,  4.74140222,  4.68832824,
        4.54586442,  3.46533383,  3.66440019,  3.86875094,  4.11409681,
        3.68142286,  4.29382589,  4.1170529 ,  3.8972521 ,  4.72282686,
        4.12676278,  3.26735788,  4.58355231,  4.1170529 ,  3.89356437,
        4.32190218,  4.22119563,  4.08862467,  4.08637562,  4.6950601 ,
        4.18156071,  4.08637562,  4.68832824,  4.87376791,  4.99998884,
        4.18156071,  2.90317844,  4.0604631 ,  3.24117094,  4.32190218,
        2.90317844,  4.02788235,  3.8972521 ,  3.98158233,  4.87376791,
        4.8599131 ,  4.15852464,  4.63958876,  4.95701699,  4.1026404 ,
        4.85546582,  4.59218948,  4.20091305,  4.64373171,  4.49614013,
        4.1026404 ,  3.26735788,  4.39259491,  4.54586442,  4.85688394,
        4.07143483,  4.19724722,  4.96129858,  4.47545444,  3.49936085,
        4.11409681,  3.43957039,  4.94382307,  3.90128513,  3.90128513,
        4.72282686,  4.94382307,  4.19724722,  3.37867759,  3.67013876,
        4.85688394,  3.43957039,  4.94841325,  4.98605211,  4.55908483])

In [55]:
zcoord[indx1,1]


Out[55]:
array([ 203.53617059,  187.74151817,  187.62727357,  334.69992553,
        187.22628825,  323.80085724,  157.64494027,  221.06605125,
        249.9082825 ,  323.86821136,  172.5054329 ,  250.03437703,
        341.22167602,  123.30212396,   14.87167489,  335.11319365,
        227.87164755,  157.58017372,  227.96089022,   26.348133  ,
        123.20714654,   26.21847287,  221.03524889,  162.52158664,
        182.53265445,  112.40519948,  201.56600985,  227.85798631,
        217.52836906,  227.6717769 ,   21.92261054,  219.72810827,
        163.14179994,  164.09552492,  209.28052577,  328.70772309,
         14.03855922,  182.80867895,  211.42972417,  154.69089581,
        163.16350659,  138.40505975,  174.79166968,  192.51606898,
        257.08191496,  179.54107246,  201.67883334,  217.41181617,
        342.42100834,  213.71904415,  182.47787453,   44.22512981,
        192.28413481,  170.99528601,  187.07932642,  149.54955162,
         12.05520589,  202.0448534 ,   15.65211713,   21.27091583,
        116.12540474,  145.93008191,  209.39385195,  197.30264049,
        144.58316199,  175.93640662,  224.71898891,  336.6931316 ,
        180.24371964,  184.39870711,  213.95351029,  176.03186035,
        136.38253554,   43.94634355,   32.90618525,  201.21964344,
        138.69157232,  336.25183801,  136.20930026,   29.2778438 ,
        160.03086976,  203.27032311,  171.15581992,  162.65715454,
        183.15300465,  256.94010195,  342.53811618,  199.04199949,
        318.86954162,  214.20693116,  219.99584201,   29.37530476,
        144.45642049,  199.13054796,   11.83906382,  158.90672629,
        336.41755774,   32.95110766,  186.96160784,  341.23378874,
        221.91377368,  186.90166613,   29.49720134,  161.99532668,
        149.9210323 ,  221.86460919,   10.59755487,  180.17896443,
        182.64161672,  158.85596415,   10.62411455,  145.83583584,
        319.0210224 ,  197.51928964,  161.83781914,  202.29863381,
        328.89554794,   21.31671664,  154.69715761,  151.19832746,
        184.35070616,   15.91313571,  172.61143075,   13.95958772,
        200.99614748,  151.36402038,   29.35417986,  179.5616083 ,
        159.84577141,  354.84906013,  115.82929759,  341.59165915,
        175.03149046,   21.84715281,  211.60245756,  183.01450805,
        242.94687605,  209.21303048,  242.98339706,  242.91410144,
        214.36942102,  208.99716188,  341.74119964,  164.23729538,
         14.80514754,  354.79859597,  243.05948369,  112.33934948,
        336.18776228,  224.80869634])

In [56]:
zcoord[indx1,2]


Out[56]:
array([ 20.24805526,  34.65658162,  34.63372468,  -2.97356963,
        19.43179804,  -1.04884163,  14.26160725,  35.95362562,
        47.0528837 ,  -0.96587435,  12.93805576,  47.16058433,
        27.07397701,  52.29712801,   3.72224051,  -2.79301759,
        14.66088273,  14.06527342,  14.85125434,  13.9254471 ,
        52.3574602 ,  13.79702834,  35.79696067,  28.53962917,
         6.52452591,  34.2946089 ,  48.87479797,  36.56000868,
        20.59506341,  36.81550791,  23.28829948,  17.72784089,
        10.07056542,  27.16887115,  30.71468685,   0.93070107,
        26.7043365 ,   6.1427434 ,  13.96988265,  -1.51742676,
        10.1966672 ,   3.2890373 ,  17.06172704,  -1.54040347,
        21.18150354,   8.66139146,  49.04595155,  20.49485686,
        32.8709367 ,   0.1962087 ,  -0.5576665 ,  -1.62159413,
        -1.79022246,  19.98607809,  19.22041416,  22.84879798,
        29.87526339,  63.53379739,  -0.83548325,  -9.41373729,
        49.56697532,   1.00024438,  30.55776123,  34.90964352,
        65.49736578,  -1.00886748,  43.8803669 ,   4.90726536,
        42.25350887,  22.93223084,   0.26044897,  -1.1420766 ,
        17.9478988 ,  -1.69238036,   0.38685937,  47.31827854,
         3.34904938,  -2.26312776,  18.27772909,  18.43595959,
        39.63115727,  20.13906578,  20.09381551,  28.53145025,
        30.62032093,  21.38708331,  32.44971022,  -0.93660758,
        -0.13140059,  11.70286466,  18.11185249,  -0.2091413 ,
        65.66149276,  -1.08663802,  29.59846232,  11.8524841 ,
         4.87256004,   0.27765312,  14.10644879,  26.84843813,
        37.26400593,  14.00986024,  18.36468275,  35.74587708,
        22.77217752,  37.10169797,  27.1679617 ,  42.40067638,
        -0.41249459,  11.7673704 ,  27.25608613,   1.04554171,
        -0.07805769,  34.92766109,  35.8150307 ,  63.4602728 ,
         1.06030398,  -9.28284831,  -1.35904103,  32.6804354 ,
        22.78075376,  -0.7523451 ,  12.78032423,  26.60080158,
        47.3819845 ,  32.53667476,  -0.3155994 ,   8.82902026,
        39.54902419,  -6.1974541 ,  49.61443621,  17.57209381,
        17.04826074,  23.47482119,  13.98304557,  30.68036538,
        38.04861718,  57.15319661,  16.04890672,  16.19324323,
        11.68144216,  57.16734474,  17.65678279,  27.08533922,
         3.90231116,  -6.33753667,  38.14154105,  34.09639988,
        -2.09605578,  43.61276664])

In [1]:
zcoord


---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-1-08d0ee264be6> in <module>()
----> 1 zcoord

NameError: name 'zcoord' is not defined

In [2]:
import datapath
import fitsio
clusters = fitsio.read('/Users/Benjamin/AstroData/Clusters/redmapper_dr8_public_v5.2_catalog.fits')

In [3]:
ra = clusters['RA']
dec = clusters['DEC']

In [5]:
import healpy as hp

In [6]:
hp.ang2pix(8,pi/6.,0.)


Out[6]:
60

In [7]:
hp.mollview(arange(2.*8**2))


---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-7-a5288f87be8f> in <module>()
----> 1 hp.mollview(arange(2.*8**2))

/Users/Benjamin/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/healpy/visufunc.pyc in mollview(map, fig, rot, coord, unit, xsize, title, nest, min, max, flip, remove_dip, remove_mono, gal_cut, format, format2, cbar, cmap, notext, norm, hold, margins, sub, return_projected_map)
    192                                           copy=True,verbose=True)
    193         img = ax.projmap(map,nest=nest,xsize=xsize,coord=coord,vmin=min,vmax=max,
--> 194                    cmap=cmap,norm=norm)
    195         if cbar:
    196             im = ax.get_images()[0]

/Users/Benjamin/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/healpy/projaxes.pyc in projmap(self, map, nest, **kwds)
    644 class HpxMollweideAxes(MollweideAxes):
    645     def projmap(self,map,nest=False,**kwds):
--> 646         nside = pixelfunc.npix2nside(pixelfunc.get_map_size(map))
    647         f = lambda x,y,z: pixelfunc.vec2pix(nside,x,y,z,nest=nest)
    648         return super(HpxMollweideAxes,self).projmap(map,f,**kwds)

/Users/Benjamin/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/healpy/pixelfunc.pyc in get_map_size(m)
   1408             return len(m)
   1409         else:
-> 1410             raise ValueError("Wrong pixel number (it is not 12*nside**2)")
   1411 
   1412 def get_min_valid_nside(npix):

ValueError: Wrong pixel number (it is not 12*nside**2)

In [8]:
%history


zcoord
import datapath
import fitsio
clusters = fitsio.read('/Users/Benjamin/AstroData/Clusters/redmapper_dr8_public_v5.2_catalog.fits')
ra = clusters['RA']
dec = clusters['DEC']
import healpy
import healpy as hp
hp.ang2pix(8,pi/6.,0.)
hp.mollview(arange(2.*8**2))
%history

In [9]:
%history ~1/


import healpy
hp.mollview(np.arange(12))
import healpy as hp
hp.mollview(np.arange(12))
hp.mollview(np.arange(16))
hp.mollview(np.arange(12*2**2))
hp.mollview(np.arange(12*4**2))
hp.mollview(np.arange(12*6**2))
hp.mollview(np.arange(12*8**2))
hp.mollview(np.arange(12*16**2))
print, 12*16**2
12*16*82
12*16**2
12*32**2
hp.mollview(np.arange(12*32**2))

In [10]:
hp.mollview(np.arange(12*8**2))



In [22]:
hp.mollview(np.arange(12*2**2))
hp.projplot(pi/6., 0.25*pi, 'ro')


---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-22-23df7b51bea3> in <module>()
      1 hp.mollview(np.arange(12*2**2))
----> 2 hp.projplot(pi/6., 0.25*pi, 'ro')

/Users/Benjamin/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/healpy/visufunc.pyc in projplot(*args, **kwds)
    811         for ax in f.get_axes():
    812             if isinstance(ax,PA.SphericalProjAxes):
--> 813                 ret = ax.projplot(*args,**kwds)
    814     finally:
    815         pylab.draw()

/Users/Benjamin/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/healpy/projaxes.pyc in projplot(self, *args, **kwds)
    255         for xx,yy in zip(x,y):
    256             if fmt is not None:
--> 257                 linestyle, marker, color = axes._process_plot_format(fmt)
    258                 kwds.setdefault('linestyle',linestyle)
    259                 kwds.setdefault('marker',marker)

AttributeError: 'module' object has no attribute '_process_plot_format'

In [12]:
hp.ang2pix(8,pi/6.,0.)


Out[12]:
60

In [13]:
hp.ang2pix(2,pi/6.,0.)


Out[13]:
4

In [14]:
cos(pi/6.)


Out[14]:
0.86602540378443871

In [15]:
hp.ang2pix(2,pi/6.,0.25*pi)


Out[15]:
0

In [16]:
hp.graticule()


0.0 180.0 -180.0 180.0
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-16-e7f72d14c00d> in <module>()
----> 1 hp.graticule()

/Users/Benjamin/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/healpy/visufunc.pyc in graticule(dpar, dmer, coord, local, **kwds)
    775             if isinstance(ax,PA.SphericalProjAxes):
    776                 ax.graticule(dpar=dpar,dmer=dmer,coord=coord,
--> 777                              local=local,**kwds)
    778     finally:
    779         pylab.draw()

/Users/Benjamin/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/healpy/projaxes.pyc in graticule(self, dpar, dmer, coord, local, verbose, **kwds)
    488             dpar,dmer = self._get_interv_graticule(pmin,pmax,dpar,
    489                                                    mmin,mmax,dmer,
--> 490                                                    verbose=verbose)
    491         theta_list = np.around(np.arange(pmin,pmax+0.5*dpar,dpar)/dpar)*dpar
    492         phi_list = np.around(np.arange(mmin,mmax+0.5*dmer,dmer)/dmer)*dmer

/Users/Benjamin/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/healpy/projaxes.pyc in _get_interv_graticule(self, pmin, pmax, dpar, mmin, mmax, dmer, verbose)
    581         vdeg = np.floor(np.around(dpar/dtor,10))
    582         varcmin = (dpar/dtor-vdeg)*60.
--> 583         if verbose: print("The interval between parallels is {0:d} deg {1:.2f}'.".format(vdeg,varcmin))
    584         vdeg = np.floor(np.around(dmer/dtor,10))
    585         varcmin = (dmer/dtor-vdeg)*60.

ValueError: Unknown format code 'd' for object of type 'float'

In [1]:
allruns


---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-1-fbb7f3077ae8> in <module>()
----> 1 allruns

NameError: name 'allruns' is not defined

In [ ]: