version="XHTML+RDFa 1.1" xmlns="http://www.w3.org/1999/xhtml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" vocab="ivo://ivoa.net/std/DALI-examples" CosmoSim

Examples

Select ten most massive FOF groups at z=0 (snapnum 85) PostgreSQL
SELECT * FROM mdr1.fof
WHERE snapnum=85 
ORDER BY mass DESC
LIMIT 10
Mass function of BDMV halos for MDR1 simulation, redshift 0 (snapnum=85) PostgreSQL
SELECT 0.25*(0.5+floor(log(mvir)/0.25)) AS log_mass, COUNT(*) AS num
FROM mdr1.bdmv
WHERE snapnum=85 
GROUP BY floor(log(mvir)/0.25)
ORDER BY log_mass
Radial profile of most massive BDMV halo (z=0) PostgreSQL
SELECT * FROM bolshoi.bdmvprof
WHERE bdmid =
(SELECT bdmid FROM bolshoi.bdmv
WHERE snapnum=416 ORDER BY mvir DESC LIMIT 1)
ORDER BY rbin
Mass accretion history of a halo ADQL
SELECT p.foftreeid, p.treesnapnum, p.mass, p.np
FROM mdr1.fofmtree AS p, 
(SELECT foftreeid, mainleafid FROM mdr1.fofmtree 
  WHERE fofid=85000000000) AS mycl
WHERE p.foftreeid BETWEEN mycl.foftreeid AND mycl.mainleafid
ORDER BY p.treesnapnum
Redshifts for snapshot numbers ADQL
SELECT distinct zred, aexp, snapnum FROM mdr1.redshifts ORDER BY snapnum DESC
Progenitors of a halo ADQL

Extracts all progenitors of the halo with fofId=85000000000 (i.e. the most massive MDR1-halo at z=0) which consist of more than 200 particles.

SELECT p.* FROM mdr1.fofmtree AS p, 
(SELECT foftreeid, lastprogid FROM mdr1.fofmtree WHERE fofid=85000000000) AS mycl WHERE p.foftreeid BETWEEN mycl.foftreeid AND mycl.lastprogid 
AND p.np>200 
ORDER BY p.treesnapnum
Get final descendant of a halo ADQL

This query extracts the fofId for the final descendant of a halo (or FOF group) at redshift 0, i.e. the root halo of a merger tree. Replace 52000001014 by the fofId of any halo you are interested in.

SELECT m.fofid FROM mdr1.fofmtree AS m,
(SELECT treerootid FROM mdr1.fofmtree 
WHERE fofid = 52000001014) AS r
WHERE m.foftreeid = r.treerootid
Surrounding halos PostgreSQL

Selects halos from the MDR1.BDMV-catalogue within 5 Mpc/h from the given location (998, 450, 500), with periodic boundary conditions taken into account.

SELECT bdmid, x, y, z, rvir, mvir 
FROM mdr1.bdmv 
WHERE pdist(1000, x,y,z, 998,450,500) < 5
LIMIT 10