#NEWLINE# def set_scan_dir_flag( self , flag ) : #NEWLINE# #INDENT# 'Set the binary field scan_dir_flag in the flag_byte' #NEWLINE# if ( self . header . data_format_id in ( 0 , 1 , 2 , 3 , 4 , 5 ) ) : #NEWLINE# #INDENT# flag_byte = self . get_flag_byte ( ) #NEWLINE# self . raise_if_overflow ( flag , 1 ) #NEWLINE# outByte = self . bitpack ( ( flag_byte , flag , flag_byte ) , ( ( 0 , 6 ) , ( 0 , 1 ) , ( 7 , 8 ) ) ) #NEWLINE# self . set_dimension ( 'flag_byte' , outByte ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( self . header . data_format_id in ( 6 , 7 , 8 , 9 , 10 ) ) : #NEWLINE# #INDENT# flag_byte = self . get_raw_classification_flags ( ) #NEWLINE# self . raise_if_overflow ( self , 1 ) #NEWLINE# outByte = self . bitpack ( ( flag_byte , flag , flag_byte ) , ( ( 0 , 6 ) , ( 0 , 1 ) , ( 7 , 8 ) ) ) #NEWLINE# self . set_dimension ( 'classification_flags' , outByte ) #NEWLINE# #UNINDENT# #UNINDENT# return