pygmc.devices package

Submodules

pygmc.devices.device module

class pygmc.devices.device.BaseDevice(connection)[source]

Bases: object

get_serial() str[source]
get_version() str[source]

Get version of device. Has a sleep wait to read as spec RFC1801 doesn’t specify end char nor byte size.

Returns:

Device version

Return type:

str

pygmc.devices.device_rfc1201 module

class pygmc.devices.device_rfc1201.DeviceRFC1201(connection)[source]

Bases: BaseDevice

get_config() dict[source]

Get device config

Return type:

dict

get_cpm() int[source]

Get CPM counts-per-minute data

Returns:

Counts per minute

Return type:

int

get_datetime() datetime[source]

Get device datetime

Returns:

Device datetime

Return type:

datetime.datetime

get_gyro() Tuple[int, int, int][source]

Get gyroscope data. No units specified in spec RFC1801 nor RFC1201 :(

Returns:

(X, Y, Z) gyroscope data

Return type:

Tuple[int, int, int]

get_usv_h() float[source]

Get µSv/h Uses device calibration config.

Returns:

µSv/h

Return type:

float

get_voltage() float[source]

Get device voltage

Returns:

Device voltage in volts

Return type:

float

heartbeat_live(count=60) int[source]

Get live CPS data, as a generator. i.e. yield (return) CPS as available.

Parameters:

count (int, optional) – How many CPS counts to return (default=60). Theoretically, 1 count = 1 second. Wall-clock time can be a bit higher or lower.

Returns:

CPS - Counts-Per-Second

Return type:

int

Yields:

Iterator[int] – CPS

heartbeat_off() None[source]

Turn heartbeat OFF. Stop writing data to buffer every second.

heartbeat_on() None[source]

Turn heartbeat ON. CPS data is automatically written to the buffer every second.

pygmc.devices.device_rfc1801 module

class pygmc.devices.device_rfc1801.DeviceRFC1801(connection)[source]

Bases: BaseDevice

get_config() dict[source]

Get device config

Return type:

dict

get_cpm() int[source]

Get CPM counts-per-minute data Specs don’t provide how CPM is computed nor if both high/low tubes are used.

Returns:

Counts per minute (GMC has 2 tubes, assumed cpm accounts for both?)

Return type:

int

get_cpmh() int[source]

Get CPM of the high dose tube Only GMC-500+ supported (spec RFC1801)

Returns:

Counts per minute on high dose tube (GMC has 2 tubes)

Return type:

int

get_cpml() int[source]

Get CPM of the low dose tube Only GMC-500+ supported (spec RFC1801)

Returns:

Counts per minute on low dose tube (GMC has 2 tubes)

Return type:

int

get_cps() int[source]

Get CPS counts-per-second

Returns:

Counts per second

Return type:

int

get_datetime() datetime[source]

Get device datetime

Returns:

Device datetime

Return type:

datetime.datetime

get_gyro() Tuple[int, int, int][source]

Get gyroscope data. No units specified in spec RFC1801 nor RFC1201 :(

Returns:

(X, Y, Z) gyroscope data

Return type:

Tuple[int, int, int]

get_max_cps() int[source]

Get the maximum counts-per-second since the device POWERED ON

Returns:

Max counts per second observed

Return type:

int

get_usv_h() float[source]

Get µSv/h Uses device calibration config.

Returns:

µSv/h

Return type:

float

get_voltage() float[source]

Get device voltage

Returns:

Device voltage in volts

Return type:

float

Notes

Device only has resolution to tenth of a volt despite example in spec RFC1801.

heartbeat_live(count=60) Generator[int, None, None][source]

Get live CPS data, as a generator. i.e. yield (return) CPS as available.

Parameters:

count (int, optional) – How many CPS counts to return (default=60). Theoretically, 1 count = 1 second. Wall-clock time can be a bit higher or lower.

Yields:

int – CPS - Counts-Per-Second int

heartbeat_live_print(count=60) None[source]

Print live CPS data.

Parameters:

count (int, optional) – How many CPS counts to return (default=60). Theoretically, 1 count = 1 second. Wall-clock time can be a bit higher or lower.

heartbeat_off() None[source]

Turn heartbeat OFF. Stop writing data to buffer every second.

heartbeat_on() None[source]

Turn heartbeat ON. CPS data is automatically written to the buffer every second.

Module contents

pygmc.devices.auto_get_device(connection)[source]

Auto get device class

Parameters:

connection