Getting "The data can't be imaged" error when using image(); command

script
fdtd

#1

Can someone please help me out trying to plot field profile using scripting (image( , , )) , but it just opens up a blank plot window and says "the data can’t be imaged!"
Hereby attaching the file and script


test simulation file abcd.fsp (420.9 KB)
plotting script abc.lsf (333 Bytes)


#2

The problem is that you are trying to visualize a 3D matrix of data using 2D plot.

The third dimension of your E2 field profile is related to multiple frequency points. Therefore, your need to either

  1. Record only one frequency point by the frequency monitor; or

  2. Use pinch command to extract a single frequency slice from the E2 data before using image(x,y,E2)


#3

OK i get your point , but then what does visualizer shows me ?
I set my monitor at single frequency and plot using image, the electric field profile but I see a great amplitude difference when I plot using visualizer


#5

Could you point out where you see the difference and how to reproduce it?

When I display the E field intensity via the image command and visualizer I get exactly the same results:


#6

Here are the 3 profile views from the monitor_mid
1)E field (exactly same)

2)H field profile(difference of 2 order )

3)P profile(difference of 2 order)

why this difference of 2 order for H and P profile ??


#7

Hi @rsharma,

From the bit of script we can see in the screen captures, it looks like you are plotting real(|P|) in the vizualizer (left plot) and |P|^2 in the right plot. To compare both, you would have to select “abs^2” in “scalar operation”, in the visualizer.