Skip to content

Commit

Permalink
Approach2 for putting NeXus section as reference to the NeXus file.
Browse files Browse the repository at this point in the history
  • Loading branch information
RubelMozumder authored and ka-sarthak committed Nov 25, 2024
1 parent b3682d1 commit f0a8606
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions src/nomad_measurements/xrd/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
from os import name
from typing import (
TYPE_CHECKING,
Any,
Expand Down Expand Up @@ -45,7 +44,6 @@
Measurement,
MeasurementResult,
ReadableIdentifiers,
SectionReference,
)

from nomad.datamodel.metainfo.plot import (
Expand Down Expand Up @@ -718,18 +716,8 @@ def normalize(self, archive: 'EntryArchive', logger: 'BoundLogger'):
if self.name is None:
self.name = 'RSM Scan Result'

class NexusMeasurement(Measurement):
nexus_result = Quantity(
type=ArchiveSection,
description='A reference to a NOMAD archive section.',
a_eln=ELNAnnotation(
component='ReferenceEditQuantity',
label='NeXus reference',
),
)


class XRayDiffraction(NexusMeasurement):
class XRayDiffraction(Measurement):
"""
Generic X-ray diffraction measurement.
"""
Expand Down Expand Up @@ -770,6 +758,15 @@ class XRayDiffraction(NexusMeasurement):
results = Measurement.results.m_copy()
results.section_def = XRDResult

nexus_result = Quantity(
type=ArchiveSection,
description='NeXus section containing results of the XRD scan.',
a_eln=ELNAnnotation(
component='ReferenceEditQuantity',
label='NeXus reference',
),
)

def normalize(self, archive: 'EntryArchive', logger: 'BoundLogger'):
"""
The normalize function of the `XRayDiffraction` section.
Expand Down

0 comments on commit f0a8606

Please sign in to comment.