Skip to content

Getting started

Laura S. Mendoza edited this page Sep 13, 2019 · 2 revisions

We suppose that tofu is installed in your machine (or on the server you are using).

  • Open ipython, from your terminal:

$ ipython

starting ipython

Note: you might have warnings showing up (like in the image above), just ignore them

  • Load tofu:

import tofu as tf

Note: Again, you might have warnings showing up, just ignore them

  • Create your first configuration: tofu has some configurations pre-defined for you to try.

configB2 = tf.geom.utils.create_config("B2")

A configuration is a geometry: the device, its structures, and so on.

  • Let's see the configuration

configB2.plot()

you should get

Configuration B2

  • Now let's create a 1D camera and plot it
import numpy as np
cam = tf.geom.utils.create_CamLOS1D(config=configB2, P=[3.4,0,0], N12=100, F=0.1, D12=0.1, angs=[np.pi,0,0], Name='', Exp='', Diag='')
cam.plot_touch()
  • And a 2D camera and plot it
import numpy as np
cam2d = tf.geom.utils.create_CamLOS1D(config=configB2, P=[3.4,0,0], N12=100, F=0.1, D12=0.1, angs=[np.pi,0,0], Name='', Exp='', Diag='')
cam2d.plot_touch()

You should get the image below

Cam2d

Now it is up to you

You can play with the functions parameters (change the cameras direction, refinement, aperture), with the plots (many are interactive) or even create you own configuration !

Clone this wiki locally