pyIntensityFeatures.utils.checks ================================ .. py:module:: pyIntensityFeatures.utils.checks .. autoapi-nested-parse:: Functions for testing the outcome of various functions. .. !! processed by numpydoc !! Attributes ---------- .. autoapisummary:: pyIntensityFeatures.utils.checks.fwhm_const Functions --------- .. autoapisummary:: pyIntensityFeatures.utils.checks.evaluate_gauss_quad pyIntensityFeatures.utils.checks.evaluate_pearson pyIntensityFeatures.utils.checks.evaluate_dayglow pyIntensityFeatures.utils.checks.compare_boundaries pyIntensityFeatures.utils.checks.compare_pearson pyIntensityFeatures.utils.checks.evaluate_boundary_in_mlt Module Contents --------------- .. py:data:: fwhm_const .. py:function:: 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) Test the robustness of the quadratic Gaussian fitting results. :Parameters: **npeaks** : int Number of Gaussian peaks in the fit **fit_coeff** : array-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. **rvalue** : float Pearson correlation coefficient **pvalue** : float Pearson p-value **po_bound** : float Polar auroral boundary location in degrees latitude **un_bound_po** : float Uncertainty of the polar auroral boundary location in degrees latitude **eq_bound** : float Equatorward auroral boundary location in degrees latitude **un_bound_eq** : float Uncertainty of the equatorward auroral boundary location in degrees lat **min_mlat** : float Minimum latitude in intensity slice in degrees **max_mlat** : float Maximum latitude in intensity slice in degrees **un_threshold** : float Maximum acceptable uncertainty value in degrees (default=1.25) :Returns: bool True if all quality criteria are met, False if any fails .. rubric:: Notes Differs from Longden, et al. (2010) by using Pearson correlation coefficients. .. rubric:: 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. .. only:: latex .. !! processed by numpydoc !! .. py:function:: evaluate_pearson(rvalue, pvalue, rthresh=0.9, pmax=0.0001) Evaluate the Pearson correlation coefficient and p-value. :Parameters: **rvalue** : float Pearson correlation coefficient **pvalue** : float Pearson p-value for testing non-correlation **rthresh** : float Minimum acceptable correlation coefficient (default=0.8) **pmax** : float Maximum acceptable p-value (default=1.0e-4) :Returns: bool True if thresholds pass, False if they fail .. !! processed by numpydoc !! .. py:function:: evaluate_dayglow(fit_coeff, locations, thresh=300.0) Evaluate the dayglow level across a range of locations. :Parameters: **fit_coeff** : array-like Coefficients, the first three of which are the quadratic constant, x-term, and x-squared-term. **locations** : array-like Locations at which the dayglow level will be evaluated. **thresh** : float Maximum allowable background intensity value in Rayleighs (default=300) :Returns: **good** : bool True if the background level is low across all desired locations, False if any location is too high. .. !! processed by numpydoc !! .. py:function:: compare_boundaries(rvalue, pvalue, eq_bounds, eq_uncert, po_bounds, po_uncert, min_mlat, max_mlat, max_uncert=3.0) Compare different boundaries and choose the best values. :Parameters: **rvalue** : list-like Pearson correlation coefficient **pvalue** : list-like Pearson p-value for testing non-correlation **eq_bounds** : float Equatorward auroral boundary location in degrees latitude **eq_uncert** : float Equatorward auroral boundary uncertainty in degrees latitude **po_bounds** : float Polar auroral boundary location in degrees latitude **po_uncert** : float Polar auroral boundary uncertainty in degrees latitude **min_mlat** : float Minimum latitude in intensity slice in degrees **max_mlat** : float Maximum latitude in intensity slice in degrees **max_uncert** : float Maximum allowable boundary uncertainty in degrees (default=3.0) :Returns: **igood_eq** : int or NoneType Index corresponding to the best equatorial index, or None **igood_po** : int or NoneType Index corresponding to the best polar index, or None .. !! processed by numpydoc !! .. py:function:: compare_pearson(rvalue, pvalue) Evaluate different Pearson correlation coefficients and choose the best. :Parameters: **rvalue** : list-like Pearson correlation coefficient **pvalue** : list-like Pearson p-value for testing non-correlation :Returns: **igood** : int or NoneType Index correspeonding to the best fit, None if no fit is good .. !! processed by numpydoc !! .. py:function:: evaluate_boundary_in_mlt(bound_data, eq_key, po_key, lt_key, ut_key, lt_bin=5.0, max_iqr=1.5) Evaluate boundary consistency with local time. :Parameters: **bound_data** : xr.Dataset Boundary data stored in an xarray Dataset **eq_key** : str Data key for the equatorward boundary data **po_key** : str Data key for the poleward boundary data **lt_key** : str Coordinate key for the MLT data **ut_key** : str Coordinate key for the UT data **lt_bin** : float Size of local time bin in hours over which the data will be evaluated (default=5.0) **max_iqr** : float Maximum multiplier for the interquartile range (IQR) used to identify outliers above or below the upper or lower quartile (default=1.5) :Returns: **bdata** : xr.Dataset Dataset with only good boundaries .. !! processed by numpydoc !!