The Particles tables store the particles’ position and velocity for a given snapshot. The available snapshots can be queried through the AvailParticles table, which lists the particle table names, snapshot numbers and their corresponding redshifts. The particle data of a specific snapshot can be directly accessed through these table names (for instance Particles36 for snapshot number 36) or – if available – through the Particles view.

Column Type UCD Unit Description
particleId bigint; meta.main unique id for particle, usually calculated like this:
particleId = snapnum*1010
+ (original particle id, starting with 1)

We put here the snapshot number in the front to create a unique identifier, which allows to use it as a primary key. The power of 10 may vary for each simulation, since it must be big enough to contain the total number of particles.
fileRowId bigint unique id, based on original data file number and row in file; not included in every particles table
snapnum smallint time.epoch number of snapshot; may be missing for some tables (e.g. for MDPL-simulation)
x float pos.cartesian.x 1/h Mpc comoving position, x-component
y float pos.cartesian.y 1/h Mpc comoving position, y-component
z float pos.cartesian.z 1/h Mpc comoving position, z-component
vx float phys.veloc; pos.cartesian.x km/s peculiar velocity, x-component
vy float phys.veloc; pos.cartesian.y km/s peculiar velocity, y-component
vz float phys.veloc; pos.cartesian.z km/s peculiar velocity, z-component
phkey int Peano-Hilbert key


Get 10 particles from snapshot 85 (redshift 0):

SELECT * FROM MDR1.Particles85

Get random 1% of particles in a cell with given phkey:

SELECT particleId, x,y,z FROM MDR1.Particles85 
WHERE phkey = 935458119 AND sprng_dbl(123) < 0.01

Using the Peano-Hilbert key allows to quickly retrieve particles or halos at a certain location in space.
See the page on Special Functions for functions to get coordinates from Hilbert keys and vice versa.
See FAQ for an example for retrieving 1000 random particles from a simulation.

Extract 1% of the particles in a sphere of 1.5 * virial radius of the BDM halo with id 8800068215607:

SELECT p.x,p.y,p.z 
  MDPL.Particles88 AS p,
WHERE b.bdmId = 8800068215607
AND pdist(1000.0,p.x,p.y,p.z, b.x,b.y,b.z) < 1.5*0.001*b.Rvir
AND sprng_dbl(1234) < 0.01
This query randomly extracts 1% of the particles using sprng_dbl(). It also uses the additional function pdist to calculate the periodic distance from the particle to the halo's center correctly. See Special functions for documentation of these functions. Note that this query takes ~ 30 minutes, since the MDPL-Particles table is quite large and a full table scan is required. If there is high traffic on the server, it may time out.

Proudly powered by Daiquiri
©2016 The CosmoSim databaseImprint and Data Protection Statement