Shore Station Compliance Checker Script#

Created: 2017-05-14

The IOOS Compliance Checker is a Python-based tool that helps users check the meta data compliance of a netCDF file. This software can be run in a web interface here: https://compliance.ioos.us/index.html The checker can also be run as a Python tool either on the command line or in a Python script. This notebook demonstrates the python usage of the Compliance Checker.

Purpose:#

Run the compliance checker python tool on a Scipps Pier shore station dataset to check for the metadata compliance.

The Scripps Pier automated shore station operated by Southern California Coastal Ocean Observing System (SCCOOS) at Scripps Institution of Oceanography (SIO) is mounted at a nominal depth of 5 meters MLLW. The instrument package includes a Seabird SBE 16plus SEACAT Conductivity, Temperature, and Pressure recorder, and a Seapoint Chlorophyll Fluorometer with a 0-50 ug/L gain setting.

Dependencies:#

This script must be run in the “IOOS” environment for the compliance checker to work properly.

Written by: J.Bosch Feb. 10, 2017

import compliance_checker

print(compliance_checker.__version__)
5.1.0
# First import the compliance checker and test that it is installed properly.
from compliance_checker.runner import CheckSuite, ComplianceChecker

# Load all available checker classes.
check_suite = CheckSuite()
check_suite.load_all_available_checkers()
# Path to the Scripps Pier Data.

url = "https://gliders.ioos.us/thredds/fileServer/deployments/rutgers/ru29-20150623T1046/ru29-20150623T1046.nc3.nc"

Running Compliance Checker on the Scripps Pier shore station data#

This code is written with all the arguments spelled out, following the usage instructions on the README section of compliance checker github page: ioos/compliance-checker

output_file = "buoy_testCC.txt"

return_value, errors = ComplianceChecker.run_checker(
    ds_loc=url,
    checker_names=["cf:1.9", "acdd"],
    verbose=True,
    criteria="normal",
    skip_checks=None,
    output_filename=output_file,
    output_format="text",
)
with open(output_file) as f:
    print(f.read())
--------------------------------------------------------------------------------
                         IOOS Compliance Checker Report                         
                                 Version 5.1.0                                  
                     Report generated 2023-09-13T13:58:44Z                      
                                    acdd:1.3                                    
http://wiki.esipfed.org/index.php?title=Category:Attribute_Conventions_Dataset_Discovery
--------------------------------------------------------------------------------
                               Corrective Actions                               
ru29-20150623T1046.nc3.nc has 11 potential issues


                               Highly Recommended                               
--------------------------------------------------------------------------------
Global Attributes
* Conventions does not contain 'ACDD-1.3'

variable "conductivity" missing the following attributes:
* coverage_content_type

variable "density" missing the following attributes:
* coverage_content_type

variable "platform_meta" missing the following attributes:
* coverage_content_type
* standard_name

variable "pressure" missing the following attributes:
* coverage_content_type

variable "salinity" missing the following attributes:
* coverage_content_type

variable "temperature" missing the following attributes:
* coverage_content_type

variable "u" missing the following attributes:
* coverage_content_type

variable "v" missing the following attributes:
* coverage_content_type


                                  Recommended                                   
--------------------------------------------------------------------------------
Global Attributes
* geospatial_bounds not present
* geospatial_bounds_crs not present
* geospatial_bounds_vertical_crs not present
* time_coverage_duration not present
* time_coverage_resolution not present

time_coverage_extents_match
* Failed to retrieve and convert times for variables time.

This Compliance Checker Report can be used to identify where file meta data can be improved. A strong meta data record allows for greater utility of the data for a broader audience of data analysts.