-
Notifications
You must be signed in to change notification settings - Fork 0
/
create_measurements.py
445 lines (436 loc) · 37.8 KB
/
create_measurements.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
import argparse
import sys
import random
import time
weather_station_list = [("Abha", 18.0),
("Abidjan", 26.0),
("Abéché", 29.4),
("Accra", 26.4),
("Addis Ababa", 16.0),
("Adelaide", 17.3),
("Aden", 29.1),
("Ahvaz", 25.4),
("Albuquerque", 14.0),
("Alexandra", 11.0),
("Alexandria", 20.0),
("Algiers", 18.2),
("Alice Springs", 21.0),
("Almaty", 10.0),
("Amsterdam", 10.2),
("Anadyr", -6.9),
("Anchorage", 2.8),
("Andorra la Vella", 9.8),
("Ankara", 12.0),
("Antananarivo", 17.9),
("Antsiranana", 25.2),
("Arkhangelsk", 1.3),
("Ashgabat", 17.1),
("Asmara", 15.6),
("Assab", 30.5),
("Astana", 3.5),
("Athens", 19.2),
("Atlanta", 17.0),
("Auckland", 15.2),
("Austin", 20.7),
("Baghdad", 22.77),
("Baguio", 19.5),
("Baku", 15.1),
("Baltimore", 13.1),
("Bamako", 27.8),
("Bangkok", 28.6),
("Bangui", 26.0),
("Banjul", 26.0),
("Barcelona", 18.2),
("Bata", 25.1),
("Batumi", 14.0),
("Beijing", 12.9),
("Beirut", 20.9),
("Belgrade", 12.5),
("Belize City", 26.7),
("Benghazi", 19.9),
("Bergen", 7.7),
("Berlin", 10.3),
("Bilbao", 14.7),
("Birao", 26.5),
("Bishkek", 11.3),
("Bissau", 27.0),
("Blantyre", 22.2),
("Bloemfontein", 15.6),
("Boise", 11.4),
("Bordeaux", 14.2),
("Bosaso", 30.0),
("Boston", 10.9),
("Bouaké", 26.0),
("Bratislava", 10.5),
("Brazzaville", 25.0),
("Bridgetown", 27.0),
("Brisbane", 21.4),
("Brussels", 10.5),
("Bucharest", 10.8),
("Budapest", 11.3),
("Bujumbura", 23.8),
("Bulawayo", 18.9),
("Burnie", 13.1),
("Busan", 15.0),
("Cabo San Lucas", 23.9),
("Cairns", 25.0),
("Cairo", 21.4),
("Calgary", 4.4),
("Canberra", 13.1),
("Cape Town", 16.2),
("Changsha", 17.4),
("Charlotte", 16.1),
("Chiang Mai", 25.8),
("Chicago", 9.8),
("Chihuahua", 18.6),
("Chișinău", 10.2),
("Chittagong", 25.9),
("Chongqing", 18.6),
("Christchurch", 12.2),
("City of San Marino", 11.8),
("Colombo", 27.4),
("Columbus", 11.7),
("Conakry", 26.4),
("Copenhagen", 9.1),
("Cotonou", 27.2),
("Cracow", 9.3),
("Da Lat", 17.9),
("Da Nang", 25.8),
("Dakar", 24.0),
("Dallas", 19.0),
("Damascus", 17.0),
("Dampier", 26.4),
("Dar es Salaam", 25.8),
("Darwin", 27.6),
("Denpasar", 23.7),
("Denver", 10.4),
("Detroit", 10.0),
("Dhaka", 25.9),
("Dikson", -11.1),
("Dili", 26.6),
("Djibouti", 29.9),
("Dodoma", 22.7),
("Dolisie", 24.0),
("Douala", 26.7),
("Dubai", 26.9),
("Dublin", 9.8),
("Dunedin", 11.1),
("Durban", 20.6),
("Dushanbe", 14.7),
("Edinburgh", 9.3),
("Edmonton", 4.2),
("El Paso", 18.1),
("Entebbe", 21.0),
("Erbil", 19.5),
("Erzurum", 5.1),
("Fairbanks", -2.3),
("Fianarantsoa", 17.9),
("Flores, Petén", 26.4),
("Frankfurt", 10.6),
("Fresno", 17.9),
("Fukuoka", 17.0),
("Gabès", 19.5),
("Gaborone", 21.0),
("Gagnoa", 26.0),
("Gangtok", 15.2),
("Garissa", 29.3),
("Garoua", 28.3),
("George Town", 27.9),
("Ghanzi", 21.4),
("Gjoa Haven", -14.4),
("Guadalajara", 20.9),
("Guangzhou", 22.4),
("Guatemala City", 20.4),
("Halifax", 7.5),
("Hamburg", 9.7),
("Hamilton", 13.8),
("Hanga Roa", 20.5),
("Hanoi", 23.6),
("Harare", 18.4),
("Harbin", 5.0),
("Hargeisa", 21.7),
("Hat Yai", 27.0),
("Havana", 25.2),
("Helsinki", 5.9),
("Heraklion", 18.9),
("Hiroshima", 16.3),
("Ho Chi Minh City", 27.4),
("Hobart", 12.7),
("Hong Kong", 23.3),
("Honiara", 26.5),
("Honolulu", 25.4),
("Houston", 20.8),
("Ifrane", 11.4),
("Indianapolis", 11.8),
("Iqaluit", -9.3),
("Irkutsk", 1.0),
("Istanbul", 13.9),
("İzmir", 17.9),
("Jacksonville", 20.3),
("Jakarta", 26.7),
("Jayapura", 27.0),
("Jerusalem", 18.3),
("Johannesburg", 15.5),
("Jos", 22.8),
("Juba", 27.8),
("Kabul", 12.1),
("Kampala", 20.0),
("Kandi", 27.7),
("Kankan", 26.5),
("Kano", 26.4),
("Kansas City", 12.5),
("Karachi", 26.0),
("Karonga", 24.4),
("Kathmandu", 18.3),
("Khartoum", 29.9),
("Kingston", 27.4),
("Kinshasa", 25.3),
("Kolkata", 26.7),
("Kuala Lumpur", 27.3),
("Kumasi", 26.0),
("Kunming", 15.7),
("Kuopio", 3.4),
("Kuwait City", 25.7),
("Kyiv", 8.4),
("Kyoto", 15.8),
("La Ceiba", 26.2),
("La Paz", 23.7),
("Lagos", 26.8),
("Lahore", 24.3),
("Lake Havasu City", 23.7),
("Lake Tekapo", 8.7),
("Las Palmas de Gran Canaria", 21.2),
("Las Vegas", 20.3),
("Launceston", 13.1),
("Lhasa", 7.6),
("Libreville", 25.9),
("Lisbon", 17.5),
("Livingstone", 21.8),
("Ljubljana", 10.9),
("Lodwar", 29.3),
("Lomé", 26.9),
("London", 11.3),
("Los Angeles", 18.6),
("Louisville", 13.9),
("Luanda", 25.8),
("Lubumbashi", 20.8),
("Lusaka", 19.9),
("Luxembourg City", 9.3),
("Lviv", 7.8),
("Lyon", 12.5),
("Madrid", 15.0),
("Mahajanga", 26.3),
("Makassar", 26.7),
("Makurdi", 26.0),
("Malabo", 26.3),
("Malé", 28.0),
("Managua", 27.3),
("Manama", 26.5),
("Mandalay", 28.0),
("Mango", 28.1),
("Manila", 28.4),
("Maputo", 22.8),
("Marrakesh", 19.6),
("Marseille", 15.8),
("Maun", 22.4),
("Medan", 26.5),
("Mek'ele", 22.7),
("Melbourne", 15.1),
("Memphis", 17.2),
("Mexicali", 23.1),
("Mexico City", 17.5),
("Miami", 24.9),
("Milan", 13.0),
("Milwaukee", 8.9),
("Minneapolis", 7.8),
("Minsk", 6.7),
("Mogadishu", 27.1),
("Mombasa", 26.3),
("Monaco", 16.4),
("Moncton", 6.1),
("Monterrey", 22.3),
("Montreal", 6.8),
("Moscow", 5.8),
("Mumbai", 27.1),
("Murmansk", 0.6),
("Muscat", 28.0),
("Mzuzu", 17.7),
("N'Djamena", 28.3),
("Naha", 23.1),
("Nairobi", 17.8),
("Nakhon Ratchasima", 27.3),
("Napier", 14.6),
("Napoli", 15.9),
("Nashville", 15.4),
("Nassau", 24.6),
("Ndola", 20.3),
("New Delhi", 25.0),
("New Orleans", 20.7),
("New York City", 12.9),
("Ngaoundéré", 22.0),
("Niamey", 29.3),
("Nicosia", 19.7),
("Niigata", 13.9),
("Nouadhibou", 21.3),
("Nouakchott", 25.7),
("Novosibirsk", 1.7),
("Nuuk", -1.4),
("Odesa", 10.7),
("Odienné", 26.0),
("Oklahoma City", 15.9),
("Omaha", 10.6),
("Oranjestad", 28.1),
("Oslo", 5.7),
("Ottawa", 6.6),
("Ouagadougou", 28.3),
("Ouahigouya", 28.6),
("Ouarzazate", 18.9),
("Oulu", 2.7),
("Palembang", 27.3),
("Palermo", 18.5),
("Palm Springs", 24.5),
("Palmerston North", 13.2),
("Panama City", 28.0),
("Parakou", 26.8),
("Paris", 12.3),
("Perth", 18.7),
("Petropavlovsk-Kamchatsky", 1.9),
("Philadelphia", 13.2),
("Phnom Penh", 28.3),
("Phoenix", 23.9),
("Pittsburgh", 10.8),
("Podgorica", 15.3),
("Pointe-Noire", 26.1),
("Pontianak", 27.7),
("Port Moresby", 26.9),
("Port Sudan", 28.4),
("Port Vila", 24.3),
("Port-Gentil", 26.0),
("Portland (OR)", 12.4),
("Porto", 15.7),
("Prague", 8.4),
("Praia", 24.4),
("Pretoria", 18.2),
("Pyongyang", 10.8),
("Rabat", 17.2),
("Rangpur", 24.4),
("Reggane", 28.3),
("Reykjavík", 4.3),
("Riga", 6.2),
("Riyadh", 26.0),
("Rome", 15.2),
("Roseau", 26.2),
("Rostov-on-Don", 9.9),
("Sacramento", 16.3),
("Saint Petersburg", 5.8),
("Saint-Pierre", 5.7),
("Salt Lake City", 11.6),
("San Antonio", 20.8),
("San Diego", 17.8),
("San Francisco", 14.6),
("San Jose", 16.4),
("San José", 22.6),
("San Juan", 27.2),
("San Salvador", 23.1),
("Sana'a", 20.0),
("Santo Domingo", 25.9),
("Sapporo", 8.9),
("Sarajevo", 10.1),
("Saskatoon", 3.3),
("Seattle", 11.3),
("Ségou", 28.0),
("Seoul", 12.5),
("Seville", 19.2),
("Shanghai", 16.7),
("Singapore", 27.0),
("Skopje", 12.4),
("Sochi", 14.2),
("Sofia", 10.6),
("Sokoto", 28.0),
("Split", 16.1),
("St. John's", 5.0),
("St. Louis", 13.9),
("Stockholm", 6.6),
("Surabaya", 27.1),
("Suva", 25.6),
("Suwałki", 7.2),
("Sydney", 17.7),
("Tabora", 23.0),
("Tabriz", 12.6),
("Taipei", 23.0),
("Tallinn", 6.4),
("Tamale", 27.9),
("Tamanrasset", 21.7),
("Tampa", 22.9),
("Tashkent", 14.8),
("Tauranga", 14.8),
("Tbilisi", 12.9),
("Tegucigalpa", 21.7),
("Tehran", 17.0),
("Tel Aviv", 20.0),
("Thessaloniki", 16.0),
("Thiès", 24.0),
("Tijuana", 17.8),
("Timbuktu", 28.0),
("Tirana", 15.2),
("Toamasina", 23.4),
("Tokyo", 15.4),
("Toliara", 24.1),
("Toluca", 12.4),
("Toronto", 9.4),
("Tripoli", 20.0),
("Tromsø", 2.9),
("Tucson", 20.9),
("Tunis", 18.4),
("Ulaanbaatar", -0.4),
("Upington", 20.4),
("Ürümqi", 7.4),
("Vaduz", 10.1),
("Valencia", 18.3),
("Valletta", 18.8),
("Vancouver", 10.4),
("Veracruz", 25.4),
("Vienna", 10.4),
("Vientiane", 25.9),
("Villahermosa", 27.1),
("Vilnius", 6.0),
("Virginia Beach", 15.8),
("Vladivostok", 4.9),
("Warsaw", 8.5),
("Washington, D.C.", 14.6),
("Wau", 27.8),
("Wellington", 12.9),
("Whitehorse", -0.1),
("Wichita", 13.9),
("Willemstad", 28.0),
("Winnipeg", 3.0),
("Wrocław", 9.6),
("Xi'an", 14.1),
("Yakutsk", -8.8),
("Yangon", 27.5),
("Yaoundé", 23.8),
("Yellowknife", -4.3),
("Yerevan", 12.4),
("Yinchuan", 9.0),
("Zagreb", 10.7),
("Zanzibar City", 26.0),
("Zürich", 9.3)]
WS_LEN = len(weather_station_list)
def fill_rows(count):
print(f"Writing {int(count)} rows to measurements.txt ")
start = time.time()
with open("measurements.txt", "w") as f_writer:
for _ in range(count):
ws = weather_station_list[random.randint(0,WS_LEN-1)]
f_writer.write(f"{ws[0]};{round(random.gauss(float(ws[1]), 10) * 10.0) / 10.0}\n")
end = time.time()
print(f"finished in {end-start} seconds")
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument('-r', '--rows', action='store', type=int, default=100, help="row count")
args = parser.parse_args()
if not args.rows:
print("Error: Missing Row count argument")
parser.print_help()
sys.ex(1)
fill_rows(count=args.rows)