intelligent-environments-lab / bleed-orange-measure-purple

Data and Analysis related to the Bleed Orange, Measure Purple low-cost sensor project on UT's campus
GNU General Public License v3.0
2 stars 1 forks source link

Improving data acquisition #16

Closed calvinjlin closed 4 years ago

calvinjlin commented 4 years ago

Problem

At present, data files are downloaded manually. However, this can be labor intensive/time consuming for the programmer. Looking at the cookiecutter project structure as well as other IEL, data retrieval via scripts/apis would probably be a better approach.

PurpleAir Solution: Access Data Through Thingspeak

Currently, PurpleAir data files are retrieved using the online download tool. However, this can necessitate a lot of button clicking (16 sensors, each sensor has 4 files due to A/B channels and primary/secondary datasets). PurpleAir provides other ways to access data. A better approach would be to utilized the Thingspeak API.

  1. Retrieve Thingspeak API keys and channel IDs for each sensor (also labor intensive).

  2. Implement Thingspeak API for data retrieval.

    • [x] Review API docs . . .

TCEQ

(to be expanded)

calvinjlin commented 4 years ago

By using Firefox's developer tools, I found a GET request url leading to a json with the metadata for all 16 sensors. Therefore, the json module was used instead of beautiful soup. It has the Thingspeak IDs and also other metadata like latitude and longitude.