def test_read_spice_l2_fits_single_file_dumbbells(spice_rasdb_filename): filename = spice_rasdb_filename result = read_spice_l2_fits(filename, read_dumbbells=True) assert isinstance(result, READ_SPICE_L2_FITS_RETURN_TYPE) assert all(window.meta.contains_dumbbell for window in result.values()) assert set(result.aligned_axes.values()) == {tuple(range(4))} assert all( isinstance(window, SpectrogramCube) for window in result.values())
def test_read_spice_l2_fits_single_file_window(spice_rasdb_filename): filename = spice_rasdb_filename result = read_spice_l2_fits(filename, windows=["WINDOW0_70.51"]) assert isinstance(result, READ_SPICE_L2_FITS_RETURN_TYPE) assert result.aligned_axes is None assert len(result) == 1 assert all( isinstance(window, SpectrogramCube) for window in result.values())
def test_read_spice_l2_fits_single_file_multiple_windows(spice_rasdb_filename): filename = spice_rasdb_filename result = read_spice_l2_fits(filename) assert isinstance(result, READ_SPICE_L2_FITS_RETURN_TYPE) assert set(result.aligned_axes.values()) == {(0, 2, 3)} assert len(result) == 2 assert all( isinstance(window, SpectrogramCube) for window in result.values())
def test_read_spice_l2_fits_multiple_files_dumbbells(spice_rasdb_filename): filenames = [spice_rasdb_filename] * 2 result = read_spice_l2_fits(filenames, read_dumbbells=True) assert isinstance(result, READ_SPICE_L2_FITS_RETURN_TYPE) assert all(window[0].meta.contains_dumbbell for window in result.values()) assert set(result.aligned_axes.values()) == {tuple(range(4))} assert all(window.dimensions[0].value == len(filenames) for window in result.values()) assert all( isinstance(window, SpectrogramSequence) for window in result.values())
def test_read_spice_l2_fits_multiple_sns_multiple_windows(spice_sns_filename): filenames = [spice_sns_filename] * 2 result = read_spice_l2_fits(filenames) assert isinstance(result, READ_SPICE_L2_FITS_RETURN_TYPE) assert set(result.aligned_axes.values()) == {(0, 2, 3)} assert len(result) == 2 assert all(window.dimensions[0].value == len(filenames) for window in result.values()) assert all( isinstance(window, SpectrogramSequence) for window in result.values())
def test_read_spice_l2_fits_multiple_rasters_single_window( spice_rasdb_filename): filenames = [spice_rasdb_filename] * 2 result = read_spice_l2_fits(filenames, windows=["WINDOW0_70.51"]) assert isinstance(result, READ_SPICE_L2_FITS_RETURN_TYPE) assert result.aligned_axes is None assert len(result) == 1 assert all(window.dimensions[0].value == len(filenames) for window in result.values()) assert all( isinstance(window, RasterSequence) for window in result.values())
def test_read_spice_l2_fits_incompatible_files(spice_rasdb_filename, spice_sns_filename): with pytest.raises(ValueError): filenames = [spice_rasdb_filename, spice_sns_filename] result = read_spice_l2_fits(filenames)