Sampleread2()

The subroutine
sampleread2(samplefile,ng,zlim,sigma8,omega0,lambda0, x,y,z,d,mag,zhmax,id,wsel,ic)
is contained in mockread.f and enables mock redshift catalogues equivalent to the current status of the 2dF redshift survery to be read into a fortran program.

On the web-page hubble.html as well as links to the mock parent catalogue files, which have names like 1.apm and 1.2df_ngp, there are also links to files specifying the current completeness of mock redshift samples with names like 1.2df_ngp:199903 and 1.2df_sgp:199903. Here 199903 indicates March 1999.

The idea is that you can call the above subroutine with samplefile set equal to the name of the required sample and it will load the requested information in to the arrays you supply. It works by first reading two bits of information from "samplefile". These are a vector "wsel" with one entry per galaxy in the parent catalogue and the name of the parent catalogue. (The code may need some tinkering to generate the correct file name if you store them in directories with different names). The vector wsel has value zero if the galaxy in the parent catalogue is to be assumed not to have a measured redshift, while for galaxies with redshift its value is equal to the reciprocal of the completeness in the region of sky the galaxy occupies. (Thus it can be thought of as the weight to give that galaxy in any analsis, although we reccommend a more sophisticated way of set the weights.) The code then reads data from the corresponding parent catalogue and keeps only that relating to galaxies with positive values of wsel(). If one wants to keep only galaxies from regions where the completeness is above some threshold then this is easily done by throwing away galaxies with wsel> 1/threshold.


Example

Read the March 1999 redshift sample for realization 1 for the 2dF SGP region reading the x,y,z cartesian redshift coordinates, the true distance, the apparent magnitude, but not the zhmax (Related to Vmax) or particle id values. The routine also reads wsel() and the header information ng,zlim,sigma8,omega0 and lambda0.

integer ng,ic,NGMAX
parameter(NGMAX=10**6)
real zlim,sigma8,omega0,lambda0
real x(NGMAX),y(NGMAX),z(NGMAX),d(NGMAX),mag(NGMAX),zhmax(1)
integer id(1)

samplefile='1.2df_sgp:199903'
ic=5
call sampleread2(samplefile,ng,zlim,sigma8,omega0,lambda0, x,y,z,d,mag,zhmax,id,wsel,ic)

Now the header values zlim,sigma8,omega0 and lambda0 should be set. The values of ng should equal the number of galaxies in the redshift sample and arrays x(1) to x(ng) should contain the positions etc for the redshift sample galaxies.