diff --git a/Readme.md b/Readme.md index 73d9c97..15cf54b 100644 --- a/Readme.md +++ b/Readme.md @@ -44,7 +44,7 @@ Returns the cloud fraction within the requested great circle. | Field | Type | Description | |----------|-------|--------------------------------------------------| | obs_time | float | Observation Unix time of the last analyzed image | -| value | float | Cloud fraction in the requested area | +| value | float | Cloud fraction in the requested area in percent | ## Configuration diff --git a/day_integration_test.yaml b/day_integration_test.yaml index 42faef6..5cd4a1c 100644 --- a/day_integration_test.yaml +++ b/day_integration_test.yaml @@ -56,7 +56,7 @@ modules: total_fraction: 0.7 zenith_fraction: 0.02 zenith_value: False - zenith_average: 0.02 + zenith_average: 2.3 comm: class: pyobs.comm.local.LocalComm diff --git a/pyobs_cloudcover/testing/module.py b/pyobs_cloudcover/testing/module.py index ab2dfb3..e9744ce 100644 --- a/pyobs_cloudcover/testing/module.py +++ b/pyobs_cloudcover/testing/module.py @@ -103,11 +103,11 @@ async def _check_point_query(self, url: str, port: int) -> None: async with session.get(f"http://{url}:{port}/query/point?az=0.0&alt=90.0") as resp: data = await resp.json() - np.testing.assert_almost_equal(data["value"], self._zenith_value, 2, err_msg="Wrong point query result!") + np.testing.assert_almost_equal(data["value"], self._zenith_value, 1, err_msg="Wrong point query result!") async def _check_area_query(self, url: str, port: int) -> None: async with aiohttp.ClientSession() as session: async with session.get(f"http://{url}:{port}/query/area?az=0.0&alt=90.0&radius=10.0") as resp: data = await resp.json() - np.testing.assert_almost_equal(data["value"], self._zenith_average, 2, err_msg="Wrong area query result!") + np.testing.assert_almost_equal(data["value"], self._zenith_average, 1, err_msg="Wrong area query result!") diff --git a/pyobs_cloudcover/web_api/coverage_query_executor.py b/pyobs_cloudcover/web_api/coverage_query_executor.py index 7e384f7..0c183ca 100644 --- a/pyobs_cloudcover/web_api/coverage_query_executor.py +++ b/pyobs_cloudcover/web_api/coverage_query_executor.py @@ -73,4 +73,5 @@ def area_query_altaz(self, alt: float, az: float, radius: float) -> Optional[flo if cloudiness is None: return None else: - return float(cloudiness) + cloud_fraction = 100.0 * float(cloudiness) + return cloud_fraction diff --git a/tests/unit/web_api/test_coverage_query_executor.py b/tests/unit/web_api/test_coverage_query_executor.py index 111c6f9..9d24373 100644 --- a/tests/unit/web_api/test_coverage_query_executor.py +++ b/tests/unit/web_api/test_coverage_query_executor.py @@ -49,7 +49,7 @@ def test_area_radec(observer, obs_time) -> None: cloud_query = SkyPixelQuery([AltAzCoord(0, 0)], [True]) executor.set_measurement(CloudCoverageInfo(cloud_query, 1, 2, 0.1, obs_time)) - assert executor.area_query_radec(10, 10, 90) == 1.0 + assert executor.area_query_radec(10, 10, 90) == 100.0 def test_area_radec_nan(observer, obs_time) -> None: