Adding a new RailDataset type

Because of the variety of formats of files in RAIL, and the variety of analysis flavors in a RailProject, it is useful to be able to define the particular types of datasets that are needed to make specific plots. These are implemented as subclasses of the rail.plotting.dataset.RailDataset class. A RailDataset is intended define the quantities needed to make a particular type of plot.

New RailDataset Example

The following example has all of the required pieces of a RailDataset and almost nothing else.

class RailPZPointEstimateDataset(RailDataset):
    """Dataet to hold a vector p(z) point estimates and corresponding
    true redshifts
    """

    data_types = dict(
        truth=np.ndarray,
        pointEstimate=np.ndarray,
    )

The required pieces, in the order that they appear are:

  1. The RailPZPointEstimateDataset (RailDataset): defines a class called RailPZPointEstimateDataset and specifies that it inherits from RailDataset.

  2. The data_types define names and expected data types of the required data.