File: getting-started.rst

package info (click to toggle)
splash 3.11.7-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,140 kB
  • sloc: f90: 56,721; ansic: 2,435; python: 828; makefile: 603; cpp: 529; perl: 219; sh: 152
file content (756 lines) | stat: -rw-r--r-- 49,340 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
Getting started
===============

.. _install:

Installing from your package manager
-------------------------------------
Pre-packaged builds of splash exist for most operating systems.

Stable version
~~~~~~~~~~~~~~
Mac OS via homebrew (recommended)::

  brew tap danieljprice/all
  brew install splash

You will also need to install `Xquartz <https://www.xquartz.org>`_ so that the X-windows server launches automatically.

Mac OS via Macports::

  sudo port install splash

Linux or Windows Linux Subsystem (Ubuntu)::

  sudo apt-get install splash

Development version
~~~~~~~~~~~~~~~~~~~

SPLASH and giza (the plotting backend) both have public repositories, so you can check out the latest and greatest code at any time. Both the splash and giza repositories are generally stable, so it is usually safe to get the very latest version. Just use:

Mac OS via homebrew::

  brew tap danieljprice/all
  brew install --HEAD splash

or compile from source following the instructions below.

Compiling from source
---------------------

Basic instructions
~~~~~~~~~~~~~~~~~~
If you have admin (super user) permissions

Ubuntu/Windows Subsystem for Linux::

   sudo apt-get install libcairo2-dev
   git clone https://github.com/danieljprice/giza.git; cd giza; ./configure; make; sudo make install; cd ..
   git clone https://github.com/danieljprice/splash.git
   cd splash; make SYSTEM=gfortran; sudo make install

Mac::

   git clone https://github.com/danieljprice/giza.git; cd giza; ./configure; make; sudo make install; cd ..
   git clone https://github.com/danieljprice/splash.git
   cd splash; make SYSTEM=gfortran; sudo make install

.. _installhome:

Installing in your home space
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If you do not have admin permissions. That is, to install in your home space::

   git clone https://github.com/danieljprice/splash.git
   cd splash; git clone https://github.com/danieljprice/giza.git
   make SYSTEM=gfortran withgiza

.. important::
   If you have installed splash in your home space, you will need to set the following environment variables for everything to work. Put the following commands in your ~/.bashrc file or equivalent, so they are set every time you log in::

      export SPLASH_DIR=$HOME/splash
      export PATH=$PATH:$SPLASH_DIR/bin
      export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$SPLASH_DIR/giza/lib

Advanced installation guide
---------------------------

The basic steps for installation are as follows:

#. make sure you have a recent Fortran compiler (such as gfortran)

#. make sure you have cairo on your system

#. compile splash and giza

Fortran compilers
~~~~~~~~~~~~~~~~~~~

Numerous Fortran 90/95/2003 compilers exist. The most widely
available are:

-  gfortran, the free Gnu Fortran Compiler
   http://gcc.gnu.org/wiki/GFortran

-  ifort, one of the most widely available commercial compilers (and is
   very good) with (limited) free licence for Linux.
   http://software.intel.com/en-us/articles/intel-compilers/

Both of these successfully compile splash and the giza library.

Cairo graphics library
~~~~~~~~~~~~~~~~~~~~~~~
Cairo is a low-level system library used in many applications. Thus it is highly
likely that you already have a copy on your system and already in your library path.
Look for the header file cairo.h, e.g. using::

   locate cairo.h

or have a look in the usual places (e.g. /usr/include/cairo, /usr/X11/include). If not,
you can usually use your inbuilt package manager to install cairo as follows:

   Debian/Ubuntu:
      sudo apt-get install libcairo2-dev
   Fedora/Red Hat/CentOS:
      sudo yum install cairo-devel
   OpenSUSE:
      zypper install cairo-devel
   MacPorts:
      sudo port install cairo

Alternatively, use the script provided in the root-level splash directory::

   ./install-cairo.sh

which downloads and installs both pixman and cairo into the giza/ subdirectory.
Unlike the methods above, this does not require any admin/superuser permissions.

Compiling and linking with giza
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

You can either install giza with your package manager, or in a subdirectory
of splash. To install in a splash subdirectory, use::

	cd splash
	git clone http://github.com/danieljprice/giza
   make withgiza

of splash.

