there should be a 'NAXIS' keyword in the header that is just the number of axes.