Skip to content

Commit 8d76c55

Browse files
Documentation
1 parent 2f39150 commit 8d76c55

File tree

1 file changed

+44
-1
lines changed

1 file changed

+44
-1
lines changed

doc/sphinx/src/databox.rst

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,13 @@ To use databox, simply include the relevant header:
1414
1515
#include <databox.hpp>
1616
17-
``DatBox`` is templated on underyling data type, which defaults to the
17+
``DataBox`` Templates
18+
^^^^^^^^^^^^^^^^^^^^^
19+
20+
Underlying Data Type
21+
--------------------
22+
23+
``DataBox`` is templated on the underyling data type, which defaults to the
1824
``Real`` type provided by ``ports-of-call``. (This is usually a
1925
``double``.)
2026

@@ -30,6 +36,9 @@ single type, you may wish to declare a type alias such as:
3036
3137
using DataBox = Spiner::DataBox<double>
3238
39+
Interpolation Gridding
40+
----------------------
41+
3342
Spiner is also templated on how the interpolation gridding works. This
3443
template parameter is called ``Grid_t``. The available options at this time are:
3544

@@ -47,6 +56,40 @@ as, for example:
4756
More detail on the interpolation gridding is available below and in
4857
the interpolation section.
4958

59+
Transformations
60+
---------------
61+
62+
Spiner performs linear interpolation of the data, but can apply transformations
63+
to the data in order to enable interpolation methods like log-log, log-lin,
64+
etc. Spiner will perform linear interpolation of the transformed variables.
65+
66+
When constructing the gridding, ``Spiner::RegularGrid1D<T>`` and
67+
``Spiner::PiecewiseGrid1D<T>`` are templated on the independent variable
68+
transformation. Note that all independent variables will use the same
69+
transformation. ``DataBox`` is templated on the dependent variable
70+
transformation. In all cases, the default is a linear "transformation" (no
71+
transformation to the data), so if you do not specify the transformation then
72+
you get linear interpolation. The available transformations are in
73+
``spiner/transformations.hpp`` and users can write custom transformations
74+
following the examples there.
75+
76+
For example, if the user wants to transform the independent variables with a
77+
logarithm and the dependent variable with a custom arctangent transformation,
78+
the declaration of the ``DataBox`` might look like
79+
80+
.. code-block:: cpp
81+
82+
using DataBox = Spiner::DataBox<double, Spiner::RegularGrid1D<double,
83+
Spiner::TransformLogarithmic>, CustomArctanTransform>;
84+
85+
This would result in interpolation according to the equation
86+
87+
.. math::
88+
89+
\arctan(y) = b + \sum m_i \log(x_i)
90+
91+
where :math:`x_i` are the independent variables.
92+
5093
.. note::
5194
In C++17 and later, you can also get the default type specialization
5295
by simply omitting the template arguments.

0 commit comments

Comments
 (0)