FUNCTION ReadFitData , fileName , fit_header
	COMPILE_OPT IDL2

	file = strsplit(fileName, '.' , /EXTRACT)
	file = file[N_Elements(file)-1]
	temp1 = ['fit','Fit','FIt','FIT','fits','fts','FITS','FTS']
	temp2 = ['dat','Dat','DAt','DAT']
	number = Where(file EQ temp1 , count)
	IF count NE 0 THEN BEGIN
		openu,lun, filename[0], /get_lun
		fitData=mrdfits(lun,filename[0], fit_header)
		free_lun,lun
	ENDIF
	number = Where(file EQ temp2 , count)
	IF count NE 0 THEN BEGIN
		dt_dat_read,filename,fitData,fit_header,swap=swap
		fitData = Temporary( Congrid(fitData, 563, 363))
	ENDIF
	Return , fitData

END