pyIntensityFeatures.proc.fitting

Functions used for fitting functions to intensity data.

Functions

estimate_peak_widths(data, data_loc, peak_inds, peak_mags)

Estimate the full width at half max of the peaks in a curve.

gauss_quad_err(params, xvals, yvals, weights)

Calculate the error of a quadriatic Gaussian fit.

get_fitting_params(mlat_bins, ilats, ilt, mean_intensity)

Find the parameters for a Gaussian fit with a quadratic background.

get_gaussian_func_fit(mlat_bins, mlt_bins, ...[, ...])

Fit intensity data using least-squares minimization in MLT bins.

Module Contents

pyIntensityFeatures.proc.fitting.estimate_peak_widths(data, data_loc, peak_inds, peak_mags)[source]

Estimate the full width at half max of the peaks in a curve.

Parameters:
dataarray-like

Input data (y-axis)

data_locarray-like

Input data location (x-axis)

peak_indsarray-like

Indexes of the peaks

peak_magsarray-like

Magnitude of the peaks

Returns:
peak_sigmaslist-like

FWHM values for each peak, or the closest estimate possible

Notes

Differs from Longden, et al. (2010) function by not assuming a fixed data location increment of 1.0 degrees.

pyIntensityFeatures.proc.fitting.gauss_quad_err(params, xvals, yvals, weights)[source]

Calculate the error of a quadriatic Gaussian fit.

Parameters:
paramsset

Set of parameters used by mult_gauss_quad

xvalsfloat or array-like

Location values

yvalsfloat or array-like

Intensity values

weightsfloat or array-like

Weights for each data value

Returns:
errfloat or array-like

Weighted error of the fit defined by params

See also

utils.distributions.mult_gauss_quad
pyIntensityFeatures.proc.fitting.get_fitting_params(mlat_bins, ilats, ilt, mean_intensity, num_gauss=3)[source]

Find the parameters for a Gaussian fit with a quadratic background.

Parameters:
mlat_binsnp.array

Magnetic latitude of output bin centres

ilatsnp.array

Indices for magnetic latitudes with valid intensity values

iltint

Index for the magnetic local time

mean_intensitynp.array

2D array of mean intensity values

num_gaussint

Maximum number of Gaussians to fit (default=3)

Returns:
paramslist

List of the parameters needed to form a mult-Gaussian fit with a quadratic background.

ipeakslist

List containing indexes of the normalized intensity peaks for the 2D mean_intesity array down-selected by [ilats, ilt].

pyIntensityFeatures.proc.fitting.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)[source]

Fit intensity data using least-squares minimization in MLT bins.

Parameters:
mlat_binsnp.array

Magnetic latitude of output bin centres

mlt_binsnp.array

Magnetic local time of output bin centres

mean_intensitynp.array

2D array of mean intensity values

std_intensitynp.array

2D array of intensity standard deviations

num_intensitynp.array

2D array of intensity counts per bin

num_gaussint

Maximum number of Gaussians to fit (default=3)

min_numint

Minimum number of samples contributing to the intensity mean (default=3)

min_intensityfloat

Minimum intensity magnitude in Rayleighs (default=0.0)

min_lat_percint

Minimum percentage of latitude bins needed to define an intensity function (default=70.0)

Returns:
func_paramslist-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_covlist-like

Covariance matrix for each fit

fit_pearsonrlist-like

Pearson r-value for correlation between the observations and the fit

fit_pearsonplist-like

Pearson p-value for correlation between the observations and the fit

num_peakslist-like

Number of peaks used in the fit

See also

utils.distributions.mult_gauss_quad