8000 How to visualise the domain image of a file saved in .omf format · Issue #184 · ubermag/ubermag · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

How to visualise the domain image of a file saved in .omf format #184

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Nikki07-22 opened this issue Jan 19, 2025 · 2 comments
Open

How to visualise the domain image of a file saved in .omf format #184

Nikki07-22 opened this issue Jan 19, 2025 · 2 comments

Comments

@Nikki07-22
Copy link

Image import discretisedfield as df
import matplotlib.pyplot as plt

Specify the path to the .omf file

file_path = "C:/Users/NIKITHA UNNI/hysteresis_angle_0_step_840.omf"

Define angle

angle = 0.1 # Example angle

Loop over steps from 0 to 999

for step in range(1000):
# Load the .omf file for the given step
field = df.Field.from_file(f"{file_path.split('step')[0]}step{step}.omf")

# Slice the field at z=0 for visualization
field_slice = field.sel(z=0)  # Select the z=0 plane

# Extract and visualize Mx component
mx_field = field_slice.x  # Extract Mx
mx_field.mpl.scalar(figsize=(8, 6))
plt.title(f"Domain Pattern: Mx Component at {angle} Degree (Step {step})")
plt.show()

# Compute and visualize the magnitude of the magnetization
magnitude_field = field_slice.norm  # Compute the magnitude
magnitude_field.mpl.scalar(figsize=(8, 6))
plt.title(f"Domain Pattern: Magnitude of Magnetization at {angle} Degree (Step {step})")
plt.show() I have just saved the different applied external angle in different steps in .omf format and tried to visualise the domain image,first of all I need to get the domain image of the single angle 0 degree external applied angle and visualise magnetic moment orientation of it with arrows showing moments orientation,how can I do that?
@lang-m
Copy link
Member
lang-m commented Jan 20, 2025

@Nikki07-22
Copy link
Author
Nikki07-22 commented Jan 21, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
0