diff --git a/checksit/check.py b/checksit/check.py index ffb0162..c8b4ca2 100644 --- a/checksit/check.py +++ b/checksit/check.py @@ -354,9 +354,9 @@ def _get_ncas_specs( template = "auto" specs = None # find appropriate specs depending on convention - if file_path.split(".")[-1] == "nc" and ":Conventions" in file_content.cdl: + if file_path.split(".")[-1] == "nc" and ":conventions" in file_content.cdl.lower(): conventions = ( - file_content.cdl.split(":Conventions =")[1].split(";")[0].strip() + file_content.cdl.lower().split(":conventions =")[1].split(";")[0].strip() ) # NCAS-GENERAL file if any( @@ -367,7 +367,7 @@ def _get_ncas_specs( print("\nNCAS-AMOF file detected, finding correct spec files") print("Finding correct AMOF version...") version_number = ( - conventions[conventions.index("NCAS-") :] + conventions[conventions.upper().index("NCAS-") :] .split("-")[2] .replace('"', "") ) @@ -591,6 +591,9 @@ def check_file( ( "Conventions" in file_content.global_attrs.keys() and "ncas-" in file_content.global_attrs["Conventions"].lower() + ) or ( + "conventions" in file_content.global_attrs.keys() and + "ncas-" in file_content.global_attrs["conventions"].lower() ) or ( "XMP-photoshop:Instructions" in file_content.global_attrs.keys() and "national centre for atmospheric science" in file_content.global_attrs["XMP-photoshop:Instructions"].lower() diff --git a/checksit/etc/checksit.ini b/checksit/etc/checksit.ini index a6b0054..ed5a730 100644 --- a/checksit/etc/checksit.ini +++ b/checksit/etc/checksit.ini @@ -21,9 +21,9 @@ rule_splitter = | format_checks_dir = %(basedir)s/fmt_checks excludes = #global_attributes:creation_date global_attributes:version -default_template_cache_dir = %(basedir)stemplate-cache +default_template_cache_dir = %(basedir)s/data/template-cache template_cache_dirs = template-cache other-cache -default_template = template-cache/ceda-base.yml +default_template = %(basedir)s/data/template-cache/ceda-base.yml specs_dir = %(basedir)s/data/specs [dataset:ukmo-assim]