Author Topic: Extract analysis data from .nc file  (Read 6932 times)

0 Members and 1 Guest are viewing this topic.

Offline atk_user

  • Heavy QuantumATK user
  • ***
  • Posts: 48
  • Country: 00
  • Reputation: 0
    • View Profile
Extract analysis data from .nc file
« on: March 15, 2014, 16:58 »
Dear all,

I'm running ATK on Linux environment.
VNL is very convenient tool for visualize the structure and analysis data such as I-V, Transmission, and Density of States.
However, it is sometimes very time consuming to compare several analysis data.

I want to extract directly specific data such as I-V, Transmission, and Density of States data from .nc file on the linux without VNL.
Is it possible to directly extract each data from the analysis by using python scripts?

If it is possible, could you let me know how to build the script and running?


Thank you very much.

« Last Edit: March 15, 2014, 17:01 by atk_user »

Offline Umberto Martinez

  • Supreme QuantumATK Wizard
  • *****
  • Posts: 479
  • Country: dk
  • Reputation: 26
    • View Profile
Re: Extract analysis data from .nc file
« Reply #1 on: March 17, 2014, 09:50 »
yes, of course it is possible.
In most of the tutorials we do that :)
random example: http://quantumwise.com/publications/tutorials/mini-tutorials/235#h6-analyzing-the-results

check also the single manual pages under "usage examples" to find useful examples.

in general you read the data with something like:
dos = nlread('dos.nc', DensityOfStates)

Finally, also note that you can export data in a text file directly from the LabFloor

Offline atk_user

  • Heavy QuantumATK user
  • ***
  • Posts: 48
  • Country: 00
  • Reputation: 0
    • View Profile
Re: Extract analysis data from .nc file
« Reply #2 on: March 17, 2014, 15:19 »
Thanks for your reply. I can extract the density of states, but I-V can't extracted.  :( After I-V calculation, the analysis.nc file was generated and I run the following code. I don't know what's the problem. Could you help me?
Code
nlread('analysis.nc',IVCurve)[0]
t = TransmissionSpectrum()
current = t.current()
print t.bias(), t.current()
« Last Edit: March 18, 2014, 08:42 by atk_user »

Offline Umberto Martinez

  • Supreme QuantumATK Wizard
  • *****
  • Posts: 479
  • Country: dk
  • Reputation: 26
    • View Profile
Re: Extract analysis data from .nc file
« Reply #3 on: March 18, 2014, 10:25 »
try:
Code
IV = nlread('analysis.nc',IVCurve)[0]
print IV.biases(), IV.currents()

Offline atk_user

  • Heavy QuantumATK user
  • ***
  • Posts: 48
  • Country: 00
  • Reputation: 0
    • View Profile
Re: Extract analysis data from .nc file
« Reply #4 on: March 18, 2014, 10:28 »
I tried but error occurred.
Code
Traceback (most recent call last):
  File "iv.py", line 2, in <module>
    print IV.biases(), IV.currents()
NameError: name 'IV' is not defined

Offline Umberto Martinez

  • Supreme QuantumATK Wizard
  • *****
  • Posts: 479
  • Country: dk
  • Reputation: 26
    • View Profile
Re: Extract analysis data from .nc file
« Reply #5 on: March 18, 2014, 10:32 »
did you include
IV = nlread('analysis.nc',IVCurve)[0] ?

Offline atk_user

  • Heavy QuantumATK user
  • ***
  • Posts: 48
  • Country: 00
  • Reputation: 0
    • View Profile
Re: Extract analysis data from .nc file
« Reply #6 on: March 18, 2014, 12:10 »
I'm so sorry. It was my mistake. It works fine for the script you suggested. Thank you for your help.

Another questions are...

1. How can I export the I-V data for Symmetrize?
2. How can I export the current values in the unit of nA? (current is exported in A)
3. The energy is set to the Average Fermi level or Absolute energy in the Exported DOS data using these python script?
« Last Edit: March 18, 2014, 13:22 by atk_user »

Offline Umberto Martinez

  • Supreme QuantumATK Wizard
  • *****
  • Posts: 479
  • Country: dk
  • Reputation: 26
    • View Profile
Re: Extract analysis data from .nc file
« Reply #7 on: March 19, 2014, 10:19 »
1. How can I export the I-V data for Symmetrize?

By exporting/plotting -IV.biases() and -IV.currents()

2. How can I export the current values in the unit of nA? (current is exported in A)

something like:
currents = IV.currents().inUnitsOf(Ampere)*10**9

3. The energy is set to the Average Fermi level or Absolute energy in the Exported DOS data using these python script?

It depends on the energy_zero_parameter you set in the input script.
http://www.quantumwise.com/documents/manuals/latest/ReferenceManual/index.html/ref.densityofstates.html

Offline Hassan

  • Regular QuantumATK user
  • **
  • Posts: 21
  • Country: ca
  • Reputation: 0
    • View Profile
Re: Extract analysis data from .nc file
« Reply #8 on: March 20, 2014, 05:54 »
I have a similar question.

Is it possible to check whether a certain analysis object EXISTS, without reading in the entire object to memory?

Like if I want to do
 
config_object = nlread ('data.nc', DeviceConfiguration, object_id = 'config2')
  • ,


is it possible to just check if config2 exists? I'm asking because I have .nc files with hundreds of objects, and it is time consuming to loop through them especially if you are looping through DeviceConfiguration or BulkConfiguration objects.

THanks

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5576
  • Country: dk
  • Reputation: 96
    • View Profile
    • QuantumATK at Synopsys
Re: Extract analysis data from .nc file
« Reply #9 on: March 20, 2014, 11:34 »
You can add the parameter "read_state=False" to nlread.

There is also a more "secret" function called "nlinspect", but if the above works well enough for you, then go with that.