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

Bugfixes for the nomad oasis september release and consolidation #152

Merged
merged 4 commits into from
Sep 5, 2023
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ cover/

# Django stuff:
*.log
!tests/data/dataconverter/readers/mpes/Ref_nexus_mpes.log
!tests/data/nexus/Ref_nexus_test.log
local_settings.py
db.sqlite3
db.sqlite3-journal
Expand Down
2 changes: 1 addition & 1 deletion examples/ellipsometry/eln_data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Data:
data_software/version: '3.882'
data_type: Psi/Delta
spectrum_type: wavelength
spectrum_unit: Angstroms
spectrum_unit: angstrom
Instrument:
Beam_path:
Detector:
Expand Down
21 changes: 16 additions & 5 deletions pynxtools/dataconverter/readers/ellips/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ def write_scan_axis(name: str, values: list, units: str):

header["Instrument/angle_of_incidence"] = unique_angles
for axis in ["detection_angle", "incident_angle"]:
write_scan_axis(axis, unique_angles, "degrees")
write_scan_axis(axis, unique_angles, "degree")

# Create mocked ellipsometry data template:
if is_mock:
Expand Down Expand Up @@ -416,7 +416,15 @@ def read(self,
template = populate_template_dict(header, template)

spectrum_type = header["Data"]["spectrum_type"]
spectrum_unit = header["Data"]["spectrum_unit"]
if header["Data"]["spectrum_unit"] == "Angstroms":
spectrum_unit = "angstrom"
else:
spectrum_unit = header["Data"]["spectrum_unit"]
# MK:: Carola, Ron, Flo, Tamas, Sandor refactor the above-mentioned construct
# there has to be a unit parsing control logic already at the level of this reader
# because test-data.data has improper units like Angstroms or degrees
# the fix above prevents that these incorrect units are get just blindly carried
# over into the nxs file and thus causing nomas to fail
template[f"/ENTRY[entry]/plot/AXISNAME[{spectrum_type}]"] = \
{"link": f"/entry/data_collection/{spectrum_type}_spectrum"}
template[f"/ENTRY[entry]/data_collection/NAME_spectrum[{spectrum_type}_spectrum]/@units"] \
Expand All @@ -432,16 +440,19 @@ def read(self,
"link": "/entry/data_collection/measured_data",
"shape": np.index_exp[index, dindx, :]
}
template[f"/ENTRY[entry]/plot/DATA[{key}]/@units"] = "degrees"
# MK:: Carola, Ron, Flo, Tamas, Sandor refactor the following line
# using a proper unit parsing logic
template[f"/ENTRY[entry]/plot/DATA[{key}]/@units"] = "degree"
if dindx == 0 and index == 0:
template[f"/ENTRY[entry]/plot/DATA[{key}]/@long_name"] = \
f"{plot_name} (degrees)"
f"{plot_name} (degree)"
template[f"/ENTRY[entry]/plot/DATA[{key}_errors]"] = \
{
"link": "/entry/data_collection/data_error",
"shape": np.index_exp[index, dindx, :]
}
template[f"/ENTRY[entry]/plot/DATA[{key}_errors]/@units"] = "degrees"
# MK:: Carola, Ron, Flo, Tamas, Sandor refactor the following line
template[f"/ENTRY[entry]/plot/DATA[{key}_errors]/@units"] = "degree"

# Define default plot showing Psi and Delta at all angles:
template["/@default"] = "entry"
Expand Down
Loading
Loading