qp practical example

Alex Malz, Phil Marshall, Eric Charles

In this notebook we use the qp module to study some photo-Z PDFs.

Setup, reading ensemble

Imports

First let's import the packages we will need for this notebook

Data files

Now lets download the data files we will need, if we haven't already

Reading ensemble

Now we read the ensemble, note that we only need the name of the data file, the name of the metadata file is assumed.

Exploration

This will show use that the

Plotting Example

Now we are going to plot some PDFs from the ensemble Note that the first call to the plot specifies the x-axis limits, but does not specify the key (i.e., which PDF in the ensemble), so that defaults to 0 (i.e., the first PDF).

Timing benchmarks

Now we are going to extract some information from the ensemble and time how long it takes to do so

Changing the grid for the representation

Conversion to other represenations

quantile representaion

Histogram representation

Other representations

qp also includes spline-based and Gaussian mixture represenations. The conversion to these forms much slower, so we will first reduce the base ensemble from 20000 PDFs to 100 PDFs

Spline representation

We can convert to the spline representation a few different ways. This particular method specifies that we should evaluate each PDF at a grid of points and then use those to construct the spline represenation. We do this for 2 different grids. Note how much slower this conversion function is that the ones above.

Gaussian mixture model