Author Topic: II Weight formula?  (Read 6128 times)

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: II Weight formula?
« Reply #15 on: 2012 August 28 04:01:13 »
Quote
Just to double check, your post above says the rejection scale factor is the average deviation ratio, but the II documentation says it is the median deviation ratio.

I confirm that this is a mistake in the documentation. Initially the image scaling algorithm used MAD (median absolute deviation from the median) as a robust estimator of dispersion, but I changed it to AvgDev (average absolute deviation from the median) in one of the latest versions (I don't remember which one now and I don't have security backups at hand). I'll change the reference documentation as soon as possible to include up-to-date information.

The reason to prefer AvgDev instead of MAD in this case is that MAD rejects the tails of the sample distribution completely, while AvgDev does not. In the case of deep-sky raw images we always have a strong central tendency (a single and narrow main histogram peak). What we want to evaluate here is the true width of the mean peak of the histogram. The AvgDev is a better estimator of dispersion in this case, in my opinion, since it is more comprehensive with data that departs from the central peak. Take into account that we compute AvgDev excluding all pixels outside the ]0,0.98] range, which rejects most outliers (black borders, hot pixels, cosmic rays, saturated stars, and the brightest pixels of plane and satellite trails) and hence robustifies the image scaling routine.

Although the current scheme based on AvgDev is very reliable and accurate, I don't discard the possibility of changing our image scaling function again in one of the next versions of the ImageIntegration tool, since it is an essential part of the pixel rejection process. Anyway, we currently are gearing towards more sophisticated pixel rejection algorithms, such as the multiscale image integration method described in this tutorial.

Quote
Also, the II documentation recommends not scaling when integrating lights, but I think the batch script does in fact scale.

The BatchPreprocessing script applies the additive+scaling output normalization for integration of light frames, while the documentation recommends no scaling, which is also the default setting in the II tool. This is another incongruence with the documentation, but this time it is intentional.

My decision to use additive+scaling output normalization in the BPP script is based on the following reasoning. For a coherent data set, i.e. when all the integrated frames have very similar dispersion values, scaling has no practical effect because all scaling factors should be very similar. However, most data sets acquired with amateur equipment under less-than-perfect skies include frames with different illumination conditions and exposure times, and in these cases output scaling helps to achieve a more coherent result in statistical terms. This subject is of course open to discussion, but we shouldn't forget the fact that the integrated result of BPP is not a valid starting image for postprocessing, but just a preview of the image, provided for convenience.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline mschuster

  • PTeam Member
  • PixInsight Jedi
  • *****
  • Posts: 1087
Re: II Weight formula?
« Reply #16 on: 2012 November 12 16:26:54 »
Juan,

Just to confirm your post, in ImageIntegration, both the Rejection normalization "Scaling + zero offset" and the Output normalization "Additive + scale" both use AvgDev rather than MAD (in equation [21]). Correct?

(If not, I want to write a normalizing script that does this).

Thanks,
Mike

Offline mschuster

  • PTeam Member
  • PixInsight Jedi
  • *****
  • Posts: 1087
Re: II Weight formula?
« Reply #17 on: 2012 November 14 09:41:02 »
FYI: I did a bit of reverse engineering and fit a linear model to the output normalization "Additive + scale" on an integration of a small number of frames. My conclusion is that this normalization uses AvgDev not MAD for scaling. Rejection normalization seems a bit harder to reverse engineer and I have not done this yet. But given my results and your comments, I think it is likely that "Scaling + zero offset" also uses AvgDev. So I have concluded that NoiseEvaluation and both rejection and output normalization use AvgDev not MAD scaling. I think this is good for consistency, IMO if the data is scaled then noise estimates should be scaled by the same factor, and vice versa.

I also investigated the question of using "Additive" versus "Additive + scale" as an output normalization for several integrations (132 * 40 minute undersampled Ha subframes, 88 hours total, 5 months of observations). I have concluded that "Additive + scale" is better for this data. When atmospheric transparency is roughly the same across an integrated set, these two options give very similar results. But when atmospheric transparency varies (thin high clouds, smoke, haze), then "Additive + scale" results in higher contrast (higher SNR) integrations.

Thanks,
Mike