Try this
from ATK.TwoProbe import *
#------------------------------------------------------------
# Specify your checkpoint file and other parameters here
checkpointfile = 'checkpointfile.nc'
vnlfile = 'ldos.vnl'
sample_name = 'sample'
energy = 0.*eV
kpoint = (0.,0.)
#------------------------------------------------------------
scf = restoreSelfConsistentCalculation(checkpointfile)
# Compute spin up/down LDOS at specific energy
ldos_up = calculateLocalDensityOfStates(scf,energy,(kpoint,Spin.Up))
ldos_dn = calculateLocalDensityOfStates(scf,energy,(kpoint,Spin.Down))
# Save up/down LDOS
f = VNLFile(vnlfile)
f.addToSample(ldos_up,sample_name,'LDOS up')
f.addToSample(ldos_dn,sample_name,'LDOS down')
# Replace data in up object by difference
ldos_up._LocalDensityOfStates__local_density_of_states_data = ldos_up.toArray()-ldos_dn.toArray()
# Save to VNL file
f.addToSample(ldos_up,sample_name,'LDOS difference')
NOTE that the "up" LDOS object is overwritten, so if you want to save it to the VNL file also, do that in a separate script.
If you are adding this to an existing VNL file, use the same sample name as for the configuration for easier plotting.