@@ -49,10 +49,10 @@ def get_electric_dark_pixel_indices(self) -> list[int]:
4949 def _spectrum_length (self ) -> int :
5050 raise NotImplementedError ("implement in derived class" )
5151
52- def get_wavelengths (self ) -> NDArray [np .float_ ]:
52+ def get_wavelengths (self ) -> NDArray [np .float64 ]:
5353 raise NotImplementedError ("implement in derived class" )
5454
55- def get_intensities (self ) -> NDArray [np .float_ ]:
55+ def get_intensities (self ) -> NDArray [np .float64 ]:
5656 raise NotImplementedError ("implement in derived class" )
5757
5858 def _get_spectrum_raw (self ) -> NDArray [np .uint8 ]:
@@ -138,7 +138,7 @@ def get_electric_dark_pixel_indices(self) -> list[int]:
138138 def _spectrum_length (self ) -> int :
139139 return self ._spectrum_num_pixel
140140
141- def get_wavelengths (self ) -> NDArray [np .float_ ]:
141+ def get_wavelengths (self ) -> NDArray [np .float64 ]:
142142 indices = numpy .arange (self ._spectrum_length , dtype = numpy .float64 )
143143 # OOI spectrometers store the wavelength calibration in slots 1,2,3,4
144144 coeffs = []
@@ -149,7 +149,7 @@ def get_wavelengths(self) -> NDArray[np.float_]:
149149 )
150150 return sum (wl * (indices ** i ) for i , wl in enumerate (coeffs )) # type: ignore
151151
152- def get_intensities (self ) -> NDArray [np .float_ ]:
152+ def get_intensities (self ) -> NDArray [np .float64 ]:
153153 tmp = self ._get_spectrum_raw ()
154154 ret = tmp [:- 1 ].view (numpy .dtype ("<H" )).astype (numpy .double )
155155 return ret * self ._normalization_value
@@ -182,7 +182,7 @@ def get_fast_buffer_spectrum(self) -> Any:
182182
183183
184184class SeaBreezeSpectrometerFeatureOOI2K (SeaBreezeSpectrometerFeatureOOI ):
185- def get_intensities (self ) -> NDArray [np .float_ ]:
185+ def get_intensities (self ) -> NDArray [np .float64 ]:
186186 tmp = self ._get_spectrum_raw ()
187187 # The byte order is different for some models
188188 N_raw = self ._spectrum_raw_length - 1
@@ -414,7 +414,7 @@ def get_electric_dark_pixel_indices(self) -> list[int]:
414414 def _spectrum_length (self ) -> int :
415415 return self ._spectrum_num_pixel
416416
417- def get_wavelengths (self ) -> NDArray [np .float_ ]:
417+ def get_wavelengths (self ) -> NDArray [np .float64 ]:
418418 # get number of wavelength coefficients
419419 data = self .protocol .query (0x00180100 )
420420 N = struct .unpack ("<B" , data )[0 ]
@@ -427,10 +427,10 @@ def get_wavelengths(self) -> NDArray[np.float_]:
427427 indices = numpy .arange (self ._spectrum_length , dtype = numpy .float64 )
428428 return sum (wl * (indices ** i ) for i , wl in enumerate (coeffs )) # type: ignore
429429
430- def get_intensities (self ) -> NDArray [np .float_ ]:
430+ def get_intensities (self ) -> NDArray [np .float64 ]:
431431 tmp = self ._get_spectrum_raw ()
432432 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 )
434434
435435 def _get_spectrum_raw (self ) -> NDArray [np .uint8 ]:
436436 timeout = int (
@@ -457,7 +457,7 @@ class SeaBreezeSpectrometerFeatureHR2000(SeaBreezeSpectrometerFeatureOOI2K):
457457
458458
459459class SeaBreezeSpectrometerFeatureHR4000 (SeaBreezeSpectrometerFeatureOOIFPGA4K ):
460- def get_intensities (self ) -> NDArray [np .float_ ]:
460+ def get_intensities (self ) -> NDArray [np .float64 ]:
461461 tmp = self ._get_spectrum_raw ()
462462 # The HR4000 needs to xor with 0x2000
463463 ret = tmp [:- 1 ].view (numpy .dtype ("<H" )) ^ 0x2000
@@ -469,15 +469,15 @@ class SeaBreezeSpectrometerFeatureUSB650(SeaBreezeSpectrometerFeatureOOI2K):
469469
470470
471471class SeaBreezeSpectrometerFeatureHR2000PLUS (SeaBreezeSpectrometerFeatureOOIFPGA ):
472- def get_intensities (self ) -> NDArray [np .float_ ]:
472+ def get_intensities (self ) -> NDArray [np .float64 ]:
473473 tmp = self ._get_spectrum_raw ()
474474 # The HR2000PLUS needs to xor with 0x2000
475475 ret = tmp [:- 1 ].view (numpy .dtype ("<H" )) ^ 0x2000
476476 return ret .astype (numpy .double ) * self ._normalization_value
477477
478478
479479class SeaBreezeSpectrometerFeatureQE65000 (SeaBreezeSpectrometerFeatureOOIFPGA ):
480- def get_wavelengths (self ) -> NDArray [np .float_ ]:
480+ def get_wavelengths (self ) -> NDArray [np .float64 ]:
481481 # QE65000 specific override
482482 indices = numpy .arange (- 10 , self ._spectrum_length - 10 , dtype = numpy .float64 )
483483 # OOI spectrometers store the wavelength calibration in slots 1,2,3,4
@@ -491,7 +491,7 @@ def get_wavelengths(self) -> NDArray[np.float_]:
491491 )
492492 return sum (wl * (indices ** i ) for i , wl in enumerate (coeffs )) # type: ignore
493493
494- def get_intensities (self ) -> NDArray [np .float_ ]:
494+ def get_intensities (self ) -> NDArray [np .float64 ]:
495495 tmp = self ._get_spectrum_raw ()
496496 # The QE65000 needs to xor with 0x8000
497497 ret = tmp [:- 1 ].view (numpy .dtype ("<H" )) ^ 0x8000
@@ -507,15 +507,15 @@ class SeaBreezeSpectrometerFeatureUSB4000(SeaBreezeSpectrometerFeatureOOIFPGA4KG
507507
508508
509509class SeaBreezeSpectrometerFeatureNIRQUEST512 (SeaBreezeSpectrometerFeatureOOIGainAlt ):
510- def get_intensities (self ) -> NDArray [np .float_ ]:
510+ def get_intensities (self ) -> NDArray [np .float64 ]:
511511 tmp = self ._get_spectrum_raw ()
512512 # The NIRQUEST512 needs to xor with 0x8000
513513 ret = tmp [:- 1 ].view (numpy .dtype ("<H" )) ^ 0x8000
514514 return ret .astype (numpy .double ) * self ._normalization_value
515515
516516
517517class SeaBreezeSpectrometerFeatureNIRQUEST256 (SeaBreezeSpectrometerFeatureOOIGainAlt ):
518- def get_intensities (self ) -> NDArray [np .float_ ]:
518+ def get_intensities (self ) -> NDArray [np .float64 ]:
519519 tmp = self ._get_spectrum_raw ()
520520 # The NIRQUEST256 needs to xor with 0x8000
521521 ret = tmp [:- 1 ].view (numpy .dtype ("<H" )) ^ 0x8000
@@ -546,7 +546,7 @@ class SeaBreezeSpectrometerFeatureMAYALSL(SeaBreezeSpectrometerFeatureOOIFPGAGai
546546
547547
548548class SeaBreezeSpectrometerFeatureJAZ (SeaBreezeSpectrometerFeatureOOIGain ):
549- def get_intensities (self ) -> NDArray [np .float_ ]:
549+ def get_intensities (self ) -> NDArray [np .float64 ]:
550550 tmp = self ._get_spectrum_raw ()
551551 # XXX: No sync byte for the Jaz
552552 ret = tmp .view (numpy .dtype ("<H" )).astype (numpy .double )
@@ -565,7 +565,7 @@ def _get_spectrum_raw(self) -> NDArray[np.uint8]:
565565 datastring = self .protocol .query (0x00100928 , timeout_ms = timeout )
566566 return numpy .frombuffer (datastring , dtype = numpy .uint8 )
567567
568- def get_intensities (self ) -> NDArray [np .float_ ]:
568+ def get_intensities (self ) -> NDArray [np .float64 ]:
569569 tmp = self ._get_spectrum_raw ()
570570 # 32byte metadata block at beginning
571571 ret = tmp [32 :].view (numpy .dtype ("<I" )).astype (numpy .double )
@@ -595,7 +595,7 @@ class SeaBreezeSpectrometerFeatureADC(SeaBreezeSpectrometerFeatureOOI):
595595 _required_protocol_cls = ADCProtocol
596596 _eeprom_cls = SeaBreezeEEPromFeatureADC
597597
598- def get_intensities (self ) -> NDArray [np .float_ ]:
598+ def get_intensities (self ) -> NDArray [np .float64 ]:
599599 tmp = self ._get_spectrum_raw ()
600600 # The byte order is different for some models
601601 N_raw = self ._spectrum_raw_length - 1
@@ -613,7 +613,7 @@ def _get_spectrum_raw(self) -> NDArray[np.uint8]:
613613 datastring = self .protocol .query (0x000_01C_00 , timeout_ms = timeout )
614614 return numpy .frombuffer (datastring , dtype = numpy .uint8 )
615615
616- def get_intensities (self ) -> NDArray [np .float_ ]:
616+ def get_intensities (self ) -> NDArray [np .float64 ]:
617617 tmp = self ._get_spectrum_raw ()
618618 # 32byte metadata block at beginning
619619 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:
635635 else :
636636 raise SeaBreezeError (f"Integration not in [{ t_min :d} , { t_max :d} ]" )
637637
638- def get_wavelengths (self ) -> NDArray [np .float_ ]:
638+ def get_wavelengths (self ) -> NDArray [np .float64 ]:
639639 data = self .protocol .query (0x000_011_00 )
640640 num_coeffs = len (data ) // 4
641641 assert len (data ) % 4 == 0 # ???
@@ -654,7 +654,7 @@ def _get_spectrum_raw(self) -> NDArray[np.uint8]:
654654 datastring = self .protocol .query (0x000_01C_00 , timeout_ms = timeout )
655655 return numpy .frombuffer (datastring , dtype = numpy .uint8 )
656656
657- def get_intensities (self ) -> NDArray [np .float_ ]:
657+ def get_intensities (self ) -> NDArray [np .float64 ]:
658658 tmp = self ._get_spectrum_raw ()
659659 # 32byte metadata block at beginning
660660 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:
676676 else :
677677 raise SeaBreezeError (f"Integration not in [{ t_min :d} , { t_max :d} ]" )
678678
679- def get_wavelengths (self ) -> NDArray [np .float_ ]:
679+ def get_wavelengths (self ) -> NDArray [np .float64 ]:
680680 data = self .protocol .query (0x000_011_00 )
681681 num_coeffs = len (data ) // 4
682682 assert len (data ) % 4 == 0 # ???
@@ -707,7 +707,7 @@ def _get_spectrum_raw(self) -> NDArray[np.uint8]:
707707 datastring = self .protocol .query (0x000_01C_00 , timeout_ms = timeout )
708708 return numpy .frombuffer (datastring , dtype = numpy .uint8 )
709709
710- def get_intensities (self ) -> NDArray [np .float_ ]:
710+ def get_intensities (self ) -> NDArray [np .float64 ]:
711711 tmp = self ._get_spectrum_raw ()
712712 # 32byte metadata block at beginning
713713 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:
729729 else :
730730 raise SeaBreezeError (f"Integration not in [{ t_min :d} , { t_max :d} ]" )
731731
732- def get_wavelengths (self ) -> NDArray [np .float_ ]:
732+ def get_wavelengths (self ) -> NDArray [np .float64 ]:
733733 data = self .protocol .query (0x000_011_00 )
734734 num_coeffs = len (data ) // 4
735735 assert len (data ) % 4 == 0 # ???
0 commit comments