QuantumATK Forum

QuantumATK => General Questions and Answers => Topic started by: vivek-dhande on January 14, 2023, 18:50

Title: Exporting Density of States data
Post by: vivek-dhande on January 14, 2023, 18:50
I have run a density of states like so and I would like to extract the raw data:

iv_characteristics.addProjectedLocalDensityOfStates(
    gate_source_voltages = back_gate_source_voltages,
    drain_source_voltages = drain_source_voltages,
    energies=numpy.linspace(-0.01, 0.035, 6000)*eV, # 10ueV steps
)

I opened the Projected Local Density of States plot and clicked on Export --> export data as text file, but I get an error:
Traceback (most recent call last):
  File "zipdir/NL/GUI/Graphics/Plotter/PlotView/PlotView.py", line 389, in save
  File "zipdir/NL/GUI/Graphics/Plotter/IO/Export.py", line 131, in writeTXT
  File "zipdir/NL/GUI/Graphics/Plotter/IO/Export.py", line 159, in _dataToTXT
  File "zipdir/NL/GUI/Graphics/Plotter/IO/Export.py", line 212, in _data1DtoTXT
NameError: name 'dataToTXT' is not defined

I'm not sure where and how I should define `dataToTXT` or fix this issue.

Thank you!
Title: Re: Exporting Density of States data
Post by: Anders Blom on January 18, 2023, 01:13
Which version of QuantumATK are you using?
Title: Re: Exporting Density of States data
Post by: vivek-dhande on February 22, 2023, 05:55
2019.12.980d1ca I'm pretty sure.
Title: Re: Exporting Density of States data
Post by: Anders Blom on February 28, 2023, 07:17
Ok, so that might have been a bug, but there is not much we can do to fix that now, 3 years later. You can either use a more recent version where most likely this bug is not present, or you will need to write a script to extract the data manually. This is not hard, but might require some experience with our data types. It's hard to provide a generic example since you are using the IVCharacteristics, but if you isolate the ProjectedLocalDensityOfStates object, it will have a .evaluate() method which basically returns an array, which you could export or print to the terminal to get the raw numbers.

I can advise but would need to see what the plot looks like in the GUI and what data files (hdf5) you are working with.