rminstr.instruments.KS_PNA

Classes

SignalGenerator

Signal geneator implementation of KS_PNA.

VNA

Implementation the ZVA67 as a VNA.

Package Contents

class rminstr.instruments.KS_PNA.SignalGenerator(visa_address: str, resource_manager: pyvisa.ResourceManager = None, log_path: str = None)

Bases: rminstr.instruments.communications.Instrument, rminstr.instruments.measurement_functionalities.ABC_SignalGenerator

Signal geneator implementation of KS_PNA.

Attributes

visa_resourcevisa.Resource

Pyvisa resource for the instrument.

Initialize KS_PNA as a signal generator.

Parameters:
visa_addressstr

Visa address of instrument.

resource_managervisa.ResourceManager, optional

Pyvisa resource manager for opening visa resources. The Default is None.

log_pathstr, optional

If provided, will log at the specified path. The default is None.

Returns:
None.
default_settings
initial_setup(display: bool = True, port: int = 1, **kwargs)

Initialize instrument.

Parameters:
displaybool, optional

True, turns display on. False turns display off to improve performance.

other_commandslist, optional

list of strings, commands to be sent directly to machine. The default is None.

Returns:
None.
setup(f_GHz: float = None, dBm: float = None, source_on: bool = None, port: int = 1, **kwargs)

Adjust settings on the machine.

Parameters:
f_GHzfloat, optional

Frequency setting in GHz. The default is None.

dBmfloat, optional,

Power to set the source at in dBm. The default is None.

source_onbool, optional

Turns source on when True, off when False. The default is None.

portint, optional

Determines which port is used for the commands. Default is 1

other_commandslist, optional

List of other command not covered by keyword arguments. Written directly to instrument. The default is None.

Returns:
None.
query_state() str

Check the state.

Returns:
str

Current state of the instrument.

raise_errors()

Query the status of the instrument. If there are errors, raise them as Python errors.

Returns:
None.
get_errors()

Query the status of the instrument. If there are errors, returns the error message.

Returns:
str

Instruments error message

get_frequency()

Get frequency.

class rminstr.instruments.KS_PNA.VNA(VNA_GPIB: str, timeout=5000, resetParams=True, resource_manager: pyvisa.ResourceManager = None, log_path: str = None)

Bases: rminstr.instruments.communications.Instrument, rminstr.instruments.measurement_functionalities.ABC_VNA

Implementation the ZVA67 as a VNA.

Attributes

IDstr

ID string from the VNA.

Initialize a VNA object

Parameters:
VNA_GPIBstr

Visa address of instrument.

timeoutint

When to time out the resource. The default is 5000.

resetParamsbool

Whether or not to reset the parameters. The default is True.

resource_managervisa.ResourceManager, optional

Pyvisa resource manager for opening visa resources. The default is None.

log_pathstr, optional

If provided, will log at the specified path. The default is None.

Returns:
None.
ID
default_setup_settings
initial_setup(**kwargs)

Put instrument into safe and known initial state.

Parameters:
**kwargs

Optional keyword arguments. These will be sent to the setup function.

Returns:
None.
arm()

Arm the VNA so that it will measure a trace when triggered.

Returns:
None.
trigger()

Start a measurement.

Only works if the trigger source is set to MAN (manual). Otherwise, this method does nothing.

Returns:
None.
fetch_data() tuple

Fetch measurement data.

Returns:
dict

keys ‘Frequency (GHz)’, <param1>, <param2>, etc. Frequency is a 1-d array of floats. Each param is a 1d array of complex data. Params keys are the parameters passed in setup (e.g. a11, b11, etc…).

setup(flist_GHz: numpy.ndarray[float] = None, fstart_GHz: float = None, fstop_GHz: float = None, npoints: float = None, sweep_type: str = None, params: list[str] = None, power_dBm: float = None, IFBW: bool = None)

Change the settings of the VNA.

Parameters:
flist_GHznp.ndarray[float], optional

List of frequencies to sweep over. The default is None.

fstart_GHzfloat, optional

Start frequency for a sweep. fstart, fstop, npoints, and sweep type must be provided all at once. The default is None.

fstop_GHzfloat, optional

Stop frequency. fstart, fstop, npoints, and sweep type must be provided all at onceThe default is None.

npointsfloat, optional

Number of points. fstart, fstop, npoints, and sweep type must be provided all at once. The default is None.

sweep_typestr, {lin, log}

Linear or logarithmic sweep. fstart, fstop, npoints, and sweep type must be provided all at once. The default is None.

paramslist[str], optional

Parameters to measure (a11, b12, S11, etc). The default is None. Firs number is source port, second number is recieving port.

power_dBmfloat, optional

Power to source. The default is None.

IFBWbool, optional

Intermediate frequency bandwidth in Hz. The default is None.

Returns:
None.
Raises:
ValueError

DESCRIPTION.

query_state() str

Checks the state of the machine according to state model.

Returns:
statestr

Current state of the instrument.

do_after_group_trigger()

Run post-trigger commands after an external trigger event.

Returns:
None.
raise_errors()

Query the status of the instrument.

If there are errors, raise them as Python errors.

Returns:
None.
Raises:
InstrumentError

Raises an instrument error when the instrument claims it has errors or is in an error state.

get_errors()

Query the status of the instrument.

Returns:
str

Error message