Learn R Programming

snapshot (version 0.1.2)

snapwrite: Write in Gadget snapshots

Description

This function allows the user to write standard format Gadget binaries. It can write the particle information and header information, which are provided as separate R objects.

Usage

snapwrite(part, head, file)

Arguments

part
A data.frame containing the main particle level information. Columns required 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 ve
head
A 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
file
The full path to the Gadget snapshot to be created.

Value

  • No value returned, called for the side-effect of writing out a binary Gadget file.

See Also

snapread,addhead,genparam

Examples

Run this code
temp=snapwrite(snap$part,snap$head,'somepath/snapshot_XXX')

Run the code above in your browser using DataLab