AstroGeoFit Script Execution¶
Script File¶
To use the simplified version of the software, it is necessary to download the AstroGeoFit_tool.py file, which can be found in the package astrogeofit_latest.zip. To download the package check the section Download the AstroGeoFit Package
Execution Of The Script¶
To execute the AstroGeoFit tool, you need to run the script with the appropriate arguments from the command line. Below are the options you can use to configure and control the execution of the tool:
Command-Line Arguments¶
To execute the program, the following line has to be executed (or copied) in to a terminal (or cmd in Windows). The argument [options] has to be changed
python AstroGeoFit_tool.py [options]
Options of Execution¶
There are options that can be added to the previous command line, which will control the sections that AstroGeoFit will execute (fit, mcmc, weights or significance test).
Warning
If no types of execuion are set, it will execute all of the parts of the tool: significance test, fit, mcmc and weights.
-fit,--fit(Optional)Define the execution type. Iffitis set, the program will execute the model fit. This section inlcudes the fitting of the genetic algorithm and it’s results.Example:python AstroGeoFit_tool.py -fit
-mcmc,--mcmc(Optional)Define the execution type. Ifmcmcis set, the program will execute themcmc. This section inlcudes the mcmc calcula and it’s results.Note that if themcmcis executed without executing thefiton the same run, the path of thefitresults has to be introduced. Refer to: add_path_results.Example:python AstroGeoFit_tool.py -mcmc
-weights,--weights(Optional)Define the execution type. Ifweightsis set, the program will compute the weights. This section inlcudes the MCMC weights computation and it’s results.Note that if theweightsis executed without executing themcmcon the same run, the path of themcmcresults has to be introduced. Refer to: add_path_results.The execution of this option will affect the form of the plots.Example:python AstroGeoFit_tool.py -weights
-sig,--significance(Optional)Define the execution type. Ifsigis set, the program will execute the significance test.
Note
The test applies only to the fitting of the Genetic Algorithm not to the MCMC.
python AstroGeoFit_tool.py -sig
Other Options¶
-p,--path(Optional)Specify the path to the configuration file. If no path is provided, the default configuration file atconfig/config_filewill beused.Example:python AstroGeoFit_tool.py -p /path/to/config_file.yml
-pr,--pathresults(Optional)Specify the path where the file of the results is located. This argument is needed if the execution computes the mcmc but not the fit, or if it computes the weights but not the mcmc . If not provided, the path defined in the configuration file will be used.It is possible to add the path for the fit results and mcmc results in case we want to execute the weights section alone. To do this, we just have to add the -pr option and add first the path of the fit results and after the path of the mcmc results separated by a space. The order of the paths is important.Example:python AstroGeoFit_tool.py -pr /path/of/the/results.pickle
-r,--remote(Optional)This option is used when the tool is executed in a server that the user can not interact with. When activated, the software will not give the user the option to chose in certain situations, which can makethe tool more restrictive.Example:python AstroGeoFit_tool.py -r
-logs,--logs(Optional)If this option is set, the tool will print the outputs of the execution in a txt file. This file will be saved under the name logs and will be included in the results folder.Example:python AstroGeoFit_tool.py -logs
-s,--savefigures(Optional)If set, the tool will save the generated figures as jpegs in the same folder where the results are stored.Example:python AstroGeoFit_tool.py -s
Commonly Used Execution Examples¶
Run the tool with the default configuration file and execute all steps:
python AstroGeoFit_tool.pyRun the tool with a custom configuration file and execute the fitting process:
python AstroGeoFit_tool.py -fit -p /path/to/config_file.yml
Run the tool with a custom configuration file and execute the mcmc process (the folder of the fitting results will be extracted from the configuration file):
python AstroGeoFit_tool.py -mcmc -p /path/to/config_file.yml
Run the tool with a custom configuration file and execute the significance test process:
python AstroGeoFit_tool.py -sig -p /path/to/config_file.yml
Run the tool with a custom configuration file and execute the weights calcula process (the folder of the fitting results and mcmc results will be extracted from the configuration file):
python AstroGeoFit_tool.py -weights -p /path/to/config_file.yml
Other Examples¶
Run the tool using MCMC and specify the path to the MCMC results:
python AstroGeoFit_tool.py -mcmc -pr /path/to/fit_results.pickle
Run the tool and save the figures:
python AstroGeoFit_tool.py -s
Run the tool selecting a custom configuration file, using the MCMC, specifying the path to the MCMC results and saving the figures:
python AstroGeoFit_tool.py -p /path/to/config_file.yml -mcmc -pr /path/to/mcmc_results -s
Run the tool using Weights section, and adding the paths of the fitting and the mcmc results:
python AstroGeoFit_tool.py -weights -pr /path/to/fit_results /path/to/mcmc_results