API Reference

This page provides an auto-generated summary of esmtools’s API. For more details and examples, refer to the relevant chapters in the main part of the documentation.

Carbon

from esmtools.carbon import ...

Functions related to analyzing ocean (and perhaps terrestrial) biogeochemistry.

calculate_compatible_emissions(…) Calculate compatible emissions.
co2_sol(t, s) Compute CO2 solubility per the equation used in CESM.
get_iam_emissions() Download IAM emissions from PIK website.
plot_compatible_emissions(…[, …]) Plot combatible emissions.
potential_pco2(t_insitu, pco2_insitu) Calculate potential pCO2 in the interior ocean.
schmidt(t) Computes the dimensionless Schmidt number.
spco2_sensitivity(ds) Compute sensitivity of surface pCO2 to changes in driver variables.
spco2_decomposition_index(ds_terms, index[, …]) Decompose oceanic surface pco2 in a first order Taylor-expansion.
spco2_decomposition(ds_terms[, detrend, …]) Decompose oceanic surface pco2 in a first order Taylor-expansion.
temp_decomp_takahashi(ds[, time_dim, …]) Decompose surface pCO2 into thermal and non-thermal components.

Composite Analysis

from esmtools.composite import ...

Functions pertaining to composite analysis. Composite analysis takes the mean view of some field (e.g., sea surface temperature) when some climate index (e.g., El Nino Southern Oscillation) is in its negative or positive mode.

composite_analysis(field, index[, …]) Create composite maps based on some variable’s response to a climate index.

Conversions

from esmtools.conversions import ...

Functions related to unit conversions.

convert_mpas_fgco2(mpas_fgco2) Convert native MPAS CO2 flux (mmol m-3 m s-1) to (molC m-2 yr-1)

Grid Tools

from esmtools.grid import ...

Functions related to climate model grids.

convert_lon(ds[, coord]) Converts longitude grid from -180to180 to 0to360 and vice versa.

Physics

from esmtools.physics import ...

Functions related to physics/dynamics.

stress_to_speed(x, y) Convert ocean wind stress to wind speed at 10 m over the ocean.

Spatial

from esmtools.spatial import ...

Functions related to spatial analysis.

extract_region(ds, xgrid, ygrid, coords[, …]) Extract a subset of some larger spatial data.
find_indices(xgrid, ygrid, xpoint, ypoint) Returns the i, j index for a latitude/longitude point on a grid.

Statistics

from esmtools.stats import ...

Functions dealing with statistics.

ACF
autocorr(ds[, dim, nlags]) Compute the autocorrelation function of a time series to a specific lag.
corr(x, y[, dim, lead, return_p]) Computes the Pearson product-moment coefficient of linear correlation.
linear_slope(x, y[, dim, nan_policy]) Returns the linear slope with y regressed onto x.
linregress(x, y[, dim, nan_policy]) Vectorized applciation of scipy.stats.linregress.
polyfit(x, y, order[, dim, nan_policy]) Returns the fitted polynomial line of y regressed onto x.
nanmean(ds[, dim]) Compute mean of data with NaNs and suppress warning from numpy.
rm_poly(x, y, order[, dim, nan_policy]) Removes a polynomial fit from y regressed onto x.
rm_trend(x, y[, dim, nan_policy]) Removes a linear fit from y regressed onto x.
standardize(ds[, dim]) Standardize Dataset/DataArray

Temporal

from esmtools.temporal import ...

Functions related to time.

to_annual(ds[, calendar, how, dim]) Resample sub-annual temporal resolution to annual resolution with weighting.

Testing

from esmtools.testing import ...

Functions specifically focused on statistical testing.

multipletests(p[, alpha, method]) Apply statsmodels.stats.multitest.multipletests for multi-dimensional xr.objects.
ttest_ind_from_stats(mean1, std1, nobs1, …) Parallelize scipy.stats.ttest_ind_from_stats and make dask-compatible.