Commit 08382f4d authored by Marco Buttu's avatar Marco Buttu
Browse files

Antenna coordinates: getRawCoordinates() -> getApparentCoordinates()

parent 58714c1a
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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()
+1 −1
Original line number Diff line number Diff line
@@ -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):
+3 −3
Original line number Diff line number Diff line
@@ -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})
@@ -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})