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 icon 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 icon to use your mouse to define the region. After you click the
icon, 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="1"/>
<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="1.0E9"/>
<Frequency Value="2.0E9"/>
<Frequency Value="3.0E9"/>
</Locator>
</JXY_Export>
</JXY_Export_Set>
When the soncmd command is executed, an output file called "output.csv" is generated.
Specifying Levels
You may export one or more levels at the same time. There are three ways to specify the levels:
A single level: To specify a single level, set the Range to One. For example, use the following to specify level 2:
<Levels Range="One" Level="2">
All levels: To specify all levels, set the range to ALL as shown below:
<Levels Range="ALL">
Range of levels: To specify a range of levels, set the range to Some followed by a Start and Stop value. For example, use the following to specify levels 2 through 5:
<Levels Range="Some" Start="2" Stop="5">
Projects with Parameters
If your project has parameters, you must add a "Parameters" line to the Locator section containing values for all parameters that are used by the project. For example, if your project contains two used parameters L1 and C1, and you want data at 3.0 GHz, your Locator section should look like the following:
<Locator>
<Frequency Value="3.0E9"/>
<Parameters L1="2.3" C1="3.7"/>
</Locator>
You may have as many Locator sections in your file, but each Locator section may contain only one Parameters line.
Specifying the Export Type
You can export all the data, just a line, or just a rectangular region by using the "<Region Style>" tag.
All Data
To export all the data, set the Region to "Whole":
<Region Style = "Whole">
Line
To export a line of data, set the Region to "Line". For example, use the following to specify a vertical line at x=240.0:
<Region Style = "Line" Vertical="yes" Position="240.0"/>
For a horizontal line, set Vertical to "no". For example, use the following to specify a horizontal line at y=440.0:
<Region Style="Line" Vertical="no" Position="440.0"/>
Rectangular Region
To export a rectangular region of data, set the Region to "Rect". For example,
<Region Style="Rect" Left="10" Right="90" Top="10" Bottom="90"/>