mangadap.config.analysisplan module

Classes to handle MaNGA DAP analysis plans.


License

Copyright © 2019, SDSS-IV/MaNGA Pipeline Group


class mangadap.config.analysisplan.AnalysisPlan(plan, analysis_path=None, **kwargs)[source]

Bases: object

Container 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.

_validate()[source]

Validate the provided plans.

common_path()[source]

Return the path for data common to all plans.

Returns:

Path object for the “common” output

Return type:

Path

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 mode and self['key'][plan_index] are only included if mode or plan_index are 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; see output_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 default(**kwargs)[source]

Return the default analysis plan set.

classmethod from_toml(ifile, **kwargs)[source]

Instantiate the plan from a TOML file.

Parameters:
  • ifile (str, Path) – File with the runtime analysis plan options

  • kwargs (dict, optional) – Passed directly to the initialization method (AnalysisPlan)

Returns:

Constructed analysis plan.

Return type:

AnalysisPlan

keys()[source]

Return the plan keyword identifiers.

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:

Path

Raises:

ValueError – Raised if the plan index is invalid or if both qa and ref are true.

parse()[source]

Parse the provided options and instantiate the methods for each DAP stage.