flatspin.astroid#

Generalized Stoner-Wohlfarth Astroid

flatspin.astroid.rotate_points(x, y, theta)#
flatspin.astroid.gsw(h_par, b=1.0, c=1.0, beta=3.0, gamma=3.0, hc=1.0)#

Generalized Stoner-Wohlfarth Astroid (explicit form)

flatspin.astroid.gsw_par(h_perp, b=1.0, c=1.0, beta=3.0, gamma=3.0, hc=1.0)#

Generalized Stoner-Wohlfarth Astroid (explicit form, par version)

flatspin.astroid.gsw_implicit(h_par, h_perp, b=1.0, c=1.0, beta=3.0, gamma=3.0, hc=1.0)#

Generalized Stoner-Wohlfarth Astroid (implicit form)

flatspin.astroid.gsw_astroid(b=1.0, c=1.0, beta=3.0, gamma=3.0, hc=1.0, rotation=0, resolution=361, angle_range=(0, 6.283185307179586))#

Generate samples from the Generalized Stoner-Wohlfarth Astroid

flatspin.astroid.db#

Astroid database table.

Type:

pd.DataFrame

flatspin.astroid.astroid_params(name=None, **filter)#

Lookup parameters from the astroid database.

Parameters:
  • name (string) – filter as a string of the form “<shape><width>x<height>x<thickness>”, e.g., “stadium220x80x25”.

  • **filter (dict) – column=value to match one row from the database. Consult astroid.db.columns for available column names.

Examples

>>> astroid_params(shape="stadium", width=220, height=80, thickness=20)
{'hc': 0.1898, 'sw_b': 0.366, 'sw_c': 1.0, 'sw_beta': 1.68, 'sw_gamma': 2.75}
Raises:

ValueError – If there are none or multiple matches.

flatspin.astroid.any_astroid_params(params)#

Evaluate astroid_params in params

Returns astroid_params(params[‘astroid_params’]), or {} if astroid_params is not set.