pyClimat package
Submodules
pyClimat.analysis module
Created on Thu Jul 29 18:49:19 2021
@author: dboateng Contains analysis routine required for calculation, extracting variables and domain, masking out areas and certian statistics.
- pyClimat.analysis.EOF_analysis(data, maxlon, minlon, maxlat, minlat, return_variance=False, return_pcs=False, season=None, standardized=None, apply_coslat_weights=None, neofs=None, pcscaling=None, neigs=None, npcs=None, lev=None)[source]
# the projectField function can be used to generate corresponding set of pseudo-PCs using different data field
- dataTYPE: datarray
DESCRIPTION. Dataset required for EOF analysis (eg. slp or geopoth500)
- maxlonTYPE: float
DESCRIPTION.: Maximum longitude
- minlonTYPE: float
DESCRIPTION: Minimum longitude
- maxlatTYPE: float
DESCRIPTION:Maximum latitude
- minlatTYPE: float
DESCRIPTION: Minimum latitude
- return_varianceTYPE: Boolean, optional
DESCRIPTION. The default is False. If estimated varainces of the eofs are required as ouput
- return_pcsTYPE: Boolean, optional
DESCRIPTION. The default is False. If the extracted pca series are required as ouput
- seasonTYPE:STR, optional
DESCRIPTION. The default is None. Name of the season eg. DFJ, JJA
- standardizedTYPE: Boolean, optional
DESCRIPTION. The default is None. True to standardized anomalies before EOF analysis
- apply_coslat_weightsTYPE: Boolean, optional
DESCRIPTION. The default is None. True to apply coslat area weights before the EOF analysis
- neofsTYPE: Float, optional
DESCRIPTION. The default is None. The no. of PCA to perform on the dataset
- pcscalingTYPE: Int, optional
DESCRIPTION. The default is None. 0 : Unsclaed PCS, 1: Scaled to Unit variance, 2: PCs are multiplied by the square-root of their eigen values
- neigsTYPE: Int, optional
DESCRIPTION. The default is None. the no. of eigenvalues to return fraction variance
- npcsTYPE:Int, optional
DESCRIPTION. The default is None. The no. of pcs retrieve
- levTYPE: float, optional
DESCRIPTION. The default is None. Vertical level if the dataset is on hybrid levels (eg. 500 for geopoth)
- TYPE
DESCRIPTION. eofs: covariance matrix between the npcs time series and eofs input time series pcs: Principal Component time series var_frac: variance fraction of the estimated eigen values
- pyClimat.analysis.compute_lterm_diff(data_control, data_main, time='annual', month=None, season=None, season_calendar=None)[source]
- data_controlTYPE: datarray
DESCRIPTION. Reference or control data
- data_mainTYPE: dataarray
DESCRIPTION. : Main module run data
- timeTYPE: STR, optional
DESCRIPTION. The default is “annual”. But can be changed to season or month
- monthTYPE:INT, optional
DESCRIPTION. The default is None. Define the specific month number to be computed or all will be eatimated
- seasonTYPE: STR, optional
DESCRIPTION. The default is None. Define the specific season (eg. DJF, JJA, MAM, SON) number to be computed or all will be eatimated
- season_calendarTYPE:STR, optional
DESCRIPTION. The default is None. Or Standard to consider the number of days in a month
- data_ltmean_diffTYPE: datarray
DESCRIPTION. Long-tem difference
- pyClimat.analysis.compute_lterm_mean(data, time='annual', month=None, season=None, season_calendar=None)[source]
- dataTYPE: datarray
DESCRIPTION. The var_data extracted from dataset
- timeTYPE: str, optional
DESCRIPTION. The default is “annual”. or season, month can be used for long-term estimates
- monthTYPE, optional
DESCRIPTION. The default is None.
- seasonTYPE, optional
DESCRIPTION. The default is None.
- season_calendarTYPE, optional
DESCRIPTION. The default is None. Use standard if you want to consider the days of the month into consideration
- data_ltmeanTYPE: datarray
DESCRIPTION. Long-term means
- pyClimat.analysis.correlation(dataA, dataB, max_pvalue=0.1, use_spearmanr=False, use_pearsonr=False, return_pvalue=False, maxlon=None, minlon=None, maxlat=None, minlat=None)[source]
- dataATYPE: Dataarray (3D)
DESCRIPTION. Comparison data 1
- dataBTYPE: Dataaray (3D)
DESCRIPTION. Comparison data 2
- max_pvalueTYPE: Float, optional
DESCRIPTION. The default is 0.1. The confidence interval for correlation estimation eg. 0.05 for 95%
- use_spearmanrTYPE: Boolean, optional
DESCRIPTION. The default is False. True to use spearman correlation
- use_pearsonrTYPE: Boolean, optional
DESCRIPTION. The default is False. True to use pearson correlation
- return_pvalueTYPE: Boolean, optional
DESCRIPTION. The default is False. True to retrieve pvalue as an ouput variable
- maxlonTYPE: float
DESCRIPTION.: Maximum longitude
- minlonTYPE: float
DESCRIPTION: Minimum longitude
- maxlatTYPE: float
DESCRIPTION:Maximum latitude
- minlatTYPE: float
DESCRIPTION: Minimum latitude
- ValueError
DESCRIPTION. If the required stats module for correlation analysis is not defined
- stats_resultTYPE: datarray
DESCRIPTION. Contians correlation map distribution and corresponding pvalues
- pyClimat.analysis.extract_profile(data, maxlon, minlon, maxlat, minlat, dim, to_pandas=True, sea_land_mask=False, minelev=None, maxelev=None, Dataset=None)[source]
- dataTYPE: dataarray
DESCRIPTION: Data to extract transect from base on coordinates, elevation or land sea masks
- maxlonTYPE: float
DESCRIPTION.: Maximum longitude
- minlonTYPE: float
DESCRIPTION: Minimum longitude
- maxlatTYPE: float
DESCRIPTION:Maximum latitude
- minlatTYPE: float
DESCRIPTION: Minimum latitude
- sea_land_maskTYPE: str, optional
DESCRIPTION. The default is None. Yes, means that the land mask will be selected and No means the sea nask points will be selected
- minelevTYPE, optional
DESCRIPTION. The default is None. To select data points base on the minimum elevation value
- maxelevTYPE. float, optional
DESCRIPTION. The default is None. To select data points base on the maximum elevation value
- DatasetTYPE: float, optional
DESCRIPTION. The default is None. Dataset containing geosp and slm for masking out elevation condition and continental values
- dimTYPE: str
DESCRIPTION. lat ot lon depending on the axis of the profile
- to_pandasTYPE:str, optional (recommended for plotting)
DESCRIPTION. The default is None. yes if you want the data to be stored in DataFrame or Pandas Series
- data_profTYPE: datarray or DataFrame or Pandas Series
DESCRIPTION. Data extracted along a profile (lat or lon)
- pyClimat.analysis.extract_transect(data, maxlon, minlon, maxlat, minlat, sea_land_mask=False, minelev=None, maxelev=None, Dataset=None)[source]
This function extract grid points base on coordinate extents or land sea masks or max, min elevations: it can be used to estimate the statistics of a selected domain like the Alps or Andes!
- dataTYPE: dataarray
DESCRIPTION: Data to extract transect from base on coordinates, elevation or land sea masks
- maxlonTYPE: float
DESCRIPTION.: Maximum longitude
- minlonTYPE: float
DESCRIPTION: Minimum longitude
- maxlatTYPE: float
DESCRIPTION:Maximum latitude
- minlatTYPE: float
DESCRIPTION: Minimum latitude
- sea_land_maskTYPE: str, optional
DESCRIPTION. The default is None. Yes, means that the land mask will be selected and No means the sea nask points will be selected
- minelevTYPE, optional
DESCRIPTION. The default is None. To select data points base on the minimum elevation value
- maxelevTYPE. float, optional
DESCRIPTION. The default is None. To select data points base on the maximum elevation value
- DatasetTYPE: float, optional
DESCRIPTION. The default is None. Dataset containing geosp and slm for masking out elevation condition and continental values
- data_extractTYPE
DESCRIPTION.
- pyClimat.analysis.extract_var(Dataset, varname, units=None, Dataset_wiso=None, other_data=None, lev_units=None, lev=None)[source]
This function extracts some defined variables from a netCDF file. Moreover, if the variable require calculation or unit conversion, the user speficication can be pass to such task. For example, echam out put the differrent component of precipitation (convective, large scale, etc). Therefore extraction of total precipitation would require the calculation of the total precipitation. Example of the defined variables:
“temp2” – near surface temperature “prec” – total precipitation “d18op” – O^18 isotopic composition in precipitation “d18ov” – O^18 isotopic composition in vapour “relhum” – relative humidity “elev” – topography or elevation “slm” – mean sea level pressure “evap” – evaporation “u, v, omega” – zonal, meridoinal, and vertical velocity
and others
data = xr.open_dataset(path_to_data) temp = extract_var(data, varname= “temp2”, unit= “°C”,) —> extract the t2m variable and convert it from K to °C
- DatasetTYPE: Dataset
DESCRIPTION. Processed output containing all variables or certain ones
- varnameTYPE: STR
DESCRIPTION: Name of variable (eg. temp2:Tempeature, prec:Total precipitation, d18op: d18o in precipitation)
- unitsTYPE, optional
DESCRIPTION. The default is None. Units of the variable for eg. °C for temperature or mm/month for precipitation
- Dataset_wisoTYPE, optional
DESCRIPTION. The default is None. Wiso Dataset is required for calcullating d18op and d18ov
- other_data: TYPE: datarray, optional
DESCRIPTION: Additional data required for calculating units eg. Pa/s–> m/s require temperature data on pressure levels (in K)
- lev_units: TYPE: str, optional
DESCRIPTION: Units of vertical levels eg. hPa
- lev: TYPE: int, optional
DESCRIPTION: The vertical height required for the variable, eg. 500 hPa for winds
- var_dataTYPE: datarray
DESCRIPTION: returns the variable for etracted or calculated from the Dataset (notmally monthly long-term climatologies)
- pyClimat.analysis.extract_vertical_section(data, maxlon, minlon, maxlat, minlat, dim, sea_land_mask=False, minelev=None, maxelev=None, Dataset=None, season=None, month=None)[source]
- pyClimat.analysis.linregression(data_x, data_y, season=None, month=None, return_yhat=True)[source]
- data_xTYPE: datarray
DESCRIPTION. The x-axis data for fitting
- data_yTYPE: datarray
DESCRIPTION. The y-axis data for fitting
- seasonTYPE, optional (of If specific season the data is required for fitting)
DESCRIPTION. The default is None. Date must be in seasonal coordinates for time
- monthTYPE, optional (of If specific month the data is required for fitting)
DESCRIPTION. The default is None. Date must be in monthly coordinates for time
- return_yhatTYPE, optional or if DataFrame containing all the fitting data and predictions are required
DESCRIPTION. The default is None.
- TYPE: Scipy.stats output or plus DataFrame
DESCRIPTION.
- pyClimat.analysis.student_t_test_btn_datasets(dataA, dataB, max_pvalue=0.1, return_pvalue=False, maxlon=None, minlon=None, maxlat=None, minlat=None)[source]
- dataATYPE: Dataarray (3D)
DESCRIPTION. Comparison data 1
- dataBTYPE: Dataaray (3D)
DESCRIPTION. Comparison data 2
- max_pvalueTYPE: Float, optional
DESCRIPTION. The default is 0.1. The confidence interval for correlation estimation eg. 0.05 for 95%
- return_pvalueTYPE: Boolean, optional
DESCRIPTION. The default is False. True to retrieve pvalue as an ouput variable
- maxlonTYPE: float
DESCRIPTION.: Maximum longitude
- minlonTYPE: float
DESCRIPTION: Minimum longitude
- maxlatTYPE: float
DESCRIPTION:Maximum latitude
- minlatTYPE: float
DESCRIPTION: Minimum latitude
- stats_resultTYPE
DESCRIPTION.
pyClimat.data module
Created on Wed Jul 28 16:55:45 2021
@author: Daniel Boateng
- Reading data routine for Climat (required user declarations of paths to datasets eg. Reanalysis
, ECHAM, DWD stations and Gtopo files etc)
Note: All User specifications must be declared in the control script which will import all the functions defined here
- pyClimat.data.read_ECHAM_input(main_path, exp_name, filename, read_var=False, varname=None)[source]
- main_pathTYPE: str
DESCRIPTION. Path containing all module outputs
- exp_nameTYPE:str
DESCRIPTION. Name of the experiment
- varnameTYPE: str
DESCRIPTION. Name of the input file (jan_surf file)
- dataTYPE: dataset
DESCRIPTION.
- pyClimat.data.read_ECHAM_processed(main_path, exp_name, years='1003_1017', period='1m', add_name=None, read_wiso=True)[source]
Reads output processed from ECHAM
- main_pathTYPE: STR
DESCRIPTION. directory to the main path for all module output (eg. esd02–>ESD, or local path)
- exp_nameTYPESTR
DESCRIPTION. Name of experiment output (eg. a003_hpc-bw_e5w2.3_t159_PI_Alps_east_300_t159l31.6h)
- yearsTYPE, optional
DESCRIPTION. The default is “1003_1017”. or range of year you have processed
- periodTYPE, optional
DESCRIPTION. The default is “1m”. or 1d, 1y if implemted here!
- add_nameTYPE, optional
DESCRIPTION. The default is None. or eg. _msl (for particular variable)
- dataTYPE: Dataset
DESCRIPTION. Dataset of echam ouput will some or all variables
- data_wisoTYPE: Dataset
DESCRIPTION. Dataset of echam wiso ouput will some or all variables
- pyClimat.data.read_ERA_processed(path, varname)[source]
- pathTYPE: STR
DESCRIPTION. path of the ERA dataset
- varnameTYPE:STR
DESCRIPTION. Variable name for ERA (eg. t2m for temperature, tp:precipitation)
- dataTYPE: datarray
DESCRIPTION.
- pyClimat.data.read_GNIP_data(path, filename)[source]
- pathTYPE: str
DESCRIPTION. The directory holding all the data
- filenameTYPE: str
DESCRIPTION. The name of the file
- dfTYPE: DataFrame
DESCRIPTION. Data containing lat, lon and d18op
- pyClimat.data.read_Gtopo(path, tile_name, extract_var=None)[source]
- pathTYPE: str
DESCRIPTION. directrory to all the tile files (or path to tiles)
- tile_nameTYPE: str
DESCRIPTION. Which tile to use for modification (check the image in the original files folder)
- extract_varTYPE, optionalor yes
DESCRIPTION. The default is None or To extract only the values to datarray
- TYPE: Dataset or dataarray
DESCRIPTION. It reads a particular tile file
pyClimat.gtopo module
Created on Mon Aug 2 19:27:52 2021
@author: dboateng
- pyClimat.gtopo.extract_alps(path, tile_name, minelev, extract_var=None, east_alps=None, west_alps=None, west_buffer=None, central_buffer=None, east_buffer=None)[source]
- pathTYPE: str
DESCRIPTION. The directrory to all the tile files
- tile_nameTYPE: str
DESCRIPTION. : hich tile to use for modification (check the image in the original files folder)
- minelevTYPE: float
DESCRIPTION. Minimum elevation to extaract the Alps
- extract_varTYPE, optional or yes
DESCRIPTION. The default is None or To extract only the values to datarray
- east_alpsTYPE, optional or yes
DESCRIPTION. The default is None. to mask out the eastern part
- west_alpsTYPE, optional or yes
DESCRIPTION. The default is None. Or mask ou the west part of the Alps
- west_bufferTYPE, optional
DESCRIPTION. The default is None. Or yes to apply buffer gradient
- central_bufferTYPE, optional
DESCRIPTION. The default is None. or yes to apply buffer gradient at the central Alps
- east_bufferTYPE, optional
DESCRIPTION. The default is None. or to apply buffer gradient at the eastern side after modification
- TYPE
DESCRIPTION.
- pyClimat.gtopo.modify_Gtopo(factor, part_of_alps, path_to_store, path, tile_name, minelev, extract_var=None, east_alps=None, west_alps=None, west_buffer=None, central_buffer=None, east_buffer=None)[source]
- factorTYPE: float
DESCRIPTION. The factor to multiply for changing the original topography
- part_of_alpsTYPE: str
DESCRIPTION. Eg. full or whole, East_alps, West_alps
- path_to_storeTYPE:str
DESCRIPTION. The directory to save the output
- pathTYPE: str
DESCRIPTION. The directory to load the original paths
- tile_nameTYPE: str
DESCRIPTION. : hich tile to use for modification (check the image in the original files folder)
- minelevTYPE: float
DESCRIPTION. Minimum elevation to extaract the Alps
- extract_varTYPE, optional or yes
DESCRIPTION. The default is None or To extract only the values to datarray
- east_alpsTYPE, optional or yes
DESCRIPTION. The default is None. to mask out the eastern part
- west_alpsTYPE, optional or yes
DESCRIPTION. The default is None. Or mask ou the west part of the Alps
- west_bufferTYPE, optional
DESCRIPTION. The default is None. Or yes to apply buffer gradient
- central_bufferTYPE, optional
DESCRIPTION. The default is None. or yes to apply buffer gradient at the central Alps
- east_bufferTYPE, optional
DESCRIPTION. The default is None. or to apply buffer gradient at the eastern side after modification
- DatasetTYPE: Dataset
DESCRIPTION. Returns Dataset with similar headers like the original file from Gtopo
- pyClimat.gtopo.visualise_topo(data, path_to_store, name_of_plot)[source]
The function to visualise the modified topo file
- dataTYPE: Dataset
DESCRIPTION. The Dataset containing the modified topography
- path_to_storeTYPE: str
DESCRIPTION. The Dataset to store the figure
- name_of_plotTYPE:str
DESCRIPTION. The name of the file
None.
pyClimat.plot_utils module
Created on Thu Jul 29 18:50:11 2021
@author: dboateng This module contains all the utilities used in the Climat_plots
- class pyClimat.plot_utils.FixedPointNormalized(vmin=None, vmax=None, sealevel=0, color_val=0.21875, clip=False)[source]
Bases:
Normalize
- class pyClimat.plot_utils.MidpointNormalize(vmin=None, vmax=None, midpoint=None, clip=False)[source]
Bases:
NormalizeAt the moment its a bug to use divergence colormap and set the colorbar range midpoint to zero if both vmax and vmin has different magnitude. This might be possible in future development in matplotlib through colors.offsetNorm(). This class was original developed by Joe Kingto and modified by Daniel Boateng. It sets the divergence color bar to a scale of 0-1 by dividing the midpoint to 0.5 Use this class at your own risk since its non-standard practice for quantitative data.
- pyClimat.plot_utils.apply_style(fontsize=20, style=None, linewidth=2)[source]
- fontsizeTYPE, optional
DESCRIPTION. The default is 10.
- styleTYPE, optional
DESCRIPTION. The default is “bmh”. [“seaborn”, “fivethirtyeight”,]
None.
- pyClimat.plot_utils.plot_background(p, domain=None, use_AlbersEqualArea=None, ax=None, left_labels=True, bottom_labels=True)[source]
This funtion defines the plotting domain and also specifies the background. It requires the plot handle from xarray.plot.imshow and other optional arguments Parameters ————-
p: TYPE: plot handle DESCRIPTION: the plot handle after plotting with xarray.plot.imshow
domian = TYPE:str DESCRIPTION: defines the domain size, eg. “Europe”, “Asia”, “Africa”
“South America”, “Alaska”, “Tibet Plateau” or “Himalaya”, “Eurosia”, “New Zealand”, default: global
pyClimat.plots module
Created on Thu Jul 29 18:49:46 2021
@author: dboateng This module contains all the functions required for generating annual, seasonal and monthly plots. It also contains all the analysis plots like isotopic profile plots, lapse rate scatter plots
- pyClimat.plots.plot_annual_mean(variable, data_alt, cmap, units, ax=None, vmax=None, vmin=None, levels=None, domain=None, center=True, output_name=None, output_format=None, level_ticks=None, title=None, path_to_store=None, data_v10=None, data_u10=None, GNIP_data=None, left_labels=True, bottom_labels=True, add_colorbar=True, plot_stats=False, compare_data1=None, compare_data2=None, max_pvalue=None, hatches=None, fig=None, cbar_pos=None, use_colorbar_default=False)[source]
- variableTYPE: str
DESCRIPTION. The variable to be plotted. Note, it will be display as colorbar name
- data_altTYPE: datarray
DESCRIPTION. The processed data to be visualized
- cmapTYPE: plt.cmap
DESCRIPTION. Color map handle from matplotlib
- unitsTYPE: str
DESCRIPTION. The unit of the dataset to be visualized
- axTYPE: GeoAxis using Matplotlib, optional or defined in control script if subplots are required for different variables
DESCRIPTION. The default is None. Figure handle to contain plot
- vmaxTYPE: float, optional
DESCRIPTION. The default is None. maximum value limit of the variable to be ploted
- vminTYPE: float, optional
DESCRIPTION. The default is None. minimum value limit of the variable to be ploted
- levelsTYPE: float, optional
DESCRIPTION. The default is None. the number of levels for colorbar scale
- domainTYPE: str, optional
DESCRIPTION. The default is None. eg. Africa, Asia, Europe
- output_nameTYPE: str, optional
DESCRIPTION. The default is None. Filename of generated figures
- output_formatTYPE: str, optional
DESCRIPTION. The default is None. Format to save figure eg. pdf, svg, tiff
- level_ticksTYPE: float, optional
DESCRIPTION. The default is None. Interval of ticks for colorbar
- titleTYPE: str, optional
DESCRIPTION. The default is None. Title of plots
- path_to_storeTYPE: str, optional
DESCRIPTION. The default is None. Directory to store data
data_v10 = datarray (required for ploting winds) data_u10 = datarray (required for ploting winds)
GNIP_data = DataFrame with lon, lat and d18Op for plotting a scatter circles with filled colormap left_labels: TYPE: Boolean, Default is True
DESCRIPTION. To add lat coordinates on the left of the plots, optioanl
- bottom_labels: TYPE: Boolean, Default is True
DESCRIPTION. To add lon coordinates on the bottom of the plots, optioanl
- add_colorbar: TYPE: Boolean, Default is True
DESCRIPTION. To add colormap to the plot
- plot_stats: TYPE: Boolean, Default
DESCRIPTION: plot the statiscal difference between two varied datasets
- compare_data1: TYPE: datarray
DESCRIPTION: dataset 1 if plot_stats == true
- compare_data2: TYPE: datarray
DESCRIPTION: dataset 2 if plot_stats == true
center: TYPE: Boolean, True to apply norm for centering zero
- max_pvalue: TYPE: float, optional
DESCRIPTION: pvalue for the student t-test significance testing
- hatches: TYPE: str, optional:
DESCRIPTION: hatches from matplotlib
None.
- pyClimat.plots.plot_echam_topo(variable, data, cmap, units, ax=None, vmax=None, vmin=None, levels=None, domain=None, output_name=None, output_format=None, level_ticks=None, title=None, path_to_store=None, cbar=None, cbar_orientation=None, cbar_position=None, fig=None, left_labels=True, bottom_labels=True)[source]
- variableTYPE: str
DESCRIPTION. The variable to be plotted. Note, it will be display as colorbar name
- dataTYPE: datarray
DESCRIPTION. The processed data to be visualized (Eg. topo input file or can be retrieved from model output)
- cmapTYPE: plt.cmap
DESCRIPTION. Color map handle from matplotlib
- unitsTYPE: str
DESCRIPTION. The unit of the dataset to be visualized
- axTYPE: matplotlib ax handle, optional
DESCRIPTION. The default is None.
- figTYPE: Matplotlib figure handle, optional
DESCRIPTION. The default is None.
- vmaxTYPE: float, optional
DESCRIPTION. The default is None. maximum value limit of the variable to be ploted
- vminTYPE: float, optional
DESCRIPTION. The default is None. minimum value limit of the variable to be ploted
- levelsTYPE: float, optional
DESCRIPTION. The default is None. the number of levels for colorbar scale
- domainTYPE: str, optional
DESCRIPTION. The default is None. eg. Africa, Asia, Europe
- output_nameTYPE: str, optional
DESCRIPTION. The default is None. Filename of generated figures
- output_formatTYPE: str, optional
DESCRIPTION. The default is None. Format to save figure eg. pdf, svg, tiff
- level_ticksTYPE: float, optional
DESCRIPTION. The default is None. Interval of ticks for colorbar
- titleTYPE: str, optional
DESCRIPTION. The default is None. Title of plots
- path_to_storeTYPE: str, optional
DESCRIPTION. The default is None. Directory to store data
- cbarTYPE: Boolean, optional
DESCRIPTION. The default is None. True is the plot require colobar axis
- cbar_orientationTYPE: , optional
DESCRIPTION.
- cbar_positionTYPE: list, optional
DESCRIPTION. The default is None. The default is None. the list defing the position of the color bar eg. [0.90, 0.30, 0.02, 0.40]
- left labels, right_labels, bottom_labels,TYPE: Bol, optional
DESCRIPTION. To set the left, right, and bottom axis label to None
None.
- pyClimat.plots.plot_eofsAsCovariance(variable, data, mode_var=None, cmap=None, levels=None, units=None, ax=None, domain=None, output_name=None, output_format=None, level_ticks=None, title=None, path_to_store=None, cbar=None, cbar_orientation=None, cbar_position=None, fig=None, use_AlberEqualArea=None, vmax=None, vmin=None, left_labels=True, bottom_labels=True)[source]
- variableTYPE: str
DESCRIPTION. The variable to be plotted. Note, it will be display as colorbar name
- dataTYPE: datarray
DESCRIPTION. The processed data to be visualized (Eg. topo input file or can be retrieved from model output)
- cmapTYPE: plt.cmap
DESCRIPTION. Color map handle from matplotlib
- unitsTYPE: str
DESCRIPTION. The unit of the dataset to be visualized
- axTYPE: matplotlib ax handle, optional
DESCRIPTION. The default is None.
- figTYPE: Matplotlib figure handle, optional
DESCRIPTION. The default is None.
- vmaxTYPE: float, optional
DESCRIPTION. The default is None. maximum value limit of the variable to be ploted
- vminTYPE: float, optional
DESCRIPTION. The default is None. minimum value limit of the variable to be ploted
- levelsTYPE: float, optional
DESCRIPTION. The default is None. the number of levels for colorbar scale
- domainTYPE: str, optional
DESCRIPTION. The default is None. eg. Africa, Asia, Europe
- output_nameTYPE: str, optional
DESCRIPTION. The default is None. Filename of generated figures
- output_formatTYPE: str, optional
DESCRIPTION. The default is None. Format to save figure eg. pdf, svg, tiff
- level_ticksTYPE: float, optional
DESCRIPTION. The default is None. Interval of ticks for colorbar
- titleTYPE: str, optional
DESCRIPTION. The default is None. Title of plots
- path_to_storeTYPE: str, optional
DESCRIPTION. The default is None. Directory to store data
- cbarTYPE: Boolean, optional
DESCRIPTION. The default is None. True is the plot require colobar axis
- cbar_orientationTYPE: , optional
DESCRIPTION.
- cbar_positionTYPE: list, optional
DESCRIPTION. The default is None. The default is None. the list defing the position of the color bar eg. [0.90, 0.30, 0.02, 0.40]
- mode_varTYPE: float, optional
DESCRIPTION. The default is None. The explained variance estimated from the EOF analysis
- use_AlberEqualAreaTYPE: Boolean, optional
DESCRIPTION. The default is None. To use ccrs.AlberEqualArea() as geoaxis projection
- left labels, right_labels, bottom_labels,TYPE: Bol, optional
DESCRIPTION. To set the left, right, and bottom axis label to None
None.
- pyClimat.plots.plot_iso_profiles(df_iso, df_geosp, dim, iso_color, iso_label, ax=None, season=None, month=None, xmax=None, xmin=None, ymax=None, ymin=None, ax_legend=None, isomax=None, isomin=None, output_name=None, output_format=None, title=None, path_to_store=None, left_labels=True, bottom_labels=True, right_labels=True, shade_color=None, shade_alpha=None, edgecolor='dimgrey')[source]
- df_isoTYPE: DataFrame
DESCRIPTION. The output from extract_profile functions for isotope
- df_geospTYPE: DataFrame
DESCRIPTION. The output from extract_profile functions for elevation
- dimTYPE: str
DESCRIPTION. The direction of the profile line (whether lat or lon)
- iso_colorTYPE: Matplotlib color handle
DESCRIPTION. Color for a specific isotopic profile
- iso_labelTYPE: str
DESCRIPTION. The lable for module experiment used for constructing isotopic profile
- axTYPE: plt axes handle, optional
DESCRIPTION. The default is None. This must be defined in the control script if multiple experiments are used
- seasonTYPE: str, optional
DESCRIPTION. The default is None. Must be defined if specific season is required
- monthTYPE: int, optional
DESCRIPTION. The default is None. he default is None. Must be defined if specific month is required
- xmaxTYPE: float, optional
DESCRIPTION. The default is None. The maximum limit of coordinates
- xminTYPE:float, optional
DESCRIPTION. The default is None. The minimun limit of cordinates
- ymaxTYPE: float, optional
DESCRIPTION. The default is None. The maximum limit of elevation axis
- yminTYPE: float, optional
DESCRIPTION. The default is None. The minimum limit of elevation axis
- ax_legendTYPE: Boolean, optional
DESCRIPTION. The default is None. True if you want to show legend. Can also be defined as fig.lenged if mutiple data are used in the control script. Check the example script
- isomaxTYPE: float, optional
DESCRIPTION. The default is None. The maximum limit of the iso values
- isominTYPE:float, optional
DESCRIPTION. The default is None. The minimum limit of the iso values
- output_nameTYPE: str, optional
DESCRIPTION. The default is None. Filename of generated figures
- output_formatTYPE: str, optional
DESCRIPTION. The default is None. Format to save figure eg. pdf, svg, tiff
- level_ticksTYPE: float, optional
DESCRIPTION. The default is None. Interval of ticks for colorbar
- titleTYPE: str, optional
DESCRIPTION. The default is None. Title of plots
- path_to_storeTYPE: str, optional
DESCRIPTION. The default is None. Directory to store data
- left labels, right_labels, bottom_labels,TYPE: Bol, optional
DESCRIPTION. To set the left, right, and bottom axis label to None
- shade_color: TYPE: STR
DESCRIPTION: shade color for plotting fill_between
- shade_alpha: TYPE: float, optional
DESCRIPTION: shade factor for plotting fill_between
- ValueError
DESCRIPTION.
None.
- pyClimat.plots.plot_monthly_mean(variable, data_mlt, cmap, units, months, axes=None, fig=None, vmax=None, vmin=None, levels=None, domain=None, output_name=None, output_format=None, level_ticks=None, title=None, path_to_store=None, data_v10=None, data_u10=None, left_labels=True, bottom_labels=True)[source]
- variableTYPE: str
DESCRIPTION. The variable to be plotted. Note, it will be display as colorbar name
- data_sltTYPE: datarray
DESCRIPTION. The processed data to be visualized (must contain the season time coordinate)
- cmapTYPE: plt.cmap
DESCRIPTION. Color map handle from matplotlib
- unitsTYPE: str
DESCRIPTION. The unit of the dataset to be visualized
- monthsTYPE: str
DESCRIPTION. The range of months to visualise eg. Jan-Jun or Ju-Dec
- axesTYPE, optional
DESCRIPTION. The default is None.
- figTYPE, optional
DESCRIPTION. The default is None.
- vmaxTYPE: float, optional
DESCRIPTION. The default is None. maximum value limit of the variable to be ploted
- vminTYPE: float, optional
DESCRIPTION. The default is None. minimum value limit of the variable to be ploted
- levelsTYPE: float, optional
DESCRIPTION. The default is None. the number of levels for colorbar scale
- domainTYPE: str, optional
DESCRIPTION. The default is None. eg. Africa, Asia, Europe
- output_nameTYPE: str, optional
DESCRIPTION. The default is None. Filename of generated figures
- output_formatTYPE: str, optional
DESCRIPTION. The default is None. Format to save figure eg. pdf, svg, tiff
- level_ticksTYPE: float, optional
DESCRIPTION. The default is None. Interval of ticks for colorbar
- titleTYPE: str, optional
DESCRIPTION. The default is None. Title of plots
- path_to_storeTYPE: str, optional
DESCRIPTION. The default is None. Directory to store data
- ValueError
DESCRIPTION.
None.
- pyClimat.plots.plot_seasonal_mean(variable, data_slt, cmap, units, seasons, axes=None, fig=None, vmax=None, vmin=None, levels=None, domain=None, output_name=None, output_format=None, level_ticks=None, title=None, path_to_store=None, data_v=None, plot_winds_pattern=False, plot_winds_streamline=False, data_u=None, cbar_pos=None, fig_title=None, season_label=None, plot_stats=False, compare_data1=None, compare_data2=None, max_pvalue=None, hatches=None, add_colorbar=True, left_labels=True, bottom_labels=True, show_arrow_scale=True, center=True)[source]
- variableTYPE: str
DESCRIPTION. The variable to be plotted. Note, it will be display as colorbar name
- data_sltTYPE: datarray
DESCRIPTION. The processed data to be visualized (must contain the season time coordinate)
- cmapTYPE: plt.cmap
DESCRIPTION. Color map handle from matplotlib
- unitsTYPE: str
DESCRIPTION. The unit of the dataset to be visualized
- seasonsTYPE: List containing str
DESCRIPTION.List of seasons to be plotted eg. [“JJA”, “DJF”] or [“JJA] or list of all seasons
- axesTYPE, optional
DESCRIPTION. The default is None.
- figTYPE, optional
DESCRIPTION. The default is None.
- vmaxTYPE: float, optional
DESCRIPTION. The default is None. maximum value limit of the variable to be ploted
- vminTYPE: float, optional
DESCRIPTION. The default is None. minimum value limit of the variable to be ploted
- levelsTYPE: float, optional
DESCRIPTION. The default is None. the number of levels for colorbar scale
- domainTYPE: str, optional
DESCRIPTION. The default is None. eg. Africa, Asia, Europe
- output_nameTYPE: str, optional
DESCRIPTION. The default is None. Filename of generated figures
- output_formatTYPE: str, optional
DESCRIPTION. The default is Notime=”season”, season_calendar=”standard”ne. Format to save figure eg. pdf, svg, tiff
- level_ticksTYPE: float, optional
DESCRIPTION. The default is None. Interval of ticks for colorbar
- titleTYPE: Bolean, optional
DESCRIPTION. The default is None. Title of plots
- path_to_storeTYPE: str, optional
DESCRIPTION. The default is None. Directory to store data
- cbar_posTYPE: list, optional
DESCRIPTION. The default is None. the list defing the position of the color bar eg. [0.90, 0.30, 0.02, 0.40]
fig_title = None seasonal_label: str (fro the label of which season) plot_stats: TYPE: Boolean, optional
DESCRIPTION. The default is False. True for ploting hatching for signifacne difference using student t-test or correlation with spearmanr cor
- Compare_data1, compare_data2: TYPE: datarray (not optional if plot_stats is set True)
DESCRIPTION. the datasets required for statistic computation
- hatches: TYPE: str
DESCRIPTION. the hatche style require for plotting..must be list in matplotlib hatch handle
- max_pvalue: TYPE: float
DESCRIPTION. The confidence interval range for statistics significance (eg. 0.05 for 95% CI)
- plot_winds_pattern: TYPE: Boolean, optional
DESCRIPTION: It plots the winds pattern using arrows on the plot background
- plot_winds_streamline: TYPE: Boolean, optional
DESCRIPTION: It plots the wind streamlines on the plot
data_v = datarray (required for ploting winds) data_u = datarray (required for ploting winds)
- plot_stats: TYPE: Boolean, Default
DESCRIPTION: plot the statiscal difference between two varied datasets
- compare_data1: TYPE: datarray
DESCRIPTION: dataset 1 if plot_stats == true
- compare_data2: TYPE: datarray
DESCRIPTION: dataset 2 if plot_stats == true
center: TYPE: Boolean, True to apply norm for centering zero
- max_pvalue: TYPE: float, optional
DESCRIPTION: pvalue for the student t-test significance testing
- hatches: TYPE: str, optional:
DESCRIPTION: hatches from matplotlib
None.
- pyClimat.plots.plot_vertical_section(variable, data, cmap, units, season=None, ax=None, fig=None, vmax=None, vmin=None, levels=None, output_name=None, output_format=None, level_ticks=None, title=None, path_to_store=None, plot_colorbar=True, cbar_pos=None, fig_title=None, season_label=None, geosp_data=None, dim=None, left_labels=True, bottom_labels=True, right_labels=True, use_norm=False, use_cbar_norm=False)[source]
- pyClimat.plots.scatter_plot_laspe_rate(reg_params, df_x_y_yhat, color, marker, label, ylabel=None, xlabel=None, ax=None, ax_legend=None, output_name=None, output_format=None, title=None, path_to_store=None, xmax=None, xmin=None, ymax=None, ymin=None, left_labels=True, bottom_labels=True)[source]
- reg_paramsTYPE: output from stats.linregress
DESCRIPTION.
- df_x_y_yhatTYPE: DataFrame output from linear_regression module in Climat_analysis
DESCRIPTION.
- colorTYPE: plt.color handle
DESCRIPTION.
- markerTYPE: plt.marker handle for scatter
DESCRIPTION.
- labelTYPE: str
DESCRIPTION. Additional lable for data aside the equation of line of fitting
- ylabelTYPE: str
DESCRIPTION. Y-axis lable name
- xlabelTYPE: str
DESCRIPTION. X-axis label name
- axTYPE: plt axes handle, optional
DESCRIPTION. The default is None. This must be defined in the control script if multiple experiments are used
- ax_legendTYPE: Boolean, optional
DESCRIPTION. The default is None. True if you want to show legend. Can also be defined as fig.lenged if mutiple data are used in the control script. Check the example script
- output_nameTYPE: str, optional
DESCRIPTION. The default is None. Filename of generated figures
- output_formatTYPE: str, optional
DESCRIPTION. The default is None. Format to save figure eg. pdf, svg, tiff
- level_ticksTYPE: float, optional
DESCRIPTION. The default is None. Interval of ticks for colorbar
- titleTYPE: str, optional
DESCRIPTION. The default is None. Title of plots
- path_to_storeTYPE: str, optional
DESCRIPTION. The default is None. Directory to store data
- left labels, right_labels, bottom_labels,TYPE: Bol, optional
DESCRIPTION. To set the left, right, and bottom axis label to None
None.
pyClimat.utils module
Created on Thu Jul 29 18:53:11 2021
@author: dboateng This routine contains funtional utilities required in the other modules
- pyClimat.utils.vert_coord_convertion(data, units)[source]
- dataTYPE: Dataarray (MxNxV)
DESCRIPTION. Dataarray on vertical coordinates with Pa as default unit
- unitsTYPE: str
DESCRIPTION. The required unit for conversion eg. hPa
- ValueError
DESCRIPTION. When other units is defined aside hPa
- dataTYPE: Datarray
DESCRIPTION. Data vertical units converted