Skip to content

Update pynxtools #567

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

Merged
merged 33 commits into from
Apr 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
e41a2b1
split off metadata class, and first version if elabFTW metadata retri…
rettigl Jan 14, 2025
3a32112
sort metadata
rettigl Jan 14, 2025
862bc78
add user information
rettigl Jan 14, 2025
d8cce46
fixup metadata
rettigl Jan 14, 2025
94166fc
fix tests
rettigl Jan 14, 2025
8186e9a
remove pump beam section if pump closed
rettigl Jan 16, 2025
dffa6d1
use default config dir also for user config
rettigl Jan 16, 2025
ac18011
change to config_v1.yaml
rettigl Jan 16, 2025
5f00201
add mock tests for metadata retrieval
rettigl Jan 20, 2025
3cab84e
Merge remote-tracking branch 'origin/v1_feature_branch' into mpes_ela…
rettigl Jan 20, 2025
9089964
add additional tests
rettigl Jan 26, 2025
d7e182f
always store config
rettigl Jan 26, 2025
b014c18
fix docs
rettigl Jan 26, 2025
bcefdfb
fix warning messages
rettigl Jan 27, 2025
74128c2
fix tests to not overwrite .env file
rettigl Jan 28, 2025
cf2abc6
allow coverage report for config module
rettigl Jan 28, 2025
79547d3
Merge remote-tracking branch 'origin/main' into mpes_elab_metadata
rettigl Feb 6, 2025
935dfeb
fix beam status
rettigl Feb 10, 2025
9bc2f8b
allow disabling copy tool
rettigl Feb 10, 2025
2289c9c
add pump2, and fix polarization and pump status conversion
rettigl Feb 11, 2025
4b51a5d
also remove source_pump if not applied
rettigl Feb 27, 2025
037dfb3
don't add field if not found in epics archiver
rettigl Mar 3, 2025
e0ec72b
Merge remote-tracking branch 'origin/main' into mpes_elab_metadata
rettigl Mar 24, 2025
eb67d39
replace for loop with numpy indexing
rettigl Mar 25, 2025
85cddde
update pyntools and definitions
rettigl Mar 24, 2025
a60da54
limit bokeh and first fixes to FLASH config
rettigl Mar 24, 2025
cb9c06c
fix Flash Nexus config
rettigl Mar 25, 2025
4bec385
Merge branch 'mpes_elab_metadata' into fix_mpes_metadata_and_copy_tool
rettigl Mar 25, 2025
027c684
Merge pull request #569 from OpenCOMPES/fix_mpes_metadata_and_copy_tool
rettigl Mar 26, 2025
38c4f31
update pyntools
rettigl Mar 26, 2025
bb5f7f9
add compatibility to old pre-2020 datasets
rettigl Apr 3, 2025
55da2c1
Merge pull request #551 from OpenCOMPES/mpes_elab_metadata
rettigl Apr 4, 2025
c62d1a1
Merge pull request #568 from OpenCOMPES/mpes_speedup_timed_df
rettigl Apr 4, 2025
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
10 changes: 9 additions & 1 deletion .cspell/custom-dictionary.txt
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,17 @@ dtype
dtypes
easimon
ecalibdict
electronanalyser
elab
elabapi
elabid
electronanalyzer
Elektronen
endstation
energycal
energycalfolder
ENERGYDISPERSION
ENOSPC
entityid
equiscale
Eref
errorbar
Expand Down Expand Up @@ -266,6 +270,7 @@ ontop
OPCPA
openmp
OPTICALDELAY
orcid
otherax
packetcoders
Pandoc
Expand Down Expand Up @@ -340,6 +345,7 @@ sdir
segs
setp
sfile
sharelink
shutil
Sixten
sohail
Expand Down Expand Up @@ -373,6 +379,7 @@ toctree
tofseg
tqdm
traceseg
trarpes
trseg
Tsec
txtsize
Expand All @@ -385,6 +392,7 @@ ufunc
unbinned
uncategorised
undoc
userid
utime
varnames
venv
Expand Down
4 changes: 4 additions & 0 deletions docs/sed/loader.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ MpesLoader
:members:
:undoc-members:

.. automodule:: sed.loader.mpes.metadata
:members:
:undoc-members:

