From e4cb379a795f6ed6970a4e8a26e3890e5f317c0d Mon Sep 17 00:00:00 2001 From: Johannes Kasimir Date: Wed, 26 Jun 2024 09:19:06 +0200 Subject: [PATCH 1/3] fix: dont load wavelength --- src/ess/dream/io/geant4.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/ess/dream/io/geant4.py b/src/ess/dream/io/geant4.py index 85070ada..50fb896b 100644 --- a/src/ess/dream/io/geant4.py +++ b/src/ess/dream/io/geant4.py @@ -83,6 +83,7 @@ def _load_raw_events(file_path: str) -> sc.DataArray: file_path, sep="\t", header_parser="bracket", data_columns=[] ) table = table.rename_dims(row="event") + table.coords.pop("lambda") return sc.DataArray( sc.ones(sizes=table.sizes, with_variances=True, unit="counts"), coords=table.coords, @@ -90,8 +91,6 @@ def _load_raw_events(file_path: str) -> sc.DataArray: def _adjust_coords(da: sc.DataArray) -> None: - da.coords["wavelength"] = da.coords.pop("lambda") - da.coords["wavelength"].unit = "angstrom" da.coords["position"] = sc.spatial.as_vectors( da.coords.pop("x_pos"), da.coords.pop("y_pos"), da.coords.pop("z_pos") ) From b5854fc1e372e6edd8b1668a895726bc28689630 Mon Sep 17 00:00:00 2001 From: Johannes Kasimir Date: Wed, 26 Jun 2024 09:30:20 +0200 Subject: [PATCH 2/3] test: remove tests checking for the wavelength coordinate --- tests/dream/io/geant4_test.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/tests/dream/io/geant4_test.py b/tests/dream/io/geant4_test.py index b97bcc7f..b2162a16 100644 --- a/tests/dream/io/geant4_test.py +++ b/tests/dream/io/geant4_test.py @@ -113,7 +113,6 @@ def test_load_geant4_csv_mantle_has_expected_coords(file): assert "sector" not in mantle.bins.coords assert "tof" in mantle.bins.coords - assert "wavelength" in mantle.bins.coords assert "position" in mantle.coords @@ -128,7 +127,6 @@ def test_load_geant4_csv_endcap_backward_has_expected_coords(file): assert "sector" not in endcap.bins.coords assert "tof" in endcap.bins.coords - assert "wavelength" in endcap.bins.coords assert "position" in endcap.coords @@ -143,7 +141,6 @@ def test_load_geant4_csv_endcap_forward_has_expected_coords(file): assert "sector" not in endcap.bins.coords assert "tof" in endcap.bins.coords - assert "wavelength" in endcap.bins.coords assert "position" in endcap.coords @@ -157,7 +154,6 @@ def test_load_geant4_csv_high_resolution_has_expected_coords(file): assert_index_coord(hr.coords["sector"], values=set(range(1, 5))) assert "tof" in hr.bins.coords - assert "wavelength" in hr.bins.coords assert "position" in hr.coords @@ -174,7 +170,6 @@ def test_load_geant4_csv_sans_has_expected_coords(file): assert_index_coord(sans.coords["sector"], values=set(range(1, 5))) assert "tof" in sans.bins.coords - assert "wavelength" in sans.bins.coords assert "position" in sans.coords From 297dd31520052779b264331b4cbee2b1ce0d47f0 Mon Sep 17 00:00:00 2001 From: Johannes Kasimir Date: Wed, 26 Jun 2024 10:07:56 +0200 Subject: [PATCH 3/3] fix: remove reference to wavelength --- docs/user-guide/dream/dream-instrument-view.ipynb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/user-guide/dream/dream-instrument-view.ipynb b/docs/user-guide/dream/dream-instrument-view.ipynb index 8987b224..ad4dc3fa 100644 --- a/docs/user-guide/dream/dream-instrument-view.ipynb +++ b/docs/user-guide/dream/dream-instrument-view.ipynb @@ -183,7 +183,7 @@ }, "outputs": [], "source": [ - "mantle_view = dream.instrument_view(dg[\"mantle\"].hist(wavelength=50), dim=\"wavelength\")\n", + "mantle_view = dream.instrument_view(dg[\"mantle\"].hist(tof=50), dim=\"tof\")\n", "mantle_view" ] }, @@ -201,7 +201,7 @@ }, "outputs": [], "source": [ - "mantle_view[1].controls[\"wavelength\"][\"slider\"].value = 43" + "mantle_view[1].controls[\"tof\"][\"slider\"].value = 43" ] }, { @@ -242,7 +242,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.13" + "version": "3.10.14" } }, "nbformat": 4,