With giza installed via your package manager (or previously compiled as below), use::

   cd splash
   make GIZA_DIR=/usr/local

where ``GIZA_DIR`` points to the directory where giza was installed.
To install giza in a splash subdirectory, use::

   cd splash
   git clone http://github.com/danieljprice/giza
   make withgiza

A successful ``make`` will produce a binary called ``splash``

Reading your data
-----------------

The most important part is getting splash to read \*your\* data format.
If you are using a publicly available code, it is reasonably likely
that I have already written a read data subroutine which will read your
dumps. If not it is best to look at some of the other examples and
change the necessary parts to suit your data files. Note that reading
directly from unformatted data files is \*much\* faster than reading
from formatted (ascii) output.

A standard ``make`` will create a binary which supports the file formats listed in
:ref:`tab:defaultreads`, plus a bunch of others (type ``splash --formats`` to see what formats your build supports).
All data formats are supported in the splash binary by default unless there 
are external library dependencies (e.g. ``HDF5``) .

The format of the file can in many cases be successfully guessed from the file extension or header, so you can simply type::

	splash disc_00000

Otherwise you can specify the data type you are reading using the ``-f`` or ``--format`` flag. For example,
the following will read a phantom dumpfile::

	splash --format phantom disc_00000

For backwards compatibility with previous version of ``splash``, one can add aliases into their `.bashrc`, or equivalent::

   alias asplash='splash ' # Alias for ascii splash
   alias ssplash='splash -f phantom '
   alias gsplash='splash -f gadget '
   alias tsplash='splash -f tipsy '

If splash is compiled with ``HDF5=yes``, the formats listed in :ref:`tab:hdf5reads` will also be available in the ``splash`` binary.
Other supported formats are listed in :ref:`tab:otherreads`, but these require additional libraries.

.. table:: Binaries and data reads compiled by default
   :name: tab:defaultreads

   +------------------------------+----------------------------+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | ``splash`` command           | Format Read                | ``read_data`` File            |  Comments                                                                                                                                                                                                                                         |
   +==============================+============================+===============================+===================================================================================================================================================================================================================================================+
   | ``splash -ascii <file>``     | ascii, csv                 | ``read_data_ascii.f90``       | Generic data read for n-column ascii formats. Automatically determines number of columns and skips header lines. Can recognise SPH particle data based on the column labels. Use ``splash -e`` to plot non-SPH data (e.g.  energy vs time files)  |
   +------------------------------+----------------------------+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | ``splash -dragon <file>``    | dragon                     | ``read_data_dragon``          | See environment variable  options.                                                                                                                                                                                                                |
   +------------------------------+----------------------------+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | ``splash -gadget <file>``    | gadget, gadget-2, gadget-3 | ``read_data_gadget.f90``      | Handles both default and block-labelled formats (see  environment variable  options).                                                                                                                                                             |
   +------------------------------+----------------------------+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | ``splash -ndspmhd <file>``   | ndspmhd                    | ``read_data_ndspmhd.f90``     | Format for the ndspmhd SPH/SPMHD code (publicly available from  my  website).                                                                                                                                                                     |
   +------------------------------+----------------------------+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | ``splash -phantom <file>``   | sphNG, Phantom             | ``read_data_sphNG.f90``       | sphNG is Matthew Bate's SPH code. Option ``-sphng`` also  works.                                                                                                                                                                                  |
   +------------------------------+----------------------------+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | ``splash -magma <file>``     | magma                      | ``read_data_srosph.f90``      | Stephan Rosswog's  code                                                                                                                                                                                                                           |
   +------------------------------+----------------------------+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | ``splash -seren <file>``     | seren                      | ``read_data_seren.f90``       | The SEREN SPH code (Hubber, McLeod et  al.)                                                                                                                                                                                                       |
   +------------------------------+----------------------------+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | ``splash -gasoline <file>``  | gasoline, tipsy            | ``read_data_tipsy.f90``       | Reads both binary and ascii TIPSY files (determined automatically). Option ``-tipsy`` also  works.                                                                                                                                                |
   +------------------------------+----------------------------+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | ``splash -vine <file>``      | vine                       | ``read_data_fine.f90``        | See environment variable  options.                                                                                                                                                                                                                |
   +------------------------------+----------------------------+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   |``splash -starsmasher <file>``| StarSmasher                | ``read_data_starsmasher.f90`` | The `StarSmasher <http://jalombar.github.io/starsmasher/>`_ code (Gaburov et al. 2018)                                                                                                                                                            |
   +------------------------------+----------------------------+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | ``splash file.vtk``          | vtk legacy binary          | ``read_data_vtk.f90``         | VTK legacy binary format (UNSTRUCTURED_GRID and STRUCTURED_GRID), e.g. from Shamrock code                                                                                                                                                                                                 |
   +------------------------------+----------------------------+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

