Пример #1
0
    nAxes = int(covMaps.shape[1] / covMapDim)
    map_roi = numpy.zeros(((1 + (2 * envelope)) * selector.shape[0],
                           (nxSubaps + belowGround) * nAxes))

    for j in range(nAxes):
        for i in range(selector.shape[0]):
            spec_GsPos = numpy.array(
                (gs_pos[selector[i, 0]], gs_pos[selector[i, 1]]))
            vector, vectorMap, theta = gamma_vector(blankCovMap, 'False',
                                                    spec_GsPos, belowGround,
                                                    envelope, False)
            for k in range(vector.shape[0]):
                for l in range(vector.shape[1]):
                    map_roi[i * (1 + (2 * envelope)) + k,
                            j * (nxSubaps + belowGround) +
                            l] = covMaps[vector[k, l, 0] + (i * covMapDim),
                                         vector[k, l, 1] + (j * covMapDim)]

    return map_roi


if __name__ == '__main__':
    maps = numpy.ones((39, 26))
    gs_pos = numpy.array(([0, 0], [0, -1], [1, 0]))
    pupil_mask = circle(7. / 2, 7)
    pupil_mask[3, 3] = 0
    envelope = 0
    selector = numpy.array((range(gs_pos.shape[0])))
    selector = numpy.array((list(itertools.combinations(selector, 2))))

    m = roi_from_map(maps, gs_pos, pupil_mask, selector, 0, 0)
Пример #2
0
    # pyplot.figure('Generated Matrix')
    # pyplot.imshow(covMaps)
    # pyplot.figure('Map Vector')
    # pyplot.imshow(vectorMap)

    # print '\n', 'Time to Calculate Slope Slice:', slopeFinish-slopeStart, '\n'
    # pyplot.figure('Map Slice from Slopes')
    # pyplot.imshow(slopeSlice)

    # print '\n', 'Time to Generate Slice:', sliceFinish-sliceStart, '\n'
    # pyplot.figure('Generated Map Slice')
    # pyplot.imshow(mapSlice)

    nwfs = 3
    nxSubaps = 7
    pupilMask = circle(nxSubaps / 2., nxSubaps)
    pupilMask[3, 3] = 0
    nSubaps = numpy.int(pupilMask.sum())
    covMapDim = (2 * nxSubaps) - 1
    telDiam = 4.2
    gsAlt = numpy.array([0] * nwfs)
    gsPos = numpy.array([[0., -20.], [0., 20], [0,
                                                10]])  #, [50,50], [-5, -5]])
    wfsWavelength = numpy.array([500e-9] * nwfs)

    nLayers = 2
    layerAlt = numpy.array([0., 10000])
    r0 = numpy.array([0.1, 0.3])
    L0 = numpy.array([25] * nLayers)

    subapDiam = telDiam / nxSubaps