:py:mod:`wolfhece.mar.commontools` ================================== .. py:module:: wolfhece.mar.commontools .. autoapi-nested-parse:: Created on Mon Dec 5 09:03:34 2022 @author: jbrajkovic Module Contents --------------- .. py:function:: openfile(fileloc, col) .. py:function:: openfileh(fileloc, col) .. py:function:: isbis(year) .. py:function:: seasonalmeans(fileloc, col, start_year, end_year, mod, season) .. py:function:: seasonalsums(fileloc, col, start_year, end_year, mod, season) .. py:function:: text_into_matrix(model_name, scenario, mx, my, sy, ey) This function reads precipitation text files to put all of it in a 3D matrix of yearly precipitation .. py:function:: slidingmeans(TS, interval, std_or_mean=1) .. py:function:: RGPD(vec, shape, scale, pu, teta, th) .. py:function:: GPD_frequency(valu, shape, scale, pu, teta, th, events_per_year) .. py:function:: RGPDI_values(vec, shape, scale, th) .. py:function:: RGPD_values(vec, shape, scale) .. py:function:: CIGPD(vec, shape, scale, pu, teta, th, varsc, varsh, cov) .. py:function:: JJ2date(day, year) .. py:function:: date2JJ(day, month, year, fn1='__', type_mod=2) .. py:function:: makebounds(mat, step) .. py:function:: map_belgium(ax, lons, lats) .. py:function:: map_belgium_J21(ax, lons, lats) .. py:function:: map_Vesdre(ax, lons, lats) .. py:function:: map_belgium_zoom(ax, lons, lats) .. py:function:: map_Europe(ax, lons, lats) .. py:function:: mean_netcdf_alldomain(start_year, end_year, direct, var) .. py:function:: quick_map_plot(lons, lats, mat, bounds, cmap, MSK=np.zeros(0), nticks=4) .. py:function:: quick_map_plot2(lons, lats, mat, bounds, cmap, ax) .. py:function:: mask_belgium(lon, lat, path_in, path_out, center_or_all=2) This routine takes as arguments: -The longitudes and latitudes of the netcdf (gridded) -a .tif file of the mask we want to create (tif must be in epsg:31370 lambbert 72) and creates a mask at the resolution of the input netcdf which is saved as netcdf in path_out L'option center_or_all precise si l'on souhaite qu'un des 4 coins des pixels chosisis soient à l'intérieur de la zone ou si on regarde uniquement le centre. Si center_or_all vaut 1, on ragarde uniquement le centre et donc le masque sera plus petit conseil : raster d'une résolution 100 mètres en input' .. py:function:: mask_belgiumV2(lon, lat, path_in, path_out, center_or_all=2, discheck=300000, buffer=2) This routine takes as arguments: -The longitudes and latitudes of the netcdf (gridded) -a .tif file of the mask we want to create (tif must be in epsg:31370 lambbert 72) and creates a mask at the resolution of the input netcdf which is saved as netcdf in path_out L'option center_or_all precise si l'on souhaite qu'un des 4 coins des pixels chosisis soient à l'intérieur de la zone ou si on regarde uniquement le centre. Si center_or_all vaut 1, on ragarde uniquement le centre et donc le masque sera plus petit conseil : raster d'une résolution 100 mètres en input' .. py:function:: dis2pix(lat1, lon1, lat2, lon2) .. py:function:: anomaly_cmap() .. py:function:: grid_mean(folder, year, var, season, sum_or_mean=0, nts=24, lev=0, nf=0, fn1='__') .. py:function:: find_pix_be(lon_p, lat_p, lons, lats) .. py:function:: find_MARs_closest_pixel(lonsm, latsm, lonsi, latsi, neighbours=1) .. py:function:: IPCC_cmap() .. py:function:: draw_cities(m, fs_c=14, fs_C=16) .. py:function:: draw_stations(m, n_id=1, fs=8) .. py:function:: box_plot(data, edge_color, fill_color, ax) .. py:function:: endmonth(year) .. py:function:: radar_coord() .. py:function:: marray(ds, var) .. py:function:: marrayV2(ds, var) .. py:function:: RGEV(retp, nyears, loc, sca, sha) .. py:function:: GEV_frequency(value, loc, sca, sha) .. py:function:: GEVCI(retp, loc, sc, sh, varloc, varsc, varsh, covlocsc, covlocsh, covscsh) .. py:function:: gumCI(retp, loc, sc, varloc, varsc, covlocsc) .. py:function:: RGum(retp, nyears, loc, sca) .. py:function:: Gum_frequency(value, loc, sca) .. py:function:: extreme_matrix(fn, ret_per=20, value=50, mx=80, my=50, abs_or_retour=1, ydays=365, start_year=2011, end_year=2040, nts=24, gpd_gev_gum=0) .. py:function:: extreme_matrix_V2(fn, ret_per=20, value=50, mx=80, my=50, abs_or_retour=1, ydays=365, start_year=2011, end_year=2040, nts=24, gpd_gev_gum=0, unst_st=0, var_unst='MKam', y_unst=2021) .. py:function:: find_clusters(TS1) .. py:function:: df_from_file(fn)