diff --git a/tests/test_conf.py b/tests/test_conf.py index 552af02ff45a637062602d9b9712156ee162ad1f..ad6df62b8795b53c89d5f07ac3ea23b8264e65c6 100644 --- a/tests/test_conf.py +++ b/tests/test_conf.py @@ -70,13 +70,19 @@ def test_c_single_threshold(rad, single_threshold, reference_data): ref_confidence = np.load(reference_data)["ref_sgl"] ref_confidence_flipped = np.load(reference_data)["ref_sgl_flipped"] - c = anc.py_conf_test( - rad, single_threshold[0], single_threshold[2], single_threshold[3], single_threshold[1] - ) + locut = np.array(single_threshold[0], dtype=float) + midpt = np.array(single_threshold[1], dtype=float) + hicut = np.array(single_threshold[2], dtype=float) + power = np.array(single_threshold[3], dtype=float) + + c = anc.py_conf_test(np.array(rad, dtype=np.float32), locut, hicut, power, midpt) assert np.all(c == ref_confidence) single_threshold[0:-1] = single_threshold[-2::-1] - c = anc.py.conf_test( - rad, single_threshold[0], single_threshold[2], single_threshold[3], single_threshold[1] - ) + locut = np.array(single_threshold[0], dtype=float) + midpt = np.array(single_threshold[1], dtype=float) + hicut = np.array(single_threshold[2], dtype=float) + power = np.array(single_threshold[3], dtype=float) + + c = anc.py_conf_test(np.array(rad, dtype=np.float32), locut, hicut, power, midpt) assert np.all(c == ref_confidence_flipped) diff --git a/tests/test_read_data.py b/tests/test_read_data.py index e91e7d2f1f9214214d81821c2dcfb7c55d361ead..4135de00825c0205bfb095df85647159ab1092e1 100644 --- a/tests/test_read_data.py +++ b/tests/test_read_data.py @@ -103,31 +103,29 @@ def test_l1b(l1b_file, geo_file): assert "M11" in l1b.data_vars -def test_sst(fixturepath, sst_file, ref_file): +def test_sst(fixturepath, geo_file, sst_file, ref_file): """Test SST reading.""" - viirs = rd.ReadData(satellite="snpp", sensor="viirs") + viirs = rd.ReadData(satellite="snpp", sensor="viirs", file_name_geo=geo_file) geo = viirs.read_viirs_geo() ancillary = rd.ReadAncillary( latitude=geo.latitude.values, longitude=geo.longitude.values, resolution=1, - ancillary_dir=fixturepath, - sst_file=sst_file, + sst_file=os.path.join(fixturepath, sst_file), ) sst = ancillary.get_sst() check_differences(ref_file, sst, "sst") -def test_ndvi(fixturepath, ndvi_file, ref_file): +def test_ndvi(fixturepath, geo_file, ndvi_file, ref_file): """Test NDVI reading.""" - viirs = rd.ReadData(satellite="snpp", sensor="viirs") + viirs = rd.ReadData(satellite="snpp", sensor="viirs", file_name_geo=geo_file) geo = viirs.read_viirs_geo() ancillary = rd.ReadAncillary( latitude=geo.latitude.values, longitude=geo.longitude.values, resolution=1, - ancillary_dir=fixturepath, - ndvi_file=ndvi_file, + ndvi_file=os.path.join(fixturepath, ndvi_file), ) ndvi = ancillary.get_ndvi() check_differences(ref_file, ndvi, "ndvi") @@ -135,6 +133,8 @@ def test_ndvi(fixturepath, ndvi_file, ref_file): def test_geos( fixturepath, + l1b_file, + geo_file, geos_file_1, geos_file_2, geos_land, @@ -143,18 +143,18 @@ def test_geos( ref_file, ): """Test GEOS reading.""" - viirs = rd.ReadData(satellite="snpp", sensor="viirs") + viirs = rd.ReadData(satellite="snpp", sensor="viirs", file_name_geo=geo_file) geo = viirs.read_viirs_geo() ancillary = rd.ReadAncillary( + file_name_l1b=l1b_file, latitude=geo.latitude.values, longitude=geo.longitude.values, resolution=1, - ancillary_dir=fixturepath, - geos_file_1=geos_file_1, - geos_file_2=geos_file_2, - geos_land=geos_land, - geos_ocean=geos_ocean, - geos_constants=geos_constants, + geos_file_1=os.path.join(fixturepath, geos_file_1), + geos_file_2=os.path.join(fixturepath, geos_file_2), + geos_land=os.path.join(fixturepath, geos_land), + geos_ocean=os.path.join(fixturepath, geos_ocean), + geos_constants=os.path.join(fixturepath, geos_constants), ) geos_data = ancillary.get_geos()