numina.core — Core classes for Pipelines

numina.core.dataframe

numina.core.dataholders

Recipe requirements

class numina.core.dataholders.Product(ptype, description='', validation=True, destination=None, optional=False, default=None, choices=None)

Product holder for RecipeResult.

numina.core.metaclass

Base metaclasses

class numina.core.metaclass.RecipeInputType

Metaclass for RecipeInput.

class numina.core.metaclass.RecipeResultType

Metaclass for RecipeResult.

class numina.core.metaclass.StoreType

Metaclass for storing members.

numina.core.metarecipes

Metaclasses for Recipes.

class numina.core.metarecipes.RecipeType

Metaclass for Recipe.

numina.core.metarecipes.generate_docs(klass)

Add documentation to generated classes

numina.core.objimport

Import objects by name

numina.core.objimport.import_object(path)

Import an object given its fully qualified name.

numina.core.oresult — Observation Result

Results of the Observing Blocks

class numina.core.oresult.ObservationResult(instrument='UNKNOWN', mode='UNKNOWN')

The result of a observing block.

numina.core.oresult.dataframe_from_list(values)

Build a DataFrame object from a list.

numina.core.oresult.obsres_from_dict(values)

Build a ObservationResult object from a dictionary.

numina.core.pipeline

DRP related classes

class numina.core.pipeline.InstrumentDRP(name, configurations, modes, pipelines, products=None, datamodel=None)

Description of an Instrument Data Reduction Pipeline

iterate_mode_provides(modes, pipeline)

Return the mode that provides a given product

query_provides(product, pipeline='default', search=False)

Return the mode that provides a given product

search_mode_provides(product, pipeline='default')

Search the mode that provides a given product

class numina.core.pipeline.ObservingMode

Observing modes of an Instrument.

class numina.core.pipeline.Pipeline(instrument, name, recipes, version=1, products=None, provides=None)

Base class for pipelines.

depsolve()

Load all recipes to search for products

get_recipe_object(mode)

Load recipe object, according to observing mode

load_product_class(mode)

Load recipe object, according to observing mode

load_product_object(name)

Load product object, according to name

load_recipe_object(mode)

Load recipe object, according to observing mode

provides(mode_label)

Return the ProductEntry for some mode

query_recipe(mode)

Recursive query of all calibrations required by a mode

who_provides(product_label)

Return the ProductEntry for some requirement

numina.core.pipelineload

Build a LoadableDRP from a yaml file

numina.core.pipelineload.check_section(node, section, keys=None)

Validate keys in a section

numina.core.pipelineload.drp_load(package, resource, confclass=None)

Load the DRPS from a resource file.

numina.core.pipelineload.drp_load_data(package, data, confclass=None)

Load the DRPS from data.

numina.core.pipelineload.load_mode(node)

Load one observing mdode

numina.core.pipelineload.load_mode_validator(obs_mode, node)

Load observing mode validator

numina.core.pipelineload.load_modes(node)

Load all observing modes

numina.core.recipeinout

Recipe inpus and outputs

class numina.core.recipeinout.ErrorRecipeResult(errortype, message, traceback, _error='')

The error result of a Recipe.

class numina.core.recipeinout.RecipeInput(*args, **kwds)

RecipeInput base class

class numina.core.recipeinout.RecipeResult(*args, **kwds)

The result of a Recipe.

class numina.core.recipeinout.define_input(inputClass)

Recipe decorator.

numina.core.recipeinout.define_requirements

alias of define_input

class numina.core.recipeinout.define_result(resultClass)

Recipe decorator.

numina.core.recipes

Basic tools and classes used to generate recipe modules.

A recipe is a class that complies with the reduction recipe API:

  • The class must derive from numina.core.BaseRecipe.
class numina.core.recipes.BaseRecipe(*args, **kwargs)

Base class for all instrument recipes

Parameters:intermediate_results (bool, optional) – If True, save intermediate results of the Recipe
obresult

ObservationResult, requirement

qc

QualityControl, result, QC.GOOD by default

logger

recipe logger

class RecipeInput(*args, **kwds)

RecipeInput base class

class RecipeResult(*args, **kwds)

The result of a Recipe.

build_recipe_input(ob, dal)

Build a RecipeInput object.

classmethod create_input(*args, **kwds)

Pass the result arguments to the RecipeInput constructor

classmethod create_result(*args, **kwds)

Pass the result arguments to the RecipeResult constructor

run_qc(recipe_input, recipe_result)

Run Quality Control checks.

save_intermediate_array(array, name)

Save intermediate array object as FITS.

save_intermediate_img(img, name)

Save intermediate FITS objects.

set_base_headers(hdr)

Set metadata in FITS headers.

validate_input(recipe_input)

“Validate the input of the recipe

validate_result(recipe_result)

Validate the result of the recipe

numina.core.requirements

Recipe requirement holders

class numina.core.requirements.InstrumentConfigurationRequirement

The Recipe requires the configuration of the instrument.

class numina.core.requirements.ObservationResultRequirement(query_opts=None)

The Recipe requires the result of an observation.

class numina.core.requirements.Parameter(value, description, destination=None, optional=False, choices=None, validation=True)

The Recipe requires a plain Python type.

class numina.core.requirements.Requirement(rtype, description, destination=None, optional=False, default=None, choices=None, validation=True, query_opts=None)

Requirement holder holder for RecipeRequirement.

numina.core.taggers

Function to retrieve tags from Observation results.

numina.core.taggers.get_tags_from_full_ob(ob, reqtags=None)
Parameters:
  • (ObservationResult) (ob) –
  • (dict) (reqtags) –
Returns:

Return type:

A dictionary

numina.core.utils

Recipes for system checks.

class numina.core.utils.AlwaysFailRecipe(*args, **kwargs)

A Recipe that always fails.

class RecipeInput(*args, **kwds)

RecipeInput base class

class RecipeResult(*args, **kwds)

The result of a Recipe.

class numina.core.utils.AlwaysSuccessRecipe(*args, **kwargs)

A Recipe that always successes.

class RecipeInput(*args, **kwds)

RecipeInput base class

class RecipeResult(*args, **kwds)

The result of a Recipe.

class numina.core.utils.OBSuccessRecipe(*args, **kwargs)

A Recipe that always successes, it requires an OB

class OBSuccessRecipeInput(*args, **kwds)

OBSuccessRecipeInput documentation.

obresult

ObservationResultType, requirement – Observation Result

RecipeInput

alias of OBSuccessRecipeInput

class RecipeResult(*args, **kwds)

The result of a Recipe.

numina.core.validator

Validator decorator

numina.core.validator.validate(method)

Decorate run method, inputs and outputs are validated