Skip to content
Snippets Groups Projects
Commit 73f9ea5d authored by Richard Olav Rud's avatar Richard Olav Rud
Browse files

Add exact match for variable search

parent 53958a41
No related branches found
No related tags found
No related merge requests found
......@@ -25,7 +25,9 @@ def get_opendap_urls_by_parameter(
for url in urls:
for var in list(netCDF4.Dataset(url).variables.keys()):
if var.startswith(parameter) and url not in datasets:
if var == parameter and url not in datasets:
datasets.append(url)
elif var.startswith('{0}_'.format(parameter)) and url not in datasets:
datasets.append(url)
else:
pass
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment