示例#1
0
def test_Piezo_valid_actuators():
    """
    Tests that when you set the "valid actuators", the DM doesn't use actuators marked 'invalid'
    """

    config = confParse.loadSoapyConfig(os.path.join(CONFIG_PATH, "sh_8x8.yaml"))

    mask = aotools.circle(config.sim.pupilSize / 2., config.sim.simSize)

    wfs = WFS.ShackHartmann(config, mask=mask)
    dm = DM.FastPiezo(config, n_dm=1, wfss=[wfs], mask=mask)

    act_coord1 = dm.valid_act_coords[0]
    act_coord_last = dm.valid_act_coords[-1]
    act_coord2 = dm.valid_act_coords[1]

    valid_actuators = numpy.ones(dm.n_acts, dtype=int)
    valid_actuators[0] = valid_actuators[-1] = 0

    dm.valid_actuators = valid_actuators

    assert dm.n_valid_actuators == (dm.n_acts - 2)
    assert not numpy.array_equal(dm.valid_act_coords[0], act_coord1)
    assert not numpy.array_equal(dm.valid_act_coords[-1], act_coord_last)
    assert numpy.array_equal(dm.valid_act_coords[0], act_coord2)
示例#2
0
def testf_initFastPiezo():

    config = confParse.loadSoapyConfig(os.path.join(CONFIG_PATH, "sh_8x8.yaml"))

    mask = aotools.circle(config.sim.pupilSize/2., config.sim.simSize)

    wfs = WFS.ShackHartmann(config, mask=mask)
    dm = DM.FastPiezo(config, n_dm=1, wfss=[wfs], mask=mask)
示例#3
0
    def testf_initFastPiezo(self):

        config = confParse.Configurator(os.path.join(CONFIG_PATH, "sh_8x8.py"))
        config.loadSimParams()

        mask = aoSimLib.circle(config.sim.pupilSize / 2., config.sim.simSize)

        wfs = WFS.ShackHartmann(config, mask=mask)
        dm = DM.FastPiezo(config, wfss=[wfs], mask=mask)