Debian Codegraph @

doc/tsrs/choppy_count_problem/source/main.rst

raw
1 Discovery case
2 ==============
3
4 This issue was reported by Cristina Oliveira during user testing of
5 ETC 18.0 (etc.stsci.edu) on 26 October 2009, for exposure ID COS.A192124
6 which specifies LDS749B (crcalspec$lds749b_mod_001.fits) as the target spectrum.
7
8 .. figure:: src_A20631.png
9 :alt: Source spectrum plot, in counts, as rendered in ETC 18.0
10
11 Spectrum, in counts, as rendered in ETC 18.0
12
13 She observed that the file in CDBS looked much smoother.
14
15 .. figure:: cdbs_flam.png
16 :alt: Corresponding spectrum, in flam, when plotted manually
17
18 Corresponding spectrum, in flam, when plotted manually
19
20 Investigation
21 ==============
22
23 Using pysynphot v0.61, the observed ETC behavior was duplicated. Further
24 examination of the input spectrum revealed that its wavelength table is
25 far from evenly spaced. Its bin widths range from 0.00098A to 50A. In the
26 specific domain of interest (1100A to 1500A), the bin size ranges from 0.00195
27 to 0.477.
28
29 .. figure:: binwidth.png
30
31 Scatter plot showing bin width as a function of wavelength
32
33 .. figure:: binwidth_zoom.png
34
35 Scatter plot zoomed to x(1100:1500) and y(0:0.6)
36
37 Unlike most of the other units supported by (py)synphot, "counts" is not a
38 flux density. When a spectrum is plotted in counts, the y value per bin
39 is obtained by integrating the flux density over the bin width, then converting
40 that integrated flux into counts. Therefore, the appearance of a plotted
41 spectrum in counts is critically dependent on the underlying wavelength
42 array in which it is presented.
43
44
45 This was not apparent in SYNPHOT plots (and, therefore, not in versions of the
46 ETC which used synphot for plotting) because SYNPHOT uses a logarithmically
47 spaced wavelength array when combining spectra (and SYNPHOT always combines
48 spectra with Vega, even if they're just being read in from a file and then
49 plotted).
50
51 .. figure:: syn_binwidth.png
52
53 bin width spacing of SYNPHOT spectrum
54
55 .. figure:: syn_binwidth_zoom.png
56
57 SYNPHOT bin width zoomed to x(1100:1500), y(0:0.6)
58
59
60 When pysynphot is used to sample the LDS749b spectrum, in counts, on the
61 wavelength array used by SYNPHOT, the appearance is much more "reasonable".
62
63 .. figure:: syn_sampled_counts.png
64
65 pysynphot LDS749B spectrum sampled on SYNPHOT wavelength array
66
67
68 Conclusions
69 ===========
70
71 The peculiar appearance of the plot is an artifact of the irregular wavelength
72 array in the spectrum being plotted, and the fact that a spectrum presented
73 in counts has been integrated over wavelength in each bin.
74
75 Presenting a source spectrum in counts is not a useful plot, and the ETC
76 should probably not be presenting this plot in counts.
77
78 This was a useful case study in differences between SYNPHOT and pysynphot
79 which will be added to the pysynphot documentation for SYNPHOT users.
80