You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
The text was updated successfully, but these errors were encountered:
Thanks for the reply,I have another query I have visualised the geometry
but along with the geometry unwanted portion also come in the plot,I have
saved the file in .omf format and done the analysis part.I am
attaching below the domain image of interest and code also.
import matplotlib.pyplot as plt
import discretisedfield as df
# Load the field data from the .omf file
file_path = "C:/Users/NIKITHA
UNNI/permalloy_hysteresis_crossbar_0.1deg_step1214.omf"
field = df.Field.from_file(file_path)
# Select the field at the specific z-slice (assuming you want to use
z=10e-9)
z_slice = 0
field_at_z = field.orientation.sel(z=z_slice)
# Plot using the MPL backend (which combines vector and scalar
visualization)
plt.figure(figsize=(15, 12))
field_at_z.mpl()
# Optionally, if you want to add extra scalar or vector visualizations
# You can also plot heatmaps or quiver vectors manually as needed here.
# Show the plot
plt.show()
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")
The text was updated successfully, but these errors were encountered: