Open jotaylor opened 3 years ago
Hmm. self.output_errors in counts should be equal to sqrt(total counts). Then signal to noise (as a ratio) should be total counts / errors (both in counts). But then you have to convert the error to flux units, so you can get that by dividing the flux (in erg /cm^2 /sec /angstrom) by the signal to noise. So it makes sense, it's just that it should read
`self.output_errors[nonzeros] = np.sqrt(self.output_sumgcounts[nonzeros])
self.signal_to_noise[nonzeros] = self.output_sumgcounts[nonzeros] / self.output_errors[nonzeros]
self.output_errors[nonzeros] = np.abs(self.output_flux[nonzeros] / self.signal_to_noise[nonzeros])`
The first line uses the total counts in each pixel to calculate the error on those counts by just calculating the sqrt. The second line calculates the S/N as the total counts/error in counts. The S/N is the same whether the fluxes and errors are measured in counts or flux units, so this ratio is used to calculate the error in flux units by dividing the flux in flux units by the S/N.
-
This should be valid for COS and STIS MAMA data
There was some discussion for DR5 about improving the STIS error measurements. We should investigate this after DR5.
The perils of time mean that I don't quite remember what we had discussed after DR5. @stscirij, any recollection?
Do we need this logic?
Specifically the second redefinition of the error array?