Calculating Time ---------------- The Exposure Time is calculated based on the user input SNR, instrument configuration and input source spectrum. For spectroscopic modes, this value is calculated at a particular wavelength which is specified by the user in Section 2 of the ETC forms. **Please make sure the wavelength entered in this section is covered by the selected mode.** With this information, the count rate terms (in photons/sec) are retrieved from *pysynphot*. Each photon count rate term is depicted below with an :sub:`r` subscript. Taking formula (ii) from the previous page and expanding the count terms, we get the following: .. math:: SNR = \frac{S_r * t}{sqrt{S_r * t + Sky_r * t + DC_r * t + RN^2 + Thermal_r * t + CS_r * t}} This can be easily changed to: .. math:: S_r^2 * t^2 - SNR^2 * [ S_r + Sky_r + DC_r + Thermal_r + CS_r] * t - SNR^2 * RN^2 = 0 Then solving for t gives us: .. math:: t = \frac{b + sqrt{b^2 + 4ac}}{2a} *Where*: :math:`b = (S_r + BG_r) * SNR^2` :math:`c = RN^2 * SNR^2` :math:`BG_r = ES_r + ZL_r + GL_r + DC_r + Thermal_r + CS_r`