Toggle navigation
Ocean Color Science Software
Jump to content
ocssw
V2022
web
ocssw
ocssw_src
src
nav_seahawk
hawknav
get_ncdf_object.py
Go to the documentation of this file.
1
def
get_ncdf_object
(file,group,object):
2
# Program to read a data object from a NetCDF file
3
# Liang Hong, 2/11/2020
4
5
from
netCDF4
import
Dataset
6
7
nc_fid = Dataset(file,
'r'
)
8
ngid = nc_fid.groups[group]
9
data = ngid.variables[object][:].data
10
nc_fid.close()
11
12
return
data
13
get_ncdf_object.get_ncdf_object
def get_ncdf_object(file, group, object)
Definition:
get_ncdf_object.py:1