π°οΈ Aethalometer Data Processor (Modular Flask App) A Dockerized, modular Flask-based application for processing and visualizing Aethalometer Black Carbon (BC) sensor data with optional weather correlation. Supports large datasets (500MBβ1GB), real-time progress tracking, and the ONA noise reduction algorithm from EPAβs Hagler et al. paper.
π Features π₯ Upload Aethalometer CSV files
π€οΈ Upload optional Weather CSV files for correlation
π§ Built-in ONA Algorithm (Optimized Noise-reduction Averaging)
π Interactive time-series & comparison visualizations (Plotly)
π§ͺ Raw vs. processed data comparisons
π¦ Handles large datasets (chunked memory-safe processing)
π§ NaN/empty value handling (JSON-safe output)
π Runs locally in a Docker container
ποΈ Configurable web server port via environment variable
π Directory Structure bash Copy Edit aethalometer_modular/ βββ app/ β βββ templates/ # index.html interface β βββ routes/ # Flask route logic β βββ processing/ # Core processing logic (ONA, weather, plots) β βββ utils/ # Status tracker, JSON encoder β βββ init.py # Flask app factory βββ Dockerfile βββ docker-compose.yml βββ requirements.txt βββ run.py # Entry point for Flask app π§ͺ Data Format π Aethalometer CSV (Example Header) css Copy Edit Serial number,Time (UTC),...,[UV BC1],[UV BC2],[UV BCc],...,[IR BCc],Readable status Important fields: UV BCc, Blue BCc, Green BCc, Red BCc, IR BCc, Time (UTC)
Missing/NaN/NA values are automatically handled
π€οΈ Weather CSV (Optional) sql Copy Edit timestamp,temperature_c,dew_point_c,relative_humidity_percent,... Timestamps must be parseable and ideally synchronized with the aethalometer data.
βοΈ How to Use
- Place Data Files Put your CSV files in the following directory:
bash Copy Edit aethalometer_modular/app/data/ aethalometer_data.csv
weather_data.csv (optional)
- Run the App Default Port (8080) bash Copy Edit docker-compose up Custom Port (e.g. 8080) bash Copy Edit PORT=8080 docker-compose up Then open: π http://localhost:8080 or π http://localhost:8080 (if using a custom port)
π§ ONA Algorithm Based on Hagler et al. (2011), the Optimized Noise-reduction Averaging algorithm:
Groups data using ATN change thresholds
Applies adaptive averaging
Retains time resolution while reducing random noise
π Developer Notes All NaN, NA, and empty fields are converted to null in JSON via a custom encoder (json_encoder.py)
Processing progress is tracked and updated via /api/status (see status_tracker.py)
Visualizations are created using Plotly and returned dynamically via API routes
π³ Docker Notes Build (optional) bash Copy Edit docker-compose build Port Explanation The docker-compose.yml dynamically maps the internal and external port:
yaml Copy Edit ports:
- "${PORT:-8080}:${PORT:-8080}" Use any free port by setting PORT=XXXX before docker-compose up.
π§βπ¬ Reference Hagler, G. S. W., Yelverton, T. L. B., Vedantham, R., Hansen, A. D. A., & Turner, J. R. (2011). Post-processing Method to Reduce Noise while Preserving High Time Resolution in Aethalometer Real-time Black Carbon Data J. Air & Waste Manage. Assoc. 61(4), 401β410.