Below is a list of the supported data formats that require ``HDF5``.

.. table:: Supported HDF5 data formats
   :name: tab:hdf5reads

   +--------------------------------+------------------------+-------------------------------+-----------------------------------------------------------------------------------------+
   | ``splash`` Command             | Read Format            | ``read_data`` File            |    Comments                                                                             |
   +================================+========================+===============================+=========================================================================================+
   | ``splash -gadget_hdf5 <file>`` | gadget HDF5 Files.     | ``read_data_gadget_hdf5.f90`` | Reads HDF5 format from the gadget code (automatically recognised)                       |
   +--------------------------------+------------------------+-------------------------------+-----------------------------------------------------------------------------------------+
   | ``splash -amuse <file>``       | AMUSE HDF5             | ``read_data_amuse_hdf5.f90``  | Reads HDF5 format from the AMUSE framework.                                             |
   +--------------------------------+------------------------+-------------------------------+-----------------------------------------------------------------------------------------+
   | ``splash -cactus_hdf5 <file>`` | Cactus HDF5            | ``read_data_cactus_hdf5.f90`` |                                                                                         |
   +--------------------------------+------------------------+-------------------------------+-----------------------------------------------------------------------------------------+
   | ``splash -flash_hdf5 <file>``  | FLASH tracer particles | ``read_dataflash_hdf5.f90``   | Reads tracer particle output from the FLASH code. The option ``-flash`` will also work. |
   +--------------------------------+------------------------+-------------------------------+-----------------------------------------------------------------------------------------+
   | ``splash -falcon_hdf5 <file>`` | falcON                 | ``read_data_falcON_hdf5.f90`` | Walter Dehnen's SPH code format. The option ``-falcon`` will also work.                 |
   +--------------------------------+------------------------+-------------------------------+-----------------------------------------------------------------------------------------+

If the ``HDF5`` read files end with ``.h5``, the suffix ``_hdf5`` from the ``splash`` command can be removed.
For example::

	splash -gadget dump_000.h5

will recognise that the file ``dump_000.h5`` is in the ``HDF5`` format, and will automatically select the correct ``read_data`` routine.

Below is a list of other formats supported, but have additional library requirements.

.. table:: Other supported file formats that require external libraries
   :name: tab:otherreads

   +---------------------------+--------------+--------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | ``splash`` Command        | Read Format  | ``read_data`` File       | Comments                                                                                                                                                                   |
   +===========================+==============+==========================+============================================================================================================================================================================+
   | ``splash -pbob <file>``   | PBOB Files   | ``read_data_pbob.f90``   | Requires the PBOB Library. Compile ``splash`` with ``PBOB_DIR=/path/to/pbob/``.                                                                                            |
   +---------------------------+--------------+--------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | ``splash -h5part <file>`` | H5Part Files | ``read_data_h5part.f90`` | Requires the H5Part and HDF5 libraries. Compile ``splash`` with ``H5PART_DIR=/path/to/h5part/``.                                                                           |
   +---------------------------+--------------+--------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | ``splash file.fits``      | FITS files   | ``read_data_fits.f90``   | Requires FITS libraries. Try to compile ``splash`` with ``FITS=yes``. If this does not work, point to the location of your fits libraries with ``FITS_DIR=/path/to/fits``. |
   +---------------------------+--------------+--------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+


Further details on writing your own subroutine are given in
appendix :ref:`sec:writeyourown`. The \*easiest\* way is to i)
email me a sample data file and ii) the subroutine you used to write it,
and I will happily create a data read for your file format.

.. _sec:commandline:

Command line options
--------------------

Typing ``splash --help`` gives a complete and up-to-date list of options. Currently these are:

