code: def barth_sextic(x, y, z):
      x2 = x * x
      y2 = y * y
      z2 = z * z
      arr = (
          3 * (phi2 * x2 - y2) * (phi2 * y2 - z2) * (phi2 * z2 - x2)
          - (1 + 2 * phi) * (x2 + y2 + z2 - 1) ** 2
      )
      nan_mask = x2 + y2 + z2 > 3.1
      arr[nan_mask] = np.nan
      return arr
  
imports: import numpy
  import pyvista
label_desc: Use image node_id 2 for calling a global function with example usage: barth_sextic(x, y, z) and returns: arr