I'm trying to concatenate files in pyfits. Because they weren't done correctly, one of the column name and one of the column format are not the same between my input files, so I can't concatenate the ndarray using np.concatenate ...
I'd like to change the column name (in a clever way). I've found in pyfits documentation the pyfits.Coldefs.change_name function (http://pythonhosted.org/pyfits/api_docs/api_tables.html#coldefs) , so here's what I'm doing right now :
hdu = pyfits.open(myfile,memmap=True)[1]
new_columns = pyfits.ColDefs(hdu.columns).change_name(prev_name,new_name)
I've also tried :
hdu = pyfits.open(myfile,memmap=True)[1]
new_columns = pyfits.ColDefs(hdu.columns).change_attrib(prev_name,'names',new_name)
This returns a None type object. Is there something I'm missing ?
Thanks