Preheat the oven to 190°C.
Roll out the pastry and use to line a large flan dish (25cm in diameter).
Line with tinfoil and fill with dried beans or a suitably sized cake tin to hold it down. Bake in the oven for 20 minutes.
Remove foil and spread the raspberry jam on the bottom. Reduce the oven temperature to 150°C.
To make the filling, cream the margarine and sugar together until pale, light and fluffy. Stir in the eggs. Add the flour and ground almonds and stir to form a smooth mixture. Spread evenly over the jam.
Sprinkle the top with the flaked almonds and bake in the middle of the oven for about 35 minutes, until golden brown, well risen and firm to the touch.
Serve warm with cream or custard.
Rambler's Rewards: Cooking from Coast to Coast by Elizabeth Guy Photographs by Derry Brabbs. Published by Frances Lincoln at £20.00.