add_subrange#
- SweepHFSS.add_subrange(rangetype, start, end=None, count=None, unit='GHz', save_single_fields=False, clear=False)[source]#
Add a range to the sweep.
- Parameters:
- rangetype
str
Type of the range. Options are
"LinearCount"
,"LinearStep"
,"LogScale"
, and"SinglePoints"
.- start
float
Starting frequency.
- end
float
,optional
Stopping frequency. The default value is
None
. A value is required forrangetype="LinearCount"|"LinearStep"|"LogScale"
.- count
int
orfloat
,optional
Frequency count or frequency step. The default is
None
. A value is required forrangetype="LinearCount"|"LinearStep"|"LogScale"
.- unit
str
,optional
Unit of the frequency. For example,
"MHz
or"GHz"
. The default is"GHz"
.- save_single_fieldsbool,
optional
Whether to save the fields of the single point. The default is
False
. This parameter is sed only forrangetype="SinglePoints"
.- clearbool,
optional
Whether to suppress all other subranges except the current one under creation. The default value is
False
.
- rangetype
- Returns:
- bool
True
when successful,False
when failed.
Examples
Create a setup in an HFSS design and add multiple sweep ranges.
>>> setup = hfss.create_setup(setupname="MySetup") >>> sweep = setup.add_sweep() >>> sweep.change_type("Interpolating") >>> sweep.change_range("LinearStep", 1.1, 2.1, 0.4, "GHz") >>> sweep.add_subrange("LinearCount", 1, 1.5, 5, "MHz") >>> sweep.add_subrange("LogScale", 1, 3, 10, "GHz")