ChpResults
Provides methods to fetch and read the Chp measurement results.
- class nirfmxspecan.chp_results.ChpResults(signal_obj)[source]
Bases:
objectProvides methods to fetch and read the Chp measurement results.
- fetch_carrier_measurement(selector_string, timeout)[source]
Returns the averaged channel power measurements.
Use
“carrier<n>”
as the selector string to read results from this method.
- Parameters:
selector_string (string) –
This parameter specifies a Selector String comprising of result name, and carrier number.
Example:
”carrier0”
”result::r1/carrier0”
You can use the
build_carrier_string()method to build the selector string.timeout (float) – This parameter specifies the timeout, in seconds, for fetching the specified measurement. Set this value to an appropriate time, longer than expected for fetching the measurement. A value of -1 specifies that the method waits until the measurement is complete. The default value is 10.
- Returns:
- absolute_power (float):
This parameter returns the averaged channel power, in dBm, measured in the specified integration bandwidth.
- psd (float):
This parameter returns the power spectral density of the channel, in dBm/Hz.
- relative_power (float):
This parameter returns the carrier power, in dB, measured relative to the total carrier power.
- error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
- Return type:
Tuple (absolute_power, psd, relative_power, error_code)
- fetch_spectrum(selector_string, timeout, spectrum)[source]
Fetches the spectrum used for channel power (CHP) measurement.
- Parameters:
selector_string (string) –
This parameter specifies a Selector String comprising of result name.
Example:
””
”result::r1”
You can use the
build_result_string()method to build the selector string.timeout (float) – This parameter specifies the timeout, in seconds, for fetching the specified measurement. Set this value to an appropriate time, longer than expected for fetching the measurement. A value of -1 specifies that the method waits until the measurement is complete. The default value is 10.
spectrum (numpy.float32) – This parameter returns the array of averaged powers measured at each frequency bin. This value is expressed in dBm.
- Returns:
- x0 (float):
This parameter returns the start frequency. This value is expressed in Hz.
- dx (float):
This parameter returns the frequency bin spacing. This value is expressed in Hz.
- error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
- Return type:
Tuple (x0, dx, error_code)
- fetch_total_carrier_power(selector_string, timeout)[source]
Returns the total integrated carrier power.
- Parameters:
selector_string (string) –
This parameter specifies a Selector String comprising of result name.
Example:
””
”result::r1”
You can use the
build_result_string()method to build the selector string.timeout (float) – This parameter specifies the timeout, in seconds, for fetching the specified measurement. Set this value to an appropriate time, longer than expected for fetching the measurement. A value of -1 specifies that the method waits until the measurement is complete. The default value is 10.
- Returns:
- total_carrier_power (float):
This parameter returns the total integrated power of all carriers, in dBm.
- error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
- Return type:
Tuple (total_carrier_power, error_code)
- get_carrier_absolute_power(selector_string)[source]
Gets the carrier power measured in the integration bandwidth that you specify in the
CARRIER_INTEGRATION_BANDWIDTHattribute. This value is expressed in dBm.Use “carrier<n>” as the Selector String to read this result.
- Parameters:
selector_string (string) – Pass an empty string.
- Returns:
- attr_val (float):
Returns the carrier power measured in the integration bandwidth that you specify in the
CARRIER_INTEGRATION_BANDWIDTHattribute. This value is expressed in dBm.- error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
- Return type:
Tuple (attr_val, error_code)
- get_carrier_frequency(selector_string)[source]
Gets the center frequency of the carrier relative to the
CENTER_FREQUENCYattribute. This value is expressed in Hz.Use “carrier<n>” as the Selector String to read this result.
- Parameters:
selector_string (string) – Pass an empty string.
- Returns:
- attr_val (float):
Returns the center frequency of the carrier relative to the
CENTER_FREQUENCYattribute. This value is expressed in Hz.- error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
- Return type:
Tuple (attr_val, error_code)
- get_carrier_integration_bandwidth(selector_string)[source]
Gets the frequency range over which the measurement integrates the carrier power. This value is expressed in Hz.
Use “carrier<n>” as the Selector String to read this result.
- Parameters:
selector_string (string) – Pass an empty string.
- Returns:
- attr_val (float):
Returns the frequency range over which the measurement integrates the carrier power. This value is expressed in Hz.
- error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
- Return type:
Tuple (attr_val, error_code)
- get_carrier_psd(selector_string)[source]
Gets the power spectral density of the channel. This value is expressed in dBm/Hz.
Use “carrier<n>” as the Selector String to read this result.
- Parameters:
selector_string (string) – Pass an empty string.
- Returns:
- attr_val (float):
Returns the power spectral density of the channel. This value is expressed in dBm/Hz.
- error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
- Return type:
Tuple (attr_val, error_code)
- get_carrier_relative_power(selector_string)[source]
Gets the carrier power measured relative to the total carrier power of all carriers. This value is expressed in dB.
Use “carrier<n>” as the Selector String to read this result.
- Parameters:
selector_string (string) – Pass an empty string.
- Returns:
- attr_val (float):
Returns the carrier power measured relative to the total carrier power of all carriers. This value is expressed in dB.
- error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
- Return type:
Tuple (attr_val, error_code)
- get_frequency_resolution(selector_string)[source]
Gets the frequency bin spacing of the spectrum acquired by the measurement. This value is expressed in Hz.
You do not need to use a selector string to read this result for default signal and result instance. Refer to the Selector String topic for information about the string syntax for named signals and results.
- Parameters:
selector_string (string) – Pass an empty string.
- Returns:
- attr_val (float):
Returns the frequency bin spacing of the spectrum acquired by the measurement. This value is expressed in Hz.
- error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
- Return type:
Tuple (attr_val, error_code)
- get_total_carrier_power(selector_string)[source]
Gets the total integrated carrier power of all carriers, in dBm.
You do not need to use a selector string to read this result for default signal and result instance. Refer to the Selector String topic for information about the string syntax for named signals and results.
- Parameters:
selector_string (string) – Pass an empty string.
- Returns:
- attr_val (float):
Returns the total integrated carrier power of all carriers, in dBm.
- error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
- Return type:
Tuple (attr_val, error_code)
- read(selector_string, timeout)[source]
Configures hardware for acquisition, performs measurement on acquired data, and returns the channel power (CHP) measurement results.
- Parameters:
selector_string (string) – Pass an empty string. The signal name that is passed when creating the signal configuration is used.
timeout (float) – This parameter specifies the timeout, in seconds, for fetching the specified measurement. Set this value to an appropriate time, longer than expected for fetching the measurement. The default value is 10.
- Returns:
- absolute_power (float):
This parameter returns the averaged CHP, in dBm, measured in the specified integration bandwidth.
- psd (float):
This parameter returns the power spectral density of the channel, in dBm/Hz.
- error_code (int):
Returns the status code of this method. The status code either indicates success or describes a warning condition.
- Return type:
Tuple (absolute_power, psd, error_code)