Example #1
0
    def test_false_positive_optimize(self) -> None:

        module = FalsePositiveModule(position=(10., 2.),
                                     aperture=0.06,
                                     ignore=True,
                                     name_in='false2',
                                     image_in_tag='res_mean',
                                     snr_out_tag='snr_fpf2',
                                     optimize=True,
                                     offset=0.1,
                                     tolerance=0.01)

        self.pipeline.add_module(module)
        self.pipeline.run_module('false2')

        data = self.pipeline.get_data('snr_fpf2')
        assert data[0, 1] == pytest.approx(2.0681640624999993,
                                           rel=self.limit,
                                           abs=0.)
        assert data[0, 2] == pytest.approx(0.21416845852767494,
                                           rel=self.limit,
                                           abs=0.)
        assert data[0, 3] == pytest.approx(179.47800221910444,
                                           rel=self.limit,
                                           abs=0.)
        assert data[0, 4] == pytest.approx(24.254455766076823,
                                           rel=self.limit,
                                           abs=0.)
        assert data[0, 5] == pytest.approx(2.5776271254831863e-08,
                                           rel=self.limit,
                                           abs=0.)
        assert data.shape == (1, 6)
Example #2
0
    def test_false_positive_optimize(self) -> None:

        module = FalsePositiveModule(position=(31., 49.),
                                     aperture=0.1,
                                     ignore=True,
                                     name_in='false2',
                                     image_in_tag='res_mean',
                                     snr_out_tag='snr_fpf2',
                                     optimize=True,
                                     offset=0.1,
                                     tolerance=0.01)

        self.pipeline.add_module(module)
        self.pipeline.run_module('false2')

        data = self.pipeline.get_data('snr_fpf2')
        assert np.allclose(data[0, 0], 30.90615234375, rtol=limit, atol=0.)
        assert np.allclose(data[0, 1], 49.0861328125, rtol=limit, atol=0.)
        assert np.allclose(data[0, 2], 0.5161240306986961, rtol=limit, atol=0.)
        assert np.allclose(data[0, 3], 92.74019185433872, rtol=limit, atol=0.)
        assert np.allclose(data[0, 4], 7.831022605121996, rtol=limit, atol=0.)
        assert np.allclose(data[0, 5],
                           2.3375921055608217e-06,
                           rtol=limit,
                           atol=0.)
Example #3
0
    def test_false_positive(self):

        module = FalsePositiveModule(position=(31., 49.),
                                     aperture=0.1,
                                     ignore=True,
                                     name_in='false',
                                     image_in_tag='res_mean',
                                     snr_out_tag='snr_fpf')

        self.pipeline.add_module(module)
        self.pipeline.run_module('false')

        data = self.pipeline.get_data('snr_fpf')
        assert np.allclose(data[0, 0], 31.0, rtol=limit, atol=0.)
        assert np.allclose(data[0, 1], 49.0, rtol=limit, atol=0.)
        assert np.allclose(data[0, 2], 0.513710034941892, rtol=limit, atol=0.)
        assert np.allclose(data[0, 3], 93.01278750418334, rtol=limit, atol=0.)
        assert np.allclose(data[0, 4], 7.333740467578795, rtol=limit, atol=0.)
        assert np.allclose(data[0, 5], 4.5257622875993775e-06, rtol=limit, atol=0.)
Example #4
0
    def test_false_positive(self):

        false = FalsePositiveModule(position=(31., 49.),
                                    aperture=0.1,
                                    ignore=True,
                                    name_in="false",
                                    image_in_tag="res_mean",
                                    snr_out_tag="snr_fpf")

        self.pipeline.add_module(false)
        self.pipeline.run_module("false")

        data = self.pipeline.get_data("snr_fpf")
        assert np.allclose(data[0, 0], 31.0, rtol=limit, atol=0.)
        assert np.allclose(data[0, 1], 49.0, rtol=limit, atol=0.)
        assert np.allclose(data[0, 2], 0.513710034941892, rtol=limit, atol=0.)
        assert np.allclose(data[0, 3], 93.01278750418334, rtol=limit, atol=0.)
        assert np.allclose(data[0, 4], 7.633199090133858, rtol=limit, atol=0.)
        assert np.allclose(data[0, 5], 3.029521252528866e-06, rtol=limit, atol=0.)
Example #5
0
    def test_false_positive(self):

        false = FalsePositiveModule(position=(31., 49.),
                                    aperture=0.1,
                                    ignore=True,
                                    name_in="false",
                                    image_in_tag="res_mean",
                                    snr_out_tag="snr_fpf")

        self.pipeline.add_module(false)
        self.pipeline.run_module("false")

        data = self.pipeline.get_data("snr_fpf")
        assert np.allclose(data[0, 2], 0.5280553948214145, rtol=limit, atol=0.)
        assert np.allclose(data[0, 3], 94.39870535499551, rtol=limit, atol=0.)
        assert np.allclose(data[0, 4], 8.542166952478182, rtol=limit, atol=0.)
        assert np.allclose(data[0, 5],
                           9.54772666372783e-07,
                           rtol=limit,
                           atol=0.)
Example #6
0
    def test_false_positive(self) -> None:

        module = FalsePositiveModule(position=(10., 2.),
                                     aperture=0.06,
                                     ignore=True,
                                     name_in='false1',
                                     image_in_tag='res_mean',
                                     snr_out_tag='snr_fpf1',
                                     optimize=False)

        self.pipeline.add_module(module)
        self.pipeline.run_module('false1')

        data = self.pipeline.get_data('snr_fpf1')
        assert data[0, 1] == pytest.approx(2., rel=self.limit, abs=0.)
        assert data[0, 2] == pytest.approx(0.216, rel=self.limit, abs=0.)
        assert data[0, 3] == pytest.approx(180., rel=self.limit, abs=0.)
        assert data[0, 4] == pytest.approx(23.555448981008507,
                                           rel=self.limit,
                                           abs=0.)
        assert data[0, 5] == pytest.approx(3.1561982060476726e-08,
                                           rel=self.limit,
                                           abs=0.)
        assert data.shape == (1, 6)