davidcarslaw / openair

Tools for air quality data analysis
https://davidcarslaw.github.io/openair/
GNU General Public License v2.0
302 stars 113 forks source link

importAURN datetime wrong #223

Closed FlorentinBulotAQ closed 4 years ago

FlorentinBulotAQ commented 4 years ago

Hello,

When importing data from the AURN network from Southampton Center station, there is a one hour time offset compared to the actual data:

importAURN(site="SOUT", year = 2019, pollutant ="pm2.5") %>%
  filter(date>=as.POSIXct("2019-12-02 08:00:00", tz = "UTC"), date<=as.POSIXct("2019-12-02 11:00:00",tz = "UTC"))

gives me:

                 date  pm2.5               site code
1 2019-12-02 08:00:00 22.689 Southampton Centre SOUT
2 2019-12-02 09:00:00 21.580 Southampton Centre SOUT
3 2019-12-02 10:00:00 20.708 Southampton Centre SOUT
4 2019-12-02 11:00:00 13.043 Southampton Centre SOUT

But if I get the data from https://uk-air.defra.gov.uk/data/data_selector_service for the same period of time, I am getting: Capture

The date format from importAURN is in GMT which should be the same than UTC but I think something is wrong with correction of summer/non-summer time.

Is there anyway to fix that from the data import? Otherwise it can be fixed manually after importing the data.

Thank you very much, With best wishes, Florentin.

jmclaren17 commented 4 years ago

Florentin, it is the same data - the time from Defra is hour ending, where as time from importAURN is hour beginning.
There is nothing wrng with the data. Hour beginning is 00:00 to 23:00 and Hour ending is 01:00 to 24:00.

FlorentinBulotAQ commented 4 years ago

Indeed, thanks a lot.