Exemplo n.º 1
0
 def test_returns_same_results_when_turned_30_degrees(self, atmo_yaml_dict):
     atmo_yaml_dict["properties"]["pupil_angle"] = 30
     atmo_disp = AtmosphericDispersion(**atmo_yaml_dict["properties"])
     waves, dx, dy = atmo_disp.fov_grid()
     dr = ((dx[0] - dx[-1])**2 + (dy[0] - dy[-1])**2)**0.5
     assert dr == approx(0.53, rel=1e-2)
Exemplo n.º 2
0
 def test_returns_similar_values_to_lasilla_website(self, atmo_yaml_dict):
     atmo_disp = AtmosphericDispersion(**atmo_yaml_dict["properties"])
     waves, dx, dy = atmo_disp.fov_grid()
     assert dy[0] - dy[-1] == approx(0.53, rel=1e-2)
     assert all(dx == 0)
     assert waves[0] == 0.5 and waves[-1] == 2.5
Exemplo n.º 3
0
 def test_returns_same_results_when_turned_90_degrees(self, atmo_yaml_dict):
     atmo_yaml_dict["properties"]["pupil_angle"] = 90
     atmo_disp = AtmosphericDispersion(**atmo_yaml_dict["properties"])
     waves, dx, dy = atmo_disp.fov_grid()
     assert dx[0] - dx[-1] == approx(0.53, rel=1e-2)
     assert all([y == approx(0) for y in dy])
Exemplo n.º 4
0
 def test_returns_non_with_wrong_which_keyword(self, atmo_yaml_dict):
     atmo_disp = AtmosphericDispersion(**atmo_yaml_dict["properties"])
     response = atmo_disp.fov_grid(which="bogus")
     assert response is None
Exemplo n.º 5
0
 def test_returns_list_of_3_arrays_with_correct_which(self, atmo_yaml_dict):
     atmo_disp = AtmosphericDispersion(**atmo_yaml_dict["properties"])
     response = atmo_disp.fov_grid()
     assert len(response) == 3
     assert all([isinstance(x, np.ndarray) for x in response])
Exemplo n.º 6
0
 def test_throws_error_if_one_keyword_missing(self, atmo_yaml_dict):
     kwargs_dict = atmo_yaml_dict["properties"]
     kwargs_dict.pop("airmass")
     with pytest.raises(ValueError):
         isinstance(AtmosphericDispersion(), AtmosphericDispersion)
Exemplo n.º 7
0
    def test_passes_if_all_keywords_are_present(self, atmo_yaml_dict):
        kwargs_dict = atmo_yaml_dict["properties"]
        atmo_disp = AtmosphericDispersion(**kwargs_dict)

        assert isinstance(atmo_disp, AtmosphericDispersion)
Exemplo n.º 8
0
 def test_throws_error_when_initialised_with_nothing(self):
     with pytest.raises(ValueError):
         isinstance(AtmosphericDispersion(), AtmosphericDispersion)