dust parameter wavelength grids are off by an order of magnitude

Issue #40 closed
Scott Daniel created an issue

Line 36 of raytrace/dust.cpp tries to create a wavelngth grid in microns by dividing an integer by 10,000. It should actually be dividing the integer by 1,000, since the integer is looping from 0 to 1200, and these should be the bounds of the wavelength grids in nanometers.

This bug is causing dust extinction not to be applied in PhoSim. We tested this by creating an InstanceCatalog of 64 sources, all with the attached SED with magNorm=21 and redshift=0.5. The first 32 sources have no dust applied to them. The second batch of 32 sources has an internal CCM dust model applied with A_v=0.1, R_v=3.1. Theoretical calculations show that the difference in flux between these two sets of sources should be a factor 1.136 in the r band. However, upon inspecting the centroid file, we find no change whatsoever between the dusty and dustless sources. This can be seen in the attached figure dust_test_2.png. When we change dust.cpp as proposed, we get the correct behavior (see the attached dust_test_fix.png). Mechanically, this is because the line in dust.cpp as it currently stands causes dustvalue in getWavelengthTime to evaluate to > 1, meaning dust extinction is never applied.

We include the InstanceCatalog used in our test, in case you want to recreate what we did.

Thanks to Chris Walter, Jim Chiang, and Javier Sanches for their help tracking down this bug.

Comments (2)

  1. Log in to comment