Run Dial software
This script is designed to interface and run the DIAL-Lidar-Ozone retrieval process, supporting configuration through command line arguments. It allows specifying a parameter file, a log file, and the version of the DIAL software to use.
Features
Parameter file (mandatory): Specifies the path to the parameter file needed for the retrieval process.
Log file (optional): Specifies the path to the log file. If not provided, a new log file is created in the ‘log’ directory.
Version (optional): Allows specifying the version of the DIAL software to be used. The default version is ‘01’.
In addition, the script suppresses warnings from the pint package and FutureWarnings to avoid unnecessary console output.
Installation
No specific installation steps are required for the script itself, assuming Python and the necessary packages (pint, argparse, logging) are installed.
Usage
The script can be run from the command line, providing the necessary arguments. Below is an example command:
python run_dial.py 'path/to/parameter/file.xml'
Here’s how to specify a custom log file and use a different version of the DIAL software:
python run_dial.py 'path/to/parameter/file.xml' --log 'path/to/logfile.log' --version '02'
API
This script provides an interface to run the DIAL-Lidar-Ozone retrieval process. It supports configuration through command line arguments, including specifying a parameter file, a log file, and the version of the DIAL software to use.
- Arguments:
Parameter file (mandatory): The path to the parameter file needed for the retrieval process.
Log file (optional): The path to the log file. If not provided, a new log file is created in the ‘log’ directory.
Version (optional): Specify the version of the DIAL software to be used. Default is ‘01’.
Warnings from the pint package and FutureWarnings are suppressed to avoid unnecessary console output.
Example: python run_dial.py ‘C:UsersgpayenPycharmProjectsdial-lidar-ozone-retrieval-for-actrisConfiguration_filesParameter_files240529_lio3s_ohp_parameters_extern.xml’ -d ‘2022-03-02’
- run_dial.main()
The Main function that orchestrates the execution flow of the script.
Parses command line arguments, suppresses unwanted warnings, configures logging, and initializes the DIAL-Lidar-Ozone retrieval process based on the specified software version.
- run_dial.parse_arguments()
Defines and parses the command line arguments.
- Returns:
The parsed arguments are accessible as properties (e.g., args.param, args.log).
- Return type:
Namespace
- run_dial.setup_logging(log_file=None)
Configures logging to a specified file.
If no log file is specified, a new log file is created in the ‘log’ directory with a timestamp.
- Parameters:
log_file (str | None, optional) – The path to the log file. If None, a log file is created in the ‘log’ directory.
- run_dial.suppress_warnings()
Suppresses specific unwanted warnings to keep the console output clean.
Suppresses the following: - UnitStrippedWarning from the pint package. - FutureWarnings regarding the use of non-Series, non-Index, non-ExtensionArray, or non-np.ndarray arguments.