NetCDF IO
The NetCDF implementation of the medsrtqc.core.Profile gives developers
and users access to more than 2 million profiles available on the Argo
GDAC for testing purposes. You can also run production QC tests on NetCDF
files if generating them in advance simplifies the workflow. Most users
will only ever use read_nc_profile().
- medsrtqc.nc.read_nc_profile(*src, mode='r')
Load a
medsrtqc.Profilebacked by a NetCDF file. For details on the underlying data structure, seeNetCDFProfile.- Parameters:
src – One or more URLs, filename, bytes, or existing ``netCDF4.Dataset``s. If more than one is passed, the first data set will mask variables available in subsequent data sets. This is useful for combining BGC and core files.
>>> from medsrtqc.nc import read_nc_profile >>> from medsrtqc.resources import resource_path >>> profile = read_nc_profile(resource_path('BR2902746_001.nc')) >>> profile['TEMP']
- medsrtqc.nc.load(src, mode='r')
Load a
netCDF4.Datasetfrom a filename, url, bytes, or existingnetCDF4.Dataset. This is applied to anywhere a NetCDF file must be specified.- Parameters:
src – A URL, filename, bytes, or existing
netCDF4.Datasetmode – Use
'r+'to allow updates.
- class medsrtqc.nc.NetCDFProfile(*dataset)
A
medsrtqc.core.Profileimplementation backed by anetCDF4.Datasetrepresentation of an Argo profile NetCDF file. The NetCDF files should be single-cycle NetCDFs; however, you can pass more than one to include variables from multiple files (e.g., a core and a BGC file). When this is the case, the variables from the first file mask those of subsequent files. These objects are normally created fromread_nc_profile().