You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+38-22Lines changed: 38 additions & 22 deletions
Original file line number
Diff line number
Diff line change
@@ -28,22 +28,19 @@ This will install topsy and its dependencies (including `pynbody` itself) into
28
28
your current python environment. (If it fails, check that you have python 3.10
29
29
or later, and `pip` is itself up-to-date using `pip install -U pip`.)
30
30
31
-
As usual, you can also install direct from github, e.g.
32
-
33
-
```
34
-
pip install git+https://github.com/pynbody/topsy
35
-
```
31
+
### Alternative 1: install into isolated environment using pipx
36
32
37
-
Or clone the repository and install for development using
33
+
You can also install `topsy` into its own isolated environment using[pipx](https://pypi.org/project/pipx/):
38
34
39
35
```
40
-
pip install -e .
36
+
pipx install topsy
41
37
```
42
38
43
-
from inside the cloned repository.
39
+
The command line tool will now be available, but you won't have access to the `topsy` package from your existing python environment. This can be useful if you don't want to risk disturbing anything.
44
40
45
-
If you want to play with `topsy` without disturbing your current installation,
46
-
I recommend using `venv`:
41
+
### Alternative 2: install into new environment using venv and pip
42
+
43
+
If you want to play with `topsy` without disturbing your existing installation, but also want to be able to use `topsy` from python scripts or jupyter etc, I recommend using `venv`:
### Alternative 3: install unreleased versions or contribute to development
65
+
66
+
As usual, you can also install direct from github, e.g.
67
+
68
+
```
69
+
pip install git+https://github.com/pynbody/topsy
70
+
```
71
+
72
+
Or clone the repository and install for development using
73
+
74
+
```
75
+
pip install -e .
76
+
```
77
+
78
+
from inside the cloned repository.
79
+
80
+
81
+
67
82
68
83
Trying it out
69
84
-------------
70
85
71
-
*Quick start: if you just want to try it out and you don't have a
86
+
### Very quick start
87
+
88
+
Once `topsy` is installed, if you just want to try it out and you don't have a
72
89
suitable simulation snapshot to hand, you can download some
73
90
from the [tangos tutorial datasets (4.8GB)](http://ftp.star.ucl.ac.uk/~app/tangos/tutorial_changa.tar.gz).
74
91
You need to untar them (`tar -xzf tutorial_changa.tar.gz` from your command line), then
75
92
you can type `topsy pioneer50h128.1536gst1.bwK1.000832` to visualise that file's
76
-
dark matter content.*
93
+
dark matter content.
94
+
95
+
### More detailed description
77
96
78
-
*Long version:* The package provides one simple command called `topsy`, to be
79
-
called straight from your shell. Pass `topsy` the path to the
80
-
simulation that you wish to visualise.
97
+
If using from the command line, pass `topsy` the path to the simulation that you wish to visualise.
81
98
82
99
You can (and probably should) also
83
100
tell it what to center on using the `-c` flag, to which valid arguments are:
@@ -88,11 +105,11 @@ tell it what to center on using the `-c` flag, to which valid arguments are:
88
105
*`-c all` (uses the shrink sphere center on all particles in the file)
89
106
90
107
By default, it will show you dark matter particles. To change this pass `-p gas` to show gas particles or `-p star` for
91
-
stars.
108
+
stars. Note that the particle type _cannot_ be changed once the window is open (although you can open a separate window for each particle type; see below).
92
109
93
110
If your particles have other quantities defined on them (such as `temp` for gas particles), you can view the
94
-
density-weighted average quantity by passing `-q temp`, or by selecting it via the main window controls
95
-
(see below).
111
+
density-weighted average quantity by passing `-q temp`. The quantity to visualise can also be changed by selecting it via the main window controls
112
+
(see below).
96
113
97
114
To open more than one visualisation window on different files or with different parameters, you can
98
115
pass multiple groups of parameters separated by `+`, for example to see separate views of the gas and
@@ -107,9 +124,7 @@ You can choose to link the rotation/zoom of multiple views using the toolbar (se
107
124
Controls in the main window
108
125
---------------------------
109
126
110
-
If everything works, a window will pop up with a beautiful rendering of your simulation. Make sure the window
111
-
is in focus (for some reason on MacOS I sometimes have to switch to another application then back to
112
-
python to get this to work). Then you can use the following controls:
127
+
The view in the `topsy` window can be manipulated as follows:
113
128
114
129
* To spin around the centre, drag the mouse.
115
130
* To zoom in and out, use the mouse scroll wheel.
@@ -155,4 +170,5 @@ vis.canvas
155
170
156
171
This loads your data into `f`, performs some centering, creates the `topsy` viewer and then the final line (`vis.canvas`) instructs `jupyter` to bring up the interactive widget.
157
172
158
-
Note that you can interact with this widget in exactly the same way as the native window produced by `topsy`. Additionally, you can manipulate things on the fly. For example, you can type `vis.quantity_name = 'temp'` to immediately switch to viewing temperature (compare with the `-q` flag above).
173
+
Note that you can interact with this widget in exactly the same way as the native window produced by `topsy`. Additionally, you can manipulate things on the fly. For example, you can type `vis.quantity_name = 'temp'` to immediately switch to viewing temperature (compare with the `-q` flag above). To switch back to a density projection, use `vis.quantity_name = None` (_not_`vis.quantity_name='rho'` which renders an average density rather than a projected density).
0 commit comments