Quick Start

Import pipelines for a specific topic, for example to import the One2One and CherryPicked pipelines for galaxies characterization:

>>> from astromlp.galaxies import One2One, CherryPicked

Next, create an instance of the One2One pipeline, you may need to provide the location of the astromlp-models/model_store directory where the actual models live, for example:

>>> pipeline = One2One(model_store='./astromlp-models/model_store')

The galaxies pipelines are based on SDSS data, so the input to the pipeline if an SDSS object identifier (objid), for example to process the object 1237648720693755918 using the selected pipeline run:

>>> result = pipeline.process(1237648720693755918)

The result object is an instance of PipelineResult, the outputs of the pipeline processing:

>>> result
PipelineResult(redshift=0.0869317390024662, smass=23.44926865895589,
subclass='STARFORMING', gz2c='ScR')

The PipelineResult object implements other methods that provide extra data, namely:

  • objid: returns the SDSS object identifier;

  • obj: returns some information about the object from SDSS data;

  • models: returns the ensemble of models used;

  • map: returns the list of results of applying each individual model for each output.

You can easily create new ensembles of models using the MapReducPipeline and passing the list of outputs and corresponding models. For example, to create a pipeline that computes the redshift using the i2r and f2r models:

>>> from astromlp.galaxies import MapReducePipeline
>>> pipeline = MapReducePipeline({ 'redshift': ['i2r', 'f2r'] })