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