diff --git a/.cspell/custom-dictionary.txt b/.cspell/custom-dictionary.txt index 2e4c8b3..73d5ae7 100644 --- a/.cspell/custom-dictionary.txt +++ b/.cspell/custom-dictionary.txt @@ -7,6 +7,7 @@ Bessy binarywave bnote caplog +codemirror configfile dataconverter Dobener @@ -14,6 +15,7 @@ dsml Dyna Ecut FEMTOSPEX +FIELDNAME fluence fluences fontawesome diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 729c48a..d8b3ba3 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -30,7 +30,7 @@ jobs: run: | curl -LsSf https://astral.sh/uv/install.sh | sh - name: Install nomad - if: "${{ matrix.python_version != '3.8'}}" + if: "${{ matrix.python_version != '3.8' && matrix.python_version != '3.9'}}" run: | uv pip install nomad-lab[infrastructure]@git+https://gitlab.mpcdf.mpg.de/nomad-lab/nomad-FAIR.git - name: Install package diff --git a/CITATION.cff b/CITATION.cff index 3b1d51e..042b974 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -1,41 +1,41 @@ -cff-version: 1.2.0 -title: 'pynxtools-igor: A pynxtools reader plugin for Wavemetrics Igor Pro data' -version: 0.1.0 -message: - If you use this software, please cite it using the - metadata from this file. -type: software -authors: - - given-names: Florian - family-names: Dobener - orcid: 'https://orcid.org/0000-0003-1987-6224' - - given-names: Laurenz - family-names: Rettig - orcid: 'https://orcid.org/0000-0002-0725-6696' - - given-names: Lukas - family-names: Pielsticker - orcid: 'https://orcid.org/0000-0001-9361-8333' - -doi: TODO -repository-code: 'https://github.com/FAIRmat-NFDI/pynxtools-igor' -url: TODO -keywords: - - Wavemetrics - - Igor Pro - - NOMAD - - pynxtools - - NeXus -abstract: - pynxtools-igor is a free, and open-source data software for converting data stored - with Wavemetrics [Igor Pro](https://www.wavemetrics.com/) into the [NeXus](https://www.nexusformat.org/) - format. It is implemented as a plugin for [pynxtools](https://github.com/FAIRmat-NFDI/pynxtools) and - allows to read, translate, and standardize data from Igor Pro binary waves and packed experiment files. - Depending on the domain of data, pynxtools allows to ensure compliance with various NeXus application - definitions. - - pynxtools-igor is developed both as a standalone reader and as a tool within NOMAD, an open-source data - management platform for materials science ((https://nomad-lab.eu/nomad-lab/). - - The work is funded by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) - 460197019 (FAIRmat) - (https://gepris.dfg.de/gepris/projekt/460197019?language=en). +cff-version: 1.2.0 +title: 'pynxtools-igor: A pynxtools reader plugin for Wavemetrics Igor Pro data' +version: 0.1.1 +message: + If you use this software, please cite it using the + metadata from this file. +type: software +authors: + - given-names: Florian + family-names: Dobener + orcid: 'https://orcid.org/0000-0003-1987-6224' + - given-names: Laurenz + family-names: Rettig + orcid: 'https://orcid.org/0000-0002-0725-6696' + - given-names: Lukas + family-names: Pielsticker + orcid: 'https://orcid.org/0000-0001-9361-8333' + +doi: TODO +repository-code: 'https://github.com/FAIRmat-NFDI/pynxtools-igor' +url: TODO +keywords: + - Wavemetrics + - Igor Pro + - NOMAD + - pynxtools + - NeXus +abstract: + pynxtools-igor is a free, and open-source data software for converting data stored + with Wavemetrics [Igor Pro](https://www.wavemetrics.com/) into the [NeXus](https://www.nexusformat.org/) + format. It is implemented as a plugin for [pynxtools](https://github.com/FAIRmat-NFDI/pynxtools) and + allows to read, translate, and standardize data from Igor Pro binary waves and packed experiment files. + Depending on the domain of data, pynxtools allows to ensure compliance with various NeXus application + definitions. + + pynxtools-igor is developed both as a standalone reader and as a tool within NOMAD, an open-source data + management platform for materials science ((https://nomad-lab.eu/nomad-lab/). + + The work is funded by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) - 460197019 (FAIRmat) + (https://gepris.dfg.de/gepris/projekt/460197019?language=en). license: Apache-2.0 \ No newline at end of file diff --git a/src/pynxtools_igor/nomad/examples/Conversion of time-resolved x-ray diffraction data.ipynb b/src/pynxtools_igor/nomad/examples/Conversion of time-resolved x-ray diffraction data.ipynb index e74e239..13aa6f1 100644 --- a/src/pynxtools_igor/nomad/examples/Conversion of time-resolved x-ray diffraction data.ipynb +++ b/src/pynxtools_igor/nomad/examples/Conversion of time-resolved x-ray diffraction data.ipynb @@ -40,7 +40,7 @@ " \"user0/name\": \"Laurenz Rettig\",\n", " \"user0/affiliation\": \"Fritz Haber Institute of the Max Planck Society\",\n", " \"instrument/beam/incident_energy\": 1187.5,\n", - " \"instrument/beam/probe/pulse_duration\": 70,\n", + " \"instrument/beam/probe/pulse_duration\": 70.0,\n", " \"sample/chemical_formula\": \"GdIr2Si2\",\n", " \"sample/name\": \"GdIr2Si2 single crystal\",\n", "}\n", @@ -57,14 +57,14 @@ " \"metadata\": {\n", " **metadata,\n", " **{\n", - " \"sample/temperature\": temperature,\n", + " \"sample/temperature\": float(temperature),\n", " \"entry_title\": f\"Resolved resonant x-ray diffraction data of GdIr2Si2 at {temperature} K\",\n", " },\n", " },\n", " }\n", "\n", "entry_dict\n", - "convert([configfile, infile], \"igor\", \"NXxrd\", outfile, objects=(entry_dict,))" + "convert([configfile, infile], \"igor\", \"NXroot\", outfile, objects=(entry_dict,))" ] }, { @@ -81,7 +81,7 @@ " \"user0/name\": \"Laurenz Rettig\",\n", " \"user0/affiliation\": \"Fritz Haber Institute of the Max Planck Society\",\n", " \"instrument/beam/incident_energy\": 1187.5,\n", - " \"instrument/beam/probe/pulse_duration\": 70,\n", + " \"instrument/beam/probe/pulse_duration\": 70.0,\n", " \"sample/chemical_formula\": \"GdCo2Si2\",\n", " \"sample/name\": \"GdCo2Si2 single crystal\",\n", "}\n", @@ -98,14 +98,14 @@ " \"metadata\": {\n", " **metadata,\n", " **{\n", - " \"sample/temperature\": temperature,\n", + " \"sample/temperature\": float(temperature),\n", " \"entry_title\": f\"Resolved resonant x-ray diffraction data of GdIr2Si2 at {temperature} K\",\n", " },\n", " },\n", " }\n", "\n", "entry_dict\n", - "convert([configfile, infile], \"igor\", \"NXxrd\", outfile, objects=(entry_dict,))" + "convert([configfile, infile], \"igor\", \"NXroot\", outfile, objects=(entry_dict,))" ] }, { @@ -129,7 +129,7 @@ " \"user0/name\": \"Laurenz Rettig\",\n", " \"user0/affiliation\": \"Fritz Haber Institute of the Max Planck Society\",\n", " \"instrument/beam/incident_energy\": 1187.5,\n", - " \"instrument/beam/probe/pulse_duration\": 70,\n", + " \"instrument/beam/probe/pulse_duration\": 70.0,\n", "}\n", "entry_dict = {}\n", "scans = [\n", @@ -160,7 +160,7 @@ " },\n", " }\n", "\n", - "convert([configfile, infile], \"igor\", \"NXxrd\", outfile, objects=(entry_dict,))" + "convert([configfile, infile], \"igor\", \"NXroot\", outfile, objects=(entry_dict,))" ] }, { @@ -184,7 +184,8 @@ " \"user0/name\": \"Laurenz Rettig\",\n", " \"user0/affiliation\": \"Fritz Haber Institute of the Max Planck Society\",\n", " \"instrument/beam/incident_energy\": 1187.5,\n", - " \"instrument/beam/probe/pulse_duration\": 70,\n", + " \"instrument/beam/probe/pulse_duration\": 70.0,\n", + " \"sample/temperature\": 20.0,\n", "}\n", "entry_dict = {}\n", "scans = [\"GdRh/voigt_area\", \"GdIr/voigt_area\", \"GdCo/voigt1_area_left\"]\n", @@ -207,7 +208,7 @@ " },\n", " }\n", "\n", - "convert([configfile, infile], \"igor\", \"NXxrd\", outfile, objects=(entry_dict,))" + "convert([configfile, infile], \"igor\", \"NXroot\", outfile, objects=(entry_dict,))" ] }, { @@ -231,10 +232,10 @@ " \"user0/name\": \"Laurenz Rettig\",\n", " \"user0/affiliation\": \"Fritz Haber Institute of the Max Planck Society\",\n", " \"instrument/beam/incident_energy\": 1187.5,\n", - " \"instrument/beam/probe/pulse_duration\": 100,\n", + " \"instrument/beam/probe/pulse_duration\": 100.0,\n", " \"sample/chemical_formula\": \"GdIr2Si2\",\n", " \"sample/name\": \"GdIr2Si2 single crystal\",\n", - " \"sample/temperature\": 20,\n", + " \"sample/temperature\": 20.0,\n", "}\n", "entry_dict = {}\n", "scans = [\"correction_2022Jan/GdCo_amp_08\", \"GdRh_ds_030_amp\", \"GdIr_ds_0200_amp\"]\n", @@ -260,7 +261,7 @@ " },\n", " }\n", "\n", - "convert([configfile, infile], \"igor\", \"NXxrd\", outfile, objects=(entry_dict,))" + "convert([configfile, infile], \"igor\", \"NXroot\", outfile, objects=(entry_dict,))" ] }, { @@ -277,10 +278,10 @@ " \"user0/name\": \"Laurenz Rettig\",\n", " \"user0/affiliation\": \"Fritz Haber Institute of the Max Planck Society\",\n", " \"instrument/beam/incident_energy\": 1187.5,\n", - " \"instrument/beam/probe/pulse_duration\": 100,\n", + " \"instrument/beam/probe/pulse_duration\": 100.0,\n", " \"sample/chemical_formula\": \"GdCo2Si2\",\n", " \"sample/name\": \"GdCo2Si2 single crystal\",\n", - " \"sample/temperature\": 20,\n", + " \"sample/temperature\": 20.0,\n", "}\n", "entry_dict = {}\n", "scans = [\"02\", \"04\", \"06\", \"08\", \"12\", \"20\"]\n", @@ -302,7 +303,7 @@ " },\n", " }\n", "\n", - "convert([configfile, infile], \"igor\", \"NXxrd\", outfile, objects=(entry_dict,))" + "convert([configfile, infile], \"igor\", \"NXroot\", outfile, objects=(entry_dict,))" ] }, { @@ -319,10 +320,10 @@ " \"user0/name\": \"Laurenz Rettig\",\n", " \"user0/affiliation\": \"Fritz Haber Institute of the Max Planck Society\",\n", " \"instrument/beam/incident_energy\": 1187.5,\n", - " \"instrument/beam/probe/pulse_duration\": 100,\n", + " \"instrument/beam/probe/pulse_duration\": 100.0,\n", " \"sample/chemical_formula\": \"GdRh2Si2\",\n", " \"sample/name\": \"GdRh2Si2 single crystal\",\n", - " \"sample/temperature\": 20,\n", + " \"sample/temperature\": 20.0,\n", "}\n", "entry_dict = {}\n", "scans = [\"005\", \"010\", \"015\", \"020\", \"030\", \"050\"]\n", @@ -344,7 +345,7 @@ " },\n", " }\n", "\n", - "convert([configfile, infile], \"igor\", \"NXxrd\", outfile, objects=(entry_dict,))" + "convert([configfile, infile], \"igor\", \"NXroot\", outfile, objects=(entry_dict,))" ] }, { @@ -361,10 +362,10 @@ " \"user0/name\": \"Laurenz Rettig\",\n", " \"user0/affiliation\": \"Fritz Haber Institute of the Max Planck Society\",\n", " \"instrument/beam/incident_energy\": 1187.5,\n", - " \"instrument/beam/probe/pulse_duration\": 100,\n", + " \"instrument/beam/probe/pulse_duration\": 100.0,\n", " \"sample/chemical_formula\": \"GdIr2Si2\",\n", " \"sample/name\": \"GdIr2Si2 single crystal\",\n", - " \"sample/temperature\": 20,\n", + " \"sample/temperature\": 20.0,\n", "}\n", "entry_dict = {}\n", "scans = [\"0025\", \"0050\", \"0100\", \"0150\", \"0200\", \"0300\"]\n", @@ -386,7 +387,7 @@ " },\n", " }\n", "\n", - "convert([configfile, infile], \"igor\", \"NXxrd\", outfile, objects=(entry_dict,))" + "convert([configfile, infile], \"igor\", \"NXroot\", outfile, objects=(entry_dict,))" ] }, { diff --git a/src/pynxtools_igor/nomad/examples/config_file.json b/src/pynxtools_igor/nomad/examples/config_file.json index c72a308..16b869d 100644 --- a/src/pynxtools_igor/nomad/examples/config_file.json +++ b/src/pynxtools_igor/nomad/examples/config_file.json @@ -3,8 +3,8 @@ "/ENTRY/DATA[data]/@axes": "@data:dims", "/ENTRY/DATA[data]/AXISNAME_indices[@*_indices]": "@data:*.index", "/ENTRY/DATA[data]/@signal": "data", - "/ENTRY/DATA[data]/data": "@data:data", - "/ENTRY/DATA[data]/data/@units": "@data:data.units", + "/ENTRY/DATA[data]/DATA[data]": "@data:data", + "/ENTRY/DATA[data]/DATA[data]/@units": "@data:data.units", "/ENTRY/DATA[data]/AXISNAME[*]": "@data:*.data", "/ENTRY/DATA[data]/AXISNAME[*]/@units": "@data:*.units" } \ No newline at end of file diff --git a/src/pynxtools_igor/nomad/examples/config_file_delay_scans.json b/src/pynxtools_igor/nomad/examples/config_file_delay_scans.json index 5ff9bc5..66fdb2d 100644 --- a/src/pynxtools_igor/nomad/examples/config_file_delay_scans.json +++ b/src/pynxtools_igor/nomad/examples/config_file_delay_scans.json @@ -12,7 +12,7 @@ "name": "Bessy II", "probe": "x-ray", "type": "Synchrotron X-ray Source", - "mode": "Slicing" + "mode": "Single Bunch" }, "BEAM[beam_probe]": { "distance": 0.0, @@ -32,9 +32,9 @@ "BEAM[beam_pump]": { "distance": 0.0, "distance/@units": "mm", - "incident_energy": "1.55", + "incident_energy": 1.55, "incident_energy/@units": "eV", - "pulse_duration": "['@eln:/ENTRY/Instrument/Beam/Probe/pulse_duration', '50']", + "pulse_duration": "['@eln:/ENTRY/Instrument/Beam/Pump/pulse_duration', '50.']", "pulse_duration/@units": "fs", "incident_polarization": [1, 1, 0, 0], "incident_polarization/@units": "V^2/mm^2", @@ -42,26 +42,28 @@ "fluence/@units": "mJ/cm^2" }, "DETECTOR[detector]": { - "amplifier_type": "APD", - "detector_type": "APD", - "amplifier_voltage": 150, - "amplifier_voltage/@units": "V" + "type": "APD", + "acquisition_mode": "event", + "COLLECTION[detector_parameters]": { + "amplifier_voltage": 150, + "amplifier_voltage/@units": "V" + } } }, "/ENTRY/SAMPLE[sample]": { "description": "['@eln:/ENTRY/Sample/description', '@attrs:sample/chemical_formula']", "name": "['@eln:/ENTRY/Sample/name', '@attrs:sample/name']", "situation": "vacuum", - "SUBSTANCE[substance]/molecular_formula_hill": "['@eln:/ENTRY/Sample/chemical_formula', '@attrs:sample/chemical_formula']", + "chemical_formula": "['@eln:/ENTRY/Sample/chemical_formula', '@attrs:sample/chemical_formula']", "temperature": "@attrs:sample/temperature", "temperature/@units": "K" }, "/ENTRY/DATA[data]/@axes": "@data:dims", "/ENTRY/DATA[data]/@signal": "data", "/ENTRY/DATA[data]/AXISNAME_indices[@*_indices]": "@data:*.index", - "/ENTRY/DATA[data]/data": "@data:data", - "/ENTRY/DATA[data]/data_errors": "@data:data.errors", - "/ENTRY/DATA[data]/data/@units": "@data:data.units", + "/ENTRY/DATA[data]/DATA[data]": "@data:data", + "/ENTRY/DATA[data]/FIELDNAME_errors[data_errors]": "@data:data.errors", + "/ENTRY/DATA[data]/DATA[data]/@units": "@data:data.units", "/ENTRY/DATA[data]/AXISNAME[*]": "@data:*.data", "/ENTRY/DATA[data]/AXISNAME[*]/@units": "@data:*.units" } \ No newline at end of file diff --git a/src/pynxtools_igor/nomad/examples/config_file_energies.json b/src/pynxtools_igor/nomad/examples/config_file_energies.json index 2d319a4..14bc330 100644 --- a/src/pynxtools_igor/nomad/examples/config_file_energies.json +++ b/src/pynxtools_igor/nomad/examples/config_file_energies.json @@ -25,26 +25,27 @@ "incident_polarization/@units": "V^2/mm^2" }, "DETECTOR[detector]": { - "amplifier_type": "APD", - "detector_type": "APD", - "amplifier_voltage": 150, - "amplifier_voltage/@units": "V" + "type": "APD", + "acquisition_mode": "event", + "COLLECTION[detector_parameters]": { + "amplifier_voltage": 150, + "amplifier_voltage/@units": "V" } + } }, "/ENTRY/SAMPLE[sample]": { "description": "['@eln:/ENTRY/Sample/description', '@attrs:sample/chemical_formula']", "name": "['@eln:/ENTRY/Sample/name', '@attrs:sample/name']", "situation": "vacuum", "chemical_formula": "['@eln:/ENTRY/Sample/chemical_formula', '@attrs:sample/chemical_formula']", - "temperature": "20", + "temperature": "@attrs:sample/temperature", "temperature/@units": "K" }, "/ENTRY/DATA[data]/@axes": "@data:dims", "/ENTRY/DATA[data]/@signal": "data", "/ENTRY/DATA[data]/AXISNAME_indices[@*_indices]": "@data:*.index", - "/ENTRY/DATA[data]/data": "@data:data", - "/ENTRY/DATA[data]/data_errors": "@data:data.errors", - "/ENTRY/DATA[data]/data/@units": "@data:data.units", + "/ENTRY/DATA[data]/DATA[data]": "@data:data", + "/ENTRY/DATA[data]/DATA[data]/@units": "@data:data.units", "/ENTRY/DATA[data]/AXISNAME[*]": "@data:*.data", "/ENTRY/DATA[data]/AXISNAME[*]/@units": "@data:*.units" } \ No newline at end of file diff --git a/src/pynxtools_igor/nomad/examples/config_file_peaks.json b/src/pynxtools_igor/nomad/examples/config_file_peaks.json index ea122de..16130fb 100644 --- a/src/pynxtools_igor/nomad/examples/config_file_peaks.json +++ b/src/pynxtools_igor/nomad/examples/config_file_peaks.json @@ -25,10 +25,12 @@ "incident_polarization/@units": "V^2/mm^2" }, "DETECTOR[detector]": { - "amplifier_type": "APD", - "detector_type": "APD", - "amplifier_voltage": 150, - "amplifier_voltage/@units": "V" + "type": "APD", + "acquisition_mode": "event", + "COLLECTION[detector_parameters]": { + "detector_bias": 150, + "detector_bias/@units": "V" + } } }, "/ENTRY/SAMPLE[sample]": { @@ -42,8 +44,8 @@ "/ENTRY/DATA[data]/@axes": "@data:dims", "/ENTRY/DATA[data]/@signal": "data", "/ENTRY/DATA[data]/AXISNAME_indices[@*_indices]": "@data:*.index", - "/ENTRY/DATA[data]/data": "@data:data", - "/ENTRY/DATA[data]/data/@units": "@data:data.units", + "/ENTRY/DATA[data]/DATA[data]": "@data:data", + "/ENTRY/DATA[data]/DATA[data]/@units": "@data:data.units", "/ENTRY/DATA[data]/AXISNAME[*]": "@data:*.data", "/ENTRY/DATA[data]/AXISNAME[*]/@units": "@data:*.units" } \ No newline at end of file diff --git a/src/pynxtools_igor/nomad/examples/config_file_temperatures.json b/src/pynxtools_igor/nomad/examples/config_file_temperatures.json index 7237867..6f9afa8 100644 --- a/src/pynxtools_igor/nomad/examples/config_file_temperatures.json +++ b/src/pynxtools_igor/nomad/examples/config_file_temperatures.json @@ -25,11 +25,13 @@ "incident_polarization/@units": "V^2/mm^2" }, "DETECTOR[detector]": { - "amplifier_type": "APD", - "detector_type": "APD", - "amplifier_voltage": 150, - "amplifier_voltage/@units": "V" + "type": "APD", + "acquisition_mode": "event", + "COLLECTION[detector_parameters]": { + "amplifier_voltage": 150, + "amplifier_voltage/@units": "V" } + } }, "/ENTRY/SAMPLE[sample]": { "description": "['@eln:/ENTRY/Sample/description', '@attrs:sample/chemical_formula']", @@ -42,9 +44,8 @@ "/ENTRY/DATA[data]/@axes": "@data:dims", "/ENTRY/DATA[data]/@signal": "data", "/ENTRY/DATA[data]/AXISNAME_indices[@*_indices]": "@data:*.index", - "/ENTRY/DATA[data]/data": "@data:data", - "/ENTRY/DATA[data]/data_errors": "@data:data.errors", - "/ENTRY/DATA[data]/data/@units": "@data:data.units", + "/ENTRY/DATA[data]/DATA[data]": "@data:data", + "/ENTRY/DATA[data]/DATA[data]/@units": "@data:data.units", "/ENTRY/DATA[data]/AXISNAME[*]": "@data:*.data", "/ENTRY/DATA[data]/AXISNAME[*]/@units": "@data:*.units" } \ No newline at end of file diff --git a/tests/data/config_file.json b/tests/data/config_file.json index c72a308..16b869d 100644 --- a/tests/data/config_file.json +++ b/tests/data/config_file.json @@ -3,8 +3,8 @@ "/ENTRY/DATA[data]/@axes": "@data:dims", "/ENTRY/DATA[data]/AXISNAME_indices[@*_indices]": "@data:*.index", "/ENTRY/DATA[data]/@signal": "data", - "/ENTRY/DATA[data]/data": "@data:data", - "/ENTRY/DATA[data]/data/@units": "@data:data.units", + "/ENTRY/DATA[data]/DATA[data]": "@data:data", + "/ENTRY/DATA[data]/DATA[data]/@units": "@data:data.units", "/ENTRY/DATA[data]/AXISNAME[*]": "@data:*.data", "/ENTRY/DATA[data]/AXISNAME[*]/@units": "@data:*.units" } \ No newline at end of file diff --git a/tests/data/example_ibw.nxs b/tests/data/example_ibw.nxs index f2608fd..c5887cf 100644 Binary files a/tests/data/example_ibw.nxs and b/tests/data/example_ibw.nxs differ diff --git a/tests/data/example_ibw_entry.nxs b/tests/data/example_ibw_entry.nxs index 9158bf6..ced20e0 100644 Binary files a/tests/data/example_ibw_entry.nxs and b/tests/data/example_ibw_entry.nxs differ diff --git a/tests/data/example_pxp.nxs b/tests/data/example_pxp.nxs index 2d63de4..d442649 100644 Binary files a/tests/data/example_pxp.nxs and b/tests/data/example_pxp.nxs differ