From 5c933a78fac14f5acf9a863bfaaaf1d4543fc8bd Mon Sep 17 00:00:00 2001 From: esea_info Date: Wed, 26 Jul 2023 11:10:26 +0800 Subject: [PATCH] profiler dataclass --- app.py | 218 +++- data/2/37/2023_7_10_14_15_31.csv | 7 + data/2/37/info.bin | Bin 0 -> 105 bytes data/2/37/sensor.bin | Bin 0 -> 63144 bytes data/2023/03/20/37/info.bin | Bin 0 -> 79 bytes data/2023/03/20/37/sensor.bin | Bin 0 -> 1754 bytes myRamses.py | 795 ++++++++++++++ profiler copy.py | 1279 ++++++++++++++++++++++ profiler.py | 1762 +++++++++++------------------- receive.py | 95 +- retrieve.yml | 1 + tcp_profiler.py | 163 ++- 12 files changed, 3111 insertions(+), 1209 deletions(-) create mode 100644 data/2/37/2023_7_10_14_15_31.csv create mode 100644 data/2/37/info.bin create mode 100644 data/2/37/sensor.bin create mode 100644 data/2023/03/20/37/info.bin create mode 100644 data/2023/03/20/37/sensor.bin create mode 100644 myRamses.py create mode 100644 profiler copy.py diff --git a/app.py b/app.py index 9533b85..ddeca2d 100644 --- a/app.py +++ b/app.py @@ -8,73 +8,183 @@ from myconfig import DEVICE_ID ,FILE_MARK,YAML_FILE_NAME,CURRENT_DIR,DATA_DIR,CA from myconfig import BEGIN_WAVELENGTH,END_WAVELENGTH,INTERVAL,ROWFACTOR from Ramses import Ramses +from profiler import Profiler,ProfilerHandle + IP = "" PORT = 7887 ADDRESS = (IP, PORT) # 绑定地址 -if __name__ == "__main__": - log.info(f"******** HandHeld server initiate.... *********", __name__, "", "") +class MyApp(object): + def __init__(self,): + log.info(f"******** Awarms server initiate.... *********", __name__, "", "") + self.device_type = DeviceType.PROFILE.name + self.mycfg = MyConfig() # 传入 cfg retrieve 的yml文件 + + # 配置反演需要的参数 波长 间隔 , rowFactor + self.retrieve = self.mycfg.get_retrieve() # 读retrieve.yml + log.info(f"Retrieve: {self.retrieve}", __name__, "", "") + + # log.info(f"syscfg: {device}", __name__, "", "") + self.mycfg.setDeviceType( DeviceType.PROFILE ) + self.sensor_cfg = self.mycfg.read_yaml() # 读config.yml, 多个device_id 配置 + log.info(f"Current Device: {self.device_type} ", __name__, "", "") + log.info(f"Sensor cfg: {self.sensor_cfg}", __name__, "", "") + + + self.cal_cfg = {} + + cfgr = Configuration( ) + cfgr.setDeviceType(self.device_type) + cfgr.setSystemCfgDict(self.sensor_cfg) + + for k,v in self.sensor_cfg.items(): + cfgr.setSystemCfgDict(v) + try: + cfgr.getCalConfiguration() + except Exception as e: + log.error(f"读取配置文件失败. \n {e}",__name__, "", "" ) + raise + log.info(f"v: {cfgr.configuration}", __name__, "", "") + self.cal_cfg.update({k:cfgr.cal_configuration}) + + log.debug(f"cal_cfg: {self.cal_cfg}", __name__, "", "") + log.warning(f"cal_cfg 2: {self.cal_cfg[2].keys()}", __name__, "", "") + # log.warning(f"cal_cfg 3: {self.cal_cfg[3].keys()}", __name__, "", "") + log.info(f"传感器配置文件读取成功", __name__, "", "") + + pass + + def init_data_process(self, mode = 0): + ''' 多个handle ''' + self.profiler_handle = { } + for k,v in self.cal_cfg.items(): + ph = ProfilerHandle( deviceid=k, cfg=self.sensor_cfg[k], calcfg=v, rtv=self.retrieve) + self.profiler_handle.update( {k:ph} ) + + def run_server(self,): + # 启动接受服务器 + log.info(f"启动接受服务器, IP: {IP} , Port:{PORT} ", __name__, "", "") - ####################################### - device_id = DEVICE_ID # 多个设备 - device_type = DeviceType.PROFILE.name - mycfg = MyConfig() + server_ = MyThreadingTCPServer(ADDRESS, MyServer, calcfg=self.cal_cfg, retrieve = self.retrieve ,profiler_handle=self.profiler_handle ) - # 配置反演需要的参数 波长 间隔 - retrieve = mycfg.get_retrieve() - log.info(f"Retrieve: {retrieve}", __name__, "", "") + try: + server_.serve_forever() + except KeyboardInterrupt: + log.warning(" Ctrl+C 退出主程序 ",__name__, "", "") + server_.server_close() + except Exception as e: + log.info(" 系统异常, 如下: \n ",__name__, "", "") + log.info(e) - # log.info(f"syscfg: {device}", __name__, "", "") - mycfg.setDeviceType(device_type) - init_para = mycfg.read_yaml() - log.info(f"Current Device: {device_type} ", __name__, "", "") - log.info(f"Sensor: {init_para}", __name__, "", "") + pass - cal_cfg = {} +if __name__ == "__main__": + log.info(f"******** Yiwin Profiler server initiate.... *********", __name__, "", "") + app = MyApp() + app.init_data_process( ) + app.run_server() + +# IP = "" +# PORT = 7887 +# ADDRESS = (IP, PORT) # 绑定地址 + +# device_id = DEVICE_ID # 多个设备 +# device_type = DeviceType.PROFILE.name +# retrieve = {} +# cal_cfg ={} + +# def get_sys_cfg(): +# log.info(f"开始获得配置", __name__, "", "") +# device_id = DEVICE_ID # 多个设备 +# device_type = DeviceType.PROFILE.name +# mycfg = MyConfig() + +# # 配置反演需要的参数 波长 间隔 +# retrieve = mycfg.get_retrieve() +# log.info(f"Retrieve: {retrieve}", __name__, "", "") + +# # log.info(f"syscfg: {device}", __name__, "", "") +# mycfg.setDeviceType(device_type) +# init_para = mycfg.read_yaml() +# log.info(f"Current Device: {device_type} ", __name__, "", "") +# log.info(f"Sensor: {init_para}", __name__, "", "") + +# cal_cfg = {} - cfgr = Configuration( ) - cfgr.setDeviceType(device_type) - cfgr.setSystemCfgDict(init_para) +# cfgr = Configuration( ) +# cfgr.setDeviceType(device_type) +# cfgr.setSystemCfgDict(init_para) - for k,v in init_para.items(): - cfgr.setSystemCfgDict(v) - try: - cfgr.getCalConfiguration() - except Exception as e: - log.error(f"读取配置文件失败. \n {e}",__name__, "", "" ) - raise - log.info(f"v: {cfgr.configuration}", __name__, "", "") - cal_cfg.update({k:cfgr.cal_configuration}) - - # log.warning(f"cal_cfg: {cal_cfg[2]}", __name__, "", "") - log.warning( f"cal_cfg 2: {cal_cfg[2].keys()}", __name__, "", "") - # log.warning( f"cal_cfg 2: {cal_cfg[2]}", __name__, "", "") - # log.warning( f"cal_cfg 3: {cal_cfg[3].keys()}", __name__, "", "") - log.info( f"传感器配置文件读取成功", __name__, "", "" ) +# for k,v in init_para.items(): +# cfgr.setSystemCfgDict(v) +# try: +# cfgr.getCalConfiguration() +# except Exception as e: +# log.error(f"读取配置文件失败. \n {e}",__name__, "", "" ) +# raise +# log.info(f"v: {cfgr.configuration}", __name__, "", "") +# cal_cfg.update({k:cfgr.cal_configuration}) + +# # log.warning(f"cal_cfg: {cal_cfg[2]}", __name__, "", "") +# log.warning( f"cal_cfg 2: {cal_cfg[2].keys()}", __name__, "", "") +# # log.warning( f"cal_cfg 2: {cal_cfg[2]}", __name__, "", "") +# # log.warning( f"cal_cfg 3: {cal_cfg[3].keys()}", __name__, "", "") +# log.info( f"传感器配置文件读取成功", __name__, "", "" ) + +# def run_server(): +# # 启动接受服务器 +# log.info(f"启动接受服务器, IP: {IP} , Port:{PORT} ", __name__, "", "") + +# server_ = MyThreadingTCPServer(ADDRESS, MyServer, cfg=cal_cfg, retrieve = retrieve ) + +# try: +# server_.serve_forever() +# except KeyboardInterrupt: +# log.warning(" Ctrl+C 退出主程序 ",__name__, "", "") +# server_.server_close() +# except Exception as e: +# log.info(" 系统异常, 如下: \n ",__name__, "", "") +# log.info(e) + +# def deal_info_sensor_bin(infobin, sensor_bin): + +# profiler = Profiler() +# profiler.setSyscfg( cal_cfg ) +# profiler.setRetrieve(retrieve) +# profiler.setDeviceID(2) +# profiler.setMeasureID(37) - # ???????????? - # 不同设备类型接收不同,修改receive.py - # 不同数据裂隙数据处理不同,修改AWRAMS.py - # 分支:服务器:处理不同的文件夹 awramse surface profile c - # 桌面: 服务器的, 读取标准trios文件处理的 -- 暂不考虑 +# path_tuple = ( "data", 2, 37 ) +# profiler.setOldFolder( path_tuple ) +# # profiler.getInfoDict( ) +# # profiler.transferFromOldFolder() +# # profiler.deleteOldFolder() +# # profiler.dealOneMeasurement_Profiler(profiler.new_folder) +# profiler.dealOneMeasurement_Profiler(profiler.old_folder) +# log.info(f" Complete Dealing one group.") + +# if __name__ == "__main__": +# log.info(f"******** HandHeld server initiate.... *********", __name__, "", "") + +# get_sys_cfg() +# run_server() + + +# profiler = Profiler() +# profiler.setSyscfg( cal_cfg ) +# profiler.setRetrieve(retrieve) +# profiler.setDeviceID(2) +# profiler.setMeasureID(37) - # 启动接受服务器 - log.info(f"启动接受服务器, IP: {IP} , Port:{PORT} ", __name__, "", "") - - server_ = MyThreadingTCPServer(ADDRESS, MyServer, cfg=cal_cfg, retrieve = retrieve ) - - try: - server_.serve_forever() - except KeyboardInterrupt: - log.warning(" Ctrl+C 退出主程序 ",__name__, "", "") - server_.server_close() - except Exception as e: - log.info(" 系统异常, 如下: \n ",__name__, "", "") - log.info(e) - - - +# path_tuple = ( "data", 2, 37 ) +# profiler.setOldFolder( path_tuple ) +# # profiler.getInfoDict( ) +# # profiler.transferFromOldFolder() +# # profiler.deleteOldFolder() +# # profiler.dealOneMeasurement_Profiler(profiler.new_folder) +# profiler.dealOneMeasurement_Profiler(profiler.old_folder) +# log.info(f" Complete Dealing one group.") # r= Ramses() diff --git a/data/2/37/2023_7_10_14_15_31.csv b/data/2/37/2023_7_10_14_15_31.csv new file mode 100644 index 0000000..f7c7278 --- /dev/null +++ b/data/2/37/2023_7_10_14_15_31.csv @@ -0,0 +1,7 @@ +2_37;350.0;351.0;352.0;353.0;354.0;355.0;356.0;357.0;358.0;359.0;360.0;361.0;362.0;363.0;364.0;365.0;366.0;367.0;368.0;369.0;370.0;371.0;372.0;373.0;374.0;375.0;376.0;377.0;378.0;379.0;380.0;381.0;382.0;383.0;384.0;385.0;386.0;387.0;388.0;389.0;390.0;391.0;392.0;393.0;394.0;395.0;396.0;397.0;398.0;399.0;400.0;401.0;402.0;403.0;404.0;405.0;406.0;407.0;408.0;409.0;410.0;411.0;412.0;413.0;414.0;415.0;416.0;417.0;418.0;419.0;420.0;421.0;422.0;423.0;424.0;425.0;426.0;427.0;428.0;429.0;430.0;431.0;432.0;433.0;434.0;435.0;436.0;437.0;438.0;439.0;440.0;441.0;442.0;443.0;444.0;445.0;446.0;447.0;448.0;449.0;450.0;451.0;452.0;453.0;454.0;455.0;456.0;457.0;458.0;459.0;460.0;461.0;462.0;463.0;464.0;465.0;466.0;467.0;468.0;469.0;470.0;471.0;472.0;473.0;474.0;475.0;476.0;477.0;478.0;479.0;480.0;481.0;482.0;483.0;484.0;485.0;486.0;487.0;488.0;489.0;490.0;491.0;492.0;493.0;494.0;495.0;496.0;497.0;498.0;499.0;500.0;501.0;502.0;503.0;504.0;505.0;506.0;507.0;508.0;509.0;510.0;511.0;512.0;513.0;514.0;515.0;516.0;517.0;518.0;519.0;520.0;521.0;522.0;523.0;524.0;525.0;526.0;527.0;528.0;529.0;530.0;531.0;532.0;533.0;534.0;535.0;536.0;537.0;538.0;539.0;540.0;541.0;542.0;543.0;544.0;545.0;546.0;547.0;548.0;549.0;550.0;551.0;552.0;553.0;554.0;555.0;556.0;557.0;558.0;559.0;560.0;561.0;562.0;563.0;564.0;565.0;566.0;567.0;568.0;569.0;570.0;571.0;572.0;573.0;574.0;575.0;576.0;577.0;578.0;579.0;580.0;581.0;582.0;583.0;584.0;585.0;586.0;587.0;588.0;589.0;590.0;591.0;592.0;593.0;594.0;595.0;596.0;597.0;598.0;599.0;600.0;601.0;602.0;603.0;604.0;605.0;606.0;607.0;608.0;609.0;610.0;611.0;612.0;613.0;614.0;615.0;616.0;617.0;618.0;619.0;620.0;621.0;622.0;623.0;624.0;625.0;626.0;627.0;628.0;629.0;630.0;631.0;632.0;633.0;634.0;635.0;636.0;637.0;638.0;639.0;640.0;641.0;642.0;643.0;644.0;645.0;646.0;647.0;648.0;649.0;650.0;651.0;652.0;653.0;654.0;655.0;656.0;657.0;658.0;659.0;660.0;661.0;662.0;663.0;664.0;665.0;666.0;667.0;668.0;669.0;670.0;671.0;672.0;673.0;674.0;675.0;676.0;677.0;678.0;679.0;680.0;681.0;682.0;683.0;684.0;685.0;686.0;687.0;688.0;689.0;690.0;691.0;692.0;693.0;694.0;695.0;696.0;697.0;698.0;699.0;700.0;701.0;702.0;703.0;704.0;705.0;706.0;707.0;708.0;709.0;710.0;711.0;712.0;713.0;714.0;715.0;716.0;717.0;718.0;719.0;720.0;721.0;722.0;723.0;724.0;725.0;726.0;727.0;728.0;729.0;730.0;731.0;732.0;733.0;734.0;735.0;736.0;737.0;738.0;739.0;740.0;741.0;742.0;743.0;744.0;745.0;746.0;747.0;748.0;749.0;750.0;751.0;752.0;753.0;754.0;755.0;756.0;757.0;758.0;759.0;760.0;761.0;762.0;763.0;764.0;765.0;766.0;767.0;768.0;769.0;770.0;771.0;772.0;773.0;774.0;775.0;776.0;777.0;778.0;779.0;780.0;781.0;782.0;783.0;784.0;785.0;786.0;787.0;788.0;789.0;790.0;791.0;792.0;793.0;794.0;795.0;796.0;797.0;798.0;799.0;800.0;801.0;802.0;803.0;804.0;805.0;806.0;807.0;808.0;809.0;810.0;811.0;812.0;813.0;814.0;815.0;816.0;817.0;818.0;819.0;820.0;821.0;822.0;823.0;824.0;825.0;826.0;827.0;828.0;829.0;830.0;831.0;832.0;833.0;834.0;835.0;836.0;837.0;838.0;839.0;840.0;841.0;842.0;843.0;844.0;845.0;846.0;847.0;848.0;849.0;850.0;851.0;852.0;853.0;854.0;855.0;856.0;857.0;858.0;859.0;860.0;861.0;862.0;863.0;864.0;865.0;866.0;867.0;868.0;869.0;870.0;871.0;872.0;873.0;874.0;875.0;876.0;877.0;878.0;879.0;880.0;881.0;882.0;883.0;884.0;885.0;886.0;887.0;888.0;889.0;890.0;891.0;892.0;893.0;894.0;895.0;896.0;897.0;898.0;899.0;900.0;901.0;902.0;903.0;904.0;905.0;906.0;907.0;908.0;909.0;910.0;911.0;912.0;913.0;914.0;915.0;916.0;917.0;918.0;919.0;920.0;921.0;922.0;923.0;924.0;925.0;926.0;927.0;928.0;929.0;930.0;931.0;932.0;933.0;934.0;935.0;936.0;937.0;938.0;939.0;940.0;941.0;942.0;943.0;944.0;945.0;946.0;947.0;948.0;949.0 +Kd;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0 +Ed0;0.008263681834184113;0.008150061937857275;0.008036442041530437;0.008653103704759038;0.009408545044077642;0.01016398638339623;0.010488344184069902;0.010360825980196484;0.01023330777632306;0.010191637155400996;0.010696380296769883;0.011201123438138779;0.011705866579507668;0.0124336241778959;0.013223195044219345;0.014012765910542789;0.018109055783313344;0.02659151927620299;0.03507398276909261;0.04381097949155816;0.055626293101139083;0.06744160671072001;0.07925692032030095;0.08292022815434229;0.08345376053661055;0.08398729291887883;0.07946420390652331;0.06627491061489034;0.053085617323257374;0.04001592467681262;0.03531810626216207;0.0306202878475115;0.02592246943286094;0.024084720189220598;0.023724291035392937;0.02336386188156529;0.023338728379557444;0.02407966947494469;0.024820610570331938;0.02556155166571918;0.0260420636285473;0.026508638900532216;0.02697521417251714;0.028262801282062804;0.030112211937675996;0.0319616225932892;0.0344653431496609;0.039064159317910206;0.04366297548615952;0.048261791654408824;0.056973399295441894;0.06623517711992861;0.07549695494441531;0.09128671312524755;0.11296339658807535;0.1346400800509032;0.16000223456806956;0.20343384429096623;0.2468654540138629;0.29029706373675956;0.3314780140127663;0.3721405869931085;0.41280315997345074;0.44228060606356423;0.4584137467163324;0.4745468873691005;0.4891984939976991;0.4903663214258811;0.49153414885406305;0.49270197628224505;0.5025434831166871;0.5154035026113878;0.5282635221060885;0.5421390390359855;0.557640072217145;0.5731411053983044;0.5886572509258782;0.604717290929148;0.6207773309324178;0.6368373709356877;0.6534585436258431;0.6703568243653116;0.6872551051047802;0.7046196921452891;0.7230141293391927;0.7414085665330964;0.7598030037270002;0.8313435547085266;0.9054582758242955;0.9795729969400644;1.096456859280212;1.2423529668399906;1.388249074399769;1.5130052607099012;1.5699844332997188;1.6269636058895367;1.6839427784793544;1.6334249955634839;1.5681908858028852;1.5029567760422868;1.4613731164010952;1.441503494576857;1.4216338727526188;1.4092683763881384;1.4354268912440546;1.461585406099971;1.4877439209558871;1.5109489925517288;1.5334371166695988;1.5559252407874689;1.5725773499201214;1.5819877101135784;1.5913980703070354;1.5999789509893072;1.5999426458686026;1.599906340747898;1.5998700356271933;1.5938545242901505;1.5856200367649875;1.5773855492398245;1.5658298176634267;1.5486394481626804;1.5314490786619341;1.5141992137828073;1.4921924419912225;1.4701856701996379;1.448178898408053;1.4277062723823535;1.4080457676129727;1.3883852628435922;1.370051946375286;1.3548843309701626;1.339716715565039;1.3245491001599154;1.316912374069281;1.3097823735280656;1.30265237298685;1.3048971595233545;1.3139710427233824;1.3230449259234103;1.334767770828464;1.3558716489518368;1.3769755270752093;1.3980794051985819;1.406253894903108;1.412356740626732;1.4184595863503564;1.4098670290797608;1.3867933915675426;1.3637197540553245;1.3383766741070897;1.2997082613448347;1.2610398485825796;1.2223714358203246;1.1848501995087886;1.1476385755760852;1.1104269516433818;1.0767855549816494;1.0478861843139737;1.0189868136462978;0.991047579239586;0.9755448687035703;0.9600421581675547;0.944539447631539;0.9373105661397684;0.9333966962976676;0.9294828264555669;0.9258739566973939;0.9228159663560577;0.9197579760147213;0.916699985673385;0.9089547487548695;0.9012044090002145;0.8934540692455595;0.8860234299218475;0.8787713608356863;0.8715192917495252;0.8656805288251004;0.863396289525795;0.8611120502264895;0.8588278109271841;0.8589156610316314;0.8591888257298138;0.8594619904279962;0.8610008735156647;0.8634916028574006;0.8659823321991365;0.8699755230838804;0.8794806488238415;0.8889857745638026;0.8984909003037637;0.9324872371201554;0.9705425421821946;1.0085978472442338;1.0985421549396324;1.2400277968839506;1.3815134388282688;1.5362440205029102;1.7685988607101748;2.0009537009174396;2.2333085411247042;2.403785133434437;2.5578203868999525;2.711855640365468;2.764977030567707;2.6868329086611595;2.608688786754612;2.5200276082434994;2.3095270976326474;2.0990265870217955;1.888526076410944;1.7185097617307534;1.563884035999018;1.4092583102672829;1.2855979232569559;1.2146794763412478;1.1437610294255398;1.0735382699801517;1.0472539495660322;1.0209696291519128;0.9946853087377935;0.9795610943850517;0.9701464136203795;0.9607317328557071;0.9527561329759516;0.9480164558765263;0.943276778777101;0.9385371016776758;0.9415809870086238;0.9449965786398499;0.9484121702710759;0.966160458048754;0.993410224585509;1.020659991122264;1.0521715088609964;1.096562696888582;1.1409538849161678;1.1853450729437536;1.229841053986102;1.2743491660256459;1.3188572780651897;1.3511180390117157;1.3731225193440684;1.3951269996764213;1.4105331361725053;1.3982789194124479;1.3860247026523904;1.373770485892333;1.3426591858227317;1.3079921661312424;1.273325146439753;1.2394539978121886;1.2064095538278101;1.1733651098434317;1.1406908427678315;1.1102895733039644;1.0798883038400975;1.0494870343762304;1.0270750570113523;1.006786580426872;0.9864981038423918;0.982740582964835;0.9999871578749826;1.0172337327851302;1.0454975255204804;1.1834846643064707;1.3214718030924613;1.4594589418784514;1.6016189702853914;1.7452259467740614;1.8888329232627314;1.9750710277760861;1.9731709778256044;1.9712709278751226;1.963019916309904;1.824476257572343;1.685932598834782;1.5473889400972212;1.4444924107143677;1.3569338457528215;1.2693752807912753;1.2036837461227452;1.1781861758900771;1.152688605657409;1.127289734049951;1.118165513929601;1.109041293809251;1.0999170736889012;1.0820088700298367;1.0595800188187674;1.037151167607698;1.0100642153213586;0.9728446384929036;0.9356250616644486;0.8984054848359937;0.8628919033869671;0.8274307579008444;0.7919696124147217;0.7673511869682474;0.7492115224865316;0.7310718580048157;0.7158898614439785;0.7082267764644857;0.700563691484993;0.6929006065055002;0.6921154414186729;0.6917753755869851;0.6914353097552974;0.6909134684937591;0.6902687683688775;0.6896240682439959;0.6868480486265613;0.6778375840504511;0.6688271194743409;0.6598166548982306;0.6481532316299138;0.6362383713271093;0.6243235110243047;0.6171595741998861;0.6135404180524787;0.6099212619050713;0.6062562516257286;0.6024399424980609;0.5986236333703933;0.5948073242427256;0.588417766779378;0.5817201814923069;0.5750225962052358;0.5684935992583022;0.5621001917922099;0.5557067843261178;0.5497450688814062;0.5453498624339529;0.5409546559864995;0.5365594495390462;0.5332132855341534;0.5300122127507839;0.5268111399674145;0.5232241282376064;0.5193104943144105;0.5153968603912144;0.5107802730520642;0.5034447343540169;0.49610919565596956;0.48877365695792224;0.4799255032064642;0.4708511728064844;0.46177684240650463;0.4545551607287504;0.448942952120846;0.44333074351294166;0.43839810016892394;0.4361663570079542;0.4339346138469844;0.43170287068601465;0.4301257582378067;0.4286484963803648;0.42717123452292294;0.42890810644079713;0.433438363434334;0.4379686204278708;0.4451093208428183;0.46249110190401055;0.4798728829652028;0.49725466402639507;0.5155259041994709;0.5339277289280994;0.5523295536567279;0.5607404986315977;0.5606954704192955;0.5606504422069932;0.5566176934594774;0.5377626627225819;0.5189076319856862;0.5000526012487907;0.47947669203708104;0.45867316204061154;0.43786963204414203;0.42404304340711346;0.4158069906153947;0.40757093782367604;0.40149827672444804;0.40275322103579697;0.40400816534714584;0.40526310965849477;0.40873163616900343;0.4124419122394679;0.4161521883099324;0.4218657185637393;0.4290540623631273;0.43624240616251536;0.44366068242325146;0.4517642468897314;0.4598678113562113;0.4679713758226912;0.4747500356978052;0.48142489126828264;0.4880997468387601;0.493230485535415;0.4973501881953494;0.5014698908552837;0.5051832809290544;0.5078629497448581;0.5105426185606619;0.5132222873764656;0.5150041288840211;0.5167494121650882;0.5184946954461553;0.5195144968076371;0.5201270720176462;0.5207396472276552;0.5218182724171126;0.5238827390881607;0.525947205759209;0.5279958821179234;0.523527005776191;0.5190581294344586;0.5145892530927263;0.5008492705598162;0.4828411980951314;0.46483312563044654;0.4478722580241229;0.4327095701083357;0.4175468821925486;0.4036143074899815;0.4119922137386385;0.42037011998729545;0.4287480262359524;0.441811566269799;0.4565435035829328;0.47127544089606654;0.48172443001818677;0.4863446473788151;0.49096486473944345;0.495078568894381;0.49512212017272705;0.49516567145107304;0.4952092227294191;0.49449618482003305;0.4935925409805924;0.4926888971411517;0.4926940288907824;0.4936531701488042;0.49461231140682604;0.4949574896867126;0.49246652736274227;0.48997556503877193;0.4874846027148016;0.48405076373007655;0.48047487264761607;0.4768989815651556;0.4734650917540899;0.470142228708214;0.4668193656623381;0.46430276883592597;0.46414937812318113;0.46399598741043635;0.4638425966976915;0.4652163349992246;0.46667280337378064;0.4681292717483367;0.4736317922531141;0.48137198191896363;0.4891121715848131;0.5050194058776173;0.5367628604702205;0.5685063150628238;0.6002223389435658;0.6312377982940857;0.6622532576446055;0.6932687169951254;0.6941066202101596;0.6841312410683884;0.6741558619266173;0.6502883781886981;0.6084376350038563;0.5665868918190143;0.527021948515457;0.5019096096665027;0.47679727081754836;0.451684931968594;0.4469386885367223;0.44611749816640067;0.4452963077960791;0.4515108792361443;0.46368507393499847;0.47585926863385264;0.4854677792995505;0.48719264120426053;0.4889175031089706;0.4906423650136807;0.4807222103006338;0.47019973082509847;0.4596772513495631;0.449348070678422;0.43911968555203573;0.4288913004256495;0.4215700417875464;0.41930878072399375;0.41704751966044107;0.4148792216763058;0.4138793756200156;0.4128795295637254;0.4118796835074352;0.40893134286078925;0.4054452204369377;0.40195909801308616;0.39873222531576735;0.39576993682535966;0.392807648334952;0.3897849532366394;0.386531313966281;0.3832776746959225;0.380024035425564;0.3755742514253436;0.37102184466478716;0.3664694379042307;0.36377702668714573;0.3621497230173699;0.3605224193475941;0.3585561071005829;0.355965739445445;0.35337537179030715;0.35086815644881947;0.34947584810793053;0.3480835397670414;0.34669123142615244;0.3466011357831534;0.346861234368925;0.34712133295469666;0.3515718729704562;0.3600806428232019;0.3685894126759476;0.3779782062144297;0.3903257164778606;0.4026732267412915;0.4150207370047224;0.42084820831832787;0.4263453730985994;0.43184253787887084;0.4245502601482941;0.41111771544388176;0.3976851707394694;0.3854801964904458;0.37511048920708495;0.36474078192372417;0.35597176945137093;0.3581768063614712;0.3603818432715715;0.3625868801816716;0.36502381583768906;0.36750003611679516;0.36997625639590126;0.36623367623795366;0.35806730420941085;0.349900932180868;0.338758419851439;0.32114068562674714;0.3035229514020552;0.28614338073526624;0.2736121088140224;0.2610808368927786;0.24854956497153477;0.24566685936899604;0.24550331350683358;0.24533976764467114;0.24168736326568968;0.23474740848749245;0.22780745370929523;0.22299103116000998;0.22451229858894922;0.2260335660178884;0.2275548334468276;0.22518978404312273;0.22277955090228502;0.22036931776144733;0.21869320250272725;0.21729210904850735;0.21589101559428744;0.2163367660221175;0.2188830321118377;0.22142929820155793;0.22168337417642148;0.21329962366022545;0.20491587314402937;0.1965321226278333;0.18810330910995932;0.17967227419564982;0.17124123928134038;0.16404076294505324;0.1573732244009187;0.1507056858567842;0.14183480162784742;0.13020531463666976;0.11857582764549214;0.10882685204094876;0.10700231079080444;0.10517776954066012;0.1033532282905158;0.09870322079447569 +ku;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0;1.0 +Lu0;0.05982312027156666;0.06322126246713124;0.06661940466269584;0.06975927492644378;0.06745666739639489;0.06515405986634604;0.06285145233629715;0.06349708233562656;0.06526289066973963;0.06702869900385275;0.0691304282147417;0.07172861353421577;0.07432679885368979;0.07967923321929311;0.11585531556506877;0.1520313979108444;0.18820748025662012;0.23278136968926808;0.2800065073452595;0.3272316450012509;0.3530841925514375;0.3514737892331573;0.34986338591487715;0.34207208264741323;0.28663328656408354;0.23119449048075388;0.1757556943974242;0.14899196531611383;0.1297771998156824;0.11056243431525092;0.10051187541864569;0.10087929950215022;0.10124672358565473;0.10227674712102695;0.10724598570974031;0.11221522429845367;0.11718446288716704;0.12187035646813656;0.12649388923241017;0.13111742199668383;0.1389583033613666;0.15008314975140982;0.16120799614145304;0.17543717548274074;0.20484561897715153;0.23425406247156233;0.2636625059659731;0.3169555422636925;0.37465130238244887;0.4323470625012052;0.5325161214659141;0.6721126897769044;0.8117092580878948;0.9802996294580284;1.27050513793265;1.5607106464072715;1.8509161548818933;2.141423310781463;2.4319770953749997;2.7225308799685366;2.9234255678377714;3.047765600073019;3.1721056323082677;3.2740232484591965;3.292813767515478;3.3116042865717583;3.3303948056280395;3.40431334566587;3.4853834556445924;3.566453565623315;3.648613649071283;3.731638393435233;3.8146631377991844;3.8939981613054147;3.960969618522084;4.027941075738752;4.094912532955422;4.150388046669895;4.2046117307400035;4.258835414810112;4.30808014965198;4.35362244688694;4.399164744121899;4.519097262079425;4.868258043893153;5.217418825706881;5.56657960752061;6.224633130231713;6.910907468131515;7.597181806031316;7.980548582943481;8.151108028677678;8.321667474411878;8.338631520354516;7.914380703034323;7.490129885714136;7.065879068393945;6.8821955079416455;6.716922454812062;6.551649401682478;6.528200053695241;6.599528544479434;6.6708570352636265;6.742488562076586;6.814940391269906;6.8873922204632265;6.959844049656547;6.997439437276378;7.032808072812217;7.068176708348056;7.089180612735619;7.1010003785275915;7.112820144319561;7.118925335201602;7.110329086598484;7.101732837995365;7.093136589392246;7.056496575997106;7.018371016809752;6.980245457622398;6.930662058777607;6.8740371677292655;6.817412276680923;6.76210861284501;6.710056478015519;6.658004343186027;6.605952208356536;6.567316820552612;6.529263629919939;6.491210439287265;6.47388460686388;6.468846969070576;6.463809331277271;6.483620847562404;6.562214206509203;6.640807565456001;6.7194009244028;6.873838544757693;7.0309139745881595;7.187989404418627;7.303218986684283;7.394457619249825;7.485696251815367;7.5297996566202485;7.466379422367542;7.402959188114834;7.339538953862124;7.183098187774294;7.02416530423338;6.8652324206924655;6.704530795112883;6.542847262021263;6.381163728929644;6.229355747903498;6.0993107780180305;5.969265808132563;5.839220838247096;5.777967425235982;5.718028720889004;5.658090016542025;5.637337207128491;5.637650334869492;5.637963462610493;5.637777495937329;5.636528570328043;5.635279644718756;5.63403071910947;5.59513275189041;5.555803988321308;5.516475224752206;5.473494728143614;5.428615414430917;5.383736100718221;5.345802325123574;5.322151815811903;5.298501306500232;5.274850797188562;5.262997350595787;5.251185233272782;5.2393731159497765;5.230639730993271;5.22345091696755;5.216262102941828;5.222510151402131;5.255382652913254;5.288255154424377;5.321936360381969;5.516774645860251;5.711612931338535;5.906451216816818;6.494587930048172;7.272363919527919;8.050139909007669;8.992267556289907;10.24713177453452;11.501995992779136;12.749771711708478;13.513066362016453;14.276361012324426;15.039655662632395;14.919699918632764;14.392611913958337;13.865523909283912;13.100618949838989;11.903058516930077;10.705498084021169;9.516348762262073;8.654284207450301;7.7922196526385346;6.930155097826763;6.389887722363338;5.990436048048003;5.59098437373267;5.278241570495735;5.115490717452705;4.952739864409673;4.7932930350584435;4.719299706251618;4.645306377444796;4.571313048637973;4.515340003157269;4.466787330343658;4.418234657530047;4.38568556246604;4.3792879687118855;4.3728903749577315;4.372127281654826;4.475854888105011;4.579582494555196;4.6833101010053815;4.843583181270806;5.025528663654037;5.207474146037269;5.388536783785214;5.5682467673924325;5.74795675099965;5.92133583826475;6.006792446756895;6.092249055249039;6.177705663741183;6.160339483202501;6.106785852071693;6.053232220940885;5.966976682488272;5.834137576767231;5.701298471046191;5.569554440794527;5.449520376277349;5.329486311760173;5.209452247242997;5.096318686120927;4.985377724302097;4.874436762483266;4.779386271317553;4.705183934424868;4.630981597532183;4.575361281518129;4.675645198613405;4.775929115708681;4.876213032803957;5.431363365450886;6.11422186271972;6.797080359988554;7.495410735554435;8.212242677853423;8.92907462015241;9.55208232398582;9.549287661639667;9.546492999293513;9.543698336947356;8.989385901369936;8.302072372684753;7.6147588439995735;7.044433346320599;6.6001420439189635;6.155850741517327;5.758809390168274;5.61461305956275;5.4704167289572245;5.326220398351699;5.252486499161361;5.19278791878806;5.133089338414757;5.047185112480367;4.9361773619596505;4.825169611438933;4.7030969821614095;4.533230047786869;4.363363113412329;4.193496179037789;4.034759135638225;3.8777493988289033;3.7207396620195814;3.6063212404596734;3.5276408029126713;3.4489603653656697;3.38108744635927;3.3510289365474755;3.320970426735681;3.2909119169238865;3.2853582391769587;3.282489434941285;3.2796206307056117;3.274693625644635;3.2682804130542635;3.2618672004638922;3.245757211368117;3.2021336433765346;3.1585100753849518;3.11488650739337;3.064584807160251;3.013864214418403;2.9631436216765557;2.9386374209581723;2.9300724271686867;2.9215074333792006;2.913651473769718;2.907424827888132;2.901198182006546;2.8949715361249604;2.87049299241411;2.8457384180336773;2.820983843653244;2.7958698361676593;2.7705767885490693;2.745283740930478;2.722365411028688;2.703848807390365;2.685332203752042;2.667095477191747;2.656832060278898;2.6465686433660482;2.636305226453199;2.62250390098909;2.6073126041486017;2.5921213073081133;2.571755176427817;2.543707950696351;2.5156607249648846;2.4870090476719904;2.452068405471985;2.417127763271979;2.3821871210719734;2.3630439171316135;2.34852848692818;2.334013056724746;2.326565887865136;2.3274241118805064;2.3282823358958766;2.3293230544249446;2.3314252398567046;2.333527425288464;2.335629610720224;2.3612274192066693;2.3914931007929696;2.4217587823792703;2.48762553920134;2.5860355831065287;2.6844456270117174;2.7821589432229357;2.8772708508800378;2.9723827585371403;3.067494666194242;3.0671813382059385;3.0563484142165698;3.0455154902272015;2.971376831993865;2.8533950288874332;2.7354132257810027;2.6162342086751624;2.4940009307116737;2.371767652748185;2.2495343747846963;2.1938066257509803;2.139920464276213;2.0860343028014463;2.0655060359357598;2.061767209391632;2.058028382847505;2.059793594573282;2.0714275780613662;2.0830615615494503;2.095771427331391;2.128262237347585;2.1607530473637793;2.193243857379973;2.2286445284883074;2.26503674625141;2.3014289640145127;2.3358936237354393;2.3679133960100764;2.399933168284713;2.4299177481415466;2.4470357476339966;2.464153747126447;2.481271746618897;2.493715410632547;2.505222331037886;2.516729251443225;2.523477767003516;2.526011557463718;2.5285453479239193;2.529644606933361;2.5258949966856994;2.522145386438038;2.5183957761903764;2.519092266272645;2.5201383880737986;2.521184509874952;2.5019825420826027;2.4707183710364173;2.4394541999902315;2.3875589953137237;2.293214176730923;2.198869358148122;2.1049989761622667;2.0274475649391506;1.9498961537160344;1.8723447424929183;1.8727629231289495;1.9019802001373447;1.9311974771457399;1.974073284458693;2.0348262276986078;2.0955791709385223;2.1497948937296876;2.162762392353364;2.17572989097704;2.1886973896007165;2.188054686850479;2.1848454938891315;2.1816363009277837;2.174963539550417;2.165419546303021;2.1558755530556244;2.1491774328504976;2.1508805046998;2.1525835765491026;2.154286648398405;2.139373958765062;2.1237724889247995;2.1081710190845375;2.0883297910344263;2.0663838011874933;2.0444378113405604;2.0229701327811096;2.002292137665557;1.9816141425500045;1.9619624815788828;1.9530682247386049;1.944173967898327;1.935279711058049;1.9289933427581494;1.923367517913504;1.9177416930688584;1.9252826582268041;1.9454921702597852;1.9657016822927664;2.0067075436288984;2.120455350107932;2.2342031565869656;2.3479509630659994;2.455293679381271;2.5621982492040947;2.669102819026918;2.6708587625524896;2.616141691255734;2.561424619958978;2.4644865991430693;2.2944665606574546;2.12444652217184;1.9602227455423002;1.8602473190439903;1.7602718925456806;1.660296466047371;1.634870266333509;1.6280433634459188;1.6212164605583288;1.6398933979893917;1.6822152965793087;1.7245371951692257;1.757637559765151;1.7612970539888015;1.7649565482124523;1.7686160424361028;1.7318144338136476;1.6932894797504014;1.6547645256871553;1.6198826161107722;1.5867086236544798;1.5535346311981875;1.5318125888578609;1.5270170331246016;1.5222214773913423;1.5180694470148857;1.5183279499072522;1.5185864527996185;1.518844955691985;1.5111904307045994;1.5021633472269973;1.493136263749395;1.4850387571525416;1.4776196013046534;1.470200445456765;1.4611463752526577;1.4483694827251494;1.435592590197641;1.4226867547858617;1.4060355681816434;1.389384381577425;1.3727331949732067;1.363943082335169;1.3576011513039332;1.3512592202726972;1.3421408145561589;1.3301658689638747;1.3181909233715903;1.30660450540935;1.2963610117427526;1.2861175180761555;1.275874024409558;1.2758050490612136;1.2761928032948262;1.2765805575284388;1.29404901431088;1.3191613784416598;1.3442737425724396;1.3788381883949807;1.4261488569819925;1.473459525569004;1.5142560278947002;1.5213411280622502;1.5284262282298002;1.5355113283973503;1.4944008620765294;1.4478915882174455;1.4013823143583617;1.358933126718041;1.3187897620098663;1.2786463973016917;1.2561572834987063;1.262778610380973;1.2693999372632399;1.2759845165958195;1.282295621620371;1.2886067266449226;1.294917831669474;1.2705320790107097;1.2411751298167364;1.211818180622763;1.1601645524587678;1.0938946440886679;1.0276247357185677;0.9719895933851651;0.9362189215512972;0.9004482497174291;0.8676666009972462;0.8634912007824198;0.8593158005675935;0.8551404003527671;0.8360088021373207;0.8140661815960367;0.7921235610547528;0.7827594540145266;0.7821274045755726;0.7814953551366186;0.7821243528342167;0.7852012810450468;0.7882782092558771;0.7900096042060425;0.7783084691310512;0.7666073340560599;0.7549061989810685;0.7689074879212844;0.7876807526539363;0.8064540173865882;0.7929805149035416;0.7577474087991741;0.7225143026948068;0.6916391332097769;0.6687828559003016;0.6459265785908264;0.6215438747607506;0.5846137515736236;0.5476836283864966;0.5107535051993697;0.4773204454368641;0.44442773684027026;0.41153502824367644;0.39109381472848054;0.37811610898098363;0.36513840323348684;0.35330660980405315;0.3433001113814021;0.33329361295875104;0.32292643580622593;0.3104745850372413;0.29802273426825665;0.28557088349927195;0.2736885255519861 +Lw;0.0324839543074607;0.034329145519652264;0.036174336731843844;0.037879286285058975;0.036628970396242425;0.0353786545074259;0.03412833861860935;0.034478915708245225;0.03543774963366862;0.03639658355909205;0.037537822520604745;0.03894863714907916;0.040359451777553554;0.04326582363807616;0.06290943635183234;0.08255304906558852;0.10219666177934474;0.12640028374127257;0.1520435334884759;0.17768678323567924;0.19172471655543058;0.19085026755360443;0.1899758185517783;0.1857451408775454;0.15564187460429738;0.12553860833104938;0.09543534205780134;0.08090263716664982;0.07046901949991555;0.060035401833181255;0.054577948352324615;0.05477745962966757;0.05497697090701052;0.05553627368671764;0.05823457024038899;0.06093286679406035;0.06363116334773171;0.06617560356219815;0.06868618185319873;0.07119676014419933;0.07545435872522208;0.08149515031501554;0.08753594190480901;0.09526238628712823;0.1112311711045933;0.12719995592205835;0.14316874073952343;0.17210685944918502;0.20343565719366974;0.23476445493815443;0.28915625395599137;0.3649571905488591;0.4407581271417269;0.5323026987957095;0.689884289897429;0.8474658809991485;1.0050474721008682;1.1627928577543345;1.320563562788625;1.4783342678229154;1.58742008333591;1.6549367208396493;1.7224533583433894;1.7777946239133438;1.7879978757609047;1.7982011276084648;1.8084043794560256;1.8485421466965675;1.892563216415014;1.9365842861334601;1.9811972114457068;2.0262796476353317;2.0713620838249573;2.1144410015888404;2.150806502857492;2.187172004126143;2.2235375053947943;2.2536607093417533;2.283104169791822;2.312547630241891;2.339287521261025;2.3640169886596083;2.3887464560581915;2.453869813309128;2.6434641178339824;2.8330584223588366;3.0226527268836914;3.3799757897158207;3.752622755195413;4.125269720675005;4.333437880538311;4.426051659571979;4.51866543860565;4.527876915552502;4.297508721747637;4.067140527942776;3.8367723341379127;3.737032160812314;3.64728889296295;3.5575456251135855;3.544812629156516;3.583543999652333;3.6222753701481496;3.6611712892075863;3.700512632459559;3.739853975711532;3.779195318963505;3.7996096144410734;3.818814783537034;3.838019952632995;3.8494250727154418;3.8558432055404825;3.862261338365522;3.86557645701447;3.860908694022977;3.8562409310314836;3.8515731680399896;3.831677640766429;3.8109754621276957;3.790273283488962;3.7633494979162405;3.7326021820769912;3.701854866237741;3.6718249767748405;3.6435606675624275;3.615296358350013;3.587032049137599;3.566053033560068;3.545390151046527;3.524727268532985;3.515319341527087;3.512583904205323;3.5098484668835583;3.5206061202263856;3.563282314134497;3.6059585080426086;3.6486347019507206;3.7324943298034277;3.8177862882013707;3.903078246599315;3.965647909769566;4.015190487252656;4.064733064735744;4.088681213544795;4.054244026345575;4.019806839146355;3.9853696519471336;3.900422315961442;3.8141217601987254;3.727821204436009;3.640560221746296;3.5527660632775464;3.4649719048087966;3.3825401711115997;3.311925752463791;3.2413113338159816;3.170696915168173;3.1374363119031385;3.1048895954427294;3.0723428789823197;3.0610741034707707;3.061244131834134;3.061414160197498;3.06131318029397;3.0606350136881275;3.059956847082285;3.0592786804764422;3.038157084276493;3.016801565658471;2.9954460470404483;2.972107637381983;2.947738170035988;2.923368702689994;2.902770662542101;2.8899284359858637;2.8770862094296263;2.8642439828733894;2.8578075613735128;2.851393581667121;2.8449796019607287;2.8402373739293467;2.8363338479133797;2.8324303218974127;2.8358230122113572;2.8536727805318973;2.871522548852437;2.8898114436874094;2.9956086327021167;3.1014058217168246;3.207203010731533;3.5265612460161577;3.9488936083036603;4.371225970591165;4.88280128306542;5.564192553572244;6.2455838240790715;6.923126039457704;7.337595034574934;7.752064029692163;8.166533024809391;8.101397055817591;7.8151882692793775;7.528979482741165;7.113636089762571;6.463360774693032;5.813085459623495;5.167377377908306;4.699276324645513;4.231175271382725;3.7630742181199324;3.469709033243293;3.252806774090066;3.03590451493684;2.8660851727791843;2.777711459576819;2.6893377463744526;2.602758118036735;2.562579740494629;2.5224013629525244;2.482222985410419;2.4518296217143973;2.4254655203766067;2.399101419038816;2.3814272604190596;2.377953367010554;2.3744794736020483;2.3740651139385704;2.430389204241021;2.486713294543472;2.5430373848459222;2.6300656674300478;2.7288620643641424;2.8276584612982374;2.925975473595371;3.023557994694091;3.1211405157928103;3.2152853601777593;3.2616882985889943;3.3080912370002284;3.354494175411463;3.345064339378958;3.3159847176749295;3.2869050959709005;3.240068338591132;3.1679367041846067;3.095805069778082;3.0242680613514286;2.959089564318601;2.8939110672857744;2.828732570252948;2.767301046563664;2.7070601042960387;2.6468191620284136;2.5952067453254313;2.5549148763927034;2.5146230074599756;2.484421175864344;2.538875342847079;2.593329509829814;2.6477836768125487;2.949230307439831;3.3200224714568085;3.690814635473785;4.0700080294060585;4.459247774074409;4.8484875187427585;5.186780701924301;5.18526320027034;5.183745698616378;5.182228196962415;4.881236544443875;4.508025298367821;4.134814052291769;3.8251273070520853;3.5838771298479974;3.3426269526439087;3.127033498861373;3.048734891342573;2.9704362838237732;2.892137676304973;2.8521001690446193;2.819683839901917;2.787267510759213;2.7406215160768395;2.6803443075440905;2.620067099011341;2.5537816613136455;2.4615439159482704;2.369306170582895;2.2770684252175193;2.1908742106515566;2.1056179235640946;2.020361636476633;1.9582324335696029;1.9155089559815808;1.872785478393559;1.8359304833730836;1.8196087125452793;1.8032869417174748;1.7869651708896706;1.7839495238730887;1.782391763173118;1.7808340024731473;1.7781586387250368;1.7746762642884653;1.7711938898518935;1.7624461657728876;1.7387585683534583;1.7150709709340288;1.6913833735146;1.6640695502880165;1.6365282684291929;1.6089869865703699;1.5956801195802877;1.5910293279525969;1.586378536324906;1.582112750256957;1.5787316815432557;1.5753506128295545;1.5719695441158537;1.5586776948808618;1.545235960992287;1.5317942271037117;1.518157321039039;1.5044231961821448;1.4906890713252496;1.4782444181885777;1.4681899024129683;1.458135386637359;1.4482328441151189;1.4426598087314417;1.4370867733477644;1.4315137379640872;1.424019618237076;1.4157707440526908;1.4075218698683056;1.3964630608003046;1.3812334172281187;1.3660037736559325;1.3504459128858908;1.331473144171288;1.3125003754566849;1.2935276067420816;1.2831328470024663;1.2752509684020017;1.267369089801537;1.263325277110769;1.263791292751115;1.264257308391461;1.264822418552745;1.2659639052421907;1.2671053919316362;1.2682468786210819;1.2821464886292215;1.2985807537305827;1.3150150188319438;1.3507806677863277;1.4042173216268452;1.4576539754673628;1.5107123061700543;1.5623580720278607;1.6140038378856674;1.6656496037434736;1.6654794666458248;1.6595971889195975;1.6537149111933704;1.6134576197726689;1.5493935006858763;1.4853293815990845;1.4206151753106133;1.3542425053764389;1.2878698354422646;1.2214971655080902;1.1912369977827824;1.1619768121019838;1.1327166264211854;1.1215697775131177;1.1195395946996562;1.1175094118861952;1.1184679218532922;1.1247851748873219;1.1311024279213515;1.1380038850409455;1.1556463948797386;1.1732889047185322;1.1909314145573255;1.2101539789691511;1.2299149532145157;1.2496759274598805;1.2683902376883436;1.2857769740334717;1.3031637103785993;1.3194453372408599;1.3287404109652603;1.3380354846896607;1.3473305584140611;1.3540874679734731;1.3603357257535722;1.3665839835336713;1.3702484274829092;1.371624275702799;1.3730001239226883;1.3735970215648152;1.3715609832003348;1.3695249448358549;1.3674889064713744;1.3678671005860463;1.3684351447240728;1.369003188862099;1.3585765203508533;1.3416000754727746;1.324623630594696;1.2964445344553521;1.2452152979648914;1.1939860614744304;1.143014444056111;1.1009040277619588;1.0587936114678067;1.0166831951736548;1.0169102672590196;1.0327752486745783;1.0486402300901367;1.0719217934610703;1.104910641640344;1.1378994898196177;1.1673386272952204;1.1743799790478766;1.1814213308005328;1.1884626825531892;1.1881136949598101;1.1863711031817985;1.1846285114037867;1.1810052019758766;1.1758228136425406;1.1706404253092042;1.1670033460378202;1.1679281140519915;1.1688528820661628;1.169777650080334;1.1616800596094288;1.1532084614861662;1.144736863362904;1.1339630765316935;1.122046404044809;1.1101297315579244;1.0984727821001425;1.0872446307523975;1.0760164794046525;1.0653456274973334;1.0605160460330625;1.0556864645687916;1.0508568831045206;1.0474433851176752;1.0443885622270328;1.0413337393363902;1.0454284834171548;1.0564022484510633;1.0673760134849724;1.0896421961904919;1.1514072551086072;1.2131723140267223;1.2749373729448377;1.3332244679040302;1.3912736493178235;1.4493228307316166;1.450276308066002;1.4205649383518635;1.3908535686377252;1.3382162233346868;1.2458953424369978;1.153574461539309;1.0644009508294692;1.0101142942408867;0.9558276376523046;0.9015409810637225;0.8877345546190955;0.884027546351134;0.8803205380831726;0.8904621151082398;0.9134429060425647;0.9364236969768897;0.9543971949524771;0.9563843003159193;0.9583714056793616;0.9603585110428039;0.9403752375608108;0.919456187504468;0.8985371374481254;0.8795962605481494;0.8615827826443826;0.8435693047406159;0.8317742357498185;0.8291702489866587;0.8265662622234989;0.824311709729083;0.824452076799638;0.8245924438701929;0.8247328109407479;0.8205764038725976;0.8156746975442596;0.8107729912159215;0.8063760451338302;0.8023474435084269;0.7983188418830235;0.7934024817621932;0.7864646291197562;0.779526776477319;0.772518907848723;0.7634773135226325;0.7544357191965418;0.7453941248704513;0.7406210937079969;0.7371774251580357;0.7337337566080746;0.7287824623039943;0.722280066847384;0.7157776713907735;0.7094862464372771;0.7039240293763147;0.6983618123153524;0.69279959525439;0.6927621416402391;0.6929726921890906;0.6931832427379423;0.7026686147708079;0.7163046284938214;0.7299406422168347;0.7487091362984746;0.774398829341222;0.8000885223839692;0.8222410231468222;0.826088232537802;0.8299354419287815;0.8337826513197613;0.8114596681075555;0.7862051324020729;0.7609505966965905;0.7379006878078963;0.7161028407713574;0.6943049937348187;0.6820934049397975;0.6856887854368684;0.6892841659339393;0.6928595925115301;0.6962865225398615;0.6997134525681931;0.7031403825965244;0.6898989189028154;0.6739580954904879;0.6580172720781604;0.629969351985111;0.5939847917401467;0.5580002314951823;0.5277903492081447;0.5083668744023544;0.488943399596564;0.47114296434150477;0.468875722024854;0.4666084797082033;0.46434123739155253;0.4539527795605651;0.442037936606648;0.43012309365273077;0.425038383529888;0.42469518068453593;0.42435197783918394;0.42469352358897966;0.4263642956074605;0.4280350676259413;0.4289752150838811;0.42262149873816085;0.41626778239244056;0.4099140660467202;0.4175167659412575;0.42771064869108744;0.4379045314409174;0.4305884195926231;0.4114568429779516;0.3923252663632801;0.3755600493329089;0.3631490907538638;0.35073813217481875;0.33749832399508756;0.3174452671044776;0.2973922102138677;0.27733915332325776;0.2591850018722172;0.24132426110426677;0.22346352033631633;0.21236394139756495;0.20531704717667412;0.19827015295578337;0.1918454891236009;0.18641196048010136;0.18097843183660184;0.1753490546427807;0.16858769967522202;0.16182634470766338;0.1550649897401047;0.14861286937472845 +Rs;3.930929936470369;4.212133083331844;4.501287577873816;4.3775375376844385;3.893159912041779;3.4807853112849565;3.2539300789198715;3.3278153473620415;3.462980925450265;3.5712205020764403;3.509394905484101;3.477208100078845;3.4477970087414933;3.479743558197035;4.757506498350702;5.891274398830716;5.643400904066695;4.753405867049854;4.334937793903962;4.055759202323182;3.446656353800871;2.8298594422909606;2.396961902935783;2.2400461867014108;1.8650073238583231;1.494733357489018;1.2009853162320165;1.2207128823870943;1.3274597349184885;1.5002877558885699;1.5453248808755216;1.7889269984155067;2.1208230585207395;2.3058716584788708;2.454639009170479;2.6079963621997786;2.726419465229592;2.74819401616185;2.767304279585261;2.7853066619457976;2.8974032089572592;3.0742864852777996;3.2450508583539732;3.370592509086748;3.693889088414071;3.97977153853152;4.15399144926059;4.405748452143885;4.659225692444063;4.864395765064975;5.075285265261065;5.510020602618002;5.838091449731123;5.831108170861376;6.107148959172273;6.294306128448143;6.2814589734576;5.715827972513863;5.349325072897676;5.09248784260341;4.788915150417106;4.447073978711965;4.172577938730334;4.019607913031214;3.9004019590785144;3.789301279748637;3.696667920372893;3.7697167728024215;3.850318885935467;3.930538904565069;3.9423398730765884;3.931443300964795;3.9210772600137553;3.900182147643661;3.856979815503589;3.816114362633557;3.7773041984915174;3.726800511820993;3.6778149845816084;3.6313001337282205;3.579856050670068;3.5265054411847605;3.4757784093782744;3.4825450390664816;3.656172141822467;3.821183825278028;3.97820581395035;4.065678708366071;4.14444580759855;4.211293832681478;3.9522192267400933;3.5626362054174856;3.2549385567279163;2.9926379194663375;2.7372938422805486;2.4998349767750834;2.2784457899469848;2.287850480409201;2.3257939616806307;2.3670312292557183;2.4256725331627016;2.4859766300492088;2.547966420590816;2.597923398090381;2.5779875346019203;2.5587652696196463;2.540218962236016;2.5147173287591906;2.4903628208967197;2.466712314976352;2.4478446627194343;2.437340809217572;2.426961179876484;2.416017069864755;2.4131544364997564;2.4102916732168405;2.4074287800071623;2.4040322265125984;2.403460711749658;2.4028832299849423;2.4034217866230265;2.4102460947287527;2.417223607246638;2.4249285981345894;2.441749847426087;2.459074681267359;2.4769260573267116;2.497749784071163;2.5179509307122485;2.5387242020373284;2.565829237955162;2.5925341550670553;2.6198437521198237;2.6579657332456272;2.705785429841392;2.7530974465089955;2.800927382940063;2.8603743234193355;2.905533047584133;2.950072344576801;2.9710396043711533;2.961335234317067;2.9519283275640467;2.924498564488934;2.883009989191828;2.8461696138912957;2.8096462460388745;2.7665178598490243;2.7503172306636725;2.7335683840836813;2.720131254659776;2.733510410714345;2.747710081250372;2.7671950374409735;2.795227408356633;2.8243311115513228;2.8553854087166064;2.9137057953536596;2.9630027019350647;3.015095816587049;3.088725675329817;3.1379839411203196;3.188833046707928;3.2410644023077118;3.2653371510502494;3.2783026329744374;3.2913773051004167;3.2813938250446575;3.2691258881995475;3.2567763750411927;3.2421813939472757;3.2429977114635724;3.2438464276191734;3.2489310446514907;3.2616839898249332;3.273987225407073;3.2864952158701883;3.3012265682492856;3.302531660442041;3.3038436765719896;3.3071092223516234;3.302226256425106;3.2966330998211997;3.2995327818966955;3.3143668819750376;3.32547825520273;3.337032796441492;3.443325189291894;3.526405982740424;3.6077101597100434;3.9249827069187795;4.234796414478783;4.503899397096783;4.841177577769547;5.0650696730686775;5.0366482427035235;5.011262174423403;4.776321298339617;4.383166924906504;4.081320332931755;3.6275314882097263;3.2512008500998313;2.943513751513333;2.6231617877727036;2.3375820859408623;2.1635455784707274;1.98083320791089;1.8647717625288185;1.8320526638201557;1.7927711070392736;1.837257677605021;1.892806690148844;1.9412593549479435;2.033754317358325;2.1606377929887417;2.2140307782881474;2.2756135688098977;2.387040883546711;2.408586154292159;2.4312407681238506;2.4649299634531125;2.476073758216443;2.4729271637317933;2.4787640284769563;2.4958678141309596;2.50468170555819;2.5168276876447617;2.5895504822309046;2.640997778049544;2.691054594616798;2.7731251768714866;2.8244398139366202;2.8464157015074525;2.8667484755409314;2.8736360652524917;2.846294630164625;2.8180677612697766;2.751678285959996;2.68985266533281;2.632319512456098;2.536335352591211;2.454252420536424;2.3937449496793874;2.322418202316074;2.2459144155810704;2.2140111152350985;2.1819726990175465;2.1539912195715307;2.155357888169136;2.1626525322546284;2.173287046361334;2.184074688592221;2.193964026254878;2.2117640311221827;2.239796078482865;2.2648352897497186;2.3006279140441737;2.419158369456252;2.5249659137629608;2.629935408644305;2.989595515645325;3.3783304862007593;3.6908620339854474;4.00105491808908;4.265192088192137;4.096789476848863;3.925002932174853;3.5528667860957106;3.236566121399455;2.9693737974394847;2.584260621639381;2.282462369692001;2.0955173671002663;1.940437132695543;1.8256957558459161;1.832102193037921;1.8547796638030463;1.9702447215055212;2.0563876014791633;2.13137706407524;2.246853402775214;2.342545414428468;2.365727563093781;2.377590532799437;2.3776889175727405;2.343183604190729;2.3026930336760585;2.2379359088342414;2.189728971923826;2.1490292236314747;2.112396224462675;2.084637681074741;2.0767567158580484;2.0929670589263254;2.132120727570204;2.170359312728076;2.218832773428388;2.297573901853731;2.3500151851489792;2.385127720618838;2.440183552874959;2.4897569572754708;2.514496855602081;2.5381826953604367;2.5612277542065884;2.5591018258765694;2.5477145153908047;2.5147089594958842;2.4823238352452535;2.4503258020950036;2.41300967717857;2.3826642176557624;2.373705773226369;2.38578860383891;2.4113203511026793;2.447536259806393;2.4866666670180213;2.5287077191007725;2.552582312073682;2.562128749570654;2.5555392019166168;2.5488165389612116;2.5426505101106276;2.536079827806752;2.5292613840918814;2.5333855561233762;2.5411606219271716;2.5532734054314368;2.5649108249235306;2.5764674434597654;2.596080971876013;2.614096705354496;2.6249456295360436;2.63241956137746;2.6386092822872986;2.639697674558694;2.6347752508430085;2.621875872468365;2.6107430830017133;2.6004595086581848;2.583393975587331;2.569598797569265;2.5693537313521424;2.5863919843410117;2.609082855117509;2.640762121066765;2.683067071025401;2.7368009321666955;2.781306687541689;2.817334390878869;2.8555743624065513;2.8903076711404405;2.907713669896721;2.954699735203278;3.008042896881879;3.0572803270826254;3.151254884113022;3.2872469121080106;3.3985227921276535;3.485414383258503;3.5672831320689693;3.626084115312475;3.6014738378451594;3.470668015984963;3.3375196030971837;3.207821173916226;3.0218651932758918;2.8051975318503826;2.64887124297925;2.533666223927685;2.415484593297529;2.31374217991154;2.2714428690974953;2.2956628971216246;2.3237091641962415;2.3624018544233745;2.445248316956928;2.5567874836928506;2.6353678695143725;2.689872818631449;2.7597286030583668;2.81720369300025;2.8255612260883667;2.86045306506799;2.895128810779826;2.9137245790900708;2.9341197949507216;2.9554451178291714;2.9622599620430363;2.9562480557866135;2.9473910740224447;2.93729816953981;2.92065019825023;2.889396426870209;2.8592250590912776;2.8379788459282675;2.812666092952148;2.7870035470494687;2.7706802876351153;2.755097836506101;2.735207638016752;2.7178257392003955;2.7046608189372496;2.6864769626227947;2.6684829917202384;2.655296976811875;2.6470607772051955;2.6392461808053;2.6351587824295226;2.6120088598363926;2.5763355692528216;2.5384769001263816;2.4746845767659127;2.367567094814038;2.261354873990786;2.183296050528389;2.120964811708955;2.0575509595359107;2.0299184903219953;2.1060967276008284;2.2218193836203906;2.3413824172017725;2.477231537062371;2.6461954064617417;2.8192744129811667;2.833399730305976;2.793680909298142;2.75551433127849;2.6899763910377943;2.6024106917206082;2.5173624598940996;2.4591414459903205;2.4283298034448983;2.3949225251924156;2.3645548380805512;2.3570010276064868;2.3586613155742433;2.3603213115132564;2.365594894338898;2.3535202888228106;2.34064227584122;2.323423456014042;2.2970845628113308;2.268537151558909;2.2428789435242007;2.230553187000721;2.2189772477049208;2.2072830062986957;2.200896491284966;2.207224781993653;2.213647974470585;2.21950234854974;2.2279287440221704;2.237243437288042;2.2427902851993844;2.2523535152506597;2.2767486726487633;2.3011599647900223;2.3422268613854844;2.467268816148238;2.5915326967182604;2.691832334311496;2.7696345404009644;2.8444878908039475;2.869835918904936;2.7018939179128676;2.4987672092875193;2.3172305967247517;2.1199874705716355;1.8812974161398548;1.6639643954213217;1.5334833580858125;1.4764919851685472;1.4178140273389;1.3863710490641998;1.459039519495649;1.5602682644368697;1.6703678861248672;1.7741483684680068;1.9157888728606074;2.0731789588278757;2.135409664527308;2.1437946376162773;2.1522105368954514;2.1269886401575;2.028047246766966;1.9322019094934109;1.8508687409585975;1.8054383136287349;1.7622252776095682;1.7193160739739513;1.7302596342067158;1.7634426279480102;1.7981448065937329;1.8344614420721648;1.8775110839387323;1.9226140587413016;1.9563363834956247;1.9569740525246349;1.955831551781868;1.954238604526927;1.9483358984144392;1.9432967392600884;1.9382331147892424;1.9401850594570047;1.9397555809689997;1.9393186528942326;1.9374378562879973;1.9290937549395777;1.9206238025009763;1.9123214446349361;1.9160701007851717;1.923350807591085;1.9307561843724286;1.9404484187565803;1.9467319168227237;1.9531715263465637;1.950332743379771;1.9437375887280526;1.9370828964787177;1.9321929860758011;1.946148364501273;1.9610101538154177;1.9756231222398084;2.010635695070404;2.057852632081413;2.105448814537777;2.160146228623137;2.232589729290889;2.304924665890212;2.338756556944241;2.2941756214965654;2.2516529595993444;2.2059013922267003;2.078929555115751;1.9524643810182891;1.833524276855428;1.7533654016408482;1.6796308484993148;1.6077735119497814;1.6066258084532663;1.6678648466815242;1.7332408061690123;1.7973934817393473;1.8562171482106085;1.9183855692740153;1.9752700717818579;1.926140684292581;1.8701222275024993;1.8147851123252596;1.7258308215846172;1.6162849887486064;1.5082055181889344;1.4411300310494182;1.419752287980594;1.3973766704451742;1.3907933699422805;1.4600321385930377;1.5373087193334527;1.6227572212168386;1.6591107079589176;1.693107551927242;1.7305324742853232;1.7301413166660493;1.7298959212325034;1.7296501986330182;1.7572020226895737;1.816268381212726;1.8789335496114024;1.9237330436669653;1.8823979861874829;1.8416193210856875;1.8013858894476273;1.8540661945006576;1.9198828930160146;1.9871392981982854;1.9689154242791491;1.893565508566626;1.8172375783370076;1.7359973352588296;1.659101152109012;1.5839734625160413;1.5224340808097656;1.4882598555830104;1.4512892810643294;1.4111644936967693;1.3778864555790762;1.3431357853325911;1.3049632277489973;1.2945803078756586;1.3046504445611113;1.3156116295718248;1.3525981417943798;1.431677047901408;1.5262674984455995;1.6112664416388827;1.5755519523762482;1.5385983693550735;1.5003400697289513;1.5056536978076622 \ No newline at end of file diff --git a/data/2/37/info.bin b/data/2/37/info.bin new file mode 100644 index 0000000000000000000000000000000000000000..008677c7b93af99e9a227adbc6b493d0261dc7d7 GIT binary patch literal 105 zcmWe<=i=j+XFviCyWY4zs9hzBB!tX-aDbtq&#}DchwYaD5JZ+^U=S8mPGC>~iUoPN TgqBTw&TyL5ht-R9Ap;`-o!=AN literal 0 HcmV?d00001 diff --git a/data/2/37/sensor.bin b/data/2/37/sensor.bin new file mode 100644 index 0000000000000000000000000000000000000000..27611f10faa84365243b341c258ec9003722f620 GIT binary patch literal 63144 zcmeI5-%nd*9LC>@obTIHSOc_hpk*s#I8qWQlTDW)G=UY?acC!&b=3hwWXU83birt1 zvgzU#8o;QDAw(B<=goHEe#E#8-C|~zI4`_V*)qd4F2uNOy2XU(q5cJ2=t%kGgrtF! z_kzAT&-*;j=RI#pQT2cdDW#t5Y)_3({i43k@5+zof23U1AF7BbWy+EfmdB)Bl447j z^vFKR$N_my4#|r$DO2*Xd?Dig-2B8muf1C9&3c!f)koY3&uMSCJUfozj9-1Fc2nKs zk)O66-SKNQ5IdM@JbLM^XI?2C+kg1d_<`~C;rg*tBQpovp8dW**ykF!J#>Be_~8A_ z)t>S0M3>9Xj+3v{EqlUlwC~!@iMixL&$+(#H_u%BZ1Kx)KX|Y0`M-K!>fRksbu`7c z#gFZYro)+;)Cqek_Ea>|9B93^_l>c)N3-KRtkjRa$=HSHpHEb6uitXD?&;d&kKC!* zS~FZdTs0e--*9sM`;`}i4Z+F4bj48lob|euwiYZa5UpGcR#t2;yXVi2lc&^g{zpsy zD7{?vf_2KeY@M`5t)14PvWS0Q$;}dK<|TyQ|!v z>QUXVn{=HHI{$5to|m)ou4Kn?DK#pCl9ISYo$o5;Z2xUXrP&SkeWkcCeHhMOCHhMOCT6$V~{?*&_U2IQAxLc3@>)4xsay7h-Duynn-g=%1=6I|ncBO`C%hrBVi+1 b8L={AWt3YhBa{tgL)lO^lnrIeEoJ)$Po637 literal 0 HcmV?d00001 diff --git a/data/2023/03/20/37/info.bin b/data/2023/03/20/37/info.bin new file mode 100644 index 0000000000000000000000000000000000000000..aff7373e46aeb93ebc5c7784022dd98764731c40 GIT binary patch literal 79 ycmWe<7U45Al?aQK3%nY}dgg@?ThHCY?iZA&iZUQT3WABm`Vs(wYzz#{2tfdh5Dg*# literal 0 HcmV?d00001 diff --git a/data/2023/03/20/37/sensor.bin b/data/2023/03/20/37/sensor.bin new file mode 100644 index 0000000000000000000000000000000000000000..84c1b09791a283134f088120039045ec365c8813 GIT binary patch literal 1754 zcmWd@R8C+}U|?Vf@^A?)oA{jJG^-D*7wbX>M&$(z2J8$BTl$ z#eUviq3$MbW?n6U4iQ>Wb3&K;PIL=#FtCxfzZc$I*jE5HhlPRRPFR53L5FX)ik5mt z7qz1`7O8z!HC0VhPE(wxa94h#+;rKaGWs$Tq$f$GNFI`Cl8BIaA|WB|Ap1r}R?1TR zyC~QkW(J0LqQ+uh#ZHOmNo#A#6)fjedo94d&+CX2R4U^f#EN&4ew+gcOG7z9o&W7a@=RRCUJ#v$#XGq ziEz1b*>PRqtm4e!jOSG3+{RJB5zk@5q0J!!3~g?XyX-sJr?P|1VPs$^U{7KXW%put z0LGOY5PAUF0qha%vFzdO{_M`|@$6wh906q8v#YSX0#%m-MeNzN*g4ssv0Y;Wn*&S_ zpV|1?RoRu;_1G2Inc2D7-?05>lVrC8#=Z%=1iK^b4Jt8X!;pVKcnT(K$JfK{lV6B literal 0 HcmV?d00001 diff --git a/myRamses.py b/myRamses.py new file mode 100644 index 0000000..de6e9f3 --- /dev/null +++ b/myRamses.py @@ -0,0 +1,795 @@ +from dataclasses import dataclass, field +from typing import Any, List +from enum import Enum +import numpy as np +import struct +# import time + +from tools.mylogger import log + + +class RamsesType(Enum): + SAM = 1 + SAMIP = 2 + + +class AirWater(Enum): + Air = 1 + Water = 2 + + +@dataclass +class SamCal(object): + SAMSN: str = None + DarkPixelStart: int = 0 + DarkPixelStop: int = 0 + Firmware: str = None + IDDataBack: str = None + IDDataCal: str = None + IDDataCalAQ: str = None + IntegrationTime: int = None + Reverse: float = None + SerialNo_MMS: str = None + WavelengthRange: str = None + c0s: float = None + c1s: float = None + c2s: float = None + c3s: float = None + c4s: float = None + cs: int or str = None + + def __post_init__(self): + assert self.SAMSN != None + assert len(self.SAMSN) == 4 , "SAMSN len is wrong" + pass + + def set_samcal(self, samcal: dict): + assert self.SAMSN == samcal['SAMSN'], "SamCal SAMSN doesnot match." + # SAMSN_ = samcal['SAMSN'] + self.DarkPixelStart = int(samcal['DarkPixelStart']) + self.DarkPixelStop = int(samcal['DarkPixelStop']) + self.Firmware = samcal['Firmware'] + self.IDDataBack = samcal['IDDataBack'] + self.IDDataCal = samcal['IDDataCal'] + self.IDDataCalAQ = samcal['IDDataCalAQ'] + if hasattr( samcal, 'IntegrationTime') : + self.IntegrationTime = samcal['IntegrationTime'] + else: + self.IntegrationTime = " " + # self.Reverse = samcal['Reverse'] + # self.SerialNo_MMS_ = samcal['SerialNo_MMS'] + if hasattr( samcal, 'WavelengthRange') : + self.WavelengthRange = samcal['WavelengthRange'] + else: + self.WavelengthRange = "310-1100" + + self.c0s = float(samcal['c0s']) + self.c1s = float(samcal['c1s']) + self.c2s = float(samcal['c2s']) + self.c3s = float(samcal['c3s']) + self.c4s_ = float(samcal['c4s']) + if hasattr( samcal, 'cs'): + cs = samcal['cs'] + else: + cs_ = 0 + pass + +@dataclass +class IPCal(object): + IPSN: str = None + Incl_Orientation: str = None + Incl_Xgain: float = None + Incl_Xoffset: float = None + Incl_Ygain: float = None + Incl_Yoffset: float = None + Incl_KBG: float = None + Incl_Kref: float = None + Press_Current_mA: float = None + Press_Surface_bar: float = None + Press_Gain: float = None + WithIncl: float = None + WithPress: float = None + Press_Sens_mV_bar_4mA: float = None + Press_Sens_mV_bar_1mA: float = None + Press_Type: str = None + CalibrationDate: str = None + + def __post_init__(self): + pass + + def set_ipcal_from_dict(self, ipcal: dict): + self.IPSN = ipcal['IPSN'] # = float(ipcal['IPSN'] ) + self.Incl_Orientation = ipcal['Incl_Orientation'] + self.Incl_Xgain = float(ipcal['Incl_Xgain']) + self.Incl_Xoffset = float(ipcal['Incl_Xoffset']) + self.Incl_Ygain = float(ipcal['Incl_Ygain']) + self.Incl_Yoffset = float(ipcal['Incl_Yoffset']) + self.Incl_KBG = float(ipcal['Incl_KBG']) + self.Incl_Kref = float(ipcal['Incl_Kref']) + self.Press_Current_mA = float(ipcal['Press_Current_mA']) + self.Press_Surface_bar = float(ipcal['Press_Surface_bar']) + self.Press_Gain = float(ipcal['Press_Gain']) + self.WithIncl = float(ipcal['WithIncl']) + self.WithPress = float(ipcal['WithPress']) + self.Press_Sens_mV_bar_4mA = float(ipcal['Press_Sens_mV_bar_4mA']) + self.Press_Sens_mV_bar_1mA = float(ipcal['Press_Sens_mV_bar_1mA']) + self.Press_Type_ = ipcal['Press_Type'] + self.CalibrationDate = ipcal['CalibrationDate'] + +@dataclass +class RamsesCal(object): + SN: str = None + typ: RamsesType = RamsesType.SAM + samsn: str = "" + inifile: str = None + calfile: str = None + calaqfile: str = None + backfile: str = None + b0: List[float] = None + b1: List[float] = None + cal: List[float] = None + calaq: List[float] = None + samcal: SamCal = None + ipcal: IPCal = None + + def __post_init__(self): + assert self.SN != None, " Pls pass the SN when initiating..." + assert len(self.SN) == 4 , "SN len is wrong" + + def set_ramsescal_from_dict(self, ramsescal: dict): + ''' 与获得cfg兼容 + # {'Lsky': + # {'SN': '85B5', 'FUNC': 'Lsky', 'TYPE': 'SAM', 'samsn': '85B5', + # 'inifile': 'SAM_85B5.ini', 'calfile': 'Cal_SAM_85B5.dat', 'calaqfile': 'CalAQ_SAM_85B5.dat', 'backfile': 'Back_SAM_85B5.dat', + # 'cal': ['+NAN',.......... + ''' + assert self.SN == ramsescal['SN'], "RamsesCal SN doesnot match." + if ramsescal['TYPE'] == "SAMIP": + self.typ = RamsesType.SAMIP + else: + self.typ: RamsesType = RamsesType.SAM + self.samsn: str = ramsescal['samsn'] + self.inifile: str = ramsescal['inifile'] + self.calfile: str = ramsescal['calfile'] + self.calaqfile: str = ramsescal['calaqfile'] + self.backfile: str = ramsescal['backfile'] + self.b0: List[float] = [float(i) for i in ramsescal['b0'] ] + self.b1: List[float] = [float(i) for i in ramsescal['b1'] ] + self.cal: List[float] = [float(i) for i in ramsescal['cal'] ] + self.calaq: List[float] = [float(i) for i in ramsescal['calaq'] ] + # 设置sam_cal + self.samcal: SamCal = SamCal( SAMSN=self.samsn ) + self.samcal.set_samcal(ramsescal ) + # 设置ip_cal + if self.typ == RamsesType.SAMIP: + self.ipcal: IPCal = IPCal( ) + self.ipcal.set_ipcal_from_dict( ramsescal ) + + # def set_ramsescal_samcal(self, samcal: SamCal): + # samcal: SamCal = samcal + + # def set_ramsescal_ipcal(self, ipcal: IPCal): + # ipcal: IPCal = ipcal + + # def set_samcal_from_dict(self, samcal: dict): + # assert self.SN != samcal['SAMSN'], "RamsesCal SN doesnot match." + # # SAMSN_ = samcal['SAMSN'] + # self.samcal.set_samcal + + # c0s_ = float(samcal['c0s']) + # c1s_ = float(['c1s']) + # c2s_ = float(['c2s']) + # c3s_ = float(['c3s']) + # c4s_ = float(['c4s']) + # if samcal['cs_']: + # cs_ = samcal['cs'] + # else: + # cs_ = 0 + + # self.samcal = SamCal(self.SN, DarkPixelStart_, DarkPixelStop_, Firmware_, IDDataBack_, IDDataCal_, IDDataCalAQ_, + # IntegrationTime_, Reverse_, SerialNo_MMS_, WavelengthRange_, c0s_, c1s_, c2s_, c3s_, c4s_, cs_,) + # pass + + # def set_samcal_from_dict(self, ipcal: dict): + # IPSN_ = ipcal['IPSN'] # = float(ipcal['IPSN'] ) + # Incl_Orientation_ = ipcal['Incl_Orientation'] + # Incl_Xgain_ = float(ipcal['Incl_Xgain']) + # Incl_Xoffset_ = float(ipcal['Incl_Xoffset']) + # Incl_Ygain_ = float(ipcal['Incl_Ygain']) + # Incl_Yoffset_ = float(ipcal['Incl_Yoffset']) + # Incl_KBG_ = float(ipcal['Incl_KBG']) + # Incl_Kref_ = float(ipcal['Incl_Kref']) + # Press_Current_mA_ = float(ipcal['Press_Current_mA']) + # Press_Surface_bar_ = float(ipcal['Press_Surface_bar']) + # Press_Gain_ = float(ipcal['Press_Gain']) + # WithIncl_ = float(ipcal['WithIncl']) + # WithPress_ = float(ipcal['WithPress']) + # Press_Sens_mV_bar_4mA_ = float(ipcal['Press_Sens_mV_bar_4mA']) + # Press_Sens_mV_bar_1mA_ = float(ipcal['Press_Sens_mV_bar_1mA']) + # Press_Type_ = ipcal['Press_Type'] + # CalibrationDate_ = ipcal['CalibrationDate'] + + # self.ipcal = IPCal(IPSN_, Incl_Xgain_, Incl_Xoffset_, Incl_Ygain_, Incl_Yoffset_, Incl_KBG_, Incl_Kref_, Press_Current_mA_, Press_Surface_bar_, Press_Gain_, WithIncl_, WithPress_, + # Press_Sens_mV_bar_4mA_, Press_Sens_mV_bar_1mA_, Press_Type_, CalibrationDate_) + # pass + + +@dataclass +class RamsesFactory(object): + SN: str = None + typ: RamsesType = RamsesType.SAM + airwater: AirWater = AirWater.Air + data_raw: bytes = None # 原始的字节 未去遮罩 + ip_raw: bytes =None # ip 数据分开传进来 + data_after_remove_mask: bytes = None # 去遮罩后 + data_valid_buf: bytes = None # 去掉帧头帧尾后的buf + ip_buf: bytes = None + data_Int_from_Hex: List[int] = None # 去遮罩后 + data_after_cal: List[float] = None + Wavelength: List[float] = None + integratedTime: int = None + RamsesCalData: RamsesCal = None + + '''Usage + + 设置标定参数: + sn = "85C2" + rf = RamsesFactory( SN=sn, airwater = AirWater.Air ) + rf.set_cfg(cfg ) + + 设置数据, + 从原始数据开始 + set_data_raw(self, byt: bytes) + removeMask() + get_data_valid_buf() -- valid_buf + 从有效数据开始 + set_data_valid_buf(self, byt: bytes) + 处理数据 + process_from_hex_2_int(self,) + ''' + + def __post_init__(self): + assert self.SN != None + assert len(self.SN) == 4 , "SAMSN len is wrong" + self.RamsesCalData = RamsesCal(self.SN) + pass + + def set_cfg(self, cfg:dict): + assert self.SN == cfg["SN"] , "ramsesFactory SN does not match!!" + if cfg['TYPE'] == "SAMIP": + self.typ: RamsesType = RamsesType.SAMIP + else: + self.typ: RamsesType = RamsesType.SAM + self.RamsesCalData.set_ramsescal_from_dict(cfg) + + def set_airwater(self,air_water:AirWater): + self.airwater = air_water + pass + + def set_data_raw_ip_raw(self, byt: bytes ): + ''' byt 含 data_raw ip_raw ''' + assert isinstance(byt, bytes), f"arg byt is not byte type" + num = 0 + buf = byt + for i in range(50): + if byt[i] == 35: + num+=1 + if num == 2: + self.ip_raw = buf[:i] + self.data_raw = buf[i:] + break + + def set_data_raw(self, byt: bytes ): + ''' 需要 光谱数据 + 兼容: 传入前分不出byte ip + ip_byt: 判断是否含IP数据 + ''' + assert isinstance(byt, bytes), f"arg byt is not byte type" + self.data_raw = byt + + def set_ip_raw(self, byt: bytes ): + ''' 需要 光谱数据 + 兼容: 传入前分不出byte ip + ip_byt: 判断是否含IP数据 + ''' + assert isinstance(byt, bytes), f"arg byt is not byte type" + self.ip_raw = byt + + def set_ip_buf(self, byt: bytes ): + ''' 处理不含遮罩的 IP buf ''' + assert isinstance(byt, bytes) + self.ip_buf = byt + + def set_data_valid_buf(self, byt: bytes): + self.data_valid_buf = byt + pass + + def set_data_Int_254(self, int_list: list): + self.data_Int_from_Hex = int_list + pass + + + def get_data_valid_buf(self, ): + self.remove_frame_head_tail( ) + pass + + def remove_frame_head_tail(self,): + ''' 兼容 SAM 576, SAMIP 的IP数据单独传进来 + 去掉 23 00 00 00 00 00 00 ...... 01 + ''' + assert (self.data_after_remove_mask != None), "please remove mask in advance" + res = {} + buf = self.data_after_remove_mask + len_ = len(buf) + # log.warning( f"valid buf: {buf.hex()}") + # log.warning( f"len: {len_}") + + # print( f" head tail, {len_}") + # print( self.data_after_remove_mask) + # if self.typ == RamsesType.SAMIP: + # assert len_ == 602, "SAMIP sensor , wrong the num of bytes" + # self.buf_ip = self.data_after_remove_mask[:26] + # buf = buf[26:] + # # self.ip = self.decode_ip_buf(self.buf_ip, self.cal_cfg) + # # self.buf = self.buf[26:] + # len_ = len_ - 26 + assert (len_ == 576), "SAM sensor , wrong the num of bytes" + + for i in range(576): + res.update({i+1: {}}) + self.data_valid_buf = buf[7:71] + buf[79:143] + \ + buf[151:215] + buf[223:287] + \ + buf[295:359] + buf[367:431] + \ + buf[439:503] + buf[511:575] + + pass + + def set_integrate_time(self, it:int): + self.integratedTime = it + + def process_from_hex_2_int(self, mode= 0): + """ + @description :从data_after_remove_mask 到 data_Int_from_Hex + """ + assert self.data_valid_buf != None, "please remove frame head and tail" + + # print( f" == {len(self.data_valid_buf)}= {self.data_valid_buf} ") + # log.warning( f"valid buf: {self.data_valid_buf.hex()}") + self.integratedTime = 2 << int(self.data_valid_buf[0]) # integrated time + + # print(f"===============it {self.integratedTime}") + + tmp = struct.unpack( + " None: + # self.integratedTime = 2 << int(self.data_valid_buf[0]) # integrated time + # self.data_Int_from_Hex = struct.unpack( + # " np.ndarray: + '''处理raw 数据 8*72 = 576 + mode =0, 无需remmoveMask + ''' + self.rf.set_data_raw(data) # 同时传入 IPbuf + if mode == 1: + self.rf.removeMask() + else: + self.rf.data_after_remove_mask = self.rf.data_raw + self.rf.get_data_valid_buf( ) + self.rf.process_from_hex_2_int() + self.rf.calibrate_data() + + def deal_raw_data_list(self, data:list) -> np.ndarray: + ''' (15 + 26 +3*sensor) removeMask get_valid_buf''' + log.info( " ", __name__,"deal_raw_data_list ") + size = len(data) + assert size>0, ">>>> raw datalist len is 0 " + tmp_data = np.array([]) + for i in range(size): + # log.info( f" Num {i} Group ", __name__,"deal_raw_data_list ") + self.rf.set_data_raw( data[i] ) + self.rf.removeMask() + self.rf.get_data_valid_buf( ) + self.rf.process_from_hex_2_int() + self.rf.calibrate_data() + if i == 0: + tmp_data = self.rf.data_after_cal + else: + tmp_data = tmp_data + self.rf.data_after_cal + self.rf.data_after_cal = tmp_data/size + # return tmp_data/size + + def deal_raw_ip_list(self, ip_data:list) -> np.ndarray: + ''' ip_raw''' + log.info(" 处理 ip_data:list ",__name__, "deal_raw_ip_list") + pass + + def deal_raw_ip_buf(self, ip_buf:bytes) -> tuple: + ''' ip_raw''' + log.debug(" args: ip_buf ",__class__, "deal_raw_ip_buf") + return self.rf.decode_ip_buf(ip_buf) + pass + + def deal_data_valid_buf(self, data:bytes): + ''' 去 23 00 00 00 .....01后的数据, 64*8=512 ''' + self.rf.set_data_valid_buf(data) + self.rf.process_from_hex_2_int() + self.rf.calibrate_data() + + def deal_data_int254(self, data:list, integrationTime:int): + '''254 * int, integrationTime ''' + self.rf.set_data_Int_254(data) + self.rf.set_integrate_time(integrationTime) + self.rf.calibrate_data() + + def get_data_after_cal(self,): + return self.rf.data_after_cal + + +def test_01(): + """ + @description :调用RamsesTest RamsesFactory 获得结果和已知的比较 + """ + # sn = "85C2" + sn = "84E3" + cfg = {} + # r85c2 = Ramses85C2() + # cfg = r85c2.calcfg + + r84e3 = Ramses84E3() + cfg = r84e3.calcfg + # rt.get_ip_cal() + # rt.get_sam_cal() + # rt.get_ramses_cal() + + rf = RamsesFactory( SN=sn, airwater=AirWater.Air ) + rf.set_cfg(cfg ) + + # rf.set_data_raw( bytes.fromhex(r85c2.data_85C2) ) + # rf.removeMask() + # rf.get_data_valid_buf() + + + # rf.process_from_hex_2_int() + # rf.get_wavelenth(1) + # rf.calibrate_data(1) + + # rf.process_from_hex_2_int() + rf.data_Int_from_Hex = r84e3.data_Int_from_Hex + rf.set_integrate_time (256) + + print( len(rf.RamsesCalData.b0) ) + print( len(rf.RamsesCalData.b1) ) + print( len(rf.RamsesCalData.cal) ) + print( len(rf.RamsesCalData.calaq) ) + + # print( rf.RamsesCalData.samcal.DarkPixelStart ) + # print( rf.RamsesCalData.samcal.DarkPixelStop ) + + + + # rf.get_wavelenth(1) + rf.calibrate_data(1) + # 4 1077 0 0 0.016433967 0.017747166 -0.001313199 0.000333492 0.010671759 0.085698462 0.124526848 0.124526478 + # 5 1088 0 0 0.016601816 0.0177432 -0.001141384 0.000505308 0.016169857 0.102722719 0.157412665 0.157412431 + + +def test_02(): + """ + @description :调用RamsesTest RamsesFactory 获得结果和已知的比较 + """ + sn = "85C2" + cfg = {} + r85c2 = Ramses85C2() + cfg = r85c2.calcfg + + + rf = RamsesFactory( SN=sn, airwater=AirWater.Air ) + rf.set_cfg(cfg ) + + rf.set_data_raw( bytes.fromhex(r85c2.data_85C2) ) + # print(f"raw : {rf.data_raw.hex()}" ) + rf.removeMask() + + # print(f"mask : {rf.data_after_remove_mask.hex() }" ) + rf.get_data_valid_buf() + rf.process_from_hex_2_int(1) + + + # rf.data_Int_from_Hex = r85c2.data_Int_from_Hex + # rf.set_integrate_time (4096) + + # print( rf.data_Int_from_Hex) + + # print( len(rf.RamsesCalData.b0) ) + # print( len(rf.RamsesCalData.b1) ) + # print( len(rf.RamsesCalData.cal) ) + # print( len(rf.RamsesCalData.calaq) ) + + + # rf.get_wavelenth(1) + rf.calibrate_data(1) + + +if __name__ == '__main__': + # 由于很多数据,要到整数这一步取平均, 需要将平均后的整数值传进去,在处理 + + # test_01() + test_02() + # print(hex(100)) + # rc= RamsesCal() + # print(rc) + + # rt =RamsesTest() + # rt.get_sam_cal() + # rt.get_ramses_cal() + # print(rt.samcal) + pass + + +# {2: {1: {'FUNC': 'Lsky', 'SN': '85B5'}, 2: {'FUNC': 'Esky', 'SN': '50ED'}, 3: {'FUNC': 'Lwater', 'SN': '852F'}}, +# 3: {1: {'FUNC': 'Lsky', 'SN': '85B5'}, 2: {'FUNC': 'Esky', 'SN': '50ED'}, 3: {'FUNC': 'Lwater', 'SN': '852F'}}} + +# {'Lsky': +# {'SN': '85B5', 'FUNC': 'Lsky', 'TYPE': 'SAM', 'samsn': '85B5', +# 'inifile': 'SAM_85B5.ini', 'calfile': 'Cal_SAM_85B5.dat', 'calaqfile': 'CalAQ_SAM_85B5.dat', 'backfile': 'Back_SAM_85B5.dat', +# 'cal': ['+NAN',.......... \ No newline at end of file diff --git a/profiler copy.py b/profiler copy.py new file mode 100644 index 0000000..aec126c --- /dev/null +++ b/profiler copy.py @@ -0,0 +1,1279 @@ +#! python3 +# -*- encoding: utf-8 -*- +''' +@File : handheld.py +@Time : 2023/02/24 17:20:59 +@Author : Jim @ Yiwin +@Version : 1.0 +@Contact : jim@yi-win.com +''' + +CUR_TIME_STR_FMT = "%Y-%m-%d %H:%M:%S" + +import time +import locale +import struct +import numpy as np +from scipy.optimize import leastsq + +from pathlib import PurePath,Path +from myconfig import CURRENT_DIR,DATA_DIR,OUTPUT_DIR,NEWLINE,ROWFACTOR,SAVE_EXT_NAME,TOKEN +from myconfig import DeviceType,RamsesSURFACE,RamsesAWRAMS,RamsesPROFILE +from tools.mylogger import log +from tools.myexception import MyException +from tools.mytime import MyTime +from tools.mypath import MyDir +from Ramses import Ramses + +class HandHeldBuf: + def __init__(self,) -> None: + self.__buf = b'' + self.__head = {} + self.__begin_sign = b'\x23' + self.__end_sign = b'\x0D' + self.data_ip = b'' + self.measure_group = { + "Lsky": b'', + "Esky": b'', + "Lwater": b'', + } + self.one_group_data= b'' + self.state = 0 + + def readFile2Buf(self, fpath) -> None: + with open(fpath,"rb") as f: + self.__buf = f.read() + pass + pass + + def read_buf(self, size: int) -> bytes: + if size > self.__buf.__len__(): + return b'' + ret = self.__buf[0:size] + self.__buf = self.__buf[size:] + return ret + + def write_buf(self, buf: bytes) -> None: + len = buf.__len__() + # logging.info(f'Received ID:{id} Size:{len}') + self.__buf = self.__buf+buf + + def get_buf_size(self) -> int: + return self.__buf.__len__() + + def back_bytes(self, buf: bytes) -> None: + self.__buf = buf+self.__buf + + def reset_head(self) -> None: + self.__head = {} + + def reset_buf(self) -> None: + self.__buf = b'' + + def getResult(self) -> str: + return self.res + + def resetMeasureGroup(self) -> None: + self.measure_group['Lsky'] = b'' + self.measure_group['Esky'] = b'' + self.measure_group['Lwater'] = b'' + + def getMeasureGroup(self) -> dict: + return self.measure_group + + def decode_handheld(self) -> bool: + '''以26个字节开始,一般26个00 ,然后23... 07.... ''' + if self.get_buf_size() < 1754: + self.__buf = b'' + return False + + self.data_ip = self.read_buf(26) + Lsky = self.read_buf(576) + Esky = self.read_buf(576) + Lwater = self.read_buf(576) + + self.measure_group['Lsky'] = self.deal_576_to_512(Lsky) + self.measure_group['Esky'] = self.deal_576_to_512(Esky) + self.measure_group['Lwater'] = self.deal_576_to_512(Lwater) + + if self.measure_group['Lsky'] == b'' \ + or self.measure_group['Esky'] == b'' \ + or self.measure_group['Lwater'] == b'' : + return False + + return True + + def decode_one_group_handheld(self) -> bool: + '''以26个字节开始,一般26个00 ,然后23... 07.... ''' + if self.get_buf_size() < 1754: + self.__buf = b'' + return False + + self.data_ip = self.read_buf(26) + self.one_group_data = self.read_buf(1728) + + return True + + def deal_576_to_512(self,data:bytes) -> bytes: + ''' 576字节校验,拆分成字典 23... 07.... ,然后254*2''' + ret = {} + index = 72 + for i in range(8): + temp = data[i*index : i*index+index] + # print( temp.hex()) + if temp[0] != 35 and temp[0]<8 and temp>0 : + return b'' + pass + ret.update( { temp[4]: temp} ) + if len(ret) != 8: + return b'' + ret_byte = ret[7][7:71]+ ret[6][7:71]+ ret[5][7:71]+ ret[4][7:71] \ + + ret[3][7:71]+ ret[2][7:71]+ ret[1][7:71]+ ret[0][7:71] + return ret_byte + + + def decode(self) -> str: + ret = '' + temp_buf = b'' + token = ";" + if TOKEN: + token = TOKEN + + if self.state == 0: + while self.get_buf_size() >= 1: + if self.read_buf(1) != self.__end_sign: + continue + self.state = 1 + break + + if self.state == 1: + while self.get_buf_size() >= 1: + buf = self.read_buf(1) + if buf != self.__end_sign: + temp_buf += buf + if buf == self.__end_sign: + ret = temp_buf[0:20].decode( + 'utf-8').strip(" ") + token + temp_buf[-9:-1].decode('utf-8').strip(" ") + log.info(f"decode : {ret}") + temp_buf = b'' + self.back_bytes(temp_buf) # 写回临时buf到 + self.res = ret + return ret + pass + + +class HandHeldPath(object): + '''处理一次测量''' + def __init__(self, ): + self.mode = 0 + self.cfg ={} + self.mydir = MyDir() + self.base_path:Path = Path() + self.output_path:Path = Path() + self.data_path:Path = Path() + self.filelist = [] + self.error_result = [] + pass + + def setMode( self, mode:int = 0 ): + self.mode = mode + pass + + def setBasePath( self, fpath:Path ): + self.base_path = fpath + pass + + def setDataPath( self, fpath:Path ): + self.data_path = fpath + pass + + def setOutputPath( self, fpath:Path ): + self.output_path = fpath + pass + + def getSensorPathFromInfoPath( self, info_path:Path, ) -> Path: + # 服务器上转移后的模式 + if self.mode == 1: + sensor_path = self.base_path.joinpath( + info_path.parent, + "sensor.bin" + ) + elif self.mode == 0: + sensor_path = self.base_path.joinpath( + "data", + info_path.parts[1][:4] + "_" + info_path.parts[1][-2:], + info_path.parts[2], + "sensor", + info_path.name + ) + else: + sensor_path = None + return sensor_path + pass + + def getOutputPathFromSensorPath(self,sensor_path:Path ) -> Path: + if self.mode == 1: + output_path = self.output_path.joinpath( + self.info_dict['year'] + "_" + self.info_dict['month'] + + "_" + self.info_dict['day'] + "_" + self.info_dict['hour'] + + "_" + self.info_dict['minute'] + "_" + self.info_dict['second'] + ) + elif self.mode == 0: + output_path = self.output_path.joinpath( + sensor_path.parts[1][:4] + "_" + sensor_path.parts[1][-2:] + + "_" +sensor_path.parts[2] + "_" +sensor_path.name + ) + else: + output_path = None + return output_path + pass + + def getCurrentMeasureTimeFromPath(self,fpath:Path ) -> str: + ret = '' + if self.mode == 1: # 读信息txt获得时间 + txt_path = fpath.parent.glob("*.txt") + txt_stem = txt_path[0].stem + ret = fpath.parts[1][:4]+"-"+fpath.parts[1][-2:]+"-"+fpath.parts[2]+" " \ + + txt_stem[-9:-7] + ":" + txt_stem[-6:-4] + ":" + txt_stem[-3:-1] + pass + elif self.mode == 0: + ret = fpath.parts[1][:4]+"-"+fpath.parts[1][-2:]+"-"+fpath.parts[2]+" " \ + + fpath.name[0:2] + ":" + fpath.name[3:5] + ":" + fpath.name[6:8] + else: + pass + return ret + pass + + + + def getDataFileList(self, ): + ''' + 获得成对的info sensor 文件 + [目录名,文件名,年月日,时间, measure_id] + ''' + # ret = [] + fs = None + self.filelist = [] + if self.mode == 1: + fs = self.data_path.glob( "*/*/*/*/info.bin" ) + else: + fs = self.data_path.glob( "*/*/info/*" ) + + for f in fs: + error_file = {} + if f.stat().st_size==0: + error_file.update( {"path": f } ) + error_file.update( {"error":"info file size is zero"} ) + self.error_result.append(error_file) + continue + + # self.info_path_fname = f + sensor_path = self.getSensorPathFromInfoPath(f) + # sensor_path = Path(sensor_purepath) + # sensor 文件不存在 + if not sensor_path.exists(): + error_file.update( {"path":f} ) + error_file.update( {"error":"cannot find the sensor file "} ) + self.error_result.append(error_file) + continue + + # sensor文件大小为0 + if sensor_path.stat().st_size==0: + error_file.update( {"path":sensor_path} ) + error_file.update( {"error":"sensor file size of the sensor is zero' "} ) + self.error_result.append(error_file) + continue + self.setFilelist(f,sensor_path ) + pass + + + def setFilelist(self, info_path:Path, sensor_path:Path): + temp = {} + temp.update( {"info_path" : info_path } ) + temp.update( {"name" : info_path.name} ) + temp.update( {"parent" : info_path.parent} ) + + if self.mode==1: # 服务器转移后目录 + temp.update( {"year" : info_path.parts[-5] } ) + temp.update( {"month" :info_path.parts[-4] } ) + temp.update( {"day" :info_path.parts[-3] } ) + + temp.update( {"year" : info_path.parts[1][:4] } ) + temp.update( {"month" :info_path.parts[1][-2:] } ) + temp.update( {"day" :info_path.parts[2] } ) + temp.update( { "sensor_path" :sensor_path } ) + self.filelist.append(temp) + + def getFilelist(self, ): + return self.filelist + + def printTest(self,d,sleep_time:int=5): + log.info( f"***** : I am testing from HandheldPath ********", __name__ ) + print(d) + log.info( f"***** : Ending testing from HandheldPath ********", __name__ ) + time.sleep(sleep_time) + pass + +class Profiler(object): + def __init__(self, ): + """ + @description : 手持数据初始化 + 入口: dealOneMeasurement_Handheld() + 参考: 分组写成函数,一次测量多组数据分离出来。 + 保存: 按时间文件夹保存 + @comment + 1号数据: Ed 带倾斜 samip + 2号数据: Esky 可能没有 ? 如何判断,信息帧的序列号? 数据? + 3号数据: Lu + """ + self.device_type = DeviceType.PROFILE.name + self.device_enum = None + self.device_id = None + self.syscfg = {} + self.retrieve ={} + self.error_result =[] + self.mode = 0 # 0:默认SD数据, 1:服务器数据 + self.base_path = CURRENT_DIR + self.current_path = CURRENT_DIR + self.data_path = DATA_DIR + self.output_path = OUTPUT_DIR + self.info_path_fname:Path = self.base_path + self.sensor_path_fname:Path = self.base_path + self.filelist = [] # 包含了全部路径信息 + self.intensity_before_avg = None + self.intensity_after_avg = {} # 最终结果{lsky: esky: lwater: } + self.intensity_after_interpo = {} # 最终结果{lsky: esky: lwater: } + + self.one_group_result = {} # 手持式 多次间隔 + self.wavelength = np.array([]) + self.real_wavelength = {} # 最终结果{lsky: esky: lwater: } + self.current_filepath = '' # 不含后缀 + self.current_measure_time = None # 当前测量时间 + # self.current_group_num = 0 + # self.measurement_interval = 0 + # self.measurement_repeat = 1 + # self.sl2f = SaveList2File() + self.mydir = MyDir() + self.my_time = MyTime() + self.hhb = HandHeldBuf() + self.hhp = HandHeldPath() + self.ramses = Ramses() + self.info_dict = {} + self.res = {} # 最终结果{ld: esky: lu: Lw: Rs:} + self.depth_m_offset = 0.0 + self.tilt_range = 0.0 + self.profiler_data = { } # "depth":[], "Ed":[], "Esky":[] ,"Lu":[] + self.depth_spectrum:np.ndarray = None + self.profiler_res = None + # self.depth_m = 0.0 + # self.tilt_x = 0.0 + # self.tilt_y = 0.0 + self.depth_tilt_x_y = [] # [ {"depth":, "tilt_x": ,"tilt_y": }] + + # 方法 + self.setDeviceEnum() + self.setMode() + self.set_hhp_path() + pass + + def setMode(self,mode=0 ): + self.hhp.setMode (mode) # 0 :读SD卡 1:读服务器数据 + + def setMeasureID(self, mid:int): + self.measure_id = mid + + def setOldFolder(self, tuple_path:tuple): + self.old_folder = self.base_path.joinpath( *tuple_path ) + + def transferFromOldFolder(self, ): + log.info( f"transferFromOldFolder: ", __name__ ) + self.getNewFolderFromOldFolder() + bin_files = self.old_folder.glob('*.bin') + for bf in bin_files: + if bf.name == "pic.bin": + bf.replace( self.new_folder.joinpath( "pic.jpg" ) ) + else: + bf.replace( self.new_folder.joinpath(bf.name) ) + pass + + def deleteOldFolder(self, ): + log.info( f"deleteOldFolder: ", __name__ ) + self.mydir.setBaseDir(self.old_folder) + self.mydir.deleteDir() + self.old_folder = DATA_DIR + + def getNewFolderFromOldFolder( self, ) -> Path: + # 服务器上转移后的模式 + tmp_folder = self.old_folder.parent.parent + path_tuple = ("20"+f"{self.info_dict['year']:02d}" + ,f"{self.info_dict['month']:02d}" + ,f"{self.info_dict['day']:02d}" + ,self.old_folder.parts[-1] ) + self.new_folder =tmp_folder.joinpath(*path_tuple) + self.mydir.setBaseDir(self.new_folder) + self.mydir.newDirIfNot() + pass + + def getInfoDict(self, ): + info_path = self.old_folder.joinpath("info.bin") + hexbin = self.read_bin(info_path) + self.info_dict = self.decode_info(hexbin) + self.new_folder = self.getNewFolderFromOldFolder() + + def getCurrentMeasureTimeFromInfoDict(self, ) -> str: + ret = "20"+ str(self.info_dict['year']) + '-' \ + + str(self.info_dict['month']) + '-' \ + + str(self.info_dict['day']) + ' ' \ + + str(self.info_dict['hour']) + ':' \ + + str(self.info_dict['minute']) + ':' \ + + str(self.info_dict['second']) + # ret = "20"+ f"{self.info_dict['year']:02d}" + '_' \ + # + f"{self.info_dict['month']:02d}" + '_' \ + # + f"{self.info_dict['day']:02d}" + '_' \ + # + f"{self.info_dict['hour']:02d}" + '_' \ + # + f"{self.info_dict['minute']:02d}" + '_' \ + # + f"{self.info_dict['second']:02d}" + return ret + pass + + def set_hhp_path(self, ): + self.hhp.setBasePath (self.base_path) + self.hhp.setDataPath (self.data_path) + self.hhp.setOutputPath (self.output_path) + + def setDeviceEnum(self, ): + if self.device_type == DeviceType.SURFACE.name: + self.device_enum = RamsesSURFACE + if self.device_type == DeviceType.AWRAMS.name: + self.device_enum = RamsesAWRAMS + if self.device_type == DeviceType.PROFILE.name: + self.device_enum = RamsesPROFILE + + def getDataFileList(self, ): + self.hhp.getDataFileList() + self.filelist = self.hhp.getFilelist() + # self.printTest(self.filelist) + pass + + def dealAllMeasurements(self, ): + log.info(f" 所有测量文件", __name__, "dealAllMeasurements", ) + if len(self.filelist)<1: + pass + # 前面已经考虑各种文件错误 + for df in self.filelist: + # 处理信息帧 + self.info_dict = {} + self.info_path_fname:Path = df["info_path"] + self.sensor_path_fname:Path = df["sensor_path"] + hex_info = self.read_bin( self.info_path_fname ) + try: + self.info_dict = self.decode_info( hex_info ) + except: + log.error( f"处理信息文件" + + "/" +self.info_path_fname.stem + + "出现错误", __name__, "dealAllMeasurements" ) + raise MyException( "处理文件"+ self.info_path_fname + "出现错误") + pass + + try: # awrams每次只有一组数据 + self.dealOneMeasurement(self.sensor_path_fname ) + # self.measurement_interval = int(self.info_dict['Measure_Interval']) + # self.measurement_repeat = int(self.info_dict['Measure_Repeat']) + # self.dealOneHandheldMeasurement(self.sensor_path_fname ) + except Exception as e: + log.error( "处理传感器文件" + self.sensor_path_fname.name + " 出现错误",__name__,"dealAllMeasurements") + raise MyException( "处理传感器文件" + self.sensor_path_fname.name + " 出现错误" ) + pass + log.info(f"Finished !! ", __name__, "dealAllMeasurements") + return True,self.error_result + pass + + def dealOneMeasurement_Profiler(self, fpath:Path): + ''' + Profiler一次测量包含多组数据 + 只有一个开始十进制 + 需要处理深度,对深度分组 + ''' + # 调用handheldbuf 处理,将一组数据提交出来 + log.info(f" 剖面测量数据", __name__, "dealOneMeasurement_Profiler") + + info_path = fpath.joinpath("info.bin") + sensor_path = fpath.joinpath("sensor.bin") + self.deal_Profiler_info_sensor_path( info_path, sensor_path ) + + + def deal_Profiler_info_sensor_path(self, info_path:Path, sensor_path:Path): + # 信息帧解析 + hex_info = self.read_bin( info_path ) + try: + self.info_dict = self.decode_info_profiler( hex_info ) + self.depth_m_offset = self.info_dict['Depth'] + except: + log.error( f"处理信息文件" + + "/" +self.info_path_fname.stem + + "出现错误", __name__, "dealOneMeasurement_Profiler" ) + raise MyException( "处理文件"+ self.info_path_fname + "出现错误") + pass + + # 当前文件名 ? + self.hhp.setMode(1) + self.current_measure_time = self.getCurrentMeasureTimeFromInfoDict() + self.get_ymdhms() + + # self.output_path 定位到 /data/output 目录? + self.output_path = OUTPUT_DIR.joinpath( self.ymdhms) + + log.info(f"current_measure_time: {self.current_measure_time}", __name__, "dealOneMeasurement_Profiler") + + # 获得真实波长 + self.real_wavelength = self.getWavelenthDict() + + # 读取数据 buf + self.hhb.readFile2Buf(sensor_path) + log.debug(f"buf: {self.hhb.get_buf_size()}", __name__, "dealOneMeasurement_Profiler") + + # 解析数据 获得深度 倾斜 光强 [depth, tiltx, tilty, {"Ed":"Esky","Lu"}] + self.profiler_data = self.getRetDict() + self.profiler_data.update({ "depth":[]}) + self.decode_sensor_buf_profiler() + + # 去掉倾斜不达标的数据 + self.remove_data_with_tilt_bias( ) + + # 获得深度数据,并波长插值 获得 + + + # 获得数据去拟合 -- 分拆Ed Lu + depth_ndarray = np.array(self.depth_tilt_x_y) + depth_ndarray = depth_ndarray[:,0] + data = np.array( self.intensity_before_avg ) + + res = self.leastsq_fitting( self.depth_tilt_x_y, self.intensity_before_avg ) + + + def decode_info_profiler( self, info: bytes ) -> dict: + '''info 分为两部分 : 传感器部分, 深度 倾斜部分 ''' + ret = {} + try: + temp = struct.unpack(" None: + cal = self.syscfg.get(self.device_id) + cal = cal[RamsesPROFILE(1).name] + # ?? 判断是否有IP 标定数据 ?? + return self.ramses.decode_ip_buf(buf, cal) + pass + + def decode_sensor_buf_profiler(self,) : + ''' + 去掉倾斜超标 + 获得 {"Ed":ndarray, Lu:ndarray} + ''' + # 处理Buf,[depth, tiltx, tilty, {"Ed":"Esky","Lu"}] + while True: + if self.hhb.decode_one_group_handheld() : + break # 清空数据 + + ## 直接倾斜超标的数据 + tmp = self.get_depth_tiltx_tilty(self.hhb.data_ip) + if tmp[1] > self.tilt_range : + continue + if tmp[2] > self.tilt_range : + continue + self.profiler_data["depth"].append(tmp[0]) + + res = {} + buf = self.hhb.one_group_data[26:] + for i in range(1,4,1): + temp_buf = buf[7:71] + buf[79:143] + \ + buf[151:215] + buf[223:287] + \ + buf[295:359] + buf[367:431] + \ + buf[439:503] + buf[511:575] + + # Ramses类 标定处理,设置buf 标定文件 + self.ramses.setBuf(temp_buf) + func = self.getFuncBySeq(i) + cfg = self.getCfgByFunc( func) + self.ramses.setCalCfg(cfg) + self.ramses.resetItSpectrum() + self.ramses.ConvertAndCalibrate() + res.update({ func : self.ramses.spectrum }) + self.profiler_data[-1].append( res ) + pass + + def remove_data_with_tilt_bias( self , ): + for i in range( len(self.profiler_data) ,0,-1 ): + if abs( self.profiler_data[i][1] ) > self.tilt_range or abs( self.profiler_data[i][2] ) > self.tilt_range: + self.profiler_data.pop(i) + pass + pass + pass + + def leastsq_fitting( self, arr_x, arr_y ): + """ + @description : arr_x arr_y 是不同波长数据 + 对其列上的每个值拟合获得kd ln(lu0) + 也可以对 arr_y 先切片 + 最小二乘只能遍历处理 + arr_y 包含 Ed Lu 返回两组数据 + """ + log.info(f" ->>>> ", __name__, 'leastsq_fitting') + res = np.array([]) + + print(arr_x.shape) + print(arr_y.shape) + + for i in range( arr_y.shape[1] ) : + # 切出第一列 + row_ = arr_x + column_ = arr_y[:,i] + # 拟合 + p0 = [1,20] + para = leastsq( self.fitting_error, p0, args = ( row_, column_ ) ) + if not res.size : + res = para[0] + else: + res = np.vstack( (res, para[0]) ) + # 转置 返回,第一列为 k, 第二列为 ln(Lu0-) + print(" __ndarray_ln_leastsq_fitting ...... %s %s " % res.shape ) + print(res) + return res.T + + # 需要拟合的函数 fitting_func + def fitting_func( self, p, x ): + k,b=p + return k*x+b + + # 拟合的残差函数 + def fitting_error(self,p,x,y): + return self.fitting_func(p,x)-y + + + def dealMultiGroup(self, group_num:int ): + log.info(f"group_num: {group_num}", __name__, "dealMultiGroup") + # 分组进行处理 + for i in range(group_num): + self.current_group_num = i + # 重设当前测量时间 ,measurement_interval 间隔为s + self.real_time = self.get_current_time_by_i_interval( i,self.measurement_interval) + log.warning(f" real time -> {self.real_time}") + self.res = {} + tmp_before_avg = [] + for j in range( self.measurement_repeat ): + tmp_before_avg.append( self.intensity_before_avg[j+i*self.measurement_repeat] ) + pass + self.getAvg(tmp_before_avg) + self.__do_sensor_dict_interpo() + + # 选择追加保存, 一个Lsky 可能多组文件,只能单独保存为 Lsky Esky ..Rs + # self.appendSave() + self.getLwRs() + self.checkAndSaveData( ) + path_info_txt = self.output_path.joinpath( "info.txt" ) + self.save_dict_to_file( self.info_dict, path_info_txt ) + + def get_current_time_by_i_interval(self, i, interval): + self.my_time.setCurrentTimeStr(self.current_measure_time) + self.my_time.timeDelta(seconds=i*interval) + return self.my_time.cur_time_str + pass + + def dealOneGroup(self, ): + # 分组,并获得平均值, 255个未插值结果 (依据 measurement_interval measurement_repeat) + self.getAvg( self.intensity_before_avg ) + + # 插值 + self.real_wavelength = self.getWavelenthDict() + self.__do_sensor_dict_interpo() + + self.ymdhms = "20"+ str(self.info_dict['year']) + '_' \ + + str(self.info_dict['month']) + '_' \ + + str(self.info_dict['day']) + '_' \ + + str(self.info_dict['hour']) + '_' \ + + str(self.info_dict['minute']) + '_' \ + + str(self.info_dict['second']) + + self.output_path = self.output_path.joinpath( self.ymdhms ) + self.appendSave() + + def dealOneMeasurement(self, fpath:Path): + '''handheld一次测量包含多组数据''' + # 调用handheldbuf 处理,将一组数据提交出来 + log.info(f"dealOneMeasurement: 一组测量数据", __name__, "dealOneMeasurement") + if len(self.filelist)<1: + pass + + # 当前文件名 + self.output_path = OUTPUT_DIR + self.current_filepath = fpath + self.current_measure_time = self.hhp.getCurrentMeasureTimeFromPath(fpath) + self.ymdhms = "20"+ str(self.info_dict['year']) + '_' \ + + str(self.info_dict['month']) + '_' \ + + str(self.info_dict['day']) + '_' \ + + str(self.info_dict['hour']) + '_' \ + + str(self.info_dict['minute']) + '_' \ + + str(self.info_dict['second']) + self.output_path = self.output_path.joinpath( self.ymdhms ) + log.warning(f"current_measure_time: {self.current_measure_time}", __name__, "dealOneHandheldMeasurement") + + self.hhb.readFile2Buf(fpath) + self.decode_sensor_buf() + self.real_wavelength = self.getWavelenthDict() + self.dealOneGroup() + + def dealOneMeasurement_Online(self, ): + '''handheld一次测量包含多组数据''' + # 调用handheldbuf 处理,将一组数据提交出来 + log.info(f"dealOneMeasurement_Online: 一组测量数据", __name__, "dealOneMeasurement_Online") + + # 当前文件名 + self.output_path = self.new_folder + # self.current_measure_time = self.hhp.getCurrentMeasureTimeFromPath(fpath) + self.ymdhms = self.getTimeFnameFromInfoDict() + + # getBuf + self.get_sensor_buf() + self.decode_sensor_buf() + self.real_wavelength = self.getWavelenthDict() + + self.getAvg( self.intensity_before_avg ) + self.real_wavelength = self.getWavelenthDict() + self.__do_sensor_dict_interpo() + + self.saveOnefileForLskyEskyLwaterLwRS() + + def get_sensor_buf(self,) : + buf = b"" + self.mydir.setBaseDir(self.new_folder) + my_bin_list = self.mydir.get_files_from_currentdir("*.bin") + my_bin_list = self.mydir.sort_filepath_and_check(my_bin_list) + for mbl in my_bin_list: + buf = buf + self.read_bin(mbl) + self.hhb.write_buf(buf) + pass + + def get_ymdhms(self, ): + self.ymdhms = "20"+ f"{self.info_dict['year']:02d}" + '_' \ + + f"{self.info_dict['month']:02d}" + '_' \ + + f"{self.info_dict['day']:02d}" + '_' \ + + f"{self.info_dict['hour']:02d}" + '_' \ + + f"{self.info_dict['minute']:02d}" + '_' \ + + f"{self.info_dict['second']:02d}" + + def getTimeFnameFromInfoDict(self,) : + ymdhms = "20"+ str(self.info_dict['year']) + '_' \ + + str(self.info_dict['month']) + '_' \ + + str(self.info_dict['day']) + '_' \ + + str(self.info_dict['hour']) + '_' \ + + str(self.info_dict['minute']) + '_' \ + + str(self.info_dict['second']) + return ymdhms + + def decode_sensor_buf_profiler(self,) : + # 处理Buf,对多组数据取平均, + self.intensity_before_avg = [] + # res_before_avg = [] + self.clearRes() # 清空数据 + while True: + if not self.hhb.decode_one_group_handheld() : + break # 清空数据 + + res = {} + ip_buf = self.hhb.one_group_data[:26] + buf = self.hhb.one_group_data[26:] + for i in range(1,4,1): + temp_buf = buf[7:71] + buf[79:143] + \ + buf[151:215] + buf[223:287] + \ + buf[295:359] + buf[367:431] + \ + buf[439:503] + buf[511:575] + + # Ramses类 标定处理,设置buf 标定文件 + self.ramses.setBuf(temp_buf) + func = self.getFuncBySeq(i) + cfg = self.getCfgByFunc( func) + if i == 1 or i==3: # 两个空气中一个水中注意序号 + self.ramses.setMode(1) # 水中??? 另外一个是空气中的 + if i == 1: # 获得深度倾斜 + # self.decode_ip_buf( ip_buf, cfg ) + x_y_depth_m = self.ramses.decode_ip_buf( ip_buf, cfg) + self.depth_tilt_x_y.append(x_y_depth_m) + self.ramses.setCalCfg(cfg) + self.ramses.resetItSpectrum() + self.ramses.ConvertAndCalibrate() + res.update({ func : self.ramses.spectrum }) + + # 处理 深度倾斜 数据 + # depth_m_x_y = self.ramses.decode_ip_buf( ip_buf, cfg) + # self.decode_ip_buf(ip_buf) + + self.intensity_before_avg.append( res ) + pass + + def decode_sensor_buf(self,) : + # 处理Buf,对多组数据取平均 + self.intensity_before_avg = [] + # res_before_avg = [] + self.clearRes() # 清空数据 + while True: + if not self.hhb.decode_one_group_handheld() : + break # 清空数据 + + res = {} + buf = self.hhb.one_group_data[26:] + for i in range(1,4,1): + temp_buf = buf[7:71] + buf[79:143] + \ + buf[151:215] + buf[223:287] + \ + buf[295:359] + buf[367:431] + \ + buf[439:503] + buf[511:575] + + # Ramses类 标定处理,设置buf 标定文件 + self.ramses.setBuf(temp_buf) + func = self.getFuncBySeq(i) + cfg = self.getCfgByFunc( func) + self.ramses.setCalCfg(cfg) + self.ramses.resetItSpectrum() + self.ramses.ConvertAndCalibrate() + res.update({ func : self.ramses.spectrum }) + self.intensity_before_avg.append( res ) + pass + + # def decode_ip_buf( self, buf, ip_cal) : + # '''Ed校正文件去处理数据''' + # res = self.ramses.decode_ip_buf(buf,ip_cal) + # self.depth_tilt_x_y.append(res) + # pass + + # def getAvg( self, d:list) : + # log.info(f"getAvg: 平均多组数据", __name__, "getAvg") + # data = d + # ret = {} + # len_result = len(data) + # if len_result == 0: + # self.intensity_after_avg ={} + # return None + # if len_result == 1: + # self.intensity_after_avg = data[0] + # return None + # ret = data[0] + + # res_dict = self.getRetDict() + + # for k in res_dict.keys(): + # for i in range(1,len_result,1): + # data[0][k] = data[0][k] + data[i][k] + # ret = data[0][k]/len_result + # self.intensity_after_avg.update( { k : ret } ) + # log.debug(f"getAvg: {self.intensity_after_avg}", __name__, "getAvg") + # pass + + def getRetDict(self,) : + ret_dict = { } + ret_dict.update( {self.device_enum(1).name:np.array([])} ) + ret_dict.update( {self.device_enum(2).name:np.array([])} ) + ret_dict.update( {self.device_enum(3).name:np.array([])} ) + # self.one_group_result = ret_dict + return ret_dict + + def __do_sensor_dict_interpo(self,) : + log.info( f"同步处理多个个插值 ", __name__, "__do_sensor_dict_interpo" ) + self.clearRes() + for k in self.intensity_after_avg.keys(): + tmp = np.interp( self.wavelength, self.real_wavelength[k], self.intensity_after_avg[k] ) + self.res.update( { k : tmp } ) + + def getCfgByDid(self, func:str) : + cfg_id:dict = self.cfg.get(int(self.device_id)) + cfg_sensor = cfg_id.get( func) + return cfg_sensor + pass + + def getFuncBySeq(self, seq:int) : + func = "" + if self.device_type == DeviceType.AWRAMS.name: + func = RamsesAWRAMS(seq).name + if self.device_type == DeviceType.SURFACE.name: + func = RamsesAWRAMS(seq).name + if self.device_type == DeviceType.PROFILE.name: + func = RamsesAWRAMS(seq).name + return func + + def getCfgByFunc(self, func:str) : + cfg_id:dict = self.syscfg.get(int(self.device_id)) + cfg_sensor = cfg_id.get( func) + return cfg_sensor + pass + + def getCfgBySeq(self, seq:int) : + func = "" + if self.device_type == DeviceType.AWRAMS.name: + func = RamsesAWRAMS(seq).name + if self.device_type == DeviceType.SURFACE.name: + func = RamsesAWRAMS(seq).name + if self.device_type == DeviceType.PROFILE.name: + func = RamsesAWRAMS(seq).name + cfg_id:dict = self.syscfg.get(int(self.device_id)) + cfg_sensor = cfg_id.get( func) + return cfg_sensor + pass + + def saveOnefileForLskyEskyLwaterLwRS(self, ) -> bool: + log.info(f" ", __name__, "saveOnefileForLskyEskyLwaterLwRS") + self.mydir.setBaseDir(self.output_path) #基路径 + + time_name = self.getTimeFnameFromInfoDict() + Lw = self.res["Lwater"] - ROWFACTOR * self.res["Lsky"] + self.res.update({ self.device_enum(4).name : Lw }) + Rs = self.res[self.device_enum(4).name] / self.res["Esky"] + self.res.update({ self.device_enum(5).name : Rs }) + + self.mydir.setHeader( self.wavelength.tolist(), TOKEN, "device_id_"+str(self.device_id) ) + header = self.mydir.header_str + + save_path_csv = self.new_folder.joinpath(time_name + SAVE_EXT_NAME) + data_str = "" + for k in self.res.keys(): + self.mydir.setContent(self.res[k].tolist(),TOKEN,k ) + data_str = data_str + NEWLINE + self.mydir.content_str + save_path_csv.write_text(header+data_str) + + path_info_txt = self.new_folder.joinpath( time_name + "_info.txt" ) + self.save_dict_to_file( self.info_dict, path_info_txt ) + + def appendSave(self, ) -> bool: + '''self.output_path''' + self.checkAndSaveData( ) + self.getLwRsAndSave() + path_info_txt = self.output_path.joinpath( "info.txt" ) + self.save_dict_to_file( self.info_dict, path_info_txt ) + + def checkAndSaveData(self, ) -> bool: + """ + check self.Lsky Esky Lwater and Save + 处理self.res 的数据 + """ + log.info(f"checkAndSaveData: {self.output_path.parts}", __name__) + self.mydir.setBaseDir(self.output_path) #基路径 + self.mydir.setHeader( self.wavelength.tolist(), TOKEN, "device_id_"+str(self.device_id) ) + # print(f"header_str : {self.mydir.header_str[-1:]}") + + if self.current_group_num == 0: + self.newFileByFunc( self.device_enum(1).name ) + self.newFileByFunc( self.device_enum(2).name ) + self.newFileByFunc( self.device_enum(3).name ) + self.newFileByFunc( self.device_enum(4).name ) + self.newFileByFunc( self.device_enum(5).name ) + pass + + self.appendFileByFunc( self.device_enum(1).name ) + self.appendFileByFunc( self.device_enum(2).name ) + self.appendFileByFunc( self.device_enum(3).name ) + self.appendFileByFunc( self.device_enum(4).name ) + self.appendFileByFunc( self.device_enum(5).name ) + + def newFileByFunc(self, func:str) -> None: + self.mydir.newFileIfNot( func+SAVE_EXT_NAME) + if self.mydir.checkHeader() == -1: + log.error(f"请备份文件:{self.mydir.current_filepath.parent} {self.mydir.current_filepath.name}, 并删除文件后再试!", __name__) + raise MyException( f"请备份文件:{self.mydir.current_filepath.parent} {self.mydir.current_filepath.name}, 并删除文件后再试!" ) + return False + if self.mydir.checkHeader() == 1: + pass + if self.mydir.checkHeader() == 0: + self.mydir.writeHeader() + pass + + # 写入数据content + log.warning(f" write content time {self.real_time}") + self.mydir.setContent(self.res[func].tolist(), TOKEN, self.real_time) + self.mydir.writeContent() + + def appendFileByFunc(self, func:str) -> None: + # 追加写入数据content + self.mydir.setContent(self.res[func].tolist(), TOKEN, self.real_time) + self.mydir.writeContent() + + def clearRes(self, ) -> None: + self.res = { } + + def getLwRs(self, ) -> bool: + """ + 并计算Lw Rs并保存 + """ + Lw = self.res["Lwater"] - ROWFACTOR * self.res["Lsky"] + self.res.update({ self.device_enum(4).name : Lw }) + Rs = self.res["Lw"] / self.res["Esky"] + self.res.update({ self.device_enum(5).name : Rs }) + + return True + + def getLwRsAndSave(self, ) -> bool: + """ + 并计算Lw Rs并保存 + """ + Lw = self.res["Lwater"] - ROWFACTOR * self.res["Lsky"] + self.res.update({ "Lw" : Lw }) + Rs = self.res["Lw"] / self.res["Esky"] + self.res.update({ "Rs" : Rs }) + self.mydir.setBaseDir(self.output_path) #基路径 + + # 保存 + + if self.current_group_num == 0: + self.newFileByFunc( "Lw" ) + self.newFileByFunc( "Rs" ) + pass + + self.appendFileByFunc( "Lw" ) + self.appendFileByFunc( "Rs" ) + + return True + + def read_bin(self,fpath: Path): + log.debug(f" readbin: ", __name__, "", "" ) + ret = None + if not fpath.exists() : + log.info(f"not find file: {fpath} ") + return ret + with open(fpath, 'rb') as file: + ret = file.read() + return ret + log.debug(f" readbin: {ret} ", __name__, "", "" ) + return ret + pass + + + + def decode_info( self,info: bytes ) -> dict: + ret = {} + # 剖面型加了1311+24个字节共26个字节 + # 保留字节有所变化,改为序列号,每个序列号两个字节 + try: + temp = struct.unpack(" None: + temp_str = "" + for key, value in info_dict.items(): + temp_str = temp_str + key + " : " + str(value) + "\n" + with open(fpath, "w+") as f: + f.write(temp_str) + + def save_error_to_file(self, errlist: list, fpath: Path) -> None: + temp_str = "" + if len(errlist) <1: + return None + for errdict in errlist: + temp_str = temp_str + errdict["path"] +" : "+ errdict["error"] + "\n" + pass + with open(fpath, "w+") as f: + f.write(temp_str) + return None + pass + + def getWavelenthDict( self, ) -> dict: + ret_dict = self.getRetDict() + cfg_id:dict = self.syscfg + # cfg_id:dict = self.syscfg.get( int(self.device_id)) + for k in ret_dict.keys(): + tmp = self.getWavelength( cfg_id.get(k) ) + ret_dict.update({ k : tmp }) + return ret_dict + + def getWavelength(self,ramsesdict:dict) -> np.ndarray: + ret = [] + for i in range(1,256): + tmp = float(ramsesdict['c0s']) + float(ramsesdict['c1s'])*i \ + + float(ramsesdict['c2s'])*i*i + float(ramsesdict['c3s'])*i*i*i + ret.append(tmp) + pass + return np.array(ret) + + def setSyscfg_DeviceID(self, syscfg:dict, did:int): + self.device_id = did + self.syscfg = syscfg + if hasattr(self.syscfg,self.device_id): + self.syscfg = self.syscfg.get(self.device_id) + else: + raise f"传入的标定文件不包含 Device Id : {self.device_id}的标定信息" + + def set_tilt_range(self, tilt_range:float): + self.tilt_range = tilt_range + + def setSyscfg(self, syscfg:dict): + self.syscfg = syscfg + if self.device_id is not None: + self.syscfg = self.syscfg.get(self.device_id) + + def setRetrieve(self, retrieve:dict): + log.debug( f"setRetrieve : {retrieve}......", __name__ ) + self.retrieve = retrieve + self.setNewWavelength() + # self.wavelength:np.ndarray = np.arange ( self.retrieve['beginWL'], self.retrieve['endWL'], self.retrieve['interval'] ) + + def setNewWavelength(self, ): + self.wavelength:np.ndarray = np.arange ( + self.retrieve['beginWL'], self.retrieve['endWL'], self.retrieve['interval'] ) + + def setDeviceID(self, did:int): + self.device_id = did + if self.syscfg == {}: + self.syscfg = self.syscfg.get(self.device_id) + + def setDeviceType(self, device_type): + self.device_type = device_type + + def getErrorInfoDict(self, ): + return self.error_result + + def printResult(self,): + log.info( f"***** : Print Lsky Esky Lwater Lw Rs......", __name__ ) + print(self.res[self.device_enum(1)]) + print(self.res[self.device_enum(2)]) + print(self.res[self.device_enum(3)]) + print(self.res[self.device_enum(4)]) + print(self.res[self.device_enum(5)]) + pass + + def printTest(self,d,sleep_time:int=5): + log.info( f"***** : I am testing ********", __name__ ) + print(d) + log.info( f"***** : Ending testing ********", __name__ ) + time.sleep(sleep_time) + pass + +if __name__ == "__main__": + # hh = HandHeld() + # hh.getDataFileList() + # hh.dealAllMeasurements() + + # data/2023_02/07/sensor/14_02_46 + # hhb= HandHeldBuf() + # hhb.readFile2Buf("data/2023_02/07/sensor/14_02_46") + # hhb.decode_handheld() + # print(hh.error_result) + # print("======") + # print(hh.filelist) + + # print( hh.getDataFname() ) + + # t = b'\x07' + # print( int(t[0])) + # print( 2 << int(t[0])) + + + pass + diff --git a/profiler.py b/profiler.py index cc3f819..250df10 100644 --- a/profiler.py +++ b/profiler.py @@ -1,652 +1,535 @@ -#! python3 -# -*- encoding: utf-8 -*- -''' -@File : handheld.py -@Time : 2023/02/24 17:20:59 -@Author : Jim @ Yiwin -@Version : 1.0 -@Contact : jim@yi-win.com -''' - -CUR_TIME_STR_FMT = "%Y-%m-%d %H:%M:%S" - -import time -import locale -import struct +from dataclasses import dataclass,field +from pathlib import Path +from typing import Any,List,Callable +from enum import Enum import numpy as np +import struct +import time from scipy.optimize import leastsq - -from pathlib import PurePath,Path -from myconfig import CURRENT_DIR,DATA_DIR,OUTPUT_DIR,NEWLINE,ROWFACTOR,SAVE_EXT_NAME,TOKEN -from myconfig import DeviceType,RamsesSURFACE,RamsesAWRAMS,RamsesPROFILE +from datetime import datetime, timedelta +from myRamses import RamsesFactoryHandle,AirWater from tools.mylogger import log -from tools.myexception import MyException -from tools.mytime import MyTime -from tools.mypath import MyDir -from Ramses import Ramses - -class HandHeldBuf: - def __init__(self,) -> None: - self.__buf = b'' - self.__head = {} - self.__begin_sign = b'\x23' - self.__end_sign = b'\x0D' - self.data_ip = b'' - self.measure_group = { - "Lsky": b'', - "Esky": b'', - "Lwater": b'', - } - self.one_group_data= b'' - self.state = 0 - - def readFile2Buf(self, fpath) -> None: - with open(fpath,"rb") as f: - self.__buf = f.read() - pass - pass - - def read_buf(self, size: int) -> bytes: - if size > self.__buf.__len__(): - return b'' - ret = self.__buf[0:size] - self.__buf = self.__buf[size:] - return ret - - def write_buf(self, buf: bytes) -> None: - len = buf.__len__() - # logging.info(f'Received ID:{id} Size:{len}') - self.__buf = self.__buf+buf - - def get_buf_size(self) -> int: - return self.__buf.__len__() +from myconfig import TOKEN,NEWLINE,DATA_DIR,SAVE_EXT_NAME +from myconfig import RamsesPROFILE - def back_bytes(self, buf: bytes) -> None: - self.__buf = buf+self.__buf - - def reset_head(self) -> None: - self.__head = {} - - def reset_buf(self) -> None: - self.__buf = b'' - - def getResult(self) -> str: - return self.res - - def resetMeasureGroup(self) -> None: - self.measure_group['Lsky'] = b'' - self.measure_group['Esky'] = b'' - self.measure_group['Lwater'] = b'' - - def getMeasureGroup(self) -> dict: - return self.measure_group - - def decode_handheld(self) -> bool: - '''以26个字节开始,一般26个00 ,然后23... 07.... ''' - if self.get_buf_size() < 1754: - self.__buf = b'' - return False - - self.data_ip = self.read_buf(26) - Lsky = self.read_buf(576) - Esky = self.read_buf(576) - Lwater = self.read_buf(576) - - self.measure_group['Lsky'] = self.deal_576_to_512(Lsky) - self.measure_group['Esky'] = self.deal_576_to_512(Esky) - self.measure_group['Lwater'] = self.deal_576_to_512(Lwater) - - if self.measure_group['Lsky'] == b'' \ - or self.measure_group['Esky'] == b'' \ - or self.measure_group['Lwater'] == b'' : - return False - - return True - - def decode_one_group_handheld(self) -> bool: - '''以26个字节开始,一般26个00 ,然后23... 07.... ''' - if self.get_buf_size() < 1754: - self.__buf = b'' - return False - - self.data_ip = self.read_buf(26) - self.one_group_data = self.read_buf(1728) - - return True - - def deal_576_to_512(self,data:bytes) -> bytes: - ''' 576字节校验,拆分成字典 23... 07.... ,然后254*2''' - ret = {} - index = 72 - for i in range(8): - temp = data[i*index : i*index+index] - # print( temp.hex()) - if temp[0] != 35 and temp[0]<8 and temp>0 : - return b'' - pass - ret.update( { temp[4]: temp} ) - if len(ret) != 8: - return b'' - ret_byte = ret[7][7:71]+ ret[6][7:71]+ ret[5][7:71]+ ret[4][7:71] \ - + ret[3][7:71]+ ret[2][7:71]+ ret[1][7:71]+ ret[0][7:71] - return ret_byte - - - def decode(self) -> str: - ret = '' - temp_buf = b'' - token = ";" - if TOKEN: - token = TOKEN - - if self.state == 0: - while self.get_buf_size() >= 1: - if self.read_buf(1) != self.__end_sign: - continue - self.state = 1 - break +TIME_STR = "2022-06-10 16:16:16" +STD_TIME_STR_FMT = "%Y-%m-%d %H:%M:%S" # 小写y是两位年份 +CUR_TIME_STR_FMT = "%Y-%m-%d %H:%M:%S" - if self.state == 1: - while self.get_buf_size() >= 1: - buf = self.read_buf(1) - if buf != self.__end_sign: - temp_buf += buf - if buf == self.__end_sign: - ret = temp_buf[0:20].decode( - 'utf-8').strip(" ") + token + temp_buf[-9:-1].decode('utf-8').strip(" ") - log.info(f"decode : {ret}") - temp_buf = b'' - self.back_bytes(temp_buf) # 写回临时buf到 - self.res = ret +@dataclass +class InfoFrame(object): + """ 剖面, 深度Depth: offset""" + infoBytes:bytes = None + time_str:str= None + time_stamp:int= None + year:str= None + month:str= None + day:str= None + hour:str= None + minute:str= None + second:str= None + Roll: int= None + Pitch:int= None + Yaw:int= None + Hx:int= None + Hy:int= None + lon:int= None + lat:int= None + satelite_num:int= None + PDOP:int= None + HDOP:int= None + VDOP:int= None + Temperature:int= None + Humidity:int = None + Battery:int= None + ErrorCode:int= None + Azimuth:int= None + RunAngle:int= None + MeasureGroupNum:int= None + Tiltx:int= None + Tilty:int= None + Depth:int= None + SN1:str= None + SN2:str= None + SN3:str= None + MeasureInterval :int= None + MeasureRepeat: int= None + ip_bytes = b'' + + def output_info_frame(self, ): + ret = "" + ret = ret + "time : " + self.time_stamp + ret = ret + NEWLINE + "time_stamp : " + self.time_stamp + ret = ret + NEWLINE + "year : " + self.year + ret = ret + NEWLINE + "month : " + self.month + ret = ret + NEWLINE + "day : " + self.day + ret = ret + NEWLINE + "hour : " + self.hour + ret = ret + NEWLINE + "minute : " + self.minute + ret = ret + NEWLINE + "second : " + self.second + + ret = ret + NEWLINE + "Roll : " + self.Roll + ret = ret + NEWLINE + "Pitch : " + self.Pitch + ret = ret + NEWLINE + "Yaw : " + self.Yaw + ret = ret + NEWLINE + "Hx : " + self.Hx + ret = ret + NEWLINE + "Hy : " + self.Hy + ret = ret + NEWLINE + "Hz : " + self.Hz + ret = ret + NEWLINE + "lon : " + self.lon + ret = ret + NEWLINE + "lat : " + self.lat + ret = ret + NEWLINE + "PDOP : " + self.PDOP + ret = ret + NEWLINE + "HDOP : " + self.HDOP + ret = ret + NEWLINE + "VDOP : " + self.VDOP + ret = ret + NEWLINE + "Temperature : " + self.Temperature + ret = ret + NEWLINE + "Humidity : " + self.Humidity + ret = ret + NEWLINE + "Battery : " + self.Battery + ret = ret + NEWLINE + "ErrorCode : " + self.ErrorCode + ret = ret + NEWLINE + "Azimuth : " + self.Azimuth + ret = ret + NEWLINE + "RunAngle : " + self.RunAngle + ret = ret + NEWLINE + "MeasureGroupNum : " + self.MeasureGroupNum + ret = ret + NEWLINE + "Tiltx : " + self.Tiltx + ret = ret + NEWLINE + "Tilty : " + self.Tilty + ret = ret + NEWLINE + "Depth : " + self.Depth + + ret = ret + NEWLINE + "SN1 : " + self.SN1 + ret = ret + NEWLINE + "SN2 : " + self.SN2 + ret = ret + NEWLINE + "SN3 : " + self.SN3 + ret = ret + NEWLINE + "MeasureInterval : " + self.MeasureInterval + ret = ret + NEWLINE + "MeasureRepeat : " + self.MeasureRepeat return ret pass + + def set_info_frame(self, info:bytes): + ret = {} + try: + temp = struct.unpack(" Path: - # 服务器上转移后的模式 - if self.mode == 1: - sensor_path = self.base_path.joinpath( - info_path.parent, - "sensor.bin" - ) - elif self.mode == 0: - sensor_path = self.base_path.joinpath( - "data", - info_path.parts[1][:4] + "_" + info_path.parts[1][-2:], - info_path.parts[2], - "sensor", - info_path.name - ) - else: - sensor_path = None - return sensor_path + def set_wavelength(self, wv:List): + self.wavelength = wv pass - def getOutputPathFromSensorPath(self,sensor_path:Path ) -> Path: - if self.mode == 1: - output_path = self.output_path.joinpath( - self.info_dict['year'] + "_" + self.info_dict['month'] - + "_" + self.info_dict['day'] + "_" + self.info_dict['hour'] - + "_" + self.info_dict['minute'] + "_" + self.info_dict['second'] - ) - elif self.mode == 0: - output_path = self.output_path.joinpath( - sensor_path.parts[1][:4] + "_" + sensor_path.parts[1][-2:] - + "_" +sensor_path.parts[2] + "_" +sensor_path.name - ) - else: - output_path = None - return output_path - pass + def set_spectrum(self, spectrum:List): + self.spectrum = spectrum + pass - def getCurrentMeasureTimeFromPath(self,fpath:Path ) -> str: - ret = '' - if self.mode == 1: # 读信息txt获得时间 - txt_path = fpath.parent.glob("*.txt") - txt_stem = txt_path[0].stem - ret = fpath.parts[1][:4]+"-"+fpath.parts[1][-2:]+"-"+fpath.parts[2]+" " \ - + txt_stem[-9:-7] + ":" + txt_stem[-6:-4] + ":" + txt_stem[-3:-1] - pass - elif self.mode == 0: - ret = fpath.parts[1][:4]+"-"+fpath.parts[1][-2:]+"-"+fpath.parts[2]+" " \ - + fpath.name[0:2] + ":" + fpath.name[3:5] + ":" + fpath.name[6:8] - else: - pass - return ret + def get_wavelength(self ): + return self.wavelength pass + def get_spectrum(self ): + return self.spectrum + pass + +@dataclass +class ProfilerData(object): + deviceid:int =None + configSensor:List[str] = None # 序列号 Ed Esky Lu + configFunc:List[str] = None # Ed Esky Lu + currentPath:Path =None + info_frame:InfoFrame = None + data_frame:DataFrame = None # 数据只到分组成byte结束 + ramsesFactoryHandle:List[RamsesFactoryHandle] = None # 多个工厂,每个工厂有自己的 标定文件及参数,工厂标记序列哈,只处理相同序列号的产品数据 + depth:float = None + tiltx:float = None + tilty:float = None + wavelength:List[List[float]] =None + spectrum:List[List[float]] =None + pass - def getDataFileList(self, ): - ''' - 获得成对的info sensor 文件 - [目录名,文件名,年月日,时间, measure_id] - ''' - # ret = [] - fs = None - self.filelist = [] - if self.mode == 1: - fs = self.data_path.glob( "*/*/*/*/info.bin" ) - else: - fs = self.data_path.glob( "*/*/info/*" ) - - for f in fs: - error_file = {} - if f.stat().st_size==0: - error_file.update( {"path": f } ) - error_file.update( {"error":"info file size is zero"} ) - self.error_result.append(error_file) - continue - - # self.info_path_fname = f - sensor_path = self.getSensorPathFromInfoPath(f) - # sensor_path = Path(sensor_purepath) - # sensor 文件不存在 - if not sensor_path.exists(): - error_file.update( {"path":f} ) - error_file.update( {"error":"cannot find the sensor file "} ) - self.error_result.append(error_file) - continue - - # sensor文件大小为0 - if sensor_path.stat().st_size==0: - error_file.update( {"path":sensor_path} ) - error_file.update( {"error":"sensor file size of the sensor is zero' "} ) - self.error_result.append(error_file) - continue - self.setFilelist(f,sensor_path ) - pass - - - def setFilelist(self, info_path:Path, sensor_path:Path): - temp = {} - temp.update( {"info_path" : info_path } ) - temp.update( {"name" : info_path.name} ) - temp.update( {"parent" : info_path.parent} ) - - if self.mode==1: # 服务器转移后目录 - temp.update( {"year" : info_path.parts[-5] } ) - temp.update( {"month" :info_path.parts[-4] } ) - temp.update( {"day" :info_path.parts[-3] } ) - - temp.update( {"year" : info_path.parts[1][:4] } ) - temp.update( {"month" :info_path.parts[1][-2:] } ) - temp.update( {"day" :info_path.parts[2] } ) - temp.update( { "sensor_path" :sensor_path } ) - self.filelist.append(temp) - - def getFilelist(self, ): - return self.filelist - - def printTest(self,d,sleep_time:int=5): - log.info( f"***** : I am testing from HandheldPath ********", __name__ ) - print(d) - log.info( f"***** : Ending testing from HandheldPath ********", __name__ ) - time.sleep(sleep_time) + def __post_init__(self): + assert self.deviceid != None , ">>>> AWRAMSData deviceid is empty" pass -class Profiler(object): - def __init__(self, ): + def build_datafactory_by_configSensor(self,calcfg:dict): """ - @description : 手持数据初始化 - 入口: dealOneMeasurement_Handheld() - 参考: 分组写成函数,一次测量多组数据分离出来。 - 保存: 按时间文件夹保存 - @comment - 1号数据: Ed 带倾斜 samip - 2号数据: Esky 可能没有 ? 如何判断,信息帧的序列号? 数据? - 3号数据: Lu + @description : 调用工厂得到整数值 + @param : 576字节数据, 数据id(第几个传感器,还是序列号?) + @Returns : List[int] """ - self.device_type = DeviceType.PROFILE.name - self.device_enum = None - self.device_id = {} - self.syscfg = {} - self.retrieve ={} - self.error_result=[] - self.mode = 0 # 0:默认SD数据, 1:服务器数据 - self.base_path = CURRENT_DIR - self.current_path = CURRENT_DIR - self.data_path = DATA_DIR - self.output_path = OUTPUT_DIR - self.info_path_fname:Path = self.base_path - self.sensor_path_fname:Path = self.base_path - self.filelist = [] # 包含了全部路径信息 - self.intensity_before_avg = None - self.intensity_after_avg = {} # 最终结果{lsky: esky: lwater: } - self.intensity_after_interpo = {} # 最终结果{lsky: esky: lwater: } - - self.one_group_result = {} # 手持式 多次间隔 - self.wavelength = np.array([]) - self.real_wavelength = {} # 最终结果{lsky: esky: lwater: } - self.current_filepath = '' # 不含后缀 - self.current_measure_time = None # 当前测量时间 - self.current_group_num = 0 - self.measurement_interval = 0 - self.measurement_repeat = 1 - # self.sl2f = SaveList2File() - self.mydir = MyDir() - self.my_time = MyTime() - self.hhb = HandHeldBuf() - self.hhp = HandHeldPath() - self.ramses = Ramses() - self.info_dict = {} - self.res = {} # 最终结果{ld: esky: lu: Lw: Rs:} - self.depth_m_offset = 0.0 - # self.depth_m = 0.0 - # self.tilt_x = 0.0 - # self.tilt_y = 0.0 - self.depth_tilt_x_y = [] # [ {"depth":, "tilt_x": ,"tilt_y": }] - - # 方法 - self.setDeviceEnum() - self.setMode() - self.set_hhp_path() + assert self.configSensor != None, ">>>> AWRAMSData configSensor is None" + self.ramsesFactoryHandle = [None,None,None] + for i in range(0, len( self.configSensor)): + # log.warning( self.configFunc[i], "build_datafactory_by_configSensor" ) + cfg = calcfg[self.configFunc[i]] + tmp_ramses_factory_handle = RamsesFactoryHandle( sn= self.configSensor[i], cfg=cfg ) + if self.configFunc[i] == RamsesPROFILE(1).name or self.configFunc[i] == RamsesPROFILE(3).name: + tmp_ramses_factory_handle.set_air_water(AirWater.Water) + self.ramsesFactoryHandle[i] = tmp_ramses_factory_handle + + # 获得波长 + def set_wavelength(self ): + self.wavelength = [] + for i in range(0, len( self.configSensor)): + self.ramsesFactoryHandle[i].rf.get_wavelenth() + self.wavelength.append (self.ramsesFactoryHandle[i].rf.Wavelength) + + def set_info_frame(self, info_frame:bytes): + self.info_frame = InfoFrame() + self.info_frame.set_info_frame(info_frame) #已经解析 pass - def setMode(self,mode=0 ): - self.hhp.setMode (mode) # 0 :读SD卡 1:读服务器数据 - - def setMeasureID(self, mid:int): - self.measure_id = mid - - def setOldFolder(self, tuple_path:tuple): - self.old_folder = self.base_path.joinpath( *tuple_path ) + def set_data_frame( self, data_byte: bytes , pth: Path, func ): + """ + @description : 剖面数据, 处理某个深度的 1754字节数据 + TODO : 依据数据数量进行处理 + """ + log.debug( f" arg: data_byte: bytes ", __class__, "set_data_frame" ) + self.data_frame = DataFrame() + # self.data_frame.set_ramses_num(3) + self.data_frame.set_data_bytes(data_byte ) + + # 调用ramsesFactoryHandle 对字节数据进行处理 + ip_buf = self.data_frame.data_ip + # self.wavelength = [] + self.spectrum = [] + for i in range(0, len( self.configSensor)): + self.ramsesFactoryHandle[i].deal_raw_data( self.data_frame.data_ramses[i], 0) + self.spectrum.append (self.ramsesFactoryHandle[i].rf.data_after_cal) + if self.configFunc[i] == RamsesPROFILE(1).name: + self.depth,self.tiltx,self.tilty = self.ramsesFactoryHandle[i].deal_raw_ip_buf(self.data_frame.data_ip) + pass - def transferFromOldFolder(self, ): - log.info( f"transferFromOldFolder: ", __name__ ) - self.getNewFolderFromOldFolder() - bin_files = self.old_folder.glob('*.bin') - for bf in bin_files: - if bf.name == "pic.bin": - bf.replace( self.new_folder.joinpath( "pic.jpg" ) ) - else: - bf.replace( self.new_folder.joinpath(bf.name) ) - pass + # 回调函数 + func( self.wavelength, self.spectrum,self.depth,self.tiltx,self.tilty) - def deleteOldFolder(self, ): - log.info( f"deleteOldFolder: ", __name__ ) - self.mydir.setBaseDir(self.old_folder) - self.mydir.deleteDir() - self.old_folder = DATA_DIR - def getNewFolderFromOldFolder( self, ) -> Path: - # 服务器上转移后的模式 - tmp_folder = self.old_folder.parent.parent - path_tuple = ("20"+f"{self.info_dict['year']:02d}" - ,f"{self.info_dict['month']:02d}" - ,f"{self.info_dict['day']:02d}" - ,self.old_folder.parts[-1] ) - self.new_folder =tmp_folder.joinpath(*path_tuple) - self.mydir.setBaseDir(self.new_folder) - self.mydir.newDirIfNot() +@dataclass +class Profiler(object): + deviceid:int = None + configSensor:List[str] =None # 序列号 + configFunc:List[str] =None # 功能 Ed Esky Lu + calibrationCfg:dict =None + data : ProfilerData =None + depth : List[float] =None + wavelength:List[np.ndarray] =None + spectrum:List[np.ndarray] =None + beginWavelength: float = None + endWavelength: float = None + rowFactor:float = None + wvInterval: float = None + depth_offset = None + tiltx_range = 1.0 + tilty_range = 1.0 + newWavelength:np.ndarray= None + Ed:np.ndarray = None # 无需记录原始波长,记录插值后的波长 + Esky:np.ndarray = None + Lu:np.ndarray = None + Kd:np.ndarray = None + Ed0:np.ndarray = None + Ku:np.ndarray = None + Lu0:np.ndarray = None + Lw:np.ndarray = None + Rs:np.ndarray = None + + afterdeal = [] + afterresult =[] + + def __post_init__(self): + assert self.deviceid != None + self.data = ProfilerData(deviceid=self.deviceid ) pass - - def getInfoDict(self, ): - info_path = self.old_folder.joinpath("info.bin") - hexbin = self.read_bin(info_path) - self.info_dict = self.decode_info(hexbin) - self.new_folder = self.getNewFolderFromOldFolder() - - def getCurrentMeasureTimeFromInfoDict(self, ) -> str: - ret = "20"+ str(self.info_dict['year']) + '-' \ - + str(self.info_dict['month']) + '-' \ - + str(self.info_dict['day']) + ' ' \ - + str(self.info_dict['hour']) + ':' \ - + str(self.info_dict['minute']) + ':' \ - + str(self.info_dict['second']) - # ret = "20"+ f"{self.info_dict['year']:02d}" + '_' \ - # + f"{self.info_dict['month']:02d}" + '_' \ - # + f"{self.info_dict['day']:02d}" + '_' \ - # + f"{self.info_dict['hour']:02d}" + '_' \ - # + f"{self.info_dict['minute']:02d}" + '_' \ - # + f"{self.info_dict['second']:02d}" - return ret + + def set_cfg_calibration(self,calcfg:dict): + assert self.deviceid != None + # assert self.deviceid in calcfg.keys(), f">>>> No calibrations data for the current id {self.deviceid}" + self.calibrationCfg = calcfg + pass + + def set_retrieve(self,rtv:dict): + self.beginWavelength = float(rtv["beginWL"]) + self.endWavelength = float(rtv["endWL"]) + self.wvInterval = float(rtv["interval"]) + self.n_t_square = float(rtv["n_t_square"]) + # self.rowFactor = float(rtv["rowFactor"]) # TODO + self.newWavelength = np.arange(self.beginWavelength,self.endWavelength,self.wvInterval) pass - def set_hhp_path(self, ): - self.hhp.setBasePath (self.base_path) - self.hhp.setDataPath (self.data_path) - self.hhp.setOutputPath (self.output_path) - - def setDeviceEnum(self, ): - if self.device_type == DeviceType.SURFACE.name: - self.device_enum = RamsesSURFACE - if self.device_type == DeviceType.AWRAMS.name: - self.device_enum = RamsesAWRAMS - if self.device_type == DeviceType.PROFILE.name: - self.device_enum = RamsesPROFILE + def set_ramses_sensor_numbers(self, num:int = 3): + self.data.data_frame = DataFrame() + self.data.data_frame.set_ramses_num( num ) + pass - def getDataFileList(self, ): - self.hhp.getDataFileList() - self.filelist = self.hhp.getFilelist() - # self.printTest(self.filelist) + def set_tilt_range( self, tilt_angle:float = 7 ): + self.tiltx_range = tilt_angle + self.tilty_range = tilt_angle + pass + + def config_awrams(self, cfg:dict): + assert self.deviceid in cfg.keys(), f'>> Cannot get the configuration of device id : {self.deviceid}' + self.configSensor = [ None, None, None ] + self.configFunc = [ None, None, None ] + + # Ed Esky Lu + # {1: {'FUNC': 'Ed', 'SN': '85B5'}, 2: {'FUNC': 'Esky', 'SN': '50ED'}, 3: {'FUNC': 'Lu', 'SN': '852F'}} + for k,v in cfg.items() : + if v["FUNC"] == RamsesPROFILE(1).name: + self.configSensor[0] = v["SN"] + self.configFunc[0] = v["FUNC"] + if v["FUNC"] == RamsesPROFILE(2).name: + self.configSensor[1] = v["SN"] + self.configFunc[1] = v["FUNC"] + if v["FUNC"] == RamsesPROFILE(3).name: + self.configSensor[2] = v["SN"] + self.configFunc[2] = v["FUNC"] + + if RamsesPROFILE(1).name not in self.configFunc: + raise f" No Ed cal info" + if RamsesPROFILE(3).name not in self.configFunc: + raise f" No Lu cal info" + # 将传感器配置传给 AWRAMSDATA + self.data = ProfilerData( deviceid=self.deviceid, configSensor=self.configSensor, configFunc=self.configFunc ) + # 将标定配置传给 AWRAMSData 建立工厂 + self.data.build_datafactory_by_configSensor( self.calibrationCfg) pass - def dealAllMeasurements(self, ): - log.info(f" 所有测量文件", __name__, "dealAllMeasurements", ) - if len(self.filelist)<1: - pass - # 前面已经考虑各种文件错误 - for df in self.filelist: - # 处理信息帧 - self.info_dict = {} - self.info_path_fname:Path = df["info_path"] - self.sensor_path_fname:Path = df["sensor_path"] - hex_info = self.read_bin( self.info_path_fname ) - try: - self.info_dict = self.decode_info( hex_info ) - except: - log.error( f"处理信息文件" - + "/" +self.info_path_fname.stem - + "出现错误", __name__, "dealAllMeasurements" ) - raise MyException( "处理文件"+ self.info_path_fname + "出现错误") - pass - - try: # awrams每次只有一组数据 - self.dealOneMeasurement(self.sensor_path_fname ) - # self.measurement_interval = int(self.info_dict['Measure_Interval']) - # self.measurement_repeat = int(self.info_dict['Measure_Repeat']) - # self.dealOneHandheldMeasurement(self.sensor_path_fname ) - except Exception as e: - log.error( "处理传感器文件" + self.sensor_path_fname.name + " 出现错误",__name__,"dealAllMeasurements") - raise MyException( "处理传感器文件" + self.sensor_path_fname.name + " 出现错误" ) - pass - log.info(f"Finished !! ", __name__, "dealAllMeasurements") - return True,self.error_result + def get_depth_offset(self,): + assert self.data.info_frame.ip_bytes != b'', ">>>> No Ip_bytes data,Pls check!" + ip_bytes = self.data.info_frame.ip_bytes + cal = self.calibrationCfg.get( RamsesPROFILE(1).name) + self.depth_offset,_,_ = self.decode_ip_buf(ip_bytes, cal) + self.depth = [] # depth None -> List pass - # def dealOneMeasurement_Handheld(self, fpath:Path): - # '''handheld一次测量包含多组数据''' - # # 调用handheldbuf 处理,将一组数据提交出来 - # log.info(f" 手持测量数据", __name__, "dealOneMeasurement_Handheld") - - # info_path = fpath.joinpath("info.bin") - # sensor_path = fpath.joinpath("sensor.bin") + def decode_ip_buf(self, buf, ip_cal:dict): + tmpbuf = buf + if len(tmpbuf) == 26 and tmpbuf[0] == 0x13: + tmpbuf = tmpbuf[2:] - # # 信息帧解析 - # hex_info = self.read_bin( info_path ) - # try: - # self.info_dict = self.decode_info( hex_info ) - # except: - # log.error( f"处理信息文件" - # + "/" +self.info_path_fname.stem - # + "出现错误", __name__, "dealOneMeasurement_Handheld" ) - # raise MyException( "处理文件"+ self.info_path_fname + "出现错误") - # pass + Incl_Xgain = float(ip_cal['Incl_Xgain'] ) + Incl_Xoffset = float(ip_cal['Incl_Xoffset'] ) + Incl_Ygain = float(ip_cal['Incl_Ygain'] ) + Incl_Yoffset = float(ip_cal['Incl_Yoffset'] ) - # # 当前文件名 ? - - # self.hhp.setMode(1) - # self.current_measure_time = self.getCurrentMeasureTimeFromInfoDict() - # self.get_ymdhms() + Incl_Kref = float(ip_cal['Incl_Kref'] ) + Press_Sens_mV_bar_1mA = float(ip_cal['Press_Sens_mV_bar_1mA'] ) + Incl_KBG = float(ip_cal['Incl_KBG'] ) + Press_Sens_mV_bar_4mA = float(ip_cal['Press_Sens_mV_bar_4mA'] ) + Press_Gain = float(ip_cal['Press_Gain'] ) + Press_Surface_bar = float(ip_cal['Press_Surface_bar'] ) + + ip_info = struct.unpack(" self.tiltx_range: + return None + if args[2] and abs(args[2]) > self.tilty_range: + return None - # 当前文件名 ? - self.hhp.setMode(1) - self.current_measure_time = self.getCurrentMeasureTimeFromInfoDict() - self.get_ymdhms() + # 深度值 + log.debug( f" call back depth offset: {self.depth_offset} ", __class__ ) + log.debug( f" call back depth : {args[0]} ", __class__ ) + self.depth.append( args[0] - self.depth_offset ) - # self.output_path 定位到 /data/output 目录? - self.output_path = OUTPUT_DIR.joinpath( self.ymdhms) - - log.warning(f"current_measure_time: {self.current_measure_time}", __name__, "dealOneMeasurement_Profiler") - - # 获得真实波长 - self.real_wavelength = self.getWavelenthDict() - - # 读取数据 buf - self.hhb.readFile2Buf(sensor_path) - log.debug(f"buf: {self.hhb.get_buf_size()}", __name__, "dealOneMeasurement_Profiler") - self.decode_sensor_buf() + wv = wavelength + spctrm = spectrum - # 解析Buf, 对buf分组,获得[{lsky: esky : lwater} .... ] - # 可能需要 传感器序列号数据,判断几个传感器。 如何判断几个传感器??????? + log.debug( f" call back wv : {wv} ", __class__ ) + log.debug( f" call back spctrm : {spctrm} ", __class__ ) + # 插值处理, 直接处理, 不按传感器功能处理了 + tmp_Ed = np.interp( self.newWavelength, np.array(wv[0]), np.array(spctrm[0]) ) + tmp_Lu = np.interp( self.newWavelength, np.array(wv[2]), np.array(spctrm[2]) ) - # 剖面 - - # 去掉倾斜不达标的数据 -- 格式ndarray 多维数组? - self.remove_data_with_tilt_beyond( self.depth_tilt_x_y, self.intensity_before_avg ) - - # 获得数据去拟合 -- 分拆Ed Lu - depth_ndarray = np.array(self.depth_tilt_x_y) - depth_ndarray = depth_ndarray[:,0] - data = np.array( self.intensity_before_avg ) - - + if not self.Ed.size : + self.Ed = tmp_Ed + else: + self.Ed = np.vstack( (self.Ed, tmp_Ed) ) + if not self.Lu.size : + self.Lu = tmp_Lu + else: + self.Lu = np.vstack( (self.Lu, tmp_Lu) ) + + def reset_profiler(self,): + log.info( " >> ",__class__,"reset_profiler" ) + self.Ed = np.array([]) + self.Esky = np.array([]) + self.Lu = np.array([]) + self.Kd = np.array([]) + self.Ed0 = np.array([]) + self.Ku = np.array([]) + self.Lu0 = np.array([]) + self.Lw = np.array([]) + self.Rs = np.array([]) - res = self.leastsq_fitting( self.depth_tilt_x_y, self.intensity_before_avg ) - + + def process_profiler(self,n_t_square:float): + log.info( " >> ",__class__,"process_profiler" ) + self.get_Ed0_kd() + self.get_Lu0_Ku() + self.get_Lw_Rs(n_t_square) + + def get_Lw_Rs ( self, n_t_square:float): + ''' Get Lw Rs ''' + log.info( " get_Lw_Rs............ ",__class__,"get_Lw_Rs" ) + self.Lw = n_t_square * self.Lu0 + self.Rs = self.Lw/ self.Ed0 + + def get_Lu0_Ku ( self, ): + '''' Get Lu0 Ku ''' + log.info( " get_lu0_Ku......... ", __class__, "get_Lu0_Ku" ) + x = np.array(self.depth) + y = np.log(self.Lu) # ln_Lu + self.Ku,ln_Lu0 = self.leastsq_linear_fitting( x, y) + self.Lu0 = np.exp(ln_Lu0) + + def get_Ed0_kd( self, ): + '''' Get Ed0 Kd ''' + log.info( " get_Ed0_kd.......... ",__class__,"get_Ed0_kd" ) + # log.warning( f"depth: {self.depth}" ) + x = np.array(self.depth) + y = np.log(self.Ed) # ln_Ed + self.Kd, ln_Ed0 = self.leastsq_linear_fitting( x, y) + self.Ed0 = np.exp(ln_Ed0) - - # group_num = int(len_total/self.measurement_repeat) - - # log.debug(f"group_num...: {group_num}", __name__, "dealOneMeasurement_Profiler") - # self.real_wavelength = self.getWavelenthDict() - # # if group_num == 1: - # # self.dealOneGroup() # self.intensity_before_avg - # # return - - # self.dealMultiGroup(group_num) - - def remove_data_with_tilt_beyond( self, arr_x:list, arr_y:list, degree): - if len(arr_x) != len(arr_y.shape): - raise MyException( f"深度和数据的维度有误" ) - pass - for i in range( len(arr_x),0,-1 ): - if abs( arr_x[i][1] ) > degree or abs( arr_x[i][2] ) > degree: - arr_x.pop(i) - arr_y.pop(i) - pass - pass - pass - - def leastsq_fitting( self, arr_x, arr_y ): - """ - @description : arr_x arr_y 是不同波长数据 - 对其列上的每个值拟合获得kd ln(lu0) - 也可以对 arr_y 先切片 - 最小二乘只能遍历处理 - arr_y 包含 Ed Lu 返回两组数据 - """ - log.info(f" ->>>> ", __name__, 'leastsq_fitting') - res = np.array([]) - - print(arr_x.shape) - print(arr_y.shape) + # t = self.leastsq_linear_fitting( x, y) + + # log.warning(self.Kd) + # log.warning(t) + # log.warning(self.Ed0) + + def leastsq_linear_fitting( self, arr_depth:np.ndarray, arr_data:np.ndarray ): + '''最小二乘拟合 + # arr_depth np一维数组 + # arr_data np二维数组,需切片出来处理 + ''' + log.info(f" ->>>> ", __class__, 'leastsq_linear_fitting y=kx+b') + k = [] + b = [] + arr_x = arr_depth + arr_y = arr_data + # print(arr_x.shape) + # print(arr_y.shape) for i in range( arr_y.shape[1] ) : # 切出第一列 - row_ = arr_x - column_ = arr_y[:,i] + x_ = arr_x + y_ = arr_y[:,i] # 拟合 - p0 = [1,20] - para = leastsq( self.fitting_error, p0, args = ( row_, column_ ) ) - if not res.size : - res = para[0] - else: - res = np.vstack( (res, para[0]) ) - # 转置 返回,第一列为 k, 第二列为 ln(Lu0-) - print(" __ndarray_ln_leastsq_fitting ...... %s %s " % res.shape ) - print(res) - return res.T - + p0 = [1,20] # [k,b] + para = leastsq( self.fitting_error, p0, args = ( x_, y_ ) ) + k.append( para[0][0] ) + b.append( para[0][1] ) + return np.array(k), np.array(b) + # 需要拟合的函数 fitting_func def fitting_func( self, p, x ): k,b=p @@ -655,561 +538,202 @@ class Profiler(object): # 拟合的残差函数 def fitting_error(self,p,x,y): return self.fitting_func(p,x)-y - - - def dealMultiGroup(self, group_num:int ): - log.info(f"group_num: {group_num}", __name__, "dealMultiGroup") - # 分组进行处理 - for i in range(group_num): - self.current_group_num = i - # 重设当前测量时间 ,measurement_interval 间隔为s - self.real_time = self.get_current_time_by_i_interval( i,self.measurement_interval) - log.warning(f" real time -> {self.real_time}") - self.res = {} - tmp_before_avg = [] - for j in range( self.measurement_repeat ): - tmp_before_avg.append( self.intensity_before_avg[j+i*self.measurement_repeat] ) - pass - self.getAvg(tmp_before_avg) - self.__do_sensor_dict_interpo() - - # 选择追加保存, 一个Lsky 可能多组文件,只能单独保存为 Lsky Esky ..Rs - # self.appendSave() - self.getLwRs() - self.checkAndSaveData( ) - path_info_txt = self.output_path.joinpath( "info.txt" ) - self.save_dict_to_file( self.info_dict, path_info_txt ) - - def get_current_time_by_i_interval(self, i, interval): - self.my_time.setCurrentTimeStr(self.current_measure_time) - self.my_time.timeDelta(seconds=i*interval) - return self.my_time.cur_time_str + def save(self, pth:Path, mode=0): + ''' 保存在原文件所在目录 ''' + log.info( " >> save ", __class__, "save" ) + log.debug( f"Lw: {self.Lw}" ) + # pth = self.data.currentPath + + fname = "20"+self.data.info_frame.year+"_"+self.data.info_frame.month+"_" \ + +self.data.info_frame.day+"_"+self.data.info_frame.hour+"_" \ + +self.data.info_frame.minute+"_"+self.data.info_frame.second \ + +".csv" + save_fpath = pth.joinpath(fname) + ret = "" + ret = ret + str(self.deviceid)+"_"+pth.parts[-1] + TOKEN + self.list2str(list(self.newWavelength)) + ret = ret + NEWLINE + "Kd" + TOKEN + self.list2str( list(self.Kd) ) + ret = ret + NEWLINE + "Ed0" + TOKEN + self.list2str( list(self.Ed0) ) + ret = ret + NEWLINE + "ku" + TOKEN + self.list2str( list(self.Ku) ) + ret = ret + NEWLINE + "Lu0" + TOKEN + self.list2str( list(self.Lu0) ) + ret = ret + NEWLINE + "Lw" + TOKEN + self.list2str( list(self.Lw) ) + ret = ret + NEWLINE + "Rs" + TOKEN + self.list2str( list(self.Rs) ) + save_fpath.write_text( ret ) pass - def dealOneGroup(self, ): - # 分组,并获得平均值, 255个未插值结果 (依据 measurement_interval measurement_repeat) - self.getAvg( self.intensity_before_avg ) - - # 插值 - self.real_wavelength = self.getWavelenthDict() - self.__do_sensor_dict_interpo() - - self.ymdhms = "20"+ str(self.info_dict['year']) + '_' \ - + str(self.info_dict['month']) + '_' \ - + str(self.info_dict['day']) + '_' \ - + str(self.info_dict['hour']) + '_' \ - + str(self.info_dict['minute']) + '_' \ - + str(self.info_dict['second']) + def list2str( self, lst:list, token=";" ): + ''' 保存在原文件所在目录 ''' + ret = "" + for i in range(len(lst)): + if i == 0: + ret = ret + str(lst[i]) + else: + ret = ret + TOKEN + str(lst[i]) + return ret + pass - self.output_path = self.output_path.joinpath( self.ymdhms ) - self.appendSave() - - def dealOneMeasurement(self, fpath:Path): - '''handheld一次测量包含多组数据''' - # 调用handheldbuf 处理,将一组数据提交出来 - log.info(f"dealOneMeasurement: 一组测量数据", __name__, "dealOneMeasurement") - if len(self.filelist)<1: - pass - - # 当前文件名 - self.output_path = OUTPUT_DIR - self.current_filepath = fpath - self.current_measure_time = self.hhp.getCurrentMeasureTimeFromPath(fpath) - self.ymdhms = "20"+ str(self.info_dict['year']) + '_' \ - + str(self.info_dict['month']) + '_' \ - + str(self.info_dict['day']) + '_' \ - + str(self.info_dict['hour']) + '_' \ - + str(self.info_dict['minute']) + '_' \ - + str(self.info_dict['second']) - self.output_path = self.output_path.joinpath( self.ymdhms ) - log.warning(f"current_measure_time: {self.current_measure_time}", __name__, "dealOneHandheldMeasurement") - - self.hhb.readFile2Buf(fpath) - self.decode_sensor_buf() - self.real_wavelength = self.getWavelenthDict() - self.dealOneGroup() - - def dealOneMeasurement_Online(self, ): - '''handheld一次测量包含多组数据''' - # 调用handheldbuf 处理,将一组数据提交出来 - log.info(f"dealOneMeasurement_Online: 一组测量数据", __name__, "dealOneMeasurement_Online") - - # 当前文件名 - self.output_path = self.new_folder - # self.current_measure_time = self.hhp.getCurrentMeasureTimeFromPath(fpath) - self.ymdhms = self.getTimeFnameFromInfoDict() - - # getBuf - self.get_sensor_buf() - self.decode_sensor_buf() - self.real_wavelength = self.getWavelenthDict() - - self.getAvg( self.intensity_before_avg ) - self.real_wavelength = self.getWavelenthDict() - self.__do_sensor_dict_interpo() - - self.saveOnefileForLskyEskyLwaterLwRS() - - def get_sensor_buf(self,) : - buf = b"" - self.mydir.setBaseDir(self.new_folder) - my_bin_list = self.mydir.get_files_from_currentdir("*.bin") - my_bin_list = self.mydir.sort_filepath_and_check(my_bin_list) - for mbl in my_bin_list: - buf = buf + self.read_bin(mbl) - self.hhb.write_buf(buf) + def registet_func(self, func:Callable): + self.afterdeal.append(func) pass - def get_ymdhms(self, ): - self.ymdhms = "20"+ f"{self.info_dict['year']:02d}" + '_' \ - + f"{self.info_dict['month']:02d}" + '_' \ - + f"{self.info_dict['day']:02d}" + '_' \ - + f"{self.info_dict['hour']:02d}" + '_' \ - + f"{self.info_dict['minute']:02d}" + '_' \ - + f"{self.info_dict['second']:02d}" - - def getTimeFnameFromInfoDict(self,) : - ymdhms = "20"+ str(self.info_dict['year']) + '_' \ - + str(self.info_dict['month']) + '_' \ - + str(self.info_dict['day']) + '_' \ - + str(self.info_dict['hour']) + '_' \ - + str(self.info_dict['minute']) + '_' \ - + str(self.info_dict['second']) - return ymdhms - - def decode_sensor_buf_profiler(self,) : - # 处理Buf,对多组数据取平均, - self.intensity_before_avg = [] - # res_before_avg = [] - self.clearRes() # 清空数据 - while True: - if not self.hhb.decode_one_group_handheld() : - break # 清空数据 - - res = {} - ip_buf = self.hhb.one_group_data[:26] - buf = self.hhb.one_group_data[26:] - for i in range(1,4,1): - temp_buf = buf[7:71] + buf[79:143] + \ - buf[151:215] + buf[223:287] + \ - buf[295:359] + buf[367:431] + \ - buf[439:503] + buf[511:575] - - # Ramses类 标定处理,设置buf 标定文件 - self.ramses.setBuf(temp_buf) - func = self.getFuncBySeq(i) - cfg = self.getCfgByFunc( func) - if i == 1 or i==3: # 两个空气中一个水中注意序号 - self.ramses.setMode(1) # 水中??? 另外一个是空气中的 - if i == 1: # 获得深度倾斜 - # self.decode_ip_buf( ip_buf, cfg ) - x_y_depth_m = self.ramses.decode_ip_buf( ip_buf, cfg) - self.depth_tilt_x_y.append(x_y_depth_m) - self.ramses.setCalCfg(cfg) - self.ramses.resetItSpectrum() - self.ramses.ConvertAndCalibrate() - res.update({ func : self.ramses.spectrum }) - - # 处理 深度倾斜 数据 - # depth_m_x_y = self.ramses.decode_ip_buf( ip_buf, cfg) - # self.decode_ip_buf(ip_buf) - - self.intensity_before_avg.append( res ) - pass - - def decode_sensor_buf(self,) : - # 处理Buf,对多组数据取平均 - self.intensity_before_avg = [] - # res_before_avg = [] - self.clearRes() # 清空数据 - while True: - if not self.hhb.decode_one_group_handheld() : - break # 清空数据 - - res = {} - buf = self.hhb.one_group_data[26:] - for i in range(1,4,1): - temp_buf = buf[7:71] + buf[79:143] + \ - buf[151:215] + buf[223:287] + \ - buf[295:359] + buf[367:431] + \ - buf[439:503] + buf[511:575] - - # Ramses类 标定处理,设置buf 标定文件 - self.ramses.setBuf(temp_buf) - func = self.getFuncBySeq(i) - cfg = self.getCfgByFunc( func) - self.ramses.setCalCfg(cfg) - self.ramses.resetItSpectrum() - self.ramses.ConvertAndCalibrate() - res.update({ func : self.ramses.spectrum }) - self.intensity_before_avg.append( res ) - pass - - def decode_ip_buf( self, buf, ip_cal) : - '''Ed校正文件去处理数据''' - res = self.ramses.decode_ip_buf(buf,ip_cal) - self.depth_tilt_x_y.append(res) - pass - - def getAvg( self, d:list) : - log.info(f"getAvg: 平均多组数据", __name__, "getAvg") - data = d - ret = {} - len_result = len(data) - if len_result == 0: - self.intensity_after_avg ={} - return None - if len_result == 1: - self.intensity_after_avg = data[0] - return None - ret = data[0] - - res_dict = self.getRetDict() - - for k in res_dict.keys(): - for i in range(1,len_result,1): - data[0][k] = data[0][k] + data[i][k] - ret = data[0][k]/len_result - self.intensity_after_avg.update( { k : ret } ) - log.debug(f"getAvg: {self.intensity_after_avg}", __name__, "getAvg") - pass - - def getRetDict(self,) : - ret_dict = { } - ret_dict.update( {self.device_enum(1).name:np.array([])} ) - ret_dict.update( {self.device_enum(2).name:np.array([])} ) - ret_dict.update( {self.device_enum(3).name:np.array([])} ) - # self.one_group_result = ret_dict - return ret_dict - - def __do_sensor_dict_interpo(self,) : - log.info( f"同步处理多个个插值 ", __name__, "__do_sensor_dict_interpo" ) - self.clearRes() - for k in self.intensity_after_avg.keys(): - tmp = np.interp( self.wavelength, self.real_wavelength[k], self.intensity_after_avg[k] ) - self.res.update( { k : tmp } ) - - def getCfgByDid(self, func:str) : - cfg_id:dict = self.cfg.get(int(self.device_id)) - cfg_sensor = cfg_id.get( func) - return cfg_sensor + def execute_func(self, ): + for f in self.afterdeal: + f() pass - - def getFuncBySeq(self, seq:int) : - func = "" - if self.device_type == DeviceType.AWRAMS.name: - func = RamsesAWRAMS(seq).name - if self.device_type == DeviceType.SURFACE.name: - func = RamsesAWRAMS(seq).name - if self.device_type == DeviceType.PROFILE.name: - func = RamsesAWRAMS(seq).name - return func - def getCfgByFunc(self, func:str) : - cfg_id:dict = self.syscfg.get(int(self.device_id)) - cfg_sensor = cfg_id.get( func) - return cfg_sensor +class ProfilerHandle(object): + def __init__(self, deviceid=2, cfg=None, calcfg=None, rtv=None): + self.sensor_cfg = cfg + self.calcfg = calcfg + self.retrieve = rtv + + self.device_id = deviceid + self.profiler = Profiler( deviceid=self.device_id ) + self.profiler.set_cfg_calibration( self.calcfg ) + self.profiler.set_retrieve( self.retrieve) + self.profiler.config_awrams( self.sensor_cfg ) + + self.afterdeal = [] pass - def getCfgBySeq(self, seq:int) : - func = "" - if self.device_type == DeviceType.AWRAMS.name: - func = RamsesAWRAMS(seq).name - if self.device_type == DeviceType.SURFACE.name: - func = RamsesAWRAMS(seq).name - if self.device_type == DeviceType.PROFILE.name: - func = RamsesAWRAMS(seq).name - cfg_id:dict = self.syscfg.get(int(self.device_id)) - cfg_sensor = cfg_id.get( func) - return cfg_sensor + def set_ramses_number( self, numbers:int =3 ): + self.profiler.set_ramses_sensor_numbers(numbers) + + def set_tilt_range( self, tilt_angle:float =7.0 ): + self.profiler.set_tilt_range(tilt_angle) + + def read_info_path(self,infopath: Path ): + assert infopath.exists(), f">>>> not find {fpath} " + ret_bytes = b'' + with open(infopath, 'rb') as file: + ret_bytes = file.read() + self.profiler.data.set_info_frame( ret_bytes ) + + def read_sensor_path(self, sensorpath:Path): + assert sensorpath.exists(), f">>>> not find {fpath} " + with open(sensorpath, 'rb') as file: + ret_bytes = file.read() + assert len(ret_bytes) > 1754, f">>>> no data " + tmp_len = int(len(ret_bytes)/1754) + log.info( f" total len : {len(ret_bytes)} num: {tmp_len} ") + for i in range(tmp_len): + tmp_buf = ret_bytes[0+1754*i:1754+1754*i] + self.profiler.data.set_data_frame( tmp_buf, None, self.profiler.callback ) # tmp_buf包装成List pass - - def saveOnefileForLskyEskyLwaterLwRS(self, ) -> bool: - log.info(f" ", __name__, "saveOnefileForLskyEskyLwaterLwRS") - self.mydir.setBaseDir(self.output_path) #基路径 - - time_name = self.getTimeFnameFromInfoDict() - Lw = self.res["Lwater"] - ROWFACTOR * self.res["Lsky"] - self.res.update({ self.device_enum(4).name : Lw }) - Rs = self.res[self.device_enum(4).name] / self.res["Esky"] - self.res.update({ self.device_enum(5).name : Rs }) - - self.mydir.setHeader( self.wavelength.tolist(), TOKEN, "device_id_"+str(self.device_id) ) - header = self.mydir.header_str - - save_path_csv = self.new_folder.joinpath(time_name + SAVE_EXT_NAME) - data_str = "" - for k in self.res.keys(): - self.mydir.setContent(self.res[k].tolist(),TOKEN,k ) - data_str = data_str + NEWLINE + self.mydir.content_str - save_path_csv.write_text(header+data_str) - - path_info_txt = self.new_folder.joinpath( time_name + "_info.txt" ) - self.save_dict_to_file( self.info_dict, path_info_txt ) - - def appendSave(self, ) -> bool: - '''self.output_path''' - self.checkAndSaveData( ) - self.getLwRsAndSave() - path_info_txt = self.output_path.joinpath( "info.txt" ) - self.save_dict_to_file( self.info_dict, path_info_txt ) - - def checkAndSaveData(self, ) -> bool: - """ - check self.Lsky Esky Lwater and Save - 处理self.res 的数据 - """ - log.info(f"checkAndSaveData: {self.output_path.parts}", __name__) - self.mydir.setBaseDir(self.output_path) #基路径 - self.mydir.setHeader( self.wavelength.tolist(), TOKEN, "device_id_"+str(self.device_id) ) - # print(f"header_str : {self.mydir.header_str[-1:]}") - - if self.current_group_num == 0: - self.newFileByFunc( self.device_enum(1).name ) - self.newFileByFunc( self.device_enum(2).name ) - self.newFileByFunc( self.device_enum(3).name ) - self.newFileByFunc( self.device_enum(4).name ) - self.newFileByFunc( self.device_enum(5).name ) - pass - - self.appendFileByFunc( self.device_enum(1).name ) - self.appendFileByFunc( self.device_enum(2).name ) - self.appendFileByFunc( self.device_enum(3).name ) - self.appendFileByFunc( self.device_enum(4).name ) - self.appendFileByFunc( self.device_enum(5).name ) - - def newFileByFunc(self, func:str) -> None: - self.mydir.newFileIfNot( func+SAVE_EXT_NAME) - if self.mydir.checkHeader() == -1: - log.error(f"请备份文件:{self.mydir.current_filepath.parent} {self.mydir.current_filepath.name}, 并删除文件后再试!", __name__) - raise MyException( f"请备份文件:{self.mydir.current_filepath.parent} {self.mydir.current_filepath.name}, 并删除文件后再试!" ) - return False - if self.mydir.checkHeader() == 1: - pass - if self.mydir.checkHeader() == 0: - self.mydir.writeHeader() - pass - - # 写入数据content - log.warning(f" write content time {self.real_time}") - self.mydir.setContent(self.res[func].tolist(), TOKEN, self.real_time) - self.mydir.writeContent() - - def appendFileByFunc(self, func:str) -> None: - # 追加写入数据content - self.mydir.setContent(self.res[func].tolist(), TOKEN, self.real_time) - self.mydir.writeContent() - - def clearRes(self, ) -> None: - self.res = { } - - def getLwRs(self, ) -> bool: - """ - 并计算Lw Rs并保存 - """ - Lw = self.res["Lwater"] - ROWFACTOR * self.res["Lsky"] - self.res.update({ self.device_enum(4).name : Lw }) - Rs = self.res["Lw"] / self.res["Esky"] - self.res.update({ self.device_enum(5).name : Rs }) - - return True - - def getLwRsAndSave(self, ) -> bool: - """ - 并计算Lw Rs并保存 - """ - Lw = self.res["Lwater"] - ROWFACTOR * self.res["Lsky"] - self.res.update({ "Lw" : Lw }) - Rs = self.res["Lw"] / self.res["Esky"] - self.res.update({ "Rs" : Rs }) - self.mydir.setBaseDir(self.output_path) #基路径 - # 保存 + def read_one_folder_awrams_online(self, pth:Path): + ''' self.data 传数据 info_frame, data_frame''' + log.info(f" 读一个文件夹进行处理 {pth}" ,__name__,"read_one_folder_awrams_online") + bytes_list = [] - if self.current_group_num == 0: - self.newFileByFunc( "Lw" ) - self.newFileByFunc( "Rs" ) - pass + bin_files = pth.glob('*.bin') + for bf in bin_files: + if bf.name != "info.bin": + bytes_list.append( self.read_bin(bf) ) - self.appendFileByFunc( "Lw" ) - self.appendFileByFunc( "Rs" ) - - return True - - def read_bin(self,fpath: Path): - log.debug(f" readbin: ", __name__, "", "" ) - ret = None - if not fpath.exists() : - log.info(f"not find file: {fpath} ") - return ret + self.profiler.data.set_data_frame( bytes_list, pth, self.aw.callback ) # 目录也要传过去 + pass + + def read_bin(self,fpath: Path): + assert fpath.exists(), f">>>> not find {fpath} " + ret = b'' with open(fpath, 'rb') as file: ret = file.read() - return ret - log.debug(f" readbin: {ret} ", __name__, "", "" ) return ret pass - def decode_info( self,info: bytes ) -> dict: - ret = {} - # 剖面型加了1311+24个字节共26个字节 - # 保留字节有所变化,改为序列号,每个序列号两个字节 - try: - temp = struct.unpack(" None: - temp_str = "" - for key, value in info_dict.items(): - temp_str = temp_str + key + " : " + str(value) + "\n" - with open(fpath, "w+") as f: - f.write(temp_str) - def save_error_to_file(self, errlist: list, fpath: Path) -> None: - temp_str = "" - if len(errlist) <1: - return None - for errdict in errlist: - temp_str = temp_str + errdict["path"] +" : "+ errdict["error"] + "\n" - pass - with open(fpath, "w+") as f: - f.write(temp_str) - return None +class ExternalFun(object): + def __init__(self, aw:Profiler=None): + pass + + @staticmethod + def get_par_400_700( aw:Profiler ): + par_400_700 = 0.0 + for i in range( 50, 350, 1 ): + par_400_700 = par_400_700 + aw.Esky + return par_400_700 pass - def getWavelenthDict( self, ) -> dict: - ret_dict = self.getRetDict() - cfg_id:dict = self.syscfg.get( int(self.device_id)) - for k in ret_dict.keys(): - tmp = self.getWavelength( cfg_id.get(k) ) - ret_dict.update({ k : tmp }) - return ret_dict - - def getWavelength(self,ramsesdict:dict) -> np.ndarray: - ret = [] - for i in range(1,256): - tmp = float(ramsesdict['c0s']) + float(ramsesdict['c1s'])*i \ - + float(ramsesdict['c2s'])*i*i + float(ramsesdict['c3s'])*i*i*i - ret.append(tmp) - pass - return np.array(ret) - - def setSyscfg(self, syscfg:dict): - self.syscfg = syscfg - - def setRetrieve(self, retrieve:dict): - log.debug( f"setRetrieve : {retrieve}......", __name__ ) - self.retrieve = retrieve - self.setNewWavelength() - # self.wavelength:np.ndarray = np.arange ( self.retrieve['beginWL'], self.retrieve['endWL'], self.retrieve['interval'] ) + @staticmethod + def get_par_350_950( aw:Profiler): + par_350_950 = 0.0 + for i in range( 0, 600, 1 ): + par_350_950 = par_350_950 + aw.Esky + return par_350_950 + pass + + @staticmethod + def get_chl( aw:Profiler ): + return 0.0 + pass + pass - def setNewWavelength(self, ): - self.wavelength:np.ndarray = np.arange ( - self.retrieve['beginWL'], self.retrieve['endWL'], self.retrieve['interval'] ) - - def setDeviceID(self, did:int): - self.device_id = did - def setDeviceType(self, device_type): - self.device_type = device_type - def getErrorInfoDict(self, ): - return self.error_result +class ProfilerCfg: + cfg= {1: {'FUNC': 'Ed', 'SN': '50ED'}, 2: {'FUNC': 'Esky', 'SN': '85C2'}, 3: {'FUNC': 'Lu', 'SN': '852F'}} + calcfg= {'Esky': {'SN': '85C2', 'FUNC': 'Esky', 'TYPE': 'SAM', 'samsn': '85C2', 'inifile': 'SAM_85C2.ini', 'calfile': 'Cal_SAM_85C2.dat', 'calaqfile': 'CalAQ_SAM_85C2.dat', 'backfile': 'Back_SAM_85C2.dat', 'cal': ['+NAN', '+NAN', '+NAN', '+NAN', '0.63607834406219', '0.718127096538326', '0.812216798598817', '0.914442457893824', '1.03343454996493', '1.15933885373154', '1.29479643420084', '1.43677001665361', '1.56848190839848', '1.67447970580786', '1.73889146263122', '1.73244260903254', '1.69192414835577', '1.61622082709111', '1.5270353751059', '1.46047364317447', '1.41296265347303', '1.39311700938614', '1.39852760194912', '1.42554260762195', '1.4700968507055', '1.53635620441153', '1.62082921439482', '1.7237742274692', '1.84755749123585', '1.98432162640748', '2.12689147788928', '2.27366206436985', '2.41515311346652', '2.54267625633242', '2.65248757975216', '2.73468816910085', '2.77942967914337', '2.79565522877852', '2.77806955157777', '2.73891358506136', '2.69063680629234', '2.6282750012231', '2.56338981635672', '2.49687123158122', '2.4309933291301', '2.36993023507549', '2.32161558853422', '2.28314087424895', '2.25846162084215', '2.24994522727437', '2.25549954861938', '2.27668712518828', '2.30493256690767', '2.33255656715114', '2.35720768052834', '2.37757260164886', '2.40002374613635', '2.42905705371268', '2.4673307146952', '2.51294806887351', '2.56575613007937', '2.62193109349514', '2.67842958533042', '2.73753357518048', '2.7913329207665', '2.8423865946084', '2.89027340109411', '2.93157202353872', '2.96274906831744', '2.98346548286676', '2.98798866816702', '2.97297872291037', '2.93559195933884', '2.87662286787444', '2.80380712732453', '2.72275302648293', '2.6373282860483', '2.55448424591999', '2.47778601018081', '2.40377038673745', '2.33484934711808', '2.2698793292122', '2.20651375086021', '2.14704740380438', '2.08988763493926', '2.0346458333411', '1.98224825426305', '1.93452491480363', '1.89146397238956', '1.8653548650058', '1.84879059497611', '1.8371693859594', '1.83197484046632', '1.83105981302589', '1.83169544364263', '1.83369029033973', '1.82985806236537', '1.81684973319988', '1.7961872241934', '1.76710061502081', '1.73459539138238', '1.70421983997876', '1.67561137148482', '1.65483955955664', '1.64005456402998', '1.63103006074007', '1.62646109446179', '1.62483351776729', '1.61794627041935', '1.60638099649103', '1.59160518167625', '1.57856502215575', '1.56723770329055', '1.55884357172436', '1.55081356970191', '1.5440909800073', '1.53473504989623', '1.52335047710565', '1.51140772671503', '1.49628095199023', '1.48082183121466', '1.4668009209167', '1.45300293604089', '1.43913779397284', '1.42471804569399', '1.41116472805909', '1.39601546893463', '1.3795217760198', '1.36066889187826', '1.3395095955925', '1.31771535033317', '1.29387042583309', '1.26955248066416', '1.24679628762607', '1.22528340309588', '1.20486570624273', '1.18549206002717', '1.16756178865017', '1.15111957559202', '1.13469169498467', '1.11621030173639', '1.09569135455521', '1.07275908862679', '1.04573742076401', '1.01572627731635', '0.98381634710957', '0.950352559222019', '0.915760692099546', '0.881456713194727', '0.848044938315892', '0.816038892625263', '0.785024915273114', '0.754850603543375', '0.725690734641156', '0.697449171016547', '0.669846688269734', '0.643097402076866', '0.615807664216611', '0.589686777991522', '0.563134754809732', '0.537416951715189', '0.512092492411016', '0.487999533569422', '0.464888888064952', '0.442938789447448', '0.422687485052752', '0.403811887358409', '0.386602162003576', '0.370223420179536', '0.355850417036878', '0.342554004485098', '0.330263308885894', '0.318892349787717', '0.308390808825048', '0.29923285616278', '0.290049870831026', '0.280987628676386', '0.272166680353347', '0.263184326446838', '0.254328565772045', '0.245533707259442', '0.236284846332185', '0.227364007848682', '0.218575558150069', '0.209919539318749', '0.201723665364338', '0.193439417628863', '0.185095630044576', '0.176908759167827', '0.168492281717065', '0.15971620196905', '0.151519711134016', '0.143896290701505', '0.137256829327417', '0.131333761731513', '0.125851036682123', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN'], 'calaq': ['+NAN', '+NAN', '+NAN', '+NAN', '0.356482954042082', '0.402818840212745', '0.455981796582809', '0.513790947820199', '0.581106393394544', '0.652400597895999', '0.729165245163259', '0.809695951374305', '0.88453433247143', '0.944944312747719', '0.981931183530144', '0.97890644433893', '0.956596648488616', '0.914337507780978', '0.864381326448261', '0.827167246646249', '0.800694416668645', '0.78986648983256', '0.793342729280327', '0.809072983311401', '0.834767169405595', '0.872805947088459', '0.921221494674019', '0.980173791184887', '1.05102154902541', '1.12930675423331', '1.21095167248078', '1.29504423201304', '1.3761833690735', '1.44941098633961', '1.51258129060157', '1.56003462286042', '1.58613256964525', '1.59595706282003', '1.58646705138274', '1.56463589386165', '1.53756622064089', '1.50241608927798', '1.4657899060372', '1.42819643066784', '1.39093699353292', '1.35640193401339', '1.3291366616142', '1.3074826757329', '1.29371125003749', '1.28918595210661', '1.29271559006051', '1.30520259911165', '1.32173660739306', '1.33791597187085', '1.35239128956384', '1.36440760724462', '1.37762092569269', '1.39461338947335', '1.4169141265919', '1.44343724653861', '1.47409755299312', '1.50670023106802', '1.53949706626466', '1.57379985877493', '1.60506087092559', '1.63474977349559', '1.66262314886676', '1.6867112751644', '1.70497845407306', '1.71722612221823', '1.72015067971529', '1.71182391495322', '1.69060216043102', '1.65693636912006', '1.615276853664', '1.56885138733016', '1.51988696317221', '1.47238950135993', '1.42841545003656', '1.38597016134539', '1.34644570226061', '1.30918427370975', '1.272833651334', '1.23871854263795', '1.20592126590957', '1.17421842576069', '1.14414540628486', '1.11675959841052', '1.09205554594672', '1.07713100431408', '1.06771250877206', '1.06114445201819', '1.05828511190168', '1.05789551638809', '1.05839987869692', '1.05968794981088', '1.05760658826783', '1.05021868492741', '1.03840218029399', '1.02171038385539', '1.00303608270452', '0.985587384786529', '0.969155119807841', '0.957250725878805', '0.948805673627153', '0.943690255948233', '0.94115052725798', '0.940311121408207', '0.936426058319819', '0.929831072715321', '0.92137487467603', '0.913920568414937', '0.907455306712896', '0.902686110798026', '0.898125710110949', '0.894320543495939', '0.888988205031672', '0.882478589132188', '0.875643320641074', '0.866960905236801', '0.85808331524723', '0.850036611133456', '0.842116721554211', '0.834155584125161', '0.825870667226897', '0.818085734330888', '0.80937333573889', '0.799879100950076', '0.789014440994224', '0.776809660553211', '0.764233867550572', '0.750465870807386', '0.736420569195548', '0.723278335744868', '0.710854686038585', '0.699063893618938', '0.687876475273581', '0.67752433279025', '0.668033624297236', '0.658549260619002', '0.647871055584177', '0.636008041103345', '0.622741859229467', '0.607099198838907', '0.589718195082128', '0.571231808679594', '0.551840143680759', '0.531790313016104', '0.511904550502093', '0.492533916324242', '0.473976829140493', '0.455993213863435', '0.438494694002521', '0.421582939065556', '0.405202246583534', '0.389190520866554', '0.373672278430399', '0.357837814065771', '0.342680416381626', '0.327270394695731', '0.312343150425572', '0.297642550528398', '0.283655852976372', '0.270238359496543', '0.257493807901754', '0.245735256551437', '0.234775054990433', '0.224782070488707', '0.21527102824311', '0.206925139776841', '0.19920428909151', '0.192067375381572', '0.18546450086342', '0.17936649692309', '0.1740492565549', '0.168716810424925', '0.163453964529452', '0.158330867670766', '0.153113270397234', '0.147968724530474', '0.142859028020375', '0.137484591721589', '0.132300435162079', '0.12719275157505', '0.122161584010771', '0.117397671330868', '0.112581820604776', '0.107730813198643', '0.102970640334024', '0.0980763328283588', '0.0929722067690889', '0.0882049761452578', '0.0837708982222196', '0.0799092380316381', '0.0764642971780796', '0.0732754076052096', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN'], 'b0': ['0.0167342121256965', '0.0166272578208838', '0.0166286620082263', '0.0167322590351011', '0.0166920032801035', '0.0166775698812814', '0.0166447407209946', '0.0166906961017275', '0.0166809423386799', '0.0166877673382172', '0.0166557529834584', '0.0166967839378053', '0.0166669086656532', '0.0166892149702227', '0.0166767580418549', '0.0166905701296523', '0.0166797450805357', '0.0166853286793596', '0.0166606032573071', '0.0166908025324281', '0.0166781405941041', '0.0166909536291278', '0.016658955500689', '0.0166904685842953', '0.0166691280074769', '0.0167018280551104', '0.0166777291783793', '0.0166913413160407', '0.0166761335902522', '0.016706050038872', '0.0166582396233696', '0.0166925097855527', '0.0166940355830564', '0.0167090314943029', '0.0166814589637695', '0.0167022263850933', '0.0166789583657336', '0.0167125271321517', '0.0167029600590216', '0.0167033172125368', '0.0166891849602547', '0.016717239220566', '0.0166950287036272', '0.0167214463738202', '0.0167003460512228', '0.0167208076151397', '0.0167006723223871', '0.0167002158917102', '0.016694364122416', '0.0167280688060731', '0.0166797285052627', '0.0167266316426611', '0.0167086472969212', '0.0167237098582131', '0.0167077462999733', '0.0167322560689996', '0.0167032709762488', '0.0167360191794125', '0.0167094863546909', '0.0167321362036039', '0.0167044837628067', '0.0167368275293078', '0.0167091722968856', '0.0167287705507912', '0.0167181887219972', '0.0167349817417959', '0.0167306388457792', '0.0167342461486254', '0.0167197319671568', '0.0167519464465281', '0.0166999253882404', '0.0167488868255989', '0.016719535855505', '0.0167381012081846', '0.016714746997405', '0.0167499849810578', '0.0167221554465538', '0.0167373439799208', '0.0167244929090075', '0.0167622135196106', '0.0167296907401605', '0.0167466896422982', '0.0167188426601383', '0.0167413380972971', '0.0167347596331369', '0.0167533143427464', '0.0167352247876418', '0.0167353516320998', '0.0167414953006763', '0.016749848191436', '0.0167323993142541', '0.0167619493621011', '0.0167279053215378', '0.0167620692274968', '0.0167349965723033', '0.0167560658380733', '0.0167266768320897', '0.0167505611026539', '0.0167372640696571', '0.0167451675088022', '0.0167349737158742', '0.0167567040733241', '0.0167333020559676', '0.0167609921837014', '0.0167265123006951', '0.0167540701751976', '0.0167341789751504', '0.0167567098310506', '0.0167278048230401', '0.0167495269800919', '0.0167406579876722', '0.0167589262067727', '0.0167242688811064', '0.0167535141184058', '0.016737757663841', '0.0167484752353975', '0.0167302035267659', '0.0167375224694401', '0.0167320194787863', '0.016746486202631', '0.016722477006851', '0.0167550999358457', '0.0167311361039708', '0.0167435888449013', '0.016719886378911', '0.0167514476180474', '0.016733504972205', '0.0167560567652923', '0.0167352814925233', '0.016753138644852', '0.0167400480176239', '0.0167452113024184', '0.0167247150176664', '0.0167355227936036', '0.0167245276298426', '0.0167448593832', '0.0167307758098776', '0.0167412056695892', '0.0167255880983649', '0.0167422534013228', '0.0167193516082593', '0.0167385023297925', '0.016705906968094', '0.0167404309936697', '0.0167155682585657', '0.0167350478684115', '0.0167151202027635', '0.0167373663129203', '0.016693902980872', '0.0167265196287105', '0.0167148515088635', '0.0167491921595762', '0.0167138374511057', '0.01672268288919', '0.016713883163964', '0.0167278643195466', '0.016726385107284', '0.0167313726941841', '0.0167074498643005', '0.0167181608057478', '0.0167095725461107', '0.0167157395945461', '0.0167250866527359', '0.0167240209499168', '0.016707788697777', '0.016726686602777', '0.0167067578902697', '0.0167323436562319', '0.0166997167142764', '0.016728047519933', '0.0167000236185428', '0.0167135718977838', '0.0167101554722925', '0.0167162518577217', '0.016698760233783', '0.0167259262339352', '0.0167001843114531', '0.0167124269826071', '0.0166979893963477', '0.0167173175605408', '0.0167030137978017', '0.0167130235179605', '0.0166889363311589', '0.0167049515344599', '0.0166891643720208', '0.0167144257860609', '0.0166950775570635', '0.0167066258115149', '0.0166899927867203', '0.0167204148684066', '0.0166873287041492', '0.0167186125255577', '0.0166735365066795', '0.0167133203025865', '0.0166931954784274', '0.0167035377509067', '0.0166783023338738', '0.0167123730693506', '0.016688532417926', '0.0167097555720206', '0.0166789950058109', '0.0166970927613137', '0.0166853232705863', '0.0166682147971699', '0.0166882733202367', '0.0166994431350328', '0.016669055250752', '0.0167072431095787', '0.0166842073185183', '0.0167115228450812', '0.0166787196818017', '0.0166820776576458', '0.0166828917652676', '0.0166828919397441', '0.0166886184348693', '0.0167101844354013', '0.0166679419158325', '0.0167196613041506', '0.0166913228215255', '0.0166967333396033', '0.0166900756630856', '0.0166983214252384', '0.0166703969754865', '0.0167076025312892', '0.0166881337389899', '0.0167046749891148', '0.0166851051748882', '0.0166903757627661', '0.0166863544270468', '0.0167023502634498', '0.0166933265103228', '0.0166808331163543', '0.0166929039280982', '0.0166964178859856', '0.0166797501403559', '0.0166952298750991', '0.0166972180354827', '0.0166983521331127', '0.0166914643220144', '0.0167088154923236', '0.0166859086394399', '0.0167097267833884', '0.0166896925125632', '0.0167073085382882', '0.0167009005377256', '0.0167047615294878', '0.0166963988680408', '0.0167178228446541', '0.0167224817177181', '0.0167383386707806', '0.0167398232918166', '0.0167536060675521', '0.0167773394158932', '0.016865794494642', '0.0172802874625528'], 'b1': ['0.0168913253365429', '0.0166791480947141', '0.0169747489414428', '0.0167706507685505', '0.0167499611810745', '0.0168839981052519', '0.0168264213414614', '0.0170086107873105', '0.0168850491418118', '0.0168500119713871', '0.0170821184095186', '0.0168872250545704', '0.0168648846362113', '0.016992469931055', '0.0171467378688764', '0.0169317564663933', '0.0170060449035047', '0.0169903947404513', '0.0169514527972631', '0.016996943775266', '0.0168920295188188', '0.0169695187209796', '0.0169094752244822', '0.0170826763090113', '0.0170169785814538', '0.0170845636711249', '0.0169070530050327', '0.0170568509390025', '0.0169742290964211', '0.0169703541737244', '0.016693127352278', '0.0167815989351284', '0.016990941642551', '0.0169070091900225', '0.016947108477903', '0.0168397329001644', '0.0169154708984108', '0.0170660484253514', '0.0169203949374878', '0.0169889800916751', '0.0168200981896078', '0.0166983649043365', '0.0169160836103067', '0.0169049146230597', '0.0172020140827875', '0.0172544859614827', '0.0168596984053201', '0.0170316986792703', '0.0167926783721753', '0.0169303102219324', '0.0169470697251848', '0.0169785680043656', '0.0169713491759485', '0.0168609210361233', '0.016910657531511', '0.0168641905785195', '0.0169026608557411', '0.017002157237797', '0.017056576353301', '0.0168407017181195', '0.0171230816037162', '0.0170056650570416', '0.0169474424146144', '0.0169244955685839', '0.0171115600016459', '0.0168694972570483', '0.0167703526170068', '0.0170216701042216', '0.016901836749513', '0.0170673187115242', '0.0170244000761134', '0.0168948935541682', '0.0167532385787514', '0.0169219944472036', '0.0167925835851213', '0.0168808996334135', '0.0168016955361912', '0.0170095228726826', '0.0168141370789144', '0.016859864413586', '0.0169525347312605', '0.0169839569014993', '0.0168162084291586', '0.0169273999277077', '0.0169807152889901', '0.0170102816927999', '0.0169689170064767', '0.0170848820718366', '0.0171890165607514', '0.0172478463290971', '0.0171135568140042', '0.016861817410934', '0.0170351581448981', '0.0171095326409737', '0.0169284916371655', '0.0167662697912137', '0.0169589875825269', '0.0169346709501011', '0.0170533392793984', '0.0170522329067499', '0.016856227418614', '0.0169100022265374', '0.0168937077559035', '0.0171910392082551', '0.0169340819786091', '0.0172338230819611', '0.0170901543616921', '0.0167868528959956', '0.0171335879543943', '0.0171073040105534', '0.0169701885145821', '0.0170029078535099', '0.0169215596137755', '0.0169346131701474', '0.0169591706978485', '0.0169375894487302', '0.0168295302870074', '0.016924547064313', '0.0169383559495664', '0.0167915482591228', '0.0170090248478852', '0.0169868139543769', '0.0168841494503271', '0.0172432628600796', '0.0172512663437595', '0.0166901924448404', '0.0170508184325355', '0.0169314384148052', '0.0170312671625162', '0.0167689058488605', '0.0171305203799934', '0.0168542409054016', '0.0171618674886609', '0.0170515112682947', '0.0172975114287112', '0.0169936038844669', '0.0169549054549809', '0.0169298114988878', '0.0170253563256194', '0.0168266819622194', '0.0170997161585044', '0.0168946802396562', '0.016992920125921', '0.016921162311133', '0.0169877344187152', '0.0169613225210795', '0.0170480064166006', '0.0169424862561673', '0.0169208393718146', '0.0171000242600703', '0.0170023016004004', '0.0168152008584853', '0.0168970548037361', '0.0170935871193654', '0.0170835660504739', '0.0168896237081778', '0.0169240319324598', '0.0171229468420115', '0.0169091491430516', '0.0171242712423403', '0.0169583039985427', '0.016980123873633', '0.0168419522788097', '0.0168699013676008', '0.0170141937971587', '0.0168653728855483', '0.0170303089928306', '0.0169958541605496', '0.0169007481821674', '0.0168055502097199', '0.016751384907064', '0.0170459629962434', '0.0171742067381729', '0.017009789952227', '0.017035314726827', '0.0170120934696568', '0.0168354903503301', '0.0170146720964735', '0.0168405631160553', '0.0169598953038541', '0.0170114023795155', '0.0169785282042766', '0.0170050780057293', '0.0167849335890737', '0.0170350095928116', '0.0167703564573663', '0.0168229929478329', '0.0170766078428147', '0.0169629183649976', '0.0170641607141142', '0.0169760169583123', '0.0169847640752334', '0.017033343924176', '0.0169504539546795', '0.0168980927481615', '0.0170428481155964', '0.0169532237266603', '0.0169255748841544', '0.0170238355432726', '0.017064109218385', '0.0168959845653789', '0.016870468169745', '0.0172003683141964', '0.0169669170520062', '0.0170209620815863', '0.0171222604650386', '0.0171542234277143', '0.0169524532109029', '0.017089563819144', '0.0169282528366317', '0.017089845561879', '0.0170309442231979', '0.0171422081648913', '0.0169198881846007', '0.0169923559422037', '0.0170145441426787', '0.0167905391173934', '0.0169942132796888', '0.0170522837042319', '0.016866790501875', '0.0168580034103032', '0.0170697227765472', '0.0168474858876703', '0.0171097497958451', '0.0168593377606543', '0.0169034298004424', '0.0170586911694318', '0.016946299558551', '0.016882736372607', '0.0172839598475418', '0.0170588570031359', '0.0169339589125446', '0.0171035821785497', '0.01705823067542', '0.0169105737418501', '0.0171094713697842', '0.0168824476474002', '0.0169520237888903', '0.0171060674148068', '0.0170696843729526', '0.0168485220864778', '0.0170749217504493', '0.0168917989226893', '0.0169097503338691', '0.0168361954054149', '0.016864311200719', '0.0169334457008711', '0.0173226382024216', '0.017014697931619', '0.0171750945594558', '0.0171205895595492', '0.0170395124142804', '0.017286882535654', '0.017103441481744', '0.0182295080172893'], 'SAMSN': '85C2', 'DarkPixelStart': '237', 'DarkPixelStop': '254', 'Firmware': '2.06', 'IDDataBack': 'DLAB_2018-07-02_16-15-52_275_586', 'IDDataCal': 'DLAB_2018-07-03_17-15-16_983_888', 'IDDataCalAQ': 'DLAB_2018-07-03_17-15-53_767_889', 'IntegrationTime': '0', 'Reverse': '0', 'SerialNo_MMS': '', 'c0s': '297.806', 'c1s': '3.3369', 'c2s': '0.000302696', 'c3s': '-1.83769e-06', 'c4s': '+0.000000000E+00'}, 'Ed': {'SN': '50ED', 'FUNC': 'Ed', 'TYPE': 'SAMIP', 'samsn': '859F', 'inifile': 'SAMIP_50ED_ALL.ini', 'calfile': 'Cal_SAM_859F.dat', 'calaqfile': 'CalAQ_SAM_859F.dat', 'backfile': 'Back_SAM_859F.dat', 'cal': ['+NAN', '+NAN', '+NAN', '+NAN', '0.549282530081406', '0.621825635483575', '0.705214779700439', '0.782494923890489', '0.848306874043027', '0.952625287085828', '1.06364941208026', '1.17099618224932', '1.27964867192574', '1.37878597375063', '1.42771820575638', '1.4380590385421', '1.41583530083466', '1.35751030831315', '1.28801896577964', '1.23773169248486', '1.19003370359023', '1.16911032524399', '1.16789019991587', '1.17908641221467', '1.20561721452238', '1.24993325867368', '1.3042108426727', '1.37841324495146', '1.46663415660191', '1.55813913029349', '1.66686169700722', '1.78274771118438', '1.89315285694338', '2.00609300108623', '2.10386062632617', '2.18077321675475', '2.23620955735442', '2.266135432154', '2.26878990322214', '2.25797663538301', '2.22685859649013', '2.17776313289299', '2.1222752364519', '2.06098344374156', '1.99948809108821', '1.94462577242816', '1.8989381397134', '1.8637403074385', '1.84137175128878', '1.82996842025894', '1.82735603324287', '1.82819560800875', '1.82831225824908', '1.82476779554239', '1.82142520789599', '1.82469614734563', '1.83514598035505', '1.85423698694933', '1.88102853388183', '1.91679111910883', '1.95713305118927', '2.0033013266641', '2.05191276620812', '2.10100127704333', '2.15116215495783', '2.19982933350689', '2.24341508467426', '2.28026480621138', '2.30634686430023', '2.31796219508283', '2.31589695847203', '2.29809543158409', '2.2668387918562', '2.22596956700897', '2.17822422289454', '2.1262484698939', '2.07154274835781', '2.01784816285075', '1.9635850159156', '1.90957838150673', '1.85662335754133', '1.80118393109592', '1.74752896056537', '1.69458207285898', '1.64238998731142', '1.59255947952261', '1.55042463825823', '1.52145095482736', '1.50182839545807', '1.48602912306116', '1.47501182897849', '1.46801797625318', '1.46252443118698', '1.4571840542778', '1.44881752975571', '1.433373570625', '1.4106211402034', '1.38310053980989', '1.35343439202405', '1.32469024445085', '1.29921323938482', '1.2757042981125', '1.25356245928469', '1.23230080447944', '1.20776661327865', '1.18172190161938', '1.16211138784545', '1.14836490545677', '1.13698033747357', '1.12673020620722', '1.115430409999', '1.10428562795353', '1.0934141739792', '1.0851095103506', '1.08102444265095', '1.08007408967758', '1.08238869164072', '1.08781099449618', '1.09202496629142', '1.09279743926351', '1.08928198225434', '1.08099296127192', '1.06779395728469', '1.05125732218958', '1.03307124483462', '1.01642561672595', '1.0017478853335', '0.98877464388953', '0.978591382441999', '0.970432000434175', '0.962460675619692', '0.953651636148435', '0.943103023421902', '0.930554197290447', '0.915976069829803', '0.89827602173614', '0.878650755188226', '0.859108524352699', '0.840122962860222', '0.820853477964574', '0.803547895709764', '0.786651104537257', '0.769194844035412', '0.751217544779413', '0.731862968408631', '0.710478767970412', '0.687207420135085', '0.662469528888512', '0.636358233772055', '0.609121332586544', '0.580838486227566', '0.552767035926316', '0.525876935395925', '0.499896413074609', '0.475284681533185', '0.452387885405863', '0.431848904268036', '0.413013739466993', '0.395710805209202', '0.380181587532903', '0.365591896979342', '0.352105459639395', '0.339276260510366', '0.32616389487977', '0.313880254968568', '0.301213081346406', '0.28867892621412', '0.276332017077307', '0.263867205519659', '0.251559483539307', '0.239917175566115', '0.228872841726392', '0.218348838385983', '0.208663588155861', '0.199488791575245', '0.191252859631973', '0.183364916996847', '0.175877803627425', '0.169219899131997', '0.162866423884395', '0.156727192611269', '0.151124000714184', '0.145138407523578', '0.13971586046093', '0.134506608902369', '0.129059486722317', '0.124203168251957', '0.119075347065844', '0.113513221481262', '0.107843336832916', '0.101790305051534', '0.0961960826886135', '0.0914035900672732', '0.0868727278958915', '0.082573024301116', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN'], 'calaq': ['+NAN', '+NAN', '+NAN', '+NAN', '0.308009257704273', '0.348985396550329', '0.39611199753429', '0.43986968240828', '0.477232425339663', '0.536318311921194', '0.599255756896796', '0.660195405447511', '0.721940911560072', '0.778381764258939', '0.806518994572799', '0.812862184246214', '0.800779958731845', '0.768238986615194', '0.729324871828135', '0.701235591002145', '0.674572715683613', '0.663056816542841', '0.662699926877705', '0.669382520005193', '0.684772623825422', '0.710275115045633', '0.74145572495904', '0.783988164111933', '0.834525694448954', '0.886966821712609', '0.949247521262016', '1.01565043430167', '1.07897249264832', '1.14377888540009', '1.19997013476615', '1.24429313837597', '1.2763795229717', '1.29391228294411', '1.29587029284695', '1.29012478792631', '1.27276079346714', '1.2450982196578', '1.21375364521069', '1.17906121512383', '1.14422362714978', '1.11315509839511', '1.08731507394343', '1.06746197368796', '1.05494171300318', '1.04869254224893', '1.04747349722362', '1.04822757370139', '1.04856210675178', '1.04679141002185', '1.04513065036628', '1.04725995618916', '1.0535067386541', '1.06471361999517', '1.08034380002613', '1.10113009018595', '1.12455239246124', '1.15132895471663', '1.1795169782144', '1.20798673857183', '1.23708055274173', '1.26532262623006', '1.29064822236823', '1.31210337451311', '1.32736540301797', '1.33430139824988', '1.33335932325033', '1.32335113190924', '1.30558590461423', '1.28227321775146', '1.25498704776805', '1.22525023251367', '1.19392661641762', '1.16317225749886', '1.13207700011805', '1.10111674556499', '1.07075040366943', '1.03893893539784', '1.0081446443131', '0.97774721715577', '0.947774052897518', '0.919152947182789', '0.894963764571428', '0.87836395884067', '0.867156996532193', '0.858153034494107', '0.851906778357719', '0.847981268808314', '0.844919850173329', '0.841944554421527', '0.83721825473176', '0.828398944802337', '0.815351600734525', '0.799543228463232', '0.782489183888857', '0.765962841341892', '0.751320667184625', '0.737812095757199', '0.725090001717255', '0.712873061263532', '0.698758948036327', '0.683766639638848', '0.672493396285743', '0.664610527729123', '0.658092136872804', '0.652228157780532', '0.645754399378545', '0.639368207275896', '0.633138158063289', '0.628392493836991', '0.626088937445665', '0.625599854321674', '0.627001238574581', '0.630202545823175', '0.632703647598273', '0.633210363154327', '0.63123164301687', '0.626485370072314', '0.618891745640103', '0.609361448964366', '0.598872648152344', '0.58927447780469', '0.580815044730471', '0.573341941514821', '0.567484926926375', '0.562800136636572', '0.558223116403165', '0.553158922485434', '0.547084299354418', '0.539847820827437', '0.531432360197925', '0.521203701656628', '0.509855867118928', '0.498554054755033', '0.487573187562371', '0.476425489189536', '0.466415695619565', '0.456641365086098', '0.446540473657011', '0.436135290849149', '0.424928637592468', '0.412541586513936', '0.399056656796071', '0.384717912438278', '0.369579305401316', '0.353784632326527', '0.337380068381195', '0.321095903578543', '0.305495669126019', '0.290421643260465', '0.276140762920409', '0.262854333224098', '0.250936131068681', '0.240006392992584', '0.229965608856624', '0.220954309792884', '0.212487857424938', '0.204661532835082', '0.197216204057537', '0.189605277840326', '0.182475141050851', '0.175121099828465', '0.167843462384963', '0.160673785509465', '0.153434661065448', '0.146286002352245', '0.139523451810534', '0.133107862589632', '0.126994143420237', '0.121367561058691', '0.116037239577153', '0.111252442566666', '0.106669531239736', '0.102319284531729', '0.098450973344807', '0.0947593486764351', '0.0911919684356708', '0.0879361030612687', '0.0844573547823388', '0.0813058869947144', '0.0782782092672921', '0.0751117681314502', '0.0722888539254525', '0.0693076153913147', '0.0660732713239472', '0.0627758734115707', '0.0592551057473219', '0.0560010918166818', '0.0532135140872552', '0.0505779890461858', '0.0480767985810033', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN'], 'b0': ['0.0165892037855774', '0.0165122714877024', '0.0164973019224162', '0.0166164505683762', '0.0165490556826164', '0.0165598147795938', '0.0164974439463348', '0.0165638938670541', '0.0165295399561229', '0.0165679375357729', '0.0165135498774463', '0.0165496044113927', '0.0165162233817516', '0.0165748471564411', '0.0165168071803162', '0.016561615028724', '0.0165228899565738', '0.0165630265440819', '0.0165138880130166', '0.016557182975186', '0.0165155392591658', '0.0165657065040199', '0.016518681058554', '0.0165595148543898', '0.0165168741793146', '0.0165713147040385', '0.0165192898072665', '0.0165624174464164', '0.0165336104942318', '0.0165711529642688', '0.0165277786152653', '0.0165778362888406', '0.0165368341231259', '0.0165763434674064', '0.0165347332508855', '0.0165844704110229', '0.0165276158286362', '0.016561547855249', '0.0165227810832013', '0.0165862270410135', '0.0165383602695828', '0.0165776928691096', '0.0165375732058275', '0.0165658438170714', '0.0165459794864142', '0.0165800024153139', '0.0165525603932462', '0.0165907623846741', '0.0165508449397234', '0.0165903560287695', '0.0165476473078365', '0.0165857165226035', '0.0165481178711146', '0.0165957271151451', '0.0165507685189908', '0.0165883062781607', '0.0165548565047555', '0.0166030835702795', '0.0165500053585241', '0.0165961038100348', '0.0165517131350783', '0.0166133108627067', '0.0165473248751564', '0.0165983146025071', '0.0165525591719102', '0.0166064242729443', '0.0165435383848847', '0.0165950365369267', '0.0165586482293239', '0.0166092385798323', '0.0165697841956677', '0.0165967129077004', '0.0165732545344154', '0.0166026855892496', '0.0165687354170748', '0.0166129015407006', '0.0165534954131229', '0.0166168593669527', '0.0165646865140591', '0.0166018156491291', '0.0165586096700045', '0.0166129247460829', '0.0165712166482126', '0.0166143243970348', '0.0165701301826831', '0.0166189659969196', '0.0165676643054824', '0.0166299271377517', '0.0165751742999882', '0.0166072596667062', '0.0165629157514673', '0.0166089130065742', '0.0165693558557167', '0.0166203017894511', '0.0165698981288603', '0.0166107804291794', '0.0165637935430329', '0.0166245248200721', '0.0165754381085446', '0.0166166770389491', '0.01656780789969', '0.0166270111110302', '0.0165662229546329', '0.0166136421936913', '0.0165698424708382', '0.0166173691874565', '0.0165821997730911', '0.0166164975025705', '0.0165739878593907', '0.016623824645643', '0.0165631308810639', '0.0166247172677161', '0.0165669479047333', '0.0166042075482691', '0.0165806895040011', '0.0166075213815439', '0.0165708319274012', '0.0166233251192561', '0.0165772010196913', '0.016621139974838', '0.0165690780890356', '0.0166295818486425', '0.0165801878838955', '0.0166132293821539', '0.0165742146789166', '0.0166257485986531', '0.0165839324997932', '0.0166274820232614', '0.0165711257459257', '0.0166118375826471', '0.0165702390560556', '0.0166138555785223', '0.0165495885340259', '0.0166076853895089', '0.0165715106412136', '0.0165914878582042', '0.0165708420470416', '0.0166090042578143', '0.0165677817282062', '0.0166140523880802', '0.0165772907006423', '0.0166172060518744', '0.0165733789362016', '0.0166208616847272', '0.0165699940909675', '0.0166094990733341', '0.0165568282643426', '0.0166152531357555', '0.0165675189665092', '0.0166057366608274', '0.0165695308557048', '0.0165973481768498', '0.0165636400036615', '0.0166118299056785', '0.0165665354421491', '0.0165949780872796', '0.0165594520428288', '0.0166050473039449', '0.0165700478297475', '0.0166062033856213', '0.0165620390067611', '0.0165990297819202', '0.016574294763657', '0.0165960321001693', '0.016567221483977', '0.0166072507684017', '0.0165554031398131', '0.0166002793830319', '0.0165516576515327', '0.0166026362123836', '0.0165560230550254', '0.0166113124082061', '0.0165672890064051', '0.016604050693843', '0.0165640243755198', '0.0166057021144688', '0.0165508046356384', '0.0165935180674385', '0.0165675029146658', '0.0165893028882626', '0.0165492090475113', '0.0165956159735774', '0.0165528561310127', '0.0166073952349921', '0.0165463099450159', '0.0166001891786512', '0.0165482056328235', '0.0165952621351168', '0.0165536456374398', '0.0165997360630289', '0.0165524916494821', '0.0165986206343906', '0.0165521507222869', '0.016599824522644', '0.0165434263709342', '0.0166010940140834', '0.0165431388335659', '0.0165863373101985', '0.0165434326520903', '0.0166064767903884', '0.016561522556148', '0.0165987263671851', '0.0165499257972134', '0.0165839637310972', '0.0165457994266058', '0.0165795458101604', '0.0165524665248577', '0.016595737060309', '0.0165466772181714', '0.0165879578484734', '0.0165430683450362', '0.0165948067512992', '0.0165396531408809', '0.0165652856665609', '0.0165523227561735', '0.0165783818770389', '0.0165503544861175', '0.016572293692008', '0.0165450638334354', '0.0165749698134617', '0.01655305398743', '0.0165967214570518', '0.0165454616399886', '0.0165946692637712', '0.0165392806334286', '0.0165890797327443', '0.0165355112418597', '0.0165804930433963', '0.0165460245013662', '0.0165847202614547', '0.0165448417247764', '0.0165611542361331', '0.0165515342966058', '0.0165765880835414', '0.0165339756736686', '0.0165878632821788', '0.0165440089481629', '0.0165963711081224', '0.0165516928957975', '0.0165934388550809', '0.0165544309564294', '0.0165877533619469', '0.0165399865655842', '0.0165907330726123', '0.016550628937744', '0.0166034288593887', '0.0165659505967252', '0.0166105647761531', '0.0165655829746165', '0.0166172674676229', '0.0165796119367761', '0.0166424952076873', '0.0166246136286404', '0.0167334388455894', '0.0171297295465388'], 'b1': ['0.018605511502516', '0.0184837131056956', '0.0183851120510798', '0.0184840774161591', '0.0185292503425739', '0.0186302980552904', '0.0183759157866635', '0.0186312056020559', '0.0185970883722841', '0.018610557385725', '0.018696732782741', '0.0185527901750176', '0.0184841121539561', '0.0185602766066645', '0.0183555554227304', '0.0185179326286786', '0.0185996666499772', '0.0186817794703681', '0.0184706934143117', '0.0185104139030999', '0.0185717901788923', '0.0185864488309574', '0.0184904599190226', '0.0185467707606851', '0.0185513739551852', '0.0186439978394227', '0.0185915799003217', '0.0186942077463949', '0.0186620183770728', '0.0186390987626822', '0.0185678106936811', '0.0186122998615499', '0.0184338018739524', '0.0186563994074951', '0.0186582494133848', '0.0184381484626158', '0.0187957369005385', '0.0184585601477162', '0.018382363401076', '0.0185619393077496', '0.0188072553604966', '0.018482204891798', '0.0185649745882186', '0.0189122127337069', '0.0186279875553889', '0.0184615582465232', '0.0185698745377681', '0.0185120261558266', '0.0184379972921025', '0.0185804266236362', '0.0185466583428899', '0.0185885491584593', '0.0184078979511364', '0.0184049089295427', '0.0184970417714545', '0.0184417327399261', '0.0183843069720872', '0.0185357707492544', '0.018271672720313', '0.018684147226538', '0.0187957920620654', '0.0182829548236024', '0.0184118543941909', '0.0184413151881155', '0.0184057733595452', '0.0182871827102461', '0.0183972310036081', '0.0185852110132782', '0.0183187237570663', '0.0184794824260633', '0.0185034061198914', '0.0181402547467266', '0.0184165518520597', '0.0183788985240326', '0.0181609569026518', '0.0186252303518572', '0.0183105499010758', '0.0181418076484435', '0.0183057028437498', '0.018502016957137', '0.0184040678908206', '0.0184980723842845', '0.0184303921584359', '0.0185389638335849', '0.0182085812003356', '0.0184602108040376', '0.0184275042081207', '0.0185323186152219', '0.0182322636497648', '0.0183371464850892', '0.0182259586523378', '0.018483065481441', '0.0182905728748417', '0.0184016187888549', '0.0183132295991711', '0.0181924879994499', '0.0184099916452902', '0.0187024550929006', '0.0183715293979111', '0.0183022039271567', '0.0184077949596782', '0.0183611756142407', '0.018411879705651', '0.0183403743072167', '0.0184016243748323', '0.0184520221102946', '0.0183486391099018', '0.01861046347148', '0.0185649627180167', '0.0184582639163523', '0.0186787228933602', '0.0185190477294169', '0.0186510274428554', '0.0186025957968757', '0.0183767100428249', '0.0183237705130843', '0.0183277608211268', '0.0185572685578353', '0.0184446809140601', '0.0186042166031303', '0.0186733833972142', '0.0186773335560441', '0.0184308924525366', '0.0186073100126766', '0.0183468275076066', '0.0185506345114271', '0.0186062746866781', '0.0184876664066378', '0.0182968567502917', '0.0184814123812545', '0.0186338901878814', '0.0185727479994544', '0.0184737700659259', '0.0185519168423637', '0.0184109360245942', '0.0186137698464147', '0.0184927182249478', '0.0183322589294271', '0.0184634239629744', '0.0185381407747276', '0.0183129747389523', '0.018566407740545', '0.0184619363473684', '0.0185385801467623', '0.0184219012982279', '0.0184126872285087', '0.0186440826764544', '0.0184714934310123', '0.0186275679088368', '0.0184197444127049', '0.0184460824707018', '0.018243945325', '0.018415498022511', '0.0184500097619367', '0.0185133976878398', '0.0184093356420695', '0.0185570035730324', '0.0186677780434563', '0.0187476308123041', '0.0184833070749635', '0.0183987680202018', '0.0183971864903508', '0.0184699862644854', '0.0186248246702486', '0.0185793174579989', '0.0187341727962561', '0.0185118727160099', '0.0185141533658448', '0.0185683596905223', '0.0185158860662092', '0.0183562021741761', '0.018351702145696', '0.0183285858001638', '0.0184325741808572', '0.0182299784613234', '0.0183180300484981', '0.0186951084852505', '0.0184788363728647', '0.0183958849576168', '0.0184240855899527', '0.0185323332784126', '0.0186074587393249', '0.0186410439047495', '0.0184129410413568', '0.0183934452819879', '0.0185733495393955', '0.0185109349700541', '0.0185722325184776', '0.0184577447695778', '0.0184457087339014', '0.0183168259212451', '0.0184703884548581', '0.0184217183574681', '0.0185029386434078', '0.0186379566048659', '0.018342027581965', '0.0184254820843023', '0.0186074793376165', '0.0184241568111645', '0.0182465302360413', '0.0184340305499022', '0.0186743681002925', '0.0184118549178763', '0.0184971573313619', '0.0183981095731159', '0.018496162154576', '0.0184611797965545', '0.0186299800037023', '0.018466689839573', '0.0186946017323634', '0.0185245357776493', '0.018476103782546', '0.0182796915654308', '0.0185767679830018', '0.0183549425362727', '0.0183019200896801', '0.0185407187032971', '0.0184576592342989', '0.0184396004676159', '0.0183728665412509', '0.018711382183031', '0.0185027394684012', '0.0184419015411806', '0.0184852501222893', '0.0186597281263393', '0.0187948452388963', '0.0182642088071376', '0.0186078693086637', '0.0186437127800135', '0.0185804302894338', '0.0185832597615481', '0.0185230038233477', '0.0187595940557125', '0.0185726041605364', '0.018819251596084', '0.0186927800054842', '0.0187059691963698', '0.0186125063681518', '0.0187091867193515', '0.0187669087185543', '0.0187420275532877', '0.0185165169325316', '0.0184496782690904', '0.0184827699483242', '0.0184833114390083', '0.0188096297500146', '0.0186457825592016', '0.0186986550572133', '0.018635516056428', '0.0185666859920442', '0.0185794000257273', '0.0185533461543306', '0.0186423201260233', '0.0186220849228963', '0.0196555486961812'], 'SAMSN': '859F', 'c0s': '+3.019290000E+02', 'c1s': '+3.345130000E+00', 'c2s': '+2.651460000E-04', 'c3s': '-1.753680000E-06', 'DarkPixelStart': '237', 'DarkPixelStop': '254', 'Reverse': '0', 'c4s': '+0.000000000E+00', 'IDDataCal': 'DLAB_2019-08-28_14-44-55_098_198', 'IDDataBack': 'DLAB_2019-08-28_12-24-09_763_812', 'IDDataCalAQ': 'DLAB_2019-08-28_14-47-19_914_233', 'Firmware': '2.06', 'IPSN': 'C121', 'Incl_Orientation': 'up', 'Incl_Xgain': '1.0', 'Incl_Xoffset': '125', 'Incl_Ygain': '0.9375', 'Incl_Yoffset': '126', 'Incl_KBG': '1.2073', 'Incl_Kref': '0.1275', 'Press_Current_mA': '1.08', 'Press_Surface_bar': '5.57', 'Press_Gain': '2.7', 'WithIncl': '1', 'WithPress': '1', 'Press_Sens_mV_bar_4mA': '71.36', 'Press_Sens_mV_bar_1mA': '17.84', 'Press_Type': 'PA-10/TAB/10bar', 'CalibrationDate': '08.06.2018'}, 'Lu': {'SN': '852F', 'FUNC': 'Lu', 'TYPE': 'SAM', 'samsn': '852F', 'inifile': 'SAM_852F.ini', 'calfile': 'Cal_SAM_852F.dat', 'calaqfile': 'CalAQ_SAM_852F.dat', 'backfile': 'Back_SAM_852F.dat', 'cal': ['+NAN', '+NAN', '+NAN', '+NAN', '0.099081925071204', '0.107353085872454', '0.113070264290883', '0.114376499819276', '0.116544285861757', '0.1185169696214', '0.121561138979849', '0.126964155564462', '0.134364254054539', '0.144053858633949', '0.154882735476408', '0.16719673162462', '0.181437615712041', '0.194237970806716', '0.20386154720656', '0.211556336359081', '0.211417859085921', '0.208790218500257', '0.20437467341685', '0.198246352046376', '0.192966396099738', '0.18897229193584', '0.186243043953596', '0.18578727224224', '0.187114583931684', '0.189090911319999', '0.193600418301244', '0.200054490546523', '0.208072057884887', '0.218285958582262', '0.230634876630779', '0.243459214546046', '0.257752719558026', '0.272580246630834', '0.286712281491418', '0.300342726342385', '0.312249154496702', '0.321331680226083', '0.327112591435919', '0.329469692698771', '0.327542874308678', '0.322985767437387', '0.316224456423823', '0.308782990589082', '0.301183418606427', '0.293575702556702', '0.286696408065096', '0.280798842600295', '0.275808444038661', '0.271299340181449', '0.266225534078626', '0.260785177597799', '0.255342424416527', '0.250947812402455', '0.24777514930692', '0.246247860756574', '0.246092032695547', '0.247219177075727', '0.249675195006791', '0.253195744885965', '0.257788026175471', '0.26369589320837', '0.270555680751329', '0.277823002163503', '0.284937579021833', '0.291097253127256', '0.296043211270752', '0.299540235735164', '0.301795150475552', '0.303069111244916', '0.30355995799167', '0.303606664702465', '0.303007474849756', '0.302001653949665', '0.300361927400822', '0.297986890885497', '0.295325565249305', '0.291656567474701', '0.287335862742648', '0.282306131698578', '0.276702242286357', '0.270280607979823', '0.263050805729498', '0.255009286552014', '0.247098798503932', '0.2398191835424', '0.23466817932016', '0.230585310303585', '0.227279061892254', '0.224693206022759', '0.222993136629962', '0.221791418806722', '0.220695274517678', '0.219442816624831', '0.217000405185694', '0.213283732282521', '0.208384750595562', '0.202985389753009', '0.197924660371165', '0.193409646692029', '0.189628652821804', '0.186318519164064', '0.183315563032657', '0.180098687261504', '0.176492614557115', '0.172650422408531', '0.168979191040057', '0.166106531649937', '0.163622827054655', '0.161570328667133', '0.159693607722301', '0.157690305409947', '0.15544650006387', '0.153185383511044', '0.150954772341381', '0.148960802743881', '0.147350785081686', '0.146182367433256', '0.145312879880878', '0.144781245193999', '0.14473607505965', '0.144976432177203', '0.145464936657928', '0.145889790468872', '0.146174517595681', '0.14615421098877', '0.145743119998859', '0.144922809795091', '0.143805231938307', '0.142492952453543', '0.141053445832183', '0.139720571628269', '0.138186469198598', '0.136919534961634', '0.135732624874463', '0.134597268963386', '0.133432724955799', '0.13211501546202', '0.130478475600008', '0.128290801143951', '0.125726707508103', '0.122634784100445', '0.119472073398083', '0.116199128230447', '0.112813911251756', '0.109547291781198', '0.106268392530964', '0.10313443150471', '0.100113578226984', '0.097073834113113', '0.0941199411272616', '0.0911853891891621', '0.0882319764053268', '0.085267274530049', '0.0822333903307463', '0.0792187073154596', '0.0760907077820793', '0.0728848234132589', '0.0697048920692252', '0.0665600438164166', '0.0635411651500916', '0.0606319242880778', '0.0578670530064308', '0.0553155735461356', '0.0529193006810867', '0.050722718025932', '0.0486788470977319', '0.0467747209472673', '0.0450423813898501', '0.0434307741189043', '0.041915712424757', '0.0405250313895705', '0.0390895391040532', '0.0377897158697839', '0.0365016922380464', '0.0351788001916396', '0.0338645937424847', '0.0325302009051183', '0.0312848146149282', '0.0300375958148976', '0.0288302935207691', '0.027652203865544', '0.0264621566936286', '0.0252688692008588', '0.0241226625595337', '0.0229255436965288', '0.0217207281738409', '0.0205701146867025', '0.0193892949195812', '0.0183936626191952', '0.017494647116465', '0.0167605279940225', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN'], 'calaq': ['+NAN', '+NAN', '+NAN', '+NAN', '0.0757791569140749', '0.0831133762408903', '0.0873256015093429', '0.088798490578607', '0.0893180250587088', '0.0912184306930603', '0.0934315009445713', '0.0978927038642625', '0.10316713605413', '0.111042352696646', '0.119482024262908', '0.129446496806651', '0.140324929207819', '0.149929004563169', '0.157951375798488', '0.163167079267684', '0.163684554455683', '0.161710955408623', '0.158158176144384', '0.153120816765498', '0.149159625705894', '0.146361065436421', '0.144318454214309', '0.144129633718655', '0.144738939517372', '0.146583353055999', '0.149927549178646', '0.154781330782628', '0.161281049713208', '0.169324782015295', '0.178566729488516', '0.188750791302883', '0.199826540979236', '0.211193704798505', '0.222305048038871', '0.232787040612667', '0.242185638548782', '0.249199329450493', '0.253905646769863', '0.255480704613068', '0.254086308176615', '0.250712203525897', '0.245637528877396', '0.239859851966525', '0.233843628655063', '0.228059104546805', '0.222661940533832', '0.218199567518201', '0.214240155949967', '0.21061280671042', '0.206823867975479', '0.202504211638902', '0.198378089686984', '0.195008429198418', '0.192596053511712', '0.1913409806608', '0.191204589224151', '0.191982450755957', '0.193875999271111', '0.196568015329539', '0.200197325412529', '0.204781342874412', '0.210052890237844', '0.215505542064364', '0.22102191587617', '0.225647984382987', '0.229501509141454', '0.232213608637945', '0.233859853462842', '0.234864695710533', '0.235347731196379', '0.235169523165461', '0.2348286160222', '0.23395735104209', '0.232593294508701', '0.230910869907075', '0.228844605598996', '0.226021135136259', '0.222713212172475', '0.218813740820075', '0.214437631947854', '0.20945948892298', '0.203847193841702', '0.197707092492944', '0.191556734852924', '0.18600061167507', '0.181873354953207', '0.178782316057322', '0.176167924779435', '0.174141863608666', '0.172744990342331', '0.171801376758966', '0.170954015345458', '0.169960140045412', '0.168049955384139', '0.165224777136175', '0.161531979240228', '0.157405412608478', '0.153570487964493', '0.150141271545146', '0.14725256652001', '0.144660342475923', '0.142269456600007', '0.139762314536934', '0.136963054606891', '0.133984343960448', '0.131197679174342', '0.129003116254732', '0.127069994503092', '0.125436648144931', '0.12397269238396', '0.122419985358787', '0.120693422850158', '0.118931546980571', '0.117166660339047', '0.115631793601506', '0.114393230429202', '0.113425752529033', '0.112707849783804', '0.112359222280159', '0.11219082672674', '0.112343608199868', '0.112664705152637', '0.112877954686814', '0.112998494144185', '0.112887922565457', '0.11253063359053', '0.111841159102354', '0.110997003525569', '0.109948198155768', '0.108874849717231', '0.107795318097265', '0.106637360724801', '0.105678694194695', '0.104756017092462', '0.103825430274706', '0.102939456306441', '0.102001186921616', '0.100737446991222', '0.0991453606719906', '0.0971498679860747', '0.0948117209915638', '0.0924075366042346', '0.0899484551808979', '0.0873520434504222', '0.0848497958878303', '0.0823900490277647', '0.0799786063537234', '0.0776610830064481', '0.0752837851752474', '0.0729604964467151', '0.0707262742573907', '0.0684046065784823', '0.0660274200992436', '0.0636252573638505', '0.0612270512870042', '0.0587905905539405', '0.0563195707029216', '0.0538582650571118', '0.0514203967394221', '0.0490721477077881', '0.0468328465329872', '0.044723244642693', '0.0427398639178554', '0.0408841538190041', '0.0391762093418711', '0.0375882143782858', '0.0361234008364646', '0.0347811387811729', '0.0335210387242261', '0.0323747022105674', '0.0312594345687719', '0.030174948252246', '0.0291339080526091', '0.0281312995576928', '0.027138393963344', '0.0260756668210364', '0.0250906058668046', '0.0240551778532538', '0.0230712653382013', '0.0221310389230639', '0.0211757703478467', '0.0202209094313405', '0.0192572613107586', '0.0182920464007378', '0.0172950661682144', '0.0163207919630062', '0.0153269728531649', '0.0143853788804443', '0.0135213976548868', '0.0127456574145877', '0.0120278700767597', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN', '+NAN'], 'b0': ['0.0181271394490075', '0.0179948670252732', '0.0180195207374602', '0.0181005261905924', '0.018089553708784', '0.0180460947386496', '0.0180426749981038', '0.0180534564280807', '0.0180790359128869', '0.0180635226786445', '0.0180649523395645', '0.0180630058790784', '0.0180600544336154', '0.0180597668962471', '0.0180588020408788', '0.0180498552319141', '0.0180704773142647', '0.0180562171706652', '0.0180717635554537', '0.0180430410499234', '0.0180523488508876', '0.0180618142041841', '0.0180579205853055', '0.0180626933915622', '0.0180613022899616', '0.0180574472304024', '0.0180710633810246', '0.0180638238251844', '0.0180615148024098', '0.0180669541091198', '0.0180750465063777', '0.0180621163975833', '0.0180742925931686', '0.0180599654505706', '0.0180625609638543', '0.018079003460247', '0.0180789446616468', '0.0180641596925595', '0.0180789860125912', '0.0180726758933779', '0.0180883707577176', '0.0180761767655234', '0.0180788425928601', '0.0180748167207502', '0.018087924097728', '0.0180769134055532', '0.0180908061015206', '0.0180821035597377', '0.0180826006434528', '0.0180812086694694', '0.0180992416941691', '0.0180889166948691', '0.0180883470289057', '0.0180961206574913', '0.0180961166445305', '0.0180882432153534', '0.0180960383045557', '0.0180981065496797', '0.0180892262162838', '0.018090062656905', '0.0181151497688632', '0.0180994168686337', '0.0180945880554018', '0.0181024354875717', '0.0180812022138367', '0.018095840622615', '0.0181047246200187', '0.0180913783846324', '0.0181042299789754', '0.018097802960468', '0.0180910716548426', '0.0181013286082848', '0.0180952437383085', '0.0181025522123893', '0.0180982995207534', '0.0180837411967154', '0.0181112380044225', '0.0181073538072781', '0.018103745283096', '0.0180962696604722', '0.0181080471771214', '0.0180900361364681', '0.0181011494208593', '0.0181086649986149', '0.0181182547536976', '0.0181057997445719', '0.0181089392757648', '0.0181055429150778', '0.0181146218027973', '0.0181128730242519', '0.0181162224507446', '0.018127437978399', '0.0181252793544177', '0.0181109518628667', '0.0181264111838525', '0.018109165222908', '0.0181143328696165', '0.0181233651720949', '0.0181237422159377', '0.0181142894249535', '0.0181268594141312', '0.0181223244194237', '0.0181331201564784', '0.0181055589669212', '0.0181385395728607', '0.0181050559510032', '0.0181237826944993', '0.0181113664191696', '0.0181140599882791', '0.0181137768128247', '0.0181257021111189', '0.0181361358093148', '0.0181222916178307', '0.0181118017381829', '0.0181256476744327', '0.0181248496186543', '0.0181254770363585', '0.0181331583668447', '0.0181230066227672', '0.0181144363342157', '0.0181321676889458', '0.0181179351126425', '0.0181364284065034', '0.0181453949313192', '0.0181325621804444', '0.0181156688366246', '0.0181297948077507', '0.0181383919656923', '0.0181374979478067', '0.0181199012889798', '0.0181422937849691', '0.0181196791803209', '0.0181355928382649', '0.0181084210803862', '0.018133168137532', '0.0181404589894803', '0.0181418954549861', '0.0181177946590129', '0.0181147076452641', '0.0181089181641013', '0.0181443674388664', '0.0181377502409103', '0.0181289850620429', '0.0181158340659255', '0.0181305586661236', '0.0181270701818138', '0.0181084884283378', '0.0181265399475526', '0.0181359089897888', '0.0181099418180697', '0.0181312042293899', '0.0181193782082575', '0.0181291396482737', '0.0181114958807759', '0.018131541667054', '0.0181167600130213', '0.018133784563213', '0.01811013496362', '0.018139256671516', '0.0181215378790981', '0.0181241962039428', '0.0181255386265836', '0.0181152391008612', '0.0181239868320727', '0.018128921378099', '0.0181191986718789', '0.0181302022105147', '0.0181156925654366', '0.018128299020215', '0.0181149622065629', '0.0181265924649967', '0.0181200464534764', '0.018134817115486', '0.0181138528846042', '0.0181302275096157', '0.0181219730236349', '0.0181227435121171', '0.0181128882037125', '0.0181298839652721', '0.0181217728990224', '0.0181271213034454', '0.0181002302783493', '0.0181198512142075', '0.0181077788321745', '0.0181113704321304', '0.0181110165936699', '0.0181200574454996', '0.0181026958065969', '0.0181267051768535', '0.018099050467861', '0.0181217983725999', '0.0181250125797599', '0.018113538826799', '0.0181123129544992', '0.0181229691103072', '0.0181081715789076', '0.0181231769118883', '0.0181145502674084', '0.0181123405217955', '0.0181137211548025', '0.0181167594895916', '0.0181050918931742', '0.0181182652222911', '0.0181006336681525', '0.0181259247432075', '0.018101253059935', '0.018119688602055', '0.018109630726366', '0.0181146952574284', '0.0181041917686091', '0.0181114787820732', '0.0181135109105496', '0.0181156468525783', '0.0180992396004504', '0.0181260718269463', '0.0181003136781442', '0.0181070481243477', '0.0181074850136501', '0.0181076732738566', '0.0181037805273608', '0.0181054610855719', '0.0180953817492662', '0.0181251186615074', '0.0181015350140535', '0.0181170220768121', '0.0180958751689736', '0.0181153706561862', '0.0181087792807607', '0.0181190203568361', '0.0181090340165361', '0.0181264401469612', '0.0181213607853913', '0.0181053968781984', '0.0181112694102031', '0.0181143349633352', '0.0181028416689998', '0.0181058145750794', '0.018112246653407', '0.018102646778684', '0.0181018787328736', '0.0181089858610059', '0.0181129695097887', '0.0181304682872664', '0.0181118867082669', '0.0181302966023328', '0.0181224601621861', '0.0181439211278299', '0.0181333813478864', '0.0181515932110585', '0.0181361972250634', '0.0181645852590311', '0.018168622995547', '0.0182029242145575', '0.01826668143855', '0.0187321041138753'], 'b1': ['0.0246216519286131', '0.024510637261161', '0.0246496004937187', '0.0246158903420498', '0.0244170047588795', '0.0245126709060577', '0.0246256846551714', '0.0247016785610073', '0.0245795106168697', '0.024601391414026', '0.0247430929974417', '0.0246690990460763', '0.0246595979967682', '0.024549218035998', '0.0245417076893854', '0.0249321420235364', '0.0245095865737246', '0.0245109975567032', '0.0246271043662396', '0.0249088567021879', '0.0244657876231882', '0.0248177038501861', '0.0247746806522609', '0.0246467759093347', '0.0244827044066167', '0.0246539416709665', '0.024721638131062', '0.0244816703025508', '0.0248143197952532', '0.0247325126325631', '0.0245241834309148', '0.0244880571694591', '0.0247891481591618', '0.0245174540737672', '0.0248839095525633', '0.0244844522938572', '0.024819053561975', '0.0246153722426461', '0.0244569738236619', '0.024594164032081', '0.024739169721128', '0.0246157473759408', '0.0245033974853286', '0.0247480762129667', '0.0246028704761041', '0.0245055458173238', '0.02469614722145', '0.0244073975760008', '0.0245040215437411', '0.0244248794159556', '0.0244697287048048', '0.0246472875499521', '0.0246650067939463', '0.0244401485106133', '0.0243791267698239', '0.0246499286698909', '0.0243780806209942', '0.0247780093711051', '0.0247202135322636', '0.0245516643449751', '0.0244492274695042', '0.0246700816544131', '0.0246774251199509', '0.0245070955769284', '0.0246320020464858', '0.0244041100537399', '0.0245954472358265', '0.0243854736620815', '0.0245493665880845', '0.0247136054955626', '0.0246331129577409', '0.0247415952572516', '0.0248944354541623', '0.0247328998106215', '0.0246575704615342', '0.0247710366748172', '0.0247250916615888', '0.0247268100478861', '0.0248027810861271', '0.0248363912138882', '0.0249100102065207', '0.0245452771289432', '0.0246815472221476', '0.0246684887780455', '0.0248864084046402', '0.024731509076811', '0.0246692868745663', '0.0245807166643024', '0.0247555966841634', '0.024710914276389', '0.0247437058838994', '0.0247758020372237', '0.0244627418690115', '0.0246814871728906', '0.0246144002825787', '0.0247326369205602', '0.0247778595970861', '0.0250858798171903', '0.02491093660596', '0.0248098248290651', '0.0248231980080813', '0.0247223508668658', '0.0247285340201608', '0.0245271073409594', '0.0246145044959695', '0.0247301532553592', '0.0247854968501228', '0.0249164176717207', '0.0248323871154641', '0.0245063201734407', '0.0249895534773082', '0.0247316035147414', '0.0250480786353239', '0.0245604978699841', '0.0248995078707639', '0.0247918838915929', '0.0246323141629729', '0.0246174315481265', '0.0245240120112333', '0.0247643169185683', '0.0246655463644507', '0.024543567994421', '0.0246558676112366', '0.0245943996905025', '0.0250753080058395', '0.0250045579362867', '0.0246554029277417', '0.0250264155167244', '0.0246469593737799', '0.024665052703698', '0.0248279473108028', '0.0246961217354281', '0.0245553355540586', '0.0245557204628138', '0.0247270518159704', '0.0247966155635732', '0.0247140158903397', '0.0247626610253931', '0.0248185803249523', '0.024609407466155', '0.0247364268316634', '0.0246575409605911', '0.0248112543155938', '0.0245781406559126', '0.0247824863574285', '0.0246500847281345', '0.0247009649523946', '0.0248219430833464', '0.024708337569752', '0.0246372621170157', '0.0247286281089676', '0.0245687148427376', '0.0244441117615777', '0.0246077550642157', '0.0247010606122576', '0.0247215691791535', '0.0245714196777312', '0.024795434478477', '0.0244320022353862', '0.0247462735133231', '0.0246903013215404', '0.0245514873393163', '0.0245751469211505', '0.0246573018109337', '0.0244665511564739', '0.0246441606245413', '0.0244944379267046', '0.0247590790173862', '0.0244953459971555', '0.0247222716158114', '0.0246553421802375', '0.0246119307568831', '0.0246354342804737', '0.0243070187840778', '0.0247393772751007', '0.0245134415963769', '0.0247120136665658', '0.0245733489346753', '0.0244120664057354', '0.0245414062211677', '0.0248899691161084', '0.0246153303478156', '0.0247247613906751', '0.0246353044064992', '0.0248533992931349', '0.0244737232023303', '0.0247406206787574', '0.0245452593236402', '0.0245186117675831', '0.024411721471631', '0.0246871115538839', '0.0245525059073826', '0.0247245782753535', '0.0246827284818056', '0.0247343388980489', '0.0248475752134495', '0.024459163701364', '0.0247058137553385', '0.0246986457244034', '0.024567998615698', '0.0243962081650239', '0.02490341386546', '0.024537072550077', '0.0244906673919604', '0.0245997164936153', '0.0246575069210413', '0.0242198948182748', '0.024409780344485', '0.0242338197871209', '0.0244076180475463', '0.0245564188845504', '0.0246008453847352', '0.0245239058776628', '0.0246243248187984', '0.0246248141155061', '0.0243052663582307', '0.0245985008452839', '0.0243217586073769', '0.0246622282938758', '0.0246268287331674', '0.0244327690853459', '0.0245608707339754', '0.0244063069139137', '0.0246343666605434', '0.0244305303303416', '0.0247014261446536', '0.0246118652962104', '0.0246281107149804', '0.0246470772029907', '0.0247607972291217', '0.0247295342592388', '0.0246461279359564', '0.0245565616760977', '0.0244480411475541', '0.0245717391258137', '0.0246028116487796', '0.0248620650642601', '0.0244563693161703', '0.0245400739655581', '0.024658254394642', '0.0247536939606119', '0.024581995678565', '0.024518225986019', '0.0249431329577538', '0.024793957860264', '0.0246779200026361', '0.0246277942344484', '0.0245882612250266', '0.0245443142460891', '0.0244427728726199', '0.0245225095578749', '0.0246755827947801', '0.0244593372157869', '0.0246154502717679', '0.0255941653568822'], 'SAMSN': '852F', 'DarkPixelStart': '237', 'DarkPixelStop': '254', 'Firmware': '2.06', 'IDDataBack': 'DLAB_2016-11-29_14-47-59_729_812', 'IDDataCal': 'DLAB_2016-12-07_12-00-24_364_510', 'IDDataCalAQ': 'DLAB_2016-12-07_12-02-43_591_545', 'IntegrationTime': '0', 'Reverse': '0', 'SerialNo_MMS': '103307', 'WavelengthRange': '310..1100', 'c0s': '299.895', 'c1s': '3.31161', 'c2s': '0.00031652', 'c3s': '-1.73194e-06', 'c4s': '+0.000000000E+00', 'cs': '102842'}} + rtv = {"beginWL":350, "endWL":950,"interval":1, "n_t_square":0.543} - def printResult(self,): - log.info( f"***** : Print Lsky Esky Lwater Lw Rs......", __name__ ) - print(self.res[self.device_enum(1)]) - print(self.res[self.device_enum(2)]) - print(self.res[self.device_enum(3)]) - print(self.res[self.device_enum(4)]) - print(self.res[self.device_enum(5)]) - pass - def printTest(self,d,sleep_time:int=5): - log.info( f"***** : I am testing ********", __name__ ) - print(d) - log.info( f"***** : Ending testing ********", __name__ ) - time.sleep(sleep_time) - pass +def profiler_demo(): + device_id = 2 + ph = ProfilerHandle( device_id, ProfilerCfg.cfg, ProfilerCfg.calcfg, ProfilerCfg.rtv) + fpath = Path.cwd() + infopath = fpath.joinpath('data','2','37','info.bin') + sensorpath = fpath.joinpath('data','2','37','sensor.bin') + savedir = fpath.joinpath('data','2','37' ) + + ph.set_ramses_number(3) # 设置传感器数量 + ph.set_tilt_range(21.0) # 设置倾斜范围 + + ph.read_info_path(infopath) + ph.profiler.reset_profiler() + ph.profiler.data.set_wavelength( ) # 设置波长 + ph.profiler.get_depth_offset() + ph.read_sensor_path(sensorpath) + ph.profiler.get_Ed0_kd() + ph.profiler.get_Lu0_Ku() + ph.profiler.get_Lw_Rs(ph.retrieve["n_t_square"]) + ph.profiler.save(savedir) -if __name__ == "__main__": - # hh = HandHeld() - # hh.getDataFileList() - # hh.dealAllMeasurements() - # data/2023_02/07/sensor/14_02_46 - # hhb= HandHeldBuf() - # hhb.readFile2Buf("data/2023_02/07/sensor/14_02_46") - # hhb.decode_handheld() - # print(hh.error_result) - # print("======") - # print(hh.filelist) +if __name__ == '__main__': - # print( hh.getDataFname() ) + # my_init() + device_id = 2 + ph = ProfilerHandle( device_id, ProfilerCfg.cfg, ProfilerCfg.calcfg, ProfilerCfg.rtv) + fpath = Path.cwd() + # t= ("data", "2","2002","8", "17","51", "info.bin") + # t= ("data" ) + infopath = fpath.joinpath('data','2','37','info.bin') + sensorpath = fpath.joinpath('data','2','37','sensor.bin') + savedir = fpath.joinpath('data','2','37' ) - # t = b'\x07' - # print( int(t[0])) - # print( 2 << int(t[0])) + ph.set_ramses_number(3) + ph.set_tilt_range(21.0) + ph.read_info_path(infopath) + ph.profiler.reset_profiler() + ph.profiler.data.set_wavelength( ) # 设置波长 + ph.profiler.get_depth_offset() + ph.read_sensor_path(sensorpath) + + # log.info( f" Ed: {ph.profiler.Ed} ") + # log.info( f" Lu: {ph.profiler.Lu} ") + ph.profiler.get_Ed0_kd() + ph.profiler.get_Lu0_Ku() + # log.info( f" Ed0: {ph.profiler.Ed0} ") + # log.info( f" Lu0: {ph.profiler.Lu0} ") + ph.profiler.get_Lw_Rs(ph.retrieve["n_t_square"]) + # log.info( f" Lw: {ph.profiler.Lw} ") + # log.info( f" Rs: {ph.profiler.Rs} ") + ph.profiler.save(savedir) + + + - pass diff --git a/receive.py b/receive.py index 1750e9f..a71b13f 100644 --- a/receive.py +++ b/receive.py @@ -18,8 +18,8 @@ from tools.mypath import MyDir from tools.mylogger import log from pathlib import Path,PurePath from myconfig import DATA_DIR,DeviceType -from profiler import Profiler - +from profiler import Profiler,ProfilerHandle +# from myRamses import RamsesFactoryHandle,AirWater IP = "" PORT = 7887 @@ -42,8 +42,9 @@ conn_pool = [] # save_path = Path class MyTCPServer(TCPServer): - def __init__(self, server_address, RequestHandlerClass, bind_and_activate=True, cfg=None, retrieve=None): + def __init__(self, server_address, RequestHandlerClass, bind_and_activate=True, cfg=None, calcfg=None, retrieve=None): self.cfg = cfg + self.calcfg = calcfg self.retrieve = retrieve TCPServer.__init__(self, server_address, RequestHandlerClass, bind_and_activate=True ) @@ -185,33 +186,62 @@ class DealData: def __init__(self) -> None: self.device_id = None - self.devie_type = DeviceType.SURFACE.name + self.devie_type = DeviceType.PROFILE.name self.measure_id = None self.cfg = {} - self.profiler = None + self.calcfg = {} + self.profiler_hdl = None pass - def deal(self, id: int, con: int, cfg:dict , retrieve) -> None: # 取字典中的 payload + def deal(self, id: int, con: int, calcfg:dict , retrieve) -> None: # 取字典中的 payload log.info(f" 接收到数据开始处理数据 device_id {id} ") self.device_id = id self.measure_id = con if self.device_id is None: self.device_id = id if self.cfg == {}: - self.cfg = cfg + self.cfg = calcfg + if self.calcfg == {}: + self.calcfg = calcfg # self.cfg = cfg.get(self.device_id) - if self.profiler is None: - self.profiler = Profiler() ##处理数据 - self.profiler.setSyscfg(self.cfg) - self.profiler.setRetrieve(retrieve) - self.profiler.setDeviceID(self.device_id) - self.profiler.setMeasureID(self.measure_id) - path_tuple = ( "data", str(id), str(con) ) - self.profiler.setOldFolder( path_tuple ) - self.profiler.getInfoDict( ) - self.profiler.transferFromOldFolder() - self.profiler.deleteOldFolder() - self.profiler.dealOneMeasurement_Profiler(self.profiler.new_folder) + if self.profiler_hdl is None: + self.profiler_hdl = ProfilerHandle( self.device_id, self.cfg, self.calcfg, retrieve) ##处理数据 + + fpath = Path.cwd() + infopath = fpath.joinpath( 'data',self.device_id,self.measure_id,'info.bin') + sensorpath = fpath.joinpath( 'data',self.device_id,self.measure_id,'sensor.bin') + + savedir = fpath.joinpath('data',self.device_id,self.measure_id ) + + self.profiler_hdl.set_ramses_number(3) + self.profiler_hdl.set_tilt_range(21.0) + + self.profiler_hdl.read_info_path(infopath) + self.profiler_hdl.profiler.reset_profiler() + self.profiler_hdl.profiler.data.set_wavelength( ) # 设置波长 + self.profiler_hdl.profiler.get_depth_offset() + self.profiler_hdl.read_sensor_path(sensorpath) + + self.profiler_hdl.profiler.get_Ed0_kd() + self.profiler_hdl.profiler.get_Lu0_Ku() + self.profiler_hdl.profiler.get_Lw_Rs(self.profiler_hdl.retrieve["n_t_square"]) + self.profiler_hdl.profiler.save(savedir) + + + # self.profiler_hdl.read_info_path(infopath) + # self.profiler_hdl.read_sensor_path(sensorpath) + # self.profiler_hdl.profiler.process_profiler() + # self.profiler.setSyscfg(self.cfg) + # self.profiler.setRetrieve(retrieve) + # self.profiler.setDeviceID(self.device_id) + # self.profiler.setMeasureID(self.measure_id) + + # path_tuple = ( "data", str(id), str(con) ) + # self.profiler.setOldFolder( path_tuple ) + # self.profiler.getInfoDict( ) + # self.profiler.transferFromOldFolder() + # self.profiler.deleteOldFolder() + # self.profiler.dealOneMeasurement_Profiler(self.profiler.new_folder) log.info(f" Complete Dealing one group.") # self.profiler.readOneFolder( ) @@ -223,20 +253,22 @@ class DealData: log.warning(f"not find file: {fpath} ") return ret ret = fpath.read_bytes() - # with open( fpath, 'rb') as file: - # ret = file.read() - # return ret return ret pass @staticmethod def decode_info(info: bytes) -> dict: + '''info 分为两部分 : 传感器部分, 深度 倾斜部分 ''' ret = {} try: - temp = struct.unpack( " None: log.debug(f"retrieve {self.server.retrieve}",__name__, "", "" ) self.cfg =self.server.cfg + self.calcfg =self.server.calcfg self.retrieve =self.server.retrieve self.sk: socket.socket = self.request self.sensor = illumination_sensor(self.request) @@ -436,7 +483,7 @@ class MyServer(socketserver.BaseRequestHandler): if data_["packet_con"] == data_["packet_all"]: log.info(f'最后一帧数据已经收到并保存') # id 为传感器测量id ,con 测量序号 - self.dealData.deal(data_['id'], data_["con"], self.cfg, self.retrieve) + self.dealData.deal(data_['id'], data_["con"], self.cfg,self.calcfg, self.retrieve) pass if time.time() - self.begin_time > TIMEOUT_SECOND: diff --git a/retrieve.yml b/retrieve.yml index ba0f0ee..3b90f5c 100644 --- a/retrieve.yml +++ b/retrieve.yml @@ -2,3 +2,4 @@ beginWL: 350 endWL: 950 interval: 1 rowFactor: 0.026 +n_t_square: 0.543 diff --git a/tcp_profiler.py b/tcp_profiler.py index 1919bfd..16d6231 100644 --- a/tcp_profiler.py +++ b/tcp_profiler.py @@ -18,7 +18,7 @@ class DataContent: # 11 13 55 AA 0200 00 11 00 00 00 4F00 01 07 # id type-num 序号 17 字节数 包号 总 info_frame = "1703140E313518565D1E51D55605CCE812068CDDC347D0239515000000000000000000000064000000000000000000000000000000000000000000F450F450F4500600000300000000000000000000" - + # "1707070c161800000000000000000000000000000000000000000000000000000000000000000000000000000000000000e0c000808e41778cf83df450f450f4500000000000000000000000000000131123600020000000524844557691e700cb054c054a05a10001" sensor_frame =[ # 11 13 55 AA 02 00 10 11 00 00 00 DA 06 02 07 '131123600020000000524844557691E700CB054C054A05A10001\ @@ -138,6 +138,104 @@ class MyBuf: return ret pass +class ProfilerBuf: + '''一次测量三个传感器数据打一个包''' + def __init__(self,) -> None: + self.__buf = b'' + self.__head = {} + self.__begin_sign = b'\x23' + self.__end_sign = b'\x0D' + self.send_head = b'\x11\x13\x55\xAA' + self.send_id = 2 # 2byte 地位在前 + self.send_type = 0 # info 0 data 1 pic 2 + self.send_num = 0 # 一次测量最多十六次平均 + self.send_con = 0 # 总的测量序号 4byte ,16次平均算几次?每次算一个 + self.send_size = 0 #字节数 2byte + self.send_packet_con = 0 + self.send_packet_all = 0 + + self.repeat = 0 # 依据这个拆包 + self.groups = 0 + + self.state = 0 + + def readFile2Buf(self, fpath) -> None: + with open(fpath,"rb") as f: + self.__buf = f.read() + pass + pass + + def read_buf(self, size: int) -> bytes: + if size > self.__buf.__len__(): + return b'' + ret = self.__buf[0:size] + self.__buf = self.__buf[size:] + return ret + + def write_buf(self, buf: bytes) -> None: + len = buf.__len__() + # logging.info(f'Received ID:{id} Size:{len}') + self.__buf = self.__buf+buf + + def get_buf_size(self) -> int: + return self.__buf.__len__() + + def back_bytes(self, buf: bytes) -> None: + self.__buf = buf+self.__buf + + def reset_head(self) -> None: + self.__head = {} + + def reset_buf(self) -> None: + self.__buf = b'' + + def get_info_cnt(self, mode= 0, len=0) -> None: + ret = b'' + if mode == 0: + ret = self.read_buf(len) + else: + ret = self.read_buf(len) + + return ret + + def pack_info_send(self,): + length = 26 + ret = self.self.read_buf(26) + id = self.send_id.to_bytes(2, byteorder='little') + self.send_type = 0 + type_num = (self.send_type *16 + self.send_num).to_bytes(1,byteorder='little' ) # ?? + con = self.send_con.to_bytes(4, byteorder='little') + size = length.to_bytes(2, byteorder='little') + packet_con = self.send_packet_con.to_bytes(1,byteorder='little' ) + packet_all = self.send_packet_all.to_bytes(1,byteorder='little' ) + ret = self.send_head + id + type_num + con + size + packet_con + packet_all +ret + self.send_packet_con += 1 + + # 取重复次数和测量间隔 + return ret + + def pack_handheld_send(self,): + length = 26+576+576+576 + ret = self.read_buf(length) + id = self.send_id.to_bytes(2, byteorder='little') + self.send_type = 1 + type_num = self.send_type << 4 + self.send_num # ?? + con = self.send_con.to_bytes(4, byteorder='little') + size = length.to_bytes(2, byteorder='little') + packet_con = self.send_packet_con.to_bytes(1,byteorder='little' ) + packet_all = self.send_packet_all.to_bytes(1,byteorder='little' ) + ret = self.send_head + id + type_num + con + size + packet_con + packet_all +ret + self.send_con+=1 # 总测量序号+1 + self.send_num += 1 # 是平均中的第几次 + self.send_packet_con += 1 + return ret + pass + + def pack_end_send(self,): + ret = b'\x11\x13\x55\xAA\x02\x00\xFF\x11\x00\x00\x00\x00\x00\x00\x00' + return ret + pass + class TcpProfiler(object): def __init__(self ): super(TcpProfiler, self).__init__() @@ -181,7 +279,6 @@ class TcpProfiler(object): except KeyboardInterrupt as e: print(f" == ctrl +c , exit") - def send_info(self,): buf = bytes.fromhex (INFO_HEADER+ DataContent.info_frame) self.flag = False @@ -189,7 +286,6 @@ class TcpProfiler(object): print(f"head ....{self.head.hex()}") self.send_rcv(buf) - def send_data(self,): buf = b'' buf = bytes.fromhex (DATA_HEADER+ DataContent.sensor_frame[0]) @@ -205,30 +301,73 @@ class TcpProfiler(object): # print(f"head ....{self.head.hex()} ") # self.send_rcv(buf) + def send_profiler_frame(self,num): + '''一次三个传感器数据作为一帧''' + buf = b'' + buf = bytes.fromhex (DATA_HEADER+ DataContent.sensor_frame[0]) + self.flag = False + self.head = buf[:15] + print(f"head ....{self.head.hex()}") + self.send_rcv(buf) + for i in range( num ): + i = i%256 + print( "sensorframe..." ) + buf = bytes.fromhex ( DataContent.sensor_frame[i] ) + self.flag = False + self.head = buf[:15] + print(f"head ....{self.head.hex()} ") + self.send_rcv(buf) + def send_end_frame(self,): buf = bytes.fromhex (DataContent.end_frame) self.flag = False self.head = buf[:15] print(f"head ....{self.head.hex()}") self.send_rcv(buf) + + def send_protocol_head(self,): + pass + if __name__ == '__main__': + pass # print( bytes.fromhex (DataContent.info_frame) ) - tp = TcpProfiler() - tp.connect() + th = TcpProfiler() + th.connect() - try : - while True: - tp.send_info() + send_num = 10; - tp.send_data() + try : + th.send_info() + print("send info frame...") + time.sleep( 10) + except KeyboardInterrupt as e: + print(e) - tp.send_end_frame() + try : + th.send_data() + print("send sensor frame...") + time.sleep( 10) + except KeyboardInterrupt as e: + print(e) - time.sleep( 10) + try : + th.send_end_frame() + print("send end frame...") + time.sleep( 10) except KeyboardInterrupt as e: print(e) - tp.disconnect( ) + th.disconnect( ) + + # with open("info.bin","rb") as f: + # d = f.read() + # print(d.hex()) + +''' +131123600020000000524844557691e700cb054c054a05a10001 +23a000300700000a07fd062a073707440750074d074c07530759075a07610765076a07720790079107a407c3070709be0aac0abf080f080808270849089e0880094f0bb70f2a190123a000300600005223cd28242b3830e235813be9401b46675a3181c68d5c7916715d74c676617658742e71b26c9c674363da5f1c5e0160f164df66a262f85ad153764e4f4c014d0123a00030050000ea4d8c4d314df44d3c4fc250e453ba5e4486b8c5bcecc4d29a96436bfa56734e4b4a55473446364a845140582a5a9c55a54d91465440303c1b3fde5783718e700123a00030040000dc565046c140f63d21392e32d12b5b28a226f3253525662366219e20dd1fb11e971dc51c2f1c901b921a6419c21882185818e418181b401dec1c1d1a3917f7150123a00030030000ee153316f516ca176e18b218ca18b118701845186a1730155913e51314153015e1146c1420147d13c11208128c1128113011bf121614db12f70f3b0ee50d320e0123a00030020000fd0d3c0d930c470c0d0cb80b710b1e0bcd0a920a560a1f0a000a140a460a3e0ad0097a096c095f092109b60870085f0834082b081c0808080b08dd07b90795070123a000300100007007620755074a0740074c074607460748074a07500758075d0757074f0743075f0756075f0758074f073f07240745076207770756073f072a070907e606d6060123a00030000000f3060f07250722072e07200703070b07ec06ff0619073e07590734071807190719070a07e106dd06f006ec061b072f073e073e07220725070b07f806c806de060123a000300700000a07fd062a073707440750074d074c07530759075a07610765076a07720790079107a407c3070709be0aac0abf080f080808270849089e0880094f0bb70f2a190123a000300600005223cd28242b3830e235813be9401b46675a3181c68d5c7916715d74c676617658742e71b26c9c674363da5f1c5e0160f164df66a262f85ad153764e4f4c014d0123a00030050000ea4d8c4d314df44d3c4fc250e453ba5e4486b8c5bcecc4d29a96436bfa56734e4b4a55473446364a845140582a5a9c55a54d91465440303c1b3fde5783718e700123a00030040000dc565046c140f63d21392e32d12b5b28a226f3253525662366219e20dd1fb11e971dc51c2f1c901b921a6419c21882185818e418181b401dec1c1d1a3917f7150123a00030030000ee153316f516ca176e18b218ca18b118701845186a1730155913e51314153015e1146c1420147d13c11208128c1128113011bf121614db12f70f3b0ee50d320e0123a00030020000fd0d3c0d930c470c0d0cb80b710b1e0bcd0a920a560a1f0a000a140a460a3e0ad0097a096c095f092109b60870085f0834082b081c0808080b08dd07b90795070123a000300100007007620755074a0740074c074607460748074a07500758075d0757074f0743075f0756075f0758074f073f07240745076207770756073f072a070907e606d6060123a00030000000f3060f07250722072e07200703070b07ec06ff0619073e07590734071807190719070a07e106dd06f006ec061b072f073e073e07220725070b07f806c806de060123a000300700000a07fd062a073707440750074d074c07530759075a07610765076a07720790079107a407c3070709be0aac0abf080f080808270849089e0880094f0bb70f2a190123a000300600005223cd28242b3830e235813be9401b46675a3181c68d5c7916715d74c676617658742e71b26c9c674363da5f1c5e0160f164df66a262f85ad153764e4f4c014d0123a00030050000ea4d8c4d314df44d3c4fc250e453ba5e4486b8c5bcecc4d29a96436bfa56734e4b4a55473446364a845140582a5a9c55a54d91465440303c1b3fde5783718e700123a00030040000dc565046c140f63d21392e32d12b5b28a226f3253525662366219e20dd1fb11e971dc51c2f1c901b921a6419c21882185818e418181b401dec1c1d1a3917f7150123a00030030000ee153316f516ca176e18b218ca18b118701845186a1730155913e51314153015e1146c1420147d13c11208128c1128113011bf121614db12f70f3b0ee50d320e0123a00030020000fd0d3c0d930c470c0d0cb80b710b1e0bcd0a920a560a1f0a000a140a460a3e0ad0097a096c095f092109b60870085f0834082b081c0808080b08dd07b90795070123a000300100007007620755074a0740074c074607460748074a07500758075d0757074f0743075f0756075f0758074f073f07240745076207770756073f072a070907e606d6060123a00030000000f3060f07250722072e07200703070b07ec06ff0619073e07590734071807190719070a07e106dd06f006ec061b072f073e073e07220725070b07f806c806de +1707070c161800000000000000000000000000000000000000000000000000000000000000000000000000000000000000e0c000808e41778cf83df450f450f4500000000000000000000000000000131123600020000000524844557691e700cb054c054a05a10001 +''' \ No newline at end of file