SKIRT / SKIRT9

SKIRT version 9 -- advanced radiative transfer in dusty systems
http://www.skirt.ugent.be
GNU Affero General Public License v3.0
38 stars 31 forks source link

Fix surface brightness calibration and coordinate transforms for local instruments #87

Closed petercamps closed 3 years ago

petercamps commented 3 years ago

Description This update fixes the surface brightness calibration and some coordinate transform issues for local instruments, including the AllSkyInstrument, the HEALPixSkyInstrument, and the PerspectiveInstrument. Distant instruments, including the SEDInstrument, the FrameInstrument, and the FullInstrument, are not affected.

For all instruments, the contribution of a given source to the flux detected in a particular pixel depends on the source's distance and on the solid angle subtended by the pixel. Because distant instruments assume that all sources in the model are at the same (large) distance from the instrument, this "calibration" can occur at the end of the simulation after all photon packet contributions have been accumulated. For local instruments, however, the effective distance from a photon packet's originating position must be taken into account for each individual photon packet. This was implemented incorrectly for local instruments in the previous SKIRT version.

Furthermore, we decided to adjust the output images produced by the AllSkyInstrument and the HEALPixSkyInstrument to follow the convention in the literature where the longitude increases from right to left. As a result, the pixels have been east-west flipped (as compared to the previous version) and the axis information in the FITS header has been updated to reflect this change. The order of the pixels in the HEALPixSkyInstrument output is also updated to ensure the proper north-south and east-west result. The PTS methods to read this output and project it to a planar map are correspondingly updated in a separate, accompanying pull request.

Motivation The calibration for the all-sky instruments depended on an arbitrary radius configured by the user, which does not make any sense. Furthermore, the dependency on distance was incorrect, causing distant objects to appear brighter than they should. This made it impossible to properly compare fluxes with observational results (e.g. the Planck all-sky maps)

Context The current pull request includes (an adjusted version of) the changes suggested by pull request #86. The issues indicated in that pull request turned out to exist for all local instruments, so that a more generic implementation was called for. Consequently, pull request #86 will be closed without being merged with the master branch.

Tests The existing test cases involving local instruments were updated, and new test cases created to explicitly test the issues raised and fixed here. This includes the test case proposed in pull request #86. We note that the output of all distant instruments remains binary identical to the previous version, confirming that this pull request does not affect distant instruments.