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
Open
@Nikki07-22

Description

@Nikki07-22

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0