Commit 6ef0bede authored by Markus Scheidgen's avatar Markus Scheidgen
Browse files

WIP: integrate xps, eels v0.10.3

parent 13ff696f
Subproject commit 49417ec2a747eb4467f69e7f41e24d7d5fae66dc
Subproject commit 70de5df39103fce7a6b555fe5e1ff7d3bb28fcfd
Subproject commit 31da759ea71b6bd962bf3678bc0ddd7e61cce043
Subproject commit 3f52d75a63bb24f8b0254a305f6422791dfaa7a1
......@@ -602,7 +602,6 @@ class EntryMetadata(metainfo.MSection):
class EntryArchive(metainfo.MSection):
section_run = metainfo.SubSection(sub_section=Run, repeats=True)
# section_experiment = metainfo.SubSection(sub_section=Experiment)
section_measurement = metainfo.SubSection(sub_section=Measurement, repeats=True)
section_quantum_cms = metainfo.SubSection(sub_section=QuantumCMS)
section_workflow = metainfo.SubSection(sub_section=Workflow, categories=[FastAccess])
......@@ -612,6 +611,7 @@ class EntryArchive(metainfo.MSection):
type=Any, shape=['0..*'],
description='The processing logs for this entry as a list of structlog entries.')
# preemptively create the elasticsearch document definition, which populates metrics and
# search quantities in the search_extension
EntryMetadata.m_def.a_elastic.document
......@@ -87,13 +87,13 @@ class EMSMetadata(MSection):
# self.sample_constituents = _unavailable(root_section.section_sample.sample_constituents)
self.experiment_summary = root_section.section_metadata.section_experiment.notes
# location = root_section.experiment_location
# if location is not None:
# location_str = ', '.join([
# getattr(location, prop)
# for prop in ['facility', 'institution', 'address']
# if getattr(location, prop) is not None])
# self.experiment_location = location_str
location = root_section.section_metadata.section_experiment.experiment_location
if location is not None:
location_str = ', '.join([
getattr(location, prop)
for prop in ['facility', 'institution', 'address']
if getattr(location, prop) is not None])
self.experiment_location = location_str
if root_section.section_metadata.section_experiment.experiment_start_time:
self.origin_time = root_section.section_metadata.section_experiment.experiment_start_time
......
......@@ -30,6 +30,10 @@ class UserProvided(MCategory):
pass
class SectionWithNotes(MSection):
notes = Quantity(type=str, categories=[UserProvided])
class DeviceSettings(MSection):
device_name = Quantity(type=str)
analysis_method = Quantity(type=str)
......@@ -49,19 +53,69 @@ class DeviceSettings(MSection):
beam_current = Quantity(type=str)
detector_type = Quantity(type=str)
dark_current = Quantity(type=str)
notes = Quantity(type=str, categories=[UserProvided])
class Sample(MSection):
spectrum_region = Quantity(type=str, shape=[])
sample_id = Quantity(type=str)
formula = Quantity(type=str)
elements = Quantity(type=str, shape=['*'])
sample_title = Quantity(type=str)
notes = Quantity(type=str, categories=[UserProvided])
class SampleMaterial(MSection):
''' This section describes a sample's material. '''
chemical_formula = Quantity(
type=str, description='The chemical formula that describes the sample.')
chemical_name = Quantity(
type=str, description='The chemical name that describes the sample.')
atom_labels = Quantity(
type=str, shape=['number_of_elements'],
description='Atom labels for distinct elements in the sample.')
number_of_elements = Quantity(
type=int, derived=lambda m: len(m.atom_labels) if m.atom_labels else 0,
description='Number of distinct chemical elements in the sample.')
space_group = Quantity(
type=int, description='Space group of the sample compound (if crystalline).')
class Experiment(MSection):
class Sample(SectionWithNotes):
sample_id = Quantity(
type=str, description='Identification number or signatures of the sample used.')
sample_title = Quantity(type=str)
formula = Quantity(type=str)
elements = Quantity(type=str, shape=['*'])
spectrum_region = Quantity(type=str, shape=[])
sample_description = Quantity(
type=str, description='Description of the sample used in the experiment.')
sample_state = Quantity(
type=str, description='The physical state of the sample.')
sample_temperature = Quantity(
type=np.dtype(np.float64), unit='kelvin',
description='The temperature of the sample during the experiment.')
sample_microstructure = Quantity(
type=str, description='The sample microstructure.')
sample_constituents = Quantity(
type=str, description='The constituents.')
section_material = SubSection(sub_section=SampleMaterial)
class ExperimentLocation(MSection):
address = Quantity(
type=str, description='''
The address where the experiment took place, format 'Country, City, Street'
''')
institution = Quantity(
type=str, description='''
Name of the institution hosting the experimental facility (e.g. in full or an
acronym).
''')
facility = Quantity(
type=str, description='''
Name of the experimental facility (e.g. in full or an acronym).
''')
class Experiment(SectionWithNotes):
method_name = Quantity(type=str)
method_abbreviation = Quantity(type=str)
experiment_id = Quantity(type=str)
......@@ -73,15 +127,15 @@ class Experiment(MSection):
type=Datetime, description='The datetime of the experiment end.')
edges = Quantity(type=str, shape=['*'])
description = Quantity(type=str)
notes = Quantity(type=str, categories=[UserProvided])
class Instrument(MSection):
experiment_location = SubSection(sub_section=ExperimentLocation)
class Instrument(SectionWithNotes):
n_scans = Quantity(type=str)
dwell_time = Quantity(type=str)
excitation_energy = Quantity(type=str)
source_label = Quantity(type=str)
notes = Quantity(type=str, categories=[UserProvided])
section_device_settings = SubSection(sub_section=DeviceSettings, repeats=True)
......@@ -91,18 +145,17 @@ class Author(MSection):
author_profile_url = Quantity(type=str)
author_profile_api_url = Quantity(type=str)
group_name = Quantity(type=str)
notes = Quantity(type=str, categories=[UserProvided])
class DataHeader(MSection):
channel_id = Quantity(type=int)
label = Quantity(type=str)
unit = Quantity(type=str)
notes = Quantity(type=str, categories=[UserProvided])
class Origin(MSection):
section_author = SubSection(sub_section=Author, repeats=True)
'''
A section that describes a potential foreign origin of an entry. An example would
be data found on zenodo.org or a specialized database like eelsdb.org.
'''
# TODO This is not experiment specific and should be added to the general NOMAD
# entry metadata.
authors = SubSection(sub_section=Author, repeats=True)
permalink = Quantity(type=str)
api_permalink = Quantity(type=str)
repository_name = Quantity(
......@@ -116,19 +169,12 @@ class Origin(MSection):
entry_repository_url = Quantity(
type=str, description='An URL to the entry on the repository, where the data is stored.')
notes = Quantity(type=str, categories=[UserProvided])
class Spectrum(MSection):
n_values = Quantity(type=int)
excitation_energy_expected = Quantity(type=np.dtype(np.float64), shape=['n_values'], unit='J', description='The expected excitation energy range of the spectrum')
excitation_energy_actual = Quantity(type=np.dtype(np.float64), shape=['n_values'], unit='J', description='The actual excitation energy range of the spectrum')
count = Quantity(type=np.dtype(np.float64), shape=['n_values'], description='The count at each energy value, dimensionless')
ring_current = Quantity(type=np.dtype(np.float64), shape=['n_values'], unit='A', description='Ring current')
total_electron_yield = Quantity(type=np.dtype(np.float64), shape=['n_values'], unit='V', description='Total electron yield')
mirror_current = Quantity(type=np.dtype(np.float64), shape=['n_values'], unit='V', description='Mirror current')
energy = Quantity(type=np.dtype(np.float64), shape=['n_values'], unit='J', description='The energy range of the (EELS) spectrum')
notes = Quantity(type=str, categories=[UserProvided])
class DataHeader(MSection):
channel_id = Quantity(type=str)
label = Quantity(type=str)
unit = Quantity(type=str)
class Metadata(MSection):
......@@ -137,160 +183,28 @@ class Metadata(MSection):
section_instrument = SubSection(sub_section=Instrument)
section_data_header = SubSection(sub_section=DataHeader)
section_origin = SubSection(sub_section=Origin)
notes = Quantity(type=str, categories=[UserProvided])
class Spectrum(MSection):
n_values = Quantity(type=int)
excitation_energy_expected = Quantity(type=np.dtype(np.float64), shape=['n_values'], unit='J', description='The expected excitation energy range of the spectrum')
excitation_energy_actual = Quantity(type=np.dtype(np.float64), shape=['n_values'], unit='J', description='The actual excitation energy range of the spectrum')
count = Quantity(type=np.dtype(np.float64), shape=['n_values'], description='The count at each energy value, dimensionless')
ring_current = Quantity(type=np.dtype(np.float64), shape=['n_values'], unit='A', description='Ring current')
total_electron_yield = Quantity(type=np.dtype(np.float64), shape=['n_values'], unit='V', description='Total electron yield')
mirror_current = Quantity(type=np.dtype(np.float64), shape=['n_values'], unit='V', description='Mirror current')
energy = Quantity(type=np.dtype(np.float64), shape=['n_values'], unit='J', description='The energy range of the spectrum')
count_rate = Quantity(type=np.dtype(np.float64), shape=['n_values'], unit='1/s')
kinetic_energy = Quantity(type=np.dtype(np.float64), shape=['n_values'], unit='J')
class Data(MSection):
section_spectrum = SubSection(sub_section=Spectrum)
notes = Quantity(type=str, categories=[UserProvided])
class Measurement(MSection):
class Measurement(SectionWithNotes):
section_metadata = SubSection(sub_section=Metadata)
section_data = SubSection(sub_section=Data)
description = Quantity(type=str, categories=[UserProvided])
# class Experiment(MSection):
# '''
# The root section for all (meta)data that belongs to a single experiment.
# '''
# m_def = Section(validate=False)
# experiment_summary = Quantity(
# type=str, description='A descriptive summary of the content of the experiment.')
# experiment_location = SubSection(sub_section=SectionProxy('Location'))
# experiment_publish_time = Quantity(
# type=Datetime, description='The datetime when this experiment was published.')
# experiment_time = Quantity(
# type=Datetime, description='The datetime of the beginning of the experiment.')
# experiment_end_time = Quantity(
# type=Datetime, description='The datetime of the experiment end.')
# raw_metadata = Quantity(
# type=JSON, description='The whole or partial metadata in its original source JSON format.')
# section_data = SubSection(sub_section=SectionProxy('Data'))
# section_method = SubSection(sub_section=SectionProxy('Method'))
# section_sample = SubSection(sub_section=SectionProxy('Sample'))
# class Location(MSection):
# m_def = Section(validate=False)
# address = Quantity(
# type=str, description='''
# The address where the experiment took place, format 'Country, City, Street'
# ''')
# institution = Quantity(
# type=str, description='''
# Name of the institution hosting the experimental facility (e.g. in full or an
# acronym).
# ''')
# facility = Quantity(
# type=str, description='''
# Name of the experimental facility (e.g. in full or an acronym).
# ''')
# class Data(MSection):
# '''
# This section contains information about the stored data.
# '''
# m_def = Section(validate=False)
# repository_name = Quantity(
# type=str, description='The name of the repository, where the data is stored.')
# repository_url = Quantity(
# type=str, description='An URL to the repository, where the data is stored.')
# preview_url = Quantity(
# type=str, description='An URL to an image file that contains a preview.')
# entry_repository_url = Quantity(
# type=str, description='An URL to the entry on the repository, where the data is stored.')
# class Method(MSection):
# '''
# This section contains information about the applied experimental method.
# '''
# m_def = Section(validate=False)
# data_type = Quantity(
# type=str, description='Name of the type of data that the experiment produced.')
# method_name = Quantity(
# type=str, description='Full name of the experimental method in use')
# method_abbreviation = Quantity(
# type=str,
# description='Abbreviated name (i.e. acronym) of the experimental method')
# probing_method = Quantity(
# type=str, description='The probing method used')
# instrument_description = Quantity(
# type=str, description='A description of the instrumentation used for the experiment.')
# class Sample(MSection):
# '''
# The section for all sample related (meta)data that was used in the experiment.
# '''
# m_def = Section(validate=False)
# sample_description = Quantity(
# type=str, description='Description of the sample used in the experiment.')
# sample_id = Quantity(
# type=str, description='Identification number or signatures of the sample used.')
# sample_state = Quantity(
# type=str, description='The physical state of the sample.')
# sample_temperature = Quantity(
# type=np.dtype(np.float64), unit='kelvin',
# description='The temperature of the sample during the experiment.')
# sample_microstructure = Quantity(
# type=str, description='The sample microstructure.')
# sample_constituents = Quantity(
# type=str, description='The constituents.')
# section_material = SubSection(sub_section=SectionProxy('Material'))
# class Material(MSection):
# ''' This section describes a sample's material. '''
# m_def = Section(validate=False)
# chemical_formula = Quantity(
# type=str, description='The chemical formula that describes the sample.')
# chemical_name = Quantity(
# type=str, description='The chemical name that describes the sample.')
# atom_labels = Quantity(
# type=str, shape=['number_of_elements'],
# description='Atom labels for distinct elements in the sample.')
# number_of_elements = Quantity(
# type=int, derived=lambda m: len(m.atom_labels) if m.atom_labels else 0,
# description='Number of distinct chemical elements in the sample.')
# space_group = Quantity(
# type=int, description='Space group of the sample compound (if crystalline).')
m_package.__init_metainfo__()
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment