bjet_mcmc.blazar_initialize module
file name: blazar_initialize.py
Purpose: Implement functions to make necessary directories and compile the c++ code
- bjet_mcmc.blazar_initialize.compile_bjet(bjet_folder=None, executable=None, verbose=False)
Compiles the specified BJET folder using the specified executable.
- Parameters:
bjet_folder (str) – The folder containing the BJET files to be compiled. If not provided, the default CPP_FOLDER will be used.
executable (str) – The name of the executable file to be generated. If not provided, the default EXECUTABLE will be used.
verbose (bool) – If True, the make process will display verbose output. If False, the output will be suppressed. Default is False.
- Returns:
None
- Return type:
None
- bjet_mcmc.blazar_initialize.initialize(data_folder=None, results_folder=None, parameter_folder=None, parameter_file=False, bjet_folder=None, executable=None, run_compile=True)
Initializes the software by creating necessary directories, compiling the required files, and copying the executable.
- Parameters:
data_folder (str) – The path to the data folder. Defaults to None.
results_folder (str) – The path to the results folder. Defaults to None.
parameter_folder (str) – The path to the parameter folder. Defaults to None.
parameter_file (bool) – Indicates whether a parameter file is present. Defaults to False.
bjet_folder (str) – The path to the bjet folder. Defaults to None.
executable (str) – The name of the executable file. Defaults to None.
run_compile (bool) – Indicates whether to compile the bjet executable. Defaults to True.
- Returns:
None
- Return type:
None
- bjet_mcmc.blazar_initialize.make_dirs(data_folder=None, results_folder=None, parameter_folder=None, parameter_file=False)
This function, make_dirs, creates folders based on the input parameters.
The function first checks if any of the input folder parameters are None. If they are, it assigns default values based on predefined constants.
Then, it iterates through each of the folders (data_folder, results_folder, parameter_folder) and checks if they are not None. If they are not None, it checks if the folder path does not already exist. If it doesn’t exist, it creates the folder.
Finally, it checks if the current folder being processed is the results_folder and if the folder path doesn’t already exist. If it doesn’t exist, it creates the folder under a specific path.
Note: This function relies on the presence of certain constants (e.g. DATA_FOLDER, RESULTS_FOLDER, PARAMETER_FOLDER, BASE_PATH, FOLDER_PATH), but these constants are not defined or included in this documentation.
- Example usage:
make_dirs(data_folder=’data’, results_folder=’results’, parameter_folder=’parameters’, parameter_file=True)
- Parameters:
data_folder (str) – The folder to store data files. Defaults to DATA_FOLDER.
results_folder (str) – The folder to store results files. Defaults to RESULTS_FOLDER.
parameter_folder (str) – The folder to store parameter files. If None and parameter_file is True, it defaults to the value of PARAMETER_FOLDER. If None and parameter_file is False, the parameter folder will not be created.
parameter_file (bool) – A boolean indicating whether a parameter file is present or not. Defaults to False.
- Returns:
None
- Return type:
None