3.9 KiB
3.9 KiB
RWSims
Collection of rw sim scripts
Usage
# the next lines are only necessary if the python script is not in the same folder as rwsims
import sys
sys.path.append('/path/to/RWSims')
from rwsims.sims import run_ste_sim, run_spectrum_sim
run_ste_sim('/path/to/json-file')
run_spectrum_sim('/path/to/json-file')
Parameter file
Parameter for a simulation are given by a JSON file, sections are:
simulation
key | type | description |
---|---|---|
num | integer | Number of trajectories |
seed | integer or null | Seed value for random number generator |
molecule
key | type | description |
---|---|---|
delta | float | Anisotropy (in Hz) |
eta | float | Asymmetry |
correlation_times
key | type | description |
---|---|---|
distribution | string | Name of distribution. Possible values: DeltaDistribution , LogGaussian |
tau | variable | Characteristic time of distribution (in s) |
Other parameter | variable | Additional parameter, e.g., sigma |
motion
key | type | description |
---|---|---|
model | string | Name of motion. Possible values: RandomJump , TetrahedralJump |
spectrum
key | type | description |
---|---|---|
dwell_time | float | Dwell time of acquisition (in s) |
num_points | integer | Number of acquisition points |
t_echo | variable | One or more echo delays (use zero for FID) (in s) |
line_broadening | float | Additional exponential broadening (in Hz) |
t_pulse | float | Pulse length used of attenuation (in s) |
ste
key | type | description |
---|---|---|
t_evo | variable | One or more evolution times |
t_mix | variable | One or more mixing times |
t_echo | float | Optional echo delay for 4-pulse sequence (in s) |
variable type
Keys of type variable can be a single value, a list of values, or values between a given start and stop value.
Examples:
- A single value
{
// Other parameter...
"tau": 1e-3,
// More parameter..
}
- A list of predefined values, defined by key
list
{
// Other parameter...
"tau": {
"list": [1e-5, 1e-4, 1e-3, 1e-2]
},
// More parameter..
}
++ A list of predefined values, based on start and end value
{
// Other parameter...
"tau": {
"start": 1e-6,
"stop": 1e0,
"steps": 31,
"is_log": true // this parameter is optional, default is false
},
// More parameter..
}
Output
Results are written to text files and png images.
- For spectrum simulations:
- Each combination of distribution and motion parameter produces files for the dependence of timesignals/spectra on the echo delay.
- The reduction factor vs. correlation time is plotted for all variable together in one png plot
- For STE simulation:
- Each combination of distribution and motion parameter produces files for the CC/SS decays.
- The dependence on the evolution of the fit parameter is saved and plotted for the various variable combinations