diff --git a/src/nomad_unisyscat/apps/__init__.py b/src/nomad_unisyscat/apps/__init__.py index 957ec23..ffe2bd6 100644 --- a/src/nomad_unisyscat/apps/__init__.py +++ b/src/nomad_unisyscat/apps/__init__.py @@ -209,7 +209,99 @@ 'x': 6, }, }, - } + }, + { + 'type': 'histogram', + 'showinput': 'true', + 'autorange': 'true', + 'nbins': 30, + 'scale': 'linear', + 'quantity': 'entry_create_time', + 'layout': { + 'xxl': { + 'minH': 3, + 'minW': 3, + 'h': 6, + 'w': 12, + 'y': 5, + 'x': 0, + }, + 'xl': { + 'minH': 3, + 'minW': 3, + 'h': 5, + 'w': 12, + 'y': 5, + 'x': 0, + }, + 'lg': {'minH': 3, 'minW': 3, 'h': 5, 'w': 12, 'y': 5, 'x': 0}, + 'md': { + 'minH': 3, + 'minW': 3, + 'h': 5, + 'w': 12, + 'y': 8, + 'x': 0, + }, + 'sm': { + 'minH': 3, + 'minW': 3, + 'h': 5, + 'w': 12, + 'y': 8, + 'x': 0, + }, + }, + }, + # { + # 'type': 'scatterplot', + # 'autorange': 'true', + # 'size': 1000, + # 'scale': 'linear', + # 'y': + # 'quantity': 'data.results[0].frequency' + # '#nomad_unisyscat.schema_packages.mypackage.EPR', + # 'x': + # 'quantity': 'data.results[0].signal' + # '#nomad_unisyscat.schema_packages.mypackage.EPR', + # 'layout': { + # 'xxl': { + # 'minH': 3, + # 'minW': 3, + # 'h': 6, + # 'w': 12, + # 'y': 5, + # 'x': 12, + # }, + # 'xl': { + # 'minH': 3, + # 'minW': 3, + # 'h': 5, + # 'w': 12, + # 'y': 5, + # 'x': 12, + # }, + # 'lg': { + # 'minH': 3, 'minW': 3, + # 'h': 5, 'w': 12, 'y': 5, 'x': 12}, + # 'md': { + # 'minH': 3, + # 'minW': 3, + # 'h': 6, + # 'w': 12, + # 'y': 10, + # 'x': 0, + # }, + # 'sm': { + # 'minH': 3, + # 'minW': 3, + # 'h': 6, + # 'w': 12, + # 'y': 13, + # 'x': 0, + # }, + # }, + # } ], } ), diff --git a/src/nomad_unisyscat/schema_packages/mypackage.py b/src/nomad_unisyscat/schema_packages/mypackage.py index ce7d66c..63054e2 100644 --- a/src/nomad_unisyscat/schema_packages/mypackage.py +++ b/src/nomad_unisyscat/schema_packages/mypackage.py @@ -283,7 +283,7 @@ def normalize(self, archive, logger) -> None: # noqa: PLR0915 if self.dsc_file.endswith('_EPR_exp_raw.DSC'): sample_name = self.dsc_file.split('_EPR')[0] - # self.method = 'experimental EPR spectroscopy' + self.method = 'experimental EPR spectroscopy' if self.samples is None or self.samples == []: sample = CompositeSystemReference() sample.name = sample_name @@ -363,7 +363,7 @@ class NRVSpectroscopy(Measurement, PlotSection, Schema): description=""" name of the method """, - default='NRVSpectroscopy', + default='Nuclear resonance vibrational spectroscopy (NRVS)', a_eln=ELNAnnotation( component='StringEditQuantity', props=dict( @@ -394,22 +394,16 @@ def normalize(self, archive, logger): col_names = ['wavenumber, cm-1', '57Fe PVDOS'] data = pd.read_csv(f.name, header=None, names=col_names) - result = NRVSResult() - result.wavenumber = data['wavenumber, cm-1'] - result.intensity = data['57Fe PVDOS'] - results = [] - results.append(result) - self.results = results - self.figures = [] - - fig = px.line(x=data['wavenumber, cm-1'], y=data['57Fe PVDOS']) - fig.update_xaxes(title_text=col_names[0]) - fig.update_yaxes(title_text=col_names[1]) - self.figures.append(PlotlyFigure(label='NRVS', figure=fig.to_plotly_json())) + result = NRVSResult() + result.wavenumber = data['wavenumber, cm-1'] + result.intensity = data['57Fe PVDOS'] + results = [] + results.append(result) + self.results = results - if self.measurement_data_file.endswith('_NRVS_exp.dat'): file_name = str(self.measurement_data_file) + sample_name = file_name.split('_NRVS') if self.samples is None or self.samples == []: sample = CompositeSystemReference() @@ -423,19 +417,30 @@ def normalize(self, archive, logger): samples = [] samples.append(sample) self.samples = samples - self.method = 'experimental nuclear resonance vibrational spectroscopy' - if self.instruments is None or self.instruments == []: - instrument = InstrumentReference() - instrument.name = 'NRVS setup' - instrument.lab_id = 'NRVS-setup' - from nomad.datamodel.context import ClientContext - if isinstance(archive.m_context, ClientContext): - pass - else: - instrument.normalize(archive, logger) - instruments = [] - instruments.append(instrument) - self.instruments = instruments + + if self.measurement_data_file.endswith('_NRVS_exp.dat'): + self.method = 'experimental nuclear resonance vibrational spectroscopy' + if self.instruments is None or self.instruments == []: + instrument = InstrumentReference() + instrument.name = 'NRVS setup' + instrument.lab_id = 'NRVS-setup' + from nomad.datamodel.context import ClientContext + if isinstance(archive.m_context, ClientContext): + pass + else: + instrument.normalize(archive, logger) + instruments = [] + instruments.append(instrument) + self.instruments = instruments + elif self.measurement_data_file.endswith('_NRVS_sim.dat'): + self.method = 'simulated nuclear resonance vibrational spectroscopy' + + self.figures = [] + + fig = px.line(x=data['wavenumber, cm-1'], y=data['57Fe PVDOS']) + fig.update_xaxes(title_text=col_names[0]) + fig.update_yaxes(title_text=col_names[1]) + self.figures.append(PlotlyFigure(label='NRVS', figure=fig.to_plotly_json())) class IRResult(MeasurementResult): @@ -482,9 +487,9 @@ class IRSpectroscopy(Measurement, PlotSection, Schema): description=""" name of the method """, + default='Infra-red (IR)', a_eln=ELNAnnotation( component='StringEditQuantity', - default='infra red vibrational spectroscopy', props=dict( suggestions=[ 'experimental IR vibrational spectroscopy', @@ -523,7 +528,7 @@ def normalize(self, archive, logger): if self.data_file.endswith('_IR_exp.dat'): sample_name = self.data_file.split('_IR')[0] - self.method = 'experimental IR vibrational spectroscopy' + self.method = 'experimental infra-red spectroscopy' if self.samples is None or self.samples == []: sample = CompositeSystemReference() sample.name = sample_name