::

   Command line options:
    
    -f format         : input file format to be read (default is ascii, --formats for full list)
    -p fileprefix     : change prefix to ALL settings files read/written by splash 
    -e, -ev           : use default options best suited for line plotting (.ev files)
    -360              : set default options suited to 360 video
    -b, --buffer      : buffer all data files into memory
    -o pixformat      : dump pixel map in specified format (use just -o for list of formats)
    
   Command line plotting mode:
    
    -x column         : x axis
    -y column         : y axis
    -r[ender] column  : column to render (will use 1 and 2 as x,y if -x,-y not specified)
    -vec[tor] column  : vector quantity to plot with arrows
    -c[ontour] column : contoured quantity
    -multi            : multiplot
    -dev device       : specify plotting device on command line (e.g. -dev /xw)
    --movie           : shortcut for -dev /mp4 to make a movie from plot sequence
    --xsec=1.0        : specify location of cross section slice
    --kappa=1.0       : specify opacity, and turn on opacity rendering
    --anglex=30       : rotate around x axis (similarly --angley, --anglez)
    --code            : enforce code units (also --codeunits)
    --sink=1          : centre on sink particle number 1
    --origin=666      : set coordinate system origin to particle number 666
    --origin=maxdens  : set coordinate system origin to particle at maximum density
    --track=666       : track particle number 666
    --track=maxdens   : track particle at maximum density
    --exact=file1,f2  : read and plot exact solution from ascii files file1 and f2
    --sort            : sort filenames for comparison (e.g. snap_000 snap1_000 snap2_000)
    --sortpad         : sort filenames and pad all sequences to same length

   Example data formats (type --formats for full list):
    
    -ascii,-csv          : ascii text/csv format (default)
    -phantom -sphng      : Phantom and sphNG codes (auto)
    -vtk                 : vtk legacy binary format (auto)
    -ndspmhd             : ndspmhd code (auto)
    -gandalf,-seren      : Gandalf/Seren code
    -gadget -gadget_hdf5 : Gadget code (auto)
    -falcon -falcon_hdf5 : FalcON code
    -flash  -flash_hdf5  : FLASH code
    -cactus -cactus_hdf5 : Cactus code
    -amuse  -amuse_hdf5  : AMUSE Framework
    -fits                : FITS format (auto)
    
    HDF5 files will be automatically recognised if they end with .h5, however you
    must specify a supported data format.
    add a suffix "_hdf5" to above format if your data files do not end with .h5.

    convert mode ("splash to X dumpfiles"):
    splash to ascii   : convert SPH data to ascii file dumpfile.ascii

           to binary  : convert SPH data to simple unformatted binary dumpfile.binary
                         write(1) time,npart,ncolumns
                         do i=1,npart
                            write(1) dat(1:ncolumns),itype
                         enddo
           to phantom : convert SPH data to binary dump file for PHANTOM
           to gadget  : convert SPH data to default GADGET snapshot file format

    Grid conversion mode ("splash to X dumpfiles"):
       splash to grid         : interpolate basic SPH data (density, plus velocity if present in data)
                                to 2D or 3D grid, write grid data to file (using default output=ascii)
              to gridascii    : as above, grid data written in ascii format
              to gridbinary   : as above, grid data in simple unformatted binary format:
                                   write(unit) nx,ny,nz,ncolumns,time                 [ 4 bytes each ]
                                   write(unit) (((rho(i,j,k),i=1,nx),j=1,ny),k=1,nz)  [ 4 bytes each ]
                                   write(unit) (((vx(i,j,k), i=1,nx),j=1,ny),k=1,nz)  [ 4 bytes each ]
                                   write(unit) (((vy(i,j,k), i=1,nx),j=1,ny),k=1,nz)  [ 4 bytes each ]
                                   write(unit) (((...(i,j,k),i=1,nx),j=1,ny),k=1,nz)  [ 4 bytes each ]
           allto grid         : as above, interpolating *all* columns to the grid (and output file)
           allto gridascii    : as above, with ascii output
           allto gridbinary   : as above, with binary output

    Analysis mode ("splash calc X dumpfiles") on a sequence of dump files:
     splash calc energies     : calculate KE,PE,total energy vs time
                                output to file called 'energy.out'
            calc massaboverho : mass above a series of density thresholds vs time
                                output to file called 'massaboverho.out'
            calc max          : maximum of each column vs. time
                                output to file called 'maxvals.out'
            calc min          : minimum of each column vs. time
                                output to file called 'minvals.out'
            calc diff           : (max - min) of each column vs. time
                                output to file called 'diffvals.out'
            calc amp          : 0.5*(max - min) of each column vs. time
                                output to file called 'ampvals.out'
            calc delta        : 0.5*(max - min)/mean of each column vs. time
                                output to file called 'deltavals.out'
            calc mean         : mean of each column vs. time
                                output to file called 'meanvals.out'
            calc rms          : (mass weighted) root mean square of each column vs. time
                                output to file called 'rmsvals.out'
            calc tracks       : track particle data vs time for selected particles,
               --track=1,2,3    output to tracks-1.out,tracks-2.out,tracks-3.out

     the above options all produce a small ascii file with one row per input file.
     the following option produces a file equivalent in size to one input file (in ascii format):

            calc timeaverage  : time average of *all* entries for every particle
                                output to file called 'time_average.out'

            calc ratio        : ratio of *all* entries in each file compared to first
                                output to file called 'ratio.out'

            calc plus         : add two snapshots together
                                output to file called 'plus.out'

