davidcortesortuno / oommfpy

Python library to analyse OOMMF and MuMax3 data files
BSD 2-Clause "Simplified" License
12 stars 7 forks source link

Problem in finding the size and position of the divergence value. #5

Closed Aryan1909 closed 3 years ago

Aryan1909 commented 3 years ago

Hi, I read the basics file in the folder but still couldn't find any instructions to find size (diameter) and position of the specific divergence value in each omf file. hoping for your suggestions on how I can do that. IMG_20210531_124842

davidcortesortuno commented 3 years ago

Hi, what do you exactly mean with size of the specific divergence?

Aryan1909 commented 3 years ago

Just like we find the skyrmion numbers, we want to find the size of the skyrmion bubble and track skyrmion position for multiple ovf files.

On Mon, 31 May 2021, 13:29 David Ignacio Cortes, @.***> wrote:

Hi, what do you exactly mean with size of the specific divergence?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/davidcortesortuno/oommfpy/issues/5#issuecomment-851289966, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUJH7Q22FPZV23VK2OUZRP3TQM6VLANCNFSM452J5VAQ .

davidcortesortuno commented 3 years ago

It might be good to add this to the code, I haven't implemented these calculations. Do you have any references specifying how to track the skyrmion position? For the skyrmion size I guess you can plot the mz component in a line across the skyrmion diameter and find the length where mz=0. This is one of the definitions, A. Bogdanov uses the derivatives I think, which gives you a slightly different size.

Aryan1909 commented 3 years ago

By definition I think the skyrmion position is the one where mz= -1.

On Mon, 31 May 2021, 14:23 David Ignacio Cortes, @.***> wrote:

It might be good to add this to the code, I haven't implemented these calculations. Do you have any references specifying how to track the skyrmion position? For the skyrmion size I guess you can plot the mz component in a line across the skyrmion diameter and find the length where mz=0. This is one of the definitions, A. Bogdanov uses the derivatives I think, which gives you a slightly different size.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/davidcortesortuno/oommfpy/issues/5#issuecomment-851333704, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUJH7Q4HG26G2ARIDRJDCZLTQNFCNANCNFSM452J5VAQ .

davidcortesortuno commented 3 years ago

Then, after you read the omf file, it should be straightforward to find the points where mz=-1, for instance, you can create a Numpy mask to obtain coordinates where this condition is met:

data = oommfpy.MagnetisationData(...)
...
eps = 1e-6   # or any threshold
# this gives me an array of booleans where True is where mz is close to -1
sk_pos = data.mz - (-1) < eps
# now we can find positions of the points satisfying the condition
print(data.coordinates[sk_pos])

# OR 
# sk_pos = np.where(data.mz - (-1) < eps)

I'm not sure if there are other algorithms, maybe to detect the skyrmion shape using opencv, but the idea is the same, you have the array and can perform any operation on the spin data.