pyopticon.majumdar_lab_widgets.picarro_crd_widget module

class pyopticon.majumdar_lab_widgets.picarro_crd_widget.PicarroCRDWidget(parent_dashboard, name, nickname, default_serial_port)

Bases: GenericWidget

Widget for a Picarro GG201-i isotopic analyzer that measures 0-30 ppm CH4, 200-2000+ ppm CO2, and 0-100% relative humidity.

Refer to the Picarro manual to configure one of its extra serial ports for data logging to an external device. Two modes are possible. In one, the Picarro listens for a query and replies with its latest measurements. In the other, the Picarro sends its latest measurements every second. We chose to use the ‘send measurements every second’ option. This means that the Picarro widget only listens for measurements, and doesn’t ever send any queries via the serial line. There wasn’t a super strong reason for choosing one over the other, except for slightly more resilience to the Picarro ‘lagging’ for a few seconds when it receives a methane concentration above its 30 ppm ‘limit’.

The Picarro needs to be set to send (in this order) the CH4 concentration in ppm, the water concentration in volume percent, and the CO2 concentration in ppm. This is done using the Picarro’s own monitor and interface, as described in its manual – contact the manufacturer if your manual doesn’t tell you how to do this.

Parameters:
  • parent_dashboard (richardview.dashboard.RichardViewDashboard) – The dashboard object to which this device will be added

  • name (str) – The name that the widget will be labeled with, and under which its data will be logged, e.g. “Methane Mass Flow Controller”

  • nickname (str) – A shortened nickname that can be used to identify the widget in automation scripts, e.g. “CH4 MFC”

  • default_serial_port (str) – The name of the default selected serial port, e.g. ‘COM9’

on_failed_serial_open()

If serial opened unsuccessfully, set readouts to ‘No Reading’

on_update()

Parse the latest message from the Picarro and update the display.

Note that sometimes we get unlucky with the timing and a valid Picarro message gets chopped off halfway through and fails to parse. So occasionally we get a ‘read error’ when the instrument is behaving just fine. This is easy to fix in data post-processing, but we might also consider fixing it by switching to a query-response setup.

on_serial_close()

When serial is closed, set all readouts to ‘None’.