<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-CA">
	<id>https://mocks.cita.utoronto.ca/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Gstein</id>
	<title>LSS Mocks - User contributions [en-ca]</title>
	<link rel="self" type="application/atom+xml" href="https://mocks.cita.utoronto.ca/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Gstein"/>
	<link rel="alternate" type="text/html" href="https://mocks.cita.utoronto.ca/index.php/Special:Contributions/Gstein"/>
	<updated>2026-05-10T02:36:40Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.35.5</generator>
	<entry>
		<id>https://mocks.cita.utoronto.ca/index.php?title=Large_Scale_Structure_Mocks&amp;diff=2125</id>
		<title>Large Scale Structure Mocks</title>
		<link rel="alternate" type="text/html" href="https://mocks.cita.utoronto.ca/index.php?title=Large_Scale_Structure_Mocks&amp;diff=2125"/>
		<updated>2020-02-25T19:15:18Z</updated>

		<summary type="html">&lt;p&gt;Gstein: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Welcome to the CITA LSS Mocks Portal.&lt;br /&gt;
&lt;br /&gt;
= [http://mocks.cita.utoronto.ca/websky WebSky Extragalactic CMB Mocks] =&lt;br /&gt;
Data to accompany [https://arxiv.org/abs/2001.08787 ''The Websky Extragalactic CMB Simulations'' - G. Stein, M. A. Alvarez, J. R. Bond, A. v. Engelen, N. Battaglia (2020)].&lt;br /&gt;
&lt;br /&gt;
= [http://cita.utoronto.ca/~malvarez/research/ksz-data Patchy kSZ Maps] =&lt;br /&gt;
Data and figures to accompany [http://adsabs.harvard.edu/abs/2016ApJ...824..118A Alvarez (2016)].&lt;/div&gt;</summary>
		<author><name>Gstein</name></author>
	</entry>
	<entry>
		<id>https://mocks.cita.utoronto.ca/index.php?title=File:KappaPower.png&amp;diff=2120</id>
		<title>File:KappaPower.png</title>
		<link rel="alternate" type="text/html" href="https://mocks.cita.utoronto.ca/index.php?title=File:KappaPower.png&amp;diff=2120"/>
		<updated>2020-02-25T19:02:11Z</updated>

		<summary type="html">&lt;p&gt;Gstein: Gstein uploaded a new version of File:KappaPower.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Gstein</name></author>
	</entry>
	<entry>
		<id>https://mocks.cita.utoronto.ca/index.php?title=File:Ksz.png&amp;diff=2119</id>
		<title>File:Ksz.png</title>
		<link rel="alternate" type="text/html" href="https://mocks.cita.utoronto.ca/index.php?title=File:Ksz.png&amp;diff=2119"/>
		<updated>2020-02-25T18:59:44Z</updated>

		<summary type="html">&lt;p&gt;Gstein: Gstein uploaded a new version of File:Ksz.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Gstein</name></author>
	</entry>
	<entry>
		<id>https://mocks.cita.utoronto.ca/index.php?title=File:KappaPower.png&amp;diff=1911</id>
		<title>File:KappaPower.png</title>
		<link rel="alternate" type="text/html" href="https://mocks.cita.utoronto.ca/index.php?title=File:KappaPower.png&amp;diff=1911"/>
		<updated>2019-10-17T16:56:43Z</updated>

		<summary type="html">&lt;p&gt;Gstein: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Gstein</name></author>
	</entry>
	<entry>
		<id>https://mocks.cita.utoronto.ca/index.php?title=File:Cib.png&amp;diff=1908</id>
		<title>File:Cib.png</title>
		<link rel="alternate" type="text/html" href="https://mocks.cita.utoronto.ca/index.php?title=File:Cib.png&amp;diff=1908"/>
		<updated>2019-10-17T16:53:23Z</updated>

		<summary type="html">&lt;p&gt;Gstein: Gstein uploaded a new version of File:Cib.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Gstein</name></author>
	</entry>
	<entry>
		<id>https://mocks.cita.utoronto.ca/index.php?title=Large_Scale_Structure_Mocks&amp;diff=1895</id>
		<title>Large Scale Structure Mocks</title>
		<link rel="alternate" type="text/html" href="https://mocks.cita.utoronto.ca/index.php?title=Large_Scale_Structure_Mocks&amp;diff=1895"/>
		<updated>2019-10-16T20:05:34Z</updated>

		<summary type="html">&lt;p&gt;Gstein: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Welcome to the CITA LSS Mocks Portal.&lt;br /&gt;
&lt;br /&gt;
= [http://mocks.cita.utoronto.ca/websky WebSky Extragalactic CMB Mocks] =&lt;br /&gt;
CIB intensity, Compton-y, CMB lensing convergence, lensed and unlensed CMB temperature, all from the same 12288^3, 15.4 Gpc simulation.&lt;br /&gt;
&lt;br /&gt;
= [http://cita.utoronto.ca/~malvarez/research/ksz-data Patchy kSZ Maps] =&lt;br /&gt;
Data and figures to accompany [http://adsabs.harvard.edu/abs/2016ApJ...824..118A Alvarez (2016)].&lt;/div&gt;</summary>
		<author><name>Gstein</name></author>
	</entry>
	<entry>
		<id>https://mocks.cita.utoronto.ca/index.php?title=File:Conversion_factors.png&amp;diff=1787</id>
		<title>File:Conversion factors.png</title>
		<link rel="alternate" type="text/html" href="https://mocks.cita.utoronto.ca/index.php?title=File:Conversion_factors.png&amp;diff=1787"/>
		<updated>2019-08-15T19:44:21Z</updated>

		<summary type="html">&lt;p&gt;Gstein: conversion factors to Tcmb units&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;conversion factors to Tcmb units&lt;/div&gt;</summary>
		<author><name>Gstein</name></author>
	</entry>
	<entry>
		<id>https://mocks.cita.utoronto.ca/index.php?title=Final_Work_-_Remi-links&amp;diff=217</id>
		<title>Final Work - Remi-links</title>
		<link rel="alternate" type="text/html" href="https://mocks.cita.utoronto.ca/index.php?title=Final_Work_-_Remi-links&amp;diff=217"/>
		<updated>2018-08-24T18:40:49Z</updated>

		<summary type="html">&lt;p&gt;Gstein: Created page with &amp;quot;Lenspix, the code to lens healpix maps given an input kappa map, can be found here:  https://github.com/louis-pham/modified_lenspix   cal-sky, the code to create &amp;quot;field&amp;quot; maps...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Lenspix, the code to lens healpix maps given an input kappa map, can be found here:&lt;br /&gt;
&lt;br /&gt;
https://github.com/louis-pham/modified_lenspix&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
cal-sky, the code to create &amp;quot;field&amp;quot; maps of kappa, cib, etc, can be found here, where scripts to break up maps into redshift slices can be found in George Stein's fork:&lt;br /&gt;
&lt;br /&gt;
https://github.com/marcelo-alvarez/cal-sky&lt;/div&gt;</summary>
		<author><name>Gstein</name></author>
	</entry>
	<entry>
		<id>https://mocks.cita.utoronto.ca/index.php?title=Logbook&amp;diff=216</id>
		<title>Logbook</title>
		<link rel="alternate" type="text/html" href="https://mocks.cita.utoronto.ca/index.php?title=Logbook&amp;diff=216"/>
		<updated>2018-08-24T18:38:52Z</updated>

		<summary type="html">&lt;p&gt;Gstein: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
Here is the research log for Remi's CIB lensing project.  Links to research notes are below.&lt;br /&gt;
&lt;br /&gt;
[[Final Work - Remi-links]]&lt;br /&gt;
&lt;br /&gt;
[[August 17 - Cal-Sky]]&lt;br /&gt;
&lt;br /&gt;
[[August 9 - Cal-Sky - CIB 2]]&lt;br /&gt;
&lt;br /&gt;
[[July 20 - Cal-Sky - CIB]]&lt;br /&gt;
&lt;br /&gt;
[[June 11 - CIB - Lensing]]&lt;br /&gt;
&lt;br /&gt;
[[June 06 - CMB, Websky and LensPix]]&lt;br /&gt;
&lt;br /&gt;
[[June 05 - LensPix parameters]]&lt;br /&gt;
&lt;br /&gt;
[[May 14 - Issue with lensing]]&lt;br /&gt;
&lt;br /&gt;
[[Apr 26 - First look at lensing sims]]&lt;/div&gt;</summary>
		<author><name>Gstein</name></author>
	</entry>
	<entry>
		<id>https://mocks.cita.utoronto.ca/index.php?title=Logbook&amp;diff=215</id>
		<title>Logbook</title>
		<link rel="alternate" type="text/html" href="https://mocks.cita.utoronto.ca/index.php?title=Logbook&amp;diff=215"/>
		<updated>2018-08-24T18:37:49Z</updated>

		<summary type="html">&lt;p&gt;Gstein: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
Here is the research log for Remi's CIB lensing project.  Links to research notes are below.&lt;br /&gt;
&lt;br /&gt;
[[August 17 - Cal-Sky]]&lt;br /&gt;
&lt;br /&gt;
[[August 9 - Cal-Sky - CIB 2]]&lt;br /&gt;
&lt;br /&gt;
[[July 20 - Cal-Sky - CIB]]&lt;br /&gt;
&lt;br /&gt;
[[June 11 - CIB - Lensing]]&lt;br /&gt;
&lt;br /&gt;
[[June 06 - CMB, Websky and LensPix]]&lt;br /&gt;
&lt;br /&gt;
[[June 05 - LensPix parameters]]&lt;br /&gt;
&lt;br /&gt;
[[May 14 - Issue with lensing]]&lt;br /&gt;
&lt;br /&gt;
[[Apr 26 - First look at lensing sims]]&lt;/div&gt;</summary>
		<author><name>Gstein</name></author>
	</entry>
	<entry>
		<id>https://mocks.cita.utoronto.ca/index.php?title=Documentation&amp;diff=214</id>
		<title>Documentation</title>
		<link rel="alternate" type="text/html" href="https://mocks.cita.utoronto.ca/index.php?title=Documentation&amp;diff=214"/>
		<updated>2018-08-24T18:37:15Z</updated>

		<summary type="html">&lt;p&gt;Gstein: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Logbooks ==&lt;br /&gt;
&lt;br /&gt;
Here are the logbooks from various WebSky related projects:&lt;br /&gt;
&lt;br /&gt;
[[ Logbook | Remi CIB Lensing ]]&lt;br /&gt;
&lt;br /&gt;
== Software ==&lt;br /&gt;
&lt;br /&gt;
== Data ==&lt;br /&gt;
&lt;br /&gt;
[http://cita.utoronto.ca/~malvarez/research/ksz-data/ Patchy kSZ Maps]&lt;br /&gt;
&lt;br /&gt;
[https://www.dropbox.com/sh/deqz1gekpw0fapw/AABGKqqzG9wMnLP0LqFzE6i-a?dl=0/ Kappa, unlensed and lensed maps (LP)]&lt;br /&gt;
&lt;br /&gt;
[https://www.dropbox.com/s/1evuw17snfqzhwj/all.pdf?dl=0 K, Phi, unlensed, lensed PDF (LP)]&lt;br /&gt;
&lt;br /&gt;
== Transferring Data to Nersc ==&lt;br /&gt;
&lt;br /&gt;
1.) log in to nersc - $ssh &amp;lt;username&amp;gt;@edison.nersc.gov&lt;br /&gt;
 &lt;br /&gt;
2.) log into edisongrid - $ssh edisongrid&lt;br /&gt;
&lt;br /&gt;
3.) Sign into collaboration account&lt;br /&gt;
 $module load globus&lt;br /&gt;
 $myproxy-logon -s nerscca.nersc.gov    !Password is the same as your username&lt;br /&gt;
 $gsissh localhost -l cmbs4&lt;br /&gt;
&lt;br /&gt;
4.) $cd /project/projectdirs/cmbs4&lt;br /&gt;
&lt;br /&gt;
5.) ensure that the permissions are set appropriately (g+rX,o-rwx)&lt;br /&gt;
&lt;br /&gt;
6.) Update README and cmbs4 wiki for any new files you add or changes you make!&lt;br /&gt;
&lt;br /&gt;
README snippet for .npz catalogues&lt;br /&gt;
 HALO CATALOGUES:&lt;br /&gt;
 Contains (x,y,z,mass,redshift) for each halo. They are saved in the npz format of numpy (see http://docs.scipy.org/doc/numpy/reference/generated/numpy.savez.html). To load simply use&lt;br /&gt;
 halo_cat = np.load(outfile)&lt;br /&gt;
 xpk      = halo_cat[&amp;quot;xpk&amp;quot;]&lt;br /&gt;
 ypk      = halo_cat[&amp;quot;ypk&amp;quot;]&lt;br /&gt;
 zpk      = halo_cat[&amp;quot;zpk&amp;quot;] &lt;br /&gt;
 M         = halo_cat[&amp;quot;M&amp;quot;]&lt;br /&gt;
 redshift = halo_cat[&amp;quot;redshift&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
README snippet for .pksc catalogues&lt;br /&gt;
&lt;br /&gt;
Contains (x,y,z,v_x,v_y,v_z,R_TH) for each halo. The final halo catalog is a binary file with a 12 byte header, R_TH is the Lagrangian top hat radius of the halo. The conversion to mass is M_halo = 4*pi/3 * R_TH**3 * rho_bar, where rho_mean = 2.775e11*Omega_M*h**2.&lt;br /&gt;
header = (int Non, float RTHmax, float redshiftbox)&lt;br /&gt;
where Non is the total number of halos found, &lt;br /&gt;
RTHmax is the radius of the largest halo in the simulation,&lt;br /&gt;
redshiftbox is the redshift of the box, which will be negative for lightcone runs.&lt;br /&gt;
This 12 byte header is then followed by a list of Non*7 4 byte floats that represent (x_halo,y_halo,z_halo,vx_halo,vy_halo,vz_halo,Rth_halo)&lt;br /&gt;
             &lt;br /&gt;
Sample Python and Fortran code to load a datafile:&lt;br /&gt;
&lt;br /&gt;
Python: &lt;br /&gt;
 pkfile            = open(filein,&amp;quot;rb&amp;quot;)&lt;br /&gt;
 Non              = np.fromfile(pkfile, dtype=np.int32, count=1)&lt;br /&gt;
 RTHMAXin   = np.fromfile(pkfile, dtype=np.float32, count=1)&lt;br /&gt;
 redshiftbox  = np.fromfile(pkfile, dtype=np.float32, count=1)&lt;br /&gt;
 print &amp;quot;Non = &amp;quot;, Non&lt;br /&gt;
 npkdata        = 7*Non&lt;br /&gt;
 peakdata      = np.fromfile(pkfile, dtype=np.float32, count=npkdata)&lt;br /&gt;
 peakdata      = np.reshape(peakdata,(Non,7))&lt;br /&gt;
 xpos   = peakdata[:,0]&lt;br /&gt;
 ypos   = peakdata[:,1]&lt;br /&gt;
 zpos   = peakdata[:,2]&lt;br /&gt;
 vxpos = peakdata[:,3]&lt;br /&gt;
 vypos = peakdata[:,4]&lt;br /&gt;
 vzpos = peakdata[:,5]&lt;br /&gt;
 Rth     = peakdata[:,6]&lt;br /&gt;
 Omega_M = 0.25&lt;br /&gt;
 h                = 0.7&lt;br /&gt;
 rhomean   = 2.775e11*Omega_M*h**2&lt;br /&gt;
 M               = 4.0/3*np.pi*Rth**3*rhomean&lt;br /&gt;
&lt;br /&gt;
Redshifts&lt;br /&gt;
 z=np.linspace(0,4,1000)&lt;br /&gt;
 def hubble(z):&lt;br /&gt;
     return h*100*np.sqrt(omegam*(1+z)**3+1-omegam)&lt;br /&gt;
 def drdz(z):&lt;br /&gt;
     return 3e5 / hubble(z)&lt;br /&gt;
 r  = np.cumsum(drdz(z)*(z[1]-z[0]))&lt;br /&gt;
 r -= r[0]&lt;br /&gt;
 z_to_r   = sp.interpolate.interp1d(z,r)&lt;br /&gt;
 r_to_z   = sp.interpolate.interp1d(r,z)&lt;br /&gt;
&lt;br /&gt;
Fortran:&lt;br /&gt;
 open(4,file=filein,status='old',access='stream')&lt;br /&gt;
 read(4) Npk,RTHLmax_in,boxredshift&lt;br /&gt;
 allocate(posxyz(3,nhalo))&lt;br /&gt;
 allocate(velxyz(3,nhalo))&lt;br /&gt;
 allocate(rth(nhalo))&lt;br /&gt;
 allocate(mass(nhalo))&lt;br /&gt;
 allocate(vrad(nhalo))&lt;br /&gt;
 offset_num_floats = 7*nhalo*myid&lt;br /&gt;
 read(4) ((posxyz(j,i),j=1,3),&amp;amp;&lt;br /&gt;
         (velxyz(j,i),j=1,3),&amp;amp;&lt;br /&gt;
         rth(i),i=1,nhalo)&lt;br /&gt;
 close(4)&lt;br /&gt;
&lt;br /&gt;
== Modeling ==&lt;br /&gt;
&lt;br /&gt;
=== CMB Lensing === &lt;br /&gt;
&lt;br /&gt;
Using a 'field+halo' model to generate lensing kappa maps from Gaussian random field (GRF) of density fluctuations on the past light cone. &lt;br /&gt;
&lt;br /&gt;
'''Halo Model:''' The peak patch algorithm is run on the GRF to produce a catalog of halos with [RA, Dec, redshift, velocity, mass]. The halos are assumed to have a spherically-symmetric matter distribution parameterized by a generalized NFW density profile. This contribution to the convergence from each halo is then projected onto the kappa map, appropriately weighted by the lensing kernel, W(z).&lt;br /&gt;
&amp;lt;gallery mode=packed heights=&amp;quot;300px&amp;quot;&amp;gt;&lt;br /&gt;
File:fullskykappa.png|&amp;quot;Halo only&amp;quot; full sky kappa map&lt;br /&gt;
File:flatskykappa.png|&amp;quot;Halo only&amp;quot; zoomed in kappa map&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Field Model:''' (development in progress) Lagrangian perturbation theory is used to move matter not within halos to its final Eulerian position. This field matter distribution is then added directly to the kappa map. A [260 x 260 x 60] Mpc/h slab at z=0 is shown below with all the matter moved with either first (1LPT) or second (2LPT) order Lagrangian perturbation theory, in addition to the halos found with the peak patch method (these peak patch halos are also moved with either . Shown below are the same peak patch halo distributions, but also the&lt;/div&gt;</summary>
		<author><name>Gstein</name></author>
	</entry>
	<entry>
		<id>https://mocks.cita.utoronto.ca/index.php?title=Documentation&amp;diff=213</id>
		<title>Documentation</title>
		<link rel="alternate" type="text/html" href="https://mocks.cita.utoronto.ca/index.php?title=Documentation&amp;diff=213"/>
		<updated>2018-08-24T18:37:03Z</updated>

		<summary type="html">&lt;p&gt;Gstein: /* Logbooks */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Logbooks ==&lt;br /&gt;
&lt;br /&gt;
Here are the logbooks from various WebSky related projects:&lt;br /&gt;
[[ Logbook | Remi CIB Lensing ]]&lt;br /&gt;
&lt;br /&gt;
== Software ==&lt;br /&gt;
&lt;br /&gt;
== Data ==&lt;br /&gt;
&lt;br /&gt;
[http://cita.utoronto.ca/~malvarez/research/ksz-data/ Patchy kSZ Maps]&lt;br /&gt;
&lt;br /&gt;
[https://www.dropbox.com/sh/deqz1gekpw0fapw/AABGKqqzG9wMnLP0LqFzE6i-a?dl=0/ Kappa, unlensed and lensed maps (LP)]&lt;br /&gt;
&lt;br /&gt;
[https://www.dropbox.com/s/1evuw17snfqzhwj/all.pdf?dl=0 K, Phi, unlensed, lensed PDF (LP)]&lt;br /&gt;
&lt;br /&gt;
== Transferring Data to Nersc ==&lt;br /&gt;
&lt;br /&gt;
1.) log in to nersc - $ssh &amp;lt;username&amp;gt;@edison.nersc.gov&lt;br /&gt;
 &lt;br /&gt;
2.) log into edisongrid - $ssh edisongrid&lt;br /&gt;
&lt;br /&gt;
3.) Sign into collaboration account&lt;br /&gt;
 $module load globus&lt;br /&gt;
 $myproxy-logon -s nerscca.nersc.gov    !Password is the same as your username&lt;br /&gt;
 $gsissh localhost -l cmbs4&lt;br /&gt;
&lt;br /&gt;
4.) $cd /project/projectdirs/cmbs4&lt;br /&gt;
&lt;br /&gt;
5.) ensure that the permissions are set appropriately (g+rX,o-rwx)&lt;br /&gt;
&lt;br /&gt;
6.) Update README and cmbs4 wiki for any new files you add or changes you make!&lt;br /&gt;
&lt;br /&gt;
README snippet for .npz catalogues&lt;br /&gt;
 HALO CATALOGUES:&lt;br /&gt;
 Contains (x,y,z,mass,redshift) for each halo. They are saved in the npz format of numpy (see http://docs.scipy.org/doc/numpy/reference/generated/numpy.savez.html). To load simply use&lt;br /&gt;
 halo_cat = np.load(outfile)&lt;br /&gt;
 xpk      = halo_cat[&amp;quot;xpk&amp;quot;]&lt;br /&gt;
 ypk      = halo_cat[&amp;quot;ypk&amp;quot;]&lt;br /&gt;
 zpk      = halo_cat[&amp;quot;zpk&amp;quot;] &lt;br /&gt;
 M         = halo_cat[&amp;quot;M&amp;quot;]&lt;br /&gt;
 redshift = halo_cat[&amp;quot;redshift&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
README snippet for .pksc catalogues&lt;br /&gt;
&lt;br /&gt;
Contains (x,y,z,v_x,v_y,v_z,R_TH) for each halo. The final halo catalog is a binary file with a 12 byte header, R_TH is the Lagrangian top hat radius of the halo. The conversion to mass is M_halo = 4*pi/3 * R_TH**3 * rho_bar, where rho_mean = 2.775e11*Omega_M*h**2.&lt;br /&gt;
header = (int Non, float RTHmax, float redshiftbox)&lt;br /&gt;
where Non is the total number of halos found, &lt;br /&gt;
RTHmax is the radius of the largest halo in the simulation,&lt;br /&gt;
redshiftbox is the redshift of the box, which will be negative for lightcone runs.&lt;br /&gt;
This 12 byte header is then followed by a list of Non*7 4 byte floats that represent (x_halo,y_halo,z_halo,vx_halo,vy_halo,vz_halo,Rth_halo)&lt;br /&gt;
             &lt;br /&gt;
Sample Python and Fortran code to load a datafile:&lt;br /&gt;
&lt;br /&gt;
Python: &lt;br /&gt;
 pkfile            = open(filein,&amp;quot;rb&amp;quot;)&lt;br /&gt;
 Non              = np.fromfile(pkfile, dtype=np.int32, count=1)&lt;br /&gt;
 RTHMAXin   = np.fromfile(pkfile, dtype=np.float32, count=1)&lt;br /&gt;
 redshiftbox  = np.fromfile(pkfile, dtype=np.float32, count=1)&lt;br /&gt;
 print &amp;quot;Non = &amp;quot;, Non&lt;br /&gt;
 npkdata        = 7*Non&lt;br /&gt;
 peakdata      = np.fromfile(pkfile, dtype=np.float32, count=npkdata)&lt;br /&gt;
 peakdata      = np.reshape(peakdata,(Non,7))&lt;br /&gt;
 xpos   = peakdata[:,0]&lt;br /&gt;
 ypos   = peakdata[:,1]&lt;br /&gt;
 zpos   = peakdata[:,2]&lt;br /&gt;
 vxpos = peakdata[:,3]&lt;br /&gt;
 vypos = peakdata[:,4]&lt;br /&gt;
 vzpos = peakdata[:,5]&lt;br /&gt;
 Rth     = peakdata[:,6]&lt;br /&gt;
 Omega_M = 0.25&lt;br /&gt;
 h                = 0.7&lt;br /&gt;
 rhomean   = 2.775e11*Omega_M*h**2&lt;br /&gt;
 M               = 4.0/3*np.pi*Rth**3*rhomean&lt;br /&gt;
&lt;br /&gt;
Redshifts&lt;br /&gt;
 z=np.linspace(0,4,1000)&lt;br /&gt;
 def hubble(z):&lt;br /&gt;
     return h*100*np.sqrt(omegam*(1+z)**3+1-omegam)&lt;br /&gt;
 def drdz(z):&lt;br /&gt;
     return 3e5 / hubble(z)&lt;br /&gt;
 r  = np.cumsum(drdz(z)*(z[1]-z[0]))&lt;br /&gt;
 r -= r[0]&lt;br /&gt;
 z_to_r   = sp.interpolate.interp1d(z,r)&lt;br /&gt;
 r_to_z   = sp.interpolate.interp1d(r,z)&lt;br /&gt;
&lt;br /&gt;
Fortran:&lt;br /&gt;
 open(4,file=filein,status='old',access='stream')&lt;br /&gt;
 read(4) Npk,RTHLmax_in,boxredshift&lt;br /&gt;
 allocate(posxyz(3,nhalo))&lt;br /&gt;
 allocate(velxyz(3,nhalo))&lt;br /&gt;
 allocate(rth(nhalo))&lt;br /&gt;
 allocate(mass(nhalo))&lt;br /&gt;
 allocate(vrad(nhalo))&lt;br /&gt;
 offset_num_floats = 7*nhalo*myid&lt;br /&gt;
 read(4) ((posxyz(j,i),j=1,3),&amp;amp;&lt;br /&gt;
         (velxyz(j,i),j=1,3),&amp;amp;&lt;br /&gt;
         rth(i),i=1,nhalo)&lt;br /&gt;
 close(4)&lt;br /&gt;
&lt;br /&gt;
== Modeling ==&lt;br /&gt;
&lt;br /&gt;
=== CMB Lensing === &lt;br /&gt;
&lt;br /&gt;
Using a 'field+halo' model to generate lensing kappa maps from Gaussian random field (GRF) of density fluctuations on the past light cone. &lt;br /&gt;
&lt;br /&gt;
'''Halo Model:''' The peak patch algorithm is run on the GRF to produce a catalog of halos with [RA, Dec, redshift, velocity, mass]. The halos are assumed to have a spherically-symmetric matter distribution parameterized by a generalized NFW density profile. This contribution to the convergence from each halo is then projected onto the kappa map, appropriately weighted by the lensing kernel, W(z).&lt;br /&gt;
&amp;lt;gallery mode=packed heights=&amp;quot;300px&amp;quot;&amp;gt;&lt;br /&gt;
File:fullskykappa.png|&amp;quot;Halo only&amp;quot; full sky kappa map&lt;br /&gt;
File:flatskykappa.png|&amp;quot;Halo only&amp;quot; zoomed in kappa map&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Field Model:''' (development in progress) Lagrangian perturbation theory is used to move matter not within halos to its final Eulerian position. This field matter distribution is then added directly to the kappa map. A [260 x 260 x 60] Mpc/h slab at z=0 is shown below with all the matter moved with either first (1LPT) or second (2LPT) order Lagrangian perturbation theory, in addition to the halos found with the peak patch method (these peak patch halos are also moved with either . Shown below are the same peak patch halo distributions, but also the&lt;/div&gt;</summary>
		<author><name>Gstein</name></author>
	</entry>
	<entry>
		<id>https://mocks.cita.utoronto.ca/index.php?title=Documentation&amp;diff=212</id>
		<title>Documentation</title>
		<link rel="alternate" type="text/html" href="https://mocks.cita.utoronto.ca/index.php?title=Documentation&amp;diff=212"/>
		<updated>2018-08-24T18:36:21Z</updated>

		<summary type="html">&lt;p&gt;Gstein: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Logbooks ==&lt;br /&gt;
&lt;br /&gt;
Here are the logbooks from various WebSky related projects:&lt;br /&gt;
&lt;br /&gt;
== Software ==&lt;br /&gt;
&lt;br /&gt;
== Data ==&lt;br /&gt;
&lt;br /&gt;
[http://cita.utoronto.ca/~malvarez/research/ksz-data/ Patchy kSZ Maps]&lt;br /&gt;
&lt;br /&gt;
[https://www.dropbox.com/sh/deqz1gekpw0fapw/AABGKqqzG9wMnLP0LqFzE6i-a?dl=0/ Kappa, unlensed and lensed maps (LP)]&lt;br /&gt;
&lt;br /&gt;
[https://www.dropbox.com/s/1evuw17snfqzhwj/all.pdf?dl=0 K, Phi, unlensed, lensed PDF (LP)]&lt;br /&gt;
&lt;br /&gt;
== Transferring Data to Nersc ==&lt;br /&gt;
&lt;br /&gt;
1.) log in to nersc - $ssh &amp;lt;username&amp;gt;@edison.nersc.gov&lt;br /&gt;
 &lt;br /&gt;
2.) log into edisongrid - $ssh edisongrid&lt;br /&gt;
&lt;br /&gt;
3.) Sign into collaboration account&lt;br /&gt;
 $module load globus&lt;br /&gt;
 $myproxy-logon -s nerscca.nersc.gov    !Password is the same as your username&lt;br /&gt;
 $gsissh localhost -l cmbs4&lt;br /&gt;
&lt;br /&gt;
4.) $cd /project/projectdirs/cmbs4&lt;br /&gt;
&lt;br /&gt;
5.) ensure that the permissions are set appropriately (g+rX,o-rwx)&lt;br /&gt;
&lt;br /&gt;
6.) Update README and cmbs4 wiki for any new files you add or changes you make!&lt;br /&gt;
&lt;br /&gt;
README snippet for .npz catalogues&lt;br /&gt;
 HALO CATALOGUES:&lt;br /&gt;
 Contains (x,y,z,mass,redshift) for each halo. They are saved in the npz format of numpy (see http://docs.scipy.org/doc/numpy/reference/generated/numpy.savez.html). To load simply use&lt;br /&gt;
 halo_cat = np.load(outfile)&lt;br /&gt;
 xpk      = halo_cat[&amp;quot;xpk&amp;quot;]&lt;br /&gt;
 ypk      = halo_cat[&amp;quot;ypk&amp;quot;]&lt;br /&gt;
 zpk      = halo_cat[&amp;quot;zpk&amp;quot;] &lt;br /&gt;
 M         = halo_cat[&amp;quot;M&amp;quot;]&lt;br /&gt;
 redshift = halo_cat[&amp;quot;redshift&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
README snippet for .pksc catalogues&lt;br /&gt;
&lt;br /&gt;
Contains (x,y,z,v_x,v_y,v_z,R_TH) for each halo. The final halo catalog is a binary file with a 12 byte header, R_TH is the Lagrangian top hat radius of the halo. The conversion to mass is M_halo = 4*pi/3 * R_TH**3 * rho_bar, where rho_mean = 2.775e11*Omega_M*h**2.&lt;br /&gt;
header = (int Non, float RTHmax, float redshiftbox)&lt;br /&gt;
where Non is the total number of halos found, &lt;br /&gt;
RTHmax is the radius of the largest halo in the simulation,&lt;br /&gt;
redshiftbox is the redshift of the box, which will be negative for lightcone runs.&lt;br /&gt;
This 12 byte header is then followed by a list of Non*7 4 byte floats that represent (x_halo,y_halo,z_halo,vx_halo,vy_halo,vz_halo,Rth_halo)&lt;br /&gt;
             &lt;br /&gt;
Sample Python and Fortran code to load a datafile:&lt;br /&gt;
&lt;br /&gt;
Python: &lt;br /&gt;
 pkfile            = open(filein,&amp;quot;rb&amp;quot;)&lt;br /&gt;
 Non              = np.fromfile(pkfile, dtype=np.int32, count=1)&lt;br /&gt;
 RTHMAXin   = np.fromfile(pkfile, dtype=np.float32, count=1)&lt;br /&gt;
 redshiftbox  = np.fromfile(pkfile, dtype=np.float32, count=1)&lt;br /&gt;
 print &amp;quot;Non = &amp;quot;, Non&lt;br /&gt;
 npkdata        = 7*Non&lt;br /&gt;
 peakdata      = np.fromfile(pkfile, dtype=np.float32, count=npkdata)&lt;br /&gt;
 peakdata      = np.reshape(peakdata,(Non,7))&lt;br /&gt;
 xpos   = peakdata[:,0]&lt;br /&gt;
 ypos   = peakdata[:,1]&lt;br /&gt;
 zpos   = peakdata[:,2]&lt;br /&gt;
 vxpos = peakdata[:,3]&lt;br /&gt;
 vypos = peakdata[:,4]&lt;br /&gt;
 vzpos = peakdata[:,5]&lt;br /&gt;
 Rth     = peakdata[:,6]&lt;br /&gt;
 Omega_M = 0.25&lt;br /&gt;
 h                = 0.7&lt;br /&gt;
 rhomean   = 2.775e11*Omega_M*h**2&lt;br /&gt;
 M               = 4.0/3*np.pi*Rth**3*rhomean&lt;br /&gt;
&lt;br /&gt;
Redshifts&lt;br /&gt;
 z=np.linspace(0,4,1000)&lt;br /&gt;
 def hubble(z):&lt;br /&gt;
     return h*100*np.sqrt(omegam*(1+z)**3+1-omegam)&lt;br /&gt;
 def drdz(z):&lt;br /&gt;
     return 3e5 / hubble(z)&lt;br /&gt;
 r  = np.cumsum(drdz(z)*(z[1]-z[0]))&lt;br /&gt;
 r -= r[0]&lt;br /&gt;
 z_to_r   = sp.interpolate.interp1d(z,r)&lt;br /&gt;
 r_to_z   = sp.interpolate.interp1d(r,z)&lt;br /&gt;
&lt;br /&gt;
Fortran:&lt;br /&gt;
 open(4,file=filein,status='old',access='stream')&lt;br /&gt;
 read(4) Npk,RTHLmax_in,boxredshift&lt;br /&gt;
 allocate(posxyz(3,nhalo))&lt;br /&gt;
 allocate(velxyz(3,nhalo))&lt;br /&gt;
 allocate(rth(nhalo))&lt;br /&gt;
 allocate(mass(nhalo))&lt;br /&gt;
 allocate(vrad(nhalo))&lt;br /&gt;
 offset_num_floats = 7*nhalo*myid&lt;br /&gt;
 read(4) ((posxyz(j,i),j=1,3),&amp;amp;&lt;br /&gt;
         (velxyz(j,i),j=1,3),&amp;amp;&lt;br /&gt;
         rth(i),i=1,nhalo)&lt;br /&gt;
 close(4)&lt;br /&gt;
&lt;br /&gt;
== Modeling ==&lt;br /&gt;
&lt;br /&gt;
=== CMB Lensing === &lt;br /&gt;
&lt;br /&gt;
Using a 'field+halo' model to generate lensing kappa maps from Gaussian random field (GRF) of density fluctuations on the past light cone. &lt;br /&gt;
&lt;br /&gt;
'''Halo Model:''' The peak patch algorithm is run on the GRF to produce a catalog of halos with [RA, Dec, redshift, velocity, mass]. The halos are assumed to have a spherically-symmetric matter distribution parameterized by a generalized NFW density profile. This contribution to the convergence from each halo is then projected onto the kappa map, appropriately weighted by the lensing kernel, W(z).&lt;br /&gt;
&amp;lt;gallery mode=packed heights=&amp;quot;300px&amp;quot;&amp;gt;&lt;br /&gt;
File:fullskykappa.png|&amp;quot;Halo only&amp;quot; full sky kappa map&lt;br /&gt;
File:flatskykappa.png|&amp;quot;Halo only&amp;quot; zoomed in kappa map&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Field Model:''' (development in progress) Lagrangian perturbation theory is used to move matter not within halos to its final Eulerian position. This field matter distribution is then added directly to the kappa map. A [260 x 260 x 60] Mpc/h slab at z=0 is shown below with all the matter moved with either first (1LPT) or second (2LPT) order Lagrangian perturbation theory, in addition to the halos found with the peak patch method (these peak patch halos are also moved with either . Shown below are the same peak patch halo distributions, but also the&lt;/div&gt;</summary>
		<author><name>Gstein</name></author>
	</entry>
	<entry>
		<id>https://mocks.cita.utoronto.ca/index.php?title=MediaWiki:Mainpage&amp;diff=137</id>
		<title>MediaWiki:Mainpage</title>
		<link rel="alternate" type="text/html" href="https://mocks.cita.utoronto.ca/index.php?title=MediaWiki:Mainpage&amp;diff=137"/>
		<updated>2018-01-08T04:38:59Z</updated>

		<summary type="html">&lt;p&gt;Gstein: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;CITA Extragalactic Mocks&lt;/div&gt;</summary>
		<author><name>Gstein</name></author>
	</entry>
	<entry>
		<id>https://mocks.cita.utoronto.ca/index.php?title=MediaWiki:Mainpage&amp;diff=132</id>
		<title>MediaWiki:Mainpage</title>
		<link rel="alternate" type="text/html" href="https://mocks.cita.utoronto.ca/index.php?title=MediaWiki:Mainpage&amp;diff=132"/>
		<updated>2018-01-08T03:02:51Z</updated>

		<summary type="html">&lt;p&gt;Gstein: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The WebSky Suite of Extragalactic CMB Mocks&lt;/div&gt;</summary>
		<author><name>Gstein</name></author>
	</entry>
	<entry>
		<id>https://mocks.cita.utoronto.ca/index.php?title=MediaWiki:Mainpage&amp;diff=131</id>
		<title>MediaWiki:Mainpage</title>
		<link rel="alternate" type="text/html" href="https://mocks.cita.utoronto.ca/index.php?title=MediaWiki:Mainpage&amp;diff=131"/>
		<updated>2018-01-08T03:02:38Z</updated>

		<summary type="html">&lt;p&gt;Gstein: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The WebSky Suite of Extragalactic Mocks&lt;/div&gt;</summary>
		<author><name>Gstein</name></author>
	</entry>
	<entry>
		<id>https://mocks.cita.utoronto.ca/index.php?title=File:WebSky_header.png&amp;diff=122</id>
		<title>File:WebSky header.png</title>
		<link rel="alternate" type="text/html" href="https://mocks.cita.utoronto.ca/index.php?title=File:WebSky_header.png&amp;diff=122"/>
		<updated>2018-01-06T02:25:17Z</updated>

		<summary type="html">&lt;p&gt;Gstein: Gstein uploaded a new version of File:WebSky header.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Gstein</name></author>
	</entry>
	<entry>
		<id>https://mocks.cita.utoronto.ca/index.php?title=File:WebSky_header.png&amp;diff=121</id>
		<title>File:WebSky header.png</title>
		<link rel="alternate" type="text/html" href="https://mocks.cita.utoronto.ca/index.php?title=File:WebSky_header.png&amp;diff=121"/>
		<updated>2018-01-06T02:19:56Z</updated>

		<summary type="html">&lt;p&gt;Gstein: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Gstein</name></author>
	</entry>
	<entry>
		<id>https://mocks.cita.utoronto.ca/index.php?title=Documentation&amp;diff=118</id>
		<title>Documentation</title>
		<link rel="alternate" type="text/html" href="https://mocks.cita.utoronto.ca/index.php?title=Documentation&amp;diff=118"/>
		<updated>2017-12-15T17:13:55Z</updated>

		<summary type="html">&lt;p&gt;Gstein: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;math&amp;gt;M_{200,M} = 2.62 \times 10^{13} M_\odot&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Software ==&lt;br /&gt;
&lt;br /&gt;
== Data ==&lt;br /&gt;
&lt;br /&gt;
[http://cita.utoronto.ca/~malvarez/research/ksz-data/ Patchy kSZ Maps]&lt;br /&gt;
&lt;br /&gt;
[https://www.dropbox.com/sh/deqz1gekpw0fapw/AABGKqqzG9wMnLP0LqFzE6i-a?dl=0/ Kappa, unlensed and lensed maps (LP)]&lt;br /&gt;
&lt;br /&gt;
[https://www.dropbox.com/s/1evuw17snfqzhwj/all.pdf?dl=0 K, Phi, unlensed, lensed PDF (LP)]&lt;br /&gt;
&lt;br /&gt;
== Transferring Data to Nersc ==&lt;br /&gt;
&lt;br /&gt;
1.) log in to nersc - $ssh &amp;lt;username&amp;gt;@edison.nersc.gov&lt;br /&gt;
 &lt;br /&gt;
2.) log into edisongrid - $ssh edisongrid&lt;br /&gt;
&lt;br /&gt;
3.) Sign into collaboration account&lt;br /&gt;
 $module load globus&lt;br /&gt;
 $myproxy-logon -s nerscca.nersc.gov    !Password is the same as your username&lt;br /&gt;
 $gsissh localhost -l cmbs4&lt;br /&gt;
&lt;br /&gt;
4.) $cd /project/projectdirs/cmbs4&lt;br /&gt;
&lt;br /&gt;
5.) ensure that the permissions are set appropriately (g+rX,o-rwx)&lt;br /&gt;
&lt;br /&gt;
6.) Update README and cmbs4 wiki for any new files you add or changes you make!&lt;br /&gt;
&lt;br /&gt;
README snippet for .npz catalogues&lt;br /&gt;
 HALO CATALOGUES:&lt;br /&gt;
 Contains (x,y,z,mass,redshift) for each halo. They are saved in the npz format of numpy (see http://docs.scipy.org/doc/numpy/reference/generated/numpy.savez.html). To load simply use&lt;br /&gt;
 halo_cat = np.load(outfile)&lt;br /&gt;
 xpk      = halo_cat[&amp;quot;xpk&amp;quot;]&lt;br /&gt;
 ypk      = halo_cat[&amp;quot;ypk&amp;quot;]&lt;br /&gt;
 zpk      = halo_cat[&amp;quot;zpk&amp;quot;] &lt;br /&gt;
 M         = halo_cat[&amp;quot;M&amp;quot;]&lt;br /&gt;
 redshift = halo_cat[&amp;quot;redshift&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
README snippet for .pksc catalogues&lt;br /&gt;
&lt;br /&gt;
Contains (x,y,z,v_x,v_y,v_z,R_TH) for each halo. The final halo catalog is a binary file with a 12 byte header, R_TH is the Lagrangian top hat radius of the halo. The conversion to mass is M_halo = 4*pi/3 * R_TH**3 * rho_bar, where rho_mean = 2.775e11*Omega_M*h**2.&lt;br /&gt;
header = (int Non, float RTHmax, float redshiftbox)&lt;br /&gt;
where Non is the total number of halos found, &lt;br /&gt;
RTHmax is the radius of the largest halo in the simulation,&lt;br /&gt;
redshiftbox is the redshift of the box, which will be negative for lightcone runs.&lt;br /&gt;
This 12 byte header is then followed by a list of Non*7 4 byte floats that represent (x_halo,y_halo,z_halo,vx_halo,vy_halo,vz_halo,Rth_halo)&lt;br /&gt;
             &lt;br /&gt;
Sample Python and Fortran code to load a datafile:&lt;br /&gt;
&lt;br /&gt;
Python: &lt;br /&gt;
 pkfile            = open(filein,&amp;quot;rb&amp;quot;)&lt;br /&gt;
 Non              = np.fromfile(pkfile, dtype=np.int32, count=1)&lt;br /&gt;
 RTHMAXin   = np.fromfile(pkfile, dtype=np.float32, count=1)&lt;br /&gt;
 redshiftbox  = np.fromfile(pkfile, dtype=np.float32, count=1)&lt;br /&gt;
 print &amp;quot;Non = &amp;quot;, Non&lt;br /&gt;
 npkdata        = 7*Non&lt;br /&gt;
 peakdata      = np.fromfile(pkfile, dtype=np.float32, count=npkdata)&lt;br /&gt;
 peakdata      = np.reshape(peakdata,(Non,7))&lt;br /&gt;
 xpos   = peakdata[:,0]&lt;br /&gt;
 ypos   = peakdata[:,1]&lt;br /&gt;
 zpos   = peakdata[:,2]&lt;br /&gt;
 vxpos = peakdata[:,3]&lt;br /&gt;
 vypos = peakdata[:,4]&lt;br /&gt;
 vzpos = peakdata[:,5]&lt;br /&gt;
 Rth     = peakdata[:,6]&lt;br /&gt;
 Omega_M = 0.25&lt;br /&gt;
 h                = 0.7&lt;br /&gt;
 rhomean   = 2.775e11*Omega_M*h**2&lt;br /&gt;
 M               = 4.0/3*np.pi*Rth**3*rhomean&lt;br /&gt;
&lt;br /&gt;
Redshifts&lt;br /&gt;
 z=np.linspace(0,4,1000)&lt;br /&gt;
 def hubble(z):&lt;br /&gt;
     return h*100*np.sqrt(omegam*(1+z)**3+1-omegam)&lt;br /&gt;
 def drdz(z):&lt;br /&gt;
     return 3e5 / hubble(z)&lt;br /&gt;
 r  = np.cumsum(drdz(z)*(z[1]-z[0]))&lt;br /&gt;
 r -= r[0]&lt;br /&gt;
 z_to_r   = sp.interpolate.interp1d(z,r)&lt;br /&gt;
 r_to_z   = sp.interpolate.interp1d(r,z)&lt;br /&gt;
&lt;br /&gt;
Fortran:&lt;br /&gt;
 open(4,file=filein,status='old',access='stream')&lt;br /&gt;
 read(4) Npk,RTHLmax_in,boxredshift&lt;br /&gt;
 allocate(posxyz(3,nhalo))&lt;br /&gt;
 allocate(velxyz(3,nhalo))&lt;br /&gt;
 allocate(rth(nhalo))&lt;br /&gt;
 allocate(mass(nhalo))&lt;br /&gt;
 allocate(vrad(nhalo))&lt;br /&gt;
 offset_num_floats = 7*nhalo*myid&lt;br /&gt;
 read(4) ((posxyz(j,i),j=1,3),&amp;amp;&lt;br /&gt;
         (velxyz(j,i),j=1,3),&amp;amp;&lt;br /&gt;
         rth(i),i=1,nhalo)&lt;br /&gt;
 close(4)&lt;br /&gt;
&lt;br /&gt;
== Modeling ==&lt;br /&gt;
&lt;br /&gt;
=== CMB Lensing === &lt;br /&gt;
&lt;br /&gt;
Using a 'field+halo' model to generate lensing kappa maps from Gaussian random field (GRF) of density fluctuations on the past light cone. &lt;br /&gt;
&lt;br /&gt;
'''Halo Model:''' The peak patch algorithm is run on the GRF to produce a catalog of halos with [RA, Dec, redshift, velocity, mass]. The halos are assumed to have a spherically-symmetric matter distribution parameterized by a generalized NFW density profile. This contribution to the convergence from each halo is then projected onto the kappa map, appropriately weighted by the lensing kernel, W(z).&lt;br /&gt;
&amp;lt;gallery mode=packed heights=&amp;quot;300px&amp;quot;&amp;gt;&lt;br /&gt;
File:fullskykappa.png|&amp;quot;Halo only&amp;quot; full sky kappa map&lt;br /&gt;
File:flatskykappa.png|&amp;quot;Halo only&amp;quot; zoomed in kappa map&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Field Model:''' (development in progress) Lagrangian perturbation theory is used to move matter not within halos to its final Eulerian position. This field matter distribution is then added directly to the kappa map. A [260 x 260 x 60] Mpc/h slab at z=0 is shown below with all the matter moved with either first (1LPT) or second (2LPT) order Lagrangian perturbation theory, in addition to the halos found with the peak patch method (these peak patch halos are also moved with either . Shown below are the same peak patch halo distributions, but also the&lt;/div&gt;</summary>
		<author><name>Gstein</name></author>
	</entry>
	<entry>
		<id>https://mocks.cita.utoronto.ca/index.php?title=Documentation&amp;diff=117</id>
		<title>Documentation</title>
		<link rel="alternate" type="text/html" href="https://mocks.cita.utoronto.ca/index.php?title=Documentation&amp;diff=117"/>
		<updated>2017-12-15T17:12:55Z</updated>

		<summary type="html">&lt;p&gt;Gstein: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;math&amp;gt;M_{200,M} = 2.62\ \times 10^{13} M_\odot&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Software ==&lt;br /&gt;
&lt;br /&gt;
== Data ==&lt;br /&gt;
&lt;br /&gt;
[http://cita.utoronto.ca/~malvarez/research/ksz-data/ Patchy kSZ Maps]&lt;br /&gt;
&lt;br /&gt;
[https://www.dropbox.com/sh/deqz1gekpw0fapw/AABGKqqzG9wMnLP0LqFzE6i-a?dl=0/ Kappa, unlensed and lensed maps (LP)]&lt;br /&gt;
&lt;br /&gt;
[https://www.dropbox.com/s/1evuw17snfqzhwj/all.pdf?dl=0 K, Phi, unlensed, lensed PDF (LP)]&lt;br /&gt;
&lt;br /&gt;
== Transferring Data to Nersc ==&lt;br /&gt;
&lt;br /&gt;
1.) log in to nersc - $ssh &amp;lt;username&amp;gt;@edison.nersc.gov&lt;br /&gt;
 &lt;br /&gt;
2.) log into edisongrid - $ssh edisongrid&lt;br /&gt;
&lt;br /&gt;
3.) Sign into collaboration account&lt;br /&gt;
 $module load globus&lt;br /&gt;
 $myproxy-logon -s nerscca.nersc.gov    !Password is the same as your username&lt;br /&gt;
 $gsissh localhost -l cmbs4&lt;br /&gt;
&lt;br /&gt;
4.) $cd /project/projectdirs/cmbs4&lt;br /&gt;
&lt;br /&gt;
5.) ensure that the permissions are set appropriately (g+rX,o-rwx)&lt;br /&gt;
&lt;br /&gt;
6.) Update README and cmbs4 wiki for any new files you add or changes you make!&lt;br /&gt;
&lt;br /&gt;
README snippet for .npz catalogues&lt;br /&gt;
 HALO CATALOGUES:&lt;br /&gt;
 Contains (x,y,z,mass,redshift) for each halo. They are saved in the npz format of numpy (see http://docs.scipy.org/doc/numpy/reference/generated/numpy.savez.html). To load simply use&lt;br /&gt;
 halo_cat = np.load(outfile)&lt;br /&gt;
 xpk      = halo_cat[&amp;quot;xpk&amp;quot;]&lt;br /&gt;
 ypk      = halo_cat[&amp;quot;ypk&amp;quot;]&lt;br /&gt;
 zpk      = halo_cat[&amp;quot;zpk&amp;quot;] &lt;br /&gt;
 M         = halo_cat[&amp;quot;M&amp;quot;]&lt;br /&gt;
 redshift = halo_cat[&amp;quot;redshift&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
README snippet for .pksc catalogues&lt;br /&gt;
&lt;br /&gt;
Contains (x,y,z,v_x,v_y,v_z,R_TH) for each halo. The final halo catalog is a binary file with a 12 byte header, R_TH is the Lagrangian top hat radius of the halo. The conversion to mass is M_halo = 4*pi/3 * R_TH**3 * rho_bar, where rho_mean = 2.775e11*Omega_M*h**2.&lt;br /&gt;
header = (int Non, float RTHmax, float redshiftbox)&lt;br /&gt;
where Non is the total number of halos found, &lt;br /&gt;
RTHmax is the radius of the largest halo in the simulation,&lt;br /&gt;
redshiftbox is the redshift of the box, which will be negative for lightcone runs.&lt;br /&gt;
This 12 byte header is then followed by a list of Non*7 4 byte floats that represent (x_halo,y_halo,z_halo,vx_halo,vy_halo,vz_halo,Rth_halo)&lt;br /&gt;
             &lt;br /&gt;
Sample Python and Fortran code to load a datafile:&lt;br /&gt;
&lt;br /&gt;
Python: &lt;br /&gt;
 pkfile            = open(filein,&amp;quot;rb&amp;quot;)&lt;br /&gt;
 Non              = np.fromfile(pkfile, dtype=np.int32, count=1)&lt;br /&gt;
 RTHMAXin   = np.fromfile(pkfile, dtype=np.float32, count=1)&lt;br /&gt;
 redshiftbox  = np.fromfile(pkfile, dtype=np.float32, count=1)&lt;br /&gt;
 print &amp;quot;Non = &amp;quot;, Non&lt;br /&gt;
 npkdata        = 7*Non&lt;br /&gt;
 peakdata      = np.fromfile(pkfile, dtype=np.float32, count=npkdata)&lt;br /&gt;
 peakdata      = np.reshape(peakdata,(Non,7))&lt;br /&gt;
 xpos   = peakdata[:,0]&lt;br /&gt;
 ypos   = peakdata[:,1]&lt;br /&gt;
 zpos   = peakdata[:,2]&lt;br /&gt;
 vxpos = peakdata[:,3]&lt;br /&gt;
 vypos = peakdata[:,4]&lt;br /&gt;
 vzpos = peakdata[:,5]&lt;br /&gt;
 Rth     = peakdata[:,6]&lt;br /&gt;
 Omega_M = 0.25&lt;br /&gt;
 h                = 0.7&lt;br /&gt;
 rhomean   = 2.775e11*Omega_M*h**2&lt;br /&gt;
 M               = 4.0/3*np.pi*Rth**3*rhomean&lt;br /&gt;
&lt;br /&gt;
Redshifts&lt;br /&gt;
 z=np.linspace(0,4,1000)&lt;br /&gt;
 def hubble(z):&lt;br /&gt;
     return h*100*np.sqrt(omegam*(1+z)**3+1-omegam)&lt;br /&gt;
 def drdz(z):&lt;br /&gt;
     return 3e5 / hubble(z)&lt;br /&gt;
 r  = np.cumsum(drdz(z)*(z[1]-z[0]))&lt;br /&gt;
 r -= r[0]&lt;br /&gt;
 z_to_r   = sp.interpolate.interp1d(z,r)&lt;br /&gt;
 r_to_z   = sp.interpolate.interp1d(r,z)&lt;br /&gt;
&lt;br /&gt;
Fortran:&lt;br /&gt;
 open(4,file=filein,status='old',access='stream')&lt;br /&gt;
 read(4) Npk,RTHLmax_in,boxredshift&lt;br /&gt;
 allocate(posxyz(3,nhalo))&lt;br /&gt;
 allocate(velxyz(3,nhalo))&lt;br /&gt;
 allocate(rth(nhalo))&lt;br /&gt;
 allocate(mass(nhalo))&lt;br /&gt;
 allocate(vrad(nhalo))&lt;br /&gt;
 offset_num_floats = 7*nhalo*myid&lt;br /&gt;
 read(4) ((posxyz(j,i),j=1,3),&amp;amp;&lt;br /&gt;
         (velxyz(j,i),j=1,3),&amp;amp;&lt;br /&gt;
         rth(i),i=1,nhalo)&lt;br /&gt;
 close(4)&lt;br /&gt;
&lt;br /&gt;
== Modeling ==&lt;br /&gt;
&lt;br /&gt;
=== CMB Lensing === &lt;br /&gt;
&lt;br /&gt;
Using a 'field+halo' model to generate lensing kappa maps from Gaussian random field (GRF) of density fluctuations on the past light cone. &lt;br /&gt;
&lt;br /&gt;
'''Halo Model:''' The peak patch algorithm is run on the GRF to produce a catalog of halos with [RA, Dec, redshift, velocity, mass]. The halos are assumed to have a spherically-symmetric matter distribution parameterized by a generalized NFW density profile. This contribution to the convergence from each halo is then projected onto the kappa map, appropriately weighted by the lensing kernel, W(z).&lt;br /&gt;
&amp;lt;gallery mode=packed heights=&amp;quot;300px&amp;quot;&amp;gt;&lt;br /&gt;
File:fullskykappa.png|&amp;quot;Halo only&amp;quot; full sky kappa map&lt;br /&gt;
File:flatskykappa.png|&amp;quot;Halo only&amp;quot; zoomed in kappa map&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Field Model:''' (development in progress) Lagrangian perturbation theory is used to move matter not within halos to its final Eulerian position. This field matter distribution is then added directly to the kappa map. A [260 x 260 x 60] Mpc/h slab at z=0 is shown below with all the matter moved with either first (1LPT) or second (2LPT) order Lagrangian perturbation theory, in addition to the halos found with the peak patch method (these peak patch halos are also moved with either . Shown below are the same peak patch halo distributions, but also the&lt;/div&gt;</summary>
		<author><name>Gstein</name></author>
	</entry>
	<entry>
		<id>https://mocks.cita.utoronto.ca/index.php?title=File:Fullsky_z4pt5_tsz_halos.png&amp;diff=96</id>
		<title>File:Fullsky z4pt5 tsz halos.png</title>
		<link rel="alternate" type="text/html" href="https://mocks.cita.utoronto.ca/index.php?title=File:Fullsky_z4pt5_tsz_halos.png&amp;diff=96"/>
		<updated>2017-12-14T21:33:22Z</updated>

		<summary type="html">&lt;p&gt;Gstein: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Gstein</name></author>
	</entry>
	<entry>
		<id>https://mocks.cita.utoronto.ca/index.php?title=File:Fullsky_z4pt5_ksz_halos.png&amp;diff=95</id>
		<title>File:Fullsky z4pt5 ksz halos.png</title>
		<link rel="alternate" type="text/html" href="https://mocks.cita.utoronto.ca/index.php?title=File:Fullsky_z4pt5_ksz_halos.png&amp;diff=95"/>
		<updated>2017-12-14T21:33:06Z</updated>

		<summary type="html">&lt;p&gt;Gstein: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Gstein</name></author>
	</entry>
	<entry>
		<id>https://mocks.cita.utoronto.ca/index.php?title=File:Fullsky_z4pt5_kappa.png&amp;diff=94</id>
		<title>File:Fullsky z4pt5 kappa.png</title>
		<link rel="alternate" type="text/html" href="https://mocks.cita.utoronto.ca/index.php?title=File:Fullsky_z4pt5_kappa.png&amp;diff=94"/>
		<updated>2017-12-14T21:32:51Z</updated>

		<summary type="html">&lt;p&gt;Gstein: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Gstein</name></author>
	</entry>
	<entry>
		<id>https://mocks.cita.utoronto.ca/index.php?title=File:Fullsky_z4pt5_cmb_lensed.png&amp;diff=93</id>
		<title>File:Fullsky z4pt5 cmb lensed.png</title>
		<link rel="alternate" type="text/html" href="https://mocks.cita.utoronto.ca/index.php?title=File:Fullsky_z4pt5_cmb_lensed.png&amp;diff=93"/>
		<updated>2017-12-14T21:32:35Z</updated>

		<summary type="html">&lt;p&gt;Gstein: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Gstein</name></author>
	</entry>
	<entry>
		<id>https://mocks.cita.utoronto.ca/index.php?title=File:Fullsky_z4pt5_cmb_diff.png&amp;diff=92</id>
		<title>File:Fullsky z4pt5 cmb diff.png</title>
		<link rel="alternate" type="text/html" href="https://mocks.cita.utoronto.ca/index.php?title=File:Fullsky_z4pt5_cmb_diff.png&amp;diff=92"/>
		<updated>2017-12-14T21:32:16Z</updated>

		<summary type="html">&lt;p&gt;Gstein: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Gstein</name></author>
	</entry>
	<entry>
		<id>https://mocks.cita.utoronto.ca/index.php?title=File:Fullsky_z4pt5_cib_halos.png&amp;diff=91</id>
		<title>File:Fullsky z4pt5 cib halos.png</title>
		<link rel="alternate" type="text/html" href="https://mocks.cita.utoronto.ca/index.php?title=File:Fullsky_z4pt5_cib_halos.png&amp;diff=91"/>
		<updated>2017-12-14T21:31:56Z</updated>

		<summary type="html">&lt;p&gt;Gstein: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Gstein</name></author>
	</entry>
	<entry>
		<id>https://mocks.cita.utoronto.ca/index.php?title=File:Fullsky_z4pt5_cib_2lpt.png&amp;diff=90</id>
		<title>File:Fullsky z4pt5 cib 2lpt.png</title>
		<link rel="alternate" type="text/html" href="https://mocks.cita.utoronto.ca/index.php?title=File:Fullsky_z4pt5_cib_2lpt.png&amp;diff=90"/>
		<updated>2017-12-14T21:31:31Z</updated>

		<summary type="html">&lt;p&gt;Gstein: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Gstein</name></author>
	</entry>
</feed>