snap.read.1: Read in a Gadget format 1 snapshot file

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/snap.read.1.R

Description

This function allows the user to read in format 1 Gadget binaries. It keeps the particle information and header information in separate components of a list.

Usage

1
snap.read.1(file, thin=1, verbose=FALSE)

Arguments

file

The full path to the Gadget snapshot to be read in.

thin

Scalar. How much should the particle data be thinned? thin=1 means all data is read in, thin=10 means every 10th particle is read in. Larger numbers will create more sub-sampled data, and will hugely increase the read-in speed and reduce the memory required. This is useful for making images where only a small fraction of Gadget particles are required.

verbose

Logical. If TRUE then function will print out the current reading processes. If FALSE the read is silent.

Details

When using thinning you will generally only see a speed-up in reading times when the multiple is quite large (over 500), assuming the initial full snapshot (thin=1) can be fully read into RAM. This is because of the extra overheads involved in stop-starting the scanning and reading when thinning. If the initial snapshot cannot be read into RAM then the speed up will be much larger and witnessed with much smaller multiples (basically whatever allows the data to be comfortably read into RAM).

Value

part

A data.frame containing the main particle level information. Columns included are:

ID particle ID
x x position in units of Mpc
y y position in units of Mpc
z z position in units of Mpc
vx x velocity
vy y velocity
vz z velocity
Mass particle mass in units of Msun
head

A list containing various header information as list elements. These are:

Npart Vector of length 6 containing the number of particles in this snapshot file, where:
gas [1] / collisionless particles [2:6]
Massarr Vector of length 6 containing the particle masses for the respective particle types
in Npart
Time Time of snapshot in units of km/s and kpc so 1 unit is ~10 Gyrs
z Redshift of snapshot
FlagSfr Star formation turned on/off
Nall Vector of length 6 containing the number of particles in all snapshot files, where:
gas [1] / collisionless particles [2:6]
FlagFeedback Feedback turned on/off
FlagCooling Cooling turned on/off
NumFiles Number of files per snapshot- usually 1
BoxSize Size of simulation box edge length in units of kpc
OmegaM Omega matter of the simulation
OmegaL Omega lambda of the simulation
h Hubble constant divided by 100 used in the simulation
FlagAge Stellar ages on/off
FlagMetals Stellar metallacities on/off
NallHW Tell Gadget to use large integers for the respective particle types in Npart
- not usually necessary
flag_entr_ics Entropy for gas on/off

Author(s)

Aaron Robotham

See Also

snap.write.1,snap.add.head.1,snap.gen.param

Examples

1
2
3
4
## Not run: 
temp=snapread('somepath/snapshot_XXX')

## End(Not run)

asgr/snapshot documentation built on Oct. 8, 2020, 2:52 p.m.