def read_chunk(self): ''' read a chunk of data ''' if not self.file_open: counted_file_parser.open_counted_file(self.filename) counted_file_parser.read_metadata() self.file_open = True # read the chunk triplet_count = counted_file_parser.read_chunk() # send all the rates to the curves for curve in self.curves: rate = 0 pattern = curve.pattern if pattern[1] == 1: rate = counted_file_parser.get_fpga_rate(pattern[0]) if pattern[1] == 2: rate = counted_file_parser.get_number_rate(*pattern[0]) if pattern[1] == 3: rate = counted_file_parser.get_special_rate(len(pattern[0])) position = counted_file_parser.get_motor_controller_position( self.scan_motor_controller) step = counted_file_parser.get_scan_step() loop = counted_file_parser.get_scan_loop() curve.add_rate(step, loop, position, rate) return triplet_count
def get_metadata(self): ''' read all the metadata ''' counted_file_parser.open_counted_file(self.filename) counted_file_parser.read_metadata() self.scan_label=counted_file_parser.get_scan_label() self.scan_nloops=counted_file_parser.get_scan_nloops() self.scan_npoints=counted_file_parser.get_scan_npoints() self.scan_integration_time=counted_file_parser.get_scan_integration_time() self.scan_close_shutter=counted_file_parser.get_scan_close_shutter() self.scan_dont_move=counted_file_parser.get_scan_dont_move() self.scan_motor_controller=counted_file_parser.get_scan_motor_controller() self.scan_start_postion=counted_file_parser.get_scan_start_position() self.scan_stop_position=counted_file_parser.get_scan_stop_position() counted_file_parser.close_counted_file() self.file_open=False
def get_metadata(self): ''' read all the metadata ''' counted_file_parser.open_counted_file(self.filename) counted_file_parser.read_metadata() self.scan_label = counted_file_parser.get_scan_label() self.scan_nloops = counted_file_parser.get_scan_nloops() self.scan_npoints = counted_file_parser.get_scan_npoints() self.scan_integration_time = counted_file_parser.get_scan_integration_time( ) self.scan_close_shutter = counted_file_parser.get_scan_close_shutter() self.scan_dont_move = counted_file_parser.get_scan_dont_move() self.scan_motor_controller = counted_file_parser.get_scan_motor_controller( ) self.scan_start_postion = counted_file_parser.get_scan_start_position() self.scan_stop_position = counted_file_parser.get_scan_stop_position() counted_file_parser.close_counted_file() self.file_open = False
def read_chunk(self): ''' read a chunk of data ''' if not self.file_open: counted_file_parser.open_counted_file(self.filename) counted_file_parser.read_metadata() self.file_open=True # read the chunk triplet_count=counted_file_parser.read_chunk() # if this chunk was aborted, return nothing if counted_file_parser.get_aborted(): return 0 # get the step and loop step=counted_file_parser.get_scan_step() loop=counted_file_parser.get_scan_loop() self.max_step=max(step+1, self.max_step) self.max_loop=max(loop+1, self.max_loop) self.all_triplets+=triplet_count self.progress=self.all_triplets*3*4/float(self.filesize) # append all the rates to the curves for curve in self.curves: rate=0 pattern=curve.pattern if pattern[1]==1: rate=counted_file_parser.get_fpga_rate(pattern[0]) elif pattern[1]==2: if len(pattern[0])==2: rate=counted_file_parser.get_number_rate_8x2(*pattern[0]) if len(pattern[0])==4: rate=counted_file_parser.get_number_rate_4x4(*pattern[0]) elif pattern[1]==3: rate=counted_file_parser.get_special_rate(len(pattern[0])) curve.add_rate(step, loop, rate) # and the position handler for i in range(qy.settings.get('motors.count')): position=counted_file_parser.get_motor_controller_position(i) self.positions[i].add_position(step, loop, position) return triplet_count
def read_chunk(self): ''' read a chunk of data ''' if not self.file_open: counted_file_parser.open_counted_file(self.filename) counted_file_parser.read_metadata() self.file_open=True # read the chunk triplet_count=counted_file_parser.read_chunk() # send all the rates to the curves for curve in self.curves: rate=0 pattern=curve.pattern if pattern[1]==1: rate=counted_file_parser.get_fpga_rate(pattern[0]) if pattern[1]==2: rate=counted_file_parser.get_number_rate(*pattern[0]) if pattern[1]==3: rate=counted_file_parser.get_special_rate(len(pattern[0])) position=counted_file_parser.get_motor_controller_position(self.scan_motor_controller) step=counted_file_parser.get_scan_step() loop=counted_file_parser.get_scan_loop() curve.add_rate(step, loop, position, rate) return triplet_count