-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathget_metadata.py
More file actions
29 lines (22 loc) · 873 Bytes
/
get_metadata.py
File metadata and controls
29 lines (22 loc) · 873 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Jul 24 10:11:53 2024
@author: vicky
"""
def get_metadata(station, mydb, mycursor):
query = ("select mg.source, mg.project, ms.stationName, mg.country, ms.latitude, ms.longitude, ms.elevation, mg.link,ms.timeZone, ms.UTCoffset from metadata_global mgjoin MetadataStations ms on ms.project = mg.project where stationName like '{station}';")
mycursor.execute(query)
result = mycursor.fetchall()
source = result[0]
project = result[1]
stationName = result[2]
country = result[3]
latitude = result[4]
longitude = result[5]
elevation = result[6]
link = result[7]
timeZone = result[8]
UTCoffset = result[9]
stationID = stationName+country
return (source, project, stationName, stationID, latitude, longitude, elevation, link, timeZone, UTCoffset)