Commit aad721ee authored by Pierre Paleo's avatar Pierre Paleo
Browse files

Add some terminology on concepts

parent b11dd0f2
Pipeline #19654 passed with stage
in 1 minute and 27 seconds
......@@ -47,9 +47,10 @@ Advanced documentation
:maxdepth: 1
:caption: Advanced documentation
apidoc/nabu.rst
processing_components.md
nabu_tasks.md
validators.md
apidoc/nabu.rst
Indices and tables
......
# Processing and Components
This page brings some terminology for developers.
## Processing
`Processing` is a class making a specific processing step (ex. `FlatField`). In general, these classes provide a very specific feature (ex. Paganin phase retrieval, Median-clip, ...).
``` note:: The name "Processing" serves as a terminology to distinguish between concepts and Nabu classes. It is not formally enforced by inheritance in the Nabu code, although these classes usually inherit from a "Processing"-like class, like "CCDProcessing", "CudaProcessing", etc.
```
When building an application upon Nabu, these are the last classes to be called, once all the parameters are sorted out.
The typical usage of a `Processing`-like class is
- First instantiate the class with specific options
- Then, Call the main class method
Example:
```python
# Build a Processing object - it might take some time
F = FlatField(radios, flats, darks)
# Then, perform the processing
F.normalize_radios() # parameters depend on the class implementation, ex. CudaFlatfield
```
Component
----------
A `Component` is a wrapper around a `Processing`, whose aim is to make the translation between user parameters and final `Processing` parameters.
For an interactive usage where the data is "ready" and all the parameters are known, it is fine to use `Processing` classes directly. Each feature can be seen as an individual function or class instance.
In an application, by contrast, the `Processing` classes (ex. `FlatField`) are part of a wider context (data/GPU contexts have to be re-used, parameters have to be consistent in the whole processing chain, and so on). Therefore, the application is built on top of several `Component` objects, which in turn use the `Processing` objects. A `Component` uses one or more `Processing` class instances, sometimes in loops, for example to manage input/output arrays.
Conceptually, these are "application components" or "processing pipeline components". A component breaks down in one or several "elementary" Processing steps.
......@@ -187,10 +187,10 @@ class NabuWorkerProcess:
self.dataset_infos.radio_dims.T,
]
phaseretr_kwargs = {
distance=self.dataset_infos.energy,
energy=self.dataset_infos.distance, # TODO convert
delta_beta=phaseretr_options["paganin_delta_beta"],
pixel_size=self.dataset_infos.pixel_size, # TODO convert
"distance": self.dataset_infos.energy,
"energy": self.dataset_infos.distance, # TODO convert
"delta_beta": phaseretr_options["paganin_delta_beta"],
"pixel_size": self.dataset_infos.pixel_size, # TODO convert
"padding": phaseretr_options["paganin_padding_type"]
"margin": None, # TODO
"use_R2C": True,
......
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