iactrace.io

Functions for loading and saving telescope configurations.

Functions

iactrace.io.load_telescope(filename, integrator, key=None)[source]

Load telescope from YAML configuration file.

Args:

filename: Path to YAML file. integrator: Integrator for sampling mirrors (e.g., MCIntegrator). key: JAX random key. Defaults to jax.random.key(0).

Returns:

Configured Telescope object.

iactrace.io.build_telescope(config, integrator, key)[source]

Build telescope from configuration dictionary.

Args:

config: Configuration dictionary (from YAML or programmatic construction). integrator: Integrator for sampling mirrors. key: JAX random key.

Returns:

Configured Telescope object.

iactrace.io.save_telescope(telescope, filename, precision=6, overwrite=True)[source]

Save a Telescope object to a YAML file.

Args:

telescope: The Telescope object to save. filename: Output file path. precision: Number of decimal places for float values. overwrite: If True, overwrite existing file. If False, raise

FileExistsError if file exists.

Returns:

Path to the saved file.

Raises:

FileExistsError: If file exists and overwrite is False.

Exceptions

exception iactrace.io.YAMLConfigError[source]

Bases: Exception

Raised when YAML configuration is invalid.