Learn R Programming

snapshot (version 0.1.2)

addhead: Add header information to particle data

Description

Function to add required header information to a Gadget read particle dataframe. This has sensible defaults for a small galaxy merger style simulation

Usage

addhead(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: ll{ ID particle ID x x position in units of
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 g
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

Value

  • partStrictly 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: ll{ 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 }
  • headA list containing various header information as list elements. These are: ll{ 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 }

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.

See Also

snapwrite,snapread,genparam

Examples

Run this code
tempadd=addhead(temp$part)

Run the code above in your browser using DataLab