pcmdi_metrics.qbo.compute_qbo_mjo_metrics
- pcmdi_metrics.qbo.compute_qbo_mjo_metrics(ds, ds2, varname, varname2, start, end, taper_to_mean=True, model='model', exp=None, member=None, debug=False)[source]
Compute QBO-MJO metrics from already-opened xarray Datasets.
This is the pure-computation entry point. It performs no file I/O, writes no output files, and produces no plots. Suitable for use in Jupyter notebooks, pipelines, and unit tests.
dsandds2are assumed to already be on the desired grid, withvarnamealready reduced to a single vertical level if applicable – any file loading, level selection, and regridding is the caller’s responsibility. See process_qbo_mjo_metrics for a file-path-based wrapper that handles that before calling here.- Parameters:
ds (
xr.Dataset) – Monthly zonal wind dataset containingvarnameon a (time, lat, lon) grid.ds2 (
xr.Dataset) – Daily OLR dataset containingvarname2on a (time, lat, lon) grid.varname (
str) – Zonal wind variable name inds.varname2 (
str) – OLR variable name inds2.start (
str) – Start of the time subset,"YYYY-MM".end (
str) – End of the time subset,"YYYY-MM".taper_to_mean (
bool, optional) – Passed through to the Kelvin filter’s time tapering. Default isTrue.model (
str, optional) – Model name, used only as a key in the returnedoutputdict. Default is"model".exp (
strorNone, optional) – Experiment name (kept for signature parity with process_qbo_mjo_metrics; not used in the computation). Default isNone.member (
strorNone, optional) – Ensemble member name, used only as a key in the returnedoutputdict. Default isNone.debug (
bool, optional) – IfTrue, print additional diagnostics and populate extra fields (window,mjo_olr_detrended,mjo_olr_tapered) in theolr_regiondiagnostic Dataset. Default isFalse.
- Returns:
output (
dict) –{model: {member: {"mjo_activity": float, "mjo_activity_diff": float, "qbo_east_years": list, "qbo_west_years": list}}}.diagnostics (
dict) – Intermediate xarray objects useful for plotting/saving:std: standard deviation of the smoothed QBO indexu_index: area-averaged U50 anomaly time seriesu_index_smoothed: 3-month running mean ofu_indexu_index_smoothed_djf: DJF-mean ofu_index_smoothedolr_region: OLR Dataset withmjo_olrand themjo_olr_stdmap*diagnostic fields attachedolr_std_map: DJF standard deviation map of MJO-filtered OLRolr_std_map_phase:{"east": ..., "west": ...}std maps partitioned by QBO phaseolr_std_map_diff: east-minus-west difference ofolr_std_map_phase