Example #1
0
    def test_unequal_range(self):
        """Making sure that a ValueError is thrown for unequal ranges"""

        x = np.arange(64)
        y = np.arange(64)

        xx, yy = np.meshgrid(x, y)

        coefs_full = [12, 20, 70, 20, 30, 0.5, 2]

        with pytest.raises(RuntimeError):
            Gauss2D.gauss2D((self.xx, yy), *coefs_full)

        with pytest.raises(RuntimeError):
            Gauss2D.gauss2D((xx, self.yy), *coefs_full)
Example #2
0
    def test_gauss2D_norot(self):
        """Testing if the no rotation case is a sub case of the full one"""

        coefs_full = [12, 20, 70, 20, 30, 0, 2]
        full_data = Gauss2D.gauss2D((self.xx, self.yy), *coefs_full)

        coefs_norot = coefs_full[:5] + [coefs_full[-1]]
        norot_data = Gauss2D.gauss2D_norot((self.xx, self.yy), *coefs_norot)

        assert np.all(norot_data == full_data)
Example #3
0
    def test_gauss2D_norot(self):
        """Testing if the no rotation case is a sub case of the full one"""

        coefs_full = [12, 20, 70, 20, 30, 0, 2]
        full_data = Gauss2D.gauss2D((self.xx, self.yy), *coefs_full)

        coefs_norot = coefs_full[:5] + [coefs_full[-1]]
        norot_data = Gauss2D.gauss2D_norot((self.xx, self.yy), *coefs_norot)

        assert np.all(norot_data == full_data)
Example #4
0
    def test_gauss2D_sym(self):
        """Testing if the symmetrical case is a sub case of the full one"""

        coefs_full = [12, 20, 70, 20, 20, 0, 2]
        full_data = Gauss2D.gauss2D((self.xx, self.yy), *coefs_full)

        coefs_sym = coefs_full[:4] + [coefs_full[-1]]
        sym_data = Gauss2D.gauss2D_sym((self.xx, self.yy), *coefs_sym)

        assert np.all(sym_data == full_data)
Example #5
0
    def test_gauss2D_sym(self):
        """Testing if the symmetrical case is a sub case of the full one"""

        coefs_full = [12, 20, 70, 20, 20, 0, 2]
        full_data = Gauss2D.gauss2D((self.xx, self.yy), *coefs_full)

        coefs_sym = coefs_full[:4] + [coefs_full[-1]]
        sym_data = Gauss2D.gauss2D_sym((self.xx, self.yy), *coefs_sym)

        assert np.all(sym_data == full_data)