dran.cli package#

Submodules#

dran.cli.init_processes module#

dran.cli.init_processes.init_output_directories(workdir, log)[source]#

Initialize output directories for diagnostics and plots. Creates the required subdirectories inside the working directory if they do not exist, and logs the operation.

Parameters:
Return type:

None

dran.cli.init_processes.run(args)[source]#

Main entry point for the application run.

Creates the working directory, configures logging, builds path mappings, initializes output directories, and dispatches execution to the selected processing mode based on the provided arguments.

Parameters:

args (Namespace)

Return type:

None

dran.cli.parser module#

dran.cli.parser.build_parser()[source]#

Construct and return the DRAN command-line interface parser.

This parser defines all supported CLI options for running the DRAN (Drift-scan Reduction and Analysis) system. It configures processing inputs, runtime behavior, operating modes, logging, database interaction, and web serving parameters.

Supported capabilities include:

  • FITS file or directory ingestion via –path

  • Debug logging control

  • Optional persistence of plot/lightcurve data to the database

  • Multiple operating modes:

    auto : Automatically process data gui : Launch desktop GUI interface web : Launch web interface anal : Run analysis-only mode docs : Generate or serve documentation serve : Start backend service (private to author)

  • Web server port configuration

  • Custom working/results directory

  • Version reporting

Returns:

A fully configured parser ready for argument parsing.

Return type:

argparse.ArgumentParser

dran.cli.parser.normalize_args(args)[source]#

Normalize parsed command-line arguments. Resolves path and workdir to validated existing filesystem paths and returns the updated namespace.

Parameters:

args (Namespace)

Return type:

Namespace

dran.cli.parser.validate_args(args, parser)[source]#

Validate command-line arguments and enforce required constraints.

Parameters:
Raises:

SystemExit – Triggered via parser.error() if: - mode=”auto” and no path is provided. - The provided path does not exist.

Return type:

None

Notes

  • Expands user home shortcuts (e.g. “~”) before checking existence.

  • Validation errors terminate execution with a clear CLI message.

dran.cli.parser.parse_args(argv=None)[source]#

Parse command-line arguments and return a normalized namespace. Builds the argument parser, parses the provided argument list or sys.argv, and applies post-processing to ensure consistent argument values.

Parameters:

argv (list[str] | None)

Return type:

Namespace

Module contents#