Influence Functions¶
Overview¶
The InfluenceFunctions class generates the influence functions of real, user-defined deformable mirrors. It acts as a dispatcher: the heavy, system-specific computation is delegated to a dedicated function in OOPAO.tools.user_defined_influence_functions_, imported lazily so that the optional dependencies (scipy.io, skimage, joblib) are only loaded when actually needed. Generic operations — left/right and up/down flips, sign convention, actuator centroids — are then applied uniformly whatever the system.
The resulting cube can be passed to a DeformableMirror through its modes argument to simulate the real mirror geometry instead of the default Gaussian model.
Note
Most systems require input data that is not shipped with OOPAO. The RAMA and EKARUS cubes are available from public download links (see the table below); the ELT-M4 FEM data and the LBT-ASM eigen modes are available on request (cedric-taissir.heritier@lam.fr). PAPYRUS_DM241 and GHOST_DM492 are modelled from actuator coordinates and need little or no external data.
Supported systems¶
|
Description |
Input data |
|---|---|---|
|
ELT M4 from reduced FEM data (892 actuators per segment) |
On request |
|
LBT adaptive secondary from the mirror eigen modes |
On request |
|
RAMA 97-actuator DM (measured cube) |
Public download link |
|
EKARUS 468-actuator DM (zonal cube) |
Public download link |
|
GHOST 492-actuator DM (modelled from coordinates) |
Coordinates file |
|
PAPYRUS 241-actuator DM (Gaussian model) |
None |
Key concepts¶
Influence-function cube — 3-D array of shape
[n_act, resolution, resolution], one 2-D phase map per actuator, sampled at the telescope pupil resolution.Mis-registration — a
MisRegistrationobject (shift, rotation, radial/tangential scaling, anamorphosis) applied during the generation, either analytically on the interpolation coordinates (ELT_M4) or as a geometric image transformation (other systems).Sign convention — global sign applied to the cube (
sign=1or-1), to match the push/pull convention of the rest of the simulation.Lazy dispatch — the system-specific compute function is resolved through a dispatch table and imported only when the class is instantiated; unknown system names raise an
OopaoErrorlisting the valid options.
Quick start¶
from OOPAO.tools.influence_functions import InfluenceFunctions
from OOPAO.MisRegistration import MisRegistration
# Optional mis-registration of the DM
misReg = MisRegistration()
misReg.rotationAngle = 1.5 # degrees
misReg.shiftX = 0.05 # metres
# Generate the ELT-M4 influence functions at the pupil resolution
IFs = InfluenceFunctions(name_system='ELT_M4',
diameter=39,
resolution=480,
loc='/path/to/M4_data/',
mis_registration=misReg,
specific_parameters={'n_segments': 6,
'new_arrangement': False,
'parallel': True,
'n_jobs': 6})
cube = IFs.influence_function_2D # [n_act, resolution, resolution]
coords = IFs.coordinates # actuator centroids
Recent developments¶
Changed in version 26.7:
ELT_M4 — the interpolation of the FEM data onto the pupil grid is now performed through a precomputed sparse barycentric-interpolation operator (one Delaunay triangulation per segment, then a single sparse matrix product for the 892 influence functions of the segment). This reproduces
scipy.interpolate.griddata(..., method='linear')with out-of-hull points set to 0, at a fraction of the cost. Optional segment-level parallelization is available throughspecific_parameters['parallel'].LBT_ASM — the requested
resolutioncan now be larger than the native resolution of the eigen-mode maps (upsampling). The mode cube is padded symmetrically before the geometric transformation so that the magnified pupil fits in the canvas; physical pixel scales are computed before padding and are therefore unaffected. The crop uses explicit end indices, making the degenerate caseresolution == native resolutionsafe.LBT_ASM —
skimage.transform.warpnow uses bilinear interpolation (order=1) instead of nearest-neighbour (order=0), removing blocky artefacts when upsampling. Downsampled influence functions therefore differ at the sub-percent level from previous versions.Dispatcher —
InfluenceFunctionsresolves the compute function through a single dispatch table instead of repeatedifblocks; unknown system names raise anOopaoErrorlisting the valid options.
API reference¶
- class OOPAO.InfluenceFunctions.InfluenceFunctions(name_system, diameter, resolution, loc=None, mis_registration=None, flip_lr=False, flip_ud=False, specific_parameters=None, sign=1)[source]¶
Compute the influence functions of a user-defined system.
- Parameters:
name_system (str) – Name of the system. One of
'ELT_M4','EKARUS_DM468','LBT_ASM','GHOST_DM492','PAPYRUS_DM241','RAMA_DM97'.diameter (float) – Telescope diameter in metres.
resolution (int) – Number of pixels across the pupil diameter.
loc (str or None) – Path to the system input data. Default
None.mis_registration (MisRegistration or None) – Mis-registration applied during the generation (shift, rotation, radial/tangential scaling, anamorphosis). Default
None(no mis-registration).flip_lr (bool) – Flip the influence functions left/right. Default
False.flip_ud (bool) – Flip the influence functions up/down. Default
False.specific_parameters (dict or None) – System-specific parameters; currently used by
ELT_M4only (keys'n_segments','new_arrangement','parallel','n_jobs'). DefaultNone.sign (int) – Sign convention applied to the influence functions. Default
1.
- Raises:
OopaoError – If
name_systemis not recognized, or if the input data cannot be found atloc.
Key properties
- influence_function_2D: numpy.ndarray¶
Influence-function cube of shape
[n_act, resolution, resolution], with flips and sign applied.
- coordinates: numpy.ndarray¶
Actuator coordinates computed as the centroids of the (flipped) influence functions.
System-specific compute functions¶
All compute functions live in OOPAO.tools.user_defined_influence_functions_ and share the common signature below; they are normally called through InfluenceFunctions rather than directly. Each returns the raw influence-function cube [n_act, resolution, resolution] (no flips or sign applied).
- OOPAO.InfluenceFunctions.compute_ELT_M4_influence_functions(name_system, diameter, resolution, loc=None, mis_registration=None, flip_lr=False, flip_ud=False, specific_parameters=None)¶
Generate the ELT-M4 influence functions from the reduced FEM data. The FEM node values are interpolated onto the (distorted, mis-registered) pupil coordinates through a precomputed sparse barycentric operator — one Delaunay triangulation per segment. The mis-registration is applied analytically to the query coordinates, so no image resampling is required.
- Parameters:
specific_parameters (dict or None) –
'n_segments'(int, number of M4 petals, default 6),'new_arrangement'(bool, use theIDX_NEW.fitsactuator ordering, defaultFalse),'parallel'(bool, one joblib process per segment, defaultFalse),'n_jobs'(int, capped atn_segments, default 6).
- OOPAO.InfluenceFunctions.compute_LBT_ASM_influence_functions(name_system, diameter, resolution, loc=None, mis_registration=None, flip_lr=False, flip_ud=False, specific_parameters=None)¶
Compute the LBT ASM influence functions from the mirror eigen modes (
phase_matrix.sav), projected from the modal to the zonal basis through the pseudo-inverse of the modes-to-commands matrix (m2c.fits). Down- and up-sampling to the requested resolution are supported; when upsampling, the mode cube is padded symmetrically before the geometric transformation.
- OOPAO.InfluenceFunctions.compute_RAMA_DM97_influence_functions(name_system, diameter, resolution, loc=None, mis_registration=None, flip_lr=False, flip_ud=False, specific_parameters=None)¶
Load the measured RAMA DM97 cube (
IF_97.npy), crop and re-center it, and resample it to the requested resolution throughinterpolate_cube().
- OOPAO.InfluenceFunctions.compute_EKARUS_DM468_influence_functions(name_system, diameter, resolution, loc=None, mis_registration=None, flip_lr=False, flip_ud=False, specific_parameters=None)¶
Load the EKARUS DM468 zonal cube (
IF_zonal_cube.npy) and resample it to the requested resolution throughinterpolate_cube().
- OOPAO.InfluenceFunctions.compute_GHOST_DM492_influence_functions(name_system, diameter, resolution, loc=None, mis_registration=None, flip_lr=False, flip_ud=False, specific_parameters=None)¶
Build the GHOST DM492 influence functions from the measured actuator coordinates (
dm_coord.mat) using the standard OOPAODeformableMirrorGaussian model (mechanical coupling 0.15).
- OOPAO.InfluenceFunctions.compute_PAPYRUS_DM241_influence_functions(name_system, diameter, resolution, loc=None, mis_registration=None, flip_lr=False, flip_ud=False, specific_parameters=None)¶
Build the PAPYRUS DM241 influence functions from a cartesian 17x17 actuator grid projected onto the T152 pupil, using the standard OOPAO
DeformableMirrorGaussian model (mechanical coupling 0.36). Requires no external data.
Adding a new system¶
Three steps are required:
Write a
compute_<NAME>_influence_functions(...)function inuser_defined_influence_functions_.pyfollowing the common signature above and returning a[n_act, resolution, resolution]cube.Add one entry to the dispatch dictionary in
InfluenceFunctions._get_compute_function.Add one row to the Supported systems table of this page.