@@ -49,10 +49,10 @@ def get_electric_dark_pixel_indices(self) -> list[int]:
49
49
def _spectrum_length (self ) -> int :
50
50
raise NotImplementedError ("implement in derived class" )
51
51
52
- def get_wavelengths (self ) -> NDArray [np .float_ ]:
52
+ def get_wavelengths (self ) -> NDArray [np .float64 ]:
53
53
raise NotImplementedError ("implement in derived class" )
54
54
55
- def get_intensities (self ) -> NDArray [np .float_ ]:
55
+ def get_intensities (self ) -> NDArray [np .float64 ]:
56
56
raise NotImplementedError ("implement in derived class" )
57
57
58
58
def _get_spectrum_raw (self ) -> NDArray [np .uint8 ]:
@@ -138,7 +138,7 @@ def get_electric_dark_pixel_indices(self) -> list[int]:
138
138
def _spectrum_length (self ) -> int :
139
139
return self ._spectrum_num_pixel
140
140
141
- def get_wavelengths (self ) -> NDArray [np .float_ ]:
141
+ def get_wavelengths (self ) -> NDArray [np .float64 ]:
142
142
indices = numpy .arange (self ._spectrum_length , dtype = numpy .float64 )
143
143
# OOI spectrometers store the wavelength calibration in slots 1,2,3,4
144
144
coeffs = []
@@ -149,7 +149,7 @@ def get_wavelengths(self) -> NDArray[np.float_]:
149
149
)
150
150
return sum (wl * (indices ** i ) for i , wl in enumerate (coeffs )) # type: ignore
151
151
152
- def get_intensities (self ) -> NDArray [np .float_ ]:
152
+ def get_intensities (self ) -> NDArray [np .float64 ]:
153
153
tmp = self ._get_spectrum_raw ()
154
154
ret = tmp [:- 1 ].view (numpy .dtype ("<H" )).astype (numpy .double )
155
155
return ret * self ._normalization_value
@@ -182,7 +182,7 @@ def get_fast_buffer_spectrum(self) -> Any:
182
182
183
183
184
184
class SeaBreezeSpectrometerFeatureOOI2K (SeaBreezeSpectrometerFeatureOOI ):
185
- def get_intensities (self ) -> NDArray [np .float_ ]:
185
+ def get_intensities (self ) -> NDArray [np .float64 ]:
186
186
tmp = self ._get_spectrum_raw ()
187
187
# The byte order is different for some models
188
188
N_raw = self ._spectrum_raw_length - 1
@@ -414,7 +414,7 @@ def get_electric_dark_pixel_indices(self) -> list[int]:
414
414
def _spectrum_length (self ) -> int :
415
415
return self ._spectrum_num_pixel
416
416
417
- def get_wavelengths (self ) -> NDArray [np .float_ ]:
417
+ def get_wavelengths (self ) -> NDArray [np .float64 ]:
418
418
# get number of wavelength coefficients
419
419
data = self .protocol .query (0x00180100 )
420
420
N = struct .unpack ("<B" , data )[0 ]
@@ -427,10 +427,10 @@ def get_wavelengths(self) -> NDArray[np.float_]:
427
427
indices = numpy .arange (self ._spectrum_length , dtype = numpy .float64 )
428
428
return sum (wl * (indices ** i ) for i , wl in enumerate (coeffs )) # type: ignore
429
429
430
- def get_intensities (self ) -> NDArray [np .float_ ]:
430
+ def get_intensities (self ) -> NDArray [np .float64 ]:
431
431
tmp = self ._get_spectrum_raw ()
432
432
arr = struct .unpack ("<" + "H" * self ._spectrum_length , tmp ) # type: ignore
433
- return numpy .array (arr , dtype = numpy .float_ )
433
+ return numpy .array (arr , dtype = numpy .float64 )
434
434
435
435
def _get_spectrum_raw (self ) -> NDArray [np .uint8 ]:
436
436
timeout = int (
@@ -457,7 +457,7 @@ class SeaBreezeSpectrometerFeatureHR2000(SeaBreezeSpectrometerFeatureOOI2K):
457
457
458
458
459
459
class SeaBreezeSpectrometerFeatureHR4000 (SeaBreezeSpectrometerFeatureOOIFPGA4K ):
460
- def get_intensities (self ) -> NDArray [np .float_ ]:
460
+ def get_intensities (self ) -> NDArray [np .float64 ]:
461
461
tmp = self ._get_spectrum_raw ()
462
462
# The HR4000 needs to xor with 0x2000
463
463
ret = tmp [:- 1 ].view (numpy .dtype ("<H" )) ^ 0x2000
@@ -469,15 +469,15 @@ class SeaBreezeSpectrometerFeatureUSB650(SeaBreezeSpectrometerFeatureOOI2K):
469
469
470
470
471
471
class SeaBreezeSpectrometerFeatureHR2000PLUS (SeaBreezeSpectrometerFeatureOOIFPGA ):
472
- def get_intensities (self ) -> NDArray [np .float_ ]:
472
+ def get_intensities (self ) -> NDArray [np .float64 ]:
473
473
tmp = self ._get_spectrum_raw ()
474
474
# The HR2000PLUS needs to xor with 0x2000
475
475
ret = tmp [:- 1 ].view (numpy .dtype ("<H" )) ^ 0x2000
476
476
return ret .astype (numpy .double ) * self ._normalization_value
477
477
478
478
479
479
class SeaBreezeSpectrometerFeatureQE65000 (SeaBreezeSpectrometerFeatureOOIFPGA ):
480
- def get_wavelengths (self ) -> NDArray [np .float_ ]:
480
+ def get_wavelengths (self ) -> NDArray [np .float64 ]:
481
481
# QE65000 specific override
482
482
indices = numpy .arange (- 10 , self ._spectrum_length - 10 , dtype = numpy .float64 )
483
483
# OOI spectrometers store the wavelength calibration in slots 1,2,3,4
@@ -491,7 +491,7 @@ def get_wavelengths(self) -> NDArray[np.float_]:
491
491
)
492
492
return sum (wl * (indices ** i ) for i , wl in enumerate (coeffs )) # type: ignore
493
493
494
- def get_intensities (self ) -> NDArray [np .float_ ]:
494
+ def get_intensities (self ) -> NDArray [np .float64 ]:
495
495
tmp = self ._get_spectrum_raw ()
496
496
# The QE65000 needs to xor with 0x8000
497
497
ret = tmp [:- 1 ].view (numpy .dtype ("<H" )) ^ 0x8000
@@ -507,15 +507,15 @@ class SeaBreezeSpectrometerFeatureUSB4000(SeaBreezeSpectrometerFeatureOOIFPGA4KG
507
507
508
508
509
509
class SeaBreezeSpectrometerFeatureNIRQUEST512 (SeaBreezeSpectrometerFeatureOOIGainAlt ):
510
- def get_intensities (self ) -> NDArray [np .float_ ]:
510
+ def get_intensities (self ) -> NDArray [np .float64 ]:
511
511
tmp = self ._get_spectrum_raw ()
512
512
# The NIRQUEST512 needs to xor with 0x8000
513
513
ret = tmp [:- 1 ].view (numpy .dtype ("<H" )) ^ 0x8000
514
514
return ret .astype (numpy .double ) * self ._normalization_value
515
515
516
516
517
517
class SeaBreezeSpectrometerFeatureNIRQUEST256 (SeaBreezeSpectrometerFeatureOOIGainAlt ):
518
- def get_intensities (self ) -> NDArray [np .float_ ]:
518
+ def get_intensities (self ) -> NDArray [np .float64 ]:
519
519
tmp = self ._get_spectrum_raw ()
520
520
# The NIRQUEST256 needs to xor with 0x8000
521
521
ret = tmp [:- 1 ].view (numpy .dtype ("<H" )) ^ 0x8000
@@ -546,7 +546,7 @@ class SeaBreezeSpectrometerFeatureMAYALSL(SeaBreezeSpectrometerFeatureOOIFPGAGai
546
546
547
547
548
548
class SeaBreezeSpectrometerFeatureJAZ (SeaBreezeSpectrometerFeatureOOIGain ):
549
- def get_intensities (self ) -> NDArray [np .float_ ]:
549
+ def get_intensities (self ) -> NDArray [np .float64 ]:
550
550
tmp = self ._get_spectrum_raw ()
551
551
# XXX: No sync byte for the Jaz
552
552
ret = tmp .view (numpy .dtype ("<H" )).astype (numpy .double )
@@ -565,7 +565,7 @@ def _get_spectrum_raw(self) -> NDArray[np.uint8]:
565
565
datastring = self .protocol .query (0x00100928 , timeout_ms = timeout )
566
566
return numpy .frombuffer (datastring , dtype = numpy .uint8 )
567
567
568
- def get_intensities (self ) -> NDArray [np .float_ ]:
568
+ def get_intensities (self ) -> NDArray [np .float64 ]:
569
569
tmp = self ._get_spectrum_raw ()
570
570
# 32byte metadata block at beginning
571
571
ret = tmp [32 :].view (numpy .dtype ("<I" )).astype (numpy .double )
@@ -595,7 +595,7 @@ class SeaBreezeSpectrometerFeatureADC(SeaBreezeSpectrometerFeatureOOI):
595
595
_required_protocol_cls = ADCProtocol
596
596
_eeprom_cls = SeaBreezeEEPromFeatureADC
597
597
598
- def get_intensities (self ) -> NDArray [np .float_ ]:
598
+ def get_intensities (self ) -> NDArray [np .float64 ]:
599
599
tmp = self ._get_spectrum_raw ()
600
600
# The byte order is different for some models
601
601
N_raw = self ._spectrum_raw_length - 1
@@ -613,7 +613,7 @@ def _get_spectrum_raw(self) -> NDArray[np.uint8]:
613
613
datastring = self .protocol .query (0x000_01C_00 , timeout_ms = timeout )
614
614
return numpy .frombuffer (datastring , dtype = numpy .uint8 )
615
615
616
- def get_intensities (self ) -> NDArray [np .float_ ]:
616
+ def get_intensities (self ) -> NDArray [np .float64 ]:
617
617
tmp = self ._get_spectrum_raw ()
618
618
# 32byte metadata block at beginning
619
619
ret = tmp [32 :].view (numpy .dtype ("<H" )).astype (numpy .double )
@@ -635,7 +635,7 @@ def set_integration_time_micros(self, integration_time_micros: int) -> None:
635
635
else :
636
636
raise SeaBreezeError (f"Integration not in [{ t_min :d} , { t_max :d} ]" )
637
637
638
- def get_wavelengths (self ) -> NDArray [np .float_ ]:
638
+ def get_wavelengths (self ) -> NDArray [np .float64 ]:
639
639
data = self .protocol .query (0x000_011_00 )
640
640
num_coeffs = len (data ) // 4
641
641
assert len (data ) % 4 == 0 # ???
@@ -654,7 +654,7 @@ def _get_spectrum_raw(self) -> NDArray[np.uint8]:
654
654
datastring = self .protocol .query (0x000_01C_00 , timeout_ms = timeout )
655
655
return numpy .frombuffer (datastring , dtype = numpy .uint8 )
656
656
657
- def get_intensities (self ) -> NDArray [np .float_ ]:
657
+ def get_intensities (self ) -> NDArray [np .float64 ]:
658
658
tmp = self ._get_spectrum_raw ()
659
659
# 32byte metadata block at beginning
660
660
ret = tmp [32 :].view (numpy .dtype ("<H" )).astype (numpy .double )
@@ -676,7 +676,7 @@ def set_integration_time_micros(self, integration_time_micros: int) -> None:
676
676
else :
677
677
raise SeaBreezeError (f"Integration not in [{ t_min :d} , { t_max :d} ]" )
678
678
679
- def get_wavelengths (self ) -> NDArray [np .float_ ]:
679
+ def get_wavelengths (self ) -> NDArray [np .float64 ]:
680
680
data = self .protocol .query (0x000_011_00 )
681
681
num_coeffs = len (data ) // 4
682
682
assert len (data ) % 4 == 0 # ???
@@ -707,7 +707,7 @@ def _get_spectrum_raw(self) -> NDArray[np.uint8]:
707
707
datastring = self .protocol .query (0x000_01C_00 , timeout_ms = timeout )
708
708
return numpy .frombuffer (datastring , dtype = numpy .uint8 )
709
709
710
- def get_intensities (self ) -> NDArray [np .float_ ]:
710
+ def get_intensities (self ) -> NDArray [np .float64 ]:
711
711
tmp = self ._get_spectrum_raw ()
712
712
# 32byte metadata block at beginning
713
713
ret = tmp [32 :].view (numpy .dtype ("<H" )).astype (numpy .double )
@@ -729,7 +729,7 @@ def set_integration_time_micros(self, integration_time_micros: int) -> None:
729
729
else :
730
730
raise SeaBreezeError (f"Integration not in [{ t_min :d} , { t_max :d} ]" )
731
731
732
- def get_wavelengths (self ) -> NDArray [np .float_ ]:
732
+ def get_wavelengths (self ) -> NDArray [np .float64 ]:
733
733
data = self .protocol .query (0x000_011_00 )
734
734
num_coeffs = len (data ) // 4
735
735
assert len (data ) % 4 == 0 # ???
0 commit comments