<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def calculate_exposure(self, duration):
 # type: (float) -> float """Calculate the exposure to set the detector to given the duration of the frame and the readout_time and frequency_accuracy"""

        exposure = duration - self.frequency_accuracy * duration / 1000000.0 - \
                   self.readout_time
        assert exposure > 0.0, \
            "Exposure time %s too small when deadtime taken into account" % (
                exposure,)
        return exposure