Sorry for not writing an error message, I was a bit tired that morning.
This code seemed to be working, i just have to analyze the data now.

from ATK.TwoProbe import *
from ATK.MPI import processIsMaster
import numpy
# Fetch the calculations.
if processIsMaster(): file = VNLFile('ldosh.vnl')
# Read old atomic configuration
vnl_file = VNLFile("gap.vnl")
atomic_configuration = vnl_file.readAtomicConfigurations()["gap"]
scf = restoreSelfConsistentCalculation('CGsupergap.nc')
scf._attributeContainer().getAttributeContainer('SetupAttributes').setDouble(100.,'MeshCutoff')
t=None
energies=numpy.linspace(-0.40308,-0.34967,10)*electronVolt
for i in range(len(energies)):
ldos = calculateLocalDensityOfStates(scf, energy = energies[i], quantum_number = (0.0,0.0))
if t==None:
t = ldos.toArray()
else:
t = t+ldos.toArray()
ldos._LocalDensityOfStates__local_density_of_states_data =t
if processIsMaster(): file.addToSample(ldos, 'ldosh', 'Local Density Of States Peak homo')
if processIsMaster(): file.addToSample(atomic_configuration,'ldosh'