wavy

Submodules

Classes

sc

Class to handle netcdf files containing satellite altimeter data

ms

Class to combine multiple satellite datasets

mc

class to read and process model data

ic

Class to handle insitu based time series.

cc

draft of envisioned collocation class object

cs

Class to consolidate multiple wavy objects

pc

Class to handle poi based time series.

gc

Package Contents

class wavy.sc(**kwargs)

Bases: wavy.quicklookmod.quicklook_class_sat, wavy.filter_module.filter_class

Class to handle netcdf files containing satellite altimeter data e.g.: Hs[time], lat[time], lon[time], time[time]

sd
ed
nID
name
varalias
units
stdvarname
twin
distlim
filter
cfg
poi
download(path=None, nproc=1, **kwargs)
_get_files(dict_for_sub=None, path=None, wavy_path=None, **kwargs)

Function to retrieve list of files/paths for available locally stored satellite data. This list is used for other functions to query and parsing.

param:

sd - start date (datetime object) ed - end date (datetime object) twin - time window (temporal constraint) in minutes nID - nID as of satellite_cfg.yaml dict_for_sub - dictionary for substitution in templates path - a path if defined

return:

pathlst - list of paths

list_input_files(show=False, **kwargs)
crop_to_poi(**kwargs)
crop_to_region(region, **kwargs)
_get_sat_ts_blunt(**kwargs)

Main function to obtain data from satellite missions. reads files, apply region and temporal filter

fct is insensitive to region

return: adjusted dictionary according to spatial and

temporal constraints

_get_sat_ts(**kwargs)

Main function to obtain data from satellite missions. reads files, apply region and temporal filter

fct will crop to region on the fly if given in init kwargs chunk_size determines number of files read before region filter

return: adjusted dictionary according to spatial and

temporal constraints

_enforce_longitude_format(**kwargs)
_enforce_meteorologic_convention(**kwargs)
_change_varname_to_aliases(**kwargs)
_change_stdvarname_to_cfname(**kwargs)
populate(**kwargs)
drop_duplicates(dim='time', keep='first')
_match_poi(poi)

return: idx that match to region

static _poi_sat(ds, twin, distlim, poi, ridx, i)
return: indices for values matching the spatial and

temporal constraints

static _match_region(LATS, LONS, region, grid_date)

Function to filter satellite data according to region return:

indices that match the region

compute_pulse_limited_footprint_radius()

Compute pulse limited footprint size

crop_to_period(**kwargs)

Function to crop the variable dictionary to a given period

get_item_parent(item, attr)

Offers possibility to explore netcdf meta info. by specifying what you are looking for (item), e.g. part of a string, and in which attribute (attr), e.g. standard_name, this function returns the parent parameter name of the query string.

param:

item - (partial) string e.g. [m] attr - attribute e.g. units

return: list of matching parameter strings

e.g. for satellite_class object sco:

sco.get_item_parent('m','units')
get_item_child(item)

Gets all attributes connected to given parameter name.

param:

item - (partial) string e.g. [m]

return: matching parameter string

e.g. for satellite_class object sco:

sco.get_item_child('time')
class wavy.ms(**kwargs)

Bases: wavy.quicklookmod.quicklook_class_sat, wavy.filter_module.filter_class

Class to combine multiple satellite datasets

nID
name
varalias
stdvarname
units
sd
ed
twin
distlim
region
path
wavy_path
vars
ocos
obsname = 'consolidated-obs'
obstype = 'consolidated-obs'
label = 'consolidated-obs'
crop_to_period(**kwargs)

Function to crop the variable dictionary to a given period

class wavy.mc(**kwargs)

Bases: wavy.quicklookmod.quicklook_class_sat

class to read and process model data model: e.g. Hs[time,lat,lon], lat[rlat,rlon], lon[rlat,rlon] This class should communicate with the satellite, model, and station classes.

sd
ed
nID
model
varalias
units
stdvarname
distlim
filter
region
leadtime
cfg
crop_to_period(**kwargs)

Function to crop the variable dictionary to a given period

get_item_parent(item, attr)

Offers possibility to explore netcdf meta info. by specifying what you are looking for (item), e.g. part of a string, and in which attribute (attr), e.g. standard_name, this function returns the parent parameter name of the query string.

param:

item - (partial) string e.g. [m] attr - attribute e.g. units

return: list of matching parameter strings

e.g. for satellite_class object sco:

sco.get_item_parent('m','units')
get_item_child(item)

Gets all attributes connected to given parameter name.

param:

item - (partial) string e.g. [m]

return: matching parameter string

e.g. for satellite_class object sco:

sco.get_item_child('time')
_get_model_filedate(fc_date, leadtime, **kwargs)

get init_date for latest model output file and checks if available

param:

fc_date - datetime object leadtime - integer in hours

return:

suitable datetime to create model filename

_make_model_filename(fc_date, leadtime, **kwargs)

creates/returns filename based on fc_date,leadtime

param: fc_date - datetime object leadtime - integer in hours

return:

filename (consists of path + filename)

comment:
  • special characters are escaped by adding “"

  • the escapes need to be removed for certain libraries like xarray and netCDF4