Command-line options can be entered in any order on the command line
(even after the dump file names). For more information on the convert
utility (``splash to ascii``) see :ref:`sec:convert`. For details
of the ``-o ppm`` or ``-o ascii`` option see :ref:`sec:writepixmap`. For details of the ``-ev`` option, see :ref:`sec:evsplash`.


Options affecting all data reads
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Command line flags (or environment variables) that affect all data reads are:

+----------------------+-----------------------+-------------------------------------------------+
| ---defaults          | SPLASH_DEFAULTS       | gives name of system-wide ``splash.defaults``   |
|                      |                       | file (and splash.limits etc.) that will be      |
|                      |                       | used if there is none in the current dir. e.g.  |
|                      |                       | ``--defaults=$HOME/splash.defaults``            |
+----------------------+-----------------------+-------------------------------------------------+
| ---kernel='quintic'  | SPLASH_KERNEL         | changes the smoothing kernel used in the        |
|                      |                       | interpolations (e.g. ``cubic`` or ``quintic``). |
|                      |                       | Can also be changed in the :ref:`sec:menu-r`.   |
+----------------------+-----------------------+-------------------------------------------------+
| ---debug             | SPLASH_DEBUG          | if set to ``yes`` or ``true``, turns on verbose |
|                      |                       | debugging output. Useful to trace code crashes  |
|                      |                       | (but of course, this never happens…).           |
+----------------------+-----------------------+-------------------------------------------------+
| ---sink=1            | SPLASH_CENTRE_ON_SINK | if set to a number n, centres coordinates and   |
|                      |                       | velocities on the nth sink/star particle (e.g.  |
|                      |                       | ``export SPLASH_CENTRE_ON_SINK=2``)             |
+----------------------+-----------------------+-------------------------------------------------+
| ---corotate          | SPLASH_COROTATE       | plot in corotating frame based on locations of  |
|                      |                       | 2 sink particles (e.g. ``--corotate=1,3``)      |
+----------------------+-----------------------+-------------------------------------------------+
| ---origin=666        | SPLASH_ORIGIN         | recentre the coordinate origin and velocities   |
|                      |                       | to the selected particle (e.g. particle 666)    |
+----------------------+-----------------------+-------------------------------------------------+
| ---origin=maxdens    | SPLASH_ORIGIN         | reset origin to particle at maximum density     |
+----------------------+-----------------------+-------------------------------------------------+
| --dontcentrevel='y'  | SPLASH_DONTCENTREVEL  | used along with SPLASH_CENTRE_ON_SINK or        |
|                      |                       | SPLASH_ORIGIN. If true, then the velocities     |
|                      |                       | will not be made relative to the sink or        |
|                      |                       | particle.                                       |
+----------------------+-----------------------+-------------------------------------------------+
| ---track=4789        | SPLASH_TRACK          | set limits of all quantities relative to those  |
|                      |                       | of the selected particle (e.g. particle 4789)   |
+----------------------+-----------------------+-------------------------------------------------+
| ---track=maxdens     | SPLASH_TRACK          | track the particle at maximum density           |
+----------------------+-----------------------+-------------------------------------------------+
| ---vzero=1.0,1.0,1.0 | SPLASH_VZERO          | subtract reference velocity from all particles  |
|                      |                       | (velocity should be specified in code units)    |
+----------------------+-----------------------+-------------------------------------------------+
| ---exact=file1,file2 |                       | plot exact solution from files file1 and file2  |
+----------------------+-----------------------+-------------------------------------------------+
| ---beam=2.0          | SPLASH_BEAM           | if given a value :math:`>`\ 0 enforces a minimum|
|                      |                       | smoothing length, specified in code units,      |
|                      |                       | all the particles. Useful to "dumb-down" the    |
|                      |                       | resolution of SPH simulations to match          |
|                      |                       | observational resolution. If this variable is   |
|                      |                       | set the "accelerated rendering" option in the   |
|                      |                       | :ref:`sec:menu-r` is also turned on, otherwise  |
|                      |                       | slow rendering can result.                      |
+----------------------+-----------------------+-------------------------------------------------+
| ---xmin=0.1          | SPLASH_MARGIN_XMIN    | can be used to manually adjust the left page    |
| ---xmax=0.1          | SPLASH_MARGIN_XMAX    | page margin (set to fraction of viewport,       |
| ---ymin=0.1          | SPLASH_MARGIN_YMIN    | negative values are allowed).                   |
| ---ymax=0.1          | SPLASH_MARGIN_YMAX    |                                                 |
+----------------------+-----------------------+-------------------------------------------------+

