mangadap.config.analysisplan module
Classes to handle MaNGA DAP analysis plans.
Copyright © 2019, SDSS-IV/MaNGA Pipeline Group
- class mangadap.config.analysisplan.AnalysisPlan(plan, analysis_path=None, **kwargs)[source]
Bases:
objectContainer class for a set of analysis plans.
- Parameters:
plan (
dict) – Dictionary providing the control-flow option hierarchy.analysis_path (
str, optional) – Path for output files. If None, the current working directory is used.**kwargs (
dict, optional) – Catch-all for spurious, ignored parameters.
- common_path()[source]
Return the path for data common to all plans.
- Returns:
Path object for the “common” output
- Return type:
- dap_file_root(cube, mode=None, plan_index=None)[source]
Return the general root name for an output file.
The default returned by this base class is:
{cube.output_root}-{mode}-{self['key'][plan_index]}
where
modeandself['key'][plan_index]are only included ifmodeorplan_indexare provided.Derived class can, of course, use different naming conventions.
- Parameters:
cube (
DataCube) – Cube being analyzed. In this base class, this is simply used to provide the primary root of the output name; seeoutput_root.mode (
str, optional) – An optional “mode” included in the file name. If None, not include in the output string.plan_index (
int, optional) – The index of the plan. This is used to select the key of the analysis plan being used, which is subsequently included in the file name. If None, this is not included in the file name.
- Returns:
General root for output DAP file names.
- Return type:
str
- classmethod from_toml(ifile, **kwargs)[source]
Instantiate the plan from a TOML file.
- Parameters:
ifile (
str, Path) – File with the runtime analysis plan optionskwargs (
dict, optional) – Passed directly to the initialization method (AnalysisPlan)
- Returns:
Constructed analysis plan.
- Return type:
- method_path(plan_index=0, qa=False, ref=False)[source]
Return the path for method-specific output.
- Parameters:
plan_index (
int, optional) – The index of the plan. This is used to select the ‘key’ of the analysis plan being used, which is used as the subdirectory for the output.qa (
bool, optional) – Flag that the output is specifically quality assessment plots.ref (
bool, optional) – Flag that the output is specifically reference data.
- Returns:
Path object for the method-specific output
- Return type:
- Raises:
ValueError – Raised if the plan index is invalid or if both qa and ref are true.