flat_correct automatically calculates the mean of the flat field and normalizes the flat before dividing by it. This is convenient, but if you want to use two different flats on different sets of images but force them to have the same normalization, there is no way to turn off the normalization or pass in an externally determined factor.
This becomes an issue when processing multi-extension FITS files. For example, if extensions 1 and 2 are two different CCDs, or two halves of the same CCD, and one tries to process them by running flat_correct on the two extensions separately, then the flats need to have the same normalization. (Imagine that the left half of the CCD is extension 1 and it is 10% more sensitive than ext 2. Then both the science targets and the flat field will have 10% more counts in ext 1, and the target should be divided down by the brighter flat field. Renormalizing ext 1 and ext 2 separately by their own means will produce a non-flat science image.)
For an example of how I had to work around this behavior, you can see the function renormalize_by_flat() in the pipeline here. It would be simpler just to have a normalizing factor passed in as an optional argument to ccdproc.flat_correct. I can write this code and issue a pull request, but someone with more practice will need to read it for style and write a test.
This is a small part of making ccdproc friendly to multi-extension FITS files, but can stand on its own.
flat_correct automatically calculates the mean of the flat field and normalizes the flat before dividing by it. This is convenient, but if you want to use two different flats on different sets of images but force them to have the same normalization, there is no way to turn off the normalization or pass in an externally determined factor.
This becomes an issue when processing multi-extension FITS files. For example, if extensions 1 and 2 are two different CCDs, or two halves of the same CCD, and one tries to process them by running flat_correct on the two extensions separately, then the flats need to have the same normalization. (Imagine that the left half of the CCD is extension 1 and it is 10% more sensitive than ext 2. Then both the science targets and the flat field will have 10% more counts in ext 1, and the target should be divided down by the brighter flat field. Renormalizing ext 1 and ext 2 separately by their own means will produce a non-flat science image.)
For an example of how I had to work around this behavior, you can see the function renormalize_by_flat() in the pipeline here. It would be simpler just to have a normalizing factor passed in as an optional argument to ccdproc.flat_correct. I can write this code and issue a pull request, but someone with more practice will need to read it for style and write a test.
This is a small part of making ccdproc friendly to multi-extension FITS files, but can stand on its own.