Skip to content

Commit

Permalink
remove NXcalibration from base classes
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaspie committed Dec 19, 2024
1 parent 27f099d commit 98049c3
Show file tree
Hide file tree
Showing 2 changed files with 111 additions and 206 deletions.
206 changes: 0 additions & 206 deletions base_classes/NXcalibration.nxdl.xml

This file was deleted.

111 changes: 111 additions & 0 deletions contributed_definitions/NXcalibration.nxdl.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="nxdlformat.xsl"?>
<!--
# NeXus - Neutron and X-ray Common Data Format
#
# Copyright (C) 2014-2024 NeXus International Advisory Committee (NIAC)
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 3 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# For further information, see http://www.nexusformat.org
-->
<definition xmlns="http://definition.nexusformat.org/nxdl/3.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" category="base" name="NXcalibration" extends="NXobject" type="group" xsi:schemaLocation="http://definition.nexusformat.org/nxdl/3.1 ../nxdl.xsd">
<symbols>
<doc>
The symbols used in the schema to specify e.g. dimensions of arrays
</doc>
<symbol name="ncoeff">
<doc>
Number of coefficients of the calibration function
</doc>
</symbol>
<symbol name="nfeat">
<doc>
Number of features used to fit the calibration function
</doc>
</symbol>
<symbol name="ncal">
<doc>
Number of points of the calibrated and uncalibrated axes
</doc>
</symbol>
</symbols>
<doc>
Subclass of NXprocess to describe post-processing calibrations.
</doc>
<field name="last_process" type="NX_CHAR">
<doc>
Indicates the name of the last operation applied in the NXprocess sequence.
</doc>
</field>
<field name="applied" type="NX_BOOLEAN">
<doc>
Has the calibration been applied?
</doc>
</field>
<field name="coefficients" type="NX_FLOAT" units="NX_ANY">
<doc>
For non-linear energy calibrations, e.g. in a TOF, a polynomial function is fit
to a set of features (peaks) at well defined energy positions to determine
E(TOF). Here we can store the array of fit coefficients.
</doc>
<dimensions rank="1">
<dim index="1" value="ncoeff"/>
</dimensions>
</field>
<field name="fit_function" type="NX_CHAR">
<doc>
For non-linear energy calibrations. Here we can store the formula of the
fit function.

Use a0, a1, ..., an for the coefficients, corresponding to the values in the coefficients field.

Use x0, x1, ..., xn for the variables.

The formula should be numpy compliant.
</doc>
</field>
<field name="scaling" type="NX_FLOAT" units="NX_ANY">
<doc>
For linear calibration. Scaling parameter.
</doc>
</field>
<field name="offset" type="NX_FLOAT" units="NX_ANY">
<doc>
For linear calibration. Offset parameter.
</doc>
</field>
<field name="calibrated_axis" type="NX_FLOAT" units="NX_ANY">
<doc>
A vector representing the axis after calibration, matching the data length
</doc>
<dimensions rank="1">
<dim index="1" value="ncal"/>
</dimensions>
</field>
<field name="original_axis" type="NX_FLOAT" units="NX_ANY">
<doc>
Vector containing the data coordinates in the original uncalibrated axis
</doc>
<dimensions rank="1">
<dim index="1" value="ncal"/>
</dimensions>
</field>
<field name="description" type="NX_CHAR">
<doc>
A description of the procedures employed.
</doc>
</field>
</definition>

0 comments on commit 98049c3

Please sign in to comment.