|
|
|
@ -28,6 +28,7 @@ class Ramses(object): |
|
|
|
@Returns : realWavelength Intensity |
|
|
|
@Returns : realWavelength Intensity |
|
|
|
""" |
|
|
|
""" |
|
|
|
self.buf = b'' |
|
|
|
self.buf = b'' |
|
|
|
|
|
|
|
self.mode = 0 # 默认0 空气中,1:水中 |
|
|
|
self.it = None |
|
|
|
self.it = None |
|
|
|
self.light_int = None # 未标定的整数值 |
|
|
|
self.light_int = None # 未标定的整数值 |
|
|
|
self.spectrum = None # 光谱强度 |
|
|
|
self.spectrum = None # 光谱强度 |
|
|
|
@ -43,6 +44,10 @@ class Ramses(object): |
|
|
|
self.buf = buf |
|
|
|
self.buf = buf |
|
|
|
pass |
|
|
|
pass |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def setMode(self, mode=1): |
|
|
|
|
|
|
|
self.mode = 1 |
|
|
|
|
|
|
|
pass |
|
|
|
|
|
|
|
|
|
|
|
def setCalCfg(self, d: dict): |
|
|
|
def setCalCfg(self, d: dict): |
|
|
|
self.cal_cfg = d |
|
|
|
self.cal_cfg = d |
|
|
|
pass |
|
|
|
pass |
|
|
|
@ -136,7 +141,11 @@ class Ramses(object): |
|
|
|
Cn, int(self.cal_cfg['DarkPixelStart']), int(self.cal_cfg['DarkPixelStop'])) |
|
|
|
Cn, int(self.cal_cfg['DarkPixelStart']), int(self.cal_cfg['DarkPixelStop'])) |
|
|
|
Dn = Cn-Offset |
|
|
|
Dn = Cn-Offset |
|
|
|
En = Dn * (t0/self.it) |
|
|
|
En = Dn * (t0/self.it) |
|
|
|
Fn = En/np.asarray(self.cal_cfg["cal"], dtype=float) # 空气或水中的标定文件 |
|
|
|
if self.mode == 0: |
|
|
|
|
|
|
|
Fn = En/np.asarray(self.cal_cfg["cal"], dtype=float) # 空气的标定文件 |
|
|
|
|
|
|
|
else: |
|
|
|
|
|
|
|
Fn = En/np.asarray(self.cal_cfg["calaq"], dtype=float) # 水中的标定文件 |
|
|
|
|
|
|
|
|
|
|
|
self.spectrum = Fn |
|
|
|
self.spectrum = Fn |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|