ENSO.maxu_r

ENSO.maxu_r.find_max_u_nino3_pairs(u_ref, nino3, lon_width=40.0, lat=(-2.0, 2.0))[source]

Locate the maximum u_ref within a region of fixed size (lon_width * lat range) at each nino3. Return the results as two pairs of (u_ref, nino3) for warm and cold conditions respectively

Parameters:
  • u_ref (geodat.nc.Variable) – zonal wind anomaly
  • nino3 (geodat.nc.Variable) – ENSO SST anomaly index
  • lon_width (number) – width along the longitude for running average
  • lat (iterable) – latitudinal region to be averaged over

The time axes of u_ref and nino3 should match

Returns:((pos_u,pos_t), (neg_u,neg_t)) contains numpy 1d arrays
ENSO.maxu_r.max_anom(u, *args, **kwargs)[source]

Same as max_anom_index() but with option=”value” enforced

ENSO.maxu_r.max_anom_index(u, lon_width=40.0, lat=(-2.0, 2.0), region=None, option='value', sign=1.0)[source]

Return the index where U is maximum after applying a lon_width degree running mean along the longitude.

Assumed uniform grid

Parameters:
  • u (geodat.nc.Variable) – any field with latitude and longitude
  • lon_width (number) – width along the longitude for running average
  • lat (iterable) – latitudinal region to be averaged over
  • region (dict) – region to be averaged over (default None, overwrites lat if defined, see geodat.nc.getRegion
  • option (str) – ‘lon’/’lat’/’value’ for finding longitude of maximum, latitude of maximum and the maximum value respectively
  • sign (scalar) – if positive, the function looks for maximum values; if negative, the function looks for minimum values (useful for analysing La Nina)
ENSO.maxu_r.max_anom_lat(u, *args, **kwargs)[source]

Same as max_anom_index() but with option=”lat” enforced

ENSO.maxu_r.max_anom_lon(u, *args, **kwargs)[source]

Same as max_anom_index() but with option=”lon” enforced

ENSO.maxu_r.plot_r(y, x, doPlot=True, *args, **kwargs)[source]

Plot (if doPlot is True) the results and compute the value of r using linear regression.

Parameters:
  • y (numpy 1d array) –
  • x (numpy 1d array) – x axis (default = [-len(y)/2,...,1,0,-1,...-len(y)/2]
Returns:

r – (slope_positive_x - slope_negative_x)/(slope_positive_x + slope_negative_x)

Return type:

number

Fork me on GitHub