2929}
3030
3131from .sciopy_dataclasses import EitMeasurementSetup
32- from sciopydev .sciopy .usb_message_parser import MessageParser , make_eitframes_hex , get_data_as_matrix
32+ from sciopydev .sciopy .usb_message_parser import (MessageParser , make_eitframes_hex , get_data_as_matrix ,
33+ make_results_folder )
3334
3435
3536class EIT_16_32_64_128 :
@@ -581,7 +582,7 @@ def StartStopMeasurementFast(self, return_as="pot_mat"):
581582 elif return_as == "pot_mat" :
582583 return self .get_data_as_matrix ()
583584
584- #todo check
585+
585586 def StartStopMeasurementNew (self , timeout :int = 0 , return_as = "pot_mat" , bSaveData :bool = False , bDeleteData :bool = False ,
586587 sSavepath :str = "C/" , bResultsFolder = True ):
587588 """
@@ -599,8 +600,8 @@ def StartStopMeasurementNew(self, timeout:int=0, return_as="pot_mat", bSaveData:
599600 - "pot_mat": Returns the processed data as a matrix using `get_data_as_matrix()`.
600601 Default is "pot_mat".
601602 - else: data is only stored
602- bSaveData (bool): Specifies if a the measured data is saved in NPZ format
603- bDeleteData (bool): Specifies if a the measured data is deleted out of memory after each EITframe, with
603+ bSaveData (bool): Specifies if the measured data is saved in NPZ format
604+ bDeleteData (bool): Specifies if the measured data is deleted out of memory after each EITframe, with
604605 bSaveData=True, measured data is saved and then removed from RAM
605606 sSavepath (str): Specifies the sPath where the measured data is saved.
606607
@@ -610,14 +611,13 @@ def StartStopMeasurementNew(self, timeout:int=0, return_as="pot_mat", bSaveData:
610611
611612 # Start measurement
612613 self .cMessageParser .clear_out_data ()
613- if bResultsFolder :
614- self .cMessageParser .make_results_folder (bResultsFolder , bSaveData , sSavepath )
614+ sCurrentPath = make_results_folder (bResultsFolder , bSaveData , sSavepath ) # No new path is created if bResultsFolder=False
615615
616616 self .send_message (bytearray ([0xB4 , 0x01 , 0x01 , 0xB4 ]))
617617 self .cMessageParser .bPrintMessages = False
618618 if timeout != 0 :
619619 self .cMessageParser .read_usb_for_seconds (timeout , bSaveData = bSaveData , bDeleteDataFrame = bDeleteData ,
620- sSavePath = sSavepath ,bResultsFolder = False )
620+ sSavePath = sCurrentPath ,bResultsFolder = False )
621621 else :
622622 if self .setup .burst_count == 0 :
623623 print ("Burst count for this setup needs to be >=1" )
@@ -628,7 +628,7 @@ def StartStopMeasurementNew(self, timeout:int=0, return_as="pot_mat", bSaveData:
628628 self .send_message (bytearray ([0xB4 , 0x01 , 0x00 , 0xB4 ]))
629629 # All data is returned if wanted
630630 data = self .cMessageParser .read_usb_till_timeout (bSaveData = bSaveData , bDeleteDataFrame = bDeleteData ,
631- sSavePath = sSavepath , bResultsFolder = False )
631+ sSavePath = sCurrentPath , bResultsFolder = False )
632632
633633 if bDeleteData :
634634 return
@@ -639,6 +639,8 @@ def StartStopMeasurementNew(self, timeout:int=0, return_as="pot_mat", bSaveData:
639639 elif return_as == "eitframe" :
640640 return data
641641
642+
643+
642644 def get_data_as_matrix (self ):
643645 """
644646 Converts the raw EIT data into a 3D matrix of potentials.
0 commit comments