def setUp(self):
        unittest.TestCase.setUp(self)

        det1 = _DelimitedDetector((radians(10), radians(20)), (radians(0), radians(360)))
        det2 = _DelimitedDetector((radians(20), radians(30)), (radians(0), radians(360)))
        det3 = _DelimitedDetector((radians(30), radians(40)), (radians(0), radians(360)))
        det4 = _DelimitedDetector((radians(10), radians(20)), (radians(0), radians(360)))
        det5 = _DelimitedDetector((radians(10), radians(20)), (radians(90), radians(270)))

        self.detectors = {'det1': det1, 'det2': det2, 'det3': det3,
                          'det4': det4, 'det5': det5}
    def setUp(self):
        unittest.TestCase.setUp(self)

        self.h = _DelimitedDetectorXMLHandler()

        self.obj = _DelimitedDetector((radians(35), radians(45)), (0, radians(360.0)))

        etree.register_namespace("mc", "http://pymontecarlo.sf.net")
        source = BytesIO(
            b'<mc:_delimitedDetector xmlns:mc="http://pymontecarlo.sf.net"><elevation lower="0.6108652381980153" upper="0.7853981633974483" /><azimuth lower="0.0" upper="6.283185307179586" /></mc:_delimitedDetector>'
        )
        self.element = etree.parse(source).getroot()
Beispiel #3
0
    def setUp(self):
        unittest.TestCase.setUp(self)

        det1 = _DelimitedDetector((radians(10), radians(20)),
                                  (radians(0), radians(360)))
        det2 = _DelimitedDetector((radians(20), radians(30)),
                                  (radians(0), radians(360)))
        det3 = _DelimitedDetector((radians(30), radians(40)),
                                  (radians(0), radians(360)))
        det4 = _DelimitedDetector((radians(10), radians(20)),
                                  (radians(0), radians(360)))
        det5 = _DelimitedDetector((radians(10), radians(20)),
                                  (radians(90), radians(270)))

        self.detectors = {
            'det1': det1,
            'det2': det2,
            'det3': det3,
            'det4': det4,
            'det5': det5
        }
Beispiel #4
0
    def parse(self, element):
        subelement = element.find('elevation')
        if subelement is None:
            raise ValueError("Element 'elevation' not found")
        elevation_lower = self._parse_numerical_parameter(subelement, 'lower')
        elevation_upper = self._parse_numerical_parameter(subelement, 'upper')
        elevation_rad = list(zip(elevation_lower, elevation_upper))

        subelement = element.find('azimuth')
        if subelement is None:
            raise ValueError("Element 'azimuth' not found")
        azimuth_lower = self._parse_numerical_parameter(subelement, 'lower')
        azimuth_upper = self._parse_numerical_parameter(subelement, 'upper')
        azimuth_rad = list(zip(azimuth_lower, azimuth_upper))

        return _DelimitedDetector(elevation_rad, azimuth_rad)
    def setUp(self):
        TestCase.setUp(self)

        self.d = _DelimitedDetector((radians(35), radians(45)),
                                    (0, radians(360.0)))