# Fourier compensation during averaging

During averaging, all the particles that pass the threshold are aligned (rotated and translated) and added together.

Rotating a particle in direct space implies rotating its Fourier transform, which has a missing wedge. Even if all the particles may come from a single tomogram and thus share the same missing wedge, after rotation each particle will cover a different area of the Fourier space. As the particles have different orientations, any voxel in the Fourier Space will have a different number of particles contributing to it. Any Fourier component will be non-zero for some particles and zero (representing missing information) for others.

As each particle has a different missing wedge, the resulting addition is not "well compensated", meaning that some Fourier components are more represented than others. In order to compute the average, each computed Fourier component has to be divided with the actual number of particles that have contributed to it.

Thus, the result of adding the aligned particles together without any special step for fourier compensation is called *raw average*. A raw average has to be compensated.

The way *Dynamo*performs the Fourier compensation is by keeping track of the number of times a rotated particle contributes to a Fourier component. While computing the raw average, each missing wedge is rotated and added into a volume. This volume has the size of a particle if Fourier space. It is called an `fweight` in *Dynamo*jargon (a Fourier weight) and represents the number of particles that contributed to each Fourier Component.

Then the *compensated average* (called simply `average` inside a project) gets computed by dividing the raw average in fourier space with the computed fweight. The used function is `dynamo_fweight_divide`

## Contents

## Artifacts from strongly inhomogeneous information quality

## Artifacts from particle rotation

While rotating a cube, there is always rotation artifact

### Use bigger boxes

T.B.I. A dadata folder can include for each particle entry a *container* entry that represents the same particle cropped with a bigger sidelength. During execution of the project, the small particle will be used for alignment (to save time), and the *container* particles will be used for averaging (to ensure exact removal of rotation artifacts during fourier compensation)

### Crop directly from tomogram

T.B.I. The user can provide a *generic data folder* as just a list of tomograms and coordinates. This way, *Dynamo*will crop on the fly the needed particle, using a sidelength twice as big as the required size for the template. This way, the edge artifacts due to rotation will stay outside of the area of interest.

### Smoothing mask

It is possible to tell Dynamo to impose an smoothing mask (in direct space) onto the raw average before dividing it in fourier space with the `fweight`.
The user can:

- pass the parameters for on-the-fly construction of a smoothing mask
- pass the name of a file.
- use the smoothing mask used in FSC computations also for this task.