def _write_proj(fid, projs):
 if (len(projs) == 0):
  return
 start_block(fid, FIFF.FIFFB_PROJ)
 for proj in projs:
  start_block(fid, FIFF.FIFFB_PROJ_ITEM)
  write_int(fid, FIFF.FIFF_NCHAN, proj['data']['ncol'])
  write_name_list(fid, FIFF.FIFF_PROJ_ITEM_CH_NAME_LIST, proj['data']['col_names'])
  write_string(fid, FIFF.FIFF_NAME, proj['desc'])
  write_int(fid, FIFF.FIFF_PROJ_ITEM_KIND, proj['kind'])
  if (proj['kind'] == FIFF.FIFFV_PROJ_ITEM_FIELD):
   write_float(fid, FIFF.FIFF_PROJ_ITEM_TIME, 0.0)
  write_int(fid, FIFF.FIFF_PROJ_ITEM_NVEC, proj['data']['nrow'])
  write_int(fid, FIFF.FIFF_MNE_PROJ_ITEM_ACTIVE, proj['active'])
  write_float_matrix(fid, FIFF.FIFF_PROJ_ITEM_VECTORS, proj['data']['data'])
  if (proj['explained_var'] is not None):
   write_float(fid, FIFF.FIFF_MNE_ICA_PCA_EXPLAINED_VAR, proj['explained_var'])
  end_block(fid, FIFF.FIFFB_PROJ_ITEM)
 end_block(fid, FIFF.FIFFB_PROJ)

def _write_proj ( fid , projs ) : if ( len ( projs ) == 0 ) : return start_block ( fid , FIFF . FIFFB_PROJ ) for proj in projs : start_block ( fid , FIFF . FIFFB_PROJ_ITEM ) write_int ( fid , FIFF . FIFF_NCHAN , proj [ 'data' ] [ 'ncol' ] ) write_name_list ( fid , FIFF . FIFF_PROJ_ITEM_CH_NAME_LIST , proj [ 'data' ] [ 'col_names' ] ) write_string ( fid , FIFF . FIFF_NAME , proj [ 'desc' ] ) write_int ( fid , FIFF . FIFF_PROJ_ITEM_KIND , proj [ 'kind' ] ) if ( proj [ 'kind' ] == FIFF . FIFFV_PROJ_ITEM_FIELD ) : write_float ( fid , FIFF . FIFF_PROJ_ITEM_TIME , 0.0 ) write_int ( fid , FIFF . FIFF_PROJ_ITEM_NVEC , proj [ 'data' ] [ 'nrow' ] ) write_int ( fid , FIFF . FIFF_MNE_PROJ_ITEM_ACTIVE , proj [ 'active' ] ) write_float_matrix ( fid , FIFF . FIFF_PROJ_ITEM_VECTORS , proj [ 'data' ] [ 'data' ] ) if ( proj [ 'explained_var' ] is not None ) : write_float ( fid , FIFF . FIFF_MNE_ICA_PCA_EXPLAINED_VAR , proj [ 'explained_var' ] ) end_block ( fid , FIFF . FIFFB_PROJ_ITEM ) end_block ( fid , FIFF . FIFFB_PROJ )
write a projection operator to a file .