QuantumATK Forum

QuantumATK => General Questions and Answers => Topic started by: Nayab Shiraz on February 28, 2020, 21:12

Title: Compare Data
Post by: Nayab Shiraz on February 28, 2020, 21:12
While comparing two or more transmission spectra using 'compare data' it only shows the sum curve. Is there a way to compare transmission spectra of just spin up or spin down curves?
Title: Re: Compare Data
Post by: Nayab Shiraz on March 23, 2020, 23:43
Please can someone help me with this?
Title: Re: Compare Data
Post by: Anders Blom on April 21, 2020, 00:44
The tool is designed as a quick way for "standard" comparison. I agree it could be nice to extend it in the future with various options, but for now it only supports the sum (for simplicity, basically). If you want to plot spin up/down curves together you will have to write a small Python script, it's really simple.

Assuming the transmission spectra are in separate files:

t1 = nlread("file1.hdf5", TransmissionSpectrum)[0]
t2 = nlread("file2.hdf5", TransmissionSpectrum)[0]
import pylab
pylab.plot(t1.evaluate(spin=Spin.Up), t1.energies(), label="File1, Spin Up")
pylab.plot(t2.evaluate(spin=Spin.Up), t2.energies(), label="File2, Spin Up")
pylab.legend()
pylab.xlabel("Transmission")
pylab.ylabel("Energy / eV")

With small modifications you can compare spin up vs down from the same file, etc.