add_subrange#
- SweepHFSS.add_subrange(range_type, start, end=None, count=None, unit='GHz', save_single_fields=False, clear=False)#
Add a range to the sweep.
- Parameters:
- range_type
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 forrange_type="LinearCount"|"LinearStep"|"LogScale"
.- count
int
orfloat
,optional
Frequency count or frequency step. The default is
None
. A value is required forrange_type="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 used only forrange_type="SinglePoints"
.- clearbool,
optional
Whether to suppress all other subranges except the current one under creation. The default value is
False
.
- range_type
- 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(name="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")