Debian Codegraph @

docs/getting-started.rst

raw
1 Getting started
2 ===============
3
4 .. _install:
5
6 Installing from your package manager
7 -------------------------------------
8 Pre-packaged builds of splash exist for most operating systems.
9
10 Stable version
11 ~~~~~~~~~~~~~~
12 Mac OS via homebrew (recommended)::
13
14 brew tap danieljprice/all
15 brew install splash
16
17 You will also need to install `Xquartz <https://www.xquartz.org>`_ so that the X-windows server launches automatically.
18
19 Mac OS via Macports::
20
21 sudo port install splash
22
23 Linux or Windows Linux Subsystem (Ubuntu)::
24
25 sudo apt-get install splash
26
27 Development version
28 ~~~~~~~~~~~~~~~~~~~
29
30 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:
31
32 Mac OS via homebrew::
33
34 brew tap danieljprice/all
35 brew install --HEAD splash
36
37 or compile from source following the instructions below.
38
39 Compiling from source
40 ---------------------
41
42 Basic instructions
43 ~~~~~~~~~~~~~~~~~~
44 If you have admin (super user) permissions
45
46 Ubuntu/Windows Subsystem for Linux::
47
48 sudo apt-get install libcairo2-dev
49 git clone https://github.com/danieljprice/giza.git; cd giza; ./configure; make; sudo make install; cd ..
50 git clone https://github.com/danieljprice/splash.git
51 cd splash; make SYSTEM=gfortran; sudo make install
52
53 Mac::
54
55 git clone https://github.com/danieljprice/giza.git; cd giza; ./configure; make; sudo make install; cd ..
56 git clone https://github.com/danieljprice/splash.git
57 cd splash; make SYSTEM=gfortran; sudo make install
58
59 .. _installhome:
60
61 Installing in your home space
62 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
63 If you do not have admin permissions. That is, to install in your home space::
64
65 git clone https://github.com/danieljprice/splash.git
66 cd splash; git clone https://github.com/danieljprice/giza.git
67 make SYSTEM=gfortran withgiza
68
69 .. important::
70 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::
71
72 export SPLASH_DIR=$HOME/splash
73 export PATH=$PATH:$SPLASH_DIR/bin
74 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$SPLASH_DIR/giza/lib
75
76 Advanced installation guide
77 ---------------------------
78
79 The basic steps for installation are as follows:
80
81 #. make sure you have a recent Fortran compiler (such as gfortran)
82
83 #. make sure you have cairo on your system
84
85 #. compile splash and giza
86
87 Fortran compilers
88 ~~~~~~~~~~~~~~~~~~~
89
90 Numerous Fortran 90/95/2003 compilers exist. The most widely
91 available are:
92
93 - gfortran, the free Gnu Fortran Compiler
94 http://gcc.gnu.org/wiki/GFortran
95
96 - ifort, one of the most widely available commercial compilers (and is
97 very good) with (limited) free licence for Linux.
98 http://software.intel.com/en-us/articles/intel-compilers/
99
100 Both of these successfully compile splash and the giza library.
101
102 Cairo graphics library
103 ~~~~~~~~~~~~~~~~~~~~~~~
104 Cairo is a low-level system library used in many applications. Thus it is highly
105 likely that you already have a copy on your system and already in your library path.
106 Look for the header file cairo.h, e.g. using::
107
108 locate cairo.h
109
110 or have a look in the usual places (e.g. /usr/include/cairo, /usr/X11/include). If not,
111 you can usually use your inbuilt package manager to install cairo as follows:
112
113 Debian/Ubuntu:
114 sudo apt-get install libcairo2-dev
115 Fedora/Red Hat/CentOS:
116 sudo yum install cairo-devel
117 OpenSUSE:
118 zypper install cairo-devel
119 MacPorts:
120 sudo port install cairo
121
122 Alternatively, use the script provided in the root-level splash directory::
123
124 ./install-cairo.sh
125
126 which downloads and installs both pixman and cairo into the giza/ subdirectory.
127 Unlike the methods above, this does not require any admin/superuser permissions.
128
129 Compiling and linking with giza
130 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
131
132 You can either install giza with your package manager, or in a subdirectory
133 of splash. To install in a splash subdirectory, use::
134
135 cd splash
136 git clone http://github.com/danieljprice/giza
137 make withgiza
138
139 of splash.
140
141 With giza installed via your package manager (or previously compiled as below), use::
142
143 cd splash
144 make GIZA_DIR=/usr/local
145
146 where ``GIZA_DIR`` points to the directory where giza was installed.
147 To install giza in a splash subdirectory, use::
148
149 cd splash
150 git clone http://github.com/danieljprice/giza
151 make withgiza
152
153 A successful ``make`` will produce a binary called ``splash``
154
155 Reading your data
156 -----------------
157
158 The most important part is getting splash to read \*your\* data format.
159 If you are using a publicly available code, it is reasonably likely
160 that I have already written a read data subroutine which will read your
161 dumps. If not it is best to look at some of the other examples and
162 change the necessary parts to suit your data files. Note that reading
163 directly from unformatted data files is \*much\* faster than reading
164 from formatted (ascii) output.
165
166 A standard ``make`` will create a binary which supports the file formats listed in
167 :ref:`tab:defaultreads`, plus a bunch of others (type ``splash --formats`` to see what formats your build supports).
168 All data formats are supported in the splash binary by default unless there
169 are external library dependencies (e.g. ``HDF5``) .
170
171 The format of the file can in many cases be successfully guessed from the file extension or header, so you can simply type::
172
173 splash disc_00000
174
175 Otherwise you can specify the data type you are reading using the ``-f`` or ``--format`` flag. For example,
176 the following will read a phantom dumpfile::
177
178 splash --format phantom disc_00000
179
180 For backwards compatibility with previous version of ``splash``, one can add aliases into their `.bashrc`, or equivalent::
181
182 alias asplash='splash ' # Alias for ascii splash
183 alias ssplash='splash -f phantom '
184 alias gsplash='splash -f gadget '
185 alias tsplash='splash -f tipsy '
186
187 If splash is compiled with ``HDF5=yes``, the formats listed in :ref:`tab:hdf5reads` will also be available in the ``splash`` binary.
188 Other supported formats are listed in :ref:`tab:otherreads`, but these require additional libraries.
189
190 .. table:: Binaries and data reads compiled by default
191 :name: tab:defaultreads
192
193 +------------------------------+----------------------------+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
194 | ``splash`` command | Format Read | ``read_data`` File | Comments |
195 +==============================+============================+===============================+===================================================================================================================================================================================================================================================+
196 | ``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) |
197 +------------------------------+----------------------------+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
198 | ``splash -dragon <file>`` | dragon | ``read_data_dragon`` | See environment variable options. |
199 +------------------------------+----------------------------+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
200 | ``splash -gadget <file>`` | gadget, gadget-2, gadget-3 | ``read_data_gadget.f90`` | Handles both default and block-labelled formats (see environment variable options). |
201 +------------------------------+----------------------------+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
202 | ``splash -ndspmhd <file>`` | ndspmhd | ``read_data_ndspmhd.f90`` | Format for the ndspmhd SPH/SPMHD code (publicly available from my website). |
203 +------------------------------+----------------------------+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
204 | ``splash -phantom <file>`` | sphNG, Phantom | ``read_data_sphNG.f90`` | sphNG is Matthew Bate's SPH code. Option ``-sphng`` also works. |
205 +------------------------------+----------------------------+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
206 | ``splash -magma <file>`` | magma | ``read_data_srosph.f90`` | Stephan Rosswog's code |
207 +------------------------------+----------------------------+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
208 | ``splash -seren <file>`` | seren | ``read_data_seren.f90`` | The SEREN SPH code (Hubber, McLeod et al.) |
209 +------------------------------+----------------------------+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
210 | ``splash -gasoline <file>`` | gasoline, tipsy | ``read_data_tipsy.f90`` | Reads both binary and ascii TIPSY files (determined automatically). Option ``-tipsy`` also works. |
211 +------------------------------+----------------------------+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
212 | ``splash -vine <file>`` | vine | ``read_data_fine.f90`` | See environment variable options. |
213 +------------------------------+----------------------------+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
214 |``splash -starsmasher <file>``| StarSmasher | ``read_data_starsmasher.f90`` | The `StarSmasher <http://jalombar.github.io/starsmasher/>`_ code (Gaburov et al. 2018) |
215 +------------------------------+----------------------------+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
216 | ``splash file.vtk`` | vtk legacy binary | ``read_data_vtk.f90`` | VTK legacy binary format (UNSTRUCTURED_GRID and STRUCTURED_GRID), e.g. from Shamrock code |
217 +------------------------------+----------------------------+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
218
219 Below is a list of the supported data formats that require ``HDF5``.
220
221 .. table:: Supported HDF5 data formats
222 :name: tab:hdf5reads
223
224 +--------------------------------+------------------------+-------------------------------+-----------------------------------------------------------------------------------------+
225 | ``splash`` Command | Read Format | ``read_data`` File | Comments |
226 +================================+========================+===============================+=========================================================================================+
227 | ``splash -gadget_hdf5 <file>`` | gadget HDF5 Files. | ``read_data_gadget_hdf5.f90`` | Reads HDF5 format from the gadget code (automatically recognised) |
228 +--------------------------------+------------------------+-------------------------------+-----------------------------------------------------------------------------------------+
229 | ``splash -amuse <file>`` | AMUSE HDF5 | ``read_data_amuse_hdf5.f90`` | Reads HDF5 format from the AMUSE framework. |
230 +--------------------------------+------------------------+-------------------------------+-----------------------------------------------------------------------------------------+
231 | ``splash -cactus_hdf5 <file>`` | Cactus HDF5 | ``read_data_cactus_hdf5.f90`` | |
232 +--------------------------------+------------------------+-------------------------------+-----------------------------------------------------------------------------------------+
233 | ``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. |
234 +--------------------------------+------------------------+-------------------------------+-----------------------------------------------------------------------------------------+
235 | ``splash -falcon_hdf5 <file>`` | falcON | ``read_data_falcON_hdf5.f90`` | Walter Dehnen's SPH code format. The option ``-falcon`` will also work. |
236 +--------------------------------+------------------------+-------------------------------+-----------------------------------------------------------------------------------------+
237
238 If the ``HDF5`` read files end with ``.h5``, the suffix ``_hdf5`` from the ``splash`` command can be removed.
239 For example::
240
241 splash -gadget dump_000.h5
242
243 will recognise that the file ``dump_000.h5`` is in the ``HDF5`` format, and will automatically select the correct ``read_data`` routine.
244
245 Below is a list of other formats supported, but have additional library requirements.
246
247 .. table:: Other supported file formats that require external libraries
248 :name: tab:otherreads
249
250 +---------------------------+--------------+--------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
251 | ``splash`` Command | Read Format | ``read_data`` File | Comments |
252 +===========================+==============+==========================+============================================================================================================================================================================+
253 | ``splash -pbob <file>`` | PBOB Files | ``read_data_pbob.f90`` | Requires the PBOB Library. Compile ``splash`` with ``PBOB_DIR=/path/to/pbob/``. |
254 +---------------------------+--------------+--------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
255 | ``splash -h5part <file>`` | H5Part Files | ``read_data_h5part.f90`` | Requires the H5Part and HDF5 libraries. Compile ``splash`` with ``H5PART_DIR=/path/to/h5part/``. |
256 +---------------------------+--------------+--------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
257 | ``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``. |
258 +---------------------------+--------------+--------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
259
260
261 Further details on writing your own subroutine are given in
262 appendix :ref:`sec:writeyourown`. The \*easiest\* way is to i)
263 email me a sample data file and ii) the subroutine you used to write it,
264 and I will happily create a data read for your file format.
265
266 .. _sec:commandline:
267
268 Command line options
269 --------------------
270
271 Typing ``splash --help`` gives a complete and up-to-date list of options. Currently these are:
272
273 ::
274
275 Command line options:
276
277 -f format : input file format to be read (default is ascii, --formats for full list)
278 -p fileprefix : change prefix to ALL settings files read/written by splash
279 -e, -ev : use default options best suited for line plotting (.ev files)
280 -360 : set default options suited to 360 video
281 -b, --buffer : buffer all data files into memory
282 -o pixformat : dump pixel map in specified format (use just -o for list of formats)
283
284 Command line plotting mode:
285
286 -x column : x axis
287 -y column : y axis
288 -r[ender] column : column to render (will use 1 and 2 as x,y if -x,-y not specified)
289 -vec[tor] column : vector quantity to plot with arrows
290 -c[ontour] column : contoured quantity
291 -multi : multiplot
292 -dev device : specify plotting device on command line (e.g. -dev /xw)
293 --movie : shortcut for -dev /mp4 to make a movie from plot sequence
294 --xsec=1.0 : specify location of cross section slice
295 --kappa=1.0 : specify opacity, and turn on opacity rendering
296 --anglex=30 : rotate around x axis (similarly --angley, --anglez)
297 --code : enforce code units (also --codeunits)
298 --sink=1 : centre on sink particle number 1
299 --origin=666 : set coordinate system origin to particle number 666
300 --origin=maxdens : set coordinate system origin to particle at maximum density
301 --track=666 : track particle number 666
302 --track=maxdens : track particle at maximum density
303 --exact=file1,f2 : read and plot exact solution from ascii files file1 and f2
304 --sort : sort filenames for comparison (e.g. snap_000 snap1_000 snap2_000)
305 --sortpad : sort filenames and pad all sequences to same length
306
307 Example data formats (type --formats for full list):
308
309 -ascii,-csv : ascii text/csv format (default)
310 -phantom -sphng : Phantom and sphNG codes (auto)
311 -vtk : vtk legacy binary format (auto)
312 -ndspmhd : ndspmhd code (auto)
313 -gandalf,-seren : Gandalf/Seren code
314 -gadget -gadget_hdf5 : Gadget code (auto)
315 -falcon -falcon_hdf5 : FalcON code
316 -flash -flash_hdf5 : FLASH code
317 -cactus -cactus_hdf5 : Cactus code
318 -amuse -amuse_hdf5 : AMUSE Framework
319 -fits : FITS format (auto)
320
321 HDF5 files will be automatically recognised if they end with .h5, however you
322 must specify a supported data format.
323 add a suffix "_hdf5" to above format if your data files do not end with .h5.
324
325 convert mode ("splash to X dumpfiles"):
326 splash to ascii : convert SPH data to ascii file dumpfile.ascii
327
328 to binary : convert SPH data to simple unformatted binary dumpfile.binary
329 write(1) time,npart,ncolumns
330 do i=1,npart
331 write(1) dat(1:ncolumns),itype
332 enddo
333 to phantom : convert SPH data to binary dump file for PHANTOM
334 to gadget : convert SPH data to default GADGET snapshot file format
335
336 Grid conversion mode ("splash to X dumpfiles"):
337 splash to grid : interpolate basic SPH data (density, plus velocity if present in data)
338 to 2D or 3D grid, write grid data to file (using default output=ascii)
339 to gridascii : as above, grid data written in ascii format
340 to gridbinary : as above, grid data in simple unformatted binary format:
341 write(unit) nx,ny,nz,ncolumns,time [ 4 bytes each ]
342 write(unit) (((rho(i,j,k),i=1,nx),j=1,ny),k=1,nz) [ 4 bytes each ]
343 write(unit) (((vx(i,j,k), i=1,nx),j=1,ny),k=1,nz) [ 4 bytes each ]
344 write(unit) (((vy(i,j,k), i=1,nx),j=1,ny),k=1,nz) [ 4 bytes each ]
345 write(unit) (((...(i,j,k),i=1,nx),j=1,ny),k=1,nz) [ 4 bytes each ]
346 allto grid : as above, interpolating *all* columns to the grid (and output file)
347 allto gridascii : as above, with ascii output
348 allto gridbinary : as above, with binary output
349
350 Analysis mode ("splash calc X dumpfiles") on a sequence of dump files:
351 splash calc energies : calculate KE,PE,total energy vs time
352 output to file called 'energy.out'
353 calc massaboverho : mass above a series of density thresholds vs time
354 output to file called 'massaboverho.out'
355 calc max : maximum of each column vs. time
356 output to file called 'maxvals.out'
357 calc min : minimum of each column vs. time
358 output to file called 'minvals.out'
359 calc diff : (max - min) of each column vs. time
360 output to file called 'diffvals.out'
361 calc amp : 0.5*(max - min) of each column vs. time
362 output to file called 'ampvals.out'
363 calc delta : 0.5*(max - min)/mean of each column vs. time
364 output to file called 'deltavals.out'
365 calc mean : mean of each column vs. time
366 output to file called 'meanvals.out'
367 calc rms : (mass weighted) root mean square of each column vs. time
368 output to file called 'rmsvals.out'
369 calc tracks : track particle data vs time for selected particles,
370 --track=1,2,3 output to tracks-1.out,tracks-2.out,tracks-3.out
371
372 the above options all produce a small ascii file with one row per input file.
373 the following option produces a file equivalent in size to one input file (in ascii format):
374
375 calc timeaverage : time average of *all* entries for every particle
376 output to file called 'time_average.out'
377
378 calc ratio : ratio of *all* entries in each file compared to first
379 output to file called 'ratio.out'
380
381 calc plus : add two snapshots together
382 output to file called 'plus.out'
383
384 Command-line options can be entered in any order on the command line
385 (even after the dump file names). For more information on the convert
386 utility (``splash to ascii``) see :ref:`sec:convert`. For details
387 of the ``-o ppm`` or ``-o ascii`` option see :ref:`sec:writepixmap`. For details of the ``-ev`` option, see :ref:`sec:evsplash`.
388
389
390 Options affecting all data reads
391 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
392
393 Command line flags (or environment variables) that affect all data reads are:
394
395 +----------------------+-----------------------+-------------------------------------------------+
396 | ---defaults | SPLASH_DEFAULTS | gives name of system-wide ``splash.defaults`` |
397 | | | file (and splash.limits etc.) that will be |
398 | | | used if there is none in the current dir. e.g. |
399 | | | ``--defaults=$HOME/splash.defaults`` |
400 +----------------------+-----------------------+-------------------------------------------------+
401 | ---kernel='quintic' | SPLASH_KERNEL | changes the smoothing kernel used in the |
402 | | | interpolations (e.g. ``cubic`` or ``quintic``). |
403 | | | Can also be changed in the :ref:`sec:menu-r`. |
404 +----------------------+-----------------------+-------------------------------------------------+
405 | ---debug | SPLASH_DEBUG | if set to ``yes`` or ``true``, turns on verbose |
406 | | | debugging output. Useful to trace code crashes |
407 | | | (but of course, this never happens…). |
408 +----------------------+-----------------------+-------------------------------------------------+
409 | ---sink=1 | SPLASH_CENTRE_ON_SINK | if set to a number n, centres coordinates and |
410 | | | velocities on the nth sink/star particle (e.g. |
411 | | | ``export SPLASH_CENTRE_ON_SINK=2``) |
412 +----------------------+-----------------------+-------------------------------------------------+
413 | ---corotate | SPLASH_COROTATE | plot in corotating frame based on locations of |
414 | | | 2 sink particles (e.g. ``--corotate=1,3``) |
415 +----------------------+-----------------------+-------------------------------------------------+
416 | ---origin=666 | SPLASH_ORIGIN | recentre the coordinate origin and velocities |
417 | | | to the selected particle (e.g. particle 666) |
418 +----------------------+-----------------------+-------------------------------------------------+
419 | ---origin=maxdens | SPLASH_ORIGIN | reset origin to particle at maximum density |
420 +----------------------+-----------------------+-------------------------------------------------+
421 | --dontcentrevel='y' | SPLASH_DONTCENTREVEL | used along with SPLASH_CENTRE_ON_SINK or |
422 | | | SPLASH_ORIGIN. If true, then the velocities |
423 | | | will not be made relative to the sink or |
424 | | | particle. |
425 +----------------------+-----------------------+-------------------------------------------------+
426 | ---track=4789 | SPLASH_TRACK | set limits of all quantities relative to those |
427 | | | of the selected particle (e.g. particle 4789) |
428 +----------------------+-----------------------+-------------------------------------------------+
429 | ---track=maxdens | SPLASH_TRACK | track the particle at maximum density |
430 +----------------------+-----------------------+-------------------------------------------------+
431 | ---vzero=1.0,1.0,1.0 | SPLASH_VZERO | subtract reference velocity from all particles |
432 | | | (velocity should be specified in code units) |
433 +----------------------+-----------------------+-------------------------------------------------+
434 | ---exact=file1,file2 | | plot exact solution from files file1 and file2 |
435 +----------------------+-----------------------+-------------------------------------------------+
436 | ---beam=2.0 | SPLASH_BEAM | if given a value :math:`>`\ 0 enforces a minimum|
437 | | | smoothing length, specified in code units, |
438 | | | all the particles. Useful to "dumb-down" the |
439 | | | resolution of SPH simulations to match |
440 | | | observational resolution. If this variable is |
441 | | | set the "accelerated rendering" option in the |
442 | | | :ref:`sec:menu-r` is also turned on, otherwise |
443 | | | slow rendering can result. |
444 +----------------------+-----------------------+-------------------------------------------------+
445 | ---xmin=0.1 | SPLASH_MARGIN_XMIN | can be used to manually adjust the left page |
446 | ---xmax=0.1 | SPLASH_MARGIN_XMAX | page margin (set to fraction of viewport, |
447 | ---ymin=0.1 | SPLASH_MARGIN_YMIN | negative values are allowed). |
448 | ---ymax=0.1 | SPLASH_MARGIN_YMAX | |
449 +----------------------+-----------------------+-------------------------------------------------+
450
451 .. _sec:splash:
452
453 Ascii data read
454 ~~~~~~~~~~~~~~~~
455
456 For several data reads there are command-line flags which can be set
457 at runtime which are specific to the data read. For the ascii data read
458 (``splash -f ascii``) these are:
459
460 +-------------------------------------+-----------------------------------+
461 | ``--ncolumns=10`` | if given a value :math:`>`\ 0 |
462 | | sets the number of columns to be |
463 | | read from ascii data (overrides |
464 | | the automatic number of columns |
465 | | determination). |
466 +-------------------------------------+-----------------------------------+
467 | ``--nheaderlines=3`` | if given a value :math:`>=`\ 0 |
468 | | sets the number of header lines |
469 | | to skip (overrides the automatic |
470 | | determination). |
471 +-------------------------------------+-----------------------------------+
472 | ``--columnsfile=/home/me/mylabels`` | can be used to provide the |
473 | | location of (path to) the default |
474 | | ``columns`` file containing the |
475 | | labels for ascii data. Overridden |
476 | | by the presence of a local |
477 | | ``columns`` file. |
478 +-------------------------------------+-----------------------------------+
479 | ``--time=3.0`` | if given a nonzero value sets the |
480 | | time to use in the legend (fixed |
481 | | for all files) |
482 +-------------------------------------+-----------------------------------+
483 | ``--gamma=1.667`` | if given a nonzero value sets |
484 | | gamma to use in exact solution |
485 | | calculations (fixed for all |
486 | | files) |
487 +-------------------------------------+-----------------------------------+
488 | ``--timeheader=1`` | sets the integer line number |
489 | | where the time appears in the |
490 | | header |
491 +-------------------------------------+-----------------------------------+
492 | ``--gammaheader=3`` | sets the integer line number |
493 | | where gamma appears in the header |
494 +-------------------------------------+-----------------------------------+
495
496 The above options can be set as environment variables by prefixing them
497 with ASPLASH, e.g.::
498
499 export ASPLASH_NCOLUMNS=10
500 splash datafile.txt
501
502 .. _sec:splash -gadget:
503
504 GADGET data read
505 ~~~~~~~~~~~~~~~~~
506
507 For the GADGET read (``splash -f gadget`` or just ``splash``) the options are:
508
509 +-----------------------------------+-----------------------------------+
510 | ``--format=2`` | if set = 2, force read of block |
511 | | labelled GADGET format instead of |
512 | | the default (non block labelled) |
513 | | format. |
514 +-----------------------------------+-----------------------------------+
515 | ``--usez`` | if ``yes`` or ``true`` uses the |
516 | | redshift in the legend instead of |
517 | | code time. |
518 +-----------------------------------+-----------------------------------+
519 | ``--hsoft=500.`` | if given a value :math:`>` 0.0 |
520 | | will assign a smoothing length to |
521 | | dark matter particles for which |
522 | | rendered plots of column density |
523 | | can then be made. |
524 +-----------------------------------+-----------------------------------+
525 | ``--extracols`` | if set to a comma separated list |
526 | | of column labels, will attempt to |
527 | | read additional columns |
528 | | containing gas particle |
529 | | properties beyond the end of the |
530 | | file (not applicable if |
531 | | --format=2). |
532 +-----------------------------------+-----------------------------------+
533 | ``--starpartcols`` | if set to a comma separated list |
534 | | of column labels, will attempt to |
535 | | read additional columns |
536 | | containing star particle |
537 | | properties beyond the end of the |
538 | | file (and after any extra gas |
539 | | particle columns) (not applicable |
540 | | if GSPLASH_FORMAT=2). |
541 +-----------------------------------+-----------------------------------+
542 | ``--checkids`` | if set to ``yes`` or ``true``, |
543 | | reads and checks particle IDs, |
544 | | excluding particles with negative |
545 | | IDs as accreted (gives them a |
546 | | negative smoothing length which |
547 | | means they are ignored in |
548 | | renderings). |
549 +-----------------------------------+-----------------------------------+
550 | ``--hcolumn`` | if set to a positive integer, |
551 | | specifies the location of the |
552 | | smoothing length in the columns, |
553 | | overriding any default settings. |
554 +-----------------------------------+-----------------------------------+
555 | ``--ignore-iflagcool`` | if set,does |
556 | | not assume that extra columns are |
557 | | present even if the cooling flag |
558 | | is set in the header. |
559 +-----------------------------------+-----------------------------------+
560
561 For backwards compatibility, the above options can also be set as
562 environment variables by prefixing them with GSPLASH, e.g.::
563
564 export GSPLASH_FORMAT=2
565 splash -gadget snap_00010
566
567 which is equivalent to::
568
569 splash -f gadget --format=2 snap_00010
570
571 For the GADGET read gsplash will also look for, and read if present,
572 files called ``snapshot_xxx.hsml`` and/or ``snapshot_xxx.dens`` (where
573 ``snapshot_xxx`` is the name of the corresponding GADGET dump file)
574 which contain smoothing lengths and/or a density estimate for dark
575 matter particles (these should just be one-column ascii files).
576
577 VINE data read
578 ~~~~~~~~~~~~~~~
579
580 For the VINE read (``splash -vine``) the options are:
581
582 +-----------------------------------+-----------------------------------+
583 | ``--hfac`` | if ``yes`` or ``true`` multiplies |
584 | | smoothing length read from the |
585 | | dump file by a factor of 2.8 (for |
586 | | use with older VINE dumps where |
587 | | the smoothing length is defined |
588 | | as in a Plummer kernel rather |
589 | | than as the usual SPH smoothing |
590 | | length). |
591 +-----------------------------------+-----------------------------------+
592 | ``--mhd`` | if set, reads VINE |
593 | | dumps containing MHD arrays |
594 | | (or set VINE_MHD=yes) |
595 +-----------------------------------+-----------------------------------+
596
597 Phantom/sphNG data read
598 ~~~~~~~~~~~~~~~~~~~~~~~~
599
600 For the sphNG and PHANTOM read (``splash -phantom``) the options are:
601
602 +-------------------+-------------------------------------------------------+
603 | ``--cm`` | resets the positions such that the centre of |
604 | | mass is exactly at the origin. |
605 +-------------------+-------------------------------------------------------+
606 | ``--dense`` | resets the positions such that the centre of |
607 | | mass of the densest clump is exactly at the origin. |
608 +-------------------+-------------------------------------------------------+
609 | ``--omega=3.142`` | if non-zero, subtracts solid body rotation with omega |
610 | | as specified to give velocities in co-rotating frame |
611 +-------------------+-------------------------------------------------------+
612 | ``--omegat=3.142``| same as --omega but applies to velocities also |
613 +-------------------+-------------------------------------------------------+
614 | ``--timeunit=hrs``| sets default time units, either 's', 'min', 'hrs', |
615 | | 'days', 'yr' or 'tfreefall' (used verbatim in legend) |
616 +-------------------+-------------------------------------------------------+
617
618 dragon data read
619 ~~~~~~~~~~~~~~~~~
620
621 For the dragon read (``splash -dragon``) the options are:
622
623 +-----------------------------------+-----------------------------------+
624 | ``--extracols`` | specifies number of extra columns |
625 | | present in the file which are |
626 | | dumped after the itype array |
627 +-----------------------------------+-----------------------------------+
628
629 Stephan Rosswog data read
630 ~~~~~~~~~~~~~~~~~~~~~~~~~~
631
632 For the srosph read (``splash``) the options are:
633
634 +-----------------------------------+-----------------------------------+
635 | ``--format=MHD`` | can be ``MHD`` or ``HYDRO`` which |
636 | | read the appropriate data format |
637 | | from either the MHD or |
638 | | hydrodynamic codes |
639 +-----------------------------------+-----------------------------------+
640 | ``--com`` | if set resets the |
641 | | positions such that the centre of |
642 | | mass is exactly at the origin. |
643 +-----------------------------------+-----------------------------------+
644 | ``--corotating`` | velocities are transformed to |
645 | | corotating frame |
646 +-----------------------------------+-----------------------------------+
647 | ``--hfact=1.2`` | can be changed to give correct |
648 | | parameter in |
649 | | :math:`h=h_{fact}(m/\rho)^{1/3}` |
650 | | used to set the particle masses |
651 | | when rendering minidumps (i.e., |
652 | | when the mass is not dumped). |
653 | | Default is RSPLASH_HFACT=1.5 |
654 +-----------------------------------+-----------------------------------+
655
656 ndspmhd data read
657 ~~~~~~~~~~~~~~~~~~
658
659 For the ndspmhd read (``splash -ndspmhd``) the options are:
660
661 +-----------------------------------+-----------------------------------+
662 | ``--barycentric`` | plots barycentric quantities for |
663 | | one-fluid dust instead of |
664 | | creating fake second set of |
665 | | particles |
666 +-----------------------------------+-----------------------------------+
667
668 H5Part data read
669 ~~~~~~~~~~~~~~~~~
670
671 For the H5PART read (``splash -f h5part``) the options are:
672
673 +-----------------------------------+------------------------------------+
674 | ``--ndim=3`` | number of spatial dimensions |
675 | | :math:`d` (overrides value |
676 | | inferred from data) |
677 +-----------------------------------+------------------------------------+
678 | ``--hfac=1.2`` | factor to use to compute h from |
679 | | :math:`h = h_{fac} *(m/\rho)^{1/d}`|
680 | | if h not present in data |
681 +-----------------------------------+------------------------------------+
682 | ``--hsml=3.0`` | value for global smoothing length |
683 | | h (if h not present in data) |
684 +-----------------------------------+------------------------------------+
685 | ``--typeid=MatID`` | name of the dataset containing |
686 | | the particle type identification |
687 | | (default is "MatID") |
688 +-----------------------------------+------------------------------------+
689
690 .. _sec:envvariables:
691
692 Environment variables
693 ---------------------
694
695 Several runtime options for splash can be set using environment
696 variables. These are variables set from your unix shell. In the bash
697 shell, environment variables are set from the command line using
698
699 ::
700
701 export VAR='blah'
702
703 or by putting this command in your ``.bash_profile``/``.bashrc``. In
704 csh, the equivalent is
705
706 ::
707
708 setenv VAR 'blah'
709
710 or by putting the above in your ``.cshrc`` file.
711
712 Changing the font
713 ~~~~~~~~~~~~~~~~~~
714
715 Several environment variables affect the backend plotting library.
716 Probably the most useful is the ability to change font:
717
718 ::
719
720 export GIZA_FONT='Helvetica'
721
722 where the name is a reasonable guess as to the font you want to use (the
723 default is ``Times``). In particular, if you are having trouble displaying
724 unicode characters such as greek letters, you can just change the font
725 until you find one that works.
726
727 Endian changing
728 ~~~~~~~~~~~~~~~~
729
730 On some compilers, the endian-ness (byte order) when reading unformatted
731 binary data files can be changed at runtime. This is useful for looking
732 at files on different systems to the one on which they were created
733 (e.g. x86 machines create little-endian files by default, whereas
734 IBM/powerpc machines create big-endian). Environment variables for
735 changing the endian-ness of the data read for some common compilers are
736 given below:
737
738 +-------------+----------------------------+----------------+-------------------+----------+
739 | Compiler | Environment variable | Big endian | Little endian | Other |
740 +=============+============================+================+===================+==========+
741 | gfortran | ``GFORTRAN_CONVERT_UNIT`` | ``big_endian`` | ``little_endian`` | ``swap`` |
742 +-------------+----------------------------+----------------+-------------------+----------+
743 | ifort | ``F_UFMTENDIAN`` | ``big`` | ``little`` | |
744 +-------------+----------------------------+----------------+-------------------+----------+
745
746 For compilers without this feature, almost all can change the
747 endian-ness at compile time, and the appropriate flags for doing so can
748 be set using
749
750 ::
751
752 export ENDIAN='BIG'
753
754 or LITTLE before *compiling* splash (this adds the appropriate
755 compile-time flags for the compiler selected using the SYSTEM
756 environment variable in the splash Makefile).