Wiki

Clone wiki

TailZ / examples / VipersMock

VIPERS mock example

This example is in the repository at examples/vipers_example.

Build mock catalog

We will start with a catalog of redshift and galaxy colors from the VIPERS PDR1 sample. We will fit the color-redshift distribution with a Gaussian mixture model and then construct a mock catalog by sampling from the model distribution

First we need the VIPERS catalog file vipers_pdr1.npy. Download it here or follow these steps to get the file:

cd examples/vipers_example
mkdir data
cd data
wget https://bitbucket.org/bengranett/tailz/downloads/vipers_pdr1.npy.gz
gunzip vipers_pdr1.npy.gz

Now we run the script vipers_mock.py to model the VIPERS data and sample it. It reads the VIPERS catalog at data/vipers_pdr1.npy.

This creates files in the subdirectory `data`.

python vipers_mock.py

The script first carries out the Gaussian mixture model fit with 8 components by calling the routine from scikit-learn. It does this 10 times, computes the AIC of each and takes the best one. It then generates a mock catalog by sampling from the Gaussian components.

ls data
syn_gmm.npy     testcat.npy     vipers_pdr1.npy zcat.npy

PDF estimation

Next we run Tailz to estimate a redshift PDF. The configuration is already set up in the file tailz.config.

python ../../tailz/main.py -c tailz.config

Since this takes some time you could submit the job eg on a slurm cluster:

sbatch -c8 -n1 --wrap="python -u ../../tailz/main.py -c tailz.config"

Updated