pyIntensityFeatures.proc.fitting ================================ .. py:module:: pyIntensityFeatures.proc.fitting .. autoapi-nested-parse:: Functions used for fitting functions to intensity data. .. !! processed by numpydoc !! Functions --------- .. autoapisummary:: pyIntensityFeatures.proc.fitting.estimate_peak_widths pyIntensityFeatures.proc.fitting.gauss_quad_err pyIntensityFeatures.proc.fitting.get_fitting_params pyIntensityFeatures.proc.fitting.get_gaussian_func_fit Module Contents --------------- .. py:function:: estimate_peak_widths(data, data_loc, peak_inds, peak_mags) Estimate the full width at half max of the peaks in a curve. :Parameters: **data** : array-like Input data (y-axis) **data_loc** : array-like Input data location (x-axis) **peak_inds** : array-like Indexes of the peaks **peak_mags** : array-like Magnitude of the peaks :Returns: **peak_sigmas** : list-like FWHM values for each peak, or the closest estimate possible .. rubric:: Notes Differs from Longden, et al. (2010) function by not assuming a fixed data location increment of 1.0 degrees. .. !! processed by numpydoc !! .. py:function:: gauss_quad_err(params, xvals, yvals, weights) Calculate the error of a quadriatic Gaussian fit. :Parameters: **params** : set Set of parameters used by `mult_gauss_quad` **xvals** : float or array-like Location values **yvals** : float or array-like Intensity values **weights** : float or array-like Weights for each data value :Returns: **err** : float or array-like Weighted error of the fit defined by `params` .. seealso:: :obj:`utils.distributions.mult_gauss_quad` .. .. !! processed by numpydoc !! .. py:function:: get_fitting_params(mlat_bins, ilats, ilt, mean_intensity, num_gauss=3) Find the parameters for a Gaussian fit with a quadratic background. :Parameters: **mlat_bins** : np.array Magnetic latitude of output bin centres **ilats** : np.array Indices for magnetic latitudes with valid intensity values **ilt** : int Index for the magnetic local time **mean_intensity** : np.array 2D array of mean intensity values **num_gauss** : int Maximum number of Gaussians to fit (default=3) :Returns: **params** : list List of the parameters needed to form a mult-Gaussian fit with a quadratic background. **ipeaks** : list List containing indexes of the normalized intensity peaks for the 2D `mean_intesity` array down-selected by [`ilats`, `ilt`]. .. !! processed by numpydoc !! .. py:function:: get_gaussian_func_fit(mlat_bins, mlt_bins, mean_intensity, std_intensity, num_intensity, num_gauss=3, min_num=3, min_intensity=0.0, min_lat_perc=70.0) Fit intensity data using least-squares minimization in MLT bins. :Parameters: **mlat_bins** : np.array Magnetic latitude of output bin centres **mlt_bins** : np.array Magnetic local time of output bin centres **mean_intensity** : np.array 2D array of mean intensity values **std_intensity** : np.array 2D array of intensity standard deviations **num_intensity** : np.array 2D array of intensity counts per bin **num_gauss** : int Maximum number of Gaussians to fit (default=3) **min_num** : int Minimum number of samples contributing to the intensity mean (default=3) **min_intensity** : float Minimum intensity magnitude in Rayleighs (default=0.0) **min_lat_perc** : int Minimum percentage of latitude bins needed to define an intensity function (default=70.0) :Returns: **func_params** : list-like Set of parameters used by `mult_gauss_quad` for each MLT bin that defines the mean intensity as a function of magnetic latitude or set to a string output with a reason if no successful fit was performed. **fit_cov** : list-like Covariance matrix for each fit **fit_pearsonr** : list-like Pearson r-value for correlation between the observations and the fit **fit_pearsonp** : list-like Pearson p-value for correlation between the observations and the fit **num_peaks** : list-like Number of peaks used in the fit .. seealso:: :obj:`utils.distributions.mult_gauss_quad` .. .. !! processed by numpydoc !!