MAOS
Multithreaded Adaptive Optics Simulator
slaving.h File Reference

Functions

dcellgenactcpl (const dspcell *HA, const dmat *W1)
 
dspcellslaving (loccell *aloc, const dcell *actcpl, const lcell *actstuck, const lcell *actfloat, real thres, real scale, int mode)
 
void act_stuck (loccell *aloc, anyarray HA, const lcell *stuck)
 
void act_zero (loccell *aloc, const dcell *HB, const lcell *dead)
 
void act_float (loccell *aloc, dspcell **HA, const dcell *HB, const lcell *actfloat)
 
void act_stuck_cmd (loccell *aloc, const dcell *adm, const lcell *stuck)
 
dspcellact_float_interp (loccell *aloc, const lcell *actfloat)
 
dspact_extrap_each (loc_t *aloc, const dmat *actcpl, real scl)
 
dspcellact_extrap (loccell *aloc, const dcell *actcpl, real scl, int lor)
 

Detailed Description

Routines to compute interpolation matrices for stuck and floating actuators.

Function Documentation

◆ genactcpl()

dcell* genactcpl ( const dspcell HA,
const dmat W1 
)

Compute the actuator coupling coefficient to be used to identify non-coupled actuators. W1 is optional weighting function. The max value is 1.

◆ slaving()

dspcell* slaving ( loccell aloc,
const dcell actcplc,
const lcell actstuck,
const lcell actfloat,
const real  thres,
const real  sclsq,
const int  mode 
)

Compute slaving actuator regularization term.

Inactive actuators (coupling coefficiency below the threshold) are slaved to neighbors that are active.

The result is S=H'H; Let b=H*a, we have if mode==1: b(isa)=alpha(a(isa)-sum(a(jsa).*weight(jsa))), where isa is inactive and jsa are neighoring active actuators. if mode==2: b(igroup)=alpha*sum(a(jsa)), where jsa are fully active actuators belonging to igroup if mode==3: b(isa)=alpha*sum(a(jsa)-a(ksa)), where isa is inactive, and jsa and ksa are neighrboring and opposite active actuator

Parameters
[in]alocThe actuator grid
[in]actcplcActuator coupling coefficiency
[in]actstuckmask for stuck actuators that will not be slaved, but have value constrained.
[in]actfloatmask for float actuators that will be slaved, but not have value constrained.
[in]thresThe threshold that an actuator is deemed slave
[in]sclsqExpected norm of the slaving matrix.
[in]modeMode of operation. (1 or 2)

◆ act_stuck()

void act_stuck ( loccell aloc,
anyarray  HA_,
const lcell stuck 
)

When some actuators are stuck, zero the corresponding column in HA

◆ act_zero()

void act_zero ( loccell aloc,
const dcell HB,
const lcell dead 
)

Zero out rows of dead actuators in mode vector.

◆ act_float()

void act_float ( loccell aloc,
dspcell **  HA,
const dcell HB,
const lcell actfloat 
)

When some actuators are float, remove the corresponding column in HA and/or HB, and add to neighboring actuators. This is implemented using a second matrix and then add to the original matrix.

Parameters
aloccoordinate of actuators
HAsparse matrix to modify
HBdense matrix to modify
actfloatfloating actuator mask

◆ act_stuck_cmd()

void act_stuck_cmd ( loccell aloc,
const dcell adm,
const lcell stuck 
)

Make DM actuator commands zero at stuck actuator locations.

Parameters
[in]alocActuator grid array
[in,out]admActuator command to process
[in]stuckList of stuck actuators

◆ act_float_interp()

dspcell* act_float_interp ( loccell aloc,
const lcell actfloat 
)

Create an interpreter that make floating actuators equal to their neighbors.

Parameters
[in]alocActuator grid array
[in]actfloatList of floating actuators

◆ act_extrap_each()

dsp* act_extrap_each ( loc_t aloc,
const dmat actcplc,
const real  thres 
)

Create an extrapolator that does the following

  1. Reduce the information to active actuators
  2. Project low order modes out from the active actuators
  3. Project back to full vector
  4. Extrapolate to inactive actuators
  5. Add back low order modes to the full vector extrap = H_extrap*H_reduce*(I-M*M^+)+M*M^

◆ act_extrap()

dspcell* act_extrap ( loccell aloc,
const dcell actcplc,
real  thres,
int  lor 
)

Create an extrapolator that make inactive actuators equal avearage of active neighbors if exist or all other neighbors.

Parameters
[in]alocActuator grid array
[in]actcplcActuator coupling coefficiency
[in]thresThreshold of coupling to turn on interpolation
[in]lorLow order mode removal before extrapolation