This HTML automatically generated with rman for NEMO
Table of Contents

Name

gadgetsnap - convert gadget files to snapshot format

Synopsis

gadgetsnap [parameter=value]

Description

gadgetsnap converts data from gadget(lNEMO) into standard snapshot(5NEMO) format. Currently limited to only output mass,pos,vel and all of the potentially 5 particles types are stacked in the order of how GADGET has stored them.

An improved version under the name gadget2nemo(1NEMO) is now preferred over this version.

Parameters

The following parameters are recognized in any order if the keyword is also given:
in=
Input file (gadget format). No default, and currently only one file at the time can be processed.
out=
Output file (snapshot format). No default.
swap=
Force swaping bytes for other-endian machines [f]
reorder=t|f
Call reorder? This brings particles back into the order of their ID’s. [Default: f]
header=|4|8
Size of the header uses in unformatted fortran data. This used to be 4, but modern compilers (e.g. gfortran) may very well use 8. By default it is not specified, and the value determined to be the correct one during install (UNFIO_HDR_SIZE) is used. This keyword can thus be used to force another value.

Examples

The following example converts a standard sample dataset lcdm_gas.dat from the directory $GADGET_DIR/ICs to a NEMO snapshot file, and piped into tsf(1NEMO) for a quick look:
% gadgetsnap lcdm_gas.dat - swap=t | tsf -
reading ‘lcdm_gas.dat.intel’ ...
Header:
npart:  32768 32768 0 0 0 0
mass:  4.23508 27.528 0 0 0 0
time: 0.0909091
redshift: 10
flag_sfr: 0
flag_feedback: 0
npartTotal:  32768 32768 0 0 0 0
flag_cooling: 424242
num_files: 0
BoxSize: 0
Omega0: 0
OmegaLambda: 0
HubbleParam: 0
char History[44] "gadgetsnap lcdm_gas.dat.intel - VERSION=0.1"
set SnapShot
  set Parameters
    int Nobj 65536
    double Time 0.0909091
  tes
  set Particles
    int CoordSystem 66306
    double Mass[65536] 4.23508 4.23508 4.23508 4.23508 4.23508 4.23508
      4.23508 4.23508 4.23508 4.23508 4.23508 4.23508 4.23508 4.23508
      4.23508 4.23508 4.23508 4.23508 4.23508 4.23508 4.23508 4.23508
      4.23508 4.23508 4.23508 4.23508 4.23508 4.23508 4.23508 4.23508
      . . .
    double PhaseSpace[65536][2][3] 395.234 395.752 1244.31 -232.532
      -232.220 278.943 310.173 440.217 2817.06 -283.772 -205.434
      285.119 191.957 465.572 4430.20 -354.984 -190.161 315.622
      71.5493 452.081 6047.62 -427.516 -198.288 348.702 72.7101
      . . .
  tes
tes
new Gadget-2 example
% gadgetsnap snapshot_000 - header=4 | tsf -
reading ‘snapshot_000’ ...
Header:
npart:  0 40000 20000 0 0 0
mass:  0 0.00104634 0.00023252 0 0 0
time: 0
redshift: 0
flag_sfr: 0
flag_feedback: 0
npartTotal:  0 40000 20000 0 0 0
flag_cooling: 0
num_files: 1
BoxSize: 0
Omega0: 0
OmegaLambda: 0
HubbleParam: 1
char History[47] "gadgetsnap snapshot_000 - header=4 VERSION=0.2"
set SnapShot
  set Parameters
    int Nobj 60000
    double Time 0.00000
  tes
  set Particles
    int CoordSystem 66306
    double Mass[60000] 0.00104634 0.00104634 0.00104634 0.00104634
      0.00104634 0.00104634 0.00104634 0.00104634 0.00104634
      0.00104634 0.00104634 0.00104634 0.00104634 0.00104634
      0.00104634 0.00104634 0.00104634 0.00104634 0.00104634
      . . .
    double PhaseSpace[60000][2][3] -94.1339 -10.2409 -7.94287 8.42407
      -51.3595 -13.0237 -97.9120 -25.4377 0.708142 -75.8381 113.303
      -16.6230 -59.3715 -23.9488 -33.6642 15.1963 84.9828 11.2808
      -109.889 -14.8212 -20.2457 47.3136 102.704 106.783 -54.4458
      . . .
  tes
tes

Header

The 256 byte GADGET header contains information on how the subsequent data is structured:

Npart(6) : number of particles in each of up to 5 particle types (6th one is unused)

Mass(6) : mass of a single particle in the particle types. If a particle type has varying masses, the entry will contain 0.0

Time/a: expansion factor of output (for cosmological) or time of output (for non-cosmological)

Redshift: z = 1/a-1 (only set for cosmological)

FlagSfr: flag for starformation (not used in the public release)

FLagFeedback: flag for feedback (not used in the public release)

Nall(6) : total number of particles of each type in the simulation. This field differs from Npart if the particle dump is distributed accross several files

FlagCooling

NumFiles

BoxSize

Omega0

OmegaLambda

HubbleParam

Caveat

There is an option to run gadget in double precision mode, their output files may not be compatible with this version of the program.

See Also

snapgadget(1NEMO) , gadget2nemo(1NEMO) , nemo2gadget(1NEMO) , uns2uns(1NEMO) , snapshot(5NEMO) , gadget(5NEMO)

http://www.mpa-garching.mpg.de/gadget/

Author

Peter Teuben

Update History


02-Jun-03    V0.1 Created for Gadget-1    PJT
17-mar-06    V0.2 various fixes for Gadget-2    PJT
21-jan-22    upd docs, and recommend gadget2nemo now     PJT


Table of Contents