Пример #1
0
    def test_currsys_updated_with_mode_specific_values(self, imageplane):
        rc.__currsys__["!OBS.detector_readout_mode"] = "fast"
        eff = DetectorModePropertiesSetter(**kwargs_dict())
        eff.apply_to(imageplane)

        key_name = "!DET.mindit"
        assert from_currsys(key_name) == eff.mode_properties["fast"][key_name]
Пример #2
0
 def test_selects_correct_mode(self, imageplane, value, mode):
     eff = DetectorModePropertiesSetter(**kwargs_dict())
     rc.__currsys__["!OBS.auto_exposure.fill_frac"] = 0.5
     imageplane.hdu.data += value
     assert eff.select_mode(imageplane) == mode
Пример #3
0
 def test_it_prints(self):
     eff = DetectorModePropertiesSetter(**kwargs_dict())
     print("\n", eff.list_modes())
     assert len(eff.list_modes()) > 0
Пример #4
0
    def test_returns_object(self):
        rc.__currsys__["!OBS.detector_readout_mode"] = "fast"
        eff = DetectorModePropertiesSetter(**kwargs_dict())
        obj = eff.apply_to(DetectorBase())

        assert isinstance(obj, DetectorBase)
Пример #5
0
 def test_throws_error_for_unknown_detector_mode(self):
     eff = DetectorModePropertiesSetter(**kwargs_dict())
     rc.__currsys__["!OBS.detector_readout_mode"] = "notthere"
     with pytest.raises(KeyError):
         eff.apply_to(DetectorBase())
Пример #6
0
 def test_understands_detector_mode_auto(self, imageplane):
     eff = DetectorModePropertiesSetter(**kwargs_dict())
     rc.__currsys__["!OBS.auto_exposure.fill_frac"] = 0.5
     eff.apply_to(imageplane, detector_readout_mode="auto")
     assert rc.__currsys__["!OBS.detector_readout_mode"] == "slow"
Пример #7
0
 def test_throws_error_when_no_dict_is_passed(self):
     with pytest.raises(ValueError):
         DetectorModePropertiesSetter()
Пример #8
0
 def test_initialises_with_correct_values(self):
     eff = DetectorModePropertiesSetter(**kwargs_dict())
     assert eff.mode_properties["fast"]["!DET.mindit"] == 0.04