diff --git a/contributed_definitions/NXfit.nxdl.xml b/contributed_definitions/NXfit.nxdl.xml
new file mode 100644
index 0000000000..b0d77f2cec
--- /dev/null
+++ b/contributed_definitions/NXfit.nxdl.xml
@@ -0,0 +1,199 @@
+
+
+
+
+
+
+ The symbols used in the schema to specify e.g. dimensions of arrays.
+
+
+
+ Rank of the dependent and independent data arrays (for
+ multidimensional/multivariate fit.)
+
+
+
+
+ Description of a fit procedure.
+
+
+
+ Human-readable label for this fit procedure.
+
+
+
+
+ Input data and results of the fit.
+
+
+
+ Position values along one or more data dimensions (to hold the
+ values for the independent variable for this fit procedure).
+
+
+
+ The ``input_dependent`` field must have the same rank (``dimRank``)
+ as the ``input_independent`` field. Each individual dimension of ``input_dependent``
+ must have the same number of points as the corresponding dimension in
+ the ``input_independent`` field.
+
+
+
+
+
+ Independent input axis for this fit procedure.
+
+
+
+ The ``input_independent`` field must have the same rank (``dimRank``)
+ as the ``input_dependent`` field. Each individual dimension of ``input_independent``
+ must have the same number of points as the corresponding dimension in
+ the ``input_dependent`` field.
+
+
+
+
+
+ Resulting envelope of applying the `global_fit_function` with its parameter to the data stored
+ in `input_independent`.
+
+
+
+ The ``envelope`` field must have the same rank (``dimRank``)
+ as the ``input_independent`` field. Each individual dimension of ``envelope``
+ must have the same number of points as the corresponding dimension in
+ the ``input_independent`` field.
+
+
+
+
+
+ Difference between the envelope and the `input_independent` data to be fitted.
+
+
+
+ The ``residual`` field must have the same rank (``dimRank``)
+ as the ``input_independent`` field. Each individual dimension of ``residual``
+ must have the same number of points as the corresponding dimension in
+ the ``input_independent`` field.
+
+
+
+
+
+
+ One peak of the peak model.
+ If there is no characteristic name for each peak component, is envisioned that peaks
+ are labeled as peak_0, peak_1, and so on.
+
+
+
+ Total area under the curve (can also be used for the total area minus any
+ background values).
+
+
+
+
+ Relative sensitivity for this peak, to be used for quantification in
+ an NXprocess.
+
+ As an example, in X-ray spectroscopy could depend on the energy scale
+ (see position), the ionization cross section, and the element probed.
+
+
+
+
+ Relative area of this peak compared to other peaks.
+
+ The relative area can simply be derived by dividing the total_area by the
+ total area of all peaks or by a more complicated method (e.g., by
+ additionally dividing by the relative sensitivity factors). Details shall
+ be given in `global_fit_function`.
+
+
+
+
+
+ One fitted background (functional form, position, and intensities) of the peak fit.
+ If there is no characteristic name for each peak component, it is envisioned that backgrounds are labeled
+ as background_0, background_1, and so on.
+
+
+
+
+ Function used to describe the overall fit to the data, taking into account the parameters of the
+ individual `NXpeak` and `NXfit_background` components.
+
+
+
+ Oftentimes, if the peaks and fit backgrounds are defined independently (i.e, with their own
+ parameter sets), the resulting global fit is a function of the form
+ :math:`model = peak_1(p_1) + peak2(p_2) + backgr(p_3).`, where each :math:`p_x` describes the
+ set of parameters for one peak/background.
+
+
+
+
+
+ Function used to optimize the parameters during peak fitting.
+
+
+
+ Description of the method used to optimize the parameters during peak fitting.
+ Examples:
+ - least squares
+ - non-linear least squares
+ - Levenberg-Marquardt algorithm (damped least-squares)
+ - linear regression
+ - Bayesian linear regression
+
+
+
+
+ For the optimization, the formula is any optimization process on the `global_fit_function` given above.
+ As an example, for a linear least squared algorithm on independent components, the formula of the error_function
+ would be :math:`LLS(peak_1(p_1) + peak2(p_2) + backgr(p_3))`, where each :math:`p_x` describes the set
+ of parameters for one peak/background.
+
+ It is however also possible to supply more involved formulas (e.g., in the case of constrained fits).
+
+
+
+
+
+ Figure-of-merit to determine the goodness of fit, i.e., how well the peak model
+ fits the measured observations.
+
+ This value (which is a single number) is oftenused to guide adjustments to the
+ fitting parameters in the peak fitting process.
+
+
+
+ Metric used to determine the goodness of fit. Examples include:
+ - :math:`\chi^2`, the squared sum of the sigma-weighted residuals
+ - reduced :math:`\chi^2`:, :math:`\chi^2`: per degree of freedom
+ - :math:`R^2`, the coefficient of determination
+
+
+
+
diff --git a/contributed_definitions/NXfit_background.nxdl.xml b/contributed_definitions/NXfit_background.nxdl.xml
new file mode 100644
index 0000000000..5b45fa81e4
--- /dev/null
+++ b/contributed_definitions/NXfit_background.nxdl.xml
@@ -0,0 +1,80 @@
+
+
+
+
+
+
+ The symbols used in the schema to specify e.g. dimensions of arrays.
+
+
+
+ Rank of the dependent and independent data arrays (for
+ multidimensional/multivariate fit.)
+
+
+
+
+ Description of the background for an NXfit model.
+
+
+
+ Human-readable label which specifies which concept/entity
+ the background represents/identifies.
+
+
+
+
+
+ Position values along one or more data dimensions (to hold the
+ values for the independent variable).
+
+
+
+ The ``position`` field must have the same rank (``dimRank``)
+ as the ``intensity`` field. Each individual dimension of ``position``
+ must have the same number of points as the corresponding dimension in
+ the ``intensity`` field.
+
+
+
+
+
+ This array holds the intensity/count values of the fitted background
+ at each position.
+
+
+
+ The ``intensity`` field must have the same rank (``dimRank``)
+ as the ``intensity`` field. Each individual dimension of ``position``
+ must have the same number of points as the corresponding dimension in
+ the ``position`` field.
+
+
+
+
+
+
+ The functional form of the background.
+
+
+
diff --git a/contributed_definitions/NXfit_function.nxdl.xml b/contributed_definitions/NXfit_function.nxdl.xml
new file mode 100644
index 0000000000..d24de7bd97
--- /dev/null
+++ b/contributed_definitions/NXfit_function.nxdl.xml
@@ -0,0 +1,47 @@
+
+
+
+
+
+ This describes a fit function that is used to fit data to any functional form.
+
+ A fit function is used to describe a set of data :math:`y_k, k = 1 ... M`, which are collected as a function
+ of one or more independent variables :math:`x` at the points :math:`x_k`. The fit function :math:`f` describes
+ these data in an approximative way as :math:`y_k \approx f(a_0, . . . a_n, x_k)`,
+ where :math:`a_i, i = 0 . . . n` are the *fit parameters* (which are stored the instances of ``NXfit_parameter``).
+
+
+
+ Human-readable description of this fit function.
+
+
+
+
+ Mathematical formula of the function, taking into account the instances of ``NXfit_parameter``.
+
+ This should be a python parsable function. Here we should provide which keywords are available
+ and a BNF of valid grammar.
+
+
+
+
diff --git a/contributed_definitions/NXfit_parameter.nxdl.xml b/contributed_definitions/NXfit_parameter.nxdl.xml
new file mode 100644
index 0000000000..f8762232f5
--- /dev/null
+++ b/contributed_definitions/NXfit_parameter.nxdl.xml
@@ -0,0 +1,56 @@
+
+
+
+
+
+ A parameter for a fit function.
+ This would typically be a variable that
+ is optimized in a fit.
+
+
+
+ The name of the parameter.
+
+
+
+
+ A description of what this parameter represents.
+
+
+
+
+ The value of the parameter. After fitting, this would store the
+ optimized value.
+
+
+
+
+ The minimal value of the parameter, to be used as a constraint during fitting.
+
+
+
+
+ The maximal value of the parameter, to be used as a constraint during fitting.
+
+
+
diff --git a/contributed_definitions/NXpeak.nxdl.xml b/contributed_definitions/NXpeak.nxdl.xml
index 0eea9cbe3f..86809edda6 100644
--- a/contributed_definitions/NXpeak.nxdl.xml
+++ b/contributed_definitions/NXpeak.nxdl.xml
@@ -26,14 +26,16 @@
The symbols used in the schema to specify e.g. dimensions of arrays.
-
+
- Number of support points
+ Rank of the dependent and independent data arrays (for
+ multidimensional/multivariate fit.)
- Base class for spectral peaks, their functional form, and support (values).
+ Base class for describing a peak, its functional form, and support values
+ (i.e., the discretization (points) at which the function has been evaluated).
@@ -41,48 +43,44 @@
the peak represents/identifies.
-
-
- Is the peak described analytically via a functional form
- or is it empirically defined via measured/reported
- intensity/counts as a function of an independent variable.
-
- If the functional form is not empirical or Gaussians, users
- should enter other for the peak_model and add relevant details
- in the NXcollection.
-
-
-
-
-
-
-
-
-
-
+
+
+
+ Position values along one or more data dimensions (to hold the
+ values for the independent variable).
+
+
+
+ The ``position`` field must have the same rank (``dimRank``)
+ as the ``intensity`` field. Each individual dimension of ``position``
+ must have the same number of points as the corresponding dimension in
+ the ``intensity`` field.
+
+
+
+
+
+ This array holds the intensity/count values of the fitted peak at each position.
+
+
+
+ The ``intensity`` field must have the same rank (``dimRank``)
+ as the ``intensity`` field. Each individual dimension of ``position``
+ must have the same number of points as the corresponding dimension in
+ the ``position`` field.
+
+
+
+
+
- In the case of an empirical description of the peak and its shoulders,
- this array holds the position values for the independent variable.
+ The functional form of the peak. This could be a Gaussian, Lorentzian,
+ Voigt, etc.
-
-
-
-
-
+
+
- In the case of an empirical description of the peak and its shoulders,
- this array holds the intensity/count values at each position.
+ Total area under the curve.
-
-
-
-
-
- In the case of an analytical description (or if peak_model is other) this
- collection holds parameter of (and eventually) the functional form.
- For example in the case of Gaussians mu, sigma, cut-off values,
- and background intensity are relevant parameter.
-
-
diff --git a/contributed_definitions/NXxps.nxdl.xml b/contributed_definitions/NXxps.nxdl.xml
index de4e591852..89a4065fce 100644
--- a/contributed_definitions/NXxps.nxdl.xml
+++ b/contributed_definitions/NXxps.nxdl.xml
@@ -348,5 +348,163 @@
+
+
+ Peak model for XPS fitting. Each `NXfit` instance shall be used for the description of
+ _one_ peak fit in _one_ XPS region. As an example, this could be used to describe the
+ fitting of one measured C 1s spectrum.
+
+ This concept is related to term `3.29`_ of the ISO 18115-1:2023 standard.
+
+ .. _3.29: https://www.iso.org/obp/ui/en/#iso:std:iso:18115:-1:ed-3:v1:en:term:3.29
+
+
+
+
+ Input data and results of the fit.
+
+
+
+ Dependent variable for this fit procedure.
+
+ This could be a link to entry/data/data.
+
+
+
+
+ Independent variable for this fit procedure.
+
+ This could be a link to entry/data/energy.
+
+
+
+
+
+
+
+
+
+
+ This could be a link to entry/data/energy.
+
+
+
+
+ Intensity values of the fitted function at each energy in the position field.
+
+ This concept is related to term `3.15`_ of the ISO 18115-1:2023 standard.
+
+ .. _3.15: https://www.iso.org/obp/ui/en/#iso:std:iso:18115:-1:ed-3:v1:en:term:3.15
+
+
+
+
+
+
+
+
+ Area of the peak.
+
+
+
+
+ Width of a peak at a defined fraction of the peak height.
+
+ Usually, this will be the Full Width at Half Maximum of the peak (FWHM).
+ For asymmetric peaks, convenient measures of peak width are the half-widths of
+ each side of the peak at half maximum intensity.
+
+ This concept is related to term `3.28`_ of the ISO 18115-1:2023 standard.
+
+ .. _3.28: https://www.iso.org/obp/ui/en/#iso:std:iso:18115:-1:ed-3:v1:en:term:3.28
+
+
+
+
+
+ Position of the peak on the energy axis.
+
+
+
+
+
+
+ Total area under the peak after background removal.
+
+ This concept is related to term `3.16`_ of the ISO 18115-1:2023 standard.
+
+ .. _3.16: https://www.iso.org/obp/ui/en/#iso:std:iso:18115:-1:ed-3:v1:en:term:3.16
+
+
+
+
+
+ Functional form of the fitted XPS background.
+
+ This concept is related to term `3.21`_ of the ISO 18115-1:2023 standard.
+
+ .. _3.21: https://www.iso.org/obp/ui/en/#iso:std:iso:18115:-1:ed-3:v1:en:term:3.21
+
+
+
+
+
+
+
+
+
+ -
+
+ Linear background, i.e., a simple straight line from the minimal to
+ the maximal abscissa value.
+
+
+ -
+
+ Shirley background. In the Shirley background, the background intensity at any
+ given binding energy is proportional to the intensity of the total peak area
+ above the background in the lower binding energy peak range (i.e., the
+ background goes up in proportion to the total number of photoelectrons below its
+ binding energy position).
+
+
+ -
+
+ Tougaard background (or Tougaard universal cross-section approach) which is a
+ methodology for integrating the intensity of the background at a given binding
+ energy from the spectral intensities to higher kinetic energies
+
+
+ -
+
+ In case none of the enumeration items apply, description should be _other_
+ and the functional form of the background should be given by the `formula`
+ field.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Atomic concentration of each species defined by one peak in the peak model.
+ This should be an array with the indices pointing to the individual peaks
+ (i.e, peak_0, peak_1, etc.)
+
+
+
diff --git a/contributed_definitions/nyaml/NXfit.yaml b/contributed_definitions/nyaml/NXfit.yaml
new file mode 100644
index 0000000000..cae8de1e8e
--- /dev/null
+++ b/contributed_definitions/nyaml/NXfit.yaml
@@ -0,0 +1,345 @@
+category: base
+doc: |
+ Description of a fit procedure.
+symbols:
+ doc: |
+ The symbols used in the schema to specify e.g. dimensions of arrays.
+ dimRank: |
+ Rank of the dependent and independent data arrays (for
+ multidimensional/multivariate fit.)
+type: group
+NXfit(NXprocess):
+ label:
+ doc: |
+ Human-readable label for this fit procedure.
+ data(NXdata):
+ doc: |
+ Input data and results of the fit.
+ input_dependent(NX_NUMBER):
+ unit: NX_ANY
+ doc: |
+ Position values along one or more data dimensions (to hold the
+ values for the independent variable for this fit procedure).
+ dimensions:
+ rank: dimRank
+ doc: |
+ The ``input_dependent`` field must have the same rank (``dimRank``)
+ as the ``input_independent`` field. Each individual dimension of ``input_dependent``
+ must have the same number of points as the corresponding dimension in
+ the ``input_independent`` field.
+ dim: []
+ input_independent(NX_NUMBER):
+ unit: NX_ANY
+ doc: |
+ Independent input axis for this fit procedure.
+ dimensions:
+ rank: dimRank
+ doc: |
+ The ``input_independent`` field must have the same rank (``dimRank``)
+ as the ``input_dependent`` field. Each individual dimension of ``input_independent``
+ must have the same number of points as the corresponding dimension in
+ the ``input_dependent`` field.
+ dim: []
+ envelope(NX_NUMBER):
+ unit: NX_ANY
+ doc: |
+ Resulting envelope of applying the `global_fit_function` with its parameter to the data stored
+ in `input_independent`.
+ dimensions:
+ rank: dimRank
+ doc: |
+ The ``envelope`` field must have the same rank (``dimRank``)
+ as the ``input_independent`` field. Each individual dimension of ``envelope``
+ must have the same number of points as the corresponding dimension in
+ the ``input_independent`` field.
+ dim: []
+ residual(NX_NUMBER):
+ unit: NX_ANY
+ doc: |
+ Difference between the envelope and the `input_independent` data to be fitted.
+ dimensions:
+ rank: dimRank
+ doc: |
+ The ``residual`` field must have the same rank (``dimRank``)
+ as the ``input_independent`` field. Each individual dimension of ``residual``
+ must have the same number of points as the corresponding dimension in
+ the ``input_independent`` field.
+ dim: []
+ peakPEAK(NXpeak):
+ doc: |
+ One peak of the peak model.
+ If there is no characteristic name for each peak component, is envisioned that peaks
+ are labeled as peak_0, peak_1, and so on.
+ total_area(NX_NUMBER):
+ unit: NX_ANY
+ doc: |
+ Total area under the curve (can also be used for the total area minus any
+ background values).
+ relative_sensitivity_factor(NX_NUMBER):
+ unit: NX_UNITLESS
+ doc: |
+ Relative sensitivity for this peak, to be used for quantification in
+ an NXprocess.
+
+ As an example, in X-ray spectroscopy could depend on the energy scale
+ (see position), the ionization cross section, and the element probed.
+ relative_area(NX_NUMBER):
+ unit: NX_ANY
+ doc: |
+ Relative area of this peak compared to other peaks.
+
+ The relative area can simply be derived by dividing the total_area by the
+ total area of all peaks or by a more complicated method (e.g., by
+ additionally dividing by the relative sensitivity factors). Details shall
+ be given in `global_fit_function`.
+ backgroundBACKGROUND(NXfit_background):
+ doc: |
+ One fitted background (functional form, position, and intensities) of the peak fit.
+ If there is no characteristic name for each peak component, it is envisioned that backgrounds are labeled
+ as background_0, background_1, and so on.
+ global_fit_function(NXfit_function):
+ doc: |
+ Function used to describe the overall fit to the data, taking into account the parameters of the
+ individual `NXpeak` and `NXfit_background` components.
+ formula:
+ doc: |
+ Oftentimes, if the peaks and fit backgrounds are defined independently (i.e, with their own
+ parameter sets), the resulting global fit is a function of the form
+ :math:`model = peak_1(p_1) + peak2(p_2) + backgr(p_3).`, where each :math:`p_x` describes the
+ set of parameters for one peak/background.
+ error_function(NXfit_function):
+ doc: |
+ Function used to optimize the parameters during peak fitting.
+ description:
+ doc: |
+ Description of the method used to optimize the parameters during peak fitting.
+ Examples:
+ - least squares
+ - non-linear least squares
+ - Levenberg-Marquardt algorithm (damped least-squares)
+ - linear regression
+ - Bayesian linear regression
+ formula:
+ doc: |
+ For the optimization, the formula is any optimization process on the `global_fit_function` given above.
+ As an example, for a linear least squared algorithm on independent components, the formula of the error_function
+ would be :math:`LLS(peak_1(p_1) + peak2(p_2) + backgr(p_3))`, where each :math:`p_x` describes the set
+ of parameters for one peak/background.
+
+ It is however also possible to supply more involved formulas (e.g., in the case of constrained fits).
+ figure_of_meritMETRIC(NX_NUMBER):
+ unit: NX_UNITLESS
+ doc: |
+ Figure-of-merit to determine the goodness of fit, i.e., how well the peak model
+ fits the measured observations.
+
+ This value (which is a single number) is oftenused to guide adjustments to the
+ fitting parameters in the peak fitting process.
+ \@metric:
+ doc: |
+ Metric used to determine the goodness of fit. Examples include:
+ - :math:`\chi^2`, the squared sum of the sigma-weighted residuals
+ - reduced :math:`\chi^2`:, :math:`\chi^2`: per degree of freedom
+ - :math:`R^2`, the coefficient of determination
+
+# ++++++++++++++++++++++++++++++++++ SHA HASH ++++++++++++++++++++++++++++++++++
+# fcf92e26824bac53c43854728f890e890bbbbb7f6f10e102a632304056ac91fd
+#
+#
+#
+#
+#
+#
+# The symbols used in the schema to specify e.g. dimensions of arrays.
+#
+#
+#
+# Rank of the dependent and independent data arrays (for
+# multidimensional/multivariate fit.)
+#
+#
+#
+#
+# Description of a fit procedure.
+#
+#
+#
+# Human-readable label for this fit procedure.
+#
+#
+#
+#
+# Input data and results of the fit.
+#
+#
+#
+# Position values along one or more data dimensions (to hold the
+# values for the independent variable for this fit procedure).
+#
+#
+#
+# The ``input_dependent`` field must have the same rank (``dimRank``)
+# as the ``input_independent`` field. Each individual dimension of ``input_dependent``
+# must have the same number of points as the corresponding dimension in
+# the ``input_independent`` field.
+#
+#
+#
+#
+#
+# Independent input axis for this fit procedure.
+#
+#
+#
+# The ``input_independent`` field must have the same rank (``dimRank``)
+# as the ``input_dependent`` field. Each individual dimension of ``input_independent``
+# must have the same number of points as the corresponding dimension in
+# the ``input_dependent`` field.
+#
+#
+#
+#
+#
+# Resulting envelope of applying the `global_fit_function` with its parameter to the data stored
+# in `input_independent`.
+#
+#
+#
+# The ``envelope`` field must have the same rank (``dimRank``)
+# as the ``input_independent`` field. Each individual dimension of ``envelope``
+# must have the same number of points as the corresponding dimension in
+# the ``input_independent`` field.
+#
+#
+#
+#
+#
+# Difference between the envelope and the `input_independent` data to be fitted.
+#
+#
+#
+# The ``residual`` field must have the same rank (``dimRank``)
+# as the ``input_independent`` field. Each individual dimension of ``residual``
+# must have the same number of points as the corresponding dimension in
+# the ``input_independent`` field.
+#
+#
+#
+#
+#
+#
+# One peak of the peak model.
+# If there is no characteristic name for each peak component, is envisioned that peaks
+# are labeled as peak_0, peak_1, and so on.
+#
+#
+#
+# Total area under the curve (can also be used for the total area minus any
+# background values).
+#
+#
+#
+#
+# Relative sensitivity for this peak, to be used for quantification in
+# an NXprocess.
+#
+# As an example, in X-ray spectroscopy could depend on the energy scale
+# (see position), the ionization cross section, and the element probed.
+#
+#
+#
+#
+# Relative area of this peak compared to other peaks.
+#
+# The relative area can simply be derived by dividing the total_area by the
+# total area of all peaks or by a more complicated method (e.g., by
+# additionally dividing by the relative sensitivity factors). Details shall
+# be given in `global_fit_function`.
+#
+#
+#
+#
+#
+# One fitted background (functional form, position, and intensities) of the peak fit.
+# If there is no characteristic name for each peak component, it is envisioned that backgrounds are labeled
+# as background_0, background_1, and so on.
+#
+#
+#
+#
+# Function used to describe the overall fit to the data, taking into account the parameters of the
+# individual `NXpeak` and `NXfit_background` components.
+#
+#
+#
+# Oftentimes, if the peaks and fit backgrounds are defined independently (i.e, with their own
+# parameter sets), the resulting global fit is a function of the form
+# :math:`model = peak_1(p_1) + peak2(p_2) + backgr(p_3).`, where each :math:`p_x` describes the
+# set of parameters for one peak/background.
+#
+#
+#
+#
+#
+# Function used to optimize the parameters during peak fitting.
+#
+#
+#
+# Description of the method used to optimize the parameters during peak fitting.
+# Examples:
+# - least squares
+# - non-linear least squares
+# - Levenberg-Marquardt algorithm (damped least-squares)
+# - linear regression
+# - Bayesian linear regression
+#
+#
+#
+#
+# For the optimization, the formula is any optimization process on the `global_fit_function` given above.
+# As an example, for a linear least squared algorithm on independent components, the formula of the error_function
+# would be :math:`LLS(peak_1(p_1) + peak2(p_2) + backgr(p_3))`, where each :math:`p_x` describes the set
+# of parameters for one peak/background.
+#
+# It is however also possible to supply more involved formulas (e.g., in the case of constrained fits).
+#
+#
+#
+#
+#
+# Figure-of-merit to determine the goodness of fit, i.e., how well the peak model
+# fits the measured observations.
+#
+# This value (which is a single number) is oftenused to guide adjustments to the
+# fitting parameters in the peak fitting process.
+#
+#
+#
+# Metric used to determine the goodness of fit. Examples include:
+# - :math:`\chi^2`, the squared sum of the sigma-weighted residuals
+# - reduced :math:`\chi^2`:, :math:`\chi^2`: per degree of freedom
+# - :math:`R^2`, the coefficient of determination
+#
+#
+#
+#
diff --git a/contributed_definitions/nyaml/NXfit_background.yaml b/contributed_definitions/nyaml/NXfit_background.yaml
new file mode 100644
index 0000000000..f988a8bfc6
--- /dev/null
+++ b/contributed_definitions/nyaml/NXfit_background.yaml
@@ -0,0 +1,128 @@
+category: base
+doc: |
+ Description of the background for an NXfit model.
+symbols:
+ doc: |
+ The symbols used in the schema to specify e.g. dimensions of arrays.
+ dimRank: |
+ Rank of the dependent and independent data arrays (for
+ multidimensional/multivariate fit.)
+type: group
+NXfit_background(NXobject):
+ label(NX_CHAR):
+ doc: |
+ Human-readable label which specifies which concept/entity
+ the background represents/identifies.
+ data(NXdata):
+ position(NX_NUMBER):
+ unit: NX_ANY
+ doc: |
+ Position values along one or more data dimensions (to hold the
+ values for the independent variable).
+ dimensions:
+ rank: dimRank
+ doc: |
+ The ``position`` field must have the same rank (``dimRank``)
+ as the ``intensity`` field. Each individual dimension of ``position``
+ must have the same number of points as the corresponding dimension in
+ the ``intensity`` field.
+ dim: []
+ intensity(NX_NUMBER):
+ unit: NX_ANY
+ doc: |
+ This array holds the intensity/count values of the fitted background
+ at each position.
+ dimensions:
+ rank: dimRank
+ doc: |
+ The ``intensity`` field must have the same rank (``dimRank``)
+ as the ``intensity`` field. Each individual dimension of ``position``
+ must have the same number of points as the corresponding dimension in
+ the ``position`` field.
+ dim: []
+ function(NXfit_function):
+ doc: |
+ The functional form of the background.
+
+# ++++++++++++++++++++++++++++++++++ SHA HASH ++++++++++++++++++++++++++++++++++
+# f2aa053cf2efec41fdae311ac6df33ac71072aeb03ff3d640b641c1e8b1f2be6
+#
+#
+#
+#
+#
+#
+# The symbols used in the schema to specify e.g. dimensions of arrays.
+#
+#
+#
+# Rank of the dependent and independent data arrays (for
+# multidimensional/multivariate fit.)
+#
+#
+#
+#
+# Description of the background for an NXfit model.
+#
+#
+#
+# Human-readable label which specifies which concept/entity
+# the background represents/identifies.
+#
+#
+#
+#
+#
+# Position values along one or more data dimensions (to hold the
+# values for the independent variable).
+#
+#
+#
+# The ``position`` field must have the same rank (``dimRank``)
+# as the ``intensity`` field. Each individual dimension of ``position``
+# must have the same number of points as the corresponding dimension in
+# the ``intensity`` field.
+#
+#
+#
+#
+#
+# This array holds the intensity/count values of the fitted background
+# at each position.
+#
+#
+#
+# The ``intensity`` field must have the same rank (``dimRank``)
+# as the ``intensity`` field. Each individual dimension of ``position``
+# must have the same number of points as the corresponding dimension in
+# the ``position`` field.
+#
+#
+#
+#
+#
+#
+# The functional form of the background.
+#
+#
+#
diff --git a/contributed_definitions/nyaml/NXfit_function.yaml b/contributed_definitions/nyaml/NXfit_function.yaml
new file mode 100644
index 0000000000..49239bbcf7
--- /dev/null
+++ b/contributed_definitions/nyaml/NXfit_function.yaml
@@ -0,0 +1,70 @@
+category: base
+doc: |
+ This describes a fit function that is used to fit data to any functional form.
+
+ A fit function is used to describe a set of data :math:`y_k, k = 1 ... M`, which are collected as a function
+ of one or more independent variables :math:`x` at the points :math:`x_k`. The fit function :math:`f` describes
+ these data in an approximative way as :math:`y_k \approx f(a_0, . . . a_n, x_k)`,
+ where :math:`a_i, i = 0 . . . n` are the *fit parameters* (which are stored the instances of ``NXfit_parameter``).
+type: group
+NXfit_function(NXobject):
+ description:
+ doc: |
+ Human-readable description of this fit function.
+ formula:
+ doc: |
+ Mathematical formula of the function, taking into account the instances of ``NXfit_parameter``.
+
+ This should be a python parsable function. Here we should provide which keywords are available
+ and a BNF of valid grammar.
+ (NXfit_parameter):
+
+# ++++++++++++++++++++++++++++++++++ SHA HASH ++++++++++++++++++++++++++++++++++
+# b51591b808787be4a867f81d41f3052c7ee34d1f259aad4d3488c0df05cfd211
+#
+#
+#
+#
+#
+# This describes a fit function that is used to fit data to any functional form.
+#
+# A fit function is used to describe a set of data :math:`y_k, k = 1 ... M`, which are collected as a function
+# of one or more independent variables :math:`x` at the points :math:`x_k`. The fit function :math:`f` describes
+# these data in an approximative way as :math:`y_k \approx f(a_0, . . . a_n, x_k)`,
+# where :math:`a_i, i = 0 . . . n` are the *fit parameters* (which are stored the instances of ``NXfit_parameter``).
+#
+#
+#
+# Human-readable description of this fit function.
+#
+#
+#
+#
+# Mathematical formula of the function, taking into account the instances of ``NXfit_parameter``.
+#
+# This should be a python parsable function. Here we should provide which keywords are available
+# and a BNF of valid grammar.
+#
+#
+#
+#
diff --git a/contributed_definitions/nyaml/NXfit_parameter.yaml b/contributed_definitions/nyaml/NXfit_parameter.yaml
new file mode 100644
index 0000000000..313e5a3cd0
--- /dev/null
+++ b/contributed_definitions/nyaml/NXfit_parameter.yaml
@@ -0,0 +1,85 @@
+category: base
+doc: |
+ A parameter for a fit function.
+ This would typically be a variable that
+ is optimized in a fit.
+type: group
+NXfit_parameter(NXobject):
+ name(NX_CHAR):
+ doc: |
+ The name of the parameter.
+ description(NX_CHAR):
+ doc: |
+ A description of what this parameter represents.
+ value(NX_NUMBER):
+ unit: NX_ANY
+ doc: |
+ The value of the parameter. After fitting, this would store the
+ optimized value.
+ min_value(NX_NUMBER):
+ unit: NX_ANY
+ doc: |
+ The minimal value of the parameter, to be used as a constraint during fitting.
+ max_value(NX_NUMBER):
+ unit: NX_ANY
+ doc: |
+ The maximal value of the parameter, to be used as a constraint during fitting.
+
+# ++++++++++++++++++++++++++++++++++ SHA HASH ++++++++++++++++++++++++++++++++++
+# 86b45dd6443b276fa8997b0d758a2262339c05b2ef70429d700ec583802a8e9b
+#
+#
+#
+#
+#
+# A parameter for a fit function.
+# This would typically be a variable that
+# is optimized in a fit.
+#
+#
+#
+# The name of the parameter.
+#
+#
+#
+#
+# A description of what this parameter represents.
+#
+#
+#
+#
+# The value of the parameter. After fitting, this would store the
+# optimized value.
+#
+#
+#
+#
+# The minimal value of the parameter, to be used as a constraint during fitting.
+#
+#
+#
+#
+# The maximal value of the parameter, to be used as a constraint during fitting.
+#
+#
+#
diff --git a/contributed_definitions/nyaml/NXpeak.yaml b/contributed_definitions/nyaml/NXpeak.yaml
index 46f05f9200..66e5a9c541 100644
--- a/contributed_definitions/nyaml/NXpeak.yaml
+++ b/contributed_definitions/nyaml/NXpeak.yaml
@@ -1,42 +1,139 @@
category: base
doc: |
- Base class for spectral peaks, their functional form, and support (values).
+ Base class for describing a peak, its functional form, and support values
+ (i.e., the discretization (points) at which the function has been evaluated).
symbols:
doc: |
The symbols used in the schema to specify e.g. dimensions of arrays.
- n_support: |
- Number of support points
+ dimRank: |
+ Rank of the dependent and independent data arrays (for
+ multidimensional/multivariate fit.)
type: group
NXpeak(NXobject):
label(NX_CHAR):
doc: |
Human-readable label which specifies which concept/entity
the peak represents/identifies.
- description(NX_CHAR):
+ data(NXdata):
+ position(NX_NUMBER):
+ unit: NX_ANY
+ doc: |
+ Position values along one or more data dimensions (to hold the
+ values for the independent variable).
+ dimensions:
+ rank: dimRank
+ doc: |
+ The ``position`` field must have the same rank (``dimRank``)
+ as the ``intensity`` field. Each individual dimension of ``position``
+ must have the same number of points as the corresponding dimension in
+ the ``intensity`` field.
+ dim: []
+ intensity(NX_NUMBER):
+ unit: NX_ANY
+ doc: |
+ This array holds the intensity/count values of the fitted peak at each position.
+ dimensions:
+ rank: dimRank
+ doc: |
+ The ``intensity`` field must have the same rank (``dimRank``)
+ as the ``intensity`` field. Each individual dimension of ``position``
+ must have the same number of points as the corresponding dimension in
+ the ``position`` field.
+ dim: []
+ function(NXfit_function):
doc: |
- Is the peak described analytically via a functional form
- or is it empirically defined via measured/reported
- intensity/counts as a function of an independent variable.
-
- If the functional form is not empirical or Gaussians, users
- should enter other for the peak_model and add relevant details
- in the NXcollection.
- enumeration: [empirical, gaussian, lorentzian, voigt, other]
- position(NX_NUMBER):
- doc: |
- In the case of an empirical description of the peak and its shoulders,
- this array holds the position values for the independent variable.
- unit: NX_ANY
- dim: (n_support,)
- intensity(NX_NUMBER):
- doc: |
- In the case of an empirical description of the peak and its shoulders,
- this array holds the intensity/count values at each position.
+ The functional form of the peak. This could be a Gaussian, Lorentzian,
+ Voigt, etc.
+ total_area(NX_NUMBER):
unit: NX_ANY
- dim: (n_support,)
- (NXparameters):
doc: |
- In the case of an analytical description (or if peak_model is other) this
- collection holds parameter of (and eventually) the functional form.
- For example in the case of Gaussians mu, sigma, cut-off values,
- and background intensity are relevant parameter.
+ Total area under the curve.
+
+# ++++++++++++++++++++++++++++++++++ SHA HASH ++++++++++++++++++++++++++++++++++
+# 68e3d1c34fd21241aad36095e5b4bd937b868e7ff36860025bb55a6e78e4d0bb
+#
+#
+#
+#
+#
+#
+# The symbols used in the schema to specify e.g. dimensions of arrays.
+#
+#
+#
+# Rank of the dependent and independent data arrays (for
+# multidimensional/multivariate fit.)
+#
+#
+#
+#
+# Base class for describing a peak, its functional form, and support values
+# (i.e., the discretization (points) at which the function has been evaluated).
+#
+#
+#
+# Human-readable label which specifies which concept/entity
+# the peak represents/identifies.
+#
+#
+#
+#
+#
+# Position values along one or more data dimensions (to hold the
+# values for the independent variable).
+#
+#
+#
+# The ``position`` field must have the same rank (``dimRank``)
+# as the ``intensity`` field. Each individual dimension of ``position``
+# must have the same number of points as the corresponding dimension in
+# the ``intensity`` field.
+#
+#
+#
+#
+#
+# This array holds the intensity/count values of the fitted peak at each position.
+#
+#
+#
+# The ``intensity`` field must have the same rank (``dimRank``)
+# as the ``intensity`` field. Each individual dimension of ``position``
+# must have the same number of points as the corresponding dimension in
+# the ``position`` field.
+#
+#
+#
+#
+#
+#
+# The functional form of the peak. This could be a Gaussian, Lorentzian,
+# Voigt, etc.
+#
+#
+#
+#
+# Total area under the curve.
+#
+#
+#
diff --git a/contributed_definitions/nyaml/NXxps.yaml b/contributed_definitions/nyaml/NXxps.yaml
index dfb2cd7622..c15d457deb 100644
--- a/contributed_definitions/nyaml/NXxps.yaml
+++ b/contributed_definitions/nyaml/NXxps.yaml
@@ -230,9 +230,160 @@ NXxps(NXmpes):
\@reference:
exists: recommended
\@energy_indices:
+ (NXfit):
+ exists: recommended
+ doc:
+ - |
+ Peak model for XPS fitting. Each `NXfit` instance shall be used for the description of
+ _one_ peak fit in _one_ XPS region. As an example, this could be used to describe the
+ fitting of one measured C 1s spectrum.
+ - |
+ xref:
+ spec: ISO 18115-1:2023
+ term: 3.29
+ url: https://www.iso.org/obp/ui/en/#iso:std:iso:18115:-1:ed-3:v1:en:term:3.29
+ label:
+ data(NXdata):
+ doc: |
+ Input data and results of the fit.
+ input_dependent(NX_NUMBER):
+ unit: NX_ANY
+ doc: |
+ Dependent variable for this fit procedure.
+
+ This could be a link to entry/data/data.
+ input_independent(NX_NUMBER):
+ unit: NX_ANY
+ doc: |
+ Independent variable for this fit procedure.
+
+ This could be a link to entry/data/energy.
+ envelope(NX_NUMBER):
+ residual(NX_NUMBER):
+ exists: recommended
+ peakPEAK(NXpeak):
+ label:
+ data(NXdata):
+ position(NX_NUMBER):
+ unit: NX_ENERGY
+ doc: |
+ This could be a link to entry/data/energy.
+ intensity(NX_NUMBER):
+ doc:
+ - |
+ Intensity values of the fitted function at each energy in the position field.
+ - |
+ xref:
+ spec: ISO 18115-1:2023
+ term: 3.15
+ url: https://www.iso.org/obp/ui/en/#iso:std:iso:18115:-1:ed-3:v1:en:term:3.15
+ function(NXfit_function):
+ exists: recommended
+ description:
+ formula:
+ exists: recommended
+ area(NXfit_parameter):
+ exists: optional
+ doc: |
+ Area of the peak.
+ width(NXfit_parameter):
+ exists: optional
+ doc:
+ - |
+ Width of a peak at a defined fraction of the peak height.
+ - |
+ Usually, this will be the Full Width at Half Maximum of the peak (FWHM).
+ For asymmetric peaks, convenient measures of peak width are the half-widths of
+ each side of the peak at half maximum intensity.
+ - |
+ xref:
+ spec: ISO 18115-1:2023
+ term: 3.28
+ url: https://www.iso.org/obp/ui/en/#iso:std:iso:18115:-1:ed-3:v1:en:term:3.28
+ value:
+ unit: NX_ENERGY
+ position(NXfit_parameter):
+ exists: optional
+ doc: |
+ Position of the peak on the energy axis.
+ value:
+ unit: NX_ENERGY
+ total_area:
+ exists: recommended
+ doc:
+ - |
+ Total area under the peak after background removal.
+ - |
+ xref:
+ spec: ISO 18115-1:2023
+ term: 3.16
+ url: https://www.iso.org/obp/ui/en/#iso:std:iso:18115:-1:ed-3:v1:en:term:3.16
+ backgroundBACKGROUND(NXfit_background):
+ doc:
+ - |
+ Functional form of the fitted XPS background.
+ - |
+ xref:
+ spec: ISO 18115-1:2023
+ term: 3.21
+ url: https://www.iso.org/obp/ui/en/#iso:std:iso:18115:-1:ed-3:v1:en:term:3.21
+ label:
+ exists: recommended
+ data(NXdata):
+ position(NX_NUMBER):
+ unit: NX_ENERGY
+ intensity(NX_NUMBER):
+ function(NXfit_function):
+ exists: recommended
+ description:
+ enumeration:
+ linear:
+ doc: |
+ Linear background, i.e., a simple straight line from the minimal to
+ the maximal abscissa value.
+ Shirley:
+ doc: |
+ Shirley background. In the Shirley background, the background intensity at any
+ given binding energy is proportional to the intensity of the total peak area
+ above the background in the lower binding energy peak range (i.e., the
+ background goes up in proportion to the total number of photoelectrons below its
+ binding energy position).
+ Tougaard:
+ doc: |
+ Tougaard background (or Tougaard universal cross-section approach) which is a
+ methodology for integrating the intensity of the background at a given binding
+ energy from the spectral intensities to higher kinetic energies
+ other:
+ doc: |
+ In case none of the enumeration items apply, description should be _other_
+ and the functional form of the background should be given by the `formula`
+ field.
+ formula:
+ exists: recommended
+ global_fit_function(NXfit_function):
+ exists: recommended
+ description:
+ exists: recommended
+ formula:
+ exists: recommended
+ error_function(NXfit_function):
+ exists: recommended
+ description:
+ exists: recommended
+ formula:
+ exists: recommended
+ figure_of_meritMETRIC(NX_NUMBER):
+ exists: recommended
+ \@metric:
+ relative_concentration(NX_FLOAT):
+ unit: NX_ANY
+ doc: |
+ Atomic concentration of each species defined by one peak in the peak model.
+ This should be an array with the indices pointing to the individual peaks
+ (i.e, peak_0, peak_1, etc.)
# ++++++++++++++++++++++++++++++++++ SHA HASH ++++++++++++++++++++++++++++++++++
-# 804ce774ddb827110dd20f43f5edf1748376d129a0b4f6416c94980c77270e55
+# 04421486bc5dffb01865fb8e056d77e5f5157304a3bc3ab9024c8ad160fe21e6
#
#
#