*/
public static void deleteTable(Fits fits, String name) throws FitsException, IOException {
int numHDUs = fits.getNumberOfHDUs();
String votMetaName = VOTMETA + name.replace(TABLE_SUFFIX, "");
for (int hduIndex = numHDUs - 1; hduIndex >= 0; hduIndex--) {
BasicHDU basicHDU = fits.getHDU(hduIndex);
Header header = basicHDU.getHeader();
String extName = header.getStringValue("EXTNAME");
if (extName != null && (extName.equals(name) || extName.equals(votMetaName))) {
// delete the old table or metadata table
fits.deleteHDU(hduIndex);
}