LSSTDESC / rail_base

Base classes for RAIL
MIT License
0 stars 1 forks source link

Simple class for tomographic binning #10

Closed hangqianjun closed 1 year ago

hangqianjun commented 1 year ago

I would like to add a very simple class for tomographic binning. It will be using the point estimate, e.g. mode of the photo-z posterior, to split the sample into tomographic bins according to the Science Requirement Document. The class will probably be placed in summarization, but open to suggestions. Comments, advice, and helps are welcome!

aimalz commented 1 year ago

This is a good idea! I think we should actually make at least one additional superclass for classifier stages in a new module under src/rail/estimation (possibly needing several depending on what kinds of inputs they expect, as we do for estimators/summarizers). Then we can implement more sophisticated tomographers under the same API. But it definitely makes sense to mock up one or two simple tomographers first before making an abstract class to support more like them.

hangqianjun commented 1 year ago

In branch issue/10/tomo_bins I have now added a tomographer module under rail_base.estimation. It contains two generic tomographer classes:

  1. PZTomographer, which takes per-galaxy n(z) from a qp.Ensemble object and output a tabular object with tomographic binning;
  2. CatTomographer, which takes catalogue-like data and output a tabular object with tomographic binning; The second type will be compatible with the classifiers in tomo-challenge, where features in the catalogue are used to assign tomographic bins.

For each of these types, I've added an example classifier in algos/. For the first type this is the simple point estimate SRD binning; for the second type I adapted the random forest classifier from TXPipe. Is this kind of structure fine? Comments and suggestions are welcome.