Skip to content
Snippets Groups Projects
Verified Commit 3245124f authored by Owen Graham's avatar Owen Graham
Browse files

Use slugified station names as station IDs

parent a00cb0b5
Branches
No related tags found
No related merge requests found
[
{
"id": "south-pole",
"name": "South Pole Station",
"records": [
{
......@@ -13,6 +14,7 @@
]
},
{
"id": "ago-4",
"name": "AGO-4",
"records": [
{
......@@ -22,6 +24,7 @@
]
},
{
"id": "ago-5",
"name": "AGO-5",
"records": [
{
......@@ -31,6 +34,7 @@
]
},
{
"id": "austin",
"name": "Austin",
"records": [
{
......@@ -40,6 +44,7 @@
]
},
{
"id": "baldrick",
"name": "Baldrick",
"records": [
{
......@@ -49,6 +54,7 @@
]
},
{
"id": "bear-peninsula",
"name": "Bear Peninsula",
"records": [
{
......@@ -58,6 +64,7 @@
]
},
{
"id": "byrd",
"name": "Byrd",
"records": [
{
......@@ -67,6 +74,7 @@
]
},
{
"id": "cape-bird",
"name": "Cape Bird",
"records": [
{
......@@ -76,6 +84,7 @@
]
},
{
"id": "cape-hallett",
"name": "Cape Hallett",
"records": [
{
......@@ -85,6 +94,7 @@
]
},
{
"id": "d-10",
"name": "D-10",
"records": [
{
......@@ -94,6 +104,7 @@
]
},
{
"id": "d-47",
"name": "D-47",
"records": [
{
......@@ -103,6 +114,7 @@
]
},
{
"id": "d-85",
"name": "D-85",
"records": [
{
......@@ -112,6 +124,7 @@
]
},
{
"id": "dismal-island",
"name": "Dismal Island",
"records": [
{
......@@ -121,6 +134,7 @@
]
},
{
"id": "dome-c-ii",
"name": "Dome C II",
"records": [
{
......@@ -130,6 +144,7 @@
]
},
{
"id": "dome-fuji",
"name": "Dome Fuji",
"records": [
{
......@@ -139,6 +154,7 @@
]
},
{
"id": "elaine",
"name": "Elaine",
"records": [
{
......@@ -148,6 +164,7 @@
]
},
{
"id": "elizabeth",
"name": "Elizabeth",
"records": [
{
......@@ -157,6 +174,7 @@
]
},
{
"id": "emilia",
"name": "Emilia",
"records": [
{
......@@ -166,6 +184,7 @@
]
},
{
"id": "emma",
"name": "Emma",
"records": [
{
......@@ -175,6 +194,7 @@
]
},
{
"id": "erin",
"name": "Erin",
"records": [
{
......@@ -184,6 +204,7 @@
]
},
{
"id": "ferrell",
"name": "Ferrell",
"records": [
{
......@@ -193,6 +214,7 @@
]
},
{
"id": "gill",
"name": "Gill",
"records": [
{
......@@ -202,6 +224,7 @@
]
},
{
"id": "harry",
"name": "Harry",
"records": [
{
......@@ -211,6 +234,7 @@
]
},
{
"id": "henry",
"name": "Henry",
"records": [
{
......@@ -220,6 +244,7 @@
]
},
{
"id": "janet",
"name": "Janet",
"records": [
{
......@@ -229,6 +254,7 @@
]
},
{
"id": "jase2007",
"name": "JASE2007",
"records": [
{
......@@ -238,6 +264,7 @@
]
},
{
"id": "kathie",
"name": "Kathie",
"records": [
{
......@@ -247,6 +274,7 @@
]
},
{
"id": "laurie-ii",
"name": "Laurie II",
"records": [
{
......@@ -256,6 +284,7 @@
]
},
{
"id": "lettau",
"name": "Lettau",
"records": [
{
......@@ -265,6 +294,7 @@
]
},
{
"id": "linda",
"name": "Linda",
"records": [
{
......@@ -274,6 +304,7 @@
]
},
{
"id": "lorne",
"name": "Lorne",
"records": [
{
......@@ -283,6 +314,7 @@
]
},
{
"id": "manuela",
"name": "Manuela",
"records": [
{
......@@ -292,6 +324,7 @@
]
},
{
"id": "marble-point",
"name": "Marble Point",
"records": [
{
......@@ -301,6 +334,7 @@
]
},
{
"id": "marble-point-ii",
"name": "Marble Point II",
"records": [
{
......@@ -310,6 +344,7 @@
]
},
{
"id": "margaret",
"name": "Margaret",
"records": [
{
......@@ -319,6 +354,7 @@
]
},
{
"id": "marilyn",
"name": "Marilyn",
"records": [
{
......@@ -328,6 +364,7 @@
]
},
{
"id": "minna-bluff",
"name": "Minna Bluff",
"records": [
{
......@@ -337,6 +374,7 @@
]
},
{
"id": "mizuho",
"name": "Mizuho",
"records": [
{
......@@ -346,6 +384,7 @@
]
},
{
"id": "nico",
"name": "Nico",
"records": [
{
......@@ -355,6 +394,7 @@
]
},
{
"id": "panda-south",
"name": "PANDA-South",
"records": [
{
......@@ -364,6 +404,7 @@
]
},
{
"id": "phoenix",
"name": "Phoenix",
"records": [
{
......@@ -373,6 +414,7 @@
]
},
{
"id": "possession-island",
"name": "Possession Island",
"records": [
{
......@@ -382,6 +424,7 @@
]
},
{
"id": "relay",
"name": "Relay Station",
"records": [
{
......@@ -391,6 +434,7 @@
]
},
{
"id": "sabrina",
"name": "Sabrina",
"records": [
{
......@@ -400,6 +444,7 @@
]
},
{
"id": "schwerdtfeger",
"name": "Schwerdtfeger",
"records": [
{
......@@ -409,6 +454,7 @@
]
},
{
"id": "siple-dome",
"name": "Siple Dome",
"records": [
{
......@@ -418,6 +464,7 @@
]
},
{
"id": "theresa",
"name": "Theresa",
"records": [
{
......@@ -427,6 +474,7 @@
]
},
{
"id": "thurston-island",
"name": "Thurston Island",
"records": [
{
......@@ -436,6 +484,7 @@
]
},
{
"id": "vito",
"name": "Vito",
"records": [
{
......@@ -445,6 +494,7 @@
]
},
{
"id": "white-island",
"name": "White Island",
"records": [
{
......@@ -454,6 +504,7 @@
]
},
{
"id": "whitlock",
"name": "Whitlock",
"records": [
{
......@@ -463,6 +514,7 @@
]
},
{
"id": "willie-field",
"name": "Willie Field",
"records": [
{
......@@ -472,6 +524,7 @@
]
},
{
"id": "windless-bight",
"name": "Windless Bight",
"records": [
{
......
......
{% for station in g.stations %}
<option value="{{ station['name'] | e }}">
<option value="{{ station['id'] | e }}">
{{- station['name'] | e -}}
</option>
{% endfor %}
......@@ -321,7 +321,7 @@ def get_station_record(station_id, stations=None):
if stations is None:
stations = get_records()
for station in stations:
if station['name'] == station_id:
if station['id'] == station_id:
return station
abort(404)
......@@ -350,7 +350,7 @@ def read_data(station, year):
for url in resource_list:
with urlopen(url) as data:
lines = map(bytes.decode, data)
spec = (SOUTH_POLE_DATA if station['name'] == 'South Pole Station'
spec = (SOUTH_POLE_DATA if station['id'] == 'south-pole'
else ONE_HOUR_DATA)
for row in asccol.parse_data(lines, spec):
date = datetime.datetime(row.year, row.month, row.day,
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment