Skip to content

Instantly share code, notes, and snippets.

@thomasaarholt
Created February 11, 2021 09:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thomasaarholt/b383445e094d9690dc9da3733d04cbbf to your computer and use it in GitHub Desktop.
Save thomasaarholt/b383445e094d9690dc9da3733d04cbbf to your computer and use it in GitHub Desktop.
1D TopHat Hyperspy Sympy component using Relationals
import hyperspy.api as hs
expr = "where(And(left < x, x < right), A, 0)"
tophat = hs.model.components1D.Expression(expr, 'Top Hat', position="left", A=1, left=0, right=1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment