def test_masking_profile_vars(self): from CALIOPy.utils import mask_data raw_data = cis.read_data_list(self.TEST_FILENAME, "Extinction_Coefficient_532", "Caliop_V4_NO_PRESSURE") data, = mask_data(raw_data, self.cad_score, self.extinction_qc) assert data.shape == (639, 399) assert np.all(data.data > 0.0) assert data.data.count() == 15382
def test_masking_column_vars(self): from CALIOPy.utils import mask_data raw_data = cis.read_data_list( self.TEST_FILENAME, "Column_Optical_Depth_Tropospheric_Aerosols_532", "Caliop_V4_NO_PRESSURE") data, = mask_data(raw_data, self.cad_score, self.extinction_qc) assert np.all(data.data > 0.0) assert data.data.count() == 639
def test_aeronet_variable_name_parsing(self): from cf_units import Unit from cis import read_data_list aeronet_data = read_data_list(valid_aeronet_filename, ["AOT_440", "Water(cm)"]) assert_equal(aeronet_data[0].name(), "AOT_440") assert_equal(aeronet_data[0].units, Unit('1')) assert_equal(aeronet_data[1].name(), "Water(cm)") assert_equal(aeronet_data[1].var_name, "Water") assert_equal(aeronet_data[1].units, Unit('cm'))
def check_output_col_grid(self, sample_file, sample_var, output_file, output_vars, expected_shape=None): """ Check that the output grid matches the sample grid in shape. :param sample_file: :param sample_var: :param output_file: :param output_vars: :return: """ from cis import read_data, read_data_list from operator import mul if expected_shape is None: sample_shape = read_data(sample_file, sample_var).data.shape else: sample_shape = expected_shape output = read_data_list(output_file, output_vars) for output_var in output: output_shape = output_var.data.shape # This copes with dims in different orders, length 1 values being taken out etc assert_that(reduce(mul, sample_shape), is_(reduce(mul, output_shape)))
def test_read_data_list_raises_error_on_invalid_file_wildcard(): read_data_list(invalid_filename + '*', cis_test_files['caliop_L1'].all_variable_names)
def test_read_data_list_raises_error_on_invalid_variable(): file = cis_test_files['modis_L3'].master_filename read_data_list(file, 'invalid_variable')
def test_masking_profile_vars(self): from CALIOPy.utils import mask_data raw_data = cis.read_data_list(self.TEST_FILENAME, "Extinction_Coefficient_532") data = mask_data(raw_data, self.cad_score, self.extinction_qc) assert data == "TODO"
def test_masking_column_vars(self): from CALIOPy.utils import mask_data raw_data = cis.read_data_list(self.TEST_FILENAME, "Column_Optical_Depth_Aerosols_532") data = mask_data(raw_data, self.cad_score, self.extinction_qc) assert data == "TODO"
def test_read_data_list_raises_error_on_invalid_file_wildcard(): read_data_list(invalid_filename + '*', cis_test_files['Aerosol_CCI'].all_variable_names)
def test_read_data_list_raises_error_on_invalid_file(): read_data_list(invalid_filename, cis_test_files['Aerosol_CCI'].all_variable_names)
def test_read_data_list_raises_error_on_invalid_variable(): file = cis_test_files['Aerosol_CCI'].master_filename read_data_list(file, 'invalid_variable')