Recipe

class musered.Recipe(output_dir=None, use_drs_output=True, temp_dir='.', log_dir='.', version=None, nifu=- 1, tag=None, verbose=True)[source]

Bases: musered.recipes.recipe.BaseRecipe

Base class for the DRS Recipes.

Parameters
output_dirstr

Name of output directory.

use_drs_outputbool

If True, output files are saved by the DRS, else files are saved by musered with custom names (experimental!).

temp_dirstr

Base directory for temporary directories where the recipe is executed. The working dir is created as a subdir with a random file name. If set to None (default), the system temp dir is used.

log_dirstr

Directory for log files.

versionstr

Version of the recipe. By default the latest version is used.

nifuint

IFU to handle. If set to 0, all IFUs are processed serially. If set to -1 (default), all IFUs are processed in parallel.

tagstr

Tag used by the recipe, default to cpl.Recipe.tag. Can be used to change the type of processed input for e.g. muse_scibasic.

Attributes Summary

DPR_TYPE

Type of data to process (DPR.TYPE).

DPR_TYPES

Same as DPR_TYPE but when a recipe can process multiples types, e.g.

QC_keywords

QC keywords to show, for each frame.

calib_frames

Return the list of calibration frames.

default_params

Default parameters.

env

Default environment variables.

exclude_frames

Frames that must be excluded by default.

n_inputs_min

Minimum number of input files, as required by the DRS.

n_inputs_rec

Recommended number of input files, typically for calibration files.

output_dir

Default output directory.

output_frames

Return the list of output frames.

recipe_name

Name of the recipe.

recipe_name_drs

Name of the recipe for the DRS, in case it is renamed in musered.

use_illum

If True, the recipe should use an ILLUM exposure.

version

Return the recipe version

Methods Summary

activate_file_logger()

Activate the logging to a file.

deactivate_file_logger()

Deactivate the logging to a file.

dump([include_files, json_col])

Dump recipe results, stats, parameters in a dict.

dump_params([json_col])

Dump non-default parameters to a JSON string.

run(flist, *args[, params])

Run the recipe.

Attributes Documentation

DPR_TYPE = None

Type of data to process (DPR.TYPE). If None, cpl.Recipe.tag is used.

DPR_TYPES = {}

Same as DPR_TYPE but when a recipe can process multiples types, e.g. muse_scibasic. If None, cpl.Recipe.tag is used.

QC_keywords = {}

QC keywords to show, for each frame.

calib_frames
default_params = {}

Default parameters.

env = None

Default environment variables.

exclude_frames = ('MASTER_DARK', 'NONLINEARITY_GAIN')

Frames that must be excluded by default.

n_inputs_min = 1

Minimum number of input files, as required by the DRS.

n_inputs_rec = None

Recommended number of input files, typically for calibration files.

output_dir = None

Default output directory.

output_frames

Output frames.

recipe_name = None

Name of the recipe.

recipe_name_drs = None

Name of the recipe for the DRS, in case it is renamed in musered.

use_illum = None

If True, the recipe should use an ILLUM exposure.

version

Recipe version.

Methods Documentation

activate_file_logger()[source]

Activate the logging to a file.

deactivate_file_logger()[source]

Deactivate the logging to a file.

dump(include_files=False, json_col=False)[source]

Dump recipe results, stats, parameters in a dict.

dump_params(json_col=False)[source]

Dump non-default parameters to a JSON string.

run(flist, *args, params=None, **kwargs)

Run the recipe.

Subclasses must implement BaseRecipe._run to customize this.

Parameters
fliststr, list of str, or dict

List of input raw files. Can be a file, list of files, or a dict with DPR_TYPE as key and list of files as value.

paramsdict

Parameters for the recipe.

*args, **kwargs

Additional arguments are passed to BaseRecipe._run.