Beispiel #1
0
class SingletFocusCalculatorTest(FileReadingTestCase):
    def setUp(self):
        astrom_data = AstromParser().parse(
            self.get_abs_path("data/1616681p22.measure3.cands.astrom"))
        self.source = astrom_data.get_sources()[0]
        self.reading0 = self.source.get_reading(0)
        self.reading1 = self.source.get_reading(1)
        self.reading2 = self.source.get_reading(2)

        self.undertest = SingletFocusCalculator(self.source)

    def test_get_focal_point_first_reading(self):
        assert_tuples_almost_equal(
            self.undertest.calculate_focus(self.reading0),
            (583.42, 408.46))

    def test_get_focal_point_second_reading(self):
        assert_tuples_almost_equal(
            self.undertest.calculate_focus(self.reading1),
            (586.18, 408.63))

    def test_get_focal_point_third_reading(self):
        assert_tuples_almost_equal(
            self.undertest.calculate_focus(self.reading2),
            (587.80, 407.98))
Beispiel #2
0
    def setUp(self):
        astrom_data = AstromParser().parse(
            self.get_abs_path("data/1616681p22.measure3.cands.astrom"))
        self.source = astrom_data.get_sources()[0]
        self.reading0 = self.source.get_reading(0)
        self.reading1 = self.source.get_reading(1)
        self.reading2 = self.source.get_reading(2)

        self.undertest = SingletFocusCalculator(self.source)
Beispiel #3
0
    def download_singlets_for_source(self, source, needs_apcor=False):
        focus_calculator = SingletFocusCalculator(source)

        for reading in source.get_readings():
            focus = focus_calculator.calculate_focus(reading)
            self._singlet_download_manager.submit_request(
                DownloadRequest(reading,
                                needs_apcor=needs_apcor,
                                focus=focus,
                                callback=self.on_singlet_image_loaded)
            )
Beispiel #4
0
    def download_singlets_for_source(self, source, needs_apcor=False):
        focus_calculator = SingletFocusCalculator(source)

        for reading in source.get_readings():
            if reading.ssos:
                # For track the objects have moved too far to center on
                # the mid point.  Centre each image on its source reading.
                # TODO: refactor.
                focus = reading.source_point
            else:
                focus = focus_calculator.calculate_focus(reading)
            self._singlet_download_manager.submit_request(
                DownloadRequest(reading,
                                needs_apcor=needs_apcor,
                                focus=focus,
                                callback=self.on_singlet_image_loaded)
            )