Skip to content

Commit 9a0ed0c

Browse files
committed
Update README.md
1 parent 96d0aed commit 9a0ed0c

File tree

1 file changed

+38
-22
lines changed

1 file changed

+38
-22
lines changed

README.md

Lines changed: 38 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -28,22 +28,19 @@ This will install topsy and its dependencies (including `pynbody` itself) into
2828
your current python environment. (If it fails, check that you have python 3.10
2929
or later, and `pip` is itself up-to-date using `pip install -U pip`.)
3030

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
3632

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/):
3834

3935
```
40-
pip install -e .
36+
pipx install topsy
4137
```
4238

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.
4440

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`:
4744

4845
```
4946
# create a toy environment
@@ -64,20 +61,40 @@ deactivate
6461
For more information about venv, see its
6562
[tutorial page](https://docs.python.org/3/library/venv.html).
6663

64+
### 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+
6782

6883
Trying it out
6984
-------------
7085

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
7289
suitable simulation snapshot to hand, you can download some
7390
from the [tangos tutorial datasets (4.8GB)](http://ftp.star.ucl.ac.uk/~app/tangos/tutorial_changa.tar.gz).
7491
You need to untar them (`tar -xzf tutorial_changa.tar.gz` from your command line), then
7592
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
7796

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.
8198

8299
You can (and probably should) also
83100
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:
88105
* `-c all` (uses the shrink sphere center on all particles in the file)
89106

90107
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).
92109

93110
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).
96113

97114
To open more than one visualisation window on different files or with different parameters, you can
98115
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
107124
Controls in the main window
108125
---------------------------
109126

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:
113128

114129
* To spin around the centre, drag the mouse.
115130
* To zoom in and out, use the mouse scroll wheel.
@@ -155,4 +170,5 @@ vis.canvas
155170

156171
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.
157172

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).
174+

0 commit comments

Comments
 (0)