Skip to content
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

ZMT zurich med tech

  1. Home
  2. Sim4Life
  3. Python API
  4. Simulation results show as nan+nanj

Simulation results show as nan+nanj

Scheduled Pinned Locked Moved Python API
4 Posts 2 Posters 673 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    LJ
    wrote on last edited by
    #1

    Hello,

    I am trying to extract the results using the python interface but I am getting a nan+nanj for each of the fields in the array.

    I have used data= E_field.Data.Field(0)

    The same thing happens when I export to matlab. However, when I look at the results in the analysis tab it does show the correct results. Am I missing something?

    Thanks!

    1 Reply Last reply
    0
    • L Offline
      L Offline
      LJ
      wrote on last edited by
      #2

      Just an update on this, using this same method to extract the results from the tutorial "emlf_two_metallic_spheres" I managed to get complex numbers as a result. However, it doesn't work with any of my simulations even though they're created the same way?

      1 Reply Last reply
      0
      • SylvainS Offline
        SylvainS Offline
        Sylvain
        ZMT
        wrote on last edited by
        #3

        maybe your fields are "NaN" in some regions and "complex numbers" in other regions. This happens, for example, if you use a Mask Filter (which replaces values outside the mask by NaN).
        Easy way to check:

        import numpy as np
        print(np.nanmax(E_field.Data.Field(0)))
        
        1 Reply Last reply
        1
        • L Offline
          L Offline
          LJ
          wrote on last edited by
          #4

          Oh that worked! Thank you :)

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Search