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. Missing psSAR in SAR statistics table when using Python API

Missing psSAR in SAR statistics table when using Python API

Scheduled Pinned Locked Moved Python API
pythonsarapi
1 Posts 1 Posters 892 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.
  • SylvainS Offline
    SylvainS Offline
    Sylvain
    ZMT
    wrote on last edited by
    #1

    When using the "To-Python" script autogeneration in the Analysis for SAR Statistics evaluator, the results may miss the "Peak Spatial Average SAR" column in the table. This seems to be due to a bug in the autogeneration method, which forgets to add one line.
    Below is the autogenerated script (for the SCC3 Benchmark tutorial), with the missing line added

    import numpy
    import s4l_v1.analysis as analysis
    import s4l_v1.document as document
    import s4l_v1.model as model
    import s4l_v1.units as units
    from s4l_v1 import Unit
    
    
    
    # Creating the analysis pipeline
    # Adding a new SimulationExtractor
    simulation = document.AllSimulations["SCC34 Benchmark Simulation"]
    simulation_extractor = simulation.Results()
    
    # Adding a new EmSensorExtractor
    em_sensor_extractor = simulation_extractor["Overall Field"]
    em_sensor_extractor.FrequencySettings.ExtractedFrequency = u"All"
    em_sensor_extractor.SurfaceCurrent.SurfaceResolution = 0.001, units.Meters
    document.AllAlgorithms.Add(em_sensor_extractor)
    
    # Adding a new SarStatisticsEvaluator
    inputs = [em_sensor_extractor.Outputs["EM E(x,y,z,f0)"]]
    sar_statistics_evaluator = analysis.em_evaluators.SarStatisticsEvaluator(inputs=inputs)
    sar_statistics_evaluator.UpdateAttributes()
    sar_statistics_evaluator.Snapshot = u"8.35e+08"
    sar_statistics_evaluator.EnablePSAvgSar = True # <==== this line is missing when "autogenerating" the script
    sar_statistics_evaluator.StdDev = False
    sar_statistics_evaluator.TotalLossyVolume = False
    sar_statistics_evaluator.VoxelCount = False
    sar_statistics_evaluator.LossyVoxelCount = False
    sar_statistics_evaluator.UpdateAttributes()
    document.AllAlgorithms.Add(sar_statistics_evaluator)
    
    # Adding a new DataTableHTMLViewer
    inputs = [sar_statistics_evaluator.Outputs["SAR Statistics"]]
    data_table_html_viewer = analysis.viewers.DataTableHTMLViewer(inputs=inputs)
    data_table_html_viewer.Visible = False
    data_table_html_viewer.UpdateAttributes()
    document.AllAlgorithms.Add(data_table_html_viewer)
    
    1 Reply Last reply
    3
    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