下载俄勒冈DEQ空气质量数据的工具
deq-tools的Python项目详细描述
使用pip安装:pip install deq-tools
deq_tools是一个功能有限的python库,用于使用python脚本访问俄勒冈deq空气质量数据。
用法:
importdeq_toolsprint(deq_tools.get_station_names())# Dump a list of names of stations where data may be availableprint(deq_tools.get_station_data())# Dump all station info, including data available for each stationstation_id=2# Get this value from get_station_names()from_ts="2018/05/03T00:00"# ISO datetime format: YYYY/MM/DDTHH:MMto_ts="2018/05/10T23:59"print(deq_tools.get_data(station_id,from_ts,to_ts))# Get the data
除了上面显示的必需位置参数之外,get_deq_data()
还接受这些可选的命名参数:
- 分辨率:
- 默认值=60。小时数据为60,日值为1440。高分辨率不起作用,对不起,但是低分辨率,例如120、180、480、720会起作用。
- agg_方法:
- 默认值为“平均”。这些可能都是有效的:平均值、最小平均值、最大平均值、运行平均值、最小运行平均值、最大运行平均值、运行预测值、最小运行预测值。