Exemplo n.º 1
0

"""Unit test for the irf.mrf module.
"""

import unittest
import os
import numpy

from ximpol.core.spline import xInterpolatedUnivariateSplineLinear
from ximpol.detector.xipe import _full_path
from ximpol.irf import load_mrf


IRF_NAME = 'xipe_baseline'
GPD_MODF_FILE_PATH = _full_path('modfact_hedme8020_1atm_1cm_mng.asc')


class TestXipeMrf(unittest.TestCase):

    """Unit test for the Xipe modulation factor.
    """

    def test_xipe_mrf(self):
        """Test the XIPE modulation factor.

        This loads the modulation factor from the XIPE .mrf FITS file,
        then the corresponding values from the text file that the response
        functions are created from and makes sure that the two are close
        enough.
        """
Exemplo n.º 2
0

"""Unit test for the irf.arf module.
"""

import unittest
import os
import numpy

from ximpol.core.spline import xInterpolatedUnivariateSplineLinear
from ximpol.detector.xipe import _full_path
from ximpol.irf import load_arf


IRF_NAME = 'xipe_baseline'
OPT_AEFF_FILE_PATH = _full_path('Area_XIPE_201602b_x3.asc')
GPD_QEFF_FILE_PATH = _full_path('eff_hedme8020_1atm_1cm_cuts80p_be50um_p_x.asc')


class TestXipeArf(unittest.TestCase):

    """Unit test for the XIPE effective area.
    """

    def test_xipe_arf(self):
        """Test the XIPE effective area.

        This is loading the effective area from the .arf FITS file, then
        loading the data points from the text files the response function
        is created from, and finally testing that the actual values from the
        two methods are close enough over the entire energy range.
Exemplo n.º 3
0

"""Unit test for the irf.rmf module.
"""

import unittest
import os
import numpy

from ximpol.core.spline import xInterpolatedUnivariateSplineLinear
from ximpol.detector.xipe import _full_path
from ximpol.irf import load_rmf


IRF_NAME = 'xipe_baseline'
GPD_ERES_FILE_PATH = _full_path('eres_fwhm_hedme8020_1atm_1cm.asc')


class TestXipeRmf(unittest.TestCase):

    """Unit test for the XIPE energy dispersion.
    """

    @classmethod
    def setUpClass(self):
        """Setup.

        Create a few objects to be used for testing.
        """
        self.edisp = load_rmf(IRF_NAME)
import numpy
import unittest
import sys

from ximpol import XIMPOL_IRF
from ximpol.irf.mrf import xModulationFactor
from ximpol.irf.mrf import xAzimuthalResponseGenerator
from ximpol.core.spline import xInterpolatedUnivariateSplineLinear
from ximpol.utils.matplotlib_ import pyplot as plt
from ximpol.utils.matplotlib_ import overlay_tag, save_current_figure
from ximpol.detector.xipe import _full_path
from ximpol.irf import load_mrf


IRF_NAME = 'xipe_baseline'
GPD_MODF_FILE_PATH = _full_path('modfact_hedme8020_1atm_1cm_mng.asc')


"""We explictely set the random seed to have reproducible results.
"""
numpy.random.seed(0)


class TestModulationFactor(unittest.TestCase):

    """Unit test for xModulationFactor.
    """

    @classmethod
    def setUpClass(self):
        """Setup---here we essentially create the modulation factor.
Exemplo n.º 5
0
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
"""Unit test for the irf.rmf module.
"""

import unittest
import os
import numpy

from ximpol.core.spline import xInterpolatedUnivariateSplineLinear
from ximpol.detector.xipe import _full_path
from ximpol.irf import load_rmf

IRF_NAME = 'xipe_baseline'
GPD_ERES_FILE_PATH = _full_path('eres_fwhm_hedme8020_1atm_1cm.asc')


class TestXipeRmf(unittest.TestCase):
    """Unit test for the XIPE energy dispersion.
    """
    @classmethod
    def setUpClass(cls):
        """Setup.

        Create a few objects to be used for testing.
        """
        cls.edisp = load_rmf(IRF_NAME)

    def test_xipe_rmf_matrix_norm(self):
        """Test the XIPE energy dispersion normalization.