Loading Common/Servers/DewarPositioner/src/DewarPositioner/posgenerator.py +2 −1 Original line number Diff line number Diff line Loading @@ -29,7 +29,8 @@ class PosGenerator(object): while True: try: t = getTimeStamp().value + 1*10*6 # 100 ms in the future az, el = source.getRawCoordinates(t) # Values in radians coordinates = source.getApparentCoordinates(t) # Values in radians az, el = coordinates[:2] # The first two elements are (az, el) position = PosGenerator.getParallacticAngle(latitude, az, el) yield position last_zerodiv_time = datetime.datetime.now() Loading Common/Servers/DewarPositioner/test/DewarPositionerMockers/mock_components.py +1 −1 Original line number Diff line number Diff line Loading @@ -68,7 +68,7 @@ class MockSource(object): def setElevation(self, value): self.elevation_obj.setValue(value) def getRawCoordinates(self, time): def getApparentCoordinates(self, time): return (self.azimuth_obj.value, self.elevation_obj.value) def _get_azimuth(self): Loading Common/Servers/DewarPositioner/test/pyunit/posgen/test_parallactic.py +3 −3 Original line number Diff line number Diff line Loading @@ -25,7 +25,7 @@ class PosGeneratorParallacticTest(unittest2.TestCase): def test_az_el_values(self): """Raise a PosGeneratorError if cannot get the (az, el) values""" source = self.m.mock() mocker.expect(source.getRawCoordinates(mocker.ANY)).result((None, None)) mocker.expect(source.getApparentCoordinates(mocker.ANY)).result((None, None)) mocker.expect(source._get_name()).result('mocker') self.m.replay() gen = self.posgen.parallactic(source, siteInfo={'latitude': 39}) Loading @@ -39,8 +39,8 @@ class PosGeneratorParallacticTest(unittest2.TestCase): source = self.m.mock() for (az, el) in zip(azimuths, elevations): mocker.expect( source.getRawCoordinates(mocker.ANY) ).result((radians(az), radians(el))) source.getApparentCoordinates(mocker.ANY) ).result((radians(az), radians(el)) + (None,)*5) self.m.count(1) self.m.replay() gen = self.posgen.parallactic(source, siteInfo={'latitude': latitude}) Loading Loading
Common/Servers/DewarPositioner/src/DewarPositioner/posgenerator.py +2 −1 Original line number Diff line number Diff line Loading @@ -29,7 +29,8 @@ class PosGenerator(object): while True: try: t = getTimeStamp().value + 1*10*6 # 100 ms in the future az, el = source.getRawCoordinates(t) # Values in radians coordinates = source.getApparentCoordinates(t) # Values in radians az, el = coordinates[:2] # The first two elements are (az, el) position = PosGenerator.getParallacticAngle(latitude, az, el) yield position last_zerodiv_time = datetime.datetime.now() Loading
Common/Servers/DewarPositioner/test/DewarPositionerMockers/mock_components.py +1 −1 Original line number Diff line number Diff line Loading @@ -68,7 +68,7 @@ class MockSource(object): def setElevation(self, value): self.elevation_obj.setValue(value) def getRawCoordinates(self, time): def getApparentCoordinates(self, time): return (self.azimuth_obj.value, self.elevation_obj.value) def _get_azimuth(self): Loading
Common/Servers/DewarPositioner/test/pyunit/posgen/test_parallactic.py +3 −3 Original line number Diff line number Diff line Loading @@ -25,7 +25,7 @@ class PosGeneratorParallacticTest(unittest2.TestCase): def test_az_el_values(self): """Raise a PosGeneratorError if cannot get the (az, el) values""" source = self.m.mock() mocker.expect(source.getRawCoordinates(mocker.ANY)).result((None, None)) mocker.expect(source.getApparentCoordinates(mocker.ANY)).result((None, None)) mocker.expect(source._get_name()).result('mocker') self.m.replay() gen = self.posgen.parallactic(source, siteInfo={'latitude': 39}) Loading @@ -39,8 +39,8 @@ class PosGeneratorParallacticTest(unittest2.TestCase): source = self.m.mock() for (az, el) in zip(azimuths, elevations): mocker.expect( source.getRawCoordinates(mocker.ANY) ).result((radians(az), radians(el))) source.getApparentCoordinates(mocker.ANY) ).result((radians(az), radians(el)) + (None,)*5) self.m.count(1) self.m.replay() gen = self.posgen.parallactic(source, siteInfo={'latitude': latitude}) Loading