.. _sec:splash:

Ascii data read
~~~~~~~~~~~~~~~~

For several data reads there are command-line flags which can be set
at runtime which are specific to the data read. For the ascii data read
(``splash -f ascii``) these are:

+-------------------------------------+-----------------------------------+
| ``--ncolumns=10``                   | if given a value :math:`>`\ 0     |
|                                     | sets the number of columns to be  |
|                                     | read from ascii data (overrides   |
|                                     | the automatic number of columns   |
|                                     | determination).                   |
+-------------------------------------+-----------------------------------+
| ``--nheaderlines=3``                | if given a value :math:`>=`\ 0    |
|                                     | sets the number of header lines   |
|                                     | to skip (overrides the automatic  |
|                                     | determination).                   |
+-------------------------------------+-----------------------------------+
| ``--columnsfile=/home/me/mylabels`` | can be used to provide the        |
|                                     | location of (path to) the default |
|                                     | ``columns`` file containing the   |
|                                     | labels for ascii data. Overridden |
|                                     | by the presence of a local        |
|                                     | ``columns`` file.                 |
+-------------------------------------+-----------------------------------+
| ``--time=3.0``                      | if given a nonzero value sets the |
|                                     | time to use in the legend (fixed  |
|                                     | for all files)                    |
+-------------------------------------+-----------------------------------+
| ``--gamma=1.667``                   | if given a nonzero value sets     |
|                                     | gamma to use in exact solution    |
|                                     | calculations (fixed for all       |
|                                     | files)                            |
+-------------------------------------+-----------------------------------+
| ``--timeheader=1``                  | sets the integer line number      |
|                                     | where the time appears in the     |
|                                     | header                            |
+-------------------------------------+-----------------------------------+
| ``--gammaheader=3``                 | sets the integer line number      |
|                                     | where gamma appears in the header |
+-------------------------------------+-----------------------------------+

The above options can be set as environment variables by prefixing them
with ASPLASH, e.g.::

  export ASPLASH_NCOLUMNS=10
  splash datafile.txt

.. _sec:splash -gadget:

GADGET data read
~~~~~~~~~~~~~~~~~

For the GADGET read (``splash -f gadget`` or just ``splash``) the options are:

