calc_exposure function

Calculate the exposure time