Skip to content

Commit

Permalink
added LR
Browse files Browse the repository at this point in the history
  • Loading branch information
aalbino2 committed Nov 7, 2024
1 parent 40e4a2c commit 369ca52
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 76 deletions.
90 changes: 30 additions & 60 deletions src/pdi_nomad_plugin/characterization/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,71 +194,20 @@ class PyrometerTemperature(TimeSeries):
)


class LaserReflectanceCurrent(TimeSeries):
class LaserReflectanceIntensity(TimeSeries):
"""
The current measured during the pyrometry experiment.
"""

m_def = Section(
a_plot=[
{
'label': 'measured current',
'x': 'time',
'y': ['value'],
},
],
a_eln={
'hide': [
'set_value',
'set_time',
]
},
)
m_def = Section(a_h5web=H5WebAnnotation(axes='time', signal='value'))
value = Quantity(
type=float,
unit='ampere',
shape=['*'],
type=HDF5Dataset,
shape=[],
)
time = Quantity(
type=Datetime,
type=HDF5Dataset,
description='The process time when each of the values were recorded.',
shape=['*'],
)


class CurrentVsTime(ArchiveSection):
"""
The current vs time data.
"""

m_def = Section()

wavelength = Quantity(
type=float,
unit='meter',
description="""
Wavelength of the light used for the pyrometry measurement.
""",
a_eln=ELNAnnotation(
component=ELNComponentEnum.NumberEditQuantity,
defaultDisplayUnit='nanometer',
),
)

incidence_angle = Quantity(
type=float,
unit='degree',
description="""
The angle of incidence of the light used for the pyrometry measurement.
""",
a_eln=ELNAnnotation(
component=ELNComponentEnum.NumberEditQuantity,
defaultDisplayUnit='degree',
),
)

current = SubSection(
section_def=LaserReflectanceCurrent,
shape=[],
)


