The getdata command can be used to obtain raw data from simulation objects (primarily monitors) in matrix form. This page describes how to check what data is available, and how to get that data into standard script matrices. In many situations, you may find the getresult command more convenient than getdata.
Note that getdata is only used to get raw data from simulation objects. To get data from a parameter sweep or optimization task, use getsweepdata.
After a simulation is run, the simulation data will be stored in the simulation objects.
For example, suppose we run a file with a source called source1, and several monitors: spatial, time_drop, through, drop, time_through, movie. After running the simulation, ?getdata will output a list of objects with data:
spatial time_drop through drop time_through movie source1
After seeing the list of objects with data, you can get a list of data within each object with:
x y z surface_normal dimension f Ex Ey Ez
Hx Hy Hz power
Finally, you can get the any available data with a command like:
This will print the result of x to the scripting screen. This is not very useful if x is a large matrix with a large amount of data. A better approach would be to create a script variable called x and set it equal to the data in the d-card called x. This can be done with:
x = getdata("through","x");
x is now a variable in the scripting workspace that shows the position of the monitor "through".
Similarly, if we want to obtain the z component of the electromagnetic field (Ez) from the monitor called "spatial", we can use:
Ez = getdata("spatial","Ez");
Once the monitor data is stored in script variables, it's possible to do further analysis or plot the data. For a a simple example using the image command, see Image plots.