snap.add.head.1: Add header information to particle data

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

View source: R/snap.add.head.1.R

Description

Function to add required header information to a Gadget format 1 particle data.frame. This has sensible defaults for a small galaxy merger style simulation

Usage

1
2
3
snap.add.head.1(part, Npart = 2, Massarr = 0, Time = 0, z = 0, FlagSfr = 0,
FlagFeedback = 0, FlagCooling = 0, BoxSize = 0, OmegaM = 0, OmegaL = 0,
h = 1, FlagAge = 0, FlagMetals = 0, NallHW = 0, flag_entr_ics = 0)

Arguments

part

Strictly speaking 'part' is passed through the function, but to make this a useful object 'part' should be a data.frame containing the main particle level information. Columns required 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 in units of km/s
vy y velocity in units of km/s
vz z velocity in units of km/s
Mass particle mass in units of Msun
Npart

The index on the Npart vector that should contain the particle number, where: gas [1] / collisionless particles [2:6]. The actual value is calculated based on the part data.frame provided with 'part', Nall is also calculated based on this number and not given as an option since the same index as Npart must be used

Massarr

The mass of the particles in the particle index provided to 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

FlagFeedback

Feedback turned on/off

FlagCooling

Cooling turned on/off

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 in the particle index provided to Npart- not usually necessary

flag_entr_ics

Entropy for gas on/off

Details

Nall is calculated based on Npart, and therfore it cannot be specified via an input argument. This increases the likelihood that a legal Gadget header will be produced.

Value

part

Strictly speaking 'part' is passed through the function, but to make this a useful object 'part' should be a data.frame containing the main particle level information. Assuming 'part' has been given a sensible input, columns provided 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 in units of km/s
vy y velocity in units of km/s
vz z velocity in units of km/s
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.read.1, snap.write.block.2,snap.read.2, snap.gen.param

Examples

1
2
3
4
## Not run: 
tempadd=snap.add.head.1(temp$part)

## End(Not run)

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