+-----------------------------------+-----------------------------------+
| ``--format=2``                    | if set = 2, force read of block   |
|                                   | labelled GADGET format instead of |
|                                   | the default (non block labelled)  |
|                                   | format.                           |
+-----------------------------------+-----------------------------------+
| ``--usez``                        | if ``yes`` or ``true`` uses the   |
|                                   | redshift in the legend instead of |
|                                   | code time.                        |
+-----------------------------------+-----------------------------------+
| ``--hsoft=500.``                  | if given a value :math:`>` 0.0    |
|                                   | will assign a smoothing length to |
|                                   | dark matter particles for which   |
|                                   | rendered plots of column density  |
|                                   | can then be made.                 |
+-----------------------------------+-----------------------------------+
| ``--extracols``                   | if set to a comma separated list  |
|                                   | of column labels, will attempt to |
|                                   | read additional columns           |
|                                   | containing gas particle           |
|                                   | properties beyond the end of the  |
|                                   | file (not applicable if           |
|                                   | --format=2).                      |
+-----------------------------------+-----------------------------------+
| ``--starpartcols``                | if set to a comma separated list  |
|                                   | of column labels, will attempt to |
|                                   | read additional columns           |
|                                   | containing star particle          |
|                                   | properties beyond the end of the  |
|                                   | file (and after any extra gas     |
|                                   | particle columns) (not applicable |
|                                   | if GSPLASH_FORMAT=2).             |
+-----------------------------------+-----------------------------------+
| ``--checkids``                    | if set to ``yes`` or ``true``,    |
|                                   | reads and checks particle IDs,    |
|                                   | excluding particles with negative |
|                                   | IDs as accreted (gives them a     |
|                                   | negative smoothing length which   |
|                                   | means they are ignored in         |
|                                   | renderings).                      |
+-----------------------------------+-----------------------------------+
| ``--hcolumn``                     | if set to a positive integer,     |
|                                   | specifies the location of the     |
|                                   | smoothing length in the columns,  |
|                                   | overriding any default settings.  |
+-----------------------------------+-----------------------------------+
| ``--ignore-iflagcool``            | if set,does                       |
|                                   | not assume that extra columns are |
|                                   | present even if the cooling flag  |
|                                   | is set in the header.             |
+-----------------------------------+-----------------------------------+

For backwards compatibility, the above options can also be set as
environment variables by prefixing them with GSPLASH, e.g.::

  export GSPLASH_FORMAT=2
  splash -gadget snap_00010

which is equivalent to::

  splash -f gadget --format=2 snap_00010

For the GADGET read gsplash will also look for, and read if present,
files called ``snapshot_xxx.hsml`` and/or ``snapshot_xxx.dens`` (where
``snapshot_xxx`` is the name of the corresponding GADGET dump file)
which contain smoothing lengths and/or a density estimate for dark
matter particles (these should just be one-column ascii files).

VINE data read
~~~~~~~~~~~~~~~

For the VINE read (``splash -vine``) the options are:

+-----------------------------------+-----------------------------------+
| ``--hfac``                        | if ``yes`` or ``true`` multiplies |
|                                   | smoothing length read from the    |
|                                   | dump file by a factor of 2.8 (for |
|                                   | use with older VINE dumps where   |
|                                   | the smoothing length is defined   |
|                                   | as in a Plummer kernel rather     |
|                                   | than as the usual SPH smoothing   |
|                                   | length).                          |
+-----------------------------------+-----------------------------------+
| ``--mhd``                         | if set, reads VINE                |
|                                   | dumps containing MHD arrays       |
|                                   | (or set VINE_MHD=yes)             |
+-----------------------------------+-----------------------------------+

Phantom/sphNG data read
~~~~~~~~~~~~~~~~~~~~~~~~

For the sphNG and PHANTOM read (``splash -phantom``) the options are:

+-------------------+-------------------------------------------------------+
| ``--cm``          | resets the positions such that the centre of          |
|                   | mass is exactly at the origin.                        |
+-------------------+-------------------------------------------------------+
| ``--dense``       | resets the positions such that the centre of          |
|                   | mass of the densest clump is exactly at the origin.   |
+-------------------+-------------------------------------------------------+
| ``--omega=3.142`` | if non-zero, subtracts solid body rotation with omega |
|                   | as specified to give velocities in co-rotating frame  |
+-------------------+-------------------------------------------------------+
| ``--omegat=3.142``| same as --omega but applies to velocities also        |
+-------------------+-------------------------------------------------------+
| ``--timeunit=hrs``| sets default time units, either 's', 'min', 'hrs',    |
|                   | 'days', 'yr' or 'tfreefall' (used verbatim in legend) |
+-------------------+-------------------------------------------------------+

dragon data read
~~~~~~~~~~~~~~~~~

For the dragon read (``splash -dragon``) the options are:

+-----------------------------------+-----------------------------------+
| ``--extracols``                   | specifies number of extra columns |
|                                   | present in the file which are     |
|                                   | dumped after the itype array      |
+-----------------------------------+-----------------------------------+

Stephan Rosswog data read
~~~~~~~~~~~~~~~~~~~~~~~~~~

For the srosph read (``splash``) the options are:

