Debian Codegraph @

docs/settings.rst

raw
1 .. _sec:settings:
2
3 Changing plot settings
4 ======================
5
6 .. _sec:menu:
7
8 Menus
9 -----
10 The plot settings may be changed in a series of submenus:
11
12 .. image:: figs/menu.png
13 :width: 50.0%
14
15 Options can be saved using the (s)ave option from the
16 menu:
17
18 .. image:: figs/menu.png
19 :width: 50.0%
20
21 .. _sec:menu-s:
22
23 (s)aving your settings
24 ----------------------
25
26 .. image:: figs/menu-s.png
27 :width: 50.0%
28
29 - Pressing ``s`` saves current options to ``splash.defaults``.
30
31 - Delete ``splash.defaults`` to revert all settings
32
33 - Pressing ``S`` saves both ``splash.defaults`` and ``splash.limits`` (and any other files).
34
35 - Typing ``sa`` or ``Sa`` gives a “save-as” option, changing the prefix of saved files
36
37 - read defaults files saved with a different prefix using the ``-p`` option
38
39 Example:
40
41 ::
42
43 Please enter your selection now (y axis or option):SA
44 enter prefix for filenames: (default="blah"):
45 default options saved to file blah.defaults
46 saving plot limits to file blah.limits
47 saving units to blah.units
48
49 Read this back using:
50
51 ::
52
53 splash -p blah
54
55 Files saved by splash can also be edited manually. For example,
56 ``splash.limits`` is a simple two-column ascii file
57 containing minimum and maximum plot limits for each column.
58 To reset the plot limits simply delete the ``splash.limits`` file.
59
60 .. _sec:multiplot:
61
62 set (m)ultiplot
63 ---------------
64
65 .. image:: figs/menu-m.png
66 :width: 50.0%
67
68 .. _sec:multiplotsetup:
69
70 Plotting more than one column from the same file on the same page (multiplot)
71 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
72
73 Press ’m’ (:ref:`sec:multiplot`) from the main menu to set up a multiplot.
74
75 Once you have gone through the options to set up a multiplot, to
76 actually plot what you have set simply type the number of the column
77 corresponding to “multiplot” at the :math:`y-`\ axis prompt.
78
79 .. important::
80 A “multiplot” - multiple columns plotted from the same file - is
81 different to plotting “multiple plots per page” - divide the plotting
82 page up into panels. The number of panels across and down on a page can
83 be changed (see :ref:`sec:nacrossndown`) irrespective of whether
84 or not you are also plotting multiple columns from the same file.
85
86
87 Plotting each particle type in a different panel (multiplot)
88 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
89
90 To make a plot using different particle types in each panel (e.g. gas
91 density in one panel, dust or dark matter density in another), use ’m’
92 :ref:`sec:multiplot` from the main menu. If multiple types are present in
93 the data read, the option appears to specify the particular types you
94 want to use for each plot.
95
96 For example, after pressing ‘m’ at the main menu we eventually arrive at
97 the question:
98
99 ::
100
101 use all active particle types? (default=yes): n
102
103 Answering ``no`` brings up a possible list of types:
104
105 ::
106
107 1: use gas particles
108 2: use ghost particles
109 3: use sink particles
110 4: use star particles
111 5: use unknown/dead particles
112 Enter type or list of types to use ([1:5], default=1): 1,3
113
114 Thus entering e.g. ``1,3`` specifies that only gas and sink particles
115 should be used for this plot.
116
117 .. important::
118 This is more specific than simply turning particle types on
119 and off for *all* plots, which can be achieved via the
120 ``turn on/off particles by type`` option in the :ref:`sec:menu-o` (see
121 :ref:`sec:plotparticlesbytype`).
122
123 .. _sec:menu-d:
124
125 (d)ata options
126 --------------
127
128 .. image:: figs/menu-d.png
129 :width: 50.0%
130
131 The following can all be achieved from the d)ata options menu:
132
133 Re-reading the initial data / changing the dump file
134 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
135 Just exit splash and restart
136 with the new dump file name on the command line (remember to save by
137 pressing ’S’ from the main menu before exiting to save both the current
138 settings and the plot limits – then you can continue plotting with the
139 current settings using a new dump file).
140
141 If you have placed more than one file on the command line, then pressing
142 space in :ref:`sec:interactive` will read (and plot) the next file (press ’h’
143 in :ref:`sec:interactive` for a full list of commands - you can move forwards
144 and backwards using arbitrary jumps). For non-interactive devices or
145 where :ref:`sec:interactive` is turned off dump files are cycled through
146 automatically, plotting the same plot for each file/timestep.
147
148 .. _sec:subsetofsteps:
149
150 Using only a subset of data files / plotting every :math:`n-`\ th dump file
151 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
152 To plot a subset of the data files in \*any\* order, see :ref:`sec:selectedstepsonly`.
153
154 Of course, another way to achieve the same thing is to explicitly order
155 the files on the command line. A method I often use is to write all
156 filenames to a file, e.g.
157
158 ::
159
160 > ls DUMP* > splash.filenames
161
162 then edit the file to list only the files I want to use, then invoke
163 splash with no files on the command line:
164
165 ::
166
167 > splash
168
169 which will use the list of files specified in the ``splash.filenames``
170 file.
171
172 .. _sec:buffering:
173
174 Plotting more than one file without re-reading the data from disk
175 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
176
177 For small data sets (or a small number of dump files) it is often useful
178 to read all of the data into memory so that you can move rapidly
179 forwards and backwards between dumps (e.g. in :ref:`sec:interactive`, or where
180 both dumps are plotted on the same page) without unnecessary re-reading
181 of data from disk. This is achieved with the command line flag::
182
183 splash --buffer file_0*
184
185 (provided you have the memory of course!!). Non-buffered
186 data means that only one file at a time is read.
187
188 .. _sec:calc:
189
190 Calculating additional quantities not dumped
191 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
192
193 Turn ``calculate extra quantities`` on in the :ref:`sec:menu-d`.
194 New columns of data can be created as
195 completely arbitrary functions of the data read from the SPH particles.
196 Option ``d1`` in the data menu leads, for a typical data read, to a prompt
197 similar to the following:
198
199 ::
200
201 Specify a function to calculate from the data
202 Valid variables are the column labels, 't', 'gamma', 'x0', 'y0' and 'z0' (origin setting)
203 Spaces, escape sequences (\d) and units labels are removed from variable names
204 Note that previously calculated quantities can be used in subsequent calculations
205
206 Examples based on current data:
207 r = sqrt((x-x0)**2 + (y-y0)**2 + (z-z0)**2)
208 pressure = (gamma-1)*density*u
209 |v| = sqrt(vx**2 + vy**2 + vz**2)
210
211 Enter function string to calculate (blank for none) (default=""):
212
213 Thus, one can for example calculate the pressure from the density and
214 thermal energy according by copying the second example given.
215
216 .. hint::
217 Function calculation is completely general and can use any of the
218 columns read from the file, the time for each step (‘``t``’), the
219 adiabatic index :math:`\gamma` (‘``gamma``’) and the current origin
220 setting (``x0``, ``y0`` and ``z0``). Previously calculated quantities
221 can also be used - e.g. in the above example we could further compute,
222 say, an entropy variable using ``s=pressure/density^gamma`` after the
223 pressure has been specified. The resultant quantities appear in the main
224 splash menu as standard columns just as if they had been read from the
225 original data file.
226
227 The origin for the calculation of radius can be changed via the
228 ``rotation on/off/settings`` option in the :ref:`sec:menu-x`. If particle
229 tracking limits are set (see :ref:`sec:track`) the radius is
230 calculated relative to the particle being tracked.
231
232 If you simply want to multiply a column by a fixed number
233 (e.g. say you have sound speed squared and you want to plot temperature)
234 - this can also be achieved by defining a unit for the column (i.e., a
235 factor by which to multiply the column by) – see :ref:`sec:physicalunits` for details. The corresponding label
236 can be changed by creating a ``splash.columns`` file (or for the ascii
237 read just a file called ‘columns’) containing labels which are used to
238 override the default ones from the data read (one per line) – see
239 :ref:`sec:columnsfile` for more details.
240
241 See also :ref:`sec:geom` for how to transform vectors (and
242 positions) into different coordinate systems.
243
244 .. _sec:physicalunits:
245
246 Plotting data in physical units
247 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
248
249 Data can be plotted in physical units by turning on the ``use physical
250 units`` option in the :ref:`sec:menu-d`. The settings for transforming the
251 data into physical units may be changed via the ``change physical unit
252 settings`` option in the :ref:`sec:menu-d`. (see :ref:`sec:changingunits`)
253
254 For some data reads (phantom, sphNG, magma) the scalings required to transform
255 the data into physical units are read from the dump file. These are used
256 as the default values but are overridden as soon as changes are made by
257 the user (that is, by the presence of a ‘splash.units’ file) (see
258 :ref:`sec:changingunits`).
259
260 .. important::
261 Physical units are now ON by default in v3.x of SPLASH if they are set by the data read.
262 You can use this option to revert to code units
263
264 Rescaling data columns
265 ~~~~~~~~~~~~~~~~~~~~~~~
266
267 See :ref:`sec:physicalunits`.
268
269 .. _sec:columnsfile:
270
271 Changing the default column labels
272 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
273
274 The labelling of columns is usually automatic in the data format read
275 (for ascii files labels will be read from the file header). Aside from
276 changing the labels in the ``read_data`` file specific to the format you
277 are reading, it is also possible to override the labelling of columns at
278 runtime by creating a file called ``splash.columns`` (or with a
279 different prefix if the ``-p`` command line option is used), with one
280 label per line corresponding to each column read from the dump file,
281 e.g.
282
283 ::
284
285 column 1
286 column 2
287 column 3
288 my quantity
289 another quantity
290
291 .. warning::
292 Labels in the ``splash.columns`` file *will not* override
293 the labels of coordinate axes or labels for vector quantities (as these
294 require the ability to be changed by plotting in different coordinate
295 systems – see :ref:`sec:geom`).
296
297 Plotting column density in g/cm\ :math:`^{2}` without having x,y,z in cm
298 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
299
300 See :ref:`sec:changingunits`. In addition to units for each
301 column (and a unit for time – see :ref:`sec:timeunits`) a unit
302 can be set for the length scale added in 3D column integrated plots. The
303 prompt for this appears after the units of either :math:`x`, :math:`y`,
304 :math:`z` or :math:`h` has been changed via the ``change physical unit
305 settings`` option in the :ref:`sec:menu-d`. The length unit for integration is
306 saved in the first row of the splash.units file, after the units for
307 time.
308
309 See :ref:`sec:setprojlabel` for details on changing the
310 default labelling scheme for 3D column integrated (projection) plots.
311
312 .. _sec:changingunits:
313
314 Changing physical unit settings
315 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
316
317 The settings for transforming the data into physical units may be
318 changed via the ``change physical unit settings`` option in the :ref:`sec:menu-d`.
319 To apply the physical units to the data select the ``use physical
320 units`` option in the :ref:`sec:menu-d`.
321
322 The transformation used is :math:`new= old*units` where ``old`` is the
323 data as read from the dump file and ``new`` is the value actually plotted.
324 The data menu option also prompts for a units label which is appended to
325 the usual label. Brackets and spaces should be explicitly included in
326 the label as required.
327
328 Once units have been changed, the user is prompted to save the unit
329 settings to a file called ``splash.units``. Another way of changing
330 units is simply to edit this file yourself in any text editor (the
331 format is fairly self-explanatory). To revert to the default unit
332 settings simply delete this file. To revert to code units turn ``use
333 physical units`` off in the :ref:`sec:menu-d`.
334
335 .. hint::
336 A further example of where this option can be useful is where the
337 :math:`y-`\ axis looks crowded because the numeric axis labels read
338 something like :math:`1\times 10^{-4}`. The units option can be used to
339 rescale the data so that the numeric label reads :math:`1` (by setting
340 :math:`units=10^{4}`) whilst the label string is amended to read
341 :math:`y
342 [\times 10^{-4}]` by setting the units label to
343 :math:`[ \times 10^{-4}]`.
344
345 Changing the axis label to something like :math:`x` :math:`[ \times 10^{4} ]`
346 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
347
348 See :ref:`sec:changingunits`.
349
350 .. _sec:timeunits:
351
352 Changing the time units
353 ~~~~~~~~~~~~~~~~~~~~~~~~
354
355 Units for the time used in the legend can be changed using the ``change
356 physical unit settings`` in the :ref:`sec:menu-d`. Changing the units of column
357 zero corresponds to the time (appears as the first row in the
358 ‘splash.units’ file).
359
360 .. _sec:menu-i:
361
362 (i)nteractive mode
363 ------------------
364
365 .. image:: figs/menu-i.png
366 :width: 50.0%
367
368 The menu option i) turns on/off :ref:`sec:interactive`. With this option turned
369 on (the default) and an appropriate device selected (i.e., the X-window,
370 not /png or /ps), after each plot the program waits for specific
371 commands from the user. With the cursor positioned anywhere in the plot
372 window (but not outside it!), many different commands can be invoked.
373 Some functions you may find useful are: Move through timesteps by
374 pressing ``space`` (``b`` to go back); zoom/select particles by
375 selecting an area with the mouse; rotate the particles by using the
376 :math:`<`, :math:`>`,[, ] and :math:`\backslash`, / keys; log the axes
377 by holding the cursor over the appropriate axis and pressing the ``l``
378 key. Press ``q`` in the plot window to quit :ref:`sec:interactive`.
379
380 A full list of these commands is obtained by holding the cursor in the
381 plot window and pressing the ‘h’ key (h for help).
382
383 .. hint::
384 Changes made in :ref:`sec:interactive` will only be saved by pressing the ‘s’ (for
385 save) key. Otherwise pressing ``space`` (to advance to the next
386 timestep) erases the changes made during :ref:`sec:interactive`. A more
387 limited :ref:`sec:interactive` applies when there is more than one plot per
388 page.
389
390 Many more commands could be added to the :ref:`sec:interactive`, limited only
391 by your imagination. Please send me your suggestions!
392
393 Adapting the plot limits
394 ~~~~~~~~~~~~~~~~~~~~~~~~~
395
396 Press ``a`` in :ref:`sec:interactive` to adapt the plot limits to the current
397 minimum and maximum of the quantity being plotted. With the mouse over
398 the colour bar, this applies to the colour bar limits. Also works even
399 when the page is subdivided into panels. To adapt the size of the arrows
400 on :ref:`sec:vectorplots`, press ``w``. To use “adaptive plot limits” (where the
401 limits change at every timestep), see :ref:`sec:adapt`.
402
403 Making the axes logarithmic
404 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
405
406 Press ``l`` in :ref:`sec:interactive` with the mouse over either the x or y axis
407 or the colour bar to use a logarithmic axis. Pressing ``l`` again changes
408 back to linear axes. To use logarithmic labels as well as logarithmic
409 axes, see :ref:`sec:loglabels`.
410
411 Cycling through data columns interactively
412 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
413
414 Use ``f`` in :ref:`sec:interactive` on :ref:`sec:renderplot` to interactively ‘flip’
415 forwards to the next quantity in the data columns (e.g. thermal energy
416 instead of density). Use ’F’ to flip backwards.
417
418 .. _sec:colourparts:
419
420 Colouring a subset of the particles and retaining this colour through other timesteps
421 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
422
423 .. figure:: figs/colourparts.pdf
424 :alt: coloured particles
425 :name: fig:colourparts
426 :width: 80.0%
427
428 Example of particles coloured interactively using the mouse (left)
429 and selection using a parameter range (right), which is the same as
430 the plot on the left but showing only particles in a particular
431 density range (after an intermediate plot of density vs x on which I
432 selected a subset of particles and hit ``p``)
433
434 In :ref:`sec:interactive`, select a subset of the particles using the mouse
435 (that is left click and resize the box until it contains the region you
436 require), then press either 1-9 to colour the selected particles with
437 colours corresponding to plotting library colour indices 1-9, press ``p``
438 to plot only those particles selected (hiding all other particles), or
439 ``h`` to hide the selected particles. An example is shown in the left
440 panel of :numref:`fig:colourparts`. Particles
441 retain these colours between timesteps and even between plots. This
442 feature can therefore be used to find particles within a certain
443 parameter range (e.g. by plotting density with x, selecting/colouring
444 particles in a given density range, then plotting x vs y in which the
445 particles will appear as previously selected/coloured). An example of
446 this feature is shown in the right panel of :numref:`fig:colourparts` where I have plotted
447 an intermediate plot of density vs x on which I selected a subset of
448 particles and hit ``p`` (to plot only that subset), then re-plotted x vs y
449 with the new particle selections.
450
451 To “un-hide” or “de-colour” particles, simply select the entire plotting
452 area and press ``1`` to restore all particles to the foreground colour
453 index.
454
455 Particles hidden in this manner are also no longer used in the rendering
456 calculation. Thus it is possible to render using only a subset of the
457 particles (e.g. using only half of a box, or only high density
458 particles). An example is shown in :numref:`fig:rendersubset`.
459
460 To colour the particles according to the value of a particular quantity,
461 see :ref:`sec:colournotrender`.
462
463 .. important::
464 Selection in this way is based on the particle *identity*,
465 meaning that the parameter range itself is not preserved for subsequent
466 timesteps, but rather the subset of particles selected from the initial
467 timestep. This can be useful for working out which particles formed a
468 particular object in a simulation by selecting only particles in that
469 object at the end time, and moving backwards through timesteps retaining
470 that selection.
471
472 Working out which particles formed a particular object in a simulation
473 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
474
475 This can be achieved by selecting and colouring particles at a
476 particular timestep and plotting the same selection at an earlier time.
477 See :ref:`sec:colourparts` for details.
478
479 Plotting only a subset of the particles
480 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
481
482 To turn plotting of certain particle *types* on and off, see
483 :ref:`sec:plotparticlesbytype`. To select a subset of the
484 particles based on restrictions of a particular parameter or by spatial
485 region see :ref:`sec:colourparts`.
486
487 .. _sec:rendersubset:
488
489 Rendering using only a subset of the particles
490 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
491
492 Particles can be selected and ‘hidden’ interactively (see
493 :ref:`sec:colourparts`) – for :ref:`sec:renderplot` ‘hidden’ particles
494 are also not used in the interpolation calculation from the particles to
495 the pixel array. An example is shown in :numref:`fig:rendersubset`, where I have taken
496 one of the rendered examples in :ref:`sec:basic`, selected half of
497 the domain with the mouse and pressed ’p’ to plot only the selected
498 particles. The result is the plot shown.
499
500 .. figure:: figs/rendersubset.pdf
501 :alt: rendering with subset of particles
502 :name: fig:rendersubset
503 :width: 50.0%
504
505 Example of :ref:`sec:renderplot` using only a subset of the particles. Here I
506 have selected only particles on the right hand side of the plot using
507 the mouse and hit ’p’ to plot only those particles.
508
509 .. important::
510 Selection of data subsets is by default based on *particle identity* – the same particles will be used
511 for the plot in subsequent dumps, allowing one to easily track the
512 Lagrangian evolution of a patch of gas.
513 See :ref:`sec:rangerestrict` to select by fixed parameter ranges
514 (e.g. to only show particles in fixed density range).
515
516 .. hint::
517 A range restriction can be set in :ref:`sec:interactive` by selecting
518 the restricted box using the mouse and pressing ``x``, ``y`` or ``r`` to
519 restrict the particles used to the x, y (or r for both x and y) range of
520 the selected box respectively. Pressing ``S`` at the main menu will save
521 such range restrictions to the ``splash.limits`` file.
522
523 Tracking a set of particles through multiple timesteps
524 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
525
526 See :ref:`sec:rendersubset`.
527
528 .. _sec:obliquexsec:
529
530 Taking an oblique cross section interactively
531 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
532
533 It is possible to take an oblique :ref:`sec:xsec` through 3D data using a
534 combination of rotation and :ref:`sec:xsec` slice plotting. To set the
535 position interactively, press ``x`` in :ref:`sec:interactive` to draw the
536 position of the :ref:`sec:xsec` line (e.g. on an x-y plot this then
537 produces a z-x plot with the appropriate amount of rotation to give the
538 cross section slice in the position selected).
539
540 .. hint::
541 Interactively selecting a :ref:`sec:xsec` will work
542 even if the current plot is a 3D column integrated projection. In this
543 case the setting ``projection or cross section`` changes to
544 ``cross section`` in order to plot the slice.
545
546 .. _sec:menu-p:
547
548 (p)age options
549 --------------
550
551 .. image:: figs/menu-p.png
552 :width: 50.0%
553
554 Options related to the page setup are changed in the p)age submenu.
555
556 .. _sec:nstepsontopofeachother:
557
558 Overlaying timesteps/multiple dump files on top of each other
559 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
560
561 It is possible to over-plot data from one file on top of data from
562 another using the ``plot n steps on top of each other`` option from the
563 :ref:`sec:menu-p`. Setting :math:`n` to a number greater than one means that
564 the page is not changed until :math:`n` steps have been plotted.
565 Following the prompts, it is possible to change the colour of all
566 particles between steps and the graph markers used and plot an
567 associated legend (see below).
568
569 .. hint::
570 This option can also be used in
571 combination with a multiplot (see :ref:`sec:multiplot`) – for
572 example plotting the density vs x and pressure vs x in separate panels,
573 then with :math:`n > 1` all timesteps will be plotted in *each* panel.
574
575 When more than one timestep is plotted per page with different
576 markers/colours, an additional legend can be plotted (turn this on in
577 the :ref:`sec:menu-g`, or when prompted while setting the ``plot n steps
578 on top of each other`` option). The text for this legend is just the
579 filename by default, if one timestep per file, or just something dull
580 like ’step 1’, if more than one timestep per file.
581
582 .. hint::
583
584 To change the legend text, create a file called ``splash.legend`` in the
585 working directory, with one label per line. The position of the legend
586 can be changed either manually via the ``legend and title options`` in the
587 :ref:`sec:menu-p`, or by positioning the mouse in :ref:`sec:interactive` and
588 pressing ``G`` (similar keys apply for moving plot titles and the legend
589 for :ref:`sec:vectorplots` – press ``h`` in :ref:`sec:interactive` for a full list).
590
591 Plotting results from multiple files in the same panel
592 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
593
594 See :ref:`sec:nstepsontopofeachother`.
595
596 Plotting more than one dump file on the same page
597 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
598
599 This is slightly different to “plotting more than one dump
600 file on the same panel”
601
602 .. _sec:axessettings:
603
604 Changing axes settings
605 ~~~~~~~~~~~~~~~~~~~~~~~
606
607 Axes settings can be changed in the :ref:`sec:menu-p`, by choosing ``axes options``. The options are as follows:
608
609 ::
610
611 -4 : draw box and major tick marks only;
612 -3 : draw box and tick marks (major and minor) only;
613 -2 : draw no box, axes or labels;
614 -1 : draw box only;
615 0 : draw box and label it with coordinates;
616 1 : same as AXIS=0, but also draw the coordinate axes (X=0, Y=0);
617 2 : same as AXIS=1, but also draw grid lines at major increments of the coordinates;
618 3 : draw box, ticks and numbers but no axes labels;
619 4 : same as AXIS=0, but with a second y-axis scaled and labelled differently
620 10 : draw box and label X-axis logarithmically;
621 20 : draw box and label Y-axis logarithmically;
622 30 : draw box and label both axes logarithmically.
623
624 Turning axes off
625 ~~~~~~~~~~~~~~~~~
626
627 Plot axes can be turned off by choosing ``axes options`` in the :ref:`sec:menu-p`
628 or by deleting them using the backspace key in :ref:`sec:interactive`.
629 See :ref:`sec:axessettings` for more details.
630
631 Turning axes labels off
632 ~~~~~~~~~~~~~~~~~~~~~~~~
633
634 Axes labels and numbering can be turned off via the ``axes options``
635 option in the :ref:`sec:menu-p` or by deleting them using the backspace key
636 in :ref:`sec:interactive`. See :ref:`sec:axessettings` for more
637 details.
638
639 .. _sec:loglabels:
640
641 Using logarithmic axes labels
642 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
643
644 Logarithmic axes (that is where the quantity plotted is logged) can be
645 set via the ``apply log or inverse transformations`` option in the :ref:`sec:menu-l`
646 or simply by pressing ``l`` with the cursor over the desired axis
647 (or the colour bar) in :ref:`sec:interactive`. By default the axes labels
648 reads :math:`log(x)` and the number next to the axis is :math:`-4` when
649 :math:`x` is 10\ :math:`^{-4}`. Logarithmic axes labels (i.e., where the
650 label reads :math:`x` and the number next to the axis is :math:`10^{-4}`
651 with a logarithmic scale) can be specified by choosing the ``axes
652 options`` option in the :ref:`sec:menu-p` and setting the axes option to 10,
653 20 or 30 as necessary (see :ref:`sec:axessettings` for more
654 details).
655
656 Plotting a second, rescaled y-axis on the right hand side of a plot
657 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
658
659 A second y axis can be added by selecting the axis=4 option in the ``axes option``
660 in the :ref:`sec:menu-p` (see :ref:`sec:axessettings`). This will prompt for
661 the scaling and alternative label:
662
663 ::
664
665 enter axis option ([-4:30], default=0): 4
666 enter scale factor for alternative y axis ([0.000:], default=1.000): 10.0
667 enter label for alternative y axis (default=""): y [other units]
668
669 .. _sec:papersize:
670
671 Changing the size of the plotting surface
672 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
673
674 The physical size of the viewing surface used for plotting can be
675 changed via the ``change paper size`` option in the :ref:`sec:menu-p`. This
676 affects the size of the X-window (if plotted to the screen) and the size
677 of .png or images generated (if plotted to these devices). Several
678 preset options are provided or the paper size in x and y can be
679 explicitly specified in inches or pixels.
680
681 .. _sec:nacrossndown:
682
683 Dividing the plotting page into panels
684 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
685
686 The plotting page can be divided into panels using the ``subdivide page into panels``
687 option in the :ref:`sec:menu-p`. For multiple plots
688 per page (i.e., nacross :math:`\times` ndown :math:`> 1`) a more limited
689 :ref:`sec:interactive` applies (basically because the data used for the plots
690 is no longer stored in memory if there is more than one plot on the same
691 page meaning that functionality such as selecting particles must be
692 turned off).
693
694 .. _sec:tiling:
695
696 Tiling plots with the same :math:`x-` and :math:`y-` axes
697 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
698
699 Plots with the same :math:`x-` and :math:`y-` axes are tiled if the
700 tiling option from the :ref:`sec:menu-p`. Tiling means that only one axis is shown where multiple plots
701 share the same x or y axis and that the plots are placed as close to
702 each other as possible. For :ref:`sec:renderplot` a shared colour bar is
703 plotted which spans the full length of the page.
704
705 .. _sec:squarexy:
706
707 Using non-proportional scales for spatial dimensions
708 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
709
710 By default if the x and y axes are both spatial coordinates, the axes
711 are scaled proportionately. This can be changed via the ``spatial
712 dimensions have same scale`` option in :ref:`sec:menu-p`.
713
714 Using non-square axes on coordinate plots
715 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
716
717 See :ref:`sec:squarexy`.
718
719 Changing the character height for axes, labels and legends
720 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
721
722 The character height used for axes, labels and legends can be changed
723 via the :ref:`sec:menu-p`. The character height is
724 relative to the paper size where 1.0 = 1/40th of the page height.
725 The page height can be changed in :ref:`sec:papersize`.
726
727 Using a thicker line width on plots
728 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
729
730 The line width used for axes and text can be changed via the :ref:`sec:menu-p`.
731
732 .. _sec:pagecolours:
733
734 Changing the foreground and background colours
735 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
736
737 The background and foreground colour of a plot can be changed via the
738 ``set foreground/background colours`` option in the :ref:`sec:menu-p`. Note
739 that the background colour setting has no effect on postscript devices
740 (see :ref:`sec:postscript` for more details).
741
742 Plotting axes, legends and titles in white even when the labels are plotted in black
743 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
744
745 By default, axes, legends and titles are plotted in the foreground
746 colour (e.g. black). However if the plot itself is also largely black
747 (e.g. :ref:`sec:renderplot` when lots of particles are plotted) it can be
748 useful to overplot those parts of the axes and labelling which lie on
749 top of the plotting surface in the background colour (e.g. white). A
750 prompt for this is given when setting the ``set foreground/background
751 colours`` option in the :ref:`sec:menu-p`.
752
753 The prompt appears as follows:
754
755 ::
756
757 ---------------- page setup options -------------------
758 ...
759 9) set foreground/background colours
760 enter option ([0:8], default=0):9
761 Enter background colour (by name, e.g. "black") (default=""):white
762 Enter foreground colour (by name, e.g. "white") (default=""):black
763
764 Overlaid (that is, drawn inside the plot borders) axis
765 ticks, legend text and titles are by default plotted in
766 the foreground colour [i.e., black].
767
768 Do you want to plot these in background colour [i.e., white] instead ? (default=no):y
769
770 In the above I have selected a background colour of white, a foreground
771 colour of black. Answering yes to the last question means that those
772 parts of the axes which lie on top of the viewing surface (and any
773 labels) will be plotted in white (the background colour) instead of the
774 foreground colour (black).
775
776 .. _sec:menu-g:
777
778 le(g)end and title options
779 --------------------------
780
781 .. image:: figs/menu-g.png
782 :width: 50.0%
783
784 .. _sec:title:
785
786 Adding titles to plots / repositioning titles
787 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
788
789 Plots may be titled individually by creating a file called
790 ``splash.titles`` in the current directory, with the title on each line
791 corresponding to the position of the plot on the page. Thus the title is
792 the same between timesteps unless the steps are plotted together on the
793 same physical page. Leave blank lines for plots without titles. For
794 example, creating a file called ``splash.titles`` in the current
795 directory, containing the text:
796
797 ::
798
799 plot one
800 plot two
801 plot three
802
803 and positioning the title using the default options, will produce a plot
804 with one of these titles on each panel.
805
806 .. _sec:legendoff:
807
808 Turning off/moving the time legend
809 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
810
811 The position of the time legend can be set interactively by positioning
812 the mouse in the plot window and pressing ’G’. To set the position
813 non-interactively and/or change additional settings such as the
814 justification, use the ``time legend on/off/settings`` option in the
815 :ref:`sec:menu-g`.
816
817 .. _sec:timelegendtext:
818
819 Changing the text in the time legend
820 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
821
822 The text which appears the time legend (by default this is ``t=``) can be
823 changed via the ``time legend on/off/settings`` option in the :ref:`sec:menu-g`.
824
825 To rescale the *value* of the time displayed in the time legend (default
826 value is as read from the dump file), see
827 :ref:`sec:timeunits`.
828
829 Making the legend read 'z=' instead of 't='
830 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
831
832 See :ref:`sec:timelegendtext`. An option to change the legend text
833 is provided in the ``time legend on/off/settings`` option in :ref:`sec:menu-g`.
834 The numeric value of the time legend is as read into the
835 ``time`` array in the read_data routine. This value can be rescaled by
836 setting a unit for time (see :ref:`sec:timeunits`).
837
838 Plotting the time legend on the first row/column of panels / nth panel only
839 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
840
841 An option to plot the time legend on the first row or column of panels
842 or on a single panel only appears in the :ref:`sec:menu-g`.
843
844 Plotting a length scale on coordinate plots
845 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
846
847 An option to plot a length scale (i.e., ``|---|`` with a label below it
848 indicating the length) on coordinate plots (i.e., plots where both
849 :math:`x-` and :math:`y-`\ axes refer to particle coordinates) is
850 provided in the :ref:`sec:menu-g`.
851
852 Annotating a plot with squares, rectangles, arrows, circles and text
853 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
854
855 Use the ``annotate plot`` option in :ref:`sec:menu-g` to annotate plots
856 with a range of geometric objects (squares, rectangles, arrows, circles
857 and text) with full control over attributes such as line width, line
858 style, colour, angle and fill style.
859
860 Text annotation can also be added/deleted in :ref:`sec:interactive` using
861 ``ctrl-t`` (to add) and the backspace key (to delete). Text can also be
862 added to plots by adding titles (:ref:`sec:title`) which can be
863 different in different panels. Text labels added using shape annotation
864 differ from titles by the fact that they must appear the same in each
865 panel and are positioned according to the world co-ordinates of the plot
866 (rather than relative to the viewport). Shape text can also be displayed
867 at arbitrary angles.
868
869 An option to plot length scales (``|---|``) on coordinate plots is
870 implemented separately via the ``plot scale on coordinate plots`` option
871 in :ref:`sec:menu-g`.
872
873 Adding your name to a plot/movie
874 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
875
876 Arbitrary text annotation can be added/removed in :ref:`sec:interactive` using
877 ``ctrl-t`` (to add) and the backspace key (to delete) or via the
878 ``annotate plot`` option in the :ref:`sec:menu-g`.
879
880 .. _sec:menu-o:
881
882 particle plot (o)ptions
883 -----------------------
884
885 .. image:: figs/menu-o.png
886 :width: 50.0%
887
888 The following are tasks which can be achieved via options in the :ref:`sec:menu-o`.
889
890 .. _sec:plotparticlesbytype:
891
892 Plotting non-gas particles (e.g. ghosts, boundary, sink particles)
893 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
894
895 Particles of different types can be turned on or off (i.e., plotted or
896 not) using the ``turn on/off particles by type`` option in :ref:`sec:menu-o`.
897 This option also prompts to allow particles of
898 non-SPH types to be plotted on top of :ref:`sec:renderplot` (useful for sink or
899 star particles - this option does not apply to SPH particle types).
900 Turning SPH particle types on or off also determines whether or not they
901 will be used in the rendering calculation (i.e., the interpolation to
902 pixels). This particularly applies to ghost particles, where ghost
903 particles will only be used in the rendering if they are turned on via
904 this menu option.
905
906 (The fact that particles of a given type are SPH particles or not is
907 specified by the ``UseTypeInRendering`` flags in the set_labels part of
908 the read_data file).
909
910 Plotting non-gas particles on top of rendered plots
911 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
912
913 An option to plot non-SPH particles on top of :ref:`sec:renderplot` (e.g. sink
914 particles) can be set when turning particle types on/off via the
915 ``turn on/off particles by type`` option in :ref:`sec:menu-o`
916 (see :ref:`sec:plotparticlesbytype`).
917
918 Using ghost particles in the rendering
919 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
920
921 See :ref:`sec:plotparticlesbytype`.
922
923 Turn off plotting of gas particles
924 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
925
926 Particles can be turned on or off by type via the
927 ``turn on/off particles by type`` option in :ref:`sec:menu-o`. See
928 :ref:`sec:plotparticlesbytype`.
929
930 .. _sec:darkmatter:
931
932 Plotting dark matter particles
933 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
934
935 To plot dark matter particles (e.g. for the gadget read) the particle
936 type corresponding to dark matter particles must be turned on via the
937 ``turn on/off particles by type`` option in :ref:`sec:menu-o`. Turning this
938 option on means that dark matter particles will appear on particle
939 plots.
940
941 To make :ref:`sec:renderplot` of dark matter (e.g. showing column density), it
942 is necessary to define smoothing lengths and a fake “density” for the
943 dark matter particles. If your data read already supplies individual
944 smoothing lengths for dark matter particles, the only thing to do is
945 define a fake density field with a constant value (e.g. :math:`\rho = 1`
946 for all dark matter particles). The actual density value does not
947 matter, so long as it is non-zero, as the rendering for density does not
948 use it unless the ``normalise interpolations`` option in the :ref:`sec:menu-r`
949 is set (which it is not by default). This is because SPLASH constructs
950 the weight:
951
952 .. math:: w_{part} = \frac{m_{part}}{\rho_{part} h_{part}^{\nu}},
953
954 (see `Price 2007 <https://ui.adsabs.harvard.edu/abs/2007PASA...24..159P>`_) and then interpolates for any
955 quantity A using
956
957 .. math:: A_{pixels} = \sum_{part} w_{part} A_{part} W_{kernel},
958
959 so if :math:`A = \rho` then the actual rho value cancels.
960
961 For the GADGET data read you can define the smoothing length for dark
962 matter particles by setting the environment variable
963 GSPLASH_DARKMATTER_HSOFT (see :ref:`sec:gsplash` for details),
964 which also triggers the creation of a fake density column as required.
965 With this variable set dark matter particles are treated identically to
966 SPH particles and can be rendered as usual (although the only meaningful
967 quantity to render is the density). A much better way is to define
968 smoothing lengths individually for dark matter particles, for example
969 based on a local number density estimate from the relation
970
971 .. math:: h \propto n^{-1/3}, \hspace{0.5cm} \textrm{where} \hspace{0.5cm} n_{i} = \sum_{j} W_{ij}.
972
973 Actually, none of this should be necessary, as the gravity for dark
974 matter should be softened with smoothing lengths defined like this in
975 the first place. The historical practice of fixed softening lengths has
976 arisen only because of confusion about what softening really means (and
977 worries about energy conservation with adaptive softening lengths). What
978 you are trying to do is solve Poisson’s equation for the dark matter
979 density field, defined with a kernel density estimate and using fixed
980 softening lengths is not a way to get a good density... but don’t get me
981 started, read [PM07]_ instead.
982
983 .. danger::
984 For simulations using both SPH and dark matter particles, dark
985 matter particles will contribute (incorrectly) to the SPH rendering when
986 the environment variable is set and the plotting of dark matter
987 particles is turned on. Thus to plot just gas column density in this
988 case, dark matter particles must be turned off [via the :ref:`sec:menu-o`],
989 and similarly to plot just dark matter density if both SPH and dark
990 matter particles are present, SPH particles must be turned off.
991
992 Plotting a column density plot of dark matter/N-body particles
993 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
994
995 See :ref:`sec:darkmatter`.
996
997 .. _sec:plotsinks:
998
999 Plotting sink particles
1000 ~~~~~~~~~~~~~~~~~~~~~~~~
1001
1002 Sink particles will be plotted on particle plots once turned on via the
1003 ``turn on/off particles by type`` option in :ref:`sec:menu-o`.
1004 Setting this option also gives a prompt for whether or not to
1005 plot sink particles on top of :ref:`sec:renderplot` (to which the answer should
1006 be yes). See :ref:`sec:plotparticlesbytype` for more details.
1007
1008 To plot sink particles as a circle scaled to the sink radius, select the
1009 appropriate marker type (32-35) in the ``change graph markers for each
1010 type`` option in :ref:`sec:menu-o`. This allows plotting of particles of a
1011 given type with circles, filled or open, proportional to their smoothing
1012 lengths. Thus, the smoothing length for sink particles needs to be set
1013 to their accretion radius (or at least proportional to it).
1014
1015 .. hint::
1016 A good option for sink particles is to print “outlined” filled
1017 circles (marker 34) — these show up on both black or white backgrounds.
1018
1019 Plotting sink particles with size proportional to the sink radius
1020 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1021
1022 See :ref:`sec:plotsinks`.
1023
1024 Plotting a point mass particle with physical size
1025 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1026
1027 See :ref:`sec:plotsinks`.
1028
1029 Changing graph markers for each particle type
1030 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1031
1032 The graph markers used to plot each particle type can be changed via the
1033 ``change graph markers for each type`` option in the :ref:`sec:menu-o`. The full list of available markers is given in the
1034 documentation for giza (also similar to the markers used in pgplot).
1035
1036 SPLASH also allows the particles to be marked by a circle proportional
1037 to the smoothing length for that particle, implemented as marker types
1038 32-35 under the ``change graph markers for each type`` option in the :ref:`sec:menu-o`.
1039
1040 .. _sec:partcolours:
1041
1042 Plotting each particle type in a different colour
1043 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1044
1045 Each particle type can be plotted in a different colour via the ``set
1046 colour for each particle type`` option in the :ref:`sec:menu-o`.
1047
1048 Changing the order in which different particle types are plotted
1049 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1050
1051 The order in which particle types are plotted can be changed via the
1052 ``change plotting order of types`` option in :ref:`sec:menu-o`.
1053 For example, it is possible to make dark matter particles
1054 be plotted on top of gas particles rather than the default which is
1055 vice-versa. This is only implemented for particle
1056 types which are stored contiguously (one after the other) in the data
1057 read, rather than mixed in with each other.
1058
1059 .. _sec:lines:
1060
1061 Plotting using lines instead of dots (e.g. for energy vs time plots)
1062 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1063
1064 An option to plot a line joining all of the points on a plot can be set
1065 via the ``plot line joining particles`` option in :ref:`sec:menu-o`.
1066 When set, this option plots a line connecting the (gas
1067 only) particles in the order that they appear in the data array. Useful
1068 mainly in one dimension or when plotting ascii data, although can give
1069 an indication of the relative closeness of the particles in memory and
1070 in physical space in higher dimensions. The line colours and styles can
1071 be changed.
1072
1073 To plot the line only with no particles, turn off gas particles using
1074 the ``turn on/off particles by type option`` from :ref:`sec:menu-o`.
1075
1076 Plotting multiple lines with different colours/line styles and a legend
1077 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1078
1079 When multiple timesteps are plotted on the same physical page, the line
1080 style can be changed instead of the colour (this occurs when the change
1081 colour option is chosen for multiple steps per page – see the
1082 ``change plots per page`` option in the :ref:`sec:menu-p`.
1083
1084 Joining the dots
1085 ~~~~~~~~~~~~~~~~~
1086
1087 See :ref:`sec:lines`.
1088
1089 .. _sec:smoothingcircle:
1090
1091 Plotting the size of the smoothing circle around selected particles
1092 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1093
1094 On coordinate plots this option plots a circle of radius :math:`2h`
1095 around selected particles. This is primarily useful in debugging
1096 neighbour finding routines. Where only one of the axes is a coordinate
1097 this function plots an error bar of length :math:`2h` in either
1098 direction is plotted in the direction of the coordinate axis. See also
1099 :ref:`sec:findingaparticle` for more details.
1100
1101 .. _sec:findingaparticle:
1102
1103 Locating a particular particle in the data set
1104 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1105
1106 The best way to locate a particular particle in the data set is to use
1107 the ``plot smoothing circles`` option in :ref:`sec:menu-o`, e.g:
1108
1109 ::
1110
1111 Please enter your selection now (y axis or option):o5
1112 ------------- particle plot options -------------------
1113 Note that circles of interaction can also be set interactively
1114 Enter number of circles to draw ([0:100], default=0):1
1115 Enter particle number to plot circle around ([1:959], default=1): 868
1116
1117 then upon plotting a coordinate plot (e.g. x vs y), particle 868 will be
1118 plotted with a circle of size :math:`2h` which makes it easy to
1119 distinguish from the other particles. See also
1120 :ref:`sec:smoothingcircle`.
1121
1122 .. _sec:geom:
1123
1124 Plotting in different coordinate systems (e.g. cylindrical coordinates)
1125 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1126
1127 The coordinates of position and of all vector components can be
1128 transformed into non-cartesian coordinate systems using the
1129 ``change coordinate system`` option in :ref:`sec:menu-o`. For
1130 example, a dump file with columns as follows:
1131
1132 ::
1133
1134 -------------------------------------------------------
1135 1) x 6) log density
1136 2) y 7) v\dx
1137 3) z 8) v\dy
1138 4) particle mass 9) v\dz
1139 5) h
1140 -------------------------------------------------------
1141 10) multiplot [ 4 ] m) set multiplot
1142 -------------------------------------------------------
1143 Please enter your selection now (y axis or option):
1144
1145 choosing :ref:`sec:menu-o`, option 7) and choosing cylindrical coordinates then
1146 produces;
1147
1148 ::
1149
1150 You may choose from a delectable sample of plots
1151 -------------------------------------------------------
1152 1) r 6) log density
1153 2) phi 7) v\dr
1154 3) z 8) v\dphi
1155 4) particle mass 9) v\dz
1156 5) h
1157 -------------------------------------------------------
1158 ...
1159
1160 transforming both coordinates and vectors into the chosen coordinate
1161 system.
1162
1163 .. hint::
1164 :ref:`sec:renderplot` are also possible in coordinate systems other than
1165 those native to the file.
1166
1167 .. hint::
1168 For 3D SPH simulations, extra columns will appear in the menu in cylindrical
1169 or spherical coordinates allowing plots of azimuthally-averaged surface
1170 density and Toomre Q parameter. For more details see :ref:`sec:surfdens`.
1171
1172 Details of the coordinate transformations are given in
1173 :ref:`sec:coordtransforms`.
1174
1175 If you have a coordinate system you would like implemented, please email
1176 me the details!
1177
1178 Plotting vector components in different coordinate systems
1179 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1180
1181 See :ref:`sec:geom`.
1182
1183 Plotting orbital velocities
1184 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1185
1186 See :ref:`sec:geom`.
1187
1188 Plotting against azimuthal angle/cylindrical radius/etc
1189 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1190
1191 See :ref:`sec:geom`.
1192
1193 .. _sec:exactsolns:
1194
1195 Plotting the exact solution to common test problems
1196 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1197 Turn on `plot exact solution` in :ref:`sec:menu-o`
1198
1199 The following exact solutions are provided
1200
1201 - Any arbitrary function y = f(x,t) (can be plotted on any or all of
1202 the plots). The functions to be plotted can also be specified by
1203 creating a ``splash.func`` file with one function per line.
1204
1205 - Hydrodynamic shock tubes (Riemann problem) – a full solution is
1206 provided for all types of waves propagating in either direction.
1207
1208 - Spherically-symmetric 3D sedov blast wave problem.
1209
1210 - Polytropes (with arbitrary :math:`\gamma`)
1211
1212 - One and two dimensional toy stars. This is a particularly simple test
1213 problem for SPH codes described in [MP04]_.
1214
1215 - Linear wave. This simply plots a sine wave of a specified amplitude,
1216 period and wavelength on the plot specified.
1217
1218 - MHD shock tubes (tabulated). These are tabulated solutions for 7
1219 specific MHD shock tube problems.
1220
1221 - h vs :math:`\rho`. This is the exact solution relating smoothing
1222 length and density in the form :math:`h \propto (m/\rho)^{1/\nu}`
1223 where :math:`\nu` is the number of spatial dimensions.
1224
1225 - radial density profiles. For various models commonly used in
1226 :math:`N-`\ body simulations.
1227
1228 - Exact solution from a file. This option reads in an exact solution
1229 from the filename input by the user, assuming the file contains two
1230 columns containing the :math:`x-` and :math:`y-` coordinates of an
1231 exact solution to be plotted as a line on the plot specified.
1232
1233 Details of the calculation of the exact solutions are given in
1234 :ref:`sec:exact`. An example plot using the Sedov blast
1235 wave exact solution is shown in :numref:`fig:sedov`.
1236
1237 .. figure:: figs/sedov_example.png
1238 :alt: sedov exact solution
1239 :name: fig:sedov
1240 :width: 50.0%
1241
1242 Example of a plot utilising the Sedov blast wave exact solution.
1243 Taken from [RP07]_.
1244
1245 Plotting an exact solution from a file
1246 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1247
1248 See :ref:`sec:exactsolns`. One of the options for exact
1249 solution plotting is to read the exact solution from either one or a
1250 sequence of ascii files, such that the results are plotted alongside the
1251 particle data. The filename(s) can be specified by the user and will be
1252 saved to the ‘splash.defaults’ file so that the solution(s) will be read
1253 and plotted on subsequent invocations of splash .
1254
1255 Changing the exact solution line style & colour
1256 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1257
1258 The line style and colour of the exact solution line can be changed via
1259 the ``exact solution plot options`` option in :ref:`sec:menu-o`. This option
1260 can also be used to turn on/off calculation of various error norms
1261 together with an inset plot of the residual error on the particles. See
1262 :ref:`sec:exact` for details of the error norms
1263 calculated.
1264
1265 Setting the number of points used in an exact solution calculation
1266 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1267
1268 The number of points used in an exact solution calculation can be
1269 changed via the ``exact solution plot options`` option in :ref:`sec:menu-o`.
1270
1271 Plotting an inset plot of residual errors from an exact solution
1272 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1273
1274 An inset plot of residual errors between the plotted points and an exact
1275 solution calculation can be turned on via the
1276 ``exact solution plot options`` option in :ref:`sec:menu-o`.
1277
1278 .. _sec:menu-l:
1279
1280 (l)imits menu
1281 -------------
1282
1283 .. image:: figs/menu-l.png
1284 :width: 50.0%
1285
1286 .. _sec:adapt:
1287
1288 Using plot limits which adapt automatically for each new plot
1289 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1290
1291 Adaptive plot limits can be set using option 1 of the :ref:`sec:menu-l`.
1292 Different settings can be applied to coordinate axes and non-coordinate axes. Changing
1293 plot limits interactively and pressing ``s`` in :ref:`sec:interactive` will
1294 change this option back to using fixed limits.
1295
1296 Using adaptive plot limits for the colour bar but not for the coordinates
1297 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1298
1299 Adaptive plot limits can be set individually for coordinate axes and
1300 non-coordinate axes (e.g. the colour bar) via the
1301 ``use adaptive/fixed limits`` option in the :ref:`sec:menu-l`. See :ref:`sec:adapt`.
1302
1303 Setting plot limits manually
1304 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1305
1306 Plot limits can be set manually using option 2) of the :ref:`sec:menu-l` (or
1307 simply ``l2`` from the main menu). Alternatively you can edit the
1308 ``splash.limits`` file created by :ref:`sec:menu-s` prior to
1309 invoking splash (this file simply contains the minimum and maximum
1310 limits for each column on consecutive lines).
1311
1312 .. _sec:track:
1313
1314 Making plot limits relative to a particular particle
1315 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1316
1317 Particle tracking limits (i.e., where a chosen particle is always at the
1318 centre of the plot and limits are set relative to that position) can be
1319 set via the ``make xy limits relative to particle`` option in the :ref:`sec:menu-l`.
1320 Alternatively particle tracking limits can be set interactively by
1321 pressing ``t`` in :ref:`sec:interactive` with the cursor over the particle you
1322 wish to track.
1323
1324 .. warning::
1325 This option only works if particle identities
1326 are preserved between timesteps in the data files
1327
1328 .. important::
1329 With particle tracking limits set, the radius calculated via
1330 the ``calculate extra quantities`` option in the :ref:`sec:menu-d`
1331 is calculated relative to the tracked particle.
1332
1333 Centreing on a sink particle can also be achieved using the
1334 SPLASH_CENTRE_ON_SINK environment variable (see :ref:`sec:envvariables`).
1335
1336 Plotting in a comoving reference frame
1337 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1338
1339 A co-moving reference frame can be set using the
1340 ``make xy limits relative to particle`` option in the :ref:`sec:menu-l`. Coordinate limits are
1341 then centred on the selected particle for all timesteps, with offsets as
1342 input by the user. This effectively gives the ‘Lagrangian’ perspective.
1343 See :ref:`sec:track` for more details. Centreing on a sink
1344 particle can also be achieved using the SPLASH_CENTRE_ON_SINK
1345 environment variable.
1346
1347 Setting the origin to correspond to a particular particle
1348 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1349
1350 See :ref:`sec:track`.
1351
1352 Tracking a particle
1353 ~~~~~~~~~~~~~~~~~~~~
1354
1355 See :ref:`sec:track`.
1356
1357 .. _sec:tracksink:
1358
1359 Setting the origin to the position of the :math:`n`\ th sink particle
1360 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1361
1362 This can be achieved using the ``make xy limits relative to particle``
1363 option in the :ref:`sec:menu-l`. For example, to track the first sink
1364 particle we would proceed as follows:
1365
1366 ::
1367
1368 Please enter your selection now (y axis or option):l3
1369 ------------------ limits options ---------------------
1370 To track particle 4923, enter 4923
1371 To track the 43rd particle of type 3, enter 3:43
1372
1373 Enter particle to track: (default="0"): 3:1
1374
1375 where 3:1 indicates the first particle of type 3. The origin is set to
1376 the position of this particle and limits are relative to its position.
1377 See :ref:`sec:track` for more details.
1378
1379 Plotting radial plots around sink particles
1380 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1381
1382 First, set the origin to the location of the sink, as described above.
1383 Then simply change to spherical coordinates using the ``change coordinate systems``
1384 option in :ref:`sec:menu-o`. Alternatively, compute the radius using
1385 the ``calculate extra quantities`` option in the :ref:`sec:menu-d`.
1386
1387 Automatically adapting plot limits to match aspect ratio of output device
1388 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1389
1390 An option to automatically adjust the plot limits to match the aspect
1391 ratio of the output device is given in the :ref:`sec:menu-l`, and is also
1392 prompted for whenever the paper size is changed (via the ``change paper
1393 size`` option in the :ref:`sec:menu-p`, see :ref:`sec:papersize`).
1394
1395 Plotting with log axes.
1396 ~~~~~~~~~~~~~~~~~~~~~~~~
1397
1398 Log axes can be set either interactively (by pressing ``l`` with the
1399 cursor over the desired axis) or manually via the ``apply log or inverse
1400 transformations to columns`` option in the :ref:`sec:menu-l`. To use
1401 logarithmic axes labels as well, see :ref:`sec:loglabels`.
1402
1403 Plotting the square root, inverse or square of a quantity
1404 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1405
1406 Columns can be logged, inverted, sqrt-ed, squared or any combination of
1407 the above via the ``apply log or inverse transformations to columns``
1408 option in the :ref:`sec:menu-l`. If you have any additional transformations
1409 you would find useful please let me know, as it is straightforward to
1410 add more.
1411
1412 .. _sec:resetlimits:
1413
1414 Resetting limits for all columns
1415 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1416
1417 Limits for all columns can be reset to their minimum and maximum values
1418 from the current dump file via the ``reset limits for all columns`` option
1419 in the :ref:`sec:menu-l`. See :ref:`sec:interactive` for details of
1420 resetting plot limits for a particular plot interactively.
1421
1422 Restoring all plot limits to their minimum and maximum values in the current dump file
1423 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1424
1425 See :ref:`sec:resetlimits`.
1426
1427 .. _sec:rangerestrict:
1428
1429 Using a subset of data restricted by parameter range
1430 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1431
1432 You can use only a subset of the
1433 particles in both particle plots and :ref:`sec:renderplot`, according to
1434 restrictions on any or all of the data columns (for example, using only
1435 particles with :math:`\rho > 10`, in the 3D box
1436 :math:`x,y,z \in [-0.1, 0.1]`). Whilst this has always been possible by
1437 selecting, colouring and/or hiding particles in :ref:`sec:interactive` (see
1438 :ref:`sec:rendersubset`), the difference here is that the
1439 selection is based, for each timestep, strictly on the parameter range,
1440 rather than being a selection based on particle identity. This means
1441 that the parameter range is also saved to the ``splash.limits`` (i.e.,
1442 by :ref:`sec:menu-s`) and is shown when splash launches
1443 via lines such as:
1444
1445 ::
1446
1447 >> current range restrictions set:
1448
1449 ( 1.693E-01 < x < 1.820E-01 )
1450 ( 2.205E-01 < y < 2.265E-01 )
1451 ( 7.580E-06 < density < 2.989E-05 )
1452
1453 >> only particles within this range will be plotted
1454 and/or used in interpolation routines
1455
1456 or more usually:
1457
1458 ::
1459
1460 >> no current parameter range restrictions set
1461
1462 Parameter range restrictions can be set either manually via the :ref:`sec:menu-l`
1463 (option 7) or interactively by selecting a region in the plot and
1464 pressing ‘x’, ‘y’ or ‘r’ to restrict using the :math:`x`, :math:`y` or
1465 both :math:`x` and :math:`y` limits of the selected area respectively
1466 (pressing ‘R’ instead removes all currently set restrictions). Another
1467 way of setting manual range restrictions is simply to edit the
1468 ``splash.limits`` file directly (this simply contains the min and max
1469 limits for each column, followed optionally by a third and fourth column
1470 specifying, respectively, the min and max of the range restriction).
1471
1472 Plotting only particles with :math:`\rho > 10`, :math:`u > 20` and :math:`-0.25 < x < 0.25`
1473 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1474
1475 Plotting a subset of the particles restricted by a parameter can be
1476 achieved by setting a parameter range restriction (which does not change
1477 between timesteps – see :ref:`sec:rangerestrict`), or
1478 alternatively by an interactive selection based on particle identity
1479 (see :ref:`sec:rendersubset`).
1480
1481 .. _sec:menu-r:
1482
1483 (r)endering options
1484 -------------------
1485
1486 .. image:: figs/menu-r.png
1487 :width: 50.0%
1488
1489 Changing the number of pixels in a rendered image
1490 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1491
1492 The number of pixels in a rendered image can be set manually using the
1493 :ref:`sec:menu-r`, option 1 (or simply type ``r1`` from the main menu). The
1494 number set is the number of pixels along the :math:`x-`\ axis. The
1495 number of pixels along the :math:`y-`\ axis is determined by the aspect
1496 ratio of the plot.
1497
1498 The number of pixels used in an image is, by
1499 default, automatically determined by the actual number of pixels
1500 available on the graphics device, which depends in turn on the size of
1501 the page (the page size can be set manually in the :ref:`sec:menu-p` – see
1502 :ref:`sec:papersize`). For vector
1503 (non-pixel) devices such as postscript, svg or pdf, the number of pixels
1504 is set to :math:`1024/\textrm{n}`, where n is the number of panels
1505 across the page.
1506
1507 Changing the colour scheme
1508 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
1509
1510 The colour scheme used for :ref:`sec:renderplot` can be changed either by
1511 pressing ``m`` or ``M`` in :ref:`sec:interactive` to cycle through the available
1512 schemes or manually by using the ``change colour scheme`` option in the
1513 :ref:`sec:menu-r`.
1514
1515 A demonstration of all the colour schemes can be also be invoked from
1516 this menu option. Setting the colour scheme to zero plots only the
1517 contours of the rendered quantity (assuming that plot contours is set to
1518 true). The colour schemes available are shown in :numref:`fig:colourschemes`.
1519
1520 .. figure:: figs/colourschemes.pdf
1521 :alt: splash colour schemes
1522 :name: fig:colourschemes
1523
1524 splash colour schemes
1525
1526 User contributed colour schemes are eagerly invited (just send me
1527 either: a table of r,g,b colour indices [if you know them] or just an
1528 image of a colour bar you wish to reproduce and I will add it).
1529
1530 Plotting contours as well as the rendered image
1531 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1532
1533 Contours of either the rendered pixel array or of another (separate)
1534 quantity can be plotted on top of :ref:`sec:renderplot` by setting the
1535 ``plot contours`` option from the :ref:`sec:menu-r`. With this option set, an extra
1536 prompt will appear after the render prompt asking the user for a
1537 quantity to be contoured. The contoured quantity can also be set via the
1538 command line options (:ref:`sec:commandline`). If the rendered and
1539 contoured quantities are the same, further prompts appear which enable
1540 the limits for the contour plot to be set separately to the render plot.
1541 These limits are also saved separately in the ``splash.limits`` file
1542 when written.
1543
1544 .. hint::
1545 To plot contours *instead* of the rendered image, use the ``change colour
1546 scheme`` option from the :ref:`sec:menu-r` and choose colour scheme 0
1547 (contours only).
1548
1549 Plotting contours instead of a rendered image
1550 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1551
1552 To plot contours instead of the rendered image, use the ``change colour
1553 scheme`` option from the :ref:`sec:menu-r` and choose colour scheme 0
1554 (contours only).
1555
1556 Changing the number of contour levels
1557 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1558
1559 The number of contour levels used whenever contours are drawn can be set
1560 via the ``change number of contours`` option in the :ref:`sec:menu-r`. The
1561 contour levels can also be manually specified (see
1562 :ref:`sec:contoursmanual`).
1563
1564 .. _sec:contoursmanual:
1565
1566 Setting the contour levels manually
1567 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1568
1569 As of v1.15.0, contour levels can be set manually by creating a file
1570 called ``splash.contours`` in the current directory (or
1571 ``prefix.contours`` if the ``splash -p prefix`` is specified on the
1572 command line). This file should contain one contour level per line,
1573 optionally with a label for each contour, e.g.
1574
1575 ::
1576
1577 1.e-2 level 1
1578 1.e-1 level 2
1579 0.1 my really great contour
1580 1.0 hi mum
1581
1582 Adding numeric labels to contours
1583 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1584
1585 An option to write numeric labels on contours appears as part of the
1586 ``change number of contours`` option in the :ref:`sec:menu-r`.
1587
1588 Adding arbitrary contour labels
1589 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1590
1591 Contours can also be labelled manually by creating a ``splash.contours``
1592 file. See :ref:`sec:contoursmanual`.
1593
1594 Turning the colour bar off/ moving the colour bar label
1595 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1596
1597 The colour bar can be turned on or off and the style chosen (e.g.
1598 horizontal vs vertical) and for the vertical bar, the label moved closer
1599 to the bar itself, via the ``colour bar options`` option in the :ref:`sec:menu-r`.
1600
1601 To change the text in the colour bar label, see
1602 :ref:`sec:setprojlabel`.
1603
1604 .. _sec:colourbarstyle:
1605
1606 Changing the style of the colour bar
1607 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1608
1609 The colour bar style (i.e., vertical vs. horizontal, plot-hugging vs.
1610 non plot-hugging, one-sided vs. two-sided, floating vs. fixed) can be
1611 changed via the ``colour bar options`` option in the :ref:`sec:menu-r`. If
1612 you want a different style implemented, email me!
1613
1614 Using a horizontal colour bar
1615 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1616
1617 An option to use a horizontal colour bar instead of the default vertical
1618 arrangement is given in the ``colour bar options`` option in the :ref:`sec:menu-r`.
1619
1620 Using ‘plot-hugging’ colour bars
1621 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1622
1623 See :ref:`sec:colourbarstyle`.
1624
1625 Using floating/inset colour bars
1626 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1627
1628 See :ref:`sec:colourbarstyle`.
1629
1630 Plotting ticks on only one side of the colour bar
1631 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1632
1633 See :ref:`sec:colourbarstyle`.
1634
1635 Changing the text in the colour bar label
1636 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1637
1638 See :ref:`sec:setprojlabel`.
1639
1640 .. _sec:colournotrender:
1641
1642 Using coloured particles instead of rendering to pixels
1643 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1644
1645 As a simpler alternative to interpolating to a pixel array, particles
1646 can simply be coloured according to the value of a particular quantity
1647 by setting the ``use particle colours not pixels`` option in the :ref:`sec:menu-r`.
1648 With this option set, :ref:`sec:renderplot` are simply plotted by
1649 colouring the particles according to the rendered field. This is
1650 somewhat cruder but can be a good indication of where individual
1651 particles might be affecting results.
1652
1653 .. danger::
1654 Any colouring of the particles set in :ref:`sec:interactive` will be
1655 overwritten by use of this option.
1656
1657 Using normalised interpolations
1658 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1659
1660 A normalised interpolation to pixels can be used by setting the
1661 ``normalise interpolations`` option from the :ref:`sec:menu-r`. In general this
1662 leads to smoother rendering but also means that edges and surfaces
1663 appear more prominently (and a bit strange). The rule-of-thumb I
1664 suggest is to use this option when there are no free surfaces
1665 in the simulation.
1666
1667 .. warning::
1668 Normalising a 3D column density rendering means plotting the quantity
1669 :math:`\int \rho {\rm d}z / \int {\rm d}z`, which is a bit meaningless. More useful
1670 is to turn on :ref:`sec:densityweighted`, which gives a mass-weighted
1671 line of sight average. For example, plotting temperature, this
1672 would give :math:`\int \rho T {\rm d}z / \int \rho {\rm d}z` which is more meaningful.
1673
1674 Speeding up the rendering on 3D column integrated plots
1675 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1676
1677 Interpolation on 3D column integrated plots can be made faster by
1678 setting the ``use accelerated rendering`` option in the :ref:`sec:menu-r`. The
1679 reason this is an option is that it makes a small approximation by
1680 assuming that each particle lies exactly in the centre of a pixel. In
1681 general this works very well but is not set by default because it can
1682 produce funny looking results when the particles are aligned on a
1683 regular grid (e.g. as is often the case in initial conditions). Typical
1684 speed-ups range from :math:`\times 2` up to :math:`\times 4`, so it is
1685 highly recommended for interactive work.
1686
1687 .. _sec:densityweighted:
1688
1689 Density weighted interpolation
1690 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1691
1692 Density weighted interpolation (where a quantity is plotted times
1693 :math:`\rho`) can be turned on in the :ref:`sec:menu-r`.
1694
1695 Selecting and rendering only a subset of the particles
1696 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1697
1698 An example of how to render using only a selected subset of the
1699 particles was given in :ref:`sec:rendersubset`.
1700
1701 .. _sec:setprojlabel:
1702
1703 Changing the label used for 3D projection plots
1704 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1705
1706 The labelling scheme used to determine the colour bar label can be
1707 changed via the ``customize label on projection plots`` option in the
1708 :ref:`sec:menu-r`. Information specific to the quantity being rendered can be
1709 incorporated via format codes as follows:
1710
1711 ::
1712
1713 Example format strings:
1714 \(2268) %l d%z %uz : this is the default format "\int rho [g/cm^3] dz [cm]"
1715 column %l : would print "column density" for density
1716 surface %l : would print "surface density"
1717 %l integrated through %z : would print "density integrated through z"
1718
1719 Format codes:
1720 %l : label for rendered quantity
1721 %z : label for 'z'
1722 %uz : units label for z (only if physical units applied)
1723
1724 Changing “column density” to “surface density” on 3D plots
1725 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1726
1727 See :ref:`sec:setprojlabel`.
1728
1729 Changing the interpolation kernel
1730 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1731
1732 The kernel used for the interpolations is by default the M\ :math:`_{4}`
1733 cubic B-spline, which has been standard in SPH calculations since the
1734 mid-1980’s. Other kernels can be selected via the ``change kernel`` option
1735 in the :ref:`sec:menu-r`. The kernel can also be changed by setting the
1736 ``SPLASH_KERNEL`` environment variable to either the kernel name as
1737 listed in the :ref:`sec:menu-r`, or something sensible resembling it.
1738 At present only a few kernels are implemented, with ``cubic`` , ``quartic``
1739 and ``quintic`` referring to the M\ :math:`_{4}`, M\ :math:`_{5}` and
1740 M\ :math:`_{6}` B-splines with support of 2h and 3h, respectively. See
1741 [Price12]_ for more details.
1742
1743 .. _sec:menu-v:
1744
1745 (v)ector plot options
1746 ---------------------
1747
1748 .. image:: figs/menu-v.png
1749 :width: 50.0%
1750
1751 Changing the number of arrows on vector plots
1752 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1753
1754 See :ref:`sec:vecpix`.
1755
1756 .. _sec:vecpix:
1757
1758 Changing the number of pixels in vector plots
1759 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1760
1761 The number of pixels used on :ref:`sec:vectorplots` can be changed via the ``change
1762 number of pixels`` option in the :ref:`sec:menu-v`. This controls the number
1763 and average size of the arrows which appear (i.e., one arrow is plotted
1764 at the centre of each pixel).
1765
1766 Changing the size of arrows on vector plots
1767 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1768
1769 The size of the arrows on :ref:`sec:vectorplots` is proportional to the magnitude
1770 of the vector quantity at that pixel, where the maximum size is set from
1771 the maximum plot limit for the x, y and z components of the vector
1772 quantity being plotted such that the longest arrow fills one pixel.
1773 These limits can be changed manually via the :ref:`sec:menu-l` options. Where
1774 these limits are nowhere near the actual values of the vector field,
1775 arrows can appear either very big (just a line across the screen) or
1776 extremely small (appearing as just dots). Pressing ``w`` in :ref:`sec:interactive`
1777 automatically adjusts the arrows to sensible proportions (this is
1778 the equivalent of pressing ``a`` for non-vector quantities). Alternatively
1779 pressing ``v`` (to decrease) or ``V`` (to increase) can be used to adjust
1780 the arrow lengths (the change can be multiplied by 10 or more by first
1781 pressing ``z`` one or more times before pressing ``v`` or ``V``).
1782
1783 Plotting vector arrows in white instead of black or vice-versa
1784 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1785
1786 Vector arrows are by default plotted using the current foreground colour
1787 index (i.e., as used for plotting the axes). To plot in the background
1788 colour index instead set the ``use background colour for arrows`` option
1789 in the :ref:`sec:menu-v`.
1790
1791 Turning off the legend for vector plots
1792 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1793
1794 The legend which appears on :ref:`sec:vectorplots` can be turned on or off via the
1795 ``vector plot legend settings`` option in the :ref:`sec:menu-v`.
1796
1797 Moving the vector plot legend
1798 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1799
1800 The position of the :ref:`sec:vectorplots` legend can be set either interactively
1801 by positioning the mouse and pressing ``H`` or manually via the ``vector
1802 plot legend settings`` option in the :ref:`sec:menu-v`.
1803
1804 Plotting stream/fieldlines instead of arrows
1805 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1806
1807 To plot :ref:`sec:vectorplots` that use stream/fieldlines instead of arrows, set
1808 the ``plot stream/field lines instead of arrows`` option in the :ref:`sec:menu-v`.
1809 This option performs a simple integration of the interpolated vector
1810 field to get the stream function, the contours of which are then plotted
1811
1812 .. hint::
1813 The number of contours can be changed via the
1814 ``change number of contours`` option in the :ref:`sec:menu-r`. It is generally advantageous
1815 to use a larger number of pixels for the vector interpolation (See
1816 :ref:`sec:vecpix`) to get smooth contours.
1817
1818 At present this option works quite well for smooth vector fields but can
1819 perform poorly for vector fields with strong gradients.
1820
1821 Turning arrow heads off for vector plots
1822 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1823
1824 :ref:`sec:vectorplots` can be plotted using arrows without heads using the ``turn
1825 arrow heads on/off`` option in the :ref:`sec:menu-v`.
1826
1827 Hiding vector arrows where there are no SPH particles
1828 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1829
1830 On :ref:`sec:renderplot` often arrows can appear where there are apparently no
1831 SPH particles because the interpolation is performed to all pixels
1832 within :math:`2h` of an SPH particle. Such arrows in regions of few or
1833 no particles can be hidden using the ``hide arrows where there are no
1834 particles`` option in the :ref:`sec:menu-v`. A threshold number of particles for
1835 each pixel can be specified, below which no arrow will be plotted on
1836 that pixel.
1837
1838 Plotting a vector plot in a cross section slice
1839 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1840
1841 :ref:`sec:vectorplots` are either in a :ref:`sec:xsec` or are column
1842 integrated projections depending on the setting of the ``switch between
1843 cross section/projection`` option in the :ref:`sec:menu-x`. Setting this to cross
1844 section and plotting :ref:`sec:vectorplots` produces a vector plot in a cross
1845 section slice.
1846
1847 Making all arrow the same length (i.e., showing direction only, not magnitude)
1848 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1849
1850 An option to plot all vector arrows of the same length (instead of the
1851 default option where the length of the arrow is proportional to the
1852 vector magnitude) can be set from the :ref:`sec:menu-v`.
1853
1854 .. _sec:menu-x:
1855
1856 (x) cross section/3D plotting options
1857 -------------------------------------
1858
1859 .. image:: figs/menu-x.png
1860 :width: 50.0%
1861
1862 Plotting a cross section slice through 3D data
1863 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1864
1865 When plotting :ref:`sec:renderplot` of 3D data, the default option is to plot
1866 a column-integrated plot. To change this to a :ref:`sec:xsec`, use
1867 option 1) in the :ref:`sec:menu-x` (``switch between cross section/projection``).
1868 See :ref:`sec:basic` for examples of how this works. An oblique
1869 :ref:`sec:xsec` can be set interactively using the ``x`` key, see
1870 :ref:`sec:obliquexsec` which works by setting a combination of
1871 rotation and a :ref:`sec:xsec` position.
1872
1873 Plotting a cross section line through 2D data
1874 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1875
1876 In 2D, setting the ``switch between cross section/projection`` option in
1877 the :ref:`sec:menu-x` to :ref:`sec:xsec` means that :ref:`sec:renderplot` are in fact a 1D
1878 :ref:`sec:xsec` (i.e., a line) through 2D data. The position of the line
1879 is completely arbitrary (i.e., can be set for oblique cross sections as
1880 well as straight lines) and is set interactively after the usual
1881 :math:`y-` and :math:`x-` axis prompts.
1882
1883 Rotating the particles
1884 ~~~~~~~~~~~~~~~~~~~~~~~
1885
1886 An angle of rotation about may be set each axis may be set in the
1887 :ref:`sec:menu-x` using the ``rotation on/off/settings`` option or
1888 interactively (press ``h`` in :ref:`sec:interactive` to see the exact
1889 keystrokes). The position of the origin about which particles are
1890 rotated can be set from the ``rotation on/off/settings`` option in the :ref:`sec:menu-x`.
1891 Rotated axes or boxes can be plotted using the ``set axes for
1892 rotated/3D plots`` option in the same menu.
1893
1894 Rotations are performed in the order :math:`z-y-x`. This means that the
1895 :math:`y-` rotation angle is an angle about the *new* :math:`y-`\ axis,
1896 defined by the :math:`z` rotation and similarly for the :math:`x-`
1897 rotation. If you think about it long enough, it makes sense. If in
1898 doubt, do it interactively and set the angles in the order
1899 :math:`z-y-x`.
1900
1901 Setting the origin about which particles are rotated
1902 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1903
1904 The origin about which particles are rotated and relative to which the
1905 radius is calculated when the ``calculate extra quantities`` option is set
1906 in the :ref:`sec:menu-d` can be changed via the ``rotation on/off/settings``
1907 option in the :ref:`sec:menu-x`.
1908
1909 .. _sec:3Dperspective:
1910
1911 Adding 3D perspective
1912 ~~~~~~~~~~~~~~~~~~~~~~
1913
1914 3D perspective can be turned on via the ``3D perspective on/off`` option
1915 in the :ref:`sec:menu-x`. Prompts for setting the perspective position then appear
1916 after the usual prompts for y and x axes, :ref:`sec:renderplot` and :ref:`sec:vectorplots`,
1917 i.e., something like the following:
1918
1919 ::
1920
1921 Please enter your selection now (y axis or option):2
1922 (x axis) (default=1):
1923 (render) (0=none) ([0:20], default=0):
1924 (vector plot) (0=none, 7=B, 10=v, 17=J) ([0:17], default=0):
1925 enter z coordinate of observer (default=1.800):
1926 enter distance between observer and projection screen ([0.000:], default=0.1800):
1927 Graphics device/type (? to see list, default /xwin):
1928
1929 3D perspective is defined by two parameters: a distance to the observer
1930 :math:`zobs` and a distance between the observer and a screen placed in
1931 front of the observer, :math:`dscreen`. The transformation from usual
1932 :math:`x` and :math:`y` to screen :math:`x'` and :math:`y'` is then
1933 given by
1934
1935 .. math::
1936
1937 \begin{aligned}
1938 x' & = & x*dscreen/(zobs-z), \nonumber \\
1939 y' & = & y*dscreen/(zobs-z).\end{aligned}
1940
1941 This means that objects at the screen distance will have unit
1942 magnification, objects closer than the screen will appear larger (points
1943 diverge) and objects further away will appear smaller (points converge).
1944 The situation could be beautifully illustrated if I could be bothered
1945 drawing a figure. I have found reasonable results with something like a
1946 :math:`1/10` reduction at the typical distance of the object (i.e.,
1947 observer is placed at a distance of :math:`10\times` object size with
1948 distance to screen of :math:`1\times` object size). splash sets this as
1949 default using the z plot limit as the ‘object size’.
1950
1951 .. hint::
1952 The position of the 3D observer in :math:`z` can also be changed in
1953 :ref:`sec:interactive` using ``u`` or ``U`` (to move ’up’) and ``d`` or ``D`` (to move
1954 ``down``).
1955
1956 .. _sec:surface:
1957
1958 Using 3D surface rendering
1959 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
1960
1961 3D surface rendering (turned on using the ``3D surface rendering on/off``
1962 option in the :ref:`sec:menu-x`) performs a ray-trace through the particle data,
1963 thus visualising the "last scattering surface". When set, the user is
1964 prompted for an "optical depth" before plotting which determines the
1965 position of the surface. Only applies to 3D data. When set with
1966 cross-section (instead of projection), particles at or below the z value
1967 of the slice are used.
1968
1969 For examples of the 3D surface rendering in splash , have a look at my
1970 movies of neutron star mergers:
1971
1972 http://users.monash.edu.au/~dprice/research/nsmag.
1973
1974 Plotting 3D box / 3D axes
1975 ~~~~~~~~~~~~~~~~~~~~~~~~~~
1976
1977 Rotated axes or boxes can be plotted using the ``set axes for rotated/3D
1978 plots`` option in the :ref:`sec:menu-x`.
1979
1980 .. _sec:animseq:
1981
1982 Setting up animation sequences
1983 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1984
1985 Animation sequences can be set via the ``set animation sequence`` option
1986 in the :ref:`sec:menu-x`. At present the possible sequences that can be added are:
1987
1988 ::
1989
1990 1 : steady zoom on x and y axes
1991 2 : steady rotation
1992 3 : steady change of limits (e.g. for colour bar)
1993 4 : steady movement of 3D observer
1994 5 : sequence of cross section slices through a 3D box
1995 6 : steady change of opacity for 3D surface plots
1996
1997 Up to one sequence of each type can be added (i.e., up to 6 in total)
1998 with different start and end points (specified in terms of dump file
1999 number), with the additional possibility of inserting extra frames
2000 between dump files (e.g. to plot a sequence of frames consisting of a
2001 changing view of the same dump file).
2002
2003 Animation sequences can also be set using ``e`` in :ref:`sec:interactive`. To
2004 set a sequence interactively first adjust the plot settings to
2005 correspond to the start of the sequence (pressing ``s`` to save if this is
2006 done in :ref:`sec:interactive`). Then in :ref:`sec:interactive` move to the dump
2007 file you want to be the end-point and also adjust the plot settings to
2008 correspond to the end-point of your desired sequence (i.e., adjust the
2009 colour bar limits and/or adjust the rotation angle and/or the x/y limits
2010 and/or the 3D observer position and/or the opacity). Then, rather than
2011 pressing ``s`` (which would make these become the default plot settings)
2012 press ``e`` instead, saving these settings as the end-point of the desired
2013 animation sequence. This can be done multiple times to set multiple
2014 sequences.
2015
2016 Animation sequences set up in this manner are saved to a file called
2017 ``splash.anim`` either when prompted (if setting sequences
2018 non-interactively) or by pressing ’S’ from the main menu which then
2019 saves both the ``splash.limits`` and ``splash.anim`` files in addition
2020 to the usual ``splash.defaults`` file.
2021
2022 **Note:** Animation sequences act on a ‘per page’
2023 basis rather than simply ‘per frame’. This means that you can produce a
2024 multi-panelled movie (e.g.) showing the evolution of different runs side
2025 by side, with the same animation sequence applied to each.
2026
2027 Plotting a sequence of frames rotating a data set through 360 degrees
2028 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2029
2030 This can be achieved by setting an animation sequence with a steady
2031 change of rotation angle. See :ref:`sec:animseq`.
2032
2033 Plotting a ‘fly-around’ of 3D data
2034 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2035
2036 This can be achieved by setting an animation sequence with a steady
2037 change of rotation angle. See :ref:`sec:animseq`.
2038
2039 Plotting a flythru of 3D data
2040 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2041
2042 A sequence of :ref:`sec:xsec` slices progressively deeper into a 3D box or
2043 alternatively a steady movement of the 3D observer (on projection plots)
2044 can be plotted by setting up an animation sequence. See
2045 :ref:`sec:animseq`.
2046
2047 Adding a steady zoom sequence to a movie
2048 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2049
2050 A steady change of :math:`x-` and :math:`y-` limits can be added by
2051 setting up an animation sequence. See :ref:`sec:animseq`.
2052
2053 Adding a steady change of colour bar limits
2054 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2055
2056 A steady change of limits on the colour bar over one or more dump files
2057 for a movie can be implemented by setting up an animation sequence. See
2058 :ref:`sec:animseq` for details.
2059
2060 .. _sec:move3Dobserver:
2061
2062 Adding steady movement of the 3D observer
2063 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2064
2065 The position of the 3D observer can be steadily changed over several
2066 dump files (or several frames produced of the same dump file) by setting
2067 up an animation sequence. See :ref:`sec:animseq` for details.
2068
2069 Miscellaneous other useful things
2070 ---------------------------------
2071
2072 .. _sec:menu-h:
2073
2074 My attempt at in-built help
2075 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2076
2077 .. image:: figs/menu-h.png
2078 :width: 50.0%
2079
2080 The :ref:`sec:menu-h` does nothing particularly useful apart
2081 from tell you about menu shortcuts (see
2082 :ref:`sec:menushortcuts`). It seemed like a good idea at the
2083 time…
2084
2085 .. _sec:menushortcuts:
2086
2087 Keyboard shortcuts to menu options
2088 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2089
2090 .. image:: figs/menu-x1.png
2091 :width: 50.0%
2092
2093 Menu options which normally require two keystrokes (e.g. x menu, option
2094 1) can be shortcut to by simply typing the letter and number together at
2095 the main menu prompt (so e.g. ``x1`` for x menu, option 1, ``r2`` for render
2096 menu, option 2, etc.).
2097
2098 Exiting splash
2099 ~~~~~~~~~~~~~~~~
2100
2101 .. image:: figs/menu-q.png
2102 :width: 50.0%
2103
2104 (q)uit, unsurprisingly, quits. Typing a number greater than the number
2105 of data columns also exits the program (e.g. I often simply type 99 to
2106 exit).