cdump / radiacode

Library for RadiaCode-101
MIT License
108 stars 20 forks source link

decoding the flag,unit and event data #28

Closed davidcarlsonSEE closed 7 months ago

davidcarlsonSEE commented 8 months ago

As the data comes in the real time data is decoded with a python struct. real_time_flags is part of that data.

I can trigger the real_time_flags to change value by moving my source to NoAlarm, Alarm1, Alarm2 which seems to correspond to real_time_flags value of 0, 8, and 9. Again that is an assumption during my testing.
Q1. Is there a way to know what the real_time_flags values mean?

decode_VS_Data br=['2608008e01000000430000004a0000cc3100000080d2432f6e973a6000b1004222084b0101813100000400320000000000d143569f9b3a0000e243bb27973a0000c343a2b4973a0000c2433bdfaf3a'] 2024-01-31T09:46:15.171706 RealTimeData(dt=datetime.datetime(2024, 1, 31, 9, 46, 15, 171706), count_rate=421.0, count_rate_err=9.6, dose_rate=0.0011553223012015224, dose_rate_err=17.7, flags=8770, real_time_flags=8)

@dataclass
class RealTimeData:
    dt: datetime.datetime
    count_rate: float
    count_rate_err: float  # %
    dose_rate: int
    dose_rate_err: int
    flags: int
    real_time_flags: int
cdump commented 8 months ago

A1. I don't know that

davidcarlsonSEE commented 7 months ago

I'm trying to verify my guess on what the unit value from the configuration means.
I read this for DoseRate: I/System.out: MaxVal=50e3 [[[CHN_DoseRate]]] Id=4 Sensor=c10_CsI_C30035 Unit=" R/h| Р/ч" ScaledUnit=1

I'm the R in " R/h" means Roentgen. Question. What does the P in " Р/ч" mean. I'm assuming scale.

Also I have tried changing the unit on the device to Sieverts to see if the unit in configuration changes to " Sv/h" but it did not.
So I'm assuming that the unit change on the device only changes how the data is displayed.
Any thoughts on that?

cdump commented 7 months ago

R/h = Roentgen/hour, Р/ч = Рентген/час (same in Russian)

davidcarlsonSEE commented 7 months ago

Спасибо ;-)

davidcarlsonSEE commented 7 months ago

I'm going to assume that the R/h lowest common unit is micro R expressed as: µR/hr And when the value goes above 999 it scales up to milli R "mR/hr"

Am6er commented 7 months ago

Flags have complicated structure depends on all alarms and other feature flags. Without official documentation you couldn't solve that issue.

davidcarlsonSEE commented 7 months ago

After hundreds of tests these flag values seem to hold.

switch(flags)
        {
            case 66: return "Red";
            case 65: return "Yellow";
            default: return "Green";
        }