Usage#
Command Line Interface#
The package installs a yasf CLI.
yasf --help
yasf compute --help
The main entry point is:
yasf compute --config path/to/config.json
Selected options (see --help for the full list):
--cluster PATH: overrideparticles.geometry.file--cluster-scale FLOAT: overrideparticles.geometry.scale--cluster-dimensional-scale FLOAT: overrideparticles.geometry.dimensional_scale--backend {yasf,mstm}: use the native YASF backend or run the MSTM4 comparison backend
Cluster Scaling Semantics#
YASF has two different multiplicative scaling concepts for particle clusters:
particles.geometry.scale (unit conversion / wavelength-unit matching)#
This value is a unit scale factor for the positions/radii loaded from the cluster file. It is used together with the wavelength scale to ensure geometry and wavelength are expressed in compatible units.
Geometry values are assumed to be in “cluster units” and are converted to the same unit system used by
parameters.wavelength.data.In practice, if your wavelength is specified in micrometers (
scale = 1e-6), then your cluster scale should also typically be1e-6when your cluster file values are also in micrometers.
particles.geometry.dimensional_scale (physical resizing)#
This value is an additional dimensionless scaling factor applied to the entire cluster geometry:
Multiplies
x,y,z, andrby the same factor.Useful for “inflating/deflating” a cluster without rewriting the geometry file.
Order of operations#
When loading a config, yasfpy.config.Config applies scaling in the following order:
Load raw geometry from the cluster file (x, y, z, r)
Apply dimensional scaling (
dimensional_scale/--cluster-dimensional-scale)Apply overlap correction (if enabled by the code path)
Convert geometry into wavelength units via the ratio:
particles.geometry.scale / parameters.wavelength.scale
Precedence (config vs CLI/API)#
If you set CLI overrides (
yasf compute --cluster-scale .../--cluster-dimensional-scale ...), they take precedence over the config file.If you don’t pass overrides (or you call
YASF(...)without them), the values from the config file are used.
Python API#
The Python API is outlined in the API documentation.
You can also override scaling programmatically:
from yasfpy import YASF
sim = YASF(
path_config="config.json",
cluster_scale=1e-6,
cluster_dimensional_scale=1.5,
)
sim.run()
Please also check the examples section for runnable examples in this repository.