def _convert_fits2record(format):
 (repeat, dtype, option) = _parse_tformat(format)
 if (dtype in FITS2NUMPY):
  if (dtype == 'A'):
   output_format = (FITS2NUMPY[dtype] + str(repeat))
   if ((format.lstrip()[0] == 'A') and (option != '')):
    output_format = (FITS2NUMPY[dtype] + str(int(option)))
  else:
   repeat_str = ''
   if (repeat != 1):
    repeat_str = str(repeat)
   output_format = (repeat_str + FITS2NUMPY[dtype])
 elif (dtype == 'X'):
  output_format = _FormatX(repeat)
 elif (dtype == 'P'):
  output_format = _FormatP.from_tform(format)
 elif (dtype == 'Q'):
  output_format = _FormatQ.from_tform(format)
 elif (dtype == 'F'):
  output_format = 'f8'
 else:
  raise ValueError('Illegal format {}.'.format(format))
 return output_format

def _convert_fits2record ( format ) : ( repeat , dtype , option ) = _parse_tformat ( format ) if ( dtype in FITS2NUMPY ) : if ( dtype == 'A' ) : output_format = ( FITS2NUMPY [ dtype ] + str ( repeat ) ) if ( ( format . lstrip ( ) [ 0 ] == 'A' ) and ( option != '' ) ) : output_format = ( FITS2NUMPY [ dtype ] + str ( int ( option ) ) ) else : repeat_str = '' if ( repeat != 1 ) : repeat_str = str ( repeat ) output_format = ( repeat_str + FITS2NUMPY [ dtype ] ) elif ( dtype == 'X' ) : output_format = _FormatX ( repeat ) elif ( dtype == 'P' ) : output_format = _FormatP . from_tform ( format ) elif ( dtype == 'Q' ) : output_format = _FormatQ . from_tform ( format ) elif ( dtype == 'F' ) : output_format = 'f8' else : raise ValueError ( 'Illegal format {}.' . format ( format ) ) return output_format
convert fits format spec to record format spec .