Put the flour and butter into a food processor and reduce to soft crumbs, then add the egg yolk followed by enough water to make a firm but slightly sticky dough. If you prefer, cut the butter into dice, rub into the flour with fingertips then mix in the egg and water.
Transfer to a lightly floured board or work surface, pat into a thick disc, wrap in kitchen paper and refrigerate for 30 minutes.
Heat the oven to 200C/gas mark 6. Roll the pastry out and use to line a 23cm loose-bottomed tart tin. Fill with baking parchment or foil and baking beans then bake for 20 minutes.
Remove the paper or foil and beans and return to the oven for a few minutes until the pastry is dry.
While the pastry is baking, make the frangipane. Cream together the butter and sugar until light and fluffy. (This is easiest done with a food mixer fitted with a beater attachment.) While the mixture is creaming, grind the pistachios to a fine powder in a food processor.
Break the eggs into a bowl, beat lightly with a fork, then add to the butter and sugar. If the mixture shows any sign of curdling or becomes grainy, introduce a little flour. Finally, mix in all the flour, all the ground nuts and set aside.
Stone the cherries. Remove the pastry case from the oven and turn the oven down to 160C/gas mark 3. Spread the base of the pastry case with the jam. Scatter the stoned cherries over then spoon in the frangipane and smooth the surface.
Scatter the flaked almonds over the tart and bake for 40 minutes until the filling feels lightly firm. Remove from the oven and allow to cool before attempting to remove the case and slicing.