Ejemplo n.º 1
0
def test_translation_annulus():
    res = 6
    inputs = {"pixresFPM": res,
              "rhoInner": 3,
              "rhoOuter": 10,
              }
    fpm = gen_annular_fpm(inputs)

    inputs.update({"xOffset": 5.5, "yOffset": -10})
    fpmOffset = gen_annular_fpm(inputs)

    fpmRecentered = np.roll(fpmOffset,
                            [int(-res*inputs["yOffset"]),
                             int(-res*inputs["xOffset"])],
                            axis=(0, 1))
    fpmPad = pad_crop(fpm, fpmRecentered.shape)
    assert np.allclose(fpmPad, fpmRecentered, atol=1e-7)
Ejemplo n.º 2
0
def test_area_spot():
    inputs = {"pixresFPM": 6,
              "rhoInner": 3,
              "rhoOuter": np.Inf,
              }
    fpm = gen_annular_fpm(inputs)

    area = np.sum(1 - fpm)
    areaExpected = np.pi * inputs["rhoInner"]**2 * inputs["pixresFPM"]**2
    assert isclose(area, areaExpected, rel_tol=1e-3)
Ejemplo n.º 3
0
def test_area_annulus():
    inputs = {"pixresFPM": 6,
              "rhoInner": 3,
              "rhoOuter": 10,
              }
    fpm = gen_annular_fpm(inputs)

    area = np.sum(fpm)
    areaExpected = (np.pi * inputs["pixresFPM"]**2 *
                    (inputs["rhoOuter"]**2 - inputs["rhoInner"]**2))
    assert isclose(area, areaExpected, rel_tol=1e-3)
Ejemplo n.º 4
0
def test_area_partially_transmissive_spot():
    inputs = {"pixresFPM": 6,
              "rhoInner": 3,
              "rhoOuter": np.Inf,
              "FPMampFac": 0.2,
              }
    fpm = gen_annular_fpm(inputs)

    area = np.sum(1 - fpm)
    areaExpected = (np.pi * inputs["rhoInner"]**2 * inputs["pixresFPM"]**2 *
                    (1-inputs["FPMampFac"]))
    assert isclose(area, areaExpected, rel_tol=1e-3)