Expand Down Expand Up @@ -322,7 +271,28 @@ class LaserReflectance(Measurement, EntryData):
type=str,
a_eln={'component': 'StringEditQuantity'},
)
current_curves = SubSection(
section_def=CurrentVsTime,
repeats=True,
wavelength = Quantity(
type=float,
unit='meter',
description="""
Wavelength of the light used for the pyrometry measurement.
""",
a_eln=ELNAnnotation(
component=ELNComponentEnum.NumberEditQuantity,
defaultDisplayUnit='nanometer',
),
)
incidence_angle = Quantity(
type=float,
unit='degree',
description="""
The angle of incidence of the light used for the pyrometry measurement.
""",
a_eln=ELNAnnotation(
component=ELNComponentEnum.NumberEditQuantity,
defaultDisplayUnit='degree',
),
)
laser_reflectance_intensity = SubSection(
section_def=LaserReflectanceIntensity,
)
2 changes: 1 addition & 1 deletion src/pdi_nomad_plugin/mbe/epic_parser/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def load(self):
mainfile_mime_re='application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
mainfile_contents_dict={
'MBE sources': {'__has_all_keys': ['source_type', 'EPIC_loop']},
'__has_symbol': '#',
'__has_comment': '#',
},
# 'MBE gas mixing': {'__has_all_keys': ['mfc1_EPIC_name']},
)
Expand Down
67 changes: 54 additions & 13 deletions src/pdi_nomad_plugin/mbe/epic_parser/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
from pdi_nomad_plugin.characterization.schema import (
PyrometerTemperature,
Pyrometry,
LaserReflectance,
LaserReflectanceIntensity,
)
from pdi_nomad_plugin.mbe.instrument import (
ColdLipEffusionCell,
Expand Down Expand Up @@ -154,6 +156,14 @@ def parse(
)
pyrometry_sheet.columns = pyrometry_sheet.columns.str.strip()

# "laser reflectance settings" sheet
lr_sheet = pd.read_excel(
xlsx,
'LR settings',
comment='#',
)
lr_sheet.columns = lr_sheet.columns.str.strip()

# reading Messages.txt
growth_starttime = None
growth_id = None
Expand Down Expand Up @@ -216,39 +226,66 @@ def parse(
child_archives['instrument'].data.name = f'{data_file} instrument'
child_archives['instrument'].data.port_list = []

# read raw files
epiclog_value, epiclog_time = epiclog_parse_timeseries(
timezone,
growth_starttime,
folder_path,
pyrometry_sheet,
'temperature',
'temperature_unit',
)
# instantiate objects
child_archives['process'].data = GrowthMbePDI()
child_archives['process'].data.steps = [GrowthStepMbePDI()]
child_archives['process'].data.steps[0].sources = []

child_archives['process'].data.name = f'{exp_string} process'

# in situ characterization
child_archives['process'].data.steps[
0
].in_situ_characterization = InSituCharacterizationMbePDI()
# # pyrometry
child_archives['process'].data.steps[0].in_situ_characterization.pyrometry = [
Pyrometry()
]
child_archives['process'].data.steps[0].in_situ_characterization.pyrometry[
0
].pyrometer_temperature = PyrometerTemperature()

# fill in quantities
child_archives['process'].data.name = f'{exp_string} process'
pyro_archive = (
child_archives['process']
.data.steps[0]
.in_situ_characterization.pyrometry[0]
)
pyro_archive.name = f'{exp_string} pyrometry'
# # # read pyrometry raw files
epiclog_value, epiclog_time = epiclog_parse_timeseries(
timezone,
growth_starttime,
folder_path,
pyrometry_sheet,
'temperature',
'temperature_unit',
)
pyro_archive.pyrometer_temperature.value = epiclog_value
pyro_archive.pyrometer_temperature.time = epiclog_time
# # laser reflectance
child_archives['process'].data.steps[
0
].in_situ_characterization.laser_reflectance = [LaserReflectance()]
child_archives['process'].data.steps[
0
].in_situ_characterization.laser_reflectance[
0
].laser_reflectance_intensity = LaserReflectanceIntensity()
lr_archive = (
child_archives['process']
.data.steps[0]
.in_situ_characterization.laser_reflectance[0]
)
lr_archive.name = f'{exp_string} laser reflectance'
# # # read laser reflectance raw files
epiclog_value, epiclog_time = epiclog_parse_timeseries(
timezone,
growth_starttime,
folder_path,
lr_sheet,
'intensity',
)
lr_archive.laser_reflectance_intensity.value = epiclog_value
lr_archive.laser_reflectance_intensity.time = epiclog_time

# filling in the sources objects list
for sources_index, sources_row in sources_sheet.iterrows():
Expand Down Expand Up @@ -445,7 +482,11 @@ def parse(
float(t0_param), ureg('°C')
)
source_object.impinging_flux[0].a_parameter = float(a_param)
source_object.impinging_flux[0].value = impinging_flux
source_object.impinging_flux[
0
].value = (
impinging_flux # TODO this value is in nm -> convert to m
)
source_object.impinging_flux[
0
].time = epiclog_time # TODO insert hdf5 link
Expand Down
4 changes: 2 additions & 2 deletions src/pdi_nomad_plugin/mbe/instrument.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ class ImpingingFluxPDI(ImpingingFlux):
bep_to_flux = Quantity(
type=float,
description='The conversion factor from Beam Equivalent Pressure (BEP) to the flux.',
unit='mol **-1 * meter ** -2 * second * pascal ** -1',
unit='meter ** -2 * second * pascal ** -1',
)
t_0_parameter = Quantity(
type=float,
Expand All @@ -347,7 +347,7 @@ class ImpingingFluxPDI(ImpingingFlux):
)
value = Quantity(
type=HDF5Dataset,
unit='mol/meter ** 2/second',
unit='1/meter ** 2/second',
shape=[],
)
time = Quantity(
Expand Down
3 changes: 3 additions & 0 deletions src/pdi_nomad_plugin/mbe/processes.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,12 +420,15 @@ class InSituCharacterizationMbePDI(ArchiveSection):
)
laser_reflectance = SubSection(
section_def=LaserReflectanceReference,
repeats=True,
)
mass_spectrometry = SubSection(
section_def=MassSpectrometryReference,
repeats=True,
)
rheed = SubSection(
section_def=RHEEDReference,
repeats=True,
)


Expand Down
Binary file modified tests/data/mbe/2023_06_12/MBE8_config.xlsx
Binary file not shown.

0 comments on commit 369ca52

Please sign in to comment.