Skip to content

Light Path

queue_listerner instance-attribute

queue_listerner = setup_logging()

logger instance-attribute

logger = getLogger()

external_logger_flag instance-attribute

external_logger_flag = True

tag instance-attribute

tag = 'lightpath'

__init__

__init__(logger=None)

Initialize the LightPath object, which encapsulates the complete optical train.

Parameters:

Name Type Description Default
logger Logger

Logger instance for diagnostics.

None

initialize_parameters

initialize_parameters()

Initialize the internal buffers used during light propagation.

Returns:

Type Description
None

initialize_path

initialize_path(
    src,
    tel,
    atm=None,
    dm=None,
    wfs=None,
    ncpa=None,
    sci=None,
    vibration=None,
    delay=0,
    localSeeing=None,
)

Define and configure the optical path with all components.

Parameters:

Name Type Description Default
src Source

Light source (NGS, LGS, or Sun).

required
tel Telescope

Telescope instance.

required
atm Atmosphere

Atmospheric model.

None
dm DeformableMirror or list

Deformable mirrors in the path.

None
wfs ShackHartmann

Wavefront sensor.

None
ncpa NCPA

Non-common path aberration object.

None
sci Science camera

Science detector.

None
vibration Vibration source

Vibration object.

None
delay int

Light Path delay in samples.

0
localSeeing Local Seeing

Local Seeing object

None

Returns:

Type Description
bool

True if initialization succeeds.

propagate

propagate(
    temporal_tick,
    parallel_dms=False,
    interaction_matrix=False,
)

Simulate light propagation through the configured optical path.

Parameters:

Name Type Description Default
temporal_tick bool

If True, the simulation time advances 1 sample.

required
interaction_matrix bool

If True, disable atmosphere during propagation (used for IM calibration).

False
parallel_dms bool

If True, compute DMs in parallel.

False

Returns:

Type Description
bool

True if propagation was successful.

get_wavefront_error

get_wavefront_error()

Return the wavefront error measurement, accounting for latency delay.

Returns:

Type Description
ndarray or bool

Delayed measurement array, zeros if not enough iterations have elapsed, or False if no WFS is attached to this light path.

setup_logging

setup_logging(logging_level=logging.WARNING)

__del__

__del__()