export#
- FieldsCalculator.export(quantity, solution=None, variations=None, output_file=None, intrinsics=None, phase=None, sample_points=None, export_with_sample_points=True, reference_coordinate_system='Global', export_in_si_system=True, export_field_in_reference=True, grid_type=None, grid_center=None, grid_start=None, grid_stop=None, grid_step=None, is_vector=False, assignment='AllObjects', objects_type='Vol')#
Export the field quantity at the top of the register to a file, mapping it to a grid of points.
Two options are available for defining the grid points on which to export: - Input grid points from file : Maps the field quantity to a customized grid of points.
Before using this command, you must create a file containing the points and units.
- Calculate grid pointsMaps the field quantity to a three-dimensional Cartesian grid.
You specify the dimensions and spacing of the grid in the x, y, and z directions, with units. The initial units are taken from the model. Other grid options are: Cylindrical, in which case rho, phi and z directions must be specified, or Spherical, in which case r, theta and phi directions must be specified.
If you want to adopt the first option you must provide either the file containing the grid of points or a list of sample points in
sample_points
. In the latter case, a new file is created in the working directory called “temp_points.pts” that will be automatically written with the data points provided and consequently imported. If you want to adopt the second option you must provide the grid type (Cartesian, Cylindrical or Spherical). Ifgrid_center
,grid_start
orgrid_stop
are not provided the default values are used.- Parameters:
- quantity
str
Name of the quantity to export.
- solution
str
,optional
Name of the solution in the format
"solution : sweep"
. The default isNone
.- variations
dict
,optional
Dictionary of all variation variables with their values. The default is
None
.- output_file
str
,optional
Full path and name to save the file to. The default is
None
, in which case the file is exported to the working directory.- assignment
str
,optional
List of objects to export. The default is
"AllObjects"
.- objects_type
str
,optional
Type of objects to export. The default is
"Vol"
. Options are"Surf"
for surface and"Vol"
for volume.- intrinsics
dict
,str
,optional
Intrinsic variables required to compute the field before the export. These are typically: frequency, time and phase. It can be provided either as a dictionary or as a string. If it is a dictionary, keys depend on the solution type and can be expressed in lower or camel case as: -
"Freq"
or"Frequency"
-"Time"
-"Phase"
If it is a string, it can either be"Freq"
or"Time"
depending on the solution type. The default isNone
in which case the intrinsics value is automatically computed based on the setup.- phase
str
,optional
Field phase. The default is
None
. This argument is deprecated. Please useintrinsics
and provide the phase as a dictionary key instead.- sample_points
str
,list
Name of the file with sample points or list of the sample points.
- export_with_sample_pointsbool,
optional
Whether to include the sample points in the file to export. The default is
True
.- reference_coordinate_system
str
,optional
Reference coordinate system in the file to export. The default is
"Global"
.- export_in_si_systembool,
optional
Whether the provided sample points are defined in the SI system or model units. The default is
True
.- export_field_in_referencebool,
optional
Whether to export the field in reference coordinate system. The default is
True
.- grid_type
str
Type of the grid to export. The options are: -
Cartesian
-Cylindrical
-Spherical
- grid_center
list
,optional
The
[x, y, z]
coordinates for the center of the grid. The default is[0, 0, 0]
. This parameter is disabled ifgridtype= "Cartesian"
.- grid_start
list
,optional
The
[x, y, z]
coordinates for the starting point of the grid. The default is[0, 0, 0]
.- grid_stop
list
,optional
The
[x, y, z]
coordinates for the stopping point of the grid. The default is[0, 0, 0]
.- grid_step
list
,optional
The
[x, y, z]
coordinates for the step size of the grid. The default is[0, 0, 0]
.- is_vectorbool,
optional
Whether the quantity is a vector. The default is
False
.- Returns
- ——-
- bool or str
The path to the exported field file when successful,
False
when failed.
- quantity