{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# dotConferences carbon footprint calculator\n", "\n", "We'd love to have your feedback on some of the data or the general process of this calculator! Please write to carbon@dotconferences.com :)\n", "\n", "All emissions are in CO2-equivalent kilograms." ] }, { "cell_type": "code", "execution_count": 25, "metadata": { "collapsed": true }, "outputs": [], "source": [ "CONFERENCE = \"dotswift-2019\" # dotjs-2018" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 1 - Transport" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "collapsed": true }, "outputs": [], "source": [ "# List of different modes of transport and their CO2e emissions per passenger per km\n", "TRANSPORTS = {\n", "\n", " # https://www.oui.sncf/aide/calcul-des-emissions-de-co2-sur-votre-trajet-en-train\n", " \"train_fr_tgv\": {\n", " \"km\": 0.0032\n", " },\n", " \"train_fr_ter\": {\n", " \"km\": 0.0292\n", " },\n", " \"train_fr_eurostar\": {\n", " \"km\": 0.0112\n", " },\n", " \"train_fr_thalys\": {\n", " \"km\": 0.0116\n", " },\n", " \"train_fr_ratp\": {\n", " \"km\": 0.0038\n", " },\n", " \"bus_fr_ouibus\": {\n", " \"km\": 0.0228\n", " },\n", " \"bus_fr_ratp\": {\n", " \"km\": 0.0947\n", " },\n", " \"car_fr\": {\n", " \"km\": 0.205\n", " },\n", " \"plane_fr_national\": {\n", " \"km\": 0.168\n", " },\n", "\n", " # https://eco-calculateur.dta.aviation-civile.gouv.fr/autres-trajets\n", " # TODO\n", "\n", " # https://assets.publishing.service.gov.uk/government/uploads/system/uploads/attachment_data/file/726911/2018_methodology_paper_FINAL_v01-00.pdf\n", " # Table 39\n", " \"plane_uk_national\": {\n", " \"km\": 0.1461\n", " },\n", " \"plane_uk_europe\": {\n", " \"km\": 0.0895\n", " },\n", " \"plane_uk_international\": {\n", " \"km\": 0.1041\n", " }\n", "}" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [], "source": [ "from geopy.geocoders import Nominatim\n", "from geopy.distance import geodesic\n", "import percache\n", "import time\n", "\n", "cache = percache.Cache(\"./geocode.cache\")\n", "geolocator = Nominatim(user_agent=\"carbon-footprint-estimator\")" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "collapsed": true }, "outputs": [], "source": [ "@cache\n", "def geocode(location):\n", " time.sleep(1) # simple rate limit\n", " return geolocator.geocode(location, addressdetails=True)\n", "\n", "def coords(location):\n", " geo = geocode(location)\n", " if not geo:\n", " return None\n", " return (geo.latitude, geo.longitude)\n", "\n", "def country(location):\n", " geo = geocode(location)\n", " if not geo:\n", " print \"*ERROR: could not geocode: %s\" % location\n", " return \"\"\n", " return geo.raw[\"address\"][\"country_code\"]\n", "\n", "def distance(p1, p2):\n", " if not p1 or not p2:\n", " return 0\n", " d = geodesic(p1, p2)\n", " return d.km\n", "\n", "def footprint_transport(location1, location2, transport=\"guess\"):\n", " km = distance(coords(location1), coords(location2))\n", " if km == 0:\n", " return 0\n", " if transport == \"guess\":\n", " transport = guess_transport(location1, location2)\n", " ghg = TRANSPORTS[transport][\"km\"] * km\n", " return ghg\n", "\n", "def guess_transport(location1, location2):\n", " # Guess the most likely form of transport, with some default assumptions\n", " # based on travel to Paris\n", " c1 = country(location1)\n", " c2 = country(location2)\n", " km = distance(coords(location1), coords(location2))\n", "\n", " if km == 0 or not c1 or not c2:\n", " return \"\"\n", "\n", " if {c1, c2} in ({\"fr\"}, {\"fr\", \"lu\"}, {\"fr\", \"ch\"}):\n", " if km > 100:\n", " return \"train_fr_tgv\"\n", " else:\n", " return \"train_fr_ter\"\n", "\n", " if {c1, c2} == {\"fr\", \"gb\"}:\n", " if \"london\" in location1.lower()+location2.lower():\n", " return \"train_fr_eurostar\"\n", " else:\n", " return \"plane_uk_europe\"\n", "\n", " if {c1, c2} in ({\"fr\", \"be\"}, {\"fr\", \"nl\"}):\n", " return \"train_fr_thalys\"\n", "\n", " # International travel\n", " if len({c1, c2}) == 2:\n", " if km < 3500:\n", " return \"plane_uk_europe\" # TODO plane_fr_europe\n", " else:\n", " return \"plane_uk_international\"\n", "\n", " raise Exception(\"%s => %s : Not supported\" % (location1, location2))" ] }, { "cell_type": "code", "execution_count": 7, "metadata": { "collapsed": true }, "outputs": [], "source": [ "from IPython.display import HTML, display\n", "import tabulate\n", "def display_table(data):\n", " display(HTML(tabulate.tabulate(data, tablefmt='html')))" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "
Versaillestrain_fr_ter 0.511848
Lille train_fr_tgv 0.652776
Metz train_fr_tgv 0.900583
Bordeaux train_fr_tgv 1.59728
Amsterdam train_fr_thalys 4.99701
London train_fr_eurostar 3.85149
Glasgow plane_uk_europe 80.4559
Berlin plane_uk_europe 78.6352
Madrid plane_uk_europe 94.2384
NYC plane_uk_international 609.028
Honolulu plane_uk_international1247.87
Sydney plane_uk_international1765.23
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "# Test transports to Paris\n", "origins = [\"Versailles\", \"Lille\", \"Metz\", \"Bordeaux\", \"Amsterdam\", \"London\", \"Glasgow\", \"Berlin\", \"Madrid\", \"NYC\", \"Honolulu\", \"Sydney\"]\n", "display_table([o, guess_transport(o, \"Paris\"), footprint_transport(o, \"Paris\")] for o in origins)" ] }, { "cell_type": "code", "execution_count": 15, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Imported 589 attendee origin cities\n", "Top countries:\n" ] }, { "data": { "text/html": [ "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "
FR418
GB 55
DE 19
NL 17
BE 13
US 12
RO 9
ES 7
SE 5
PT 4
LT 4
PL 4
BG 2
HR 2
RU 2
RS 2
LU 2
UK 2
MK 1
BY 1
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "Top cities:\n" ] }, { "data": { "text/html": [ "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "
Paris 259
London 39
PARIS 13
Boulogne Billancourt 12
Levallois-Perret 11
Lyon 10
Cluj-Napoca 7
Romainville 6
Amsterdam 6
Rotterdam 5
BOULOGNE-BILLANCOURT 5
4
Stockholm 4
Villeurbanne 3
Hasselt 3
Berlin 3
Villerbanne 3
Kaunas 3
Cranleigh 3
Bordeaux 3
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "from collections import Counter\n", "import re\n", "origins = []\n", "countries = Counter()\n", "cities = Counter()\n", "import csv\n", "\n", "FILE = \"%s-attendee-cities.csv\" % CONFERENCE\n", "\n", "# CSV file includes speakers\n", "with open(FILE, \"r\") as f:\n", " reader = csv.reader(f, delimiter=',', quotechar='\"')\n", " for row in reader:\n", " \n", " if row[1] == \"FR\" and not row[0]:\n", " row[0] = \"Paris\"\n", " row[0] = re.sub(\"\\bcedex\\b\", \"\", row[0], flags=re.I)\n", " \n", " origins.append(\"%s, %s\" % (row[0], row[1]))\n", " countries[row[1]] += 1\n", " cities[row[0]] += 1\n", "\n", "print(\"Imported %s attendee origin cities\" % len(origins))\n", "print(\"Top countries:\")\n", "display_table(countries.most_common(20))\n", "\n", "print(\"Top cities:\")\n", "display_table(cities.most_common(20))\n" ] }, { "cell_type": "code", "execution_count": 16, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "*ERROR: could not geocode: Thibaud David, FR\n", "*ERROR: could not geocode: Paris CEDEX, FR\n", "*ERROR: could not geocode: Paris CEDEX, FR\n", "*ERROR: could not geocode: Auirbeau sur Siagne, FR\n", "*ERROR: could not geocode: HRoa, NO\n", "*ERROR: could not geocode: Nognet Sur Marne, FR\n", "*ERROR: could not geocode: Fontenay-Aix Roses, FR\n" ] }, { "data": { "text/html": [ "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Antibes, FR' train_fr_tgv 2.21202
'Asni\\xc3\\xa8res-sur-Seine, FR' train_fr_ter 0.2205
'Romainville, FR' train_fr_ter 0.203255
'Romainville, FR' train_fr_ter 0.203255
'Romainville, FR' train_fr_ter 0.203255
'NANTES, FR' train_fr_tgv 1.099
'PARIS, FR' 0
'Noyal sur Vilaine, FR' train_fr_tgv 0.953833
'Paris, FR' 0
'NANTES, FR' train_fr_tgv 1.099
'Bordeaux, FR' train_fr_tgv 1.59728
'LILLE, FR' train_fr_tgv 0.652776
'LILLE, FR' train_fr_tgv 0.652776
'Rennes, FR' train_fr_tgv 0.98974
'PARIS, FR' 0
'Rennes, FR' train_fr_tgv 0.98974
'Sutton, GB' plane_uk_europe 29.6815
'Thibaud David, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Lyon, FR' train_fr_tgv 1.25509
'VOISINS-LE-BRETONNEUX, FR' train_fr_ter 0.718687
'Toulouse, FR' train_fr_tgv 1.88152
'Villate, FR' train_fr_tgv 1.93132
'Vancouver, CA' plane_uk_international827.197
'Lyon, FR' train_fr_tgv 1.25509
'Torrevieja, ES' plane_uk_europe 110.365
'Porto, PT' plane_uk_europe 108.696
'Chissay-en-Touraine, FR' train_fr_tgv 0.61388
'Draveil, FR' train_fr_ter 0.569978
'Paris, FR' 0
'Cork, IE' plane_uk_europe 75.1619
'LONDON, GB' train_fr_eurostar 3.85149
'Paris, FR' 0
'London, GB' train_fr_eurostar 3.85149
'le Rouret, FR' train_fr_tgv 2.17074
'Francheville, FR' train_fr_tgv 0.353588
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Noisy le Sec, FR' train_fr_ter 0.239956
'Barcelona, ES' plane_uk_europe 74.3474
'Lyon, FR' train_fr_tgv 1.25509
'Lyon, FR' train_fr_tgv 1.25509
'LYON, FR' train_fr_tgv 1.25509
'Lyon, FR' train_fr_tgv 1.25509
'Darmstadt, DE' plane_uk_europe 42.1702
'SAINT-DREZERY, FR' train_fr_tgv 1.86648
'Haguenau, FR' train_fr_tgv 1.27705
'Paris, FR' 0
'Paris, FR' 0
'Athens, CY' plane_uk_europe 267.626
'Fontvielle, FR' train_fr_tgv 1.52145
'Paris, FR' 0
'ST SEBASTIEN SUR LOIRE, FR' train_fr_tgv 1.09092
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Munich, DE' plane_uk_europe 61.3923
'Nottingham, GB' plane_uk_europe 46.3499
'Nottingham, GB' plane_uk_europe 46.3499
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Amsterdam, NL' train_fr_thalys 4.99701
'Paris, FR' 0
'BEYNES, FR' train_fr_tgv 1.97491
'Stuttgart, DE' plane_uk_europe 44.8739
'Stuttgart, DE' plane_uk_europe 44.8739
'Dortmund, DE' plane_uk_europe 42.0361
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Taurage, LT' plane_uk_europe 137.314
'Paris, FR' 0
'Zagreb, HR' plane_uk_europe 96.8571
'Zagreb, HR' plane_uk_europe 96.8571
'Chaville, FR' train_fr_ter 0.382808
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Bois-Colombes, FR' train_fr_ter 0.260969
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Tetovo, MK' plane_uk_europe 146.572
'PARIS, FR' 0
'Boulogne Billancourt, FR' train_fr_ter 0.24803
'Boulogne Billancourt, FR' train_fr_ter 0.24803
'Boulogne Billancourt, FR' train_fr_ter 0.24803
'Boulogne Billancourt, FR' train_fr_ter 0.24803
'Lyon, FR' train_fr_tgv 1.25509
'London, GB' train_fr_eurostar 3.85149
'Cesson Sevign\\xc3\\xa9, FR' train_fr_tgv 0.971518
'MORDELLES, FR' train_fr_tgv 1.03211
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Barcelona, ES' plane_uk_europe 74.3474
'Barcelona, ES' plane_uk_europe 74.3474
'Montrouge, FR' train_fr_ter 0.156711
'Villiers sur Marne, FR' train_fr_ter 0.417314
'vitry sur seine, FR' train_fr_ter 0.240052
'CLAMART, FR' train_fr_ter 0.263307
'Chatillon, FR' train_fr_ter 0.227174
'Madison, US' plane_uk_international696.658
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Krak\\xc3\\xb3w, PL' plane_uk_europe 114.85
'Krak\\xc3\\xb3w, PL' plane_uk_europe 114.85
'BEOGRAD, RS' plane_uk_europe 129.616
'BEOGRAD, RS' plane_uk_europe 129.616
'Amsterdam, NL' train_fr_thalys 4.99701
'Rennes, FR' train_fr_tgv 0.98974
'London, GB' train_fr_eurostar 3.85149
'London, GB' train_fr_eurostar 3.85149
'London, GB' train_fr_eurostar 3.85149
'Deerlijk, BE' train_fr_thalys 2.69282
'Gent, BE' train_fr_thalys 3.0567
'Paris, FR' 0
'Paris, FR' 0
'Karlsruhe, DE' plane_uk_europe 39.705
'Differdange, LU' train_fr_tgv 0.858323
'Differdange, LU' train_fr_tgv 0.858323
'Livry Gargan, FR' train_fr_ter 0.429897
'Paris, FR' 0
'Villerbanne, FR' train_fr_tgv 1.25739
'Villerbanne, FR' train_fr_tgv 1.25739
'Villerbanne, FR' train_fr_tgv 1.25739
'Paris CEDEX, FR' 0
'Paris CEDEX, FR' 0
'Zoetermeer, NL' train_fr_thalys 4.4947
'Hamburg, DE' plane_uk_europe 66.815
', GB' plane_uk_europe 67.7527
', GB' plane_uk_europe 67.7527
', GB' plane_uk_europe 67.7527
', GB' plane_uk_europe 67.7527
'London, GB' train_fr_eurostar 3.85149
'Kidlington, GB' plane_uk_europe 37.5438
'Antwerpen, BE' train_fr_thalys 3.49317
'Antwerpen, BE' train_fr_thalys 3.49317
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Ingelheim am Rhein, DE' plane_uk_europe 38.6641
'PARIS, FR' 0
'PARIS, FR' 0
'PARIS, FR' 0
'PARIS, FR' 0
'St.Petersburg, RU' plane_uk_europe 194.174
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Romainville, FR' train_fr_ter 0.203255
'Romainville, FR' train_fr_ter 0.203255
'Romainville, FR' train_fr_ter 0.203255
'Walldorf, DE' plane_uk_europe 41.3662
'paris, FR' 0
'paris, FR' 0
'Paris, FR' 0
'Warsaw, PL' plane_uk_europe 122.637
'Lyon, FR' train_fr_tgv 1.25509
'Levallois-Perret, FR' train_fr_ter 0.179809
'Caluire et Cuire, FR' train_fr_tgv 1.24397
'Neuville sur Saone, FR' train_fr_tgv 1.21873
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Levallois-Perret, FR' train_fr_ter 0.179809
'Kaunas, LT' plane_uk_europe 145.056
'Kaunas, LT' plane_uk_europe 145.056
'Kaunas, LT' plane_uk_europe 145.056
'Stockholm, SE' plane_uk_europe 138.407
'London, GB' train_fr_eurostar 3.85149
'Auirbeau sur Siagne, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Warsaw, PL' plane_uk_europe 122.637
'Paris, FR' 0
'BOULOGNE-BILLANCOURT, FR' train_fr_ter 0.24803
'BOULOGNE-BILLANCOURT, FR' train_fr_ter 0.24803
'BOULOGNE-BILLANCOURT, FR' train_fr_ter 0.24803
'BOULOGNE-BILLANCOURT, FR' train_fr_ter 0.24803
'BOULOGNE-BILLANCOURT, FR' train_fr_ter 0.24803
'Saint Mars la Briere, FR' train_fr_tgv 0.553288
'Issy-Les-Moulineaux, FR' train_fr_ter 0.196173
'Issy-Les-Moulineaux, FR' train_fr_ter 0.196173
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'le Kremlin Bicetre, FR' train_fr_ter 0.143432
'le Kremlin Bicetre, FR' train_fr_ter 0.143432
'Chaumont en Vexin, FR' train_fr_ter 1.65564
'London, GB' train_fr_eurostar 3.85149
'London, GB' train_fr_eurostar 3.85149
'Lvovskiy, RU' plane_uk_europe 242.774
'London, GB' train_fr_eurostar 3.85149
'Niort, FR' train_fr_tgv 1.12736
'Paris, FR' 0
'Waddinxveen, NL' train_fr_thalys 4.52481
'PARIS, FR' 0
'PARIS, FR' 0
'Brugge, BE' train_fr_thalys 3.12054
'Cluj-Napoca, RO' plane_uk_europe 143.389
'Cluj-Napoca, RO' plane_uk_europe 143.389
'Cluj-Napoca, RO' plane_uk_europe 143.389
'Cluj-Napoca, RO' plane_uk_europe 143.389
'Cluj-Napoca, RO' plane_uk_europe 143.389
'Cluj-Napoca, RO' plane_uk_europe 143.389
'Cluj-Napoca, RO' plane_uk_europe 143.389
'Lyon, FR' train_fr_tgv 1.25509
'Lisboa, PT' plane_uk_europe 130.22
'Lisboa, PT' plane_uk_europe 130.22
'London, GB' train_fr_eurostar 3.85149
'London, GB' train_fr_eurostar 3.85149
'London, GB' train_fr_eurostar 3.85149
'Cascais, PT' plane_uk_europe 131.287
'London, GB' train_fr_eurostar 3.85149
'Aachen, DE' plane_uk_europe 30.7045
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'London, GB' train_fr_eurostar 3.85149
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Toulouse, FR' train_fr_tgv 1.88152
'London, GB' train_fr_eurostar 3.85149
'London, GB' train_fr_eurostar 3.85149
'BARCELONA, ES' plane_uk_europe 74.3474
'Levallois-Perret, FR' train_fr_ter 0.179809
'Levallois-Perret, FR' train_fr_ter 0.179809
'Levallois-Perret, FR' train_fr_ter 0.179809
'Kyiv, UA' plane_uk_europe 181.662
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'CASTRIES, FR' train_fr_tgv 1.8856
'Madrid, ES' plane_uk_europe 94.2384
'Madrid, ES' plane_uk_europe 94.2384
'Berlin, DE' plane_uk_europe 78.6352
'PARIS, FR' 0
'LIDING\\xc3\\x96, SE' plane_uk_europe 138.904
'London, GB' train_fr_eurostar 3.85149
'Seeheim-Jugenheim, DE' plane_uk_europe 41.9049
'Amsterdam, NL' train_fr_thalys 4.99701
'Utrecht, NL' train_fr_thalys 4.74653
'Utrecht, NL' train_fr_thalys 4.74653
'Amsterdam, NL' train_fr_thalys 4.99701
'Amsterdam, NL' train_fr_thalys 4.99701
'Paris, FR' 0
'Paris, FR' 0
'Aachen, DE' plane_uk_europe 30.7045
'HRoa, NO' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Chatou, FR' train_fr_ter 0.429495
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Bordeaux, FR' train_fr_tgv 1.59728
'Bordeaux, FR' train_fr_tgv 1.59728
'Saint Gilles, BE' train_fr_thalys 3.03782
'Brussels, BE' train_fr_thalys 3.0618
'CESSON SEVIGNE, FR' train_fr_tgv 0.971518
'Montferrier sur Lez, FR' train_fr_tgv 1.88321
'D\\xc3\\xbcren, DE' plane_uk_europe 32.9002
'Deerlijk, BE' train_fr_thalys 2.69282
'Boulogne-Billancourt, FR' train_fr_ter 0.24803
'K\\xc3\\xb6ln, DE' plane_uk_europe 36.1507
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Milano, IT' plane_uk_europe 57.3372
'Boulogne Billancourt, FR' train_fr_ter 0.24803
'Boulogne Billancourt, FR' train_fr_ter 0.24803
'Velizy, FR' train_fr_ter 0.47148
'Seoul, KR' plane_uk_international935.703
'PARIS, FR' 0
'Rotterdam, NL' train_fr_thalys 4.33682
'Didcot, GB' plane_uk_europe 35.7265
'75010, FR' train_fr_ter 0.0691554
'ISSY LES MOULINEAUX, FR' train_fr_ter 0.196173
'Ris-Orangis, FR' train_fr_ter 0.672337
'Paris, FR' 0
'Paris, FR' 0
'Toledo, US' plane_uk_international668.282
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Hamburg, DE' plane_uk_europe 66.815
'Vienna, AT' plane_uk_europe 92.7702
'Hasselt, BE' train_fr_thalys 3.65381
'Hasselt, BE' train_fr_thalys 3.65381
'Hasselt, BE' train_fr_thalys 3.65381
'Clichy, FR' train_fr_ter 0.178898
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Nognet Sur Marne, FR' 0
'London, GB' train_fr_eurostar 3.85149
'London, GB' train_fr_eurostar 3.85149
'London, GB' train_fr_eurostar 3.85149
'London, GB' train_fr_eurostar 3.85149
'London, GB' train_fr_eurostar 3.85149
'London, GB' train_fr_eurostar 3.85149
'London, GB' train_fr_eurostar 3.85149
'London, GB' train_fr_eurostar 3.85149
'London, GB' train_fr_eurostar 3.85149
'London, GB' train_fr_eurostar 3.85149
'London, GB' train_fr_eurostar 3.85149
'London, GB' train_fr_eurostar 3.85149
'London, GB' train_fr_eurostar 3.85149
'London, GB' train_fr_eurostar 3.85149
'PALAISEAU, FR' train_fr_ter 0.5147
'PALAISEAU, FR' train_fr_ter 0.5147
'75020, FR' train_fr_ter 0.123772
'London, GB' train_fr_eurostar 3.85149
'New Rochelle, US' plane_uk_international606.346
'Paris, FR' 0
'Paris, FR' 0
'Chissay en Touraine, FR' train_fr_tgv 0.61388
'PARIS, FR' 0
'Paris, FR' 0
'Levallois-Perret, FR' train_fr_ter 0.179809
'Levallois-Perret, FR' train_fr_ter 0.179809
'Levallois-Perret, FR' train_fr_ter 0.179809
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Sharnbrook, GB' plane_uk_europe 38.2435
'Sofia, BG' plane_uk_europe 157.648
'Paris, FR' 0
'Manchester, GB' plane_uk_europe 54.2581
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Lab\\xc3\\xa8ge, FR' train_fr_tgv 1.90571
'Lab\\xc3\\xa8ge, FR' train_fr_tgv 1.90571
'Toulouse, FR' train_fr_tgv 1.88152
'London, GB' train_fr_eurostar 3.85149
'Levallois-Perret, FR' train_fr_ter 0.179809
'Levallois-Perret, FR' train_fr_ter 0.179809
'Levallois-Perret, FR' train_fr_ter 0.179809
'Lannion, FR' train_fr_tgv 1.36645
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Chatillon, FR' train_fr_ter 0.227174
'Herentals, BE' train_fr_thalys 3.64518
'Bucuresti, RO' plane_uk_europe 167.807
'Bucuresti, RO' plane_uk_europe 167.807
'Villeurbanne, FR' train_fr_tgv 1.25663
'Villeurbanne, FR' train_fr_tgv 1.25663
'Villeurbanne, FR' train_fr_tgv 1.25663
'75009 - PARIS 09, FR' train_fr_ter 0.0545581
'75009 - PARIS 09, FR' train_fr_ter 0.0545581
'Paris, FR' 0
'Paris, FR' 0
'Heino, NL' train_fr_thalys 5.62241
'Amsterdam, NL' train_fr_thalys 4.99701
'Paris, FR' 0
'Paris, FR' 0
'Berlin, DE' plane_uk_europe 78.6352
'Berlin, DE' plane_uk_europe 78.6352
'Minsk, BY' plane_uk_europe 163.915
'Rotterdam, NL' train_fr_thalys 4.33682
'Rotterdam, NL' train_fr_thalys 4.33682
'Rotterdam, NL' train_fr_thalys 4.33682
'Dortmund, DE' plane_uk_europe 42.0361
'Antony, FR' train_fr_ter 0.35523
'Hergenrath, BE' train_fr_thalys 3.89345
'Boulogne Billancourt, FR' train_fr_ter 0.24803
'Paris, FR' 0
'Bussy St Georges, FR' train_fr_ter 0.742557
'Paris, FR' 0
'Amstelveen, NL' train_fr_thalys 4.87877
'Sofia, BG' plane_uk_europe 157.648
'Paris, FR' 0
'LOOS, FR' train_fr_tgv 0.642346
'LOOS, FR' train_fr_tgv 0.642346
'Paris-la-D\\xc3\\xa9fense, FR' train_fr_ter 0.259118
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'San Francisco, US' plane_uk_international934.373
'75008, FR' train_fr_ter 0.0993955
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Stockholm, SE' plane_uk_europe 138.407
'Stockholm, SE' plane_uk_europe 138.407
'Stockholm, SE' plane_uk_europe 138.407
'flushing, US' plane_uk_international660.541
'Lyon, FR' train_fr_tgv 1.25509
'Lyon, FR' train_fr_tgv 1.25509
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Fontenay-Aix Roses, FR' 0
'Vernouillet, FR' train_fr_ter 0.873694
'Vernouillet, FR' train_fr_ter 0.873694
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'London, GB' train_fr_eurostar 3.85149
'Guildford, GB' plane_uk_europe 30.1674
'Boulogne Billancourt, FR' train_fr_ter 0.24803
'Boulogne Billancourt, FR' train_fr_ter 0.24803
'Woking, GB' plane_uk_europe 30.7908
'Woking, GB' plane_uk_europe 30.7908
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Puteaux, FR' train_fr_ter 0.261301
'Puteaux, FR' train_fr_ter 0.261301
'London, GB' train_fr_eurostar 3.85149
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Cleveland, US' plane_uk_international657.208
'London, UK' train_fr_eurostar 3.85149
'Boston, US' plane_uk_international577.384
'Pittsburg, US' plane_uk_international653.137
'Chicago, US' plane_uk_international694.214
'San Jose, US' plane_uk_international935.978
'NYC, US' plane_uk_international609.028
'Cupertino, US' plane_uk_international936.826
'London, UK' train_fr_eurostar 3.85149
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Paris, FR' 0
'Antony, FR' train_fr_ter 0.35523
'Paris, FR' 0
'Cranleigh, GB' plane_uk_europe 29.1091
'Cranleigh, GB' plane_uk_europe 29.1091
'Paris, FR' 0
'Cranleigh, GB' plane_uk_europe 29.1091
'Levallois, FR' train_fr_ter 0.179809
'Boulogne Billancourt, FR' train_fr_ter 0.24803
'Boulogne Billancourt, FR' train_fr_ter 0.24803
'Boulogne Billancourt, FR' train_fr_ter 0.24803
'London, GB' train_fr_eurostar 3.85149
'Chamb\\xc3\\xa9ry, FR' train_fr_tgv 1.45522
'PARIS, FR' 0
'Courbevoie, FR' train_fr_ter 0.239817
'Marigny L\\xe2\\x80\\x99\\xc3\\x89glise, FR'train_fr_tgv 0.654361
'Montreuil, FR' train_fr_tgv 0.587976
'Paris, FR' 0
'TASSIN-LA-DEMI-LUNE, FR' train_fr_tgv 1.24687
'Neuilly sur seine, FR' train_fr_ter 0.197775
'Boulogne Billancourt, FR' train_fr_ter 0.24803
'Boulogne Billancourt, FR' train_fr_ter 0.24803
'Rotterdam, NL' train_fr_thalys 4.33682
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "display_table([repr(o), guess_transport(o, \"Paris\"), footprint_transport(o, \"Paris\")] for o in origins)" ] }, { "cell_type": "code", "execution_count": 17, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "*ERROR: could not geocode: Thibaud David, FR\n", "*ERROR: could not geocode: Paris CEDEX, FR\n", "*ERROR: could not geocode: Paris CEDEX, FR\n", "*ERROR: could not geocode: Auirbeau sur Siagne, FR\n", "*ERROR: could not geocode: HRoa, NO\n", "*ERROR: could not geocode: Nognet Sur Marne, FR\n", "*ERROR: could not geocode: Fontenay-Aix Roses, FR\n", "Total km: 441935.359549\n", "Total CO2e kg footprint: 34754.8830268\n", "Average km/attendee 750.31470212\n", "Average CO2e kg/attendee: 59.0065925752\n", "Total CO2e by transport:\n", " plane_uk_europe: 16086.9525631\n", " train_fr_eurostar: 308.119544801\n", " train_fr_tgv: 155.696439877\n", " train_fr_ter: 45.6523108679\n", " train_fr_thalys: 247.65769123\n", " plane_uk_international: 20785.748845\n" ] } ], "source": [ "from collections import defaultdict\n", "\n", "total_footprint_transport_attendees = sum([\n", " footprint_transport(o, \"Paris\") * 2 # *2 for return trip\n", " for o in origins\n", "])\n", "total_footprint_by_transport = defaultdict(float)\n", "for o in origins:\n", " t = guess_transport(o, \"Paris\")\n", " if t:\n", " total_footprint_by_transport[t] += footprint_transport(o, \"Paris\") * 2\n", " \n", "total_distance = sum([\n", " distance(coords(o), coords(\"Paris\")) * 2\n", " for o in origins\n", "])\n", "\n", "no_show = 45.0 / len(origins)\n", "\n", "total_distance *= (1-no_show)\n", "total_footprint_transport_attendees *= (1-no_show)\n", "\n", "print \"Total km:\", total_distance\n", "print \"Total CO2e kg footprint:\", total_footprint_transport_attendees\n", "print \"Average km/attendee\", total_distance / len(origins)\n", "print \"Average CO2e kg/attendee:\", total_footprint_transport_attendees / len(origins)\n", "print \"Total CO2e by transport:\"\n", "for k, v in total_footprint_by_transport.items():\n", " print \" %s: %s\" % (k, v)" ] }, { "cell_type": "code", "execution_count": 18, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "
\n", " \n", " Loading BokehJS ...\n", "
" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "\n", "(function(root) {\n", " function now() {\n", " return new Date();\n", " }\n", "\n", " var force = true;\n", "\n", " if (typeof (root._bokeh_onload_callbacks) === \"undefined\" || force === true) {\n", " root._bokeh_onload_callbacks = [];\n", " root._bokeh_is_loading = undefined;\n", " }\n", "\n", " var JS_MIME_TYPE = 'application/javascript';\n", " var HTML_MIME_TYPE = 'text/html';\n", " var EXEC_MIME_TYPE = 'application/vnd.bokehjs_exec.v0+json';\n", " var CLASS_NAME = 'output_bokeh rendered_html';\n", "\n", " /**\n", " * Render data to the DOM node\n", " */\n", " function render(props, node) {\n", " var script = document.createElement(\"script\");\n", " node.appendChild(script);\n", " }\n", "\n", " /**\n", " * Handle when an output is cleared or removed\n", " */\n", " function handleClearOutput(event, handle) {\n", " var cell = handle.cell;\n", "\n", " var id = cell.output_area._bokeh_element_id;\n", " var server_id = cell.output_area._bokeh_server_id;\n", " // Clean up Bokeh references\n", " if (id != null && id in Bokeh.index) {\n", " Bokeh.index[id].model.document.clear();\n", " delete Bokeh.index[id];\n", " }\n", "\n", " if (server_id !== undefined) {\n", " // Clean up Bokeh references\n", " var cmd = \"from bokeh.io.state import curstate; print(curstate().uuid_to_server['\" + server_id + \"'].get_sessions()[0].document.roots[0]._id)\";\n", " cell.notebook.kernel.execute(cmd, {\n", " iopub: {\n", " output: function(msg) {\n", " var id = msg.content.text.trim();\n", " if (id in Bokeh.index) {\n", " Bokeh.index[id].model.document.clear();\n", " delete Bokeh.index[id];\n", " }\n", " }\n", " }\n", " });\n", " // Destroy server and session\n", " var cmd = \"import bokeh.io.notebook as ion; ion.destroy_server('\" + server_id + \"')\";\n", " cell.notebook.kernel.execute(cmd);\n", " }\n", " }\n", "\n", " /**\n", " * Handle when a new output is added\n", " */\n", " function handleAddOutput(event, handle) {\n", " var output_area = handle.output_area;\n", " var output = handle.output;\n", "\n", " // limit handleAddOutput to display_data with EXEC_MIME_TYPE content only\n", " if ((output.output_type != \"display_data\") || (!output.data.hasOwnProperty(EXEC_MIME_TYPE))) {\n", " return\n", " }\n", "\n", " var toinsert = output_area.element.find(\".\" + CLASS_NAME.split(' ')[0]);\n", "\n", " if (output.metadata[EXEC_MIME_TYPE][\"id\"] !== undefined) {\n", " toinsert[toinsert.length - 1].firstChild.textContent = output.data[JS_MIME_TYPE];\n", " // store reference to embed id on output_area\n", " output_area._bokeh_element_id = output.metadata[EXEC_MIME_TYPE][\"id\"];\n", " }\n", " if (output.metadata[EXEC_MIME_TYPE][\"server_id\"] !== undefined) {\n", " var bk_div = document.createElement(\"div\");\n", " bk_div.innerHTML = output.data[HTML_MIME_TYPE];\n", " var script_attrs = bk_div.children[0].attributes;\n", " for (var i = 0; i < script_attrs.length; i++) {\n", " toinsert[toinsert.length - 1].firstChild.setAttribute(script_attrs[i].name, script_attrs[i].value);\n", " }\n", " // store reference to server id on output_area\n", " output_area._bokeh_server_id = output.metadata[EXEC_MIME_TYPE][\"server_id\"];\n", " }\n", " }\n", "\n", " function register_renderer(events, OutputArea) {\n", "\n", " function append_mime(data, metadata, element) {\n", " // create a DOM node to render to\n", " var toinsert = this.create_output_subarea(\n", " metadata,\n", " CLASS_NAME,\n", " EXEC_MIME_TYPE\n", " );\n", " this.keyboard_manager.register_events(toinsert);\n", " // Render to node\n", " var props = {data: data, metadata: metadata[EXEC_MIME_TYPE]};\n", " render(props, toinsert[toinsert.length - 1]);\n", " element.append(toinsert);\n", " return toinsert\n", " }\n", "\n", " /* Handle when an output is cleared or removed */\n", " events.on('clear_output.CodeCell', handleClearOutput);\n", " events.on('delete.Cell', handleClearOutput);\n", "\n", " /* Handle when a new output is added */\n", " events.on('output_added.OutputArea', handleAddOutput);\n", "\n", " /**\n", " * Register the mime type and append_mime function with output_area\n", " */\n", " OutputArea.prototype.register_mime_type(EXEC_MIME_TYPE, append_mime, {\n", " /* Is output safe? */\n", " safe: true,\n", " /* Index of renderer in `output_area.display_order` */\n", " index: 0\n", " });\n", " }\n", "\n", " // register the mime type if in Jupyter Notebook environment and previously unregistered\n", " if (root.Jupyter !== undefined) {\n", " var events = require('base/js/events');\n", " var OutputArea = require('notebook/js/outputarea').OutputArea;\n", "\n", " if (OutputArea.prototype.mime_types().indexOf(EXEC_MIME_TYPE) == -1) {\n", " register_renderer(events, OutputArea);\n", " }\n", " }\n", "\n", " \n", " if (typeof (root._bokeh_timeout) === \"undefined\" || force === true) {\n", " root._bokeh_timeout = Date.now() + 5000;\n", " root._bokeh_failed_load = false;\n", " }\n", "\n", " var NB_LOAD_WARNING = {'data': {'text/html':\n", " \"
\\n\"+\n", " \"

\\n\"+\n", " \"BokehJS does not appear to have successfully loaded. If loading BokehJS from CDN, this \\n\"+\n", " \"may be due to a slow or bad network connection. Possible fixes:\\n\"+\n", " \"

\\n\"+\n", " \"
    \\n\"+\n", " \"
  • re-rerun `output_notebook()` to attempt to load from CDN again, or
  • \\n\"+\n", " \"
  • use INLINE resources instead, as so:
  • \\n\"+\n", " \"
\\n\"+\n", " \"\\n\"+\n", " \"from bokeh.resources import INLINE\\n\"+\n", " \"output_notebook(resources=INLINE)\\n\"+\n", " \"\\n\"+\n", " \"
\"}};\n", "\n", " function display_loaded() {\n", " var el = document.getElementById(\"1002\");\n", " if (el != null) {\n", " el.textContent = \"BokehJS is loading...\";\n", " }\n", " if (root.Bokeh !== undefined) {\n", " if (el != null) {\n", " el.textContent = \"BokehJS \" + root.Bokeh.version + \" successfully loaded.\";\n", " }\n", " } else if (Date.now() < root._bokeh_timeout) {\n", " setTimeout(display_loaded, 100)\n", " }\n", " }\n", "\n", "\n", " function run_callbacks() {\n", " try {\n", " root._bokeh_onload_callbacks.forEach(function(callback) { callback() });\n", " }\n", " finally {\n", " delete root._bokeh_onload_callbacks\n", " }\n", " console.info(\"Bokeh: all callbacks have finished\");\n", " }\n", "\n", " function load_libs(js_urls, callback) {\n", " root._bokeh_onload_callbacks.push(callback);\n", " if (root._bokeh_is_loading > 0) {\n", " console.log(\"Bokeh: BokehJS is being loaded, scheduling callback at\", now());\n", " return null;\n", " }\n", " if (js_urls == null || js_urls.length === 0) {\n", " run_callbacks();\n", " return null;\n", " }\n", " console.log(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n", " root._bokeh_is_loading = js_urls.length;\n", " for (var i = 0; i < js_urls.length; i++) {\n", " var url = js_urls[i];\n", " var s = document.createElement('script');\n", " s.src = url;\n", " s.async = false;\n", " s.onreadystatechange = s.onload = function() {\n", " root._bokeh_is_loading--;\n", " if (root._bokeh_is_loading === 0) {\n", " console.log(\"Bokeh: all BokehJS libraries loaded\");\n", " run_callbacks()\n", " }\n", " };\n", " s.onerror = function() {\n", " console.warn(\"failed to load library \" + url);\n", " };\n", " console.log(\"Bokeh: injecting script tag for BokehJS library: \", url);\n", " document.getElementsByTagName(\"head\")[0].appendChild(s);\n", " }\n", " };var element = document.getElementById(\"1002\");\n", " if (element == null) {\n", " console.log(\"Bokeh: ERROR: autoload.js configured with elementid '1002' but no matching script tag was found. \")\n", " return false;\n", " }\n", "\n", " var js_urls = [\"https://cdn.pydata.org/bokeh/release/bokeh-1.0.1.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-widgets-1.0.1.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-tables-1.0.1.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-gl-1.0.1.min.js\"];\n", "\n", " var inline_js = [\n", " function(Bokeh) {\n", " Bokeh.set_log_level(\"info\");\n", " },\n", " \n", " function(Bokeh) {\n", " \n", " },\n", " function(Bokeh) {\n", " console.log(\"Bokeh: injecting CSS: https://cdn.pydata.org/bokeh/release/bokeh-1.0.1.min.css\");\n", " Bokeh.embed.inject_css(\"https://cdn.pydata.org/bokeh/release/bokeh-1.0.1.min.css\");\n", " console.log(\"Bokeh: injecting CSS: https://cdn.pydata.org/bokeh/release/bokeh-widgets-1.0.1.min.css\");\n", " Bokeh.embed.inject_css(\"https://cdn.pydata.org/bokeh/release/bokeh-widgets-1.0.1.min.css\");\n", " console.log(\"Bokeh: injecting CSS: https://cdn.pydata.org/bokeh/release/bokeh-tables-1.0.1.min.css\");\n", " Bokeh.embed.inject_css(\"https://cdn.pydata.org/bokeh/release/bokeh-tables-1.0.1.min.css\");\n", " }\n", " ];\n", "\n", " function run_inline_js() {\n", " \n", " if ((root.Bokeh !== undefined) || (force === true)) {\n", " for (var i = 0; i < inline_js.length; i++) {\n", " inline_js[i].call(root, root.Bokeh);\n", " }if (force === true) {\n", " display_loaded();\n", " }} else if (Date.now() < root._bokeh_timeout) {\n", " setTimeout(run_inline_js, 100);\n", " } else if (!root._bokeh_failed_load) {\n", " console.log(\"Bokeh: BokehJS failed to load within specified timeout.\");\n", " root._bokeh_failed_load = true;\n", " } else if (force !== true) {\n", " var cell = $(document.getElementById(\"1002\")).parents('.cell').data().cell;\n", " cell.output_area.append_execute_result(NB_LOAD_WARNING)\n", " }\n", "\n", " }\n", "\n", " if (root._bokeh_is_loading === 0) {\n", " console.log(\"Bokeh: BokehJS loaded, going straight to plotting\");\n", " run_inline_js();\n", " } else {\n", " load_libs(js_urls, function() {\n", " console.log(\"Bokeh: BokehJS plotting callback run at\", now());\n", " run_inline_js();\n", " });\n", " }\n", "}(window));" ], "application/vnd.bokehjs_load.v0+json": "\n(function(root) {\n function now() {\n return new Date();\n }\n\n var force = true;\n\n if (typeof (root._bokeh_onload_callbacks) === \"undefined\" || force === true) {\n root._bokeh_onload_callbacks = [];\n root._bokeh_is_loading = undefined;\n }\n\n \n\n \n if (typeof (root._bokeh_timeout) === \"undefined\" || force === true) {\n root._bokeh_timeout = Date.now() + 5000;\n root._bokeh_failed_load = false;\n }\n\n var NB_LOAD_WARNING = {'data': {'text/html':\n \"
\\n\"+\n \"

\\n\"+\n \"BokehJS does not appear to have successfully loaded. If loading BokehJS from CDN, this \\n\"+\n \"may be due to a slow or bad network connection. Possible fixes:\\n\"+\n \"

\\n\"+\n \"
    \\n\"+\n \"
  • re-rerun `output_notebook()` to attempt to load from CDN again, or
  • \\n\"+\n \"
  • use INLINE resources instead, as so:
  • \\n\"+\n \"
\\n\"+\n \"\\n\"+\n \"from bokeh.resources import INLINE\\n\"+\n \"output_notebook(resources=INLINE)\\n\"+\n \"\\n\"+\n \"
\"}};\n\n function display_loaded() {\n var el = document.getElementById(\"1002\");\n if (el != null) {\n el.textContent = \"BokehJS is loading...\";\n }\n if (root.Bokeh !== undefined) {\n if (el != null) {\n el.textContent = \"BokehJS \" + root.Bokeh.version + \" successfully loaded.\";\n }\n } else if (Date.now() < root._bokeh_timeout) {\n setTimeout(display_loaded, 100)\n }\n }\n\n\n function run_callbacks() {\n try {\n root._bokeh_onload_callbacks.forEach(function(callback) { callback() });\n }\n finally {\n delete root._bokeh_onload_callbacks\n }\n console.info(\"Bokeh: all callbacks have finished\");\n }\n\n function load_libs(js_urls, callback) {\n root._bokeh_onload_callbacks.push(callback);\n if (root._bokeh_is_loading > 0) {\n console.log(\"Bokeh: BokehJS is being loaded, scheduling callback at\", now());\n return null;\n }\n if (js_urls == null || js_urls.length === 0) {\n run_callbacks();\n return null;\n }\n console.log(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n root._bokeh_is_loading = js_urls.length;\n for (var i = 0; i < js_urls.length; i++) {\n var url = js_urls[i];\n var s = document.createElement('script');\n s.src = url;\n s.async = false;\n s.onreadystatechange = s.onload = function() {\n root._bokeh_is_loading--;\n if (root._bokeh_is_loading === 0) {\n console.log(\"Bokeh: all BokehJS libraries loaded\");\n run_callbacks()\n }\n };\n s.onerror = function() {\n console.warn(\"failed to load library \" + url);\n };\n console.log(\"Bokeh: injecting script tag for BokehJS library: \", url);\n document.getElementsByTagName(\"head\")[0].appendChild(s);\n }\n };var element = document.getElementById(\"1002\");\n if (element == null) {\n console.log(\"Bokeh: ERROR: autoload.js configured with elementid '1002' but no matching script tag was found. \")\n return false;\n }\n\n var js_urls = [\"https://cdn.pydata.org/bokeh/release/bokeh-1.0.1.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-widgets-1.0.1.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-tables-1.0.1.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-gl-1.0.1.min.js\"];\n\n var inline_js = [\n function(Bokeh) {\n Bokeh.set_log_level(\"info\");\n },\n \n function(Bokeh) {\n \n },\n function(Bokeh) {\n console.log(\"Bokeh: injecting CSS: https://cdn.pydata.org/bokeh/release/bokeh-1.0.1.min.css\");\n Bokeh.embed.inject_css(\"https://cdn.pydata.org/bokeh/release/bokeh-1.0.1.min.css\");\n console.log(\"Bokeh: injecting CSS: https://cdn.pydata.org/bokeh/release/bokeh-widgets-1.0.1.min.css\");\n Bokeh.embed.inject_css(\"https://cdn.pydata.org/bokeh/release/bokeh-widgets-1.0.1.min.css\");\n console.log(\"Bokeh: injecting CSS: https://cdn.pydata.org/bokeh/release/bokeh-tables-1.0.1.min.css\");\n Bokeh.embed.inject_css(\"https://cdn.pydata.org/bokeh/release/bokeh-tables-1.0.1.min.css\");\n }\n ];\n\n function run_inline_js() {\n \n if ((root.Bokeh !== undefined) || (force === true)) {\n for (var i = 0; i < inline_js.length; i++) {\n inline_js[i].call(root, root.Bokeh);\n }if (force === true) {\n display_loaded();\n }} else if (Date.now() < root._bokeh_timeout) {\n setTimeout(run_inline_js, 100);\n } else if (!root._bokeh_failed_load) {\n console.log(\"Bokeh: BokehJS failed to load within specified timeout.\");\n root._bokeh_failed_load = true;\n } else if (force !== true) {\n var cell = $(document.getElementById(\"1002\")).parents('.cell').data().cell;\n cell.output_area.append_execute_result(NB_LOAD_WARNING)\n }\n\n }\n\n if (root._bokeh_is_loading === 0) {\n console.log(\"Bokeh: BokehJS loaded, going straight to plotting\");\n run_inline_js();\n } else {\n load_libs(js_urls, function() {\n console.log(\"Bokeh: BokehJS plotting callback run at\", now());\n run_inline_js();\n });\n }\n}(window));" }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "\n", "\n", "\n", "\n", "\n", "\n", "
\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "(function(root) {\n", " function embed_document(root) {\n", " \n", " var docs_json = {\"9232430c-00d2-4804-ad4c-0ac10df23340\":{\"roots\":{\"references\":[{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"size\":{\"field\":\"size\",\"units\":\"screen\"},\"x\":{\"field\":\"lon\"},\"y\":{\"field\":\"lat\"}},\"id\":\"1050\",\"type\":\"Circle\"},{\"attributes\":{\"data_source\":{\"id\":\"1047\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"1049\",\"type\":\"Circle\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1050\",\"type\":\"Circle\"},\"selection_glyph\":null,\"view\":{\"id\":\"1052\",\"type\":\"CDSView\"}},\"id\":\"1051\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"source\":{\"id\":\"1047\",\"type\":\"ColumnDataSource\"}},\"id\":\"1052\",\"type\":\"CDSView\"},{\"attributes\":{\"plot\":null,\"text\":\"\"},\"id\":\"1054\",\"type\":\"Title\"},{\"attributes\":{},\"id\":\"1059\",\"type\":\"Selection\"},{\"attributes\":{\"dimension\":\"lon\"},\"id\":\"1013\",\"type\":\"MercatorTicker\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"plot\":null,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"1038\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"overlay\":{\"id\":\"1038\",\"type\":\"BoxAnnotation\"}},\"id\":\"1032\",\"type\":\"BoxZoomTool\"},{\"attributes\":{},\"id\":\"1033\",\"type\":\"SaveTool\"},{\"attributes\":{},\"id\":\"1030\",\"type\":\"PanTool\"},{\"attributes\":{},\"id\":\"1031\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"1030\",\"type\":\"PanTool\"},{\"id\":\"1031\",\"type\":\"WheelZoomTool\"},{\"id\":\"1032\",\"type\":\"BoxZoomTool\"},{\"id\":\"1033\",\"type\":\"SaveTool\"},{\"id\":\"1034\",\"type\":\"ResetTool\"},{\"id\":\"1035\",\"type\":\"HelpTool\"}]},\"id\":\"1036\",\"type\":\"Toolbar\"},{\"attributes\":{},\"id\":\"1034\",\"type\":\"ResetTool\"},{\"attributes\":{},\"id\":\"1035\",\"type\":\"HelpTool\"},{\"attributes\":{},\"id\":\"1010\",\"type\":\"LinearScale\"},{\"attributes\":{\"dimension\":\"lon\"},\"id\":\"1015\",\"type\":\"MercatorTickFormatter\"},{\"attributes\":{\"callback\":null,\"data\":{\"color\":[\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\",\"blue\"],\"lat\":[6250566.058387328,6711528.507310883,6247023.028469452,6256717.746469357,5741623.273341704,5904504.887796117,6868132.533213504,6255420.855374339,6787080.929523039,8250991.480498332,7304312.167817082,5068983.531590666,6608986.829942168,5744573.320402273,6894157.660591816,6645310.286303089,6245228.1433151,5744096.189183348,7342136.513636763,5596560.14987214,5404434.445070757,6125397.65558454,6660499.058549562,6556193.450036304,6454403.819557181,6842169.357607037,4926682.735486275,6126805.126067943,6243121.340802804,6581827.746904905,4679895.405438774,5997209.584479427,6270189.791326281,6592826.038772372,5392884.244517042,6712763.638756483,6678128.098218731,6253212.185813283,6226549.1654193,5266096.066103294,5977834.516357591,6237352.010318624,6814775.806630632,6255227.258066088,5533186.02091626,6240955.539612582,7085452.058364173,6974385.803922438,6363704.792462494,5750461.081374191,6233147.6520372955,6552456.140772077,5592885.343231742,4486071.583106649,6256167.2181554055,6808147.3387864595,6257120.185069738,6259704.795380127,6253855.3934884155,5215097.34950119,8386109.858655772,6319242.465299898,6260421.638720954,5415732.574265395,8259564.658643049,5760589.204075308,6663015.75382023,5741946.359573029,6129695.090390114,6000211.1979917595,6234010.562352629,6243427.434134532,6811395.977043195,6524594.462785045,6586550.068162402,6768267.846967777,6216334.065758224,4484210.039912254,6729140.913278009,4160643.2407886907,5112967.445386269,6255317.115377749,6527004.717359812,6441994.989805688,6256179.187989854,5162472.973768493,6658267.504591581,5383632.9134859275,4548292.343730622,5087140.819053366,6590703.2283005975,5321578.718196322,6570002.206260343,5747877.024595145,6684778.668220834,6841070.499383747,5413980.263046329,7151681.178182635,5415177.589209561,5142357.36288071,4576257.083266782,5464021.698011181,6238898.104135768,4518391.6628727615,6254096.387427293,6256296.745530651,6424271.795756613,6326570.283942462,6237907.196445192,7072187.663046757,5323358.165362713,6241055.656230105,6229545.98647286,6260846.495428912,6630820.90788647,6405182.094593976,4999302.370613497,6245423.389097842,6276027.254524554,6248267.991398281,6594196.236452866,6852043.658319197,4681985.437211557,6119063.082521352,6141587.728347871,6239016.934332682,6250653.387552831,6258350.782482607,6111868.641465672,5622015.671035698,5401227.831720856,5034410.73661706,5711113.592039375,6242462.467068897,6125854.52624968,6781690.563766543,7411194.890934023,4972724.540162889,6654181.480768274,6880818.964536441,5975354.415339375,6319531.730105084,5832414.556762211,4930337.2000554195,5695310.950543289,6221606.054874108,5423974.159363213,6243904.777195247,6610397.731303634,5662844.0210950775],\"lon\":[261767.6935447902,-14209.643569085307,249378.59119203623,254717.73000531044,537897.0485552929,2626033.5115105673,545240.1392033203,271155.64468965563,499671.2566966717,2011664.926497636,-364746.6939418176,242390.64374087742,594201.6566301461,545604.6542505322,1490441.0663704798,-54737.66745642165,253080.07558040335,544010.9932883865,2661034.7305211267,-64569.356689563545,160772.8294877639,-187018.9486586173,489773.2653310411,341822.2370567447,2226062.9553779336,2338458.097213566,-412280.91801087913,-178543.4277200389,262380.35149432,677252.4198965469,-1017080.7578939479,126079.34207755371,220753.4854473379,374287.18873567856,170315.71509991543,831031.0457777694,-61946.246472409,260730.88327998217,249955.02577926198,2596213.0793376295,-173005.65040739317,1021914.3948995298,570810.761671962,249009.0438784498,2905741.5209832964,254889.6184310443,1113267.7108797147,-127936.96381626833,655587.4205983601,1778556.8477396898,255583.12772673735,335767.6701400403,2277251.401778242,-13568797.665451096,240157.27419293922,516700.11658881925,251154.60461205026,254815.36833068522,257777.94733501386,-7910172.7930241525,3374787.1750522736,-13704982.546375066,252415.74312324726,443818.60917659075,2018572.1339221222,538731.2434234505,-62935.85448166306,530523.6128394661,1288565.652241523,438258.2562712121,228318.3016317365,257822.61984666917,499574.55172250874,3397921.714080371,721581.9116729572,-143438.69271499114,268849.38313914597,-13584572.327477345,-138792.2839609744,3749048.9915252384,-9296594.389113009,252646.90917782858,196268.78571125556,896648.1526466284,272911.47588598885,2334496.6372864004,359202.61594599293,153466.45263319096,-13627647.04821743,-9094072.654020505,483757.5489166236,-9334258.771093508,671444.5592353386,539045.7543807888,-19329.534662286016,-60777.18031204714,429842.71427427314,3068174.346717769,779894.6565700267,-9754305.949039325,-76015.69427478928,692777.5147563873,266236.14696082484,14135158.74044791,262490.4637417955,249573.90176237453,963044.61840248,962173.5211231245,240797.2165496625,-249925.03630844224,-9950154.793103512,251919.25819430925,-385031.78796408017,281625.55449333723,414666.4501707826,961990.9014984781,-8213445.502301302,282826.0461459501,935464.3796622657,300271.6137290069,484428.6941266162,540194.4445932839,-1046059.1440187067,-205776.34964897836,1822578.830554733,94652.77002755189,268197.3020789421,256648.19921880012,41389.43270506914,4214677.037039321,791375.8260239215,-958548.5800166269,659051.861263032,243605.86296212222,-169592.29425704625,-942940.7191153816,2481349.2427491928,-8236212.508898596,538190.1761349457,695170.6393299819,-166891.01549345668,209518.92206139732,-51710.263446680394,-8904455.65316211,1023081.6020243954,268097.1416801104,442782.4696201852,867022.7410896108,774780.7616144235,639506.3071459054],\"size\":[21.444956461204377,12.039764646185533,9.779327685429283,8.389853430108921,8.17368328402077,7.137225393759445,6.814678553683554,6.814678553683554,6.4519501214821595,6.034176336545163,6.034176336545163,6.034176336545163,5.535238985626912,5.535238985626912,5.535238985626912,5.535238985626912,5.535238985626912,5.535238985626912,5.535238985626912,5.535238985626912,5.535238985626912,5.535238985626912,4.901274189394899,4.901274189394899,4.901274189394899,4.901274189394899,4.901274189394899,4.901274189394899,4.901274189394899,4.901274189394899,4.901274189394899,4.901274189394899,4.901274189394899,4.901274189394899,4.901274189394899,4.901274189394899,4.901274189394899,4.901274189394899,4.901274189394899,4.901274189394899,4.901274189394899,4.901274189394899,4.901274189394899,4.901274189394899,4.901274189394899,4.901274189394899,4.901274189394899,4.901274189394899,4.901274189394899,4.901274189394899,4.901274189394899,4.901274189394899,4.901274189394899,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722,3.9810717055349722],\"width\":[16.55294535724685,6.324555320336759,4.47213595499958,3.4641016151377544,3.3166247903554,2.6457513110645907,2.449489742783178,2.449489742783178,2.23606797749979,2.0,2.0,2.0,1.7320508075688772,1.7320508075688772,1.7320508075688772,1.7320508075688772,1.7320508075688772,1.7320508075688772,1.7320508075688772,1.7320508075688772,1.7320508075688772,1.7320508075688772,1.4142135623730951,1.4142135623730951,1.4142135623730951,1.4142135623730951,1.4142135623730951,1.4142135623730951,1.4142135623730951,1.4142135623730951,1.4142135623730951,1.4142135623730951,1.4142135623730951,1.4142135623730951,1.4142135623730951,1.4142135623730951,1.4142135623730951,1.4142135623730951,1.4142135623730951,1.4142135623730951,1.4142135623730951,1.4142135623730951,1.4142135623730951,1.4142135623730951,1.4142135623730951,1.4142135623730951,1.4142135623730951,1.4142135623730951,1.4142135623730951,1.4142135623730951,1.4142135623730951,1.4142135623730951,1.4142135623730951,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0],\"x\":[[261767.6935447902,261767.6935447902],[-14209.643569085307,261767.6935447902],[249378.59119203623,261767.6935447902],[254717.73000531044,261767.6935447902],[537897.0485552929,261767.6935447902],[2626033.5115105673,261767.6935447902],[545240.1392033203,261767.6935447902],[271155.64468965563,261767.6935447902],[499671.2566966717,261767.6935447902],[2011664.926497636,261767.6935447902],[-364746.6939418176,261767.6935447902],[242390.64374087742,261767.6935447902],[594201.6566301461,261767.6935447902],[545604.6542505322,261767.6935447902],[1490441.0663704798,261767.6935447902],[-54737.66745642165,261767.6935447902],[253080.07558040335,261767.6935447902],[544010.9932883865,261767.6935447902],[2661034.7305211267,261767.6935447902],[-64569.356689563545,261767.6935447902],[160772.8294877639,261767.6935447902],[-187018.9486586173,261767.6935447902],[489773.2653310411,261767.6935447902],[341822.2370567447,261767.6935447902],[2226062.9553779336,261767.6935447902],[2338458.097213566,261767.6935447902],[-412280.91801087913,261767.6935447902],[-178543.4277200389,261767.6935447902],[262380.35149432,261767.6935447902],[677252.4198965469,261767.6935447902],[-1017080.7578939479,261767.6935447902],[126079.34207755371,261767.6935447902],[220753.4854473379,261767.6935447902],[374287.18873567856,261767.6935447902],[170315.71509991543,261767.6935447902],[831031.0457777694,261767.6935447902],[-61946.246472409,261767.6935447902],[260730.88327998217,261767.6935447902],[249955.02577926198,261767.6935447902],[2596213.0793376295,261767.6935447902],[-173005.65040739317,261767.6935447902],[1021914.3948995298,261767.6935447902],[570810.761671962,261767.6935447902],[249009.0438784498,261767.6935447902],[2905741.5209832964,261767.6935447902],[254889.6184310443,261767.6935447902],[1113267.7108797147,261767.6935447902],[-127936.96381626833,261767.6935447902],[655587.4205983601,261767.6935447902],[1778556.8477396898,261767.6935447902],[255583.12772673735,261767.6935447902],[335767.6701400403,261767.6935447902],[2277251.401778242,261767.6935447902],[-13568797.665451096,261767.6935447902],[240157.27419293922,261767.6935447902],[516700.11658881925,261767.6935447902],[251154.60461205026,261767.6935447902],[254815.36833068522,261767.6935447902],[257777.94733501386,261767.6935447902],[-7910172.7930241525,261767.6935447902],[3374787.1750522736,261767.6935447902],[-13704982.546375066,261767.6935447902],[252415.74312324726,261767.6935447902],[443818.60917659075,261767.6935447902],[2018572.1339221222,261767.6935447902],[538731.2434234505,261767.6935447902],[-62935.85448166306,261767.6935447902],[530523.6128394661,261767.6935447902],[1288565.652241523,261767.6935447902],[438258.2562712121,261767.6935447902],[228318.3016317365,261767.6935447902],[257822.61984666917,261767.6935447902],[499574.55172250874,261767.6935447902],[3397921.714080371,261767.6935447902],[721581.9116729572,261767.6935447902],[-143438.69271499114,261767.6935447902],[268849.38313914597,261767.6935447902],[-13584572.327477345,261767.6935447902],[-138792.2839609744,261767.6935447902],[3749048.9915252384,261767.6935447902],[-9296594.389113009,261767.6935447902],[252646.90917782858,261767.6935447902],[196268.78571125556,261767.6935447902],[896648.1526466284,261767.6935447902],[272911.47588598885,261767.6935447902],[2334496.6372864004,261767.6935447902],[359202.61594599293,261767.6935447902],[153466.45263319096,261767.6935447902],[-13627647.04821743,261767.6935447902],[-9094072.654020505,261767.6935447902],[483757.5489166236,261767.6935447902],[-9334258.771093508,261767.6935447902],[671444.5592353386,261767.6935447902],[539045.7543807888,261767.6935447902],[-19329.534662286016,261767.6935447902],[-60777.18031204714,261767.6935447902],[429842.71427427314,261767.6935447902],[3068174.346717769,261767.6935447902],[779894.6565700267,261767.6935447902],[-9754305.949039325,261767.6935447902],[-76015.69427478928,261767.6935447902],[692777.5147563873,261767.6935447902],[266236.14696082484,261767.6935447902],[14135158.74044791,261767.6935447902],[262490.4637417955,261767.6935447902],[249573.90176237453,261767.6935447902],[963044.61840248,261767.6935447902],[962173.5211231245,261767.6935447902],[240797.2165496625,261767.6935447902],[-249925.03630844224,261767.6935447902],[-9950154.793103512,261767.6935447902],[251919.25819430925,261767.6935447902],[-385031.78796408017,261767.6935447902],[281625.55449333723,261767.6935447902],[414666.4501707826,261767.6935447902],[961990.9014984781,261767.6935447902],[-8213445.502301302,261767.6935447902],[282826.0461459501,261767.6935447902],[935464.3796622657,261767.6935447902],[300271.6137290069,261767.6935447902],[484428.6941266162,261767.6935447902],[540194.4445932839,261767.6935447902],[-1046059.1440187067,261767.6935447902],[-205776.34964897836,261767.6935447902],[1822578.830554733,261767.6935447902],[94652.77002755189,261767.6935447902],[268197.3020789421,261767.6935447902],[256648.19921880012,261767.6935447902],[41389.43270506914,261767.6935447902],[4214677.037039321,261767.6935447902],[791375.8260239215,261767.6935447902],[-958548.5800166269,261767.6935447902],[659051.861263032,261767.6935447902],[243605.86296212222,261767.6935447902],[-169592.29425704625,261767.6935447902],[-942940.7191153816,261767.6935447902],[2481349.2427491928,261767.6935447902],[-8236212.508898596,261767.6935447902],[538190.1761349457,261767.6935447902],[695170.6393299819,261767.6935447902],[-166891.01549345668,261767.6935447902],[209518.92206139732,261767.6935447902],[-51710.263446680394,261767.6935447902],[-8904455.65316211,261767.6935447902],[1023081.6020243954,261767.6935447902],[268097.1416801104,261767.6935447902],[442782.4696201852,261767.6935447902],[867022.7410896108,261767.6935447902],[774780.7616144235,261767.6935447902],[639506.3071459054,261767.6935447902]],\"y\":[[6250566.058387328,6250566.058387328],[6711528.507310883,6250566.058387328],[6247023.028469452,6250566.058387328],[6256717.746469357,6250566.058387328],[5741623.273341704,6250566.058387328],[5904504.887796117,6250566.058387328],[6868132.533213504,6250566.058387328],[6255420.855374339,6250566.058387328],[6787080.929523039,6250566.058387328],[8250991.480498332,6250566.058387328],[7304312.167817082,6250566.058387328],[5068983.531590666,6250566.058387328],[6608986.829942168,6250566.058387328],[5744573.320402273,6250566.058387328],[6894157.660591816,6250566.058387328],[6645310.286303089,6250566.058387328],[6245228.1433151,6250566.058387328],[5744096.189183348,6250566.058387328],[7342136.513636763,6250566.058387328],[5596560.14987214,6250566.058387328],[5404434.445070757,6250566.058387328],[6125397.65558454,6250566.058387328],[6660499.058549562,6250566.058387328],[6556193.450036304,6250566.058387328],[6454403.819557181,6250566.058387328],[6842169.357607037,6250566.058387328],[4926682.735486275,6250566.058387328],[6126805.126067943,6250566.058387328],[6243121.340802804,6250566.058387328],[6581827.746904905,6250566.058387328],[4679895.405438774,6250566.058387328],[5997209.584479427,6250566.058387328],[6270189.791326281,6250566.058387328],[6592826.038772372,6250566.058387328],[5392884.244517042,6250566.058387328],[6712763.638756483,6250566.058387328],[6678128.098218731,6250566.058387328],[6253212.185813283,6250566.058387328],[6226549.1654193,6250566.058387328],[5266096.066103294,6250566.058387328],[5977834.516357591,6250566.058387328],[6237352.010318624,6250566.058387328],[6814775.806630632,6250566.058387328],[6255227.258066088,6250566.058387328],[5533186.02091626,6250566.058387328],[6240955.539612582,6250566.058387328],[7085452.058364173,6250566.058387328],[6974385.803922438,6250566.058387328],[6363704.792462494,6250566.058387328],[5750461.081374191,6250566.058387328],[6233147.6520372955,6250566.058387328],[6552456.140772077,6250566.058387328],[5592885.343231742,6250566.058387328],[4486071.583106649,6250566.058387328],[6256167.2181554055,6250566.058387328],[6808147.3387864595,6250566.058387328],[6257120.185069738,6250566.058387328],[6259704.795380127,6250566.058387328],[6253855.3934884155,6250566.058387328],[5215097.34950119,6250566.058387328],[8386109.858655772,6250566.058387328],[6319242.465299898,6250566.058387328],[6260421.638720954,6250566.058387328],[5415732.574265395,6250566.058387328],[8259564.658643049,6250566.058387328],[5760589.204075308,6250566.058387328],[6663015.75382023,6250566.058387328],[5741946.359573029,6250566.058387328],[6129695.090390114,6250566.058387328],[6000211.1979917595,6250566.058387328],[6234010.562352629,6250566.058387328],[6243427.434134532,6250566.058387328],[6811395.977043195,6250566.058387328],[6524594.462785045,6250566.058387328],[6586550.068162402,6250566.058387328],[6768267.846967777,6250566.058387328],[6216334.065758224,6250566.058387328],[4484210.039912254,6250566.058387328],[6729140.913278009,6250566.058387328],[4160643.2407886907,6250566.058387328],[5112967.445386269,6250566.058387328],[6255317.115377749,6250566.058387328],[6527004.717359812,6250566.058387328],[6441994.989805688,6250566.058387328],[6256179.187989854,6250566.058387328],[5162472.973768493,6250566.058387328],[6658267.504591581,6250566.058387328],[5383632.9134859275,6250566.058387328],[4548292.343730622,6250566.058387328],[5087140.819053366,6250566.058387328],[6590703.2283005975,6250566.058387328],[5321578.718196322,6250566.058387328],[6570002.206260343,6250566.058387328],[5747877.024595145,6250566.058387328],[6684778.668220834,6250566.058387328],[6841070.499383747,6250566.058387328],[5413980.263046329,6250566.058387328],[7151681.178182635,6250566.058387328],[5415177.589209561,6250566.058387328],[5142357.36288071,6250566.058387328],[4576257.083266782,6250566.058387328],[5464021.698011181,6250566.058387328],[6238898.104135768,6250566.058387328],[4518391.6628727615,6250566.058387328],[6254096.387427293,6250566.058387328],[6256296.745530651,6250566.058387328],[6424271.795756613,6250566.058387328],[6326570.283942462,6250566.058387328],[6237907.196445192,6250566.058387328],[7072187.663046757,6250566.058387328],[5323358.165362713,6250566.058387328],[6241055.656230105,6250566.058387328],[6229545.98647286,6250566.058387328],[6260846.495428912,6250566.058387328],[6630820.90788647,6250566.058387328],[6405182.094593976,6250566.058387328],[4999302.370613497,6250566.058387328],[6245423.389097842,6250566.058387328],[6276027.254524554,6250566.058387328],[6248267.991398281,6250566.058387328],[6594196.236452866,6250566.058387328],[6852043.658319197,6250566.058387328],[4681985.437211557,6250566.058387328],[6119063.082521352,6250566.058387328],[6141587.728347871,6250566.058387328],[6239016.934332682,6250566.058387328],[6250653.387552831,6250566.058387328],[6258350.782482607,6250566.058387328],[6111868.641465672,6250566.058387328],[5622015.671035698,6250566.058387328],[5401227.831720856,6250566.058387328],[5034410.73661706,6250566.058387328],[5711113.592039375,6250566.058387328],[6242462.467068897,6250566.058387328],[6125854.52624968,6250566.058387328],[6781690.563766543,6250566.058387328],[7411194.890934023,6250566.058387328],[4972724.540162889,6250566.058387328],[6654181.480768274,6250566.058387328],[6880818.964536441,6250566.058387328],[5975354.415339375,6250566.058387328],[6319531.730105084,6250566.058387328],[5832414.556762211,6250566.058387328],[4930337.2000554195,6250566.058387328],[5695310.950543289,6250566.058387328],[6221606.054874108,6250566.058387328],[5423974.159363213,6250566.058387328],[6243904.777195247,6250566.058387328],[6610397.731303634,6250566.058387328],[5662844.0210950775,6250566.058387328]]},\"selected\":{\"id\":\"1059\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"1060\",\"type\":\"UnionRenderers\"}},\"id\":\"1047\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"dimension\":\"lat\"},\"id\":\"1024\",\"type\":\"MercatorTickFormatter\"},{\"attributes\":{\"formatter\":{\"id\":\"1024\",\"type\":\"MercatorTickFormatter\"},\"plot\":{\"id\":\"1003\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"1022\",\"type\":\"MercatorTicker\"}},\"id\":\"1021\",\"type\":\"MercatorAxis\"},{\"attributes\":{\"plot\":{\"id\":\"1003\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"1013\",\"type\":\"MercatorTicker\"}},\"id\":\"1020\",\"type\":\"Grid\"},{\"attributes\":{\"tile_source\":{\"id\":\"1001\",\"type\":\"WMTSTileSource\"}},\"id\":\"1045\",\"type\":\"TileRenderer\"},{\"attributes\":{\"dimension\":\"lat\"},\"id\":\"1022\",\"type\":\"MercatorTicker\"},{\"attributes\":{},\"id\":\"1060\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"field\":\"color\"},\"line_color\":{\"value\":null},\"size\":{\"field\":\"size\",\"units\":\"screen\"},\"x\":{\"field\":\"lon\"},\"y\":{\"field\":\"lat\"}},\"id\":\"1049\",\"type\":\"Circle\"},{\"attributes\":{\"dimension\":1,\"plot\":{\"id\":\"1003\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"1022\",\"type\":\"MercatorTicker\"}},\"id\":\"1029\",\"type\":\"Grid\"},{\"attributes\":{\"formatter\":{\"id\":\"1015\",\"type\":\"MercatorTickFormatter\"},\"plot\":{\"id\":\"1003\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"1013\",\"type\":\"MercatorTicker\"}},\"id\":\"1012\",\"type\":\"MercatorAxis\"},{\"attributes\":{},\"id\":\"1008\",\"type\":\"LinearScale\"},{\"attributes\":{\"callback\":null,\"end\":9000000,\"start\":-4000000},\"id\":\"1006\",\"type\":\"Range1d\"},{\"attributes\":{\"callback\":null,\"end\":18000000,\"start\":-16000000},\"id\":\"1004\",\"type\":\"Range1d\"},{\"attributes\":{\"below\":[{\"id\":\"1012\",\"type\":\"MercatorAxis\"}],\"left\":[{\"id\":\"1021\",\"type\":\"MercatorAxis\"}],\"plot_height\":550,\"plot_width\":900,\"renderers\":[{\"id\":\"1012\",\"type\":\"MercatorAxis\"},{\"id\":\"1020\",\"type\":\"Grid\"},{\"id\":\"1021\",\"type\":\"MercatorAxis\"},{\"id\":\"1029\",\"type\":\"Grid\"},{\"id\":\"1038\",\"type\":\"BoxAnnotation\"},{\"id\":\"1045\",\"type\":\"TileRenderer\"},{\"id\":\"1051\",\"type\":\"GlyphRenderer\"}],\"title\":{\"id\":\"1054\",\"type\":\"Title\"},\"toolbar\":{\"id\":\"1036\",\"type\":\"Toolbar\"},\"x_range\":{\"id\":\"1004\",\"type\":\"Range1d\"},\"x_scale\":{\"id\":\"1008\",\"type\":\"LinearScale\"},\"y_range\":{\"id\":\"1006\",\"type\":\"Range1d\"},\"y_scale\":{\"id\":\"1010\",\"type\":\"LinearScale\"}},\"id\":\"1003\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"attribution\":\"© OpenStreetMap contributors,© CartoDB\",\"url\":\"https://tiles.basemaps.cartocdn.com/light_all/{z}/{x}/{y}@2x.png\"},\"id\":\"1001\",\"type\":\"WMTSTileSource\"}],\"root_ids\":[\"1003\"]},\"title\":\"Bokeh Application\",\"version\":\"1.0.1\"}};\n", " var render_items = [{\"docid\":\"9232430c-00d2-4804-ad4c-0ac10df23340\",\"roots\":{\"1003\":\"f5de9f8a-b598-4247-bb60-9a883df6f8b5\"}}];\n", " root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n", "\n", " }\n", " if (root.Bokeh !== undefined) {\n", " embed_document(root);\n", " } else {\n", " var attempts = 0;\n", " var timer = setInterval(function(root) {\n", " if (root.Bokeh !== undefined) {\n", " embed_document(root);\n", " clearInterval(timer);\n", " }\n", " attempts++;\n", " if (attempts > 100) {\n", " console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n", " clearInterval(timer);\n", " }\n", " }, 10, root)\n", " }\n", "})(window);" ], "application/vnd.bokehjs_exec.v0+json": "" }, "metadata": { "application/vnd.bokehjs_exec.v0+json": { "id": "1003" } }, "output_type": "display_data" } ], "source": [ "from bokeh.io import output_notebook, show\n", "from bokeh.plotting import figure\n", "from bokeh.models import (\n", " ColumnDataSource, Circle, LogColorMapper, BasicTicker, ColorBar,\n", " DataRange1d, PanTool, WheelZoomTool, BoxSelectTool\n", ")\n", "from bokeh.models.mappers import ColorMapper, LinearColorMapper\n", "from bokeh.palettes import Viridis5\n", "from bokeh.tile_providers import CARTODBPOSITRON_RETINA\n", "\n", "import json, math\n", "import bokeh.tile_providers\n", "\n", "output_notebook()\n", "\n", "def coords2mercator(coords):\n", " lat, lon = coords\n", " \n", " r_major = 6378137.000\n", " x = r_major * math.radians(lon)\n", " scale = x/lon\n", " y = 180.0/math.pi * math.log(math.tan(math.pi/4.0 + \n", " lat * (math.pi/180.0)/2.0)) * scale\n", " return (x, y)\n", "\n", "p = figure(x_range=(-16000000, 18000000), y_range=(-4000000, 9000000),\n", " x_axis_type=\"mercator\", y_axis_type=\"mercator\", plot_width=900, plot_height=550)\n", "\n", "p.add_tile(CARTODBPOSITRON_RETINA)\n", "\n", "unique_coords = Counter()\n", "for o in origins:\n", " if geocode(o):\n", " unique_coords[json.dumps([geocode(o).latitude,geocode(o).longitude])] += 1\n", "\n", "source = ColumnDataSource(\n", " data=dict(\n", " lat=[coords2mercator(json.loads(k))[1] for k, v in unique_coords.most_common()],\n", " lon=[coords2mercator(json.loads(k))[0] for k, v in unique_coords.most_common()],\n", " \n", " x=[(coords2mercator(json.loads(k))[0], coords2mercator(coords(\"Paris\"))[0]) for k, v in unique_coords.most_common()],\n", " y=[(coords2mercator(json.loads(k))[1], coords2mercator(coords(\"Paris\"))[1]) for k, v in unique_coords.most_common()],\n", " \n", " size=[(v*100)**(0.3) for k, v in unique_coords.most_common()],\n", " width=[math.sqrt(v) for k, v in unique_coords.most_common()],\n", " color=[\"blue\" for k, v in unique_coords.most_common()]\n", " )\n", ")\n", "\n", "#lines_glyph = p.multi_line('x', 'y', color = 'color', line_width = \"width\", \n", "# line_alpha = 0.2, hover_line_alpha = 1.0, hover_line_color = 'color',\n", "# source = source)\n", "\n", "p.circle(x=\"lon\", y=\"lat\", size=\"size\", fill_color=\"color\", fill_alpha=0.5, line_color=None, source=source)\n", "\n", "show(p)" ] }, { "cell_type": "code", "execution_count": 19, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Total subway footprint: 28.20132\n", "Total car footprint: 169.043\n", "Total commute footprint: 197.24432\n" ] } ], "source": [ "# Commute to the conference\n", "\n", "# Compute subway emissions, considering ~90% usage among attendees to get to the conference\n", "split_subway = 0.90\n", "split_car = 0.10\n", "\n", "average_distance = 7 # Distance from Chatelet to Docks\n", "subway_co2ekm = 0.0038\n", "total_footprint_subway = len(origins) * 2 * split_subway * average_distance * subway_co2ekm\n", "print \"Total subway footprint:\", total_footprint_subway\n", "\n", "average_distance = 7 # Distance from Chatelet to Docks\n", "subway_co2ekm = 0.205\n", "total_footprint_car = len(origins) * 2 * split_car * average_distance * subway_co2ekm\n", "print \"Total car footprint:\", total_footprint_car\n", "\n", "total_footprint_commute = total_footprint_subway + total_footprint_car\n", "print \"Total commute footprint:\", total_footprint_commute" ] }, { "cell_type": "code", "execution_count": 20, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Total transport footprint: 34952.1273468\n" ] } ], "source": [ "# Other transports\n", "\n", "# Food\n", "# Deliveries\n", "total_footprint_transport = total_footprint_transport_attendees + total_footprint_commute\n", "print \"Total transport footprint:\", total_footprint_transport" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 2 - Hotels" ] }, { "cell_type": "code", "execution_count": 21, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Total hotel nights: 460\n", "Total hotel footprint: 3174.0\n" ] } ], "source": [ "# https://www.consoglobe.com/impact-ecologique-d-une-nuit-d-hotel-cg\n", "one_night_ghg = 6.9\n", "average_stay = 2\n", "# Any attendee with an origin further than this (in km) will be considered as sleeping in a hotel\n", "hotel_km_limit = 100 \n", "\n", "hotel_attendees = len([\n", " o\n", " for o in origins\n", " if distance(coords(o), coords(\"Paris\")) > hotel_km_limit\n", "])\n", "\n", "total_footprint_hotels = hotel_attendees * average_stay * one_night_ghg\n", "print \"Total hotel nights:\", average_stay * hotel_attendees\n", "print \"Total hotel footprint:\", total_footprint_hotels" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 3 - Energy" ] }, { "cell_type": "code", "execution_count": 22, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Total energy footprint: 1365.12\n" ] } ], "source": [ "docks_surface = 3200\n", "\n", "# Watts estimate\n", "heating_kwh = 474 * 24\n", "# https://www.rte-france.com/en/eco2mix/eco2mix-co2-en\n", "kwh_co2e = 0.08\n", "total_heating = heating_kwh * kwh_co2e\n", "\n", "# lights, screen, tech\n", "total_other_energy = 0.5 * total_heating # TODO\n", "\n", "total_footprint_energy = total_heating + total_other_energy\n", "print \"Total energy footprint:\", total_footprint_energy" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 4 - Food" ] }, { "cell_type": "code", "execution_count": 29, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Total food footprint 1590.3\n" ] } ], "source": [ "attendees = len(origins)\n", "\n", "if CONFERENCE == \"dotswift-2019\": # half-day\n", " kg_per_attendee = 0.2\n", "else:\n", " kg_per_attendee = 0.5\n", "\n", "# http://www.greeneatz.com/foods-carbon-footprint.html\n", "# TODO: find better FR source\n", "cheese_ghg = 13.5\n", "\n", "# Let's just consider everyone eats only cheese! (among the worst offenders)\n", "total_footprint_food = attendees * kg_per_attendee * cheese_ghg\n", "print \"Total food footprint\", total_footprint_food" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 5 - Hardware" ] }, { "cell_type": "code", "execution_count": 26, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Total hardware footprint: 83.9651481\n" ] } ], "source": [ "# Badges & print\n", "badges_paper = 0.3\n", "badges_format = 0.075 * 0.120\n", "\n", "rollups_surface = 12 * (0.8 * 2) + 6 * (1.6 * 2) + 5 * (2 * 2)\n", "rollups_paper = 0.5\n", "\n", "total_paper_kg = (badges_paper * badges_format * len(origins)) + (rollups_surface * rollups_paper)\n", "\n", "# https://www.epa.vic.gov.au/~/media/Publications/972.pdf\n", "total_footprint_paper = 2.727 * total_paper_kg\n", "\n", "# Stage\n", "total_stage = 0\n", "total_swag = 0\n", "if CONFERENCE == \"dotjs-2018\":\n", "\n", " stage_wood_kg = 4 * 15\n", " stage_cardboard_kg = 26 * 0.5\n", " total_stage = stage_wood_kg + stage_cardboard_kg\n", " \n", " # Swag\n", " tshirts = 100 + 450\n", " # https://www.carbontrust.com/media/38358/ctc793-international-carbon-flows-clothing.pdf\n", " total_footprint_tshirts = tshirts * 15\n", " total_swag = total_footprint_tshirts\n", "\n", "hoodies = 0\n", "\n", "# Cardboard\n", "total_footprint_hardware = total_footprint_paper + total_stage + total_swag\n", "print \"Total hardware footprint:\", total_footprint_hardware" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Conclusion" ] }, { "cell_type": "code", "execution_count": 30, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Total footprint: 41165.5124949\n", "Footprint per attendee 69.8905135737\n" ] } ], "source": [ "total_footprint = total_footprint_transport + total_footprint_hotels + total_footprint_energy + total_footprint_food + total_footprint_hardware\n", "print \"Total footprint:\", total_footprint\n", "print \"Footprint per attendee\", total_footprint / len(origins)" ] }, { "cell_type": "code", "execution_count": 31, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "\n", "\n", "\n", "\n", "\n", "
\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "(function(root) {\n", " function embed_document(root) {\n", " \n", " var docs_json = {\"2c828a1a-2ba6-4ff8-af36-930f0d930d42\":{\"roots\":{\"references\":[{\"attributes\":{},\"id\":\"1225\",\"type\":\"BasicTicker\"},{\"attributes\":{\"axis_label\":null,\"formatter\":{\"id\":\"1247\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"1214\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"1225\",\"type\":\"BasicTicker\"},\"visible\":false},\"id\":\"1224\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"1222\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"1220\",\"type\":\"LinearScale\"},{\"attributes\":{\"axis_label\":null,\"formatter\":{\"id\":\"1249\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"1214\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"1230\",\"type\":\"BasicTicker\"},\"visible\":false},\"id\":\"1229\",\"type\":\"LinearAxis\"},{\"attributes\":{\"grid_line_color\":{\"value\":null},\"plot\":{\"id\":\"1214\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"1225\",\"type\":\"BasicTicker\"}},\"id\":\"1228\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"1230\",\"type\":\"BasicTicker\"},{\"attributes\":{\"items\":[{\"id\":\"1251\",\"type\":\"LegendItem\"}],\"plot\":{\"id\":\"1214\",\"subtype\":\"Figure\",\"type\":\"Plot\"}},\"id\":\"1250\",\"type\":\"Legend\"},{\"attributes\":{\"label\":{\"field\":\"label\"},\"renderers\":[{\"id\":\"1243\",\"type\":\"GlyphRenderer\"}]},\"id\":\"1251\",\"type\":\"LegendItem\"},{\"attributes\":{\"callback\":null,\"renderers\":\"auto\",\"tooltips\":\"@label: @value\"},\"id\":\"1234\",\"type\":\"HoverTool\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"1234\",\"type\":\"HoverTool\"}]},\"id\":\"1235\",\"type\":\"Toolbar\"},{\"attributes\":{\"field\":\"angle\",\"include_zero\":true},\"id\":\"1237\",\"type\":\"CumSum\"},{\"attributes\":{\"callback\":null,\"start\":-0.5},\"id\":\"1216\",\"type\":\"Range1d\"},{\"attributes\":{\"below\":[{\"id\":\"1224\",\"type\":\"LinearAxis\"}],\"left\":[{\"id\":\"1229\",\"type\":\"LinearAxis\"}],\"plot_height\":350,\"renderers\":[{\"id\":\"1224\",\"type\":\"LinearAxis\"},{\"id\":\"1228\",\"type\":\"Grid\"},{\"id\":\"1229\",\"type\":\"LinearAxis\"},{\"id\":\"1233\",\"type\":\"Grid\"},{\"id\":\"1250\",\"type\":\"Legend\"},{\"id\":\"1243\",\"type\":\"GlyphRenderer\"}],\"title\":{\"id\":\"1213\",\"type\":\"Title\"},\"toolbar\":{\"id\":\"1235\",\"type\":\"Toolbar\"},\"toolbar_location\":null,\"x_range\":{\"id\":\"1216\",\"type\":\"Range1d\"},\"x_scale\":{\"id\":\"1220\",\"type\":\"LinearScale\"},\"y_range\":{\"id\":\"1218\",\"type\":\"DataRange1d\"},\"y_scale\":{\"id\":\"1222\",\"type\":\"LinearScale\"}},\"id\":\"1214\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"dimension\":1,\"grid_line_color\":{\"value\":null},\"plot\":{\"id\":\"1214\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"1230\",\"type\":\"BasicTicker\"}},\"id\":\"1233\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"1274\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"callback\":null},\"id\":\"1218\",\"type\":\"DataRange1d\"},{\"attributes\":{},\"id\":\"1273\",\"type\":\"Selection\"},{\"attributes\":{\"field\":\"angle\"},\"id\":\"1238\",\"type\":\"CumSum\"},{\"attributes\":{\"callback\":null,\"data\":{\"angle\":{\"__ndarray__\":\"AMvZuJWryj/xCCfwzxHPPw7dTkkqP4o/p+uztU4B3z9PQHym21YVQA==\",\"dtype\":\"float64\",\"shape\":[5]},\"color\":[\"#1f77b4\",\"#ff7f0e\",\"#2ca02c\",\"#d62728\",\"#9467bd\"],\"label\":[\"Energy\",\"Food\",\"Hardware\",\"Hotels\",\"Transport\"],\"value\":{\"__ndarray__\":\"Fa5H4XpUlUA0MzMzM9mYQPtSifzE/VRAAAAAAADMqECHmDkTBBHhQA==\",\"dtype\":\"float64\",\"shape\":[5]}},\"selected\":{\"id\":\"1273\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"1274\",\"type\":\"UnionRenderers\"}},\"id\":\"1239\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"plot\":null,\"text\":\"Footprint by category\"},\"id\":\"1213\",\"type\":\"Title\"},{\"attributes\":{\"end_angle\":{\"expr\":{\"id\":\"1238\",\"type\":\"CumSum\"},\"units\":\"rad\"},\"fill_color\":{\"field\":\"color\"},\"line_color\":{\"value\":\"white\"},\"radius\":{\"units\":\"data\",\"value\":0.4},\"start_angle\":{\"expr\":{\"id\":\"1237\",\"type\":\"CumSum\"},\"units\":\"rad\"},\"x\":{\"value\":0},\"y\":{\"value\":1}},\"id\":\"1241\",\"type\":\"Wedge\"},{\"attributes\":{\"data_source\":{\"id\":\"1239\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"1241\",\"type\":\"Wedge\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1242\",\"type\":\"Wedge\"},\"selection_glyph\":null,\"view\":{\"id\":\"1244\",\"type\":\"CDSView\"}},\"id\":\"1243\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"end_angle\":{\"expr\":{\"id\":\"1238\",\"type\":\"CumSum\"},\"units\":\"rad\"},\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"radius\":{\"units\":\"data\",\"value\":0.4},\"start_angle\":{\"expr\":{\"id\":\"1237\",\"type\":\"CumSum\"},\"units\":\"rad\"},\"x\":{\"value\":0},\"y\":{\"value\":1}},\"id\":\"1242\",\"type\":\"Wedge\"},{\"attributes\":{\"source\":{\"id\":\"1239\",\"type\":\"ColumnDataSource\"}},\"id\":\"1244\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"1247\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"1249\",\"type\":\"BasicTickFormatter\"}],\"root_ids\":[\"1214\"]},\"title\":\"Bokeh Application\",\"version\":\"1.0.1\"}};\n", " var render_items = [{\"docid\":\"2c828a1a-2ba6-4ff8-af36-930f0d930d42\",\"roots\":{\"1214\":\"067fa4c0-9ae5-4fe9-ae52-dd5bc65d2907\"}}];\n", " root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n", "\n", " }\n", " if (root.Bokeh !== undefined) {\n", " embed_document(root);\n", " } else {\n", " var attempts = 0;\n", " var timer = setInterval(function(root) {\n", " if (root.Bokeh !== undefined) {\n", " embed_document(root);\n", " clearInterval(timer);\n", " }\n", " attempts++;\n", " if (attempts > 100) {\n", " console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n", " clearInterval(timer);\n", " }\n", " }, 10, root)\n", " }\n", "})(window);" ], "application/vnd.bokehjs_exec.v0+json": "" }, "metadata": { "application/vnd.bokehjs_exec.v0+json": { "id": "1214" } }, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "{'Food': 1590.3000000000002, 'Hardware': 83.96514810000001, 'Energy': 1365.1200000000001, 'Transport': 34952.12734679976, 'Hotels': 3174.0}\n" ] } ], "source": [ "from bokeh.palettes import Category10\n", "from bokeh.transform import cumsum\n", "import pandas as pd\n", "from math import pi\n", "\n", "raw = {\n", " 'Transport': total_footprint_transport,\n", " 'Hotels': total_footprint_hotels,\n", " 'Energy': total_footprint_energy,\n", " 'Food': total_footprint_food,\n", " 'Hardware': total_footprint_hardware\n", "}\n", "\n", "data = pd.Series(raw).reset_index(name='value').rename(columns={'index':'label'})\n", "data['angle'] = data['value']/data['value'].sum() * 2*pi\n", "data['color'] = Category10[len(raw)]\n", "\n", "p = figure(plot_height=350, title=\"Footprint by category\", toolbar_location=None,\n", " tools=\"hover\", tooltips=\"@label: @value\", x_range=(-0.5, 1.0))\n", "\n", "p.wedge(x=0, y=1, radius=0.4,\n", " start_angle=cumsum('angle', include_zero=True), end_angle=cumsum('angle'),\n", " line_color=\"white\", fill_color='color', legend='label', source=dict(data))\n", "\n", "p.axis.axis_label=None\n", "p.axis.visible=False\n", "p.grid.grid_line_color = None\n", "\n", "show(p)\n", "print raw" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 2", "language": "python", "name": "python2" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 2 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython2", "version": "2.7.14" } }, "nbformat": 4, "nbformat_minor": 2 }