pysecs.SECS.fit_J#

SECS.fit_J(obs_loc: ndarray, obs_J: ndarray, obs_std: ndarray | None = None, epsilon: float = 0.05, mode: str = 'relative', robust: str | None = None, robust_maxiter: int = 20, robust_tol: float = 1e-06) → SECS#

Fits the SECS to observed sheet current densities.

This is the current density counterpart of fit(). Fitting divergence-free and curl-free SECs to a horizontal current field decomposes it into its rotational and divergent parts (a Helmholtz decomposition on the sphere). Each curl-free amplitude is the field-aligned current flowing into the shell at that SEC pole. Typical inputs are currents derived from radar electric fields and conductances, or the output of a numerical model. To combine currents with magnetic field observations, use the joint fit in fit().

Parameters:
  • obs_loc (ndarray (nobs, 3 [lat, lon, r])) – Latitude, longitude, and radius of the current observations. Currents only exist on the SEC shells, so the radius must equal the radius of the SEC shell being fit.

  • obs_J (ndarray (ntimes, nobs, 2 [Jx, Jy] or 3 [Jx, Jy, Jz])) – The observed horizontal sheet current densities (A/m). A third (radial) component, such as the output of predict_J(), is ignored since it is not a sheet current.

  • obs_std (ndarray, same shape as obs_J, optional) – Standard error (1-sigma) of the current components, see fit(). Default: equal weights

  • epsilon – Regularization and robust fitting options, see fit().

  • mode – Regularization and robust fitting options, see fit().

  • robust – Regularization and robust fitting options, see fit().

  • robust_maxiter – Regularization and robust fitting options, see fit().

  • robust_tol – Regularization and robust fitting options, see fit().

Returns:

This system, with the fitted amplitudes stored in sec_amps.

Return type:

SECS

Notes

The current of a SEC is singular at its own pole, but averages to zero over any small cap around it. Observations at a pole (within 1e-9 radians) therefore receive no contribution from that SEC, so currents can be fit at the SEC grid points themselves.