<commit_before>.. ipyvolume documentation master file, created by
   sphinx-quickstart on Wed Jan 18 15:42:24 2017.
   You can adapt this file completely to your liking, but it should at least
   contain the root `toctree` directive.

Ipyvolume
=========

IPyvolume is a Python library to visualize 3d volumes (in the Jupyter notebook), with minimal configuration and effort. It is currently pre-alpha, use at own risk. IPyvolume's *volshow* is to 3d arrays what matplotlib's imshow is to 2d arrays.


Examples
========
.. ipywidgets-setup::

   from ipywidgets import VBox, jsdlink, IntSlider, Button
   import ipyvolume
   import numpy as np

Generated volume
----------------
.. ipywidgets-display::
   import numpy as np
   V = np.zeros((128,128,128)) # our 3d array
   # outer box
   V[30:-30,30:-30,30:-30] = 0.75
   V[35:-35,35:-35,35:-35] = 0.0
   # inner box
   V[50:-50,50:-50,50:-50] = 0.25
   V[55:-55,55:-55,55:-55] = 0.0
   #V[10:30,10:30,10:30] = 0.5
   # for normalization
   V[0,0,0] = 1
   ipyvolume.volshow(V, opacity1=0.03, level1=0.25,
                  opacity2=0.03, level2=0.75, opacity3=0)

Builtin funtional examples
--------------------------
.. ipywidgets-display::

    ipyvolume.example_ylm()

Dataset: Aquarius A2 - pure dark matter simulation
--------------------------------------------------

.. ipywidgets-display::

   aqa2 = ipyvolume.datasets.aquariusA2.fetch()
   ipyvolume.volshow(aqa2.data.T, lighting=True,
                  level1=0.16, opacity1=0.06,
                  level2=0.25, opacity2=0.06,
                  level3=0.45, opacity3=0.06)

Dataset: Helmi & de Zeeuw 2000
------------------------------

.. ipywidgets-display::

   hdz2000 = ipyvolume.datasets.hdz2000.fetch()
   ipyvolume.volshow(hdz2000.data.T, lighting=True, level1=0.6, level2=0.8, level3=0.9, opacity2=0.03)

Use with vaex<commit_msg>try without lighting<commit_after>.. ipyvolume documentation master file, created by
   sphinx-quickstart on Wed Jan 18 15:42:24 2017.
   You can adapt this file completely to your liking, but it should at least
   contain the root `toctree` directive.

Ipyvolume
=========

IPyvolume is a Python library to visualize 3d volumes (in the Jupyter notebook), with minimal configuration and effort. It is currently pre-alpha, use at own risk. IPyvolume's *volshow* is to 3d arrays what matplotlib's imshow is to 2d arrays.


Examples
========
.. ipywidgets-setup::

   from ipywidgets import VBox, jsdlink, IntSlider, Button
   import ipyvolume
   import numpy as np

Generated volume
----------------
.. ipywidgets-display::
   import numpy as np
   V = np.zeros((128,128,128)) # our 3d array
   # outer box
   V[30:-30,30:-30,30:-30] = 0.75
   V[35:-35,35:-35,35:-35] = 0.0
   # inner box
   V[50:-50,50:-50,50:-50] = 0.25
   V[55:-55,55:-55,55:-55] = 0.0
   #V[10:30,10:30,10:30] = 0.5
   # for normalization
   V[0,0,0] = 1
   ipyvolume.volshow(V, opacity1=0.03, level1=0.25,
                  opacity2=0.03, level2=0.75, opacity3=0)

Builtin funtional examples
--------------------------
.. ipywidgets-display::

    ipyvolume.example_ylm()

Dataset: Aquarius A2 - pure dark matter simulation
--------------------------------------------------

.. ipywidgets-display::

   aqa2 = ipyvolume.datasets.aquariusA2.fetch()
   ipyvolume.volshow(aqa2.data.T, lighting=True,
                  level1=0.16, opacity1=0.06,
                  level2=0.25, opacity2=0.06,
                  level3=0.45, opacity3=0.06)

Dataset: Helmi & de Zeeuw 2000
------------------------------

.. ipywidgets-display::

   hdz2000 = ipyvolume.datasets.hdz2000.fetch()
   ipyvolume.volshow(hdz2000.data.T)

Use with vaex
{'fraction_non_alphanumeric': 0.18700301617768028, 'fraction_numerical': 0.09295311214697011, 'mean_word_length': 2.4029850746268657, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '473148', 'n_tokens_mistral': 1452, 'n_tokens_neox': 1250, 'n_words': 324}