FlashLoader
###################################################
.. automodule:: sed.loader.flash.loader
Expand Down
11 changes: 6 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ classifiers = [
"Operating System :: OS Independent",
]
dependencies = [
"bokeh>=2.4.2",
"bokeh>=2.4.2,<3.7.0",
"dask>=2021.12.0,<2024.8",
"elabapi-python>=5.0",
"fastdtw>=0.3.4",
"h5py>=3.6.0",
"ipympl>=0.9.1",
Expand All @@ -43,8 +44,8 @@ dependencies = [
"pandas>=1.4.1",
"photutils<2.0",
"psutil>=5.9.0",
"pynxtools-mpes>=0.2.0",
"pynxtools>=0.9.0",
"pynxtools-mpes>=0.2.2",
"pynxtools>=0.10.1",
"pyyaml>=6.0.0",
"scipy>=1.8.0",
"symmetrize>=0.5.5",
Expand Down Expand Up @@ -95,8 +96,8 @@ all = [

[tool.coverage.report]
omit = [
"config.py",
"config-3.py",
"./config.py",
"./config-3.py",
]

[tool.ruff]
Expand Down
4 changes: 2 additions & 2 deletions src/sed/calibrator/momentum.py
Original file line number Diff line number Diff line change
Expand Up @@ -2004,9 +2004,9 @@ def gather_calibration_metadata(self, calibration: dict = None) -> dict:
metadata["calibration"] = calibration
# create empty calibrated axis entries, if they are not present.
if "kx_axis" not in metadata["calibration"]:
metadata["calibration"]["kx_axis"] = 0
metadata["calibration"]["kx_axis"] = 0.0
if "ky_axis" not in metadata["calibration"]:
metadata["calibration"]["ky_axis"] = 0
metadata["calibration"]["ky_axis"] = 0.0

return metadata

Expand Down
29 changes: 13 additions & 16 deletions src/sed/config/NXmpes_config-HEXTOF.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
"/ENTRY[entry]/experiment_institution": "Deutsches Elektronen-Synchrotron DESY",
"/ENTRY[entry]/experiment_facility": "Free-Electron Laser FLASH",
"/ENTRY[entry]/experiment_laboratory": "@attrs:metadata/creationLocation",
"/ENTRY/entry_identifier": {
"identifier":"@attrs:metadata/pid"
},
"/ENTRY/identifierNAME[entry_identifier]": "@attrs:metadata/pid",
"/ENTRY[entry]/USER[user0]": {
"name": "!@attrs:metadata/principalInvestigator",
"role": "Principal investigator",
Expand Down Expand Up @@ -48,7 +46,7 @@
"value/@units": "@attrs:metadata/scientificMetadata/sample/sample_pressure/unit"
}
},
"/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]": {
"/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYZER[electronanalyzer]": {
"description": "HEXTOF Momentum Microscope",
"device_information": {
"vendor": "None",
Expand Down Expand Up @@ -78,7 +76,7 @@
"type": "estimated"
}
},
"/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/COLLECTIONCOLUMN[collectioncolumn]": {
"/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYZER[electronanalyzer]/COLLECTIONCOLUMN[collectioncolumn]": {
"projection": "@attrs:metadata/scientificMetadata/Collection/projection",
"scheme": "momentum dispersive",
"lens_mode": "@attrs:metadata/scientificMetadata/Collection/lens_mode",
Expand Down Expand Up @@ -107,19 +105,18 @@
}
}
},
"/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/ENERGYDISPERSION[energydispersion]": {
"/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYZER[electronanalyzer]/ENERGYDISPERSION[energydispersion]": {
"pass_energy": "@attrs:metadata/scientificMetadata/Collection/tof_voltage",
"pass_energy/@units": "V",
"scheme": "tof",
"tof_distance": 0.8,
"tof_distance/@units": "m"
},
"/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYSER[electronanalyser]/DETECTOR[detector]": {
"/ENTRY[entry]/INSTRUMENT[instrument]/ELECTRONANALYZER[electronanalyzer]/ELECTRON_DETECTOR[detector]": {
"amplifier_type": "MCP",
"detector_type": "DLD",
"sensor_pixels": [2024, 2048]
"detector_type": "DLD"
},
"/ENTRY[entry]/INSTRUMENT[instrument]/sourceTYPE[source_probe]": {
"/ENTRY[entry]/INSTRUMENT[instrument]/source_probe": {
"name": "@attrs:metadata/scientificMetadata/Source/name",
"probe": "@attrs:metadata/scientificMetadata/Source/probe",
"type": "@attrs:metadata/scientificMetadata/Source/type",
Expand All @@ -128,7 +125,7 @@
"frequency/@units": "@attrs:metadata/scientificMetadata/Source/repetition_rate/unit",
"associated_beam": "/entry/instrument/beam_probe"
},
"/ENTRY[entry]/INSTRUMENT[instrument]/beamTYPE[beam_probe]": {
"/ENTRY[entry]/INSTRUMENT[instrument]/beam_probe": {
"distance": 0.0,
"distance/@units": "mm",
"incident_energy": "@attrs:metadata/scientificMetadata/Source/photon_energy/value",
Expand All @@ -146,16 +143,16 @@
"energy_dispersion": "@attrs:metadata/scientificMetadata/Source/dispersion/value",
"energy_dispersion/@units": "@attrs:metadata/scientificMetadata/Source/dispersion/unit"
},
"/ENTRY[entry]/INSTRUMENT[instrument]/sourceTYPE[source_pump]": {
"/ENTRY[entry]/INSTRUMENT[instrument]/source_pump": {
"name": "PIGLET @ FLASH @ DESY",
"probe": "visible light",
"type": "Optical Laser",
"mode": "Single Bunch",
"frequency": 1000,
"frequency": 1000.0,
"frequency/@units": "kHz",
"associated_beam": "/entry/instrument/beam_pump"
},
"/ENTRY[entry]/INSTRUMENT[instrument]/beamTYPE[beam_pump]": {
"/ENTRY[entry]/INSTRUMENT[instrument]/beam_pump": {
"distance": 0.0,
"distance/@units": "mm",
"incident_wavelength": "@attrs:metadata/scientificMetadata/Laser/wavelength/value",
Expand Down Expand Up @@ -195,7 +192,7 @@
"gas_pressure_env": {
"pressure_gauge": "@link:/entry/instrument/pressure_gauge"
},
"bias": {
"bias_env": {
"voltmeter": "@link:/entry/instrument/manipulator/sample_bias_voltmeter"
}
},
Expand All @@ -207,6 +204,6 @@
"data/@units": "counts",
"AXISNAME[*]": "@data:*.data",
"AXISNAME[*]/@units": "@data:*.unit",
"energy/@type": "@attrs:metadata/energy_calibration/calibration/energy_scale"
"AXISNAME[energy]/@type": "@attrs:metadata/energy_calibration/calibration/energy_scale"
}
}
Loading