ICOS-Carbon-Portal / pylib

Python library for direct access to ICOS time series data.
12 stars 3 forks source link

120 make station function case insensitive #136

Closed altix closed 1 year ago

altix commented 1 year ago

Now the user will no need to use case-sensitive id of a station in order to create the station object. Added a lookup table.

altix commented 1 year ago

this is a fixed list and not suitable, we need to query the database for a current list of stations and build the dictionary on the fly. this code snippet should help

from icoscp.station import station
stations = station.getIdList()
values = stations.id.tolist()
keys = [k.upper() for k in values]
lookup = dict(zip(keys, values))

Right, I agree, but I used another approach in order to avoid to many sparql-runs.