2.4.16  :  particles

This set of tables stores the particles' position and velocity for a number of snapshots. The Bolshoi dataset contains different snapshots at various redshifts. 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 particles416 for snapshot number 416) or through the particles view. The particles view combines all the different particles tables into one big virtual table.

Since the simulation contains nearly 9 billion particles, dealing with these amounts of data is quite challenging and your queries are likely to time out before finishing, if you are not careful. Below we give an example of an optimized query using the Spatial 3D library. Please make use of the Spatial 3D library for extracting particles from a certain region and follow the examples to create fast queries.

Column Type UCD Unit Description
particleId bigint meta.id; meta.main unique id for particle, = snapnum*1010 +(original particle id); we put the snapshot number in the front to create a unique identifier, which allows to use it as a primary key
snapnum smallint time.epoch number of snapshot
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

Examples

Get 10 particles from snapshot 416 (redshift 0):
select top 10 * from Bolshoi..particles where snapnum = 416

Retrieve particles from a two-cell layer around a halo which lies in a cell with phkey = 991135410 (for snapshot 416):
with myphkeys as
( select * from Sp3D.spatial3D.fPHCellNeighbours(10, 991135410, 2) )
select p.* from Bolshoi..particles p, myphkeys k
where p.snapnum = 416 and p.phkey = k.PHkey
or by direct access to the particle data
with myphkeys as
( select * from Sp3D.spatial3D.fPHCellNeighbours(10, 991135410, 2) )
select p.* from Bolshoi..particles416 p, myphkeys k
where p.phkey = k.PHkey
This query first retrieves the Peano-Hilbert keys of neighbouring cells using the Spatial 3D library (fPHCellNeighbours), gives the result the temporary name myphkeys and then returns the matching particles (for which the phkeys have the desired values) by joining the particles table with myphkeys.

Get particles inside a box with side length 5 Mpc/h spanning from P1(46.5, 154.4, 79.8) to P2(51.5, 159.4, 84.8):
use Sp3D
declare @box spatial3d.Box
set @box=spatial3d.Box::newInstance(46.5, 154.4, 79.8, 51.5, 159.4, 84.8)

select distinct f.*
  from spatial3d.fSimulationCoverBox(sims.bolshoi(), @box, 10) cb
    , Bolshoi..particles f
  where f.snapnum = 416
   and f.phkey between cb.keymin and cb.Keymax
   and (cb.fullonly=1 or
  	 (cb.fullonly=0 and
  	   @box.ContainsPoint(f.x+cb.shiftx,f.y+cb.shifty,f.z+cb.shiftz)=1))