An R-notebook

Query galaxy and halo trees from the Millennium database and plot them ala Delucia & Blaizot (2007)

Uses some special purpose scripts written in R.

In [8]:
# R way of retrieving token
token=readLines('/home/idies/keystone.token')
In [9]:
# soucrgin some scripts specially written for querying CAS  jobs from R, 
# and for plotting galaxy and halo merger trees respectively
source('query_CAS.r')
source('HandleTrees.r')
In [10]:
# find some random galaxies from the L-Galaxies semi-analytical simulation 
# from Henriques etal 2015 (9)2015MNRAS.451.2663H)
# available on this version of CasJobs as context Henriques2015a
sql="
select  galaxyId, haloId 
  from mrscplanck1
 where snapnum=58 and stellarmass between 11 and 11.1 and type=0"
r=queryCAS(sql,token=token,context="Henriques2015a")
In [11]:
# plot the merger tree for the first galaxy
gt=galaxyTree(root=r$galaxyId[1],token=token,plot=TRUE)
In [13]:
# plot the merger tree for the corresponding dark matter halo
ht=haloTree(root=r$haloId[1],token=token,plot=TRUE)
In [ ]: