esmtools.composite.composite_analysis¶
-
esmtools.composite.
composite_analysis
(field, index, threshold=1, plot=False, ttest=False, psig=0.05, **plot_kwargs)[source]¶ Create composite maps based on some variable’s response to a climate index.
Note
Make sure that the field and index are detrended prior to using this function if needed.
Parameters: - field (xr.object) – Variable to create composites for. Contains dims time and 2 spatial.
- index (xr.object) – Climate index time series.
- threshold (float) – Threshold value for standardized composite. Defaults to 1.
- plot (bool) – Quick plot and no returns. Defaults to False.
- ttest (bool) – Apply ttest whether pos/neg different from mean. Defaults to False.
- psig (float) – Significance level for ttest. Defaults to 0.05.
- **plot_kwargs (type) – kwargs to pass to xarray’s plot function.
Returns: Positive and negative composite if not plot.
Return type: composite (xr.object)
References
- Motivated from Ryan Abernathy’s notebook here: https://rabernat.github.io/research_computing/xarray.html