Devices
- class pygmc.devices.GMC300(port, baudrate=57600, timeout=5, connection=None)[source]
Bases:
DeviceRFC1201GMC-300
- get_config() dict
Get device config.
- Return type:
dict
- get_connection_details() dict
Get connection details from pyserial.
- Return type:
dict
- get_cpm() int
Get CPM counts-per-minute data.
- Returns:
Counts per minute
- Return type:
int
- get_datetime() datetime
Get device datetime.
- Returns:
Device datetime
- Return type:
datetime.datetime
- get_gyro() Tuple[int, int, int]
Get gyroscope data.
No units specified in spec RFC1801 nor RFC1201 :(
- Returns:
(X, Y, Z) gyroscope data
- Return type:
Tuple[int, int, int]
- get_history_data() list
Get tidy device memory history in a list of tuples.
First row is column names. Columns: “datetime”, “count”, “unit”, “mode”, “reference_datetime”, “notes”
- Returns:
List of tuples, first row is column names.
- Return type:
list
- get_raw_history() bytes
Get device history data.
Stops reading when read entire page contains empty data. Full 1 MiB read takes ~5 minutes on the slower 57,600 baudrate
- Returns:
Raw history data.
- Return type:
bytes
- get_serial() str
Get serial.
- get_temp() float
Get device temperature in Celsius.
Notes
Seems a bit temperamental. GMC-300S initially returned 0, then 86, then stabilized to 20.7 (which is about the room temperature when measured). i.e. call the method a few times until it stabilizes.
- Returns:
Device temperature is celsius.
- Return type:
float
- get_usv_h(cpm=None) float
Get µSv/h as is displayed by the device. See notes below.
- cpm: int | None
Counts per minute to be converted to µSv/h. Default=None polls device for live cpm to convert. If cpm is provided, user input is used instead.
Notes
Uses device calibration config. GQ does not have an official source documentation for device configuration nor cpm-to-µSv/h formula. A revision firmware update by GQ may change the config bytes and is often not announced. Treat the output as a best effort convenience.
- Returns:
µSv/h
- Return type:
float
- get_version() str
Get version of device.
Has a sleep wait to read as spec RFC1801 doesn’t specify end char nor byte size. i.e. SLOW.
- Returns:
Device version
- Return type:
str
- get_voltage() float
Get device voltage.
- Returns:
Device voltage in volts
- Return type:
float
- heartbeat_live(count=60) Generator[int, None, None]
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, 1count = 1second. Wall-clock time can be a bit higher or lower.
- Yields:
int – CPS
- heartbeat_live_print(count=60) None
Print live CPS data.
- Parameters:
count (int, optional) – How many CPS counts to return (default=60). Theoretically, 1count = 1second. Wall-clock time can be a bit higher or lower.
- power_off() None
Power OFF device.
- power_on() None
Power ON device.
- reboot() None
Reboot device.
Note: Different from power off-on as it changes display to default.
- save_history_csv(file_path: str) None
Save device history as a CSV file.
- Parameters:
file_path (str) – Path to save.
- save_history_raw(file_path) None
Save raw device history to file.
- Parameters:
file_path (str) – Path to save.
- send_key(key_number) None
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
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.
- class pygmc.devices.GMC300S(port, baudrate=57600, timeout=5, connection=None)[source]
Bases:
DeviceRFC1201GMC-300S
- get_config() dict
Get device config.
- Return type:
dict
- get_connection_details() dict
Get connection details from pyserial.
- Return type:
dict
- get_cpm() int
Get CPM counts-per-minute data.
- Returns:
Counts per minute
- Return type:
int
- get_datetime() datetime
Get device datetime.
- Returns:
Device datetime
- Return type:
datetime.datetime
- get_gyro() Tuple[int, int, int]
Get gyroscope data.
No units specified in spec RFC1801 nor RFC1201 :(
- Returns:
(X, Y, Z) gyroscope data
- Return type:
Tuple[int, int, int]
- get_history_data() list
Get tidy device memory history in a list of tuples.
First row is column names. Columns: “datetime”, “count”, “unit”, “mode”, “reference_datetime”, “notes”
- Returns:
List of tuples, first row is column names.
- Return type:
list
- get_raw_history() bytes
Get device history data.
Stops reading when read entire page contains empty data. Full 1 MiB read takes ~5 minutes on the slower 57,600 baudrate
- Returns:
Raw history data.
- Return type:
bytes
- get_serial() str
Get serial.
- get_temp() float
Get device temperature in Celsius.
Notes
Seems a bit temperamental. GMC-300S initially returned 0, then 86, then stabilized to 20.7 (which is about the room temperature when measured). i.e. call the method a few times until it stabilizes.
- Returns:
Device temperature is celsius.
- Return type:
float
- get_usv_h(cpm=None) float
Get µSv/h as is displayed by the device. See notes below.
- cpm: int | None
Counts per minute to be converted to µSv/h. Default=None polls device for live cpm to convert. If cpm is provided, user input is used instead.
Notes
Uses device calibration config. GQ does not have an official source documentation for device configuration nor cpm-to-µSv/h formula. A revision firmware update by GQ may change the config bytes and is often not announced. Treat the output as a best effort convenience.
- Returns:
µSv/h
- Return type:
float
- get_version() str
Get version of device.
Has a sleep wait to read as spec RFC1801 doesn’t specify end char nor byte size. i.e. SLOW.
- Returns:
Device version
- Return type:
str
- get_voltage() float
Get device voltage.
- Returns:
Device voltage in volts
- Return type:
float
- heartbeat_live(count=60) Generator[int, None, None]
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, 1count = 1second. Wall-clock time can be a bit higher or lower.
- Yields:
int – CPS
- heartbeat_live_print(count=60) None
Print live CPS data.
- Parameters:
count (int, optional) – How many CPS counts to return (default=60). Theoretically, 1count = 1second. Wall-clock time can be a bit higher or lower.
- power_off() None
Power OFF device.
- power_on() None
Power ON device.
- reboot() None
Reboot device.
Note: Different from power off-on as it changes display to default.
- save_history_csv(file_path: str) None
Save device history as a CSV file.
- Parameters:
file_path (str) – Path to save.
- save_history_raw(file_path) None
Save raw device history to file.
- Parameters:
file_path (str) – Path to save.
- send_key(key_number) None
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
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.
- class pygmc.devices.GMC300EPlus(port, baudrate=57600, timeout=5, connection=None)[source]
Bases:
DeviceRFC1201GMC-300E+
- get_config() dict
Get device config.
- Return type:
dict
- get_connection_details() dict
Get connection details from pyserial.
- Return type:
dict
- get_cpm() int
Get CPM counts-per-minute data.
- Returns:
Counts per minute
- Return type:
int
- get_datetime() datetime
Get device datetime.
- Returns:
Device datetime
- Return type:
datetime.datetime
- get_gyro() Tuple[int, int, int]
Get gyroscope data.
No units specified in spec RFC1801 nor RFC1201 :(
- Returns:
(X, Y, Z) gyroscope data
- Return type:
Tuple[int, int, int]
- get_history_data() list
Get tidy device memory history in a list of tuples.
First row is column names. Columns: “datetime”, “count”, “unit”, “mode”, “reference_datetime”, “notes”
- Returns:
List of tuples, first row is column names.
- Return type:
list
- get_raw_history() bytes
Get device history data.
Stops reading when read entire page contains empty data. Full 1 MiB read takes ~5 minutes on the slower 57,600 baudrate
- Returns:
Raw history data.
- Return type:
bytes
- get_serial() str
Get serial.
- get_temp() float
Get device temperature in Celsius.
Notes
Seems a bit temperamental. GMC-300S initially returned 0, then 86, then stabilized to 20.7 (which is about the room temperature when measured). i.e. call the method a few times until it stabilizes.
- Returns:
Device temperature is celsius.
- Return type:
float
- get_usv_h(cpm=None) float
Get µSv/h as is displayed by the device. See notes below.
- cpm: int | None
Counts per minute to be converted to µSv/h. Default=None polls device for live cpm to convert. If cpm is provided, user input is used instead.
Notes
Uses device calibration config. GQ does not have an official source documentation for device configuration nor cpm-to-µSv/h formula. A revision firmware update by GQ may change the config bytes and is often not announced. Treat the output as a best effort convenience.
- Returns:
µSv/h
- Return type:
float
- get_version() str
Get version of device.
Has a sleep wait to read as spec RFC1801 doesn’t specify end char nor byte size. i.e. SLOW.
- Returns:
Device version
- Return type:
str
- get_voltage() float
Get device voltage.
- Returns:
Device voltage in volts
- Return type:
float
- heartbeat_live(count=60) Generator[int, None, None]
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, 1count = 1second. Wall-clock time can be a bit higher or lower.
- Yields:
int – CPS
- heartbeat_live_print(count=60) None
Print live CPS data.
- Parameters:
count (int, optional) – How many CPS counts to return (default=60). Theoretically, 1count = 1second. Wall-clock time can be a bit higher or lower.
- power_off() None
Power OFF device.
- power_on() None
Power ON device.
- reboot() None
Reboot device.
Note: Different from power off-on as it changes display to default.
- save_history_csv(file_path: str) None
Save device history as a CSV file.
- Parameters:
file_path (str) – Path to save.
- save_history_raw(file_path) None
Save raw device history to file.
- Parameters:
file_path (str) – Path to save.
- send_key(key_number) None
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
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.
- class pygmc.devices.GMC320(port, baudrate=115200, timeout=5, connection=None)[source]
Bases:
DeviceRFC1201GMC-320
- get_config() dict
Get device config.
- Return type:
dict
- get_connection_details() dict
Get connection details from pyserial.
- Return type:
dict
- get_cpm() int
Get CPM counts-per-minute data.
- Returns:
Counts per minute
- Return type:
int
- get_datetime() datetime
Get device datetime.
- Returns:
Device datetime
- Return type:
datetime.datetime
- get_gyro() Tuple[int, int, int]
Get gyroscope data.
No units specified in spec RFC1801 nor RFC1201 :(
- Returns:
(X, Y, Z) gyroscope data
- Return type:
Tuple[int, int, int]
- get_history_data() list
Get tidy device memory history in a list of tuples.
First row is column names. Columns: “datetime”, “count”, “unit”, “mode”, “reference_datetime”, “notes”
- Returns:
List of tuples, first row is column names.
- Return type:
list
- get_raw_history() bytes
Get device history data.
Stops reading when read entire page contains empty data. Full 1 MiB read takes ~5 minutes on the slower 57,600 baudrate
- Returns:
Raw history data.
- Return type:
bytes
- get_serial() str
Get serial.
- get_temp() float
Get device temperature in Celsius.
Notes
Seems a bit temperamental. GMC-300S initially returned 0, then 86, then stabilized to 20.7 (which is about the room temperature when measured). i.e. call the method a few times until it stabilizes.
- Returns:
Device temperature is celsius.
- Return type:
float
- get_usv_h(cpm=None) float
Get µSv/h as is displayed by the device. See notes below.
- cpm: int | None
Counts per minute to be converted to µSv/h. Default=None polls device for live cpm to convert. If cpm is provided, user input is used instead.
Notes
Uses device calibration config. GQ does not have an official source documentation for device configuration nor cpm-to-µSv/h formula. A revision firmware update by GQ may change the config bytes and is often not announced. Treat the output as a best effort convenience.
- Returns:
µSv/h
- Return type:
float
- get_version() str
Get version of device.
Has a sleep wait to read as spec RFC1801 doesn’t specify end char nor byte size. i.e. SLOW.
- Returns:
Device version
- Return type:
str
- get_voltage() float
Get device voltage.
- Returns:
Device voltage in volts
- Return type:
float
- heartbeat_live(count=60) Generator[int, None, None]
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, 1count = 1second. Wall-clock time can be a bit higher or lower.
- Yields:
int – CPS
- heartbeat_live_print(count=60) None
Print live CPS data.
- Parameters:
count (int, optional) – How many CPS counts to return (default=60). Theoretically, 1count = 1second. Wall-clock time can be a bit higher or lower.
- power_off() None
Power OFF device.
- power_on() None
Power ON device.
- reboot() None
Reboot device.
Note: Different from power off-on as it changes display to default.
- save_history_csv(file_path: str) None
Save device history as a CSV file.
- Parameters:
file_path (str) – Path to save.
- save_history_raw(file_path) None
Save raw device history to file.
- Parameters:
file_path (str) – Path to save.
- send_key(key_number) None
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
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.
- class pygmc.devices.GMC320Plus(port, baudrate=115200, timeout=5, connection=None)[source]
Bases:
DeviceRFC1201GMC-320+
- get_config() dict
Get device config.
- Return type:
dict
- get_connection_details() dict
Get connection details from pyserial.
- Return type:
dict
- get_cpm() int
Get CPM counts-per-minute data.
- Returns:
Counts per minute
- Return type:
int
- get_datetime() datetime
Get device datetime.
- Returns:
Device datetime
- Return type:
datetime.datetime
- get_gyro() Tuple[int, int, int]
Get gyroscope data.
No units specified in spec RFC1801 nor RFC1201 :(
- Returns:
(X, Y, Z) gyroscope data
- Return type:
Tuple[int, int, int]
- get_history_data() list
Get tidy device memory history in a list of tuples.
First row is column names. Columns: “datetime”, “count”, “unit”, “mode”, “reference_datetime”, “notes”
- Returns:
List of tuples, first row is column names.
- Return type:
list
- get_raw_history() bytes
Get device history data.
Stops reading when read entire page contains empty data. Full 1 MiB read takes ~5 minutes on the slower 57,600 baudrate
- Returns:
Raw history data.
- Return type:
bytes
- get_serial() str
Get serial.
- get_temp() float
Get device temperature in Celsius.
Notes
Seems a bit temperamental. GMC-300S initially returned 0, then 86, then stabilized to 20.7 (which is about the room temperature when measured). i.e. call the method a few times until it stabilizes.
- Returns:
Device temperature is celsius.
- Return type:
float
- get_usv_h(cpm=None) float
Get µSv/h as is displayed by the device. See notes below.
- cpm: int | None
Counts per minute to be converted to µSv/h. Default=None polls device for live cpm to convert. If cpm is provided, user input is used instead.
Notes
Uses device calibration config. GQ does not have an official source documentation for device configuration nor cpm-to-µSv/h formula. A revision firmware update by GQ may change the config bytes and is often not announced. Treat the output as a best effort convenience.
- Returns:
µSv/h
- Return type:
float
- get_version() str
Get version of device.
Has a sleep wait to read as spec RFC1801 doesn’t specify end char nor byte size. i.e. SLOW.
- Returns:
Device version
- Return type:
str
- get_voltage() float
Get device voltage.
- Returns:
Device voltage in volts
- Return type:
float
- heartbeat_live(count=60) Generator[int, None, None]
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, 1count = 1second. Wall-clock time can be a bit higher or lower.
- Yields:
int – CPS
- heartbeat_live_print(count=60) None
Print live CPS data.
- Parameters:
count (int, optional) – How many CPS counts to return (default=60). Theoretically, 1count = 1second. Wall-clock time can be a bit higher or lower.
- power_off() None
Power OFF device.
- power_on() None
Power ON device.
- reboot() None
Reboot device.
Note: Different from power off-on as it changes display to default.
- save_history_csv(file_path: str) None
Save device history as a CSV file.
- Parameters:
file_path (str) – Path to save.
- save_history_raw(file_path) None
Save raw device history to file.
- Parameters:
file_path (str) – Path to save.
- send_key(key_number) None
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
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.
- class pygmc.devices.GMC320PlusV5(port, baudrate=115200, timeout=5, connection=None)[source]
Bases:
DeviceRFC1201GMC-320+V5
- get_config() dict
Get device config.
- Return type:
dict
- get_connection_details() dict
Get connection details from pyserial.
- Return type:
dict
- get_cpm() int
Get CPM counts-per-minute data.
- Returns:
Counts per minute
- Return type:
int
- get_datetime() datetime
Get device datetime.
- Returns:
Device datetime
- Return type:
datetime.datetime
- get_gyro() Tuple[int, int, int]
Get gyroscope data.
No units specified in spec RFC1801 nor RFC1201 :(
- Returns:
(X, Y, Z) gyroscope data
- Return type:
Tuple[int, int, int]
- get_history_data() list
Get tidy device memory history in a list of tuples.
First row is column names. Columns: “datetime”, “count”, “unit”, “mode”, “reference_datetime”, “notes”
- Returns:
List of tuples, first row is column names.
- Return type:
list
- get_raw_history() bytes
Get device history data.
Stops reading when read entire page contains empty data. Full 1 MiB read takes ~5 minutes on the slower 57,600 baudrate
- Returns:
Raw history data.
- Return type:
bytes
- get_serial() str
Get serial.
- get_temp() float
Get device temperature in Celsius.
Notes
Seems a bit temperamental. GMC-300S initially returned 0, then 86, then stabilized to 20.7 (which is about the room temperature when measured). i.e. call the method a few times until it stabilizes.
- Returns:
Device temperature is celsius.
- Return type:
float
- get_usv_h(cpm=None) float
Get µSv/h as is displayed by the device. See notes below.
- cpm: int | None
Counts per minute to be converted to µSv/h. Default=None polls device for live cpm to convert. If cpm is provided, user input is used instead.
Notes
Uses device calibration config. GQ does not have an official source documentation for device configuration nor cpm-to-µSv/h formula. A revision firmware update by GQ may change the config bytes and is often not announced. Treat the output as a best effort convenience.
- Returns:
µSv/h
- Return type:
float
- get_version() str
Get version of device.
Has a sleep wait to read as spec RFC1801 doesn’t specify end char nor byte size. i.e. SLOW.
- Returns:
Device version
- Return type:
str
- get_voltage() float
Get device voltage.
- Returns:
Device voltage in volts
- Return type:
float
- heartbeat_live(count=60) Generator[int, None, None]
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, 1count = 1second. Wall-clock time can be a bit higher or lower.
- Yields:
int – CPS
- heartbeat_live_print(count=60) None
Print live CPS data.
- Parameters:
count (int, optional) – How many CPS counts to return (default=60). Theoretically, 1count = 1second. Wall-clock time can be a bit higher or lower.
- power_off() None
Power OFF device.
- power_on() None
Power ON device.
- reboot() None
Reboot device.
Note: Different from power off-on as it changes display to default.
- save_history_csv(file_path: str) None
Save device history as a CSV file.
- Parameters:
file_path (str) – Path to save.
- save_history_raw(file_path) None
Save raw device history to file.
- Parameters:
file_path (str) – Path to save.
- send_key(key_number) None
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
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.
- class pygmc.devices.GMC500(port, baudrate=115200, timeout=5, connection=None)[source]
Bases:
DeviceRFC1801GMC-500
- get_config() dict
Get device config.
- Return type:
dict
- get_connection_details() dict
Get connection details from pyserial.
- Return type:
dict
- get_cpm() int
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
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
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
Get CPS counts-per-second.
- Returns:
Counts per second
- Return type:
int
- get_datetime() datetime
Get device datetime.
- Returns:
Device datetime
- Return type:
datetime.datetime
- get_gyro() Tuple[int, int, int]
Get gyroscope data.
No units specified in spec RFC1801 nor RFC1201 :(
- Returns:
(X, Y, Z) gyroscope data
- Return type:
Tuple[int, int, int]
- get_history_data() list
Get tidy device memory history in a list of tuples.
First row is column names. Columns: “datetime”, “count”, “unit”, “mode”, “reference_datetime”, “notes”
- Returns:
List of tuples, first row is column names.
- Return type:
list
- get_max_cps() int
Get the maximum counts-per-second since the device POWERED ON.
- Returns:
Max counts per second observed
- Return type:
int
- get_raw_history() bytes
Get device history data.
Stops reading when read entire page contains empty data. Full 1 MiB read takes ~5 minutes on the slower 57,600 baudrate
- Returns:
Raw history data.
- Return type:
bytes
- get_serial() str
Get serial.
- get_usv_h(cpm=None) float
Get µSv/h as is displayed by the device. See notes below.
- cpm: int | None
Counts per minute to be converted to µSv/h. Default=None polls device for live cpm to convert. If cpm is provided, user input is used instead.
Notes
Uses device calibration config. GQ does not have an official source documentation for device configuration nor cpm-to-µSv/h formula. A revision firmware update by GQ may change the config bytes and is often not announced. Treat the output as a best effort convenience.
- Returns:
µSv/h
- Return type:
float
- get_version() str
Get version of device.
Has a sleep wait to read as spec RFC1801 doesn’t specify end char nor byte size. i.e. SLOW.
- Returns:
Device version
- Return type:
str
- get_voltage() float
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]
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, 1count = 1second. Wall-clock time can be a bit higher or lower.
- Yields:
int – CPS - Counts-Per-Second int
- heartbeat_live_print(count=60) None
Print live CPS data.
- Parameters:
count (int, optional) – How many CPS counts to return (default=60). Theoretically, 1count = 1second. Wall-clock time can be a bit higher or lower.
- power_off() None
Power OFF device.
- power_on() None
Power ON device.
- reboot() None
Reboot device.
Note: Different from power off-on as it changes display to default.
- save_history_csv(file_path: str) None
Save device history as a CSV file.
- Parameters:
file_path (str) – Path to save.
- save_history_raw(file_path) None
Save raw device history to file.
- Parameters:
file_path (str) – Path to save.
- send_key(key_number) None
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
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.
- set_gmcmap_counter_id(counter_id: str)
Set Counter-Id for currently connected GQ GMC for gmcmap.com
- Parameters:
counter_id (str) – Counter-Id for gmcmap.com
- Raises:
RuntimeError: – GQ spec specifies a b”xaa” response for success. RuntimeError for Unexpected response.
- set_gmcmap_user_id(user_id: str) None
Set User-Id for gmcmap.com
See: https://gmcmap.com/
- Parameters:
user_id (str) – User-Id on gmcmap.com
- Raises:
RuntimeError: – GQ spec specifies a b”xaa” response for success. RuntimeError for Unexpected response.
- set_wifi_off() None
Set WiFi Off
- set_wifi_on() None
Set WiFi On
- set_wifi_password(password=None, bytes_encoding: str = 'utf8')
Set WiFi password
- Parameters:
password (str | None) – Set WiFi password. Default=None prompts the user with interactive Python built-in getpass; to discretely input the variable. Optionally, the user can use the parameter to set the variable with their own method.
bytes_encoding (str) – Encoding to cast to bytes. Realize it’s not about the WiFi spec it’s about the GQ & ESP8266 spec. (undocumented in GQ-RFC1801)
- Raises:
RuntimeError: – GQ spec specifies a b”xaa” response for success. RuntimeError for Unexpected response.
- set_wifi_ssid(ssid, bytes_encoding: str = 'utf8') None
Set WiFi SSID (Access point name)
- Parameters:
ssid (str) – WiFi SSID access point name.
bytes_encoding (str) – Encoding to cast to bytes. Realize it’s not about the WiFi spec it’s about the GQ & ESP8266 spec. (undocumented in GQ-RFC1801)
- Raises:
RuntimeError: – GQ spec specifies a b”xaa” response for success. RuntimeError for Unexpected response.
- class pygmc.devices.GMC500Plus(port, baudrate=115200, timeout=5, connection=None)[source]
Bases:
DeviceRFC1801GMC-500+
- get_config() dict
Get device config.
- Return type:
dict
- get_connection_details() dict
Get connection details from pyserial.
- Return type:
dict
- get_cpm() int
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
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
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
Get CPS counts-per-second.
- Returns:
Counts per second
- Return type:
int
- get_datetime() datetime
Get device datetime.
- Returns:
Device datetime
- Return type:
datetime.datetime
- get_gyro() Tuple[int, int, int]
Get gyroscope data.
No units specified in spec RFC1801 nor RFC1201 :(
- Returns:
(X, Y, Z) gyroscope data
- Return type:
Tuple[int, int, int]
- get_history_data() list
Get tidy device memory history in a list of tuples.
First row is column names. Columns: “datetime”, “count”, “unit”, “mode”, “reference_datetime”, “notes”
- Returns:
List of tuples, first row is column names.
- Return type:
list
- get_max_cps() int
Get the maximum counts-per-second since the device POWERED ON.
- Returns:
Max counts per second observed
- Return type:
int
- get_raw_history() bytes
Get device history data.
Stops reading when read entire page contains empty data. Full 1 MiB read takes ~5 minutes on the slower 57,600 baudrate
- Returns:
Raw history data.
- Return type:
bytes
- get_serial() str
Get serial.
- get_usv_h(cpm=None) float
Get µSv/h as is displayed by the device. See notes below.
- cpm: int | None
Counts per minute to be converted to µSv/h. Default=None polls device for live cpm to convert. If cpm is provided, user input is used instead.
Notes
Uses device calibration config. GQ does not have an official source documentation for device configuration nor cpm-to-µSv/h formula. A revision firmware update by GQ may change the config bytes and is often not announced. Treat the output as a best effort convenience.
- Returns:
µSv/h
- Return type:
float
- get_version() str
Get version of device.
Has a sleep wait to read as spec RFC1801 doesn’t specify end char nor byte size. i.e. SLOW.
- Returns:
Device version
- Return type:
str
- get_voltage() float
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]
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, 1count = 1second. Wall-clock time can be a bit higher or lower.
- Yields:
int – CPS - Counts-Per-Second int
- heartbeat_live_print(count=60) None
Print live CPS data.
- Parameters:
count (int, optional) – How many CPS counts to return (default=60). Theoretically, 1count = 1second. Wall-clock time can be a bit higher or lower.
- power_off() None
Power OFF device.
- power_on() None
Power ON device.
- reboot() None
Reboot device.
Note: Different from power off-on as it changes display to default.
- save_history_csv(file_path: str) None
Save device history as a CSV file.
- Parameters:
file_path (str) – Path to save.
- save_history_raw(file_path) None
Save raw device history to file.
- Parameters:
file_path (str) – Path to save.
- send_key(key_number) None
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
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.
- set_gmcmap_counter_id(counter_id: str)
Set Counter-Id for currently connected GQ GMC for gmcmap.com
- Parameters:
counter_id (str) – Counter-Id for gmcmap.com
- Raises:
RuntimeError: – GQ spec specifies a b”xaa” response for success. RuntimeError for Unexpected response.
- set_gmcmap_user_id(user_id: str) None
Set User-Id for gmcmap.com
See: https://gmcmap.com/
- Parameters:
user_id (str) – User-Id on gmcmap.com
- Raises:
RuntimeError: – GQ spec specifies a b”xaa” response for success. RuntimeError for Unexpected response.
- set_wifi_off() None
Set WiFi Off
- set_wifi_on() None
Set WiFi On
- set_wifi_password(password=None, bytes_encoding: str = 'utf8')
Set WiFi password
- Parameters:
password (str | None) – Set WiFi password. Default=None prompts the user with interactive Python built-in getpass; to discretely input the variable. Optionally, the user can use the parameter to set the variable with their own method.
bytes_encoding (str) – Encoding to cast to bytes. Realize it’s not about the WiFi spec it’s about the GQ & ESP8266 spec. (undocumented in GQ-RFC1801)
- Raises:
RuntimeError: – GQ spec specifies a b”xaa” response for success. RuntimeError for Unexpected response.
- set_wifi_ssid(ssid, bytes_encoding: str = 'utf8') None
Set WiFi SSID (Access point name)
- Parameters:
ssid (str) – WiFi SSID access point name.
bytes_encoding (str) – Encoding to cast to bytes. Realize it’s not about the WiFi spec it’s about the GQ & ESP8266 spec. (undocumented in GQ-RFC1801)
- Raises:
RuntimeError: – GQ spec specifies a b”xaa” response for success. RuntimeError for Unexpected response.
- class pygmc.devices.GMC600(port, baudrate=115200, timeout=5, connection=None)[source]
Bases:
DeviceRFC1801GMC-600
- get_config() dict
Get device config.
- Return type:
dict
- get_connection_details() dict
Get connection details from pyserial.
- Return type:
dict
- get_cpm() int
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
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
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
Get CPS counts-per-second.
- Returns:
Counts per second
- Return type:
int
- get_datetime() datetime
Get device datetime.
- Returns:
Device datetime
- Return type:
datetime.datetime
- get_gyro() Tuple[int, int, int]
Get gyroscope data.
No units specified in spec RFC1801 nor RFC1201 :(
- Returns:
(X, Y, Z) gyroscope data
- Return type:
Tuple[int, int, int]
- get_history_data() list
Get tidy device memory history in a list of tuples.
First row is column names. Columns: “datetime”, “count”, “unit”, “mode”, “reference_datetime”, “notes”
- Returns:
List of tuples, first row is column names.
- Return type:
list
- get_max_cps() int
Get the maximum counts-per-second since the device POWERED ON.
- Returns:
Max counts per second observed
- Return type:
int
- get_raw_history() bytes
Get device history data.
Stops reading when read entire page contains empty data. Full 1 MiB read takes ~5 minutes on the slower 57,600 baudrate
- Returns:
Raw history data.
- Return type:
bytes
- get_serial() str
Get serial.
- get_usv_h(cpm=None) float
Get µSv/h as is displayed by the device. See notes below.
- cpm: int | None
Counts per minute to be converted to µSv/h. Default=None polls device for live cpm to convert. If cpm is provided, user input is used instead.
Notes
Uses device calibration config. GQ does not have an official source documentation for device configuration nor cpm-to-µSv/h formula. A revision firmware update by GQ may change the config bytes and is often not announced. Treat the output as a best effort convenience.
- Returns:
µSv/h
- Return type:
float
- get_version() str
Get version of device.
Has a sleep wait to read as spec RFC1801 doesn’t specify end char nor byte size. i.e. SLOW.
- Returns:
Device version
- Return type:
str
- get_voltage() float
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]
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, 1count = 1second. Wall-clock time can be a bit higher or lower.
- Yields:
int – CPS - Counts-Per-Second int
- heartbeat_live_print(count=60) None
Print live CPS data.
- Parameters:
count (int, optional) – How many CPS counts to return (default=60). Theoretically, 1count = 1second. Wall-clock time can be a bit higher or lower.
- power_off() None
Power OFF device.
- power_on() None
Power ON device.
- reboot() None
Reboot device.
Note: Different from power off-on as it changes display to default.
- save_history_csv(file_path: str) None
Save device history as a CSV file.
- Parameters:
file_path (str) – Path to save.
- save_history_raw(file_path) None
Save raw device history to file.
- Parameters:
file_path (str) – Path to save.
- send_key(key_number) None
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
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.
- set_gmcmap_counter_id(counter_id: str)
Set Counter-Id for currently connected GQ GMC for gmcmap.com
- Parameters:
counter_id (str) – Counter-Id for gmcmap.com
- Raises:
RuntimeError: – GQ spec specifies a b”xaa” response for success. RuntimeError for Unexpected response.
- set_gmcmap_user_id(user_id: str) None
Set User-Id for gmcmap.com
See: https://gmcmap.com/
- Parameters:
user_id (str) – User-Id on gmcmap.com
- Raises:
RuntimeError: – GQ spec specifies a b”xaa” response for success. RuntimeError for Unexpected response.
- set_wifi_off() None
Set WiFi Off
- set_wifi_on() None
Set WiFi On
- set_wifi_password(password=None, bytes_encoding: str = 'utf8')
Set WiFi password
- Parameters:
password (str | None) – Set WiFi password. Default=None prompts the user with interactive Python built-in getpass; to discretely input the variable. Optionally, the user can use the parameter to set the variable with their own method.
bytes_encoding (str) – Encoding to cast to bytes. Realize it’s not about the WiFi spec it’s about the GQ & ESP8266 spec. (undocumented in GQ-RFC1801)
- Raises:
RuntimeError: – GQ spec specifies a b”xaa” response for success. RuntimeError for Unexpected response.
- set_wifi_ssid(ssid, bytes_encoding: str = 'utf8') None
Set WiFi SSID (Access point name)
- Parameters:
ssid (str) – WiFi SSID access point name.
bytes_encoding (str) – Encoding to cast to bytes. Realize it’s not about the WiFi spec it’s about the GQ & ESP8266 spec. (undocumented in GQ-RFC1801)
- Raises:
RuntimeError: – GQ spec specifies a b”xaa” response for success. RuntimeError for Unexpected response.
- class pygmc.devices.GMC600Plus(port, baudrate=115200, timeout=5, connection=None)[source]
Bases:
DeviceRFC1801GMC-600+
- get_config() dict
Get device config.
- Return type:
dict
- get_connection_details() dict
Get connection details from pyserial.
- Return type:
dict
- get_cpm() int
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
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
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
Get CPS counts-per-second.
- Returns:
Counts per second
- Return type:
int
- get_datetime() datetime
Get device datetime.
- Returns:
Device datetime
- Return type:
datetime.datetime
- get_gyro() Tuple[int, int, int]
Get gyroscope data.
No units specified in spec RFC1801 nor RFC1201 :(
- Returns:
(X, Y, Z) gyroscope data
- Return type:
Tuple[int, int, int]
- get_history_data() list
Get tidy device memory history in a list of tuples.
First row is column names. Columns: “datetime”, “count”, “unit”, “mode”, “reference_datetime”, “notes”
- Returns:
List of tuples, first row is column names.
- Return type:
list
- get_max_cps() int
Get the maximum counts-per-second since the device POWERED ON.
- Returns:
Max counts per second observed
- Return type:
int
- get_raw_history() bytes
Get device history data.
Stops reading when read entire page contains empty data. Full 1 MiB read takes ~5 minutes on the slower 57,600 baudrate
- Returns:
Raw history data.
- Return type:
bytes
- get_serial() str
Get serial.
- get_usv_h(cpm=None) float
Get µSv/h as is displayed by the device. See notes below.
- cpm: int | None
Counts per minute to be converted to µSv/h. Default=None polls device for live cpm to convert. If cpm is provided, user input is used instead.
Notes
Uses device calibration config. GQ does not have an official source documentation for device configuration nor cpm-to-µSv/h formula. A revision firmware update by GQ may change the config bytes and is often not announced. Treat the output as a best effort convenience.
- Returns:
µSv/h
- Return type:
float
- get_version() str
Get version of device.
Has a sleep wait to read as spec RFC1801 doesn’t specify end char nor byte size. i.e. SLOW.
- Returns:
Device version
- Return type:
str
- get_voltage() float
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]
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, 1count = 1second. Wall-clock time can be a bit higher or lower.
- Yields:
int – CPS - Counts-Per-Second int
- heartbeat_live_print(count=60) None
Print live CPS data.
- Parameters:
count (int, optional) – How many CPS counts to return (default=60). Theoretically, 1count = 1second. Wall-clock time can be a bit higher or lower.
- power_off() None
Power OFF device.
- power_on() None
Power ON device.
- reboot() None
Reboot device.
Note: Different from power off-on as it changes display to default.
- save_history_csv(file_path: str) None
Save device history as a CSV file.
- Parameters:
file_path (str) – Path to save.
- save_history_raw(file_path) None
Save raw device history to file.
- Parameters:
file_path (str) – Path to save.
- send_key(key_number) None
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
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.
- set_gmcmap_counter_id(counter_id: str)
Set Counter-Id for currently connected GQ GMC for gmcmap.com
- Parameters:
counter_id (str) – Counter-Id for gmcmap.com
- Raises:
RuntimeError: – GQ spec specifies a b”xaa” response for success. RuntimeError for Unexpected response.
- set_gmcmap_user_id(user_id: str) None
Set User-Id for gmcmap.com
See: https://gmcmap.com/
- Parameters:
user_id (str) – User-Id on gmcmap.com
- Raises:
RuntimeError: – GQ spec specifies a b”xaa” response for success. RuntimeError for Unexpected response.
- set_wifi_off() None
Set WiFi Off
- set_wifi_on() None
Set WiFi On
- set_wifi_password(password=None, bytes_encoding: str = 'utf8')
Set WiFi password
- Parameters:
password (str | None) – Set WiFi password. Default=None prompts the user with interactive Python built-in getpass; to discretely input the variable. Optionally, the user can use the parameter to set the variable with their own method.
bytes_encoding (str) – Encoding to cast to bytes. Realize it’s not about the WiFi spec it’s about the GQ & ESP8266 spec. (undocumented in GQ-RFC1801)
- Raises:
RuntimeError: – GQ spec specifies a b”xaa” response for success. RuntimeError for Unexpected response.
- set_wifi_ssid(ssid, bytes_encoding: str = 'utf8') None
Set WiFi SSID (Access point name)
- Parameters:
ssid (str) – WiFi SSID access point name.
bytes_encoding (str) – Encoding to cast to bytes. Realize it’s not about the WiFi spec it’s about the GQ & ESP8266 spec. (undocumented in GQ-RFC1801)
- Raises:
RuntimeError: – GQ spec specifies a b”xaa” response for success. RuntimeError for Unexpected response.
- class pygmc.devices.GMC800(port, baudrate=115200, timeout=5, connection=None)[source]
Bases:
DeviceSpec404GMC-800
- get_config() dict
Get device config.
- Return type:
dict
- get_connection_details() dict
Get connection details from pyserial.
- Return type:
dict
- get_cpm() int
Get CPM counts-per-minute data.
- Returns:
Counts per minute
- Return type:
int
- get_cps() int
Get CPS counts-per-second.
- Returns:
Counts per second
- Return type:
int
- get_datetime() datetime
Get device datetime.
- Returns:
Device datetime
- Return type:
datetime.datetime
- get_history_data() list
Get tidy device memory history in a list of tuples.
First row is column names. Columns: “datetime”, “count”, “unit”, “mode”, “reference_datetime”, “notes”
- Returns:
List of tuples, first row is column names.
- Return type:
list
- get_raw_history() bytes
Get device history data.
Stops reading when read entire page contains empty data. Full 1 MiB read takes ~5 minutes on the slower 57,600 baudrate
- Returns:
Raw history data.
- Return type:
bytes
- get_serial() str
Get serial.
- get_usv_h(cpm=None) float
Get µSv/h as is displayed by the device. See notes below.
- cpm: int | None
Counts per minute to be converted to µSv/h. Default=None polls device for live cpm to convert. If cpm is provided, user input is used instead.
Notes
Uses device calibration config. GQ does not have an official source documentation for device configuration nor cpm-to-µSv/h formula. A revision firmware update by GQ may change the config bytes and is often not announced. Treat the output as a best effort convenience.
- Returns:
µSv/h
- Return type:
float
- get_version() str
Get version of device.
Has a sleep wait to read as spec RFC1801 doesn’t specify end char nor byte size. i.e. SLOW.
- Returns:
Device version
- Return type:
str
- heartbeat_live(count=60) Generator[int, None, None]
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, 1count = 1second. Wall-clock time can be a bit higher or lower.
- Yields:
int – CPS - Counts-Per-Second int
- heartbeat_live_print(count=60) None
Print live CPS data.
- Parameters:
count (int, optional) – How many CPS counts to return (default=60). Theoretically, 1count = 1second. Wall-clock time can be a bit higher or lower.
- power_off() None
Power OFF device.
- power_on() None
Power ON device.
- reboot() None
Reboot device.
Note: Different from power off-on as it changes display to default.
- save_history_csv(file_path: str) None
Save device history as a CSV file.
- Parameters:
file_path (str) – Path to save.
- save_history_raw(file_path) None
Save raw device history to file.
- Parameters:
file_path (str) – Path to save.
- send_key(key_number) None
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
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.
- class pygmc.devices.GMCSE(port, baudrate=115200, timeout=5, connection=None)[source]
Bases:
DeviceRFC1201GMC-SE
- get_config() dict
Get device config.
- Return type:
dict
- get_connection_details() dict
Get connection details from pyserial.
- Return type:
dict
- get_cpm() int
Get CPM counts-per-minute data.
- Returns:
Counts per minute
- Return type:
int
- get_datetime() datetime
Get device datetime.
- Returns:
Device datetime
- Return type:
datetime.datetime
- get_gyro() Tuple[int, int, int]
Get gyroscope data.
No units specified in spec RFC1801 nor RFC1201 :(
- Returns:
(X, Y, Z) gyroscope data
- Return type:
Tuple[int, int, int]
- get_history_data() list
Get tidy device memory history in a list of tuples.
First row is column names. Columns: “datetime”, “count”, “unit”, “mode”, “reference_datetime”, “notes”
- Returns:
List of tuples, first row is column names.
- Return type:
list
- get_raw_history() bytes
Get device history data.
Stops reading when read entire page contains empty data. Full 1 MiB read takes ~5 minutes on the slower 57,600 baudrate
- Returns:
Raw history data.
- Return type:
bytes
- get_serial() str
Get serial.
- get_temp() float
Get device temperature in Celsius.
Notes
Seems a bit temperamental. GMC-300S initially returned 0, then 86, then stabilized to 20.7 (which is about the room temperature when measured). i.e. call the method a few times until it stabilizes.
- Returns:
Device temperature is celsius.
- Return type:
float
- get_usv_h(cpm=None) float
Get µSv/h as is displayed by the device. See notes below.
- cpm: int | None
Counts per minute to be converted to µSv/h. Default=None polls device for live cpm to convert. If cpm is provided, user input is used instead.
Notes
Uses device calibration config. GQ does not have an official source documentation for device configuration nor cpm-to-µSv/h formula. A revision firmware update by GQ may change the config bytes and is often not announced. Treat the output as a best effort convenience.
- Returns:
µSv/h
- Return type:
float
- get_version() str
Get version of device.
Has a sleep wait to read as spec RFC1801 doesn’t specify end char nor byte size. i.e. SLOW.
- Returns:
Device version
- Return type:
str
- get_voltage() float
Get device voltage.
- Returns:
Device voltage in volts
- Return type:
float
- heartbeat_live(count=60) Generator[int, None, None]
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, 1count = 1second. Wall-clock time can be a bit higher or lower.
- Yields:
int – CPS
- heartbeat_live_print(count=60) None
Print live CPS data.
- Parameters:
count (int, optional) – How many CPS counts to return (default=60). Theoretically, 1count = 1second. Wall-clock time can be a bit higher or lower.
- power_off() None
Power OFF device.
- power_on() None
Power ON device.
- reboot() None
Reboot device.
Note: Different from power off-on as it changes display to default.
- save_history_csv(file_path: str) None
Save device history as a CSV file.
- Parameters:
file_path (str) – Path to save.
- save_history_raw(file_path) None
Save raw device history to file.
- Parameters:
file_path (str) – Path to save.
- send_key(key_number) None
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
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.
- class pygmc.devices.DeviceRFC1201(connection)[source]
Bases:
BaseDeviceDevice class representing Spec RFC1201
- get_connection_details() dict
Get connection details from pyserial.
- Return type:
dict
- 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_history_data() list
Get tidy device memory history in a list of tuples.
First row is column names. Columns: “datetime”, “count”, “unit”, “mode”, “reference_datetime”, “notes”
- Returns:
List of tuples, first row is column names.
- Return type:
list
- get_raw_history() bytes
Get device history data.
Stops reading when read entire page contains empty data. Full 1 MiB read takes ~5 minutes on the slower 57,600 baudrate
- Returns:
Raw history data.
- Return type:
bytes
- get_serial() str
Get serial.
- get_temp() float[source]
Get device temperature in Celsius.
Notes
Seems a bit temperamental. GMC-300S initially returned 0, then 86, then stabilized to 20.7 (which is about the room temperature when measured). i.e. call the method a few times until it stabilizes.
- Returns:
Device temperature is celsius.
- Return type:
float
- get_usv_h(cpm=None) float[source]
Get µSv/h as is displayed by the device. See notes below.
- cpm: int | None
Counts per minute to be converted to µSv/h. Default=None polls device for live cpm to convert. If cpm is provided, user input is used instead.
Notes
Uses device calibration config. GQ does not have an official source documentation for device configuration nor cpm-to-µSv/h formula. A revision firmware update by GQ may change the config bytes and is often not announced. Treat the output as a best effort convenience.
- Returns:
µSv/h
- Return type:
float
- get_version() str
Get version of device.
Has a sleep wait to read as spec RFC1801 doesn’t specify end char nor byte size. i.e. SLOW.
- Returns:
Device version
- Return type:
str
- 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, 1count = 1second. 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, 1count = 1second. 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.
- save_history_csv(file_path: str) None
Save device history as a CSV file.
- Parameters:
file_path (str) – Path to save.
- save_history_raw(file_path) None
Save raw device history to file.
- Parameters:
file_path (str) – Path to save.
- 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.
- class pygmc.devices.DeviceRFC1801(connection)[source]
Bases:
BaseDeviceDevice class representing Spec RFC1801
- get_connection_details() dict
Get connection details from pyserial.
- 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_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_history_data() list
Get tidy device memory history in a list of tuples.
First row is column names. Columns: “datetime”, “count”, “unit”, “mode”, “reference_datetime”, “notes”
- Returns:
List of tuples, first row is column names.
- Return type:
list
- 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_raw_history() bytes
Get device history data.
Stops reading when read entire page contains empty data. Full 1 MiB read takes ~5 minutes on the slower 57,600 baudrate
- Returns:
Raw history data.
- Return type:
bytes
- get_serial() str
Get serial.
- get_usv_h(cpm=None) float[source]
Get µSv/h as is displayed by the device. See notes below.
- cpm: int | None
Counts per minute to be converted to µSv/h. Default=None polls device for live cpm to convert. If cpm is provided, user input is used instead.
Notes
Uses device calibration config. GQ does not have an official source documentation for device configuration nor cpm-to-µSv/h formula. A revision firmware update by GQ may change the config bytes and is often not announced. Treat the output as a best effort convenience.
- Returns:
µSv/h
- Return type:
float
- get_version() str
Get version of device.
Has a sleep wait to read as spec RFC1801 doesn’t specify end char nor byte size. i.e. SLOW.
- Returns:
Device version
- Return type:
str
- 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, 1count = 1second. 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, 1count = 1second. 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.
- save_history_csv(file_path: str) None
Save device history as a CSV file.
- Parameters:
file_path (str) – Path to save.
- save_history_raw(file_path) None
Save raw device history to file.
- Parameters:
file_path (str) – Path to save.
- 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.
- set_gmcmap_counter_id(counter_id: str)[source]
Set Counter-Id for currently connected GQ GMC for gmcmap.com
- Parameters:
counter_id (str) – Counter-Id for gmcmap.com
- Raises:
RuntimeError: – GQ spec specifies a b”xaa” response for success. RuntimeError for Unexpected response.
- set_gmcmap_user_id(user_id: str) None[source]
Set User-Id for gmcmap.com
See: https://gmcmap.com/
- Parameters:
user_id (str) – User-Id on gmcmap.com
- Raises:
RuntimeError: – GQ spec specifies a b”xaa” response for success. RuntimeError for Unexpected response.
- set_wifi_password(password=None, bytes_encoding: str = 'utf8')[source]
Set WiFi password
- Parameters:
password (str | None) – Set WiFi password. Default=None prompts the user with interactive Python built-in getpass; to discretely input the variable. Optionally, the user can use the parameter to set the variable with their own method.
bytes_encoding (str) – Encoding to cast to bytes. Realize it’s not about the WiFi spec it’s about the GQ & ESP8266 spec. (undocumented in GQ-RFC1801)
- Raises:
RuntimeError: – GQ spec specifies a b”xaa” response for success. RuntimeError for Unexpected response.
- set_wifi_ssid(ssid, bytes_encoding: str = 'utf8') None[source]
Set WiFi SSID (Access point name)
- Parameters:
ssid (str) – WiFi SSID access point name.
bytes_encoding (str) – Encoding to cast to bytes. Realize it’s not about the WiFi spec it’s about the GQ & ESP8266 spec. (undocumented in GQ-RFC1801)
- Raises:
RuntimeError: – GQ spec specifies a b”xaa” response for success. RuntimeError for Unexpected response.
- class pygmc.devices.BaseDevice(connection)[source]
Bases:
objectBase device class which all devices inherit from.
- get_history_data() list[source]
Get tidy device memory history in a list of tuples.
First row is column names. Columns: “datetime”, “count”, “unit”, “mode”, “reference_datetime”, “notes”
- Returns:
List of tuples, first row is column names.
- Return type:
list
- get_raw_history() bytes[source]
Get device history data.
Stops reading when read entire page contains empty data. Full 1 MiB read takes ~5 minutes on the slower 57,600 baudrate
- Returns:
Raw history data.
- Return type:
bytes
- 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. i.e. SLOW.
- Returns:
Device version
- Return type:
str