msl.equipment.resources.vaisala.ptu300 package

Vaisala PTU300 series barometer which reads temperature, relative humidity, and pressure. Supports models PTU300, PTU301, PTU303, PTU307 and PTU30T.

class msl.equipment.resources.vaisala.ptu300.PTU300(record: EquipmentRecord)[source]

Bases: ConnectionSerial

Vaisala Barometer PTU300 series (models PTU300, PTU301, PTU303, PTU307 and PTU30T). The device manual is available here.

Note

Ensure the device is in STOP or SEND mode before initiating a connection to a PC.

The default settings for the RS232 connection are:

  • Baud rate = 4800

  • Data bits = 7

  • Stop bits = 1

  • Parity = EVEN

  • Flow control = None

Do not instantiate this class directly. Use the connect() method to connect to the equipment.

Parameters:

record – A record from an Equipment-Register Database.

property device_info: dict[str, str]

Return a dictionary of information about the Vaisala device.

set_units(desired_units: dict[str, str]) None[source]

Set units of specified quantities. Note that only one pressure unit is used at a time for the PTU300 series.

Parameters:

desired_units

Dictionary of quantities (as keys) and their unit (their value) as specified in the instrument manual on pages 22 and 106.

These may include the following (available options depend on the barometer components):

  • Pressure quantities: P, P3h, P1, P2, QNH, QFE, HCP, …

  • Pressure units: hPa, psi, inHg, torr, bar, mbar, mmHg, kPa, Pa, mmH2O, inH2O

  • Temperature quantity: T

  • Temperature units: ‘C, ‘F (C and F are also supported but are returned as ‘C or ‘F)

  • Humidity quantity: RH

  • Humidity unit: %RH

property units: dict[str, str]

A dictionary of measured quantities and their associated units as set on the device by set_units().

set_format(fmt: str) None[source]

Set the format of data output to follow the pattern in the format string. For example, in the format string 4.3 P " " 3.3 T " " 3.3 RH " " SN " " #r #n, x.y is the number of digits and decimal places of the values; P, T, RH, and SN are placeholders for pressure, temperature, relative humidity, and serial number values; and “ “, #r, and #n represent a string constant, carriage-return, and line feed respectively. Additional allowed modifiers include ERR for error flags, U5 for unit field and (optional) length, TIME for time as [hh:mm:ss], and DATE for date as [yyyy-mm-dd]. For more options, refer to the manual.

Parameters:

fmt – string representing desired output format

get_format() str[source]

Return the currently active formatter string. The hash symbol “#” is used to set the format, but then appears as a backslash “\” on the device.

get_reading_str() str[source]

Output the reading once. The returned string follows the format set by set_format().

check_for_errors() None[source]

Raise an error if present.