chain_scan
Classes¤
ChainScan ¤
ChainScan(
working_dir="",
distribution_file="generator.in",
run_file="photo_track.in",
log_dir="log",
log_file_name="log.log",
console_log=True,
logger_name=None,
n_parallel=5,
)
Bases: ChainCore
Parameters:
Name | Type | Description | Default |
---|---|---|---|
working_dir |
str | Path
|
Working dir in which to perform the scan. Defaults to "". |
''
|
distribution_file |
str | Path
|
Name of the distribution file. Defaults to "generator.in". |
'generator.in'
|
run_file |
str | Path
|
Name of the run file. Defaults to "photo_track.in". |
'photo_track.in'
|
log_dir |
str | Path
|
Path to the log directory. Defaults to "log". |
'log'
|
log_file_name |
str | Path
|
Name of the log file. Defaults to "log.log". |
'log.log'
|
console_log |
bool
|
Option if to log to console. Defaults to False. |
True
|
logger_name |
str | Path
|
Name of the logger. If set to None, new logger will be created. Defaults to None. |
None
|
n_parallel |
int
|
Number of parallel runs. Defaults to 5. |
5
|
Source code in astra/chain_scan.py
Functions¤
add_scanning_parameter ¤
Method to add a scanning parameter for the parallel scan.
There are multiple options how to define the range of the parameter to be scanned:
- Full values list (
values
) - Start and end values (
start
,end
) + step size (step
) - Start and end values (
start
,end
) + number of steps (n_steps
)
This list also corresponds to the order at which the definition of the parameter is checked. Once the parameter is fully defined (one of the points above is fulfilled), the rest of the values may be internally overwritten to match the calculated values from the full definition.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
parameter |
str
|
Name of the scanning parameter. |
required |
values |
list
|
Full list of values to be scanned. If specified, defines fully the parameter. Defaults to None. |
None
|
start |
float
|
Starting value of the scan. Will be taken into account only if |
None
|
end |
float
|
Final value of the scan. Will be taken into account only if |
None
|
step |
float | list
|
Step size to be performed. For constant step size, use |
None
|
n_steps |
int
|
Number of constant steps to be performed. Will be taken into account only if |
None
|
Source code in astra/chain_scan.py
run ¤
Method to run the chain parallel scan.
Source code in astra/chain_scan.py
setup_scan_dir ¤
Method to setup the scan dir for the prese parameters. Each layer mean new subdirectory structure.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
preset_parameters |
dict
|
Dictionary of parameters from layers. |
required |
Returns:
Type | Description |
---|---|
Path
|
pathlib.Path: Path to the scan directory. |
Source code in astra/chain_scan.py
Created: October 31, 2023