Export Current Density Data

Selecting File > Export > Data from the main menu of the Current Density Viewer opens the Export Data dialog box which allows you to export a comma separated value (.csv) file of the plot presently displayed in the Current Density Viewer. The type of data exported is dependent on the type of plot you are displaying. For example, if you are displaying JXY Magnitude Surface, then the surface current density data is exported. Likewise, if you are displaying Surface Charge, then surface charge data is exported.

You may export all the data on your display, a region of your display, or a line of data. Select the desired Export type from the drop list. Note that the controls below the drop list are updated based on the selection you make. The choices and their corresponding controls are explained below.

Export Type

Line: Select the Line export type if you wish to export data from a single line of your plot. Click the Vertical radio button to select a vertical line, or click the Horizontal radio button to select a horizontal line. Once you have selected the direction of the line, you may enter the location by editing the the X-position entry box (Vertical) or Y-position entry box (Horizontal line). You may also click the Mouse button and select the location in your current density plot which you wish to export.

Region: Select the Region export type if you wish to export data from a specified area of your plot. The area is a rectangle defined by  the Top, Bottom, Left and Right entries. You may enter these values manually, or click the mouse button to use your mouse to define the region. After you click the mouse button, you click on your plot at the desired location for a corner of your region, then drag the mouse to enclose the desired region.

All Data: Select the All Data export type if you wish to export a sampling of the complete plot that is presently displayed.

If there is no metal at any given point in the display, then a value of zero is exported for that data point.

Sample Spacing

The Sample Spacing section controls how many data points are exported. The first data point is always one half of the Sample Spacing from the defined edge of the specified region or line. For example, if you set your Sample Spacing to 5.0 microns, the first sample will be 2.5 microns from the edge of the specified region and the second sample will be 7.5 microns.

Additional Options

All Levels: Select this checkbox if you wish to export the specified data points for each metal level of your circuit. If this checkbox is not selected, then the data for only the presently displayed level is exported.

Export Raw Data: Select this checkbox if you wish to export the complex data for the specified data points. If this checkbox is unselected, then whatever type of data is presently plotted is exported.

Export Currents by Command Line

You can also export current density data from a script using Sonnet's utility program, soncmd, which is located in the bin directory of the sonnet installation directory. The syntax is as follows:

soncmd -JXYExport xml_control_file project_file

where,

  • soncmd is the complete path to the soncmd program;
  • project_file is the name of the project file (e.g., filter.sonx);
  • xml_control_file is the name of control file in xml format.

The following is an example of a control file:

<?xml version="1.0" encoding="utf-8"?>
<JXY_Export_Set>
   <JXY_Export Filename="output.csv" Label="My Currents">
      <Region Style="Whole"/>
      <Levels Range="Some" Start="0" Stop="0"/>
      <Grid XStep="10" YStep="10"/>
      <Measurement Complex="No" Type="jxy"/>
      <Drive>
         <JXYPort Capacitance="0" Inductance="0" Number="1" Phase="0" Reactance="0" Resistance="50" Voltage="1.0"/>
         <JXYPort Capacitance="0" Inductance="0" Number="2" Phase="0" Reactance="0" Resistance="50" Voltage="0"/>
      </Drive>
      <Locator>
         <Frequency Value="1000000000"/>
         <Frequency Value="2000000000"/>
         <Frequency Value="3000000000"/>
      </Locator>
   </JXY_Export>
</JXY_Export_Set>

When the soncmd command is executed, an output file called "output.csv" is generated.