Skip to content

Commit

Permalink
use current cf names
Browse files Browse the repository at this point in the history
  • Loading branch information
n-a-t-e committed Nov 1, 2023
1 parent 699b818 commit 7fd565a
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions harvester/cde_harvester/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,19 @@ def intersection(lst1, lst2):
def flatten(t):
return [item for sublist in t for item in sublist]

def get_cf_names():
cf_names_xml_url="https://cfconventions.org/Data/cf-standard-names/current/src/cf-standard-name-table.xml"

cf_standard_names = (
pd.read_xml(
"https://cfconventions.org/Data/cf-standard-names/78/src/cf-standard-name-table.xml"
print ("Downloading", cf_names_xml_url)

cf_standard_names = (
pd.read_xml(cf_names_xml_url)
.sort_values(by="id")["id"]
.unique()
)
.sort_values(by="id")["id"]
.unique()
)
return cf_standard_names

cf_standard_names = get_cf_names()

# list of standard names that are supported by CDE
supported_standard_names = flatten(cde_eov_to_standard_name.values())

0 comments on commit 7fd565a

Please sign in to comment.