Author Topic: Extract 3D/2D potential profile as a text file  (Read 805 times)

0 Members and 1 Guest are viewing this topic.

Offline maheswari

  • New QuantumATK user
  • *
  • Posts: 3
  • Country: sg
  • Reputation: 0
    • View Profile
Extract 3D/2D potential profile as a text file
« on: March 11, 2024, 11:34 »
Hi, I am interested in getting the raw data (in txt or excel) of the 3D or 2D potential profile of across the device. I could see the 2D image using Viewer, but I don't see an option to extract the raw data. Alternatively, when I tried the "Text Representation" tool, it was hard to read the file since there was no label. It seems to have 6 columns. Is this (x,y,z, potential)? If all the data is just potential, where do I get the (x,y,z) information? Where do I find the information related to sampling? I have attached the snapshot of the output file for your reference.

Thanks!

Offline maheswari

  • New QuantumATK user
  • *
  • Posts: 3
  • Country: sg
  • Reputation: 0
    • View Profile
Re: Extract 3D/2D potential profile as a text file
« Reply #1 on: March 13, 2024, 12:47 »
Hi, Is there any response to my earlier query? Thanks!

Offline filipr

  • QuantumATK Staff
  • Heavy QuantumATK user
  • *****
  • Posts: 73
  • Country: dk
  • Reputation: 6
  • QuantumATK developer
    • View Profile
Re: Extract 3D/2D potential profile as a text file
« Reply #2 on: March 13, 2024, 14:52 »
The columns in the text representation have no meaning - it's just a way to visually "compress" the output. It is just one long list of numbers, 111x111x431 = 5,310,351 numbers to be exact. So you can just take the "matrix" of numbers and split at whitespace and you get a 1-dimensional array of numbers. This is the potential. To convert a 3D index (i, j, k) into a 1D index n in this list you use: n = k + Nk * j + Nj * Nk * i as is somewhat documented at the top of of the text representation (outer loop: x, middle loop: y, inner loop: z)

If you know Python you can also more conveniently get the binary exact numbers as a numpy array by using the QuantumATK python API, see https://docs.quantumatk.com/manual/Python.html and https://docs.quantumatk.com/manual/Types/ElectrostaticDifferencePotential/ElectrostaticDifferencePotential.html This allows you to directly extract the data, do post-processing and plotting in the same Python script.