pyIntensityFeatures.tests.test_main

Tests for functions in _main.

Classes

TestAuroralBounds

Tests for the AuroralBounds class.

Functions

clean_func(inst_data[, clean_var, bad_val])

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.TestCase

Tests for the AuroralBounds class.

setUp()[source]

Set up the test runs.

tearDown()[source]

Tear down the test environment.

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_init_empty_data()[source]

Test initialization of the class with an empty data object.

test_repr_string()[source]

Test __repr__ method string.

test_print_string()[source]

Test __str__ method string.

test_equality()[source]

Test class equality with empty data objects.

test_inequality_wrong_class()[source]

Test class equality with different classes.

test_inequality_extra_attributes()[source]

Test class equality with extra attributes.

test_inequality_missing_attributes()[source]

Test class equality with missing attributes.

test_inequality_attributes()[source]

Test class equality with unequal standard attributes.

test_update_properties()[source]

Test properties can be updated to different values.

test_init_with_data()[source]

Test times are set based on data when data is available.

test_init_with_transposed_data()[source]

Test times are set based on data when data is available.

test_update_times_with_data()[source]

Test times are set based on data when data is available.

test_set_boundaries_empty_data()[source]

Test initialization of the class with an empty data object.

test_set_boundaries_with_data()[source]

Test setting boundaries from data.

test_set_boundaries_with_long_end_time()[source]

Test setting boundaries with an end time beyond the data.

test_set_boundaries_with_data_no_slice()[source]

Test setting boundaries from data without slicing.

test_set_boundaries_with_mask()[source]

Test setting boundaries from data while masking all data.