Skip to content

Commit

Permalink
update Nexus config file
Browse files Browse the repository at this point in the history
  • Loading branch information
rettigl committed Feb 28, 2024
1 parent 5f903a6 commit a510154
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 30 deletions.
35 changes: 20 additions & 15 deletions specsscan/config/NXmpes_arpes_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
"analyzer_elevation/@units": "degrees",
"analyzer_elevation/@vector": [0, 1, 0],
"analyzer_rotation/@depends_on": "rot_y",
"analyzer_rotation": 90,
"analyzer_rotation": 0,
"analyzer_rotation/@transformation_type": "rotation",
"analyzer_rotation/@units": "degrees",
"analyzer_rotation/@vector": [0, 0, 1],
Expand Down Expand Up @@ -271,33 +271,38 @@
"drain_current": {
"amperemeter": "@link:/entry/instrument/manipulator/drain_current_amperemeter"
},
"depends_on": "/entry/sample/transformations/bz_offset",
"depends_on": "/entry/sample/transformations/offset_azimuth",
"transformations": {
"AXISNAME[bz_offset]/@depends_on": "sample_azimuth",
"AXISNAME[bz_offset]": 0,
"AXISNAME[bz_offset]/@units": "degrees",
"AXISNAME[bz_offset]/@transformation_type": "rotation",
"AXISNAME[bz_offset]/@vector": [0, 0, 1],
"sample_azimuth/@depends_on": "sample_tilt",
"offset_azimuth/@depends_on": "sample_azimuth",
"offset_azimuth": 0,
"offset_azimuth/@units": "degrees",
"offset_azimuth/@transformation_type": "rotation",
"offset_azimuth/@vector": [0, 0, 1],
"sample_azimuth/@depends_on": "offset_tilt",
"sample_azimuth": "@attrs:metadata/scan_info/trARPES:Carving:OMG.RBV",
"sample_azimuth/@units": "degrees",
"sample_azimuth/@transformation_type": "rotation",
"sample_azimuth/@vector": [0, 0, 1],
"sample_tilt/@depends_on": "sample_polar",
"offset_tilt/@depends_on": "sample_tilt",
"offset_tilt": 0,
"offset_tilt/@units": "degrees",
"offset_tilt/@transformation_type": "rotation",
"offset_tilt/@vector": [1, 0, 0],
"sample_tilt/@depends_on": "offset_polar",
"sample_tilt": "@attrs:metadata/scan_info/trARPES:Carving:PHI.RBV",
"sample_tilt/@units": "degrees",
"sample_tilt/@transformation_type": "rotation",
"sample_tilt/@vector": [1, 0, 0],
"sample_polar/@depends_on": "polar_offset",
"offset_polar/@depends_on": "sample_polar",
"offset_polar": -321,
"offset_polar/@units": "degrees",
"offset_polar/@transformation_type": "rotation",
"offset_polar/@vector": [0, 1, 0],
"sample_polar/@depends_on": "yz_flip",
"sample_polar": "@attrs:metadata/scan_info/trARPES:Carving:THT.RBV",
"sample_polar/@units": "degrees",
"sample_polar/@transformation_type": "rotation",
"sample_polar/@vector": [0, 1, 0],
"polar_offset/@depends_on": "yz_flip",
"polar_offset": -321,
"polar_offset/@units": "degrees",
"polar_offset/@transformation_type": "rotation",
"polar_offset/@vector": [0, 1, 0],
"AXISNAME[yz_flip]/@depends_on": "xy_adjust",
"AXISNAME[yz_flip]": 90.0,
"AXISNAME[yz_flip]/@units": "degrees",
Expand Down
24 changes: 9 additions & 15 deletions tutorial/specscan_conversion_to_NXmpes.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"%load_ext autoreload\n",
"%autoreload 2\n",
"from specsscan import SpecsScan\n",
"from pathlib import Path"
"from pathlib import Path\n",
"import matplotlib.pyplot as plt"
]
},
{
Expand Down Expand Up @@ -123,12 +124,10 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"tags": []
},
"metadata": {},
"outputs": [],
"source": [
"config = {\"nexus\":{\"definition\": \"NXmpes_arpes\"}, \"spa_params\":{\"crop\":True, \"ek_min\":20.2, \"ek_max\":22.5, \"ang_min\":-13.5, \"ang_max\":13.5}}"
"config = {\"nexus\":{\"definition\": \"NXmpes_arpes\"}, \"spa_params\":{\"crop\":True, \"ek_range_min\":0.07597844332538181, \"ek_range_max\":0.9117413199045858, \"ang_range_min\":0.16453159041394336, \"ang_range_max\":0.8840087145969499,}}"
]
},
{
Expand All @@ -147,7 +146,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"The load_scan method loads the scan as an xarray along with the metadata needed for nexus conversion. The progress bars can be activated by changing the config parameter, enable_nested_progress_bar, to true in config.yaml "
"The load_scan method loads the scan as an xarray along with the metadata needed for nexus conversion."
]
},
{
Expand All @@ -173,7 +172,8 @@
"outputs": [],
"source": [
"%matplotlib inline\n",
"res_xarray[:,29,:].plot()"
"res_xarray[:,29,:].plot()\n",
"plt.show()"
]
},
{
Expand All @@ -185,7 +185,8 @@
"outputs": [],
"source": [
"%matplotlib inline\n",
"res_xarray.loc[{\"energy\":slice(21.6, 21.8)}].sum(axis=2).plot()"
"res_xarray.loc[{\"energy\":slice(21.6, 21.8)}].sum(axis=2).plot()\n",
"plt.show()"
]
},
{
Expand All @@ -199,13 +200,6 @@
"sps.save(\"FS_map_CsV3Sb5.h5\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The data may be visualised as a 2D plot by slicing the xarray in 2 dimensions keeping the third fixed. In the plot below, the Angle vs Ekin data is plotted for a fixed mirrorX value."
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down

0 comments on commit a510154

Please sign in to comment.