_make_model_filename_wrapper(fc_date, leadtime, **kwargs)

Wrapper function of make_model_filename. Organizes various cases.

param:

model - modelname type(str) fc_date - datetime object leadtime - integer in hours

return:

filename

_make_list_of_model_filenames(fc_dates, lt, **kwargs)
return: flst - list of model files to be opened

dlst - list of dates to be chosen within each file

_get_files(dict_for_sub=None, path=None, wavy_path=None, **kwargs)

Function to retrieve list of files/paths for available locally stored data. This list is used for other functions to query and parsing.

param:

sd - start date (datetime object) ed - end date (datetime object) nID - nID as of model_cfg.yaml dict_for_sub - dictionary for substitution in templates path - a path if defined

return:

pathlst - list of paths filelst - list of files

list_input_files(show=False, **kwargs)
_get_model(**kwargs)

Main function to obtain data from satellite missions. reads files, apply region and temporal filter

return: adjusted dictionary according to spatial and

temporal constraints

_enforce_longitude_format(**kwargs)
_enforce_meteorologic_convention(**kwargs)
_change_varname_to_aliases(**kwargs)
_change_stdvarname_to_cfname(**kwargs)
populate(**kwargs)
class wavy.ic(**kwargs)

Bases: wavy.quicklookmod.quicklook_class_sat, wavy.filter_module.filter_class

Class to handle insitu based time series.

twin
sd
ed
nID
name
varalias
units
stdvarname
distlim
filter
region
cfg
download(path=None, nproc=1, **kwargs)
_create_pathlst(**kwargs)
list_input_files(show=False, **kwargs)
_get_files(dict_for_sub=None, path=None, wavy_path=None, **kwargs)

Function to retrieve list of files/paths for available locally stored data. This list is used for other functions to query and parsing.

param:

sd - start date (datetime object) ed - end date (datetime object) nID - nID as of model_cfg.yaml dict_for_sub - dictionary for substitution in templates path - a path if defined

return:

pathtotals - list of paths

_get_insitu_ts(**kwargs)

Main function to obtain data from insitu locations. reads files, apply region and temporal filter

return: adjusted dictionary according to spatial and

temporal constraints

static _enforce_longitude_format(ds)
_enforce_meteorologic_convention(**kwargs)
_change_varname_to_aliases(**kwargs)
_change_stdvarname_to_cfname()
static _return_extension(fstr: str)
populate(**kwargs)
get_item_parent(item, attr)
get_item_child(item)
class wavy.cc(oco=None, model=None, poi=None, leadtime=None, varalias=None, **kwargs)

Bases: wavy.quicklookmod.quicklook_class_sat

draft of envisioned collocation class object

varalias = None
varalias_obs
varalias_mod = None
model = None
leadtime = None
oco = None
nID
obstype = ''
units
stdvarname
region
sd
ed
twin
distlim
method
colloc_time_method
nproc
res
populate(**kwargs)
_build_xr_dataset(results_dict, **kwargs)
_drop_duplicates(**kwargs)
_collocate_field(mco, tmp_dict, **kwargs)

Some info

_collocate_track(**kwargs)

Some info

_collocate_centered_model_value(time, lon, lat, **kwargs)
_collocate_regridded_model(**kwargs)
collocate(**kwargs)
get obs value for model value for given

temporal and spatial constraints

validate_collocated_values(**kwargs)
class wavy.cs(ocos, **kwargs)

Bases: wavy.quicklookmod.quicklook_class_sat, wavy.filter_module.filter_class

Class to consolidate multiple wavy objects

ocos
varalias
stdvarname
units
sd
ed
vars
twin
distlim
region
obsname = 'consolidated-obs'
obstype = 'consolidated-obs'
label = 'consolidated-obs'
name = 'consolidated-names'
nID = 'consolidated-nIDs'
sensor = 'consolidated-sensors'
rename_consolidate_object_parameters(**kwargs)
class wavy.pc(poi: dict, **kwargs)

Bases: wavy.quicklookmod.quicklook_class_sat, wavy.filter_module.filter_class

Class to handle poi based time series.

nID
varalias
sd
ed
stdvarname
units
twin
distlim
filter
region
name
vars
_build_xr_ds(poi)
crop_to_period(**kwargs)

Function to crop the variable dictionary to a given period

class wavy.gc(oco=None, mco=None, cco=None, bb=None, grid='lonlat', res=(1, 1), **kwargs)
mvals = None
bb = None
res = (1, 1)
grid = 'lonlat'
ovals_clean
mvals_clean
Midx_clean
create_grid_coords()

returns grid coordinates

get_obs_grid_idx()
static assign_obs_to_grid(glons, glats, olons, olats, res)

assigns observation coordinates to grid indices

static clean_Midx(Midx, ovals, mvals, glons, glats)

cleans Midx and observations (ovals) for grid cells outside bb

static region_filter()
static get_grid_idx(Midx)
static calc_mean(gidx, ovals)
static rm_used_idx_from_Midx(gidx, Midx)
static get_exteriors(glons, glats, res)
grid_view(metric, mask_metric_llim, mask_metric, **kwargs)
quicklook(metric='mor', mask_metric_llim=10, mask_metric='nov', **kwargs)