YTAn introduction

Contents
What is yt?
Installing yt
Using yt
> yt from the command line
yt with the iPython notebook
scripting yt
yt’s Cookbook

What is yt?
simulation datayt

imagesplotsEnzo
FlashRamses
Orion

simplify data

What is yt?
Analysis basics:(Plots you always need to create)

Very easy to makeSlices, projections, 2D plots, 1D profiles....

What is yt?
Advanced tools:(Complicated analysis in easy-to-use routines)

e.g. Dark matter halo finder and gas clump finder,‘Synthetic observations’ with Sunrise (radiative transfer)
Calculate star formation rates in any region

What is yt?
Use as part of your own analysis programmes
e.g. easily view new properties inimages, plots etc(escape velocity, density2, mass x time,
dinosaurs/cm3 ...)
e.g. make data simple

1000s of grids...

1 grid over any
volumeInstalling yt
Let’s do this together....

Can everyone connect to the WWW?

Installing yt
yt webpage:
http://yt-project.org

Download installation script
and run...
./install_script.sh

Installing yt
install_script.sh

installs all necessarypackages

very friendly!

Installing yt
install_script.shtimeFinished!

Installing yt> source yt-x86_64/bin/activate

path to yt> yt -hyt command line options

Command line yt
Quickest way to use yt

Command line yt(yt)> cd workshop2014(yt)> yt stats sample_data/IsolatedGravity/galaxy0030/galaxy0030

Enzo data output# AMR levels

Smallest cell(in different units)xCommand line yt(yt)> yt plot -p -g Density -a 2 sample_data/IsolatedGravity/galaxy0030/galaxy0030

projectionZf (x, y, z)dx

2D image, integrated
along 1 axis

fielde.g. Density
TotalEnergy
PressureSoundSpeed.
.
.

Enzo dataaxis
y=1

x=0
z=2

Command line yt(yt)> yt plot -p -g Density -a 2 sample_data/IsolatedGravity/galaxy0030/galaxy0030(yt)>cd frames/image!
But .... how do we view it?

Command line yt
If data is local, viewing the image
is easy!

dataterminal

e.g. (yt)>display galaxy0030_Projection_z_density_Density.png
If data is not local....

terminal

Can use scp ....

data(e.g. conival)e.g.

(yt)>scp tasker@conival:workshop2014/frames/
galaxy0030_Projection_z_density_Density.png

But this can be slow

Command line yt(yt)> yt upload_image frames/
galaxy0030_Projection_z_density_Density.png

WWWUpload to imgur.com
Easy to view,easy to share

Command line yt
Image changes(yt)> yt plot -h

image options

Command line yt
Image changese.g.
(yt)> yt plot --colormap Accent -p -g Density -a 2
sample_data/IsolatedGravity/galaxy0030/galaxy0030

Command line yt
Image changes

color maps

http://yt-project.org/docs/dev/visualizing/colormaps/index.html

Command line yt
Mapserver(yt)> yt mapserver -p -a 2 sample_data/IsolatedGravity/galaxy0030/galaxy0030

WWW

Command line yt
Mapserver(yt)> yt mapserver -p -a 2 sample_data/IsolatedGravity/galaxy0030/galaxy0030

WWW

iPython notebook
Command line is quick
but hard to saveand share
Let’s try iPython notebook:yt in your web browser

iPython notebook(yt)> yt notebook

any password OKdata
if data is local, copy
WWW into browser

iPython notebook
dataterminal

if data is not local ...

(yt)> ~Cssh > -L88XX:localhost:88XX

Then go to:
http://127.0.0.1:8888/

in web browser

iPython notebook

enter password

pushiPython notebook

load yt

shift + enterload data

field
Create projected imageaxisiPython notebook
show image

iPython notebook
save notebook for later!

iPython notebook
save notebook for later!

iPython notebook
Let’s try a bigger example
yt-project.org/docs/3.0

push

simple visualization

iPython notebook

doScripts
Command line & iPython notebook
are great for quick analysis...
But what if you want repeat thesame commands 100s of times?

or write a longer programme?

Scripts
Let’s write a script:(yt) > emacs -nw simple_projection.py

any text editor, e.g. emacs, vim ....

save thisScripts(yt)> iyt==================| Welcome to yt! |==================
In [1]: execfile(“simple_projection.py”)
In [2]: exit()ls
yt upload_image galaxy0030_Projection_z_Density.png

Scripts
What about other plots?
yt-project.org/docs/3.0‘The Cookbook’push

Many examples!
Let’s try ‘Simple Phase Plots’Scripts

Scripts(yt)> iyt==================| Welcome to yt! |==================
In [1]: execfile(“simple_phase.py”)
In [2]: exit()

The docs
Still not enough information?

yt-project.org/docs/3.0

The documentation (docs) contain much more!

The docs
e.g. let’s modify an image

visualizing data

The docs
e.g. let’s modify an image

visualizing data
Plot
Modification
Mechanisms

The docs
e.g. let’s modify an image

The docs
Also very very useful ...

The docs
Also very very useful ...

SummaryYou can run yt by.....
the command line: very quick!
with the iPython notebook:easy to save and share
like an online lab bookscripts:

great for repeating jobs
best for more complicated programmes

Practice running examples from the docs
create: A slice
A radial profile