aoinf

Top  Previous  Next

Using data generated by aogeom (or a user-supplied equivalent), aoinf computes the DM's OPD and slope influence function matrices. aoinf is a utility that can be accessed either from Matlab or from the operating system console window.  Most users will access aoinf from Matlab.  

aoinf generates a .mat file that saves the results of aoinf 's calculations; the same output file alsoresaves all the geometry data read in from the aogeom output file.

From the operating system console window the calling syntax for aoinf is:

C> aoinf infilespec outfilespec nxopd dxopd

From Matlab the calling syntax is:

>> aoinf(infilespec, outfilespec, nxopd, dxopd);

where

infilespec   =  name of .mat input file from which the AO geometry specifications are to be read.  Usually, but not necessarily, this file is created by aogeom.  The filename specification must include the .mat suffix.

outfilespec   =  name of .mat file to which the resulting combined influence functions and AO geometry are to be written.  This file can later be loaded into Matlab for computation of the reconstructor using aorecon, or specified as a constructor argument to TasatDMModel.  The filename specification must include the .mat suffix.

nxopd   =  number of points across the square mesh superimposed on the DM for the purpose of resolving surface deflections on the OPD mesh.  This number, together with dxopd, must span the entire mirror (but not the entire propagation mesh).  The OPD mesh is a "gwoom" type (see the LightLike User Guide discussion of coordinate systems and meshes).  The origin lies at the nxopd/2 + 1 point (counting from 1).  Hence, the mesh is not quite symmetric, and one must be careful to usenxopd and dxopd combinations which covers the entire physical region of interest.

dxopd   =  physical spacing (in m) between mesh points of the square mesh superimposed on the DM for the purpose of resolving surface deflections on the OPD mesh.  This parameter needs to be small enough to properly model the shape of the mirror and ought to be smaller than the spacing between actuators.  It is usually sufficient to use six to twelve points per actuator spacing. CAUTION:  the actuator spacing MUST BE an integer multiple of dxopd  (it is suggested that dxopd be input in the format [dxact]/N ).

Notice that aoinf has no output arguments:  all outputs are saved to outfilespec.

Key results computed by aoinf are saved under the following names:

opdif = DM OPD influence function matrix: maps actuator displacements in meters

            to DM surface displacements in meters.  The surface displacements may be

            defined on a substantially denser mesh than the actuators.

dtos and mvtos = two closely-related slope influence function matrices, where:

  dtos = slope influence matrix that maps all actuator displacements to all slopes

                (mapping meters to tilt angle in radians of angle).

  mvtos = slope influence matrix that maps master actuator volts to all slopes.

                   Usually we treat volts as equal to displacements, so that mvtos maps

                   meters to tilt angle in radians of angle.

                   For a review of the use of masters and slaves, and volts and displacements,

                   see the background section on influence functions.  An important point to bear

                   in mind is that mvtos is the matrix that should be pseudo-inverted by aorecon.

By loading outfilespec into the Matlab workspace, the user can inspect and work with the above-mentioned influence matrices.  The names and formats of all the saved variables are summarized in the section .mat Interface File Contents.  Remember that, in addition to the influence matrices,outfilespec will also contain all the preceding data saved by aogeom.  This redundancy is convenient, and uses little extra storage, since the aogeom data is small compared to the influence matrices.

CAUTION:  Two execution errors that users may encounter with aoinf are due to:

(a)  the specified dxopd does not divide the actuator spacing an integral number of times;

(b)  the nxopd, dxopd combination does not entirely cover the mesh of actuators.

Recommended ways of avoiding these error conditions are:

(a)  Specify dxopd as an integer divisor of the actuator spacing (i.e., dxopd = dxact/N, where dxact is the actuator spacing and N is an integer)

(b)  Carry out a preliminary setup check, using the Matlab utility function opdc to generate OPD coordinates, and construct a composite plot with the xact, yact, xsub, and ysub coordinates that are supplied by the aogeom output file.

Starting with a sample file generated by aogeom, the following Matlab example illustrates the use of the recommended setup check procedure:

>> load small45g    % Load a .mat file previously created with aogeom.

>> dxact=max([xact(2)-xact(1),yact(2)-yact(1)]);    % This determines the actuator spacing.

>> dxopd=dxact/5;    % dxopd is an integral divisor of dxact.

>> nxopd=32;

>> xopd=opdc(nxopd,dxopd); % Generate a coordinate vector.

>> [x,y]=meshgrid(xopd,xopd);    % Generate a coordinate mesh.

>> plot(x(:),y(:),'.')    % Plot the mesh with blue dots.

>> axis square    % Make the plot area square.

>> hold on;plot(xact(:),yact(:),'r+')    % Plot the actuators with red plusses.

>> hold on;plot(xsub(:),ysub(:),'ks')    % Plot the subaperture centers with black squares.

>> hold off;

In this case the following plot is generated:

aoinfcoords

What we are looking for is to ensure the actuators (+) lie on the OPD mesh points (blue dots).  Also we want to make sure that the blue dots cover the entire region covered by the actuators.  The locations of the center of the subapertures, but not the sizes, are indicated by the black squares.  From this plot we expect that nxopd and dxopd ought to be valid inputs to aoinf.

The following sequence illustrates a successful execution of aoinf, using the above input parameters:

>> dxact=max([xact(2)-xact(1),yact(2)-yact(1)]);    % This determines the actuator spacing.

>> dxopd=dxact/5;    % dxopd is an integral divisor of dxact.

>> nxopd=32;

>> aoinf('small45g.mat','small45gi.mat',nxopd,dxopd) % Run aoinf

Warning: the variable balmodel was not found in file small45g.mat

    (% This warning message should be ignored).

aoinf: Reading DM specification from: [small45g.mat].

aoinf: Writing DM matrices to: [small45gi.mat].

aoinf: Using a mesh with 32 points and 0.030000 spacing.

aoinf: Completed successfully.

The following sequence illustrates an unsuccessful execution of aoinf, due to poor specification ofnxopd (not enough points to cover the entire mesh of actuators):

>> dxact=max([xact(2)-xact(1),yact(2)-yact(1)]);    % This determines the actuator spacing.

>> dxopd=dxact/5;    % dxopd is an integral divisor of dxact.

>> nxopd=30; % This is not large enough to cover all the actuators.

>> aoinf('small45g.mat','small45gibad.mat',nxopd,dxopd)

Warning: the variable balmodel was not found in file small45g.mat

aoinf: Reading DM specification from: [small45g.mat].

aoinf: Writing DM matrices to: [small45gibad.mat].

aoinf: Using a mesh with 30 points and 0.030000 spacing.

aoinf: Error reading or generating DM.

aoinf: Aborted with error number -896.

CAUTION: aoinf can bog down when the user has specified a problem that requires too much CPU and/or memory.  In this case, aoinf takes what seems to be forever to complete.  The aoinfcomputation can be rather time-consuming, but should probably not take more than fifteen minutes or so.  If the processing does continue longer, the user should probably rethink the actuator influence reach and/or the OPD mesh spacing.  The OPD influence function is nominally dimensioned nact xnxopd2, which can of course be very large.  (Note that nxopd2 = nopd  as defined in the background section on OPD influence functions.)  To ameliorate the size problem, aoinf stores the influence function in a sparse form, which takes advantage of the fact that any given actuator affects only a small subset of the OPD points (the vast majority of matrix elements are 0).  This allows reasonable sized OPD influence function matrices to be created.  If the number of OPD points affected by a given actuator is large, the computation will take a long time and the resulting file will be large.