Closed amehta-scottlogic closed 3 months ago
forecast_api_seeded_data_tests.py
, forecast_api_validation_tests.py
, cams_known_grib_test.py
, forecast_calibration_tests.py
& open_aq_etl_tests.py
tests all passed.
Executed manual test cases, had to make some changes to test assertions, but expected behaviour was observed
Test Analysis:
Elements to verify:
Looking good, we already have some code snippets that may expedite the process too! 😎
original_value
s are not being converted - RESOLVED ✅Steps to reproduce:
Expected:
Actual:
unit
and value
is identical to original_unit
and original_value
= not convertedI am concerned this data could make it through to the UI.
The document structure is slightly different than described, with fields value
, unit
, original_value
& original_unit
estimated_surface_pressure_pa
and estimated_temperature_k
estimated_surface_pressure_pa
and estimated_temperature_k
are correct. They are generated by interpolating data from a given GRIB file, for a given latitude, longitude and time. See Manual testing of interpolating surface temperature and pressure values from CAMS data to use in converting OpenAQ ppm to µg m³ for details - test passed
Description
From the last call with the mentors, they are keen to include PPM values from OpenAQ. We want to store the data in µg/m³ so all units are the same. The problem is we need a value for air density from that location to do the conversion.
The approach to take for now will be to query CAMS and use their surface temperature + pressure values (as we do already for forecast data) and when units are PPM we convert. The cams data should be queried with the lat/longs of the measurement stations themselves (rather than the city lat/long) for the best approximation.
While this is not likely to be 100% accurate, it should mean that more data can be used.
Formula: ppb = ppm * 1000
Weights no2 = 46.01 g/mol so2 = 64.07 g/mol o3 = 48 g/mol
https://www.apis.ac.uk/unit-conversion https://www.breeze-technologies.de/blog/air-pollution-how-to-convert-between-mgm3-%C2%B5gm3-ppm-ppb/
Acceptance Criteria
fields "value" and new field 'original_unit' value of µg/m³ or ppmEDIT: fields "value", "unit", and new field 'original_unit' value of µg/m³ or ppm, and new field "original_value"EDIT - only ppm measurements for so2, no2 and o3 are converted. We now filter out any instance of pm10 or pm2_5 and do not store in the database
Test Checklist: