pysecs.SECS.fit#
- SECS.fit(obs_loc: ndarray, obs_B: ndarray, obs_std: ndarray | None = None, epsilon: float = 0.05, mode: str = 'relative') SECS #
Fits the SECS to the given observations.
Given a number of observation locations and measurements, this function fits the SEC system to them. It uses singular value decomposition (SVD) to fit the SEC amplitudes with the epsilon parameter used to regularize the solution.
- Parameters:
obs_locs (ndarray (nobs, 3 [lat, lon, r])) – Contains latitude, longitude, and radius of the observation locations (place where the measurements are made)
obs_B (ndarray (ntimes, nobs, 3 [Bx, By, Bz])) – An array containing the measured/observed B-fields.
obs_std (ndarray (ntimes, nobs, 3 [varX, varY, varZ]), optional) – Standard error of vector components at each observation location. This can be used to weight different observations more/less heavily. An infinite value eliminates the observation from the fit. Default: ones(nobs, 3) equal weights
epsilon (float) – Value used to regularize/smooth the SECS amplitudes. Epsilon has different meanings depending on the mode used, described in that parameter section. Must be between 0 and 1. A higher number produces a more regularized (smoother) solution. Default: 0.05
mode (str) –
The mode used to filter the singular values. Options are: - ‘relative’: filter singular values that are less than epsilon times
the largest singular value, keep [S >= epsilon * S.max()].
’variance’: filter singular values that contribute to 1-epsilon of the total energy of the system (% total variance as a ratio).
Default: ‘relative’