Parameter Generator

Generate a parameter set for ShaneAO and store it as a set of FITS files

param_gen.gen_CM_16x(use_penalty=True, method=1, weighting=None)

Generate the 16x control matrix using the algorithm described in RTC_WindPCMeeting_PresentationV2.pdf This uses the matrices At, Aw, Mt, Mw, and Cwt (computed with sauce.py), H (computed with calibrate.py), and the regularization matrices Q and P (Q is the covariance of the measurement noise, P is the a-priori covariance of the modal coefficients) These should be stored as fits files A.fits etc, in the parameterFiles directory

param_gen.gen_CM_8x(use_penalty=True, method=1)

Generate the 8x control matrix. This creates a dummy, all zero, matrix for now.

param_gen.gen_dark()

Generate the WFS Background using previously collected dark data

param_gen.gen_flat()

Generate the WFS Flat For now we assume the flat is uniform, so it is set to all ones

param_gen.gen_ref_cents(mode)

Generate a default reference centroid array

param_gen.gen_tt_params()

This generates the tip/tilt camera specific parameters: * tt_dark.fits * tt_flat.fits * tt_centWts

param_gen.gen_weights()

Generate the centroider weights Center of Gravity, Quad cell, and Binned Quad cell

param_gen.illums(mode, secondary=True)

Define the illuminated subapertures for each mode

param_gen.map25(mode, secondary=True)

Produce a list of 1-dimensional indices into the camera image that identify pixels within subaps. The result can be viewed as a ns x 5 x 5 array, where ns is the number of 5 x 5 pixel subaps.

param_gen.penalty(At, H, W=None)

Define the penalty matrix, S, for the modal based reconstructor. S = A^T sum_k{a_bar_k w_k a_bar_k} A where A maps mode coefficients to actuator vectors (modes in terms of actuators are the columns of A), a_bar_k are column vectors of ‘bad’ actuator patterns, and w_k is the penalty weight of the k’th bad patterns. S can also be expressed S = A^T A_bar W A_bar^T A where A_bar is the matrix formed by stacking the a_bar_k as columns and W is diag(w_k), a diagonal matrix with w_k on the diagnoal.

Bad actuator patterns include:

  • any actuator outside the aperture
  • piston on the aperture
  • any 2x2 waffle pattern
  • derivatives (first differences) across the pupil boundary or outside the pupil

Inputs: At is the matrix mapping mode coefficients to actuator vectors. H is the matrix mapping mode coefficients to Hartmann sensor slope vectors.

Returns (S,Abar,H_d,R,U,s) where S is the penalty matrix, Abar is the set of bad patterns, H_d is the mode coefficient reconstruction matrix: H_d = (H^T H + S)^-1 * H^T R is the actuator reconstruction matrix: R = At * H_d U is the set of singular modes of the actuator reconstruction matrix s is the set of singular values of the actuator reconstruction matrix