pyIntensityFeatures.utils.checks

Functions for testing the outcome of various functions.

Attributes

fwhm_const

Functions

evaluate_gauss_quad(npeaks, fit_coeff, rvalue, pvalue, ...)

Test the robustness of the quadratic Gaussian fitting results.

evaluate_pearson(rvalue, pvalue[, rthresh, pmax])

Evaluate the Pearson correlation coefficient and p-value.

evaluate_dayglow(fit_coeff, locations[, thresh])

Evaluate the dayglow level across a range of locations.

compare_boundaries(rvalue, pvalue, eq_bounds, ...[, ...])

Compare different boundaries and choose the best values.

compare_pearson(rvalue, pvalue)

Evaluate different Pearson correlation coefficients and choose the best.

evaluate_boundary_in_mlt(bound_data, eq_key, po_key, ...)

Evaluate boundary consistency with local time.

Module Contents

pyIntensityFeatures.utils.checks.fwhm_const[source]
pyIntensityFeatures.utils.checks.evaluate_gauss_quad(npeaks, fit_coeff, rvalue, pvalue, po_bound, un_bound_po, eq_bound, un_bound_eq, min_mlat, max_mlat, un_threshold=1.25)[source]

Test the robustness of the quadratic Gaussian fitting results.

Parameters:
npeaksint

Number of Gaussian peaks in the fit

fit_coeffarray-like

List or array containing Guassian constant, quadratic multiplier for x, quadratic multiplier for x^2, and Gaussian amplitudes, x offsets, and exponential scalers in that order.

rvaluefloat

Pearson correlation coefficient

pvaluefloat

Pearson p-value

po_boundfloat

Polar auroral boundary location in degrees latitude

un_bound_pofloat

Uncertainty of the polar auroral boundary location in degrees latitude

eq_boundfloat

Equatorward auroral boundary location in degrees latitude

un_bound_eqfloat

Uncertainty of the equatorward auroral boundary location in degrees lat

min_mlatfloat

Minimum latitude in intensity slice in degrees

max_mlatfloat

Maximum latitude in intensity slice in degrees

un_thresholdfloat

Maximum acceptable uncertainty value in degrees (default=1.25)

Returns:
bool

True if all quality criteria are met, False if any fails

Notes

Differs from Longden, et al. (2010) by using Pearson correlation coefficients.

References

Longden, N. S., et al. (2010) Estimating the location of the open-closed magnetic field line boundary from auroral images, 28 (9), p 1659-1678, doi:10.5194/angeo-28-1659-2010.

pyIntensityFeatures.utils.checks.evaluate_pearson(rvalue, pvalue, rthresh=0.9, pmax=0.0001)[source]

Evaluate the Pearson correlation coefficient and p-value.

Parameters:
rvaluefloat

Pearson correlation coefficient

pvaluefloat

Pearson p-value for testing non-correlation

rthreshfloat

Minimum acceptable correlation coefficient (default=0.8)

pmaxfloat

Maximum acceptable p-value (default=1.0e-4)

Returns:
bool

True if thresholds pass, False if they fail

pyIntensityFeatures.utils.checks.evaluate_dayglow(fit_coeff, locations, thresh=300.0)[source]

Evaluate the dayglow level across a range of locations.

Parameters:
fit_coeffarray-like

Coefficients, the first three of which are the quadratic constant, x-term, and x-squared-term.

locationsarray-like

Locations at which the dayglow level will be evaluated.

threshfloat

Maximum allowable background intensity value in Rayleighs (default=300)

Returns:
goodbool

True if the background level is low across all desired locations, False if any location is too high.

pyIntensityFeatures.utils.checks.compare_boundaries(rvalue, pvalue, eq_bounds, eq_uncert, po_bounds, po_uncert, min_mlat, max_mlat, max_uncert=3.0)[source]

Compare different boundaries and choose the best values.

Parameters:
rvaluelist-like

Pearson correlation coefficient

pvaluelist-like

Pearson p-value for testing non-correlation

eq_boundsfloat

Equatorward auroral boundary location in degrees latitude

eq_uncertfloat

Equatorward auroral boundary uncertainty in degrees latitude

po_boundsfloat

Polar auroral boundary location in degrees latitude

po_uncertfloat

Polar auroral boundary uncertainty in degrees latitude

min_mlatfloat

Minimum latitude in intensity slice in degrees

max_mlatfloat

Maximum latitude in intensity slice in degrees

max_uncertfloat

Maximum allowable boundary uncertainty in degrees (default=3.0)

Returns:
igood_eqint or NoneType

Index corresponding to the best equatorial index, or None

igood_point or NoneType

Index corresponding to the best polar index, or None

pyIntensityFeatures.utils.checks.compare_pearson(rvalue, pvalue)[source]

Evaluate different Pearson correlation coefficients and choose the best.

Parameters:
rvaluelist-like

Pearson correlation coefficient

pvaluelist-like

Pearson p-value for testing non-correlation

Returns:
igoodint or NoneType

Index correspeonding to the best fit, None if no fit is good

pyIntensityFeatures.utils.checks.evaluate_boundary_in_mlt(bound_data, eq_key, po_key, lt_key, ut_key, lt_bin=5.0, max_iqr=1.5)[source]

Evaluate boundary consistency with local time.

Parameters:
bound_dataxr.Dataset

Boundary data stored in an xarray Dataset

eq_keystr

Data key for the equatorward boundary data

po_keystr

Data key for the poleward boundary data

lt_keystr

Coordinate key for the MLT data

ut_keystr

Coordinate key for the UT data

lt_binfloat

Size of local time bin in hours over which the data will be evaluated (default=5.0)

max_iqrfloat

Maximum multiplier for the interquartile range (IQR) used to identify outliers above or below the upper or lower quartile (default=1.5)

Returns:
bdataxr.Dataset

Dataset with only good boundaries