Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add cfchecker run script #94

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
add cfcheker run script
  • Loading branch information
ssuttles-usgs committed Dec 21, 2022
commit bb124f3ced8757cebe87b84da636a98e5ad5fc63
20 changes: 20 additions & 0 deletions scripts/runcfchecker.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import argparse
import stglib
import xarray as xr


def cfcheckername_parser():
description = "Run cfchecker on .nc files"
parser = argparse.ArgumentParser(description=description)
parser.add_argument("ncname", help=".nc filename")

return parser


args = cfcheckername_parser().parse_args()

print(args.ncname)

ds = xr.open_dataset(args.ncname)

stglib.core.utils.check_compliance(args.ncname, conventions=ds.attrs["Conventions"])