How to get frequency data from ONA

Hello there,

When using the ONA for simulation, users are required to set the frequency range, either setting “start and stop”, or “centre and range”. After simulation, is there a way get the frequency array from the ONA? Neither “getdata” nor “getresult” command can return this data.

thank you,
Chris Lu

Hi @zqlu,
Yes,there is a simple way. For example, those 2 lines of script get the wavelength vector:

T=getresult(‘ONA_1’,‘input 1/mode 1/transmission’);
?T.wavelength;

Try this and let me know if your problem is solved.

2 Likes

Hi @zqlu
After the simulation is completed
Select the ONA
Open “Result view” tab
1)Select the result you want and click right , then click on “Send to script”. After that you can continue with python commands.
OR
2)Select the result you want and click right , then click on “Visualize”
After that a window will be opened with the transmission spectrum click on the option “Export to” and select “Text”. You can save the .txt file with the data of your simulation. Then you can use the data as you want.

I hope it helps !

2 Likes

Thanks @aya_zaki and @konslekk for the replies, all the methods work. Just to explain a bit about it, the result you get from the “getresult” command is a dataset of the result, which is a package of the data (i.e. transmission) and the variable (i.e. frequency/wavelength). There is no raw data stored in the ONA results, so you won’t be able to see the frequency parameter directly. To get the frequency points, you could use the “.” operator or use the “getparameter” coammand:

T=getresult('ONA_1','input 1/mode 1/transmission');
lambda = T.wavelength; # if plot kind = wavelength
f = T.getparameter("frequency"); # if plot kind = frequency

I hope this could help :slight_smile:

2 Likes

Thank you guys for repliers. They are all very helpful.
I think Lumerical should add this topic into the knowledge base.

1 Like