pyIntensityFeatures.tests.test_main
Tests for functions in _main.
Classes
Tests for the AuroralBounds class. |
Functions
|
Clean data as a test for the clean_func attribute. |
Module Contents
- pyIntensityFeatures.tests.test_main.clean_func(inst_data, clean_var='clean_flag', bad_val=1)[source]
Clean data as a test for the clean_func attribute.
- Parameters:
- inst_datadict, list, array, pds.DataFrame, or xr.Dataset
Instrument data
- clean_varstr or int
Data variable with the clean flag (default=’clean_flag’)
- bad_valfloat or int
Values to flag as bad (default=1)
- Returns:
- clean_mask2D array or NoneType
Cleaning mask output
- class pyIntensityFeatures.tests.test_main.TestAuroralBounds(methodName='runTest')[source]
Bases:
unittest.TestCaseTests for the AuroralBounds class.
- set_inst_data(class_name='dict')[source]
Set the inst_data attribute and vars using the desired class.
- Parameters:
- class_namestr
String specifying one of ‘dict’, ‘list’, ‘array’, ‘pandas’, or ‘xarray’ (default=’dict’)
- set_alb(set_attr=True)[source]
Set the ALB test attribute for the tests.
- set_attrbool
If True, set the alb attribute, if False return the class object
- eval_times(class_name='dict')[source]
Evaluate times based on the input.
- Parameters:
- class_namestr
String specifying one of ‘dict’, ‘list’, ‘array’, ‘pandas’, or ‘xarray’ (default=’dict’)
- eval_boundaries(min_mlat_base=59.0, mlat_inc=1.0, mag_method='ALLOWTRACE', mlt_inc=0.5, un_threshold=1.25, strict_fit=0, lt_out_bin=5.0, max_iqr=1.5)[source]
Evaluate successful setting of boundaries.
- Parameters:
- min_mlat_basefloat
Base minimum co-latitude for intensity profiles. (default=59.0)
- methodstr
Method for converting between geographic and magnetic coordinates. (default=’ALLOWTRACE’)
- mlat_incfloat
Magnetic latitude increment for gridding intensity. (default=1.0)
- mlt_incfloat
Magnetic local time increment for gridding intensity. (default=0.5)
- un_thresholdfloat
Maximum acceptable uncertainty value in degrees (default=1.25)
- strict_fitint
Enforce positive values for the x-offsets in quadratic-Gaussian fits using integer version of boolean (default=0)
- lt_out_binfloat
Size of local time bin in hours over which outliers in the data will be identified (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)
- test_set_boundaries_empty_data()[source]
Test initialization of the class with an empty data object.
- test_set_boundaries_with_long_end_time()[source]
Test setting boundaries with an end time beyond the data.