Writes a Lumerical dataset to a Sentaurus TDR file. This command is only available on Linux.
| Syntax | Description |
|---|---|
| tdrwritedataset(“file_name”, dataset, options); |
Writes a rectilinear dataset to a TDR file with the following parameters:
This function does not return any data. |
Note: Take the following precautions with the units within the rectilinear dataset to write to a TDR file:
- This script command does not account for the physical nature of the input dataset. To set the correct units for attributes in the dataset, you must use the X_unit field in the options struct.
- Coordinates x,y,and z in the rectilinear dataset are always assumed to be provided in the units of m and are converted to microns prior to writing the dataset to a TDR file.
The fields of the options struct contain both required and optional arguments for this script command and are in the table below.
| Syntax | Description |
|---|---|
| region_name | Required. Specifies the name of the region to which the dataset applies. It can be arbitrary name. For example, to save the optical generation rate from the FDTD analysis object the region name can be set the same as the analysis object name. |
| X_unit | Optional. Specifies the unit of the dataset attributes, specified as a string. X is the name of the dataset attribute. Supports compound units with * and ^. For denominators, use negative exponents. If this quantity is not provided for any attribute, that attribute is interpreted as unitless. |
| X_rename | Rename the dataset attribute with the name X to a different name for the TDR file. This option facilitates cases where Sentaurus expects a specific name for its data, such as OpticalGeneration. |
| source_cs | Optional. Specifies the coordinate system for the Lumerical dataset at input. The allowed values are found in tdrinfo. The default is cs_3d_z_y_x_neg in 3D or cs_2d_y_x in 2D. See tdraddregion for further information. |
| destination_cs | Optional. Specifies the coordinate system to write to in the TDR file. The allowed values are found in tdrinfo. The default is cs_3d_sprocess (i.e. cs_3d_x_y_z) in 3D or cs_2d_sprocess (i.e. cs_2d_x_y) in 2D. See tdraddregion for further information. |
| memory_layout | Optional. Specifies the memory layout of the destination, this controls how the dataset is stored in memory. The available options are “x-fastest” and “z-fastest”, meaning which coordinate changes the fastest over consecutive memory locations. Default is x-fastest |
Example
# Write optical generation from a completed simulation to a TDR file
# Make sure fsp file with results is loaded.
G = getresult("CW_generation_blue","G");
opt = {"G_unit" : "cm^-3*s^-1",
"G_rename" : "OpticalGeneration",
"region_name" : "CW_generation_blue", #required
"source_cs" : "cs_3d_z_y_x_neg",
"destination_cs" : "cs_3d_x_y_z",
"memory_layout" : "x-fastest"};
tdrwritedataset("CW_generation_blue.tdr",G,opt);
Wrapper functions
The Knowledge Base article Synopsys Sentaurus™ interoperability – import from and export to TDR files contains a set of wrapper functions and examples which is a more user-friendly method of using this built-in script command.
See Also
Synopsys Sentaurus™ interoperability – import from and export to TDR files, tdrinfo, tdraddregion, tdrimportdataset