<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 BORG SDSS data products
borg_sdss_origami package
Authors
Step1:  To access the 3D structure maps use
Step2:  Individual voxels in this 3D volumetric data cube can be accessed as follows
Step3:  where i,j and k index voxel positions along the x,y and z axes respectively. All indices run from 0 to 255.
The ranges describing the extent of the cubic cartesian volume along the x,y and z axes can be accessed as follows
Step4:  Units are Mpc/h.
(Note that all the maps that are part of the BORG SDSS data products have consistent coordinate systems. The coordinate transform to change from Cartesian to spherical coordinates and vice versa is given in appendix B of Jasche et al. 2015).
Example plot
The following code can be used to reproduce figure 8 (bottom row) in Leclercq et al. (2017).
<ASSISTANT_TASK:>
Python Code:
import numpy as np
origami = np.load('borg_sdss_origami.npz')
Explanation: BORG SDSS data products
borg_sdss_origami package
Authors: Florent Leclercq, Jens Jasche, Guilhem Lavaux, Benjamin Wandelt, Will Percival
Last update: 09/10/2018
This package contains the maps obtained by Leclercq et al. (2017), who performed a Bayesian analysis of the cosmic web in the SDSS volume.
The results are four probabilistic maps of the voids, sheets, filaments, and clusters. Structures are defined using the DIVA algorithm (Lavaux & Wandelt 2010). Data are provided in terms of a standard 3D numpy array and can easily be accessed and processed using python.
For further details on the data and employed methods please consult Leclercq et al. (2017) (reference below).
File content
This package consists of two files:
* borg_sdss_origami.ipynb: The file you are currently reading.
* borg_sdss_origami.tar.gz: Archive available on GitHub LFS and on the author's website.
The archive borg_sdss_origami.tar.gz can be extracted using
bash
tar -xzf borg_sdss_origami.tar.gz
It contains the file borg_sdss_origami.npz.
Usage
Loading and accessing the data
The file borg_sdss_origami.npz contains the probabilistic structure types maps in a standard uncompressed .npz format. To load and process the data execute the following commands:
End of explanation
#3D probabilistic maps for ORIGAMI structures
voids=origami['voids']
sheets=origami['sheets']
filaments=origami['filaments']
clusters=origami['clusters']
Explanation: To access the 3D structure maps use:
End of explanation
k=10;j=127;i=243
voids_ijk=voids[k,j,i]
Explanation: Individual voxels in this 3D volumetric data cube can be accessed as follows:
End of explanation
#Minimum and maximum position along the x-axis in Mpc/h
xmin=origami['ranges'][0]
xmax=origami['ranges'][1]
#Minimum and maximum position along the y-axis in Mpc/h
ymin=origami['ranges'][2]
ymax=origami['ranges'][3]
#Minimum and maximum position along the z-axis in Mpc/h
zmin=origami['ranges'][4]
zmax=origami['ranges'][5]
Explanation: where i,j and k index voxel positions along the x,y and z axes respectively. All indices run from 0 to 255.
The ranges describing the extent of the cubic cartesian volume along the x,y and z axes can be accessed as follows:
End of explanation
from matplotlib import pyplot as plt
%matplotlib inline
f, ((ax1, ax2), (ax3, ax4)) = plt.subplots(2, 2, sharex='row', sharey='col', figsize=(12,12))
ax1.imshow(voids[:,:,128], origin='lower', extent=[ymin,ymax,zmin,zmax], vmin=0., vmax=1., cmap="viridis")
ax1.set_title("voids")
ax2.imshow(sheets[:,:,128], origin='lower', extent=[ymin,ymax,zmin,zmax], vmin=0., vmax=1., cmap="viridis")
ax2.set_title("sheets")
ax3.imshow(filaments[:,:,128], origin='lower', extent=[ymin,ymax,zmin,zmax], vmin=0., vmax=1., cmap="viridis")
ax3.set_title("filaments")
ax4.imshow(clusters[:,:,128], origin='lower', extent=[ymin,ymax,zmin,zmax], vmin=0., vmax=1., cmap="viridis")
ax4.set_title("clusters")
plt.show()
Explanation: Units are Mpc/h.
(Note that all the maps that are part of the BORG SDSS data products have consistent coordinate systems. The coordinate transform to change from Cartesian to spherical coordinates and vice versa is given in appendix B of Jasche et al. 2015).
Example plot
The following code can be used to reproduce figure 8 (bottom row) in Leclercq et al. (2017).
End of explanation
<END_TASK>