wavy ==== .. py:module:: wavy Submodules ---------- .. toctree:: :maxdepth: 1 /autoapi/wavy/GPfcts/index /autoapi/wavy/ais_module/index /autoapi/wavy/apps/index /autoapi/wavy/collocation_module/index /autoapi/wavy/consolidate/index /autoapi/wavy/credentials/index /autoapi/wavy/filter_module/index /autoapi/wavy/grid_readers/index /autoapi/wavy/grid_stats/index /autoapi/wavy/gridder_module/index /autoapi/wavy/init_class_insitu/index /autoapi/wavy/init_class_mod/index /autoapi/wavy/init_class_sat/index /autoapi/wavy/insitu_collectors/index /autoapi/wavy/insitu_module/index /autoapi/wavy/insitu_readers/index /autoapi/wavy/model_module/index /autoapi/wavy/model_readers/index /autoapi/wavy/multiins/index /autoapi/wavy/multisat_module/index /autoapi/wavy/ncmod/index /autoapi/wavy/quicklookmod/index /autoapi/wavy/satellite_collectors/index /autoapi/wavy/satellite_module/index /autoapi/wavy/satellite_readers/index /autoapi/wavy/triple_collocation/index /autoapi/wavy/utils/index /autoapi/wavy/validationmod/index /autoapi/wavy/wconfig/index Classes ------- .. autoapisummary:: wavy.sc wavy.ms wavy.mc wavy.ic wavy.cc wavy.cs wavy.pc wavy.gc Package Contents ---------------- .. py:class:: sc(**kwargs) Bases: :py:obj:`wavy.quicklookmod.quicklook_class_sat`, :py:obj:`wavy.filter_module.filter_class` Class to handle netcdf files containing satellite altimeter data e.g.: Hs[time], lat[time], lon[time], time[time] .. py:attribute:: sd .. py:attribute:: ed .. py:attribute:: nID .. py:attribute:: name .. py:attribute:: varalias .. py:attribute:: units .. py:attribute:: stdvarname .. py:attribute:: twin .. py:attribute:: distlim .. py:attribute:: filter .. py:attribute:: cfg .. py:attribute:: poi .. py:method:: download(path=None, nproc=1, **kwargs) .. py:method:: _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 .. py:method:: list_input_files(show=False, **kwargs) .. py:method:: crop_to_poi(**kwargs) .. py:method:: crop_to_region(region, **kwargs) .. py:method:: _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 .. py:method:: _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 .. py:method:: _enforce_longitude_format(**kwargs) .. py:method:: _enforce_meteorologic_convention(**kwargs) .. py:method:: _change_varname_to_aliases(**kwargs) .. py:method:: _change_stdvarname_to_cfname(**kwargs) .. py:method:: populate(**kwargs) .. py:method:: drop_duplicates(dim='time', keep='first') .. py:method:: _match_poi(poi) return: idx that match to region .. py:method:: _poi_sat(ds, twin, distlim, poi, ridx, i) :staticmethod: return: indices for values matching the spatial and temporal constraints .. py:method:: _match_region(LATS, LONS, region, grid_date) :staticmethod: Function to filter satellite data according to region return: indices that match the region .. py:method:: compute_pulse_limited_footprint_radius() Compute pulse limited footprint size .. py:method:: crop_to_period(**kwargs) Function to crop the variable dictionary to a given period .. py:method:: 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: .. code :: sco.get_item_parent('m','units') .. py:method:: 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: .. code :: sco.get_item_child('time') .. py:class:: ms(**kwargs) Bases: :py:obj:`wavy.quicklookmod.quicklook_class_sat`, :py:obj:`wavy.filter_module.filter_class` Class to combine multiple satellite datasets .. py:attribute:: nID .. py:attribute:: name .. py:attribute:: varalias .. py:attribute:: stdvarname .. py:attribute:: units .. py:attribute:: sd .. py:attribute:: ed .. py:attribute:: twin .. py:attribute:: distlim .. py:attribute:: region .. py:attribute:: path .. py:attribute:: wavy_path .. py:attribute:: vars .. py:attribute:: ocos .. py:attribute:: obsname :value: 'consolidated-obs' .. py:attribute:: obstype :value: 'consolidated-obs' .. py:attribute:: label :value: 'consolidated-obs' .. py:method:: crop_to_period(**kwargs) Function to crop the variable dictionary to a given period .. py:class:: mc(**kwargs) Bases: :py:obj:`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. .. py:attribute:: sd .. py:attribute:: ed .. py:attribute:: nID .. py:attribute:: model .. py:attribute:: varalias .. py:attribute:: units .. py:attribute:: stdvarname .. py:attribute:: distlim .. py:attribute:: filter .. py:attribute:: region .. py:attribute:: leadtime .. py:attribute:: cfg .. py:method:: crop_to_period(**kwargs) Function to crop the variable dictionary to a given period .. py:method:: 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: .. code :: sco.get_item_parent('m','units') .. py:method:: 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: .. code :: sco.get_item_child('time') .. py:method:: _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 .. py:method:: _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 .. py:method:: _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 .. py:method:: _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 .. py:method:: _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 .. py:method:: list_input_files(show=False, **kwargs) .. py:method:: _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 .. py:method:: _enforce_longitude_format(**kwargs) .. py:method:: _enforce_meteorologic_convention(**kwargs) .. py:method:: _change_varname_to_aliases(**kwargs) .. py:method:: _change_stdvarname_to_cfname(**kwargs) .. py:method:: populate(**kwargs) .. py:class:: ic(**kwargs) Bases: :py:obj:`wavy.quicklookmod.quicklook_class_sat`, :py:obj:`wavy.filter_module.filter_class` Class to handle insitu based time series. .. py:attribute:: twin .. py:attribute:: sd .. py:attribute:: ed .. py:attribute:: nID .. py:attribute:: name .. py:attribute:: varalias .. py:attribute:: units .. py:attribute:: stdvarname .. py:attribute:: distlim .. py:attribute:: filter .. py:attribute:: region .. py:attribute:: cfg .. py:method:: download(path=None, nproc=1, **kwargs) .. py:method:: _create_pathlst(**kwargs) .. py:method:: list_input_files(show=False, **kwargs) .. py:method:: _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 .. py:method:: _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 .. py:method:: _enforce_longitude_format(ds) :staticmethod: .. py:method:: _enforce_meteorologic_convention(**kwargs) .. py:method:: _change_varname_to_aliases(**kwargs) .. py:method:: _change_stdvarname_to_cfname() .. py:method:: _return_extension(fstr: str) :staticmethod: .. py:method:: populate(**kwargs) .. py:method:: get_item_parent(item, attr) .. py:method:: get_item_child(item) .. py:class:: cc(oco=None, model=None, poi=None, leadtime=None, varalias=None, **kwargs) Bases: :py:obj:`wavy.quicklookmod.quicklook_class_sat` draft of envisioned collocation class object .. py:attribute:: varalias :value: None .. py:attribute:: varalias_obs .. py:attribute:: varalias_mod :value: None .. py:attribute:: model :value: None .. py:attribute:: leadtime :value: None .. py:attribute:: oco :value: None .. py:attribute:: nID .. py:attribute:: obstype :value: '' .. py:attribute:: units .. py:attribute:: stdvarname .. py:attribute:: region .. py:attribute:: sd .. py:attribute:: ed .. py:attribute:: twin .. py:attribute:: distlim .. py:attribute:: method .. py:attribute:: colloc_time_method .. py:attribute:: nproc .. py:attribute:: res .. py:method:: populate(**kwargs) .. py:method:: _build_xr_dataset(results_dict, **kwargs) .. py:method:: _drop_duplicates(**kwargs) .. py:method:: _collocate_field(mco, tmp_dict, **kwargs) Some info .. py:method:: _collocate_track(**kwargs) Some info .. py:method:: _collocate_centered_model_value(time, lon, lat, **kwargs) .. py:method:: _collocate_regridded_model(**kwargs) .. py:method:: collocate(**kwargs) get obs value for model value for given temporal and spatial constraints .. py:method:: validate_collocated_values(**kwargs) .. py:class:: cs(ocos, **kwargs) Bases: :py:obj:`wavy.quicklookmod.quicklook_class_sat`, :py:obj:`wavy.filter_module.filter_class` Class to consolidate multiple wavy objects .. py:attribute:: ocos .. py:attribute:: varalias .. py:attribute:: stdvarname .. py:attribute:: units .. py:attribute:: sd .. py:attribute:: ed .. py:attribute:: vars .. py:attribute:: twin .. py:attribute:: distlim .. py:attribute:: region .. py:attribute:: obsname :value: 'consolidated-obs' .. py:attribute:: obstype :value: 'consolidated-obs' .. py:attribute:: label :value: 'consolidated-obs' .. py:attribute:: name :value: 'consolidated-names' .. py:attribute:: nID :value: 'consolidated-nIDs' .. py:attribute:: sensor :value: 'consolidated-sensors' .. py:method:: rename_consolidate_object_parameters(**kwargs) .. py:class:: pc(poi: dict, **kwargs) Bases: :py:obj:`wavy.quicklookmod.quicklook_class_sat`, :py:obj:`wavy.filter_module.filter_class` Class to handle poi based time series. .. py:attribute:: nID .. py:attribute:: varalias .. py:attribute:: sd .. py:attribute:: ed .. py:attribute:: stdvarname .. py:attribute:: units .. py:attribute:: twin .. py:attribute:: distlim .. py:attribute:: filter .. py:attribute:: region .. py:attribute:: name .. py:attribute:: vars .. py:method:: _build_xr_ds(poi) .. py:method:: crop_to_period(**kwargs) Function to crop the variable dictionary to a given period .. py:class:: gc(oco=None, mco=None, cco=None, bb=None, grid='lonlat', res=(1, 1), **kwargs) .. py:attribute:: mvals :value: None .. py:attribute:: bb :value: None .. py:attribute:: res :value: (1, 1) .. py:attribute:: grid :value: 'lonlat' .. py:attribute:: ovals_clean .. py:attribute:: mvals_clean .. py:attribute:: Midx_clean .. py:method:: create_grid_coords() returns grid coordinates .. py:method:: get_obs_grid_idx() .. py:method:: assign_obs_to_grid(glons, glats, olons, olats, res) :staticmethod: assigns observation coordinates to grid indices .. py:method:: clean_Midx(Midx, ovals, mvals, glons, glats) :staticmethod: cleans Midx and observations (ovals) for grid cells outside bb .. py:method:: region_filter() :staticmethod: .. py:method:: get_grid_idx(Midx) :staticmethod: .. py:method:: calc_mean(gidx, ovals) :staticmethod: .. py:method:: rm_used_idx_from_Midx(gidx, Midx) :staticmethod: .. py:method:: get_exteriors(glons, glats, res) :staticmethod: .. py:method:: grid_view(metric, mask_metric_llim, mask_metric, **kwargs) .. py:method:: quicklook(metric='mor', mask_metric_llim=10, mask_metric='nov', **kwargs)