From 9dd8629478aab088ba60776f5450e802aa72290a Mon Sep 17 00:00:00 2001 From: domna Date: Wed, 31 Aug 2022 10:33:44 +0200 Subject: [PATCH 1/2] Updates tools and mpes example 2 --- docker/mpes/example/E2 Binning of WSe2.ipynb | 46 +++++++++++--------- tools.json | 13 +++++- 2 files changed, 37 insertions(+), 22 deletions(-) diff --git a/docker/mpes/example/E2 Binning of WSe2.ipynb b/docker/mpes/example/E2 Binning of WSe2.ipynb index 451936b..b246473 100644 --- a/docker/mpes/example/E2 Binning of WSe2.ipynb +++ b/docker/mpes/example/E2 Binning of WSe2.ipynb @@ -39,7 +39,6 @@ "metadata": {}, "outputs": [], "source": [ - "import shutil\n", "import os\n", "FDIR = f'{os.getcwd()}/Scan049_1'\n", "ECAL = f'{os.getcwd()}/energycal_2019_01_08'" @@ -75,7 +74,7 @@ "metadata": {}, "outputs": [], "source": [ - "! unzip 'WSe2.zip'" + "! unzip WSe2.zip" ] }, { @@ -559,7 +558,7 @@ "metadata": {}, "outputs": [], "source": [ - "# Manual Meta data\n", + "# manual Meta data\n", "#General\n", "metadata['experiment_summary'] = 'WSe2 XUV NIR pump probe data.'\n", "metadata['entry_title'] = 'Valence Band Dynamics - 800 nm linear s-polarized pump, 0.6 mJ/cm2 absorbed fluence'\n", @@ -567,6 +566,7 @@ "\n", "#User\n", "# Fill general parameters of NXuser\n", + "# TODO: discuss how to deal with multiple users?\n", "metadata['user0'] = {}\n", "metadata['user0']['name'] = 'Julian Maklar'\n", "metadata['user0']['role'] = 'Principal Investigator'\n", @@ -576,12 +576,12 @@ "\n", "#NXinstrument\n", "metadata['instrument'] = {}\n", + "#analyzer\n", "metadata['instrument']['analyzer']={}\n", "metadata['instrument']['analyzer']['slow_axes'] = \"delay\" # the scanned axes\n", "metadata['instrument']['analyzer']['spatial_resolution'] = 10.\n", "metadata['instrument']['analyzer']['energy_resolution'] = 110.\n", "metadata['instrument']['analyzer']['momentum_resolution'] = 0.08\n", - "metadata['instrument']['analyzer']['projection'] = \"reciprocal\"\n", "metadata['instrument']['analyzer']['working_distance'] = 4.\n", "metadata['instrument']['analyzer']['lens_mode'] = \"6kV_kmodem4.0_30VTOF.sav\"\n", "\n", @@ -613,15 +613,26 @@ "metadata['sample']['sample_history'] = 'Cleaved'\n", "metadata['sample']['chemical_formula'] = 'WSe2'\n", "metadata['sample']['description'] = 'Sample'\n", - "metadata['sample']['name'] = 'WSe2 Single Crystal'" + "metadata['sample']['name'] = 'WSe2 Single Crystal'\n", + "\n", + "metadata['file'] = {}\n", + "metadata['file'][\"trARPES:Carving:TEMP_RBV\"] = 300.\n", + "metadata['file'][\"trARPES:XGS600:PressureAC:P_RD\"] = 5.e-11\n", + "\n", + "#Sample positions\n", + "metadata['file'][\"trARPES:Carving:TRX.RBV\"] = np.nan\n", + "metadata['file'][\"trARPES:Carving:TRY.RBV\"] = np.nan\n", + "metadata['file'][\"trARPES:Carving:TRZ.RBV\"] = np.nan\n", + "metadata['file'][\"trARPES:Carving:THT.RBV\"] = np.nan\n", + "metadata['file'][\"trARPES:Carving:PHI.RBV\"] = np.nan\n", + "metadata['file'][\"trARPES:Carving:OMG.RBV\"] = np.nan" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "### Add additional EPCIS metadata\n", - "The following snippet adds metadata, which is normally read from the EPICS archive at FHI. Since this is not available in a public example we fill in the values manually here." + "### Run the following cell to store metadata from EPICS archive only if outside the FHI network" ] }, { @@ -634,17 +645,9 @@ "metadata['file'][\"KTOF:Lens:Extr:I\"] = -0.12877\n", "metadata['file'][\"KTOF:Lens:UDLD:V\"] = 399.99905\n", "metadata['file'][\"KTOF:Lens:Sample:V\"] = 17.19976\n", - "metadata['file'][\"trARPES:Carving:TEMP_RBV\"] = np.nan\n", - "metadata['file'][\"trARPES:XGS600:PressureAC:P_RD\"] = np.nan\n", "metadata['file'][\"KTOF:Apertures:m1.RBV\"] = 3.729931\n", "metadata['file'][\"KTOF:Apertures:m2.RBV\"] = -5.200078\n", - "metadata['file'][\"KTOF:Apertures:m3.RBV\"] = -11.00043\n", - "metadata['file'][\"trARPES:Carving:TRX.RBV\"] = np.nan\n", - "metadata['file'][\"trARPES:Carving:TRY.RBV\"] = np.nan\n", - "metadata['file'][\"trARPES:Carving:TRZ.RBV\"] = np.nan\n", - "metadata['file'][\"trARPES:Carving:THT.RBV\"] = np.nan\n", - "metadata['file'][\"trARPES:Carving:PHI.RBV\"] = np.nan\n", - "metadata['file'][\"trARPES:Carving:OMG.RBV\"] = np.nan" + "metadata['file'][\"KTOF:Apertures:m3.RBV\"] = -11.000425" ] }, { @@ -688,8 +691,8 @@ "metadata": {}, "outputs": [], "source": [ - "convert(input_file=[\"config_file.WSe2.json\"],\n", - " objects=res_xarray,\n", + "convert(input_file=[\"config_file.json\"],\n", + " objects=[res_xarray]\n", " reader='mpes',\n", " nxdl='NXmpes',\n", " output='WSe2.mpes.nxs')" @@ -727,8 +730,11 @@ } ], "metadata": { + "interpreter": { + "hash": "04a85ee725c84970834ee49bc50cfa1b458f13df4bad0079c1f67af1ec20cbf5" + }, "kernelspec": { - "display_name": "Python 3 (ipykernel)", + "display_name": "Python 3.7.10 64-bit (system)", "language": "python", "name": "python3" }, @@ -742,7 +748,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.12" + "version": "3.7.10" }, "widgets": { "application/vnd.jupyter.widget-state+json": { diff --git a/tools.json b/tools.json index 0d76960..19a0710 100644 --- a/tools.json +++ b/tools.json @@ -36,7 +36,16 @@ "description": "Includes multiple NeXus tools for visualization and analysis.", "image": "gitlab-registry.mpcdf.mpg.de/nomad-lab/nomad-remote-tools-hub/nexus-webtop:latest", "mount_path": "/config", - "file_extensions": ["nxs", "nx", "nexus", "hdf5", "hd5", "h5", "hdf", "ipynb"], + "file_extensions": [ + "nxs", + "nx", + "nexus", + "hdf5", + "hd5", + "h5", + "hdf", + "ipynb" + ], "maintainer": [ { "name": "Sandor Brockhauser", @@ -68,7 +77,7 @@ }, "mpes": { "short_description": "An example for analyzing mpes data.", - "description": "This example presents the capabilities of the NOMAD platform to store and standardize multi photoemission spectroscopy (MPES) experimental data. It contains three major examples:\n\n- Taking a pre-binned file, here stored in a h5 file, and converting it into the standardized MPES NeXus format. There exists a [NeXus application definition for MPES](https: //manual.nexusformat.org/classes/contributed_definitions/NXmpes.html#nxmpes) which details the internal structure of such a file.\n- Binning of raw data (see [here](https: //www.nature.com/articles/s41597-020-00769-8) for additional resources) into a h5 file and consecutively generating a NeXus file from it.\n- An analysis example using data in the NeXus format and employing the [pyARPES](https: //github.com/chstan/arpes) analysis tool to reproduce the main findings of [this paper](https://arxiv.org/pdf/2107.07158.pdf).", + "description": "This example presents the capabilities of the NOMAD platform to store and standardize multi photoemission spectroscopy (MPES) experimental data. It contains three major examples:\n\n- Taking a pre-binned file, here stored in a h5 file, and converting it into the standardized MPES NeXus format. There exists a [NeXus application definition for MPES](https://manual.nexusformat.org/classes/contributed_definitions/NXmpes.html#nxmpes) which details the internal structure of such a file.\n- Binning of raw data (see [here](https://www.nature.com/articles/s41597-020-00769-8) for additional resources) into a h5 file and consecutively generating a NeXus file from it.\n- An analysis example using data in the NeXus format and employing the [pyARPES](https://github.com/chstan/arpes) analysis tool to reproduce the main findings of [this paper](https://arxiv.org/pdf/2107.07158.pdf).", "image": "gitlab-registry.mpcdf.mpg.de/nomad-lab/nomad-remote-tools-hub/mpes-webtop", "mount_path": "/config", "file_extensions": [ -- GitLab From 9eeae993acf33a61f3d7472e97213988ca0bcf31 Mon Sep 17 00:00:00 2001 From: domna Date: Wed, 31 Aug 2022 10:37:21 +0200 Subject: [PATCH 2/2] Updates MoTe2 link and filename --- docker/mpes/example/E1 Convert to NeXus.ipynb | 17 +++++++++++------ docker/mpes/example/mpes.archive.json | 4 ++-- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/docker/mpes/example/E1 Convert to NeXus.ipynb b/docker/mpes/example/E1 Convert to NeXus.ipynb index 899055e..d44cd96 100644 --- a/docker/mpes/example/E1 Convert to NeXus.ipynb +++ b/docker/mpes/example/E1 Convert to NeXus.ipynb @@ -21,7 +21,7 @@ "source": [ "## Download the data\n", "Since the provided datafile is comparably large (~200MB) it is not directly provided with the example.\n", - "You can [download](https://datashare.mpcdf.mpg.de/s/VY8GrMQ1KOQeH4F/download) it from zenodo. Place the file in the directory of this notebook afterwards. Under Linux, macOS and in a NORTH container you can directly use the cell below to download the file with curl." + "You can [download](https://zenodo.org/record/7035754/files/MoTe2.h5?download=1) it from zenodo. Place the file in the directory of this notebook afterwards. Under Linux, macOS and in a NORTH container you can directly use the cell below to download the file with curl." ] }, { @@ -30,7 +30,7 @@ "metadata": {}, "outputs": [], "source": [ - "! curl -o MoTe.h5 \"https://datashare.mpcdf.mpg.de/s/VY8GrMQ1KOQeH4F/download\"" + "! curl -o MoTe2.h5 \"https://zenodo.org/record/7035754/files/MoTe2.h5?download=1\"" ] }, { @@ -50,7 +50,7 @@ "dataconverter \\\n", " --reader mpes \\\n", " --nxdl NXmpes \\\n", - " --input-file MoTe.h5 \\\n", + " --input-file MoTe2.h5 \\\n", " --input-file config_file.json \\\n", " --input-file eln_data.yaml \\\n", " --output MoTe.mpes.nx\n", @@ -85,7 +85,7 @@ "metadata": {}, "outputs": [], "source": [ - "convert(input_file=[\"MoTe.h5\", \"config_file.json\", \"eln_data.yaml\"],\n", + "convert(input_file=[\"MoTe2.h5\", \"config_file.json\", \"eln_data.yaml\"],\n", " reader='mpes',\n", " nxdl='NXmpes',\n", " output='MoTe.mpes.nxs')" @@ -118,13 +118,13 @@ "metadata": {}, "outputs": [], "source": [ - "H5Web('MoTe.mpes.nxs')" + "H5Web('MoTe2.mpes.nxs')" ] } ], "metadata": { "kernelspec": { - "display_name": "Python 3 (ipykernel)", + "display_name": "Python 3.10.4 64-bit ('3.10.4')", "language": "python", "name": "python3" }, @@ -140,6 +140,11 @@ "pygments_lexer": "ipython3", "version": "3.10.4" }, + "vscode": { + "interpreter": { + "hash": "c2ecc4d45d4efcd07af778d75fd26bf86d0642a6646ea5c57f06d5857684e419" + } + }, "widgets": { "application/vnd.jupyter.widget-state+json": { "state": {}, diff --git a/docker/mpes/example/mpes.archive.json b/docker/mpes/example/mpes.archive.json index ff6f878..7a7435d 100644 --- a/docker/mpes/example/mpes.archive.json +++ b/docker/mpes/example/mpes.archive.json @@ -5,10 +5,10 @@ "nxdl": "NXmpes.nxdl", "input_files": [ "config_file.json", - "MoTe.h5", + "MoTe2.h5", "eln_data.yaml" ], - "output": "MoTe.mpes.nxs", + "output": "MoTe2.mpes.nxs", "User": { "name": "Julian Maklar", "role": "Principal Investigator", -- GitLab