Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependencies #41

Merged
merged 2 commits into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
395 changes: 202 additions & 193 deletions poetry.lock

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ matplotlib = ">=3.5.1"
numpy = ">=1.21.6"
opencv-python = ">=4.8.1.78"
pynxtools-mpes = ">=0.0.1"
pynxtools = ">=0.3.1"
python-dateutil = ">=2.8.2"
pyyaml = ">=6.0"
xarray = ">=0.20.2"
Expand Down
25 changes: 12 additions & 13 deletions specsscan/config/NXmpes_arpes_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@


"depends_on": "/entry/instrument/electronanalyser/transformations/trans_z",
"transformations": {
"TRANSFORMATIONS[transformations]": {
"AXISNAME[trans_z]/@depends_on": "analyzer_elevation",
"AXISNAME[trans_z]": 40.0,
"AXISNAME[trans_z]/@transformation_type": "translation",
Expand All @@ -116,7 +116,6 @@
"AXISNAME[rot_y]/@transformation_type": "rotation",
"AXISNAME[rot_y]/@units": "degrees",
"AXISNAME[rot_y]/@vector": [0, 1, 0]

}
},
"/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/COLLECTIONCOLUMN[collectioncolumn]": {
Expand All @@ -130,8 +129,8 @@
"energy_scan_mode": "@attrs:metadata/scan_info/energy_scan_mode",
"pass_energy": "@attrs:metadata/scan_info/PassEnergy",
"pass_energy/@units": "eV",
"kinetic_energy": "@attrs:metadata/scan_info/KineticEnergy",
"kinetic_energy/@units": "eV",
"center_energy": "@attrs:metadata/scan_info/KineticEnergy",
"center_energy/@units": "eV",
"scheme": "hemispherical",
"diameter": 300.0,
"diameter/@units": "mm",
Expand All @@ -158,7 +157,7 @@
"detector_voltage": "@attrs:metadata/scan_info/ScreenVoltage",
"detector_voltage/@units": "V"
},
"/ENTRY[entry]/INSTRUMENT[instrument]/source_TYPE[source_probe]": {
"/ENTRY[entry]/INSTRUMENT[instrument]/sourceTYPE[source_probe]": {
"name": "HHG @ TR-ARPES @ FHI",
"probe": "photon",
"type": "HHG laser",
Expand All @@ -167,7 +166,7 @@
"frequency/@units": "kHz",
"associated_beam": "/entry/instrument/beam_probe"
},
"/ENTRY[entry]/INSTRUMENT[instrument]/beam_TYPE[beam_probe]": {
"/ENTRY[entry]/INSTRUMENT[instrument]/beamTYPE[beam_probe]": {
"distance": 0.0,
"distance/@units": "mm",
"incident_energy": "@attrs:metadata/instrument/beam/probe/incident_energy",
Expand All @@ -182,7 +181,7 @@
"extent/@units": "µm",
"associated_source": "/entry/instrument/source_probe"
},
"/ENTRY[entry]/INSTRUMENT[instrument]/source_TYPE[source_pump]": {
"/ENTRY[entry]/INSTRUMENT[instrument]/sourceTYPE[source_pump]": {
"name": "OPCPA @ TR-ARPES @ FHI",
"probe": "visible light",
"type": "Optical Laser",
Expand All @@ -191,7 +190,7 @@
"frequency/@units": "kHz",
"associated_beam": "/entry/instrument/beam_pump"
},
"/ENTRY[entry]/INSTRUMENT[instrument]/beam_TYPE[beam_pump]": {
"/ENTRY[entry]/INSTRUMENT[instrument]/beamTYPE[beam_pump]": {
"distance": 0.0,
"distance/@units": "mm",
"incident_energy": "@attrs:metadata/instrument/beam/pump/incident_energy",
Expand Down Expand Up @@ -254,7 +253,7 @@
},
"/ENTRY[entry]/SAMPLE[sample]": {
"preparation_date": "@attrs:metadata/sample/preparation_date",
"sample_history/notes": "@attrs:metadata/sample/sample_history",
"history/notes/description": "@attrs:metadata/sample/sample_history",
"description": "@attrs:metadata/sample/chemical_formula",
"name": "@attrs:metadata/sample/name",
"situation": "vacuum",
Expand All @@ -272,7 +271,7 @@
"amperemeter": "@link:/entry/instrument/manipulator/drain_current_amperemeter"
},
"depends_on": "/entry/sample/transformations/offset_azimuth",
"transformations": {
"TRANSFORMATIONS[transformations]": {
"offset_azimuth/@depends_on": "sample_azimuth",
"offset_azimuth": 0,
"offset_azimuth/@units": "degrees",
Expand Down Expand Up @@ -330,11 +329,11 @@
"AXISNAME[trans_x]/@vector": [0, 1, 0]
}
},
"/ENTRY[entry]/PROCESS[process]/energy_calibration":{
"/ENTRY[entry]/PROCESS[process]/CALIBRATION[energy_calibration]":{
"calibrated_axis": "@link:/entry/data/energy"
},
"/ENTRY[entry]/PROCESS[process]/CALIBRATION[angular1_calibration]":{
"calibrated_axis": "@link:/entry/data/angular1"
"/ENTRY[entry]/PROCESS[process]/CALIBRATION[angular0_calibration]":{
"calibrated_axis": "@link:/entry/data/angular0"
},
"/ENTRY[entry]/data": {
"@axes": "@data:dims",
Expand Down
20 changes: 9 additions & 11 deletions specsscan/config/example_config_FHI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ enable_nested_progress_bar: false
# dictionary containing renaming rules for axis names (to change the name in the xarrays)
coordinate_mapping:
Ekin: "energy"
Angle: "angular1"
polar: "angular2"
tilt: "angular2"
azimuth: "angular2"
X: "spatial1"
Y: "spatial1"
Z: "spatial1"
Angle: "angular0"
polar: "angular1"
tilt: "angular1"
azimuth: "angular1"
X: "spatial0"
Y: "spatial0"
Z: "spatial0"

# dictionary of corresponding NeXus paths for the different axes
coordinate_depends:
Expand All @@ -27,15 +27,13 @@ coordinate_depends:

# dictionary containing units for the respective axes
units:
angular0: "degree"
angular1: "degree"
angular2: "degree"
energy: "eV"
delay: "fs"
mirrorX: "steps"
mirrorY: "steps"
X: "mm"
Y: "mm"
Z: "mm"
spatial0: "mm"
voltage: "V"

# URL of the epics archiver request engine
Expand Down
4 changes: 2 additions & 2 deletions specsscan/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def load_scan(

loader_dict = {
"iterations": iterations,
"scan_path": scan_path,
"scan_path": str(scan_path),
"raw_data": data,
}

Expand Down Expand Up @@ -404,7 +404,7 @@ def check_scan(

loader_dict = {
"delays": delays,
"scan_path": scan_path,
"scan_path": str(scan_path),
"raw_data": data,
"check_scan": True,
}
Expand Down
4 changes: 2 additions & 2 deletions specsscan/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ def handle_meta(
print("Gathering metadata from different locations")
# get metadata from LUT dataframe
lut_meta = {}
energy_scan_mode = "fixed"
energy_scan_mode = "snapshot"
if df_lut is not None:
for col in df_lut.columns:
col_array = df_lut[f"{col}"].to_numpy()
Expand All @@ -390,7 +390,7 @@ def handle_meta(

kinetic_energy = df_lut["KineticEnergy"].to_numpy()
if len(set(kinetic_energy)) > 1 and scan_info["ScanType"] == "voltage":
energy_scan_mode = "sweep"
energy_scan_mode = "fixed_analyser_transmission"

metadata["scan_info"] = complete_dictionary(
metadata.get("scan_info", {}),
Expand Down
2 changes: 1 addition & 1 deletion tests/data
Submodule data updated from a6ef66 to aefc67
8 changes: 4 additions & 4 deletions tests/test_specsscan.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,14 +317,14 @@ def test_conversion_and_save_to_nexus():
crop=True,
)

assert res_xarray.dims == ("angular1", "angular2", "energy")
assert res_xarray.dims == ("angular0", "angular1", "energy")

with pytest.raises(NameError):
sps.save("result.tiff")
sps.save("result.tiff", alias_dict={"X": "angular1", "Y": "angular2"})
sps.save("result.tiff", alias_dict={"X": "angular0", "Y": "angular1"})
sps.save("result.h5")
with pytest.raises(LookupError):
sps.save("result.nxs")
# with pytest.raises(LookupError):
# sps.save("result.nxs")

metadata = {}
# General
Expand Down
Loading