研究發電廠與PM 2.5濃度之關係
輸出指定時間範圍內台灣所有核能及火力發電機對應 PM 2.5 濃度之影響程度
發電機名稱 | 對 PM 2.5 影響程度(%) |
---|---|
核一#1 | 79% |
核二#1 | 56 % |
The whole daatset could be found on the official site.
- ftp://gpssensor.ddns.net:2121/data.log-20161212.gz
- ftp://gpssensor.ddns.net:2121/data.log-20161213.gz
- ftp://gpssensor.ddns.net:2121/data.log-20161214.gz
- ftp://gpssensor.ddns.net:2121/data.log-20161215.gz
- ftp://gpssensor.ddns.net:2121/data.log-20161216.gz
- ftp://gpssensor.ddns.net:2121/data.log-20161217.gz
- ftp://gpssensor.ddns.net:2121/data.log-20161218.gz
We define the target output format to be .csv
file with header:
Field | Data Type | Description |
---|---|---|
latitude | Float | - |
longitude | Float | - |
pm25 | Float | The concentration of PM2.5 in μg/m3 |
timestamp | String | Timestamp with format YYYY/MM/DD HH:mm , and the mm part can only be 00 , 10 , 20 , 30 , 40 and 50 |
/data/pm25/csvs/2016-12-20.csv
latitude | longitude | pm25 | timestamp |
---|---|---|---|
21.5566 | 120.5678 | 71 | 2016/12/25 19:40 |
21.5566 | 120.5678 | 68 | 2016/12/25 19:50 |
/src/pm25 $ python preprocess_LASS.py [../../data/pm25/logs] [../../data/pm25/csvs] [-v]
-v
switch allows error reporting
- Turn log files into csv files
- Drop data when any following rules is matched:
- Empty data
- NA, NAN, none data
- Any data with zero value
- Error datetime
/src/pm25 $ python extractTaiwanCsv.py [../../data/pm25/reducedCsvs]
Extract entries near Taiwan.
To Be Documented
We manually searched out the longitudes and latitudes of generators and merge them with open data to give /data/power/raw.csv
with following header:
Field | Data Type | Description |
---|---|---|
name | String | The identifier of generators |
latitude | Float | - |
longitude | Float | - |
load | Float | The working load of generators in percentage |
timestamp | String | Timestamp with format YYYY/MM/DD HH:mm , and the mm part can only be 00 , 10 , 20 , 30 , 40 and 50 |
/src/compute $ python relayMetrices.py 10 60
Calculate weight param metrices with arguments r1
and r2
:
/data/relayMetrices/dfR1Pm25Sum.csv
/data/relayMetrices/dfR1WeightSum.csv
/data/relayMetrices/dfR2Pm25Sum.csv
/data/relayMetrices/dfR2WeightSum.csv
This step will take several days!
The format of these metrices is like following:
協和#1 | 台中#1 | ... | 星元#1 | 嘉惠#1 | |
---|---|---|---|---|---|
2016/12/17 00:00 | -21.65610874 | -21.65610874 | ... | 3.502609225 | 0.704510358 |
2016/12/17 00:10 | -18.59080956 | -18.59080956 | ... | 2.18297131 | 0.697338471 |
... | ... | ... | ... | ... | ... |
2016/12/23 23:40 | -9.457467469 | -9.457467469 | ... | -1.206004589 | 8.70393683 |
2016/12/23 23:50 | -9.251565115 | -9.251565115 | ... | -0.77633429 | 10.38556501 |
/src/compute $ python populateGeneratorPm25.py
Remove meaningless power generator and from the above 4 metrices we can calculate weighted pm2.5 concentrations metrix /data/pm25.csv
for each timestamp and for each power generator.
Manually remove the following columns of /data/pm25.csv
:
桂山發電廠
桂山發電廠.1
桂山發電廠.2
桂山發電廠.3
桂山發電廠.4
/src/compute $ python compute.py
Output the final result /data/computed.csv
以下將有效結果按照影響 PM 2.5 程度高到低排序列出發電廠:
發電機名稱 | 對 PM 2.5 影響程度(%) |
---|---|
1.南部CC#1 | 2.184873262 |
2.麥寮#2 | 1.49417488 |
3.台中#8 | 1.430793164 |
4.台中#7 | 1.26254155 |
5.台中#4 | 0.865876417 |
6.台中#10 | 0.463076126 |
7.南部CC#3 | 0.108828336 |
8.協和#3 | 0.075507763 |
9.星彰#1 | 0.04750983 |
10.台中#3 | 0.038797059 |
11.星元#1 | 0.03089229 |
12.台中#6 | 0.029548456 |
13.協和#1 | 0.027159773 |
14.國光#1 | 0.027102036 |
15.翡翠#1 | 0.014511465 |
16.台中#1 | 0.014321961 |