wavy.ncmod
This module encompasses classes and methods to read and write to netcdf files from model, station, or satellite output. I try to mostly follow the PEP convention for python code style. Constructive comments on style and effecient programming are most welcome!
Attributes
definition of some global functions |
Functions
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Function from: |
|
Returns dict of netcdf-file content |
|
fct to find a specific attribute with its value in a netcdf-file |
|
Module Contents
- wavy.ncmod.insitu_dict
- wavy.ncmod.satellite_dict
- wavy.ncmod.variable_info
definition of some global functions
- wavy.ncmod.check_if_ncfile_accessible(fstr, **kwargs)
- wavy.ncmod.read_netcdfs(paths, dim='time', decode_times=None, use_cftime=None, **kwargs)
- wavy.ncmod.build_usr_pw_path(path, remoteHostName, usr, pw)
- wavy.ncmod.read_netcdfs_with_credentials_aggregated(path, remoteHostName, usr, pw, decode_times=None, use_cftime=None)
- wavy.ncmod.read_netcdfs_naive(paths, varnames, varalias, **kwargs)
- wavy.ncmod.process_one_path_netCDF4(path: str, varnames: dict, varalias: str)
- wavy.ncmod.consolidate_darrays(darrays: list) numpy.ndarray
- wavy.ncmod.build_xr_ds(darray: numpy.ndarray, varnames: dict, varalias: str)
- wavy.ncmod.build_xr_ds_multivar(darray: numpy.ndarray, varnames: dict, varalias: list)
- wavy.ncmod.build_xr_ds_from_dict(dict_var, var_name_ref)
- wavy.ncmod.read_netcdfs_KF(paths, dim='time')
- wavy.ncmod.read_mf_netcdfs(paths)
- wavy.ncmod.process_one_path_lru(path, t, varname)
- wavy.ncmod.process_one_path(path, t, varname)
- wavy.ncmod.read_netcdfs_sel_lru(paths, dlst, varname, dim='time', **kwargs)
- wavy.ncmod.read_netcdfs_sel(paths, dlst, varname, dim='time', **kwargs)
- wavy.ncmod.get_swim_var_coords(varalias)
- wavy.ncmod.read_swim_nc(path, varnamedict)
- wavy.ncmod.read_swim_netcdfs(pathlst, varalias)
- wavy.ncmod.get_arcmfc_ts(pathtofile)
- wavy.ncmod.get_arcmfc_stats(pathtofile)
- wavy.ncmod.get_filevarname(varalias, variable_info, srcdict, ncdict, **kwargs)
- wavy.ncmod.get_filevarname_list(varalias, variable_info, srcdict, ncdict, **kwargs)
- wavy.ncmod.get_nc_ts(pathtofile, varlst, **kwargs)
- wavy.ncmod.get_varlst_from_nc_1D(pathtofile, varlst, sdate, edate)
- wavy.ncmod.dumptonc_stats(pathtofile, title, time_dt, time_unit, valid_dict)
check if nc file already exists
if so use append mode
if not create file
- wavy.ncmod.ncdump(nc_fid, verb=True)
Function from: http://schubert.atmos.colostate.edu/~cslocum/netcdf_example.html # ncdump outputs dimensions, variables and their attribute information. The information is similar to that of NCAR’s ncdump utility. ncdump requires a valid instance of Dataset. # Parameters ———- nc_fid : netCDF4.Dataset
A netCDF4 dateset object
- verbBoolean
whether or not nc_attrs, nc_dims, and nc_vars are printed
# Returns ——- nc_attrs : list
A Python list of the NetCDF file global attributes
- nc_dimslist
A Python list of the NetCDF file dimensions
- nc_varslist
A Python list of the NetCDF file variables
- wavy.ncmod.ncdumpMeta(pathtofile)
Returns dict of netcdf-file content Input: str pointing to netcdf-file Output: dict of attributes
- wavy.ncmod.find_attr_in_nc(attrstr, pathtofile=None, ncdict=None, subattrstr=None)
fct to find a specific attribute with its value in a netcdf-file when only a fraction of attribute name is given, can also search in a deeper layer of attribute hierarchy. input: path to the nc-file or ncdict
string of desired attribute string of desired sub-attribute (optional)
output: dict
- wavy.ncmod.get_varname_for_cf_stdname_in_ncfile(ncdict, stdname)