# Is it possible to get data directly from d-cards in MODE?

#1

In a MODE script, I used copydcard to save mode profiles to the deck. Is there a way to later pull data (e.g., electric field data for plotting) from the named d-card using script commands?

#2

Yes, it is possible by using getdata command.

Example
I have “test_mode1” in my deck:

Command
?getdata
will return all objects with available data in my FDE simulation. I can see that besides the modes in the mode list, I have also “::test_mode1” object at my disposal:

Then I can inquiry what type of data are within this object:
?getdata("::test_mode1");

which returns:

surface_normal  dimension  f  neff  loss  TE polarization fraction  waveguide TE/TM fraction  x  y
z  Ex  Ey  Ez  Hx  Hy  Hz  Z0


Hence, if I wish to get Ex from the mode in my deck, I use the following command:
Ex=getdata("::test_mode1","Ex");

and the Ex matrix will be available in my script workspace now:

Exporting contents of LDF file to MAT file