The lofarpipe.cuisine package

The LOFAR pipeline system developed partly from the WSRT Cuisine, developed by Adriaan Renting for use at the Westerbork Synthesis Radio Telescope. Many of the basic concepts (the recipe, with associated inputs and outputs, for example) originated in the Cuisine system, and the user is encouraged to refer to its documentation where necessary.

A slightly modified version of the “original” Cuisine is distributed as part of the lofarpipe package. The modifications include:

  • Use of new style Python classes throughout.
  • Reworked option handling code to use the optparse module from the Python standard library.
  • Reworked logging system using the logging module from the Python standard library. This provides a flexible way of configuring logging formats and destinations, included logging to files or TCP sockets. See the section on the pipeline logging system.
  • Assorted bug-fixes and tweaks.

It is hoped that these changes will eventually be merged upstream.

Very little of the original Cuisine code is currently used in the LOFAR framework, although the lofarpipe.cuisine.WSRTrecipe.WSRTrecipe is still used as the basis for all LOFAR recipes. The recipe author, however, is never expected to directly interact with Cuisine code: all LOFAR pipeline recipes inherit from lofarpipe.support.baserecipe.BaseRecipe, which entirely wraps all relevant Cuisine functionality. The lofarpipe.support inheritance diagrams show exactly how these packages are related. The following API documentation covers only those routines directly used by the rest of the pipeline system, not Cuisine as a whole.

lofarpipe.cuisine.WSRTrecipe

class lofarpipe.cuisine.WSRTrecipe.WSRTrecipe

Base class for recipes, pipelines are created by calling the cook_* methods. Most subclasses should only need to reimplement go() and add inputs and outputs. Some might need to addlogger() to messages or override main_results.

help()

Shows helptext and inputs and outputs of the recipe

main_init()

Main initialization for stand alone execution, reading input from the command line

main()

This function is to be run in standalone mode.

run(name)

This code will run if all inputs are valid, and wraps the actual functionality in self.go() with some exception handling, might need another name, like try_execute, because it’s to similar to go().

go()

Main functionality, this empty placeholder only shows help

main_result()

Main results display for stand alone execution, displaying results on stdout

cook_recipe(recipe, inputs, outputs)

Execute another recipe/pipeline as part of this one

lofarpipe.cuisine.cook

class lofarpipe.cuisine.cook.PipelineCook(task, inputs, outputs, logger, recipe_path)

A system for spawning a recipe, providing it with correct inputs, and collecting its outputs.

copy_inputs()

Ensure inputs are available to the recipe to be run

copy_outputs()

Pass outputs from the recipe back to the rest of the pipeline

spawn()

Copy inputs to the target recipe then run it

try_running()

Run the recipe, inputs should already have been checked.

Table Of Contents

Previous topic

The lofarpipe package

Next topic

The lofarpipe.support package

This Page