Added try,except to look for lref.  If not defined, flux calibration is not performed