Tutorial: CinemasciΒΆ
This tutorial uses the Supercomputng Cinema tutorial.
The jupyter notebook workflow needs the following installed:
Python 3.7
or abovepandas
,numpy
os
,shutil
cinemasci v1.4
openCV 4.4
(opencv-python
)skimage
(scikit-image
)notebook
,jupyterLab
Start by cloning the full tutorial repository and navigating to the pngviewer subdirectory:
$ git clone https://github.com/cinemascience/cinema_tutorial_2020-SC $ cd cinema_tutorial_2020-SC/cinema_jnc/pngviewer $ jupyter notebook
In the jupyter notebook, open cinema_tutorial.ipynb
. The first cell, Fig. 7 uses cinemasci to load a volume Cinema database from the Nyx cosmology simulation show the formation of dark matter halos in the universe over time. The sliders can be used to select the phi and theta view angles and to explore the database over time.
The second cell loads a Cinema database with two slices of the Nyx simulation (denoted 7 and 12) over 18 time steps, Fig. 8.
The next cell, Fig. 9, runs an image-based analysis using the Python libraries, OpenCV and skimage. The Cinema database CSV file is loaded into a pandas dataframe for easy manipulation. The image statistics and output image names are saved into new lists.
Finally, Fig. 10, the image statistics and output images names are added to the original dataframe and reordered per CinemaScience Specifications to create the new Cinema database. The workflow finishes by launching a HTML file in the browser to view the databases in the workflow.
Note
To use browser based viewers, you need to allow local file access. See A Note on Browser Security for more information.
The CinemaScience GitHub page and the CinemaScience website are useful sources for more information and ideas.