+-----------------------------------+-----------------------------------+
| ``--format=MHD``                  | can be ``MHD`` or ``HYDRO`` which |
|                                   | read the appropriate data format  |
|                                   | from either the MHD or            |
|                                   | hydrodynamic codes                |
+-----------------------------------+-----------------------------------+
| ``--com``                         | if set resets the                 |
|                                   | positions such that the centre of |
|                                   | mass is exactly at the origin.    |
+-----------------------------------+-----------------------------------+
| ``--corotating``                  | velocities are transformed to     |
|                                   | corotating frame                  |
+-----------------------------------+-----------------------------------+
| ``--hfact=1.2``                   | can be changed to give correct    |
|                                   | parameter in                      |
|                                   | :math:`h=h_{fact}(m/\rho)^{1/3}`  |
|                                   | used to set the particle masses   |
|                                   | when rendering minidumps (i.e.,   |
|                                   | when the mass is not dumped).     |
|                                   | Default is RSPLASH_HFACT=1.5      |
+-----------------------------------+-----------------------------------+

ndspmhd data read
~~~~~~~~~~~~~~~~~~

For the ndspmhd read (``splash -ndspmhd``) the options are:

+-----------------------------------+-----------------------------------+
| ``--barycentric``                 | plots barycentric quantities for  |
|                                   | one-fluid dust instead of         |
|                                   | creating fake second set of       |
|                                   | particles                         |
+-----------------------------------+-----------------------------------+

H5Part data read
~~~~~~~~~~~~~~~~~

For the H5PART read (``splash -f h5part``) the options are:

+-----------------------------------+------------------------------------+
| ``--ndim=3``                      | number of spatial dimensions       |
|                                   | :math:`d` (overrides value         |
|                                   | inferred from data)                |
+-----------------------------------+------------------------------------+
| ``--hfac=1.2``                    | factor to use to compute h from    |
|                                   | :math:`h = h_{fac} *(m/\rho)^{1/d}`|
|                                   | if h not present in data           |
+-----------------------------------+------------------------------------+
| ``--hsml=3.0``                    | value for global smoothing length  |
|                                   | h (if h not present in data)       |
+-----------------------------------+------------------------------------+
| ``--typeid=MatID``                | name of the dataset containing     |
|                                   | the particle type identification   |
|                                   | (default is "MatID")               |
+-----------------------------------+------------------------------------+

.. _sec:envvariables:

Environment variables
---------------------

Several runtime options for splash can be set using environment
variables. These are variables set from your unix shell. In the bash
shell, environment variables are set from the command line using

::

   export VAR='blah'

or by putting this command in your ``.bash_profile``/``.bashrc``. In
csh, the equivalent is

::

   setenv VAR 'blah'

or by putting the above in your ``.cshrc`` file.

Changing the font
~~~~~~~~~~~~~~~~~~

Several environment variables affect the backend plotting library.
Probably the most useful is the ability to change font:

::

   export GIZA_FONT='Helvetica'

where the name is a reasonable guess as to the font you want to use (the
default is ``Times``). In particular, if you are having trouble displaying
unicode characters such as greek letters, you can just change the font
until you find one that works.

Endian changing
~~~~~~~~~~~~~~~~

On some compilers, the endian-ness (byte order) when reading unformatted
binary data files can be changed at runtime. This is useful for looking
at files on different systems to the one on which they were created
(e.g. x86 machines create little-endian files by default, whereas
IBM/powerpc machines create big-endian). Environment variables for
changing the endian-ness of the data read for some common compilers are
given below:

+-------------+----------------------------+----------------+-------------------+----------+
| Compiler    | Environment variable       | Big endian     | Little endian     | Other    |
+=============+============================+================+===================+==========+
| gfortran    | ``GFORTRAN_CONVERT_UNIT``  | ``big_endian`` | ``little_endian`` | ``swap`` |
+-------------+----------------------------+----------------+-------------------+----------+
| ifort       | ``F_UFMTENDIAN``           | ``big``        | ``little``        |          |
+-------------+----------------------------+----------------+-------------------+----------+

For compilers without this feature, almost all can change the
endian-ness at compile time, and the appropriate flags for doing so can
be set using

::

   export ENDIAN='BIG'

or LITTLE before *compiling* splash (this adds the appropriate
compile-time flags for the compiler selected using the SYSTEM
environment variable in the splash Makefile).