dstndstn/tractor — pull request #24 by bpartridge (2014-01-28 17:50:24+00:00)
Title: Expose data numbers and electron counts in info dict when loading SDSS images

[Low priority feature contribution]

Since we're incorporating sky noise in the model for the Inference project, it's useful to expose in `tractor.Image` instances the calculations described in http://data.sdss3.org/datamodel/files/BOSS_PHOTOOBJ/frames/RERUN/RUN/CAMCOL/frame.html :

```
If you have performed the above calculations, you can return the image to very close to the state it was in when input into the photometric pipeline, as follows:

dn= img/cimg+simg

These dn values are in the same units as the "data numbers" stored by the raw data files that come off the instrument. They are related to the detected number nelec of photo-electrons by:

nelec= dn*gain

The number of photo-electrons is the quantity that is statistically Poisson distributed.
```

This patch simply returns image-size vectors in `get_tractor_image_dr8` (which is also called if DR9 is passed) for the data-numbers and electron-counts. The caller can then do something like `img, info = ...; img.counts = np.round(info['dn'])`.