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

First multi reader version #10

Merged
merged 13 commits into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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 pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ dependencies = [

[project.entry-points."pynxtools.reader"]
raman = "pynxtools_raman.reader:RamanReader"
raman_multi = "pynxtools_raman_multiformat.reader:RamanReaderMulti"


[project.urls]
"Homepage" = "https://github.com/FAIRmat-NFDI/pynxtools-raman"
Expand Down
5 changes: 5 additions & 0 deletions src/pynxtools_raman_multiformat/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## Multiformat data reader for Raman spectroscopy data
This is example data for writing a new data reader based on the [`MultiFormatReader`](https://github.com/FAIRmat-NFDI/pynxtools/blob/master/src/pynxtools/dataconverter/readers/multi/reader.py) from scratch. A how-to guide to implement this reader is available [here](https://fairmat-nfdi.github.io/pynxtools/how-tos/use-multi-format-reader.html)

## This file types are currently supported:
- Witec Alpha Raman microscope - via ELN file (.yaml)
63 changes: 63 additions & 0 deletions src/pynxtools_raman_multiformat/config_file.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{
"/ENTRY[entry]/INSTRUMENT[instrument]/scattering_configuration": "@eln",
lukaspie marked this conversation as resolved.
Show resolved Hide resolved
"/ENTRY[entry]/INSTRUMENT[instrument]/beam_incident/wavelength": "@eln",
"/ENTRY[entry]/INSTRUMENT[instrument]/beam_incident/wavelength/@units": "@eln",
"/ENTRY[entry]/INSTRUMENT[instrument]/beam_incident/parameter_reliability": "@eln",
"/ENTRY[entry]/INSTRUMENT[instrument]/beam_incident/average_power": "@eln",
"/ENTRY[entry]/INSTRUMENT[instrument]/beam_incident/average_power/@units": "@eln",
"/ENTRY[entry]/INSTRUMENT[instrument]/beam_incident/associated_source": "@eln",
"/ENTRY[entry]/INSTRUMENT[instrument]/detector_TYPE[detector_ccd]/detector_channel_type": "@eln",
"/ENTRY[entry]/INSTRUMENT[instrument]/detector_TYPE[detector_ccd]/count_time/@units": "@eln",
"/ENTRY[entry]/INSTRUMENT[instrument]/detector_TYPE[detector_ccd]/count_time": "@eln",
"/ENTRY[entry]/INSTRUMENT[instrument]/detector_TYPE[detector_ccd]/number_of_cycles": "@eln",
"/ENTRY[entry]/INSTRUMENT[instrument]/detector_TYPE[detector_ccd]/number_of_cycles/@units": "@eln",
"/ENTRY[entry]/INSTRUMENT[instrument]/detector_TYPE[detector_ccd]/detector_type": "@eln",
"/ENTRY[entry]/INSTRUMENT[instrument]/detector_TYPE[detector_ccd]/FABRICATION[device_information]/model": "@eln",
"/ENTRY[entry]/INSTRUMENT[instrument]/detector_TYPE[detector_ccd]/FABRICATION[device_information]/serial_number": "@eln",
"/ENTRY[entry]/INSTRUMENT[instrument]/detector_TYPE[detector_ccd]/detector_number": "@eln",
"/ENTRY[entry]/INSTRUMENT[instrument]/detector_TYPE[detector_ccd]/gain_setting": "@eln",
"/ENTRY[entry]/INSTRUMENT[instrument]/SOURCE[source_532nmlaser]/type": "@eln",
"/ENTRY[entry]/INSTRUMENT[instrument]/SOURCE[source_532nmlaser]/power": "@eln",
"/ENTRY[entry]/INSTRUMENT[instrument]/SOURCE[source_532nmlaser]/power/@units": "@eln",
"/ENTRY[entry]/INSTRUMENT[instrument]/FABRICATION[device_information]/vendor": "@eln",
"/ENTRY[entry]/INSTRUMENT[instrument]/FABRICATION[device_information]/model": "@eln",
"/ENTRY[entry]/INSTRUMENT[instrument]/LENS_OPT[objective_lens]/type": "@eln",
"/ENTRY[entry]/INSTRUMENT[instrument]/LENS_OPT[objective_lens]/FABRICATION[device_information]/vendor": "@eln",
"/ENTRY[entry]/INSTRUMENT[instrument]/LENS_OPT[objective_lens]/FABRICATION[device_information]/model": "@eln",
"/ENTRY[entry]/INSTRUMENT[instrument]/LENS_OPT[objective_lens]/magnification": "@eln",
"/ENTRY[entry]/INSTRUMENT[instrument]/LENS_OPT[objective_lens]/numerical_aperture": "@eln",
"/ENTRY[entry]/INSTRUMENT[instrument]/MONOCHROMATOR[monochromator]/device_information/model": "@eln",
"/ENTRY[entry]/INSTRUMENT[instrument]/MONOCHROMATOR[monochromator]/grating/period": "@eln",
"/ENTRY[entry]/INSTRUMENT[instrument]/MONOCHROMATOR[monochromator]/grating/period/@units": "@eln",
"/ENTRY[entry]/INSTRUMENT[instrument]/MONOCHROMATOR[monochromator]/wavelength": "@eln",
"/ENTRY[entry]/INSTRUMENT[instrument]/MONOCHROMATOR[monochromator]/wavelength/@units": "@eln",
"/ENTRY[entry]/INSTRUMENT[instrument]/SENSOR[temperature_sensor]/attached_to": "@eln",
"/ENTRY[entry]/INSTRUMENT[instrument]/SENSOR[temperature_sensor]/measurement": "@eln",
"/ENTRY[entry]/INSTRUMENT[instrument]/SENSOR[temperature_sensor]/value": "@eln",
"/ENTRY[entry]/INSTRUMENT[instrument]/SENSOR[temperature_sensor]/value/@units": "@eln",
"/ENTRY[entry]/SAMPLE[sample]/name": "@eln",
"/ENTRY[entry]/SAMPLE[sample]/atom_types": "@eln",
"/ENTRY[entry]/USER[user]/address": "@eln",
"/ENTRY[entry]/USER[user]/affiliation": "@eln",
"/ENTRY[entry]/USER[user]/email": "@eln",
"/ENTRY[entry]/USER[user]/name": "@eln",
"/ENTRY[entry]/experiment_description": "@eln",
"/ENTRY[entry]/experiment_type": "@eln",
"/ENTRY[entry]/raman_experiment_type": "@eln",
"/ENTRY[entry]/title": "@eln",
"/ENTRY[entry]/start_time": "@eln",
"/ENTRY[entry]/definition": "@eln",
"/ENTRY[entry]/@default": "data",
"/ENTRY[entry]/DATA[data]/@signal": "y_values",
"/ENTRY[entry]/DATA[data]/y_values": "@data:y_values",
"/ENTRY[entry]/DATA[data]/x_values": "@data:x_values",
"/ENTRY[entry]/DATA[data]/y_values/@unit": "@attrs:/ENTRY[entry]/data/unit_y",
lukaspie marked this conversation as resolved.
Show resolved Hide resolved
"/ENTRY[entry]/DATA[data]/x_values/@unit": "@attrs:/ENTRY[entry]/data/unit_x",
"/ENTRY[entry]/DATA[data]/y_values/@long_name": "@attrs:/ENTRY[entry]/data/longname_y",
lukaspie marked this conversation as resolved.
Show resolved Hide resolved
"/ENTRY[entry]/DATA[data]/x_values/@long_name": "@attrs:/ENTRY[entry]/data/longname_x",
"/ENTRY[entry]/DATA[data]/@axes":"x_values_raman",
"/ENTRY[entry]/DATA[data]/x_values_raman/@long_name": "@attrs:/ENTRY[entry]/data/longname_x_raman",
"/ENTRY[entry]/DATA[data]/x_values_raman": "@data:x_values_raman",
"/ENTRY[entry]/DATA[data]/x_values_raman/@unit": "1/cm"
}

122 changes: 122 additions & 0 deletions src/pynxtools_raman_multiformat/eln_data.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
# Original meta_data_1.txt file below
#Spectrum--000
#
#General:
# System ID: 100-1100-292
# Start Time: 2:04:54 PM
# Start Date: Friday, June 21, 2024
# Duration: 0h 0m 21s
# User Name: Witec
# Sample Name:
# Configuration: Raman CCD1
#
# UHTS300M:
# Excitation Wavelength [nm]: 532.100
# Grating: G1: 600 g/mm BLZ=500nm
# Center Wavelength [nm]: 596.989
# Spectral Center [rel. 1/cm]: 2042.739
#
# DU970_BV:
# Serial Number: 6358
# Readout Mode: FVB (1-200)
# Output Amplifier: Conventional
# Vertical Shift Speed [µs]: 9.75
# Horizontal Shift Speed [MHz]: 0.050
# Preamplifier Gain: 1.00
# Cycle Time [sec]: 1.00002
# Sensor Temperature [°C]: -56
#
# Number Of Accumulations: 20
# Integration Time [s]: 1.00000
#
# Objective:
# Objective Name: Nikon 20x 20x / 0.4
# Objective Magnification: 20.0
#
# Sample Location (global position):
# Position X [µm]: 0.000
# Position Y [µm]: 0.000
# Position Z [µm]: 0.000

data:
unit_x: nm
unit_y: counts
longname_x: Wavelength
longname_y: Raman Intensity
instrument:
scattering_configuration: z(xx)-z
beam_incident:
wavelength:
value: 532.1
unit: nm
average_power:
value: 60
unit: mW
parameter_reliability: nominal
associated_source: entry/instrument/source_532nmlaser
detector_ccd:
detector_channel_type: multichannel
count_time:
value: 1.0
unit: s
number_of_cycles:
value: 20
unit: counts
detector_type: CCD
device_information:
model: DU970_BV
serial_number: "6358"
detector_number:
- 1600
- 200
gain_setting: 1.0
temperature_sensor:
attached_to: CCD
measurement: temperature
value:
value: -56
unit: celsius
source_532nmlaser:
source_type: laser #DPSS
power:
value: 80
unit: mW
device_information:
vendor: Witec
model: Alpha Raman
objective_lens:
type: objective
device_information:
vendor: Nikon
model: "Nikon 20x"
magnification: 20
numerical_aperture: 0.4
monochromator:
device_information:
model: UHTS300M
grating:
period:
value: 600
unit: counts / mm
wavelength:
value: 596.989 ##Spectral Center [rel. 1/cm]: 2042.739
unit: nm
sample:
name: Silicon Wafer
atom_types: Si
user:
address: Lennestr. 5, 04318 Leipzig
affiliation: Universität Leipzig
email: [email protected]
name: Hildebrandt, Ron
experiment_description: Raman spectrum of commercial silicon wafer
experiment_type: Raman spectroscopy
raman_experiment_type: non-resonant Raman spectroscopy
title: Si-Wafer
start_time: '2024-06-21T14:04:54+02:00'
definition: NXraman
measurement_file_meta_data:
delimiter: ","
skip_lines: 17


Loading
Loading