nsrt_mk3_dev.nsrt_mk3_dev.NsrtMk3Dev

class nsrt_mk3_dev.nsrt_mk3_dev.NsrtMk3Dev(port: str)

Bases: object

This class provides access to all the NSRT mk3 Dev API as published in the datasheet

__init__(port: str)

Initialise the NSRT mk3 Dev class

Args:

port: Virtual commport that was assigned to the NSRT by the OS (eg: COM12, /dev/ttyACM0)

Methods

__init__(port)

Initialise the NSRT mk3 Dev class

read_dob()

This command reads the date of birth

read_doc()

This command reads the date of calibration

read_fs()

This command reads the current sampling frequency

read_fw_rev()

This command reads the fw revision

read_leq()

This command retrieves the current running LEQ and starts the integration of a new LEQ.

read_level()

This command retrieves the current running level in dB.

read_model()

This command reads the model

read_sn()

This command reads the serial number

read_tau()

This command reads the current time constant

read_temperature()

This command retrieves the temperature

read_user_id()

This command reads the user id

read_weighting()

This command returns the weighting curve that is currently selected

write_fs(frequency)

This command sets the sampling frequency

write_tau(tau)

This command sets the time constant

write_user_id(user_id)

This command sets the user id

write_weighting(weighting)

This command selects the weighting curve

Attributes

ACK

SECONDS_FROM_1904_TO_1970

class Weighting(value)

Bases: enum.Enum

Enumeration class for the weighting selection

DB_A = 1

DB_A

DB_C = 0

DB_C

DB_Z = 2

DB_Z

read_dob()datetime.datetime

This command reads the date of birth

Returns:

UTC datetime object representing the manufacturing date

read_doc()datetime.datetime

This command reads the date of calibration

Returns:

UTC datetime object representing the calibration date

read_fs()int

This command reads the current sampling frequency

Returns:

Sampling frequency in Hz

read_fw_rev()

This command reads the fw revision

Returns:

ASCII string representing the Firmware revision

read_leq()float

This command retrieves the current running LEQ and starts the integration of a new LEQ. This way the next read_leq command returns the LEQ calculated between the present time and the retrieval of the previous LEQ.

Returns:

level in dB

read_level()float

This command retrieves the current running level in dB. That is an exponentially averaged level, using the time constant and weighting function set for the instrument. That is not an LEQ.

Returns:

level in dB

read_model()

This command reads the model

Returns:

ASCII string representing the Model

read_sn()

This command reads the serial number

Returns:

ASCII string representing the serial number of the instrument.

read_tau()float

This command reads the current time constant

Returns:

Float representing the time constant in s.

read_temperature()float

This command retrieves the temperature

Returns:

Float representing the temperature in degC

read_user_id()

This command reads the user id

Returns:

ASCII string representing the UserID, as defined by the user.

read_weighting()nsrt_mk3_dev.nsrt_mk3_dev.NsrtMk3Dev.Weighting

This command returns the weighting curve that is currently selected

Returns:

Weighting curve: DB_C / DB_A / DB_Z

write_fs(frequency: int)

This command sets the sampling frequency

Args:

Sampling frequency in Hz

Returns:

True if succeeded otherwise False

Raises:

ValueError: if the given frequency is invalid

write_tau(tau: float)

This command sets the time constant

Args:

tau: Float representing the time constant in s.

Returns:

True if succeeded otherwise False

write_user_id(user_id)

This command sets the user id

Returns:

True if succeeded otherwise False

Raises:

ValueError: if the given string is longer than 31 characters

write_weighting(weighting: nsrt_mk3_dev.nsrt_mk3_dev.NsrtMk3Dev.Weighting)bool

This command selects the weighting curve

Args:

Weighting curve: DB_C / DB_A / DB_Z

Returns:

True if succeeded otherwise False