pygmc.devices package
Submodules
pygmc.devices.device module
pygmc.devices.device_rfc1201 module
- class pygmc.devices.device_rfc1201.DeviceRFC1201(connection)[source]
Bases:
BaseDevice- 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_temp() float[source]
Get device temperature in Celsius.
- Returns:
Device temperature is celsius.
- Return type:
float
- 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) 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
- 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.
- reboot() None[source]
Reboot device.
Note: Different from power off-on as it changes display to default.
- send_key(key_number) None[source]
Send key press signal to device.
Note the power button acts as menu clicks and does not power on/off.
- Parameters:
key_number (int) – Each number represents a key-press. key=0 -> S1 (back button) key=1 -> S2 (down button) key=2 -> S3 (up button) key=3 -> S4 (power button)
- set_datetime(datetime_=None) None[source]
Set datetime on device.
- Parameters:
datetime (None | datetime.datetime) – Datetime to set. Default=None uses current time on computer i.e. datetime.datetime.now()
- Raises:
ValueError – Year value earlier than 2000.
RuntimeError – Unexpected response from device.
pygmc.devices.device_rfc1801 module
- class pygmc.devices.device_rfc1801.DeviceRFC1801(connection)[source]
Bases:
BaseDevice- 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_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.
- reboot() None[source]
Reboot device.
Note: Different from power off-on as it changes display to default.
- send_key(key_number) None[source]
Send key press signal to device.
Note the power button acts as menu clicks and does not power on/off.
- Parameters:
key_number (int) – Each number represents a key-press. key=0 -> S1 (back button) key=1 -> S2 (down button) key=2 -> S3 (up button) key=3 -> S4 (power button)
- set_datetime(datetime_=None) None[source]
Set datetime on device.
- Parameters:
datetime (None | datetime.datetime) – Datetime to set. Default=None uses current time on computer i.e. datetime.datetime.now()
- Raises:
ValueError – Year value earlier than 2000.
RuntimeError – Unexpected response from device.