Skip to content

Analysis & Postprocessing

Postprocessing results

108 Topics 319 Posts
  • SetUp Field Crop Filter

    python
    2
    1 Votes
    2 Posts
    449 Views
    SylvainS
    In general, an easy way to create a postprocessing script is to first do it in the GUI and then use the "To-Python" function (available via right-click on the algorithm in the Explorer window). Here is what the auto-generated script looks like for a simple pipeline with a Crop Filter: # Creating the analysis pipeline # Adding a new SimulationExtractor simulation = document.AllSimulations["EM"] 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.Normalization.Normalize = True em_sensor_extractor.SurfaceCurrent.SurfaceResolution = 0.001, units.Meters document.AllAlgorithms.Add(em_sensor_extractor) # Adding a new FieldCropFilter inputs = [em_sensor_extractor.Outputs["EM E(x,y,z,f0)"]] field_crop_filter = analysis.core.FieldCropFilter(inputs=inputs) field_crop_filter.LowerExtent = numpy.array([1, 3, 2]) field_crop_filter.UpperExtent = numpy.array([21, 21, 21]) field_crop_filter.UpdateAttributes() document.AllAlgorithms.Add(field_crop_filter) Note fyi that you don't actually need to pass a Numpy array to UpperExtent or LowerExtent, it also works if you pass any iterable, like a list or a tuple.
  • This topic is deleted!

    1
    0 Votes
    1 Posts
    9 Views
    No one has replied
  • 0 Votes
    2 Posts
    734 Views
    SylvainS
    In Sim4Life, the complex field S(x,y,z,f0) is (one half of) the cross product of the complex fields E(x,y,z,f0) and H(x,y,z,f0), both of which are the complex representation of harmonic fields (actually S = 0.5 E cross H*, where H* is the complex conjugate of H) The time-averaged Poynting vector (if you want the power flow) is given by Re(S) See the Wikipedia article (https://en.wikipedia.org/wiki/Poynting_vector) for more detail. EDIT: this post was corrected to reflect the notations used in Sim4Life, namley that S(x,y,z,f0) is already the time-averaged quantity and includes the factor 1/2.
  • This topic is deleted!

    1
    0 Votes
    1 Posts
    16 Views
    No one has replied
  • How to export the high quality of results images from Analysis section

    2
    0 Votes
    2 Posts
    620 Views
    M
    I typically just take screenshots (I recommend SnagIt since it 'snaps' screenshots to subwindows (for example, just the rendering window). Alternatively, for reproducibility, I sometimes use a script to take screenshots. There's a third way (unfortunately not so reliable), which is to use the built in Screen shot grabber ... Go to 3D View -> Screen Capture (you need to configure it first ... I say it's unreliable because saving a particular '3D View' (Camera Settings -> Save) doesn't work well when you reimport it (views get forgotten or overwritten) For the script I do something like this. I create a wireframe, zoom to it, and then use the following script (which you'll need to tweak via trial and error since you might get weird behavior for the color bars and ruler, axis, etc). #Manual Record Screenshot import s4l_v1 as s4l import XCoreModeling import XRendererUI import XCoreUI bb = "CameraBoundingBox" e_cam = s4l.model.AllEntities()[bb] bb_pts = XCoreModeling.GetBoundingBox([e_cam]) oglview = XCoreUI.GetUIApp().Frame.MainView[0] oglview.ZoomTo(bb_pts[0], bb_pts[1]) x_size = bb_pts[1][0]-bb_pts[0][0] z_size = bb_pts[1][2]-bb_pts[0][2] img_dim = [x_size,z_size] screen_prefix = "Test" screen_name = "Test" XRendererUI.SaveScreenCapture(width = int(1000*img_dim[0]/img_dim[1]), height = 1000, \ transparent_background = False, output_folder=r"C:\Users\montanaro\Desktop\Screen", \ output_prefix=screen_prefix+screen_name)
  • How to extract point data?

    5
    0 Votes
    5 Posts
    656 Views
    A
    Thanks a lot !
  • 0 Votes
    2 Posts
    293 Views
    M
    Answered in your other post: https://forum.zmt.swiss/topic/253/how-do-i-calculate-the-full-width-at-half-maximum-fwhm-volume-data-in-acoustic-ultrasound-simulation You would probably need to update the script slightly to use Intensity (a scalar real field) instead of pressure field (scalar complex field) and there would be no need for 'postprocessing' of the field (taking the absolute value of the pressure field; see Notes in my response)
  • Export results from analysis

    export matlab postprocessing
    3
    1 Votes
    3 Posts
    820 Views
    H
    @LJ thanks
  • Calculating Coducting Loss along Microstrip Line

    1
    0 Votes
    1 Posts
    190 Views
    No one has replied
  • How to calculate the inductance of a simple coil?

    Moved coil inductance wpt low-frequency
    5
    0 Votes
    5 Posts
    1k Views
    J
    Thank you very much for your answer! I was observing a mutual inductance in my simulations, but I wasn't sure why it was being generated. I guess I need to read up more on how boundary conditions for current sources are implemented in Sim4Life :)
  • Max modulation tool logic

    4
    1 Votes
    4 Posts
    749 Views
    SylvainS
    Thanks a lot for sharing your solution!
  • Induced Magnetic H-field

    1
    0 Votes
    1 Posts
    391 Views
    No one has replied
  • Optimization not running

    6
    0 Votes
    6 Posts
    895 Views
    H
    @dstoupis We just figured out an issue with the Sweeper and Optimizer in Sim4Life light 5.2.1.1375. We have starting on working on a fix which should be available in the coming few weeks. If you urgently need to use the features, you have the option to use an older version of Sim4Life light, e.g., 4.4. If you do not have the installer anymore, please drop us a light at s4l-support@zmt.swiss.
  • 0 Votes
    2 Posts
    324 Views
    SylvainS
    Are you perhaps using Sim4Life using Remote Desktop or TeamViewer, or something similar? There are sometimes issues with the graphics drivers when using those software, preventing the Workbench to work correctly. If that's the case, there should be some warnings/errors in the Console when you start Sim4Life, mentioning issues with OpenGL.
  • Electrode position optimization

    1
    1 Votes
    1 Posts
    226 Views
    No one has replied
  • Spherical Field Interpolator

    1
    0 Votes
    1 Posts
    203 Views
    No one has replied
  • Beam Tilt Problem

    2
    0 Votes
    2 Posts
    374 Views
    SylvainS
    Hi, I would advice you to look into the Tutorial examples related to 5G (in the FDTD or Optimization tutorial sections). They all include some analysis of beam patterns. The key ingredients are the "Far Field Sensor", the "Radiation Evaluator" and the "1D Filter"
  • Far Field Viewer and Radiation Evaluator

    3
    0 Votes
    3 Posts
    539 Views
    C
    Thank you. How can I display the big green arrow that shows the max direction. There was an option "Show Max Direction" (see screenshot above).
  • Inserting point sensors after running simulation NEURON

    5
    0 Votes
    5 Posts
    769 Views
    F
    Dear supporter, It did actually speed the process up quite a bit. Thanks a bunch.
  • SAR statistics per solid

    2
    1 Votes
    2 Posts
    447 Views
    SylvainS
    @Spuky you are looking for the "SAR Statistics" algorithm, in the Dosimetry tools. It is computed directly from the E-field and is different from using the "Statistics" algorithm on the "local SAR" field. [image: 1573025607511-b68d7134-8261-434e-8c4f-e58c36892e21-image-resized.png]