pacificclimate / data-prep-actions

Data Preparation actions - record of ephemera used to prepare data for PCIC data portals and other tools
0 stars 0 forks source link

ncWMS testing script stops after a single missing file #48

Closed corviday closed 3 years ago

corviday commented 3 years ago

Currently, if the GetCapabilities call returns a 400, the ncWMS checking script stops.

Now checking x/storage/data/climate/CLIMDEX/CMIP5/multidecadal_means/CSIRO-QCCCE/CSIRO-Mk3-6-0/rcp26/monClim/atmos/aMon/r5i1p1/v20141101/rx5dayETCCDI/rx5dayETCCDI_aMon_CSIRO-Mk3-6-0_rcp26_r5i1p1_20400101-20691231.nc
  ERROR: GetCapabilities returned 400 (There is no dataset with ID x/storage/data/climate/CLIMDEX/CMIP5/multidecadal_means/CSIRO-QCCCE/CSIRO-Mk3-6-0/rcp26/monClim/atmos/aMon/r5i1p1/v20141101/rx5dayETCCDI/rx5dayETCCDI_aMon_CSIRO-Mk3-6-0_rcp26_r5i1p1_20400101-20691231.nc)
Traceback (most recent call last):
  File "ncWMS-check.py", line 92, in <module>
    layers = cap_metadata['WMT_MS_Capabilities']['Capability']['Layer']['Layer']['Layer']
KeyError: 'WMT_MS_Capabilities'

It would be nice if the script kept running so you could see all missing files in one go. This would mean skipping the remainder of the checks for a given file if GetCapabilities failed.