pyTomoAO.slope_conversion.slope_conversion_matrix¶
- pyTomoAO.slope_conversion.slope_conversion_matrix(validLLMap, nWFS, D, subapOrder='F', slopesOrder='simu', slopeScale=1.0, xSign=1.0, ySign=1.0)[source]¶
Sparse matrix taking external slopes to pyTomoAO’s gradient-operator convention.
P @ sreturns, for an input slope vectorscoveringnWFSsensors (sensor blocks concatenated in pyTomoAO’s LGS order), the slopes in the order of the tomographic gradient operator and in units ofd * angle[m], ready forRecStatSA.- Parameters:
validLLMap (
array_likeofbool) – Valid-subaperture map,(nLenslet, nLenslet), the same for every sensor.nWFS (
int) – Number of sensors in the slope vector.D (
float) – Telescope diameter [m]; the subaperture size isd = D / nLenslet.subapOrder (
{"F", "C"}, optional) – Enumeration of the valid subapertures in the input:"F"column-major (pyTomoAO’s own),"C"row-major (e.g. SPECULA). Default"F".slopesOrder (
{"simu", "inverted", "keck"}, optional) – Layout of each sensor’s block in the input:"simu"all X then all Y,"inverted"all Y then all X,"keck"interleaved[x0, y0, x1, y1, ...]. Default"simu".slopeScale (
float, optional) – Factor converting the input slopes to angles of arrival in radians (e.g.specula_slope_scale()). Default 1 (input already in radians).xSign (
float, optional) – Sign (or extra factor) applied to the X and Y slopes, for inputs whose axes point the other way. Default +1.ySign (
float, optional) – Sign (or extra factor) applied to the X and Y slopes, for inputs whose axes point the other way. Default +1.
- Returns:
scipy.sparse.csr_matrix–(nWFS * 2 * nValid, nWFS * 2 * nValid), one non-zero per row.
Notes
pyTomoAO’s X slope is the derivative along the columns of
validLLMapand Y along its rows. An input whose X runs along the rows corresponds toslopesOrder="inverted"(with the same subaperture enumeration), not to a sign change.Examples
SPECULA
IdealDerivativeSensoror Shack-Hartmann slopes of six LGS, concatenated in the order of the asterism:>>> P = slope_conversion_matrix( ... validLLMap, 6, 10.0, subapOrder="C", slopeScale=specula_slope_scale(4.0, 8) ... ) >>> opd = rec.RecStatSA @ (P @ slopes) # OPD [m] on rec.gridMask