Adjusting polynomial non-linearity fits for detector gain

Adjusting polynomial non-linearity fits for detector gain

As demonstrated in our linearity tests, non-linearity measured as a function of observed photons (rather than adu) seems to be constant for a given detector+amplifier combination.

How can one then convert a non-linearity correction derived for one gain, to an appropriate form for another gain.

In the plots presented on these pages we have parametrised non-linearity as

Nt/Nm = P(Nm) = a0 + a1 Nm + a2 Nm 2 + ...

where Nt are "true" or linear counts, and Nm are "measured" or non-linear counts.

If we work in photons rather than adu, then we can get a fit like

pt/pm = P'(pm) = a'0 + a'1 pm + a'2 pm 2 + ...

As photons and adu are related by the gain pm = g Nm (which we assume is a constant - that is the non-linearity is small), we can derive the coefficients for the polynomial P from P', given the non-linearity is the same at equivalent illumination levels, P(Nm) = P'(pm), and therefore

a0 + a1 Nm + a2 Nm 2 + ... = a'0 + a'1 g Nm + a'2. g 2 Nm 2 + ...

=>

a0 = a'0

a1 = a'1 g

a2 = a'2. g 2

I wrote a quick-and-dirty perl script to do this conversion from a0,a1,a2, ... to a0,ga1,,g2a2 ...

A listing of polyfudge.pl follows

#!/usr/bin/perl

###############################################################################

# Given a set of polynomial coeffs

# P(x) = a0 + a1x + a2*x^2 ...

#

# and a fudge factor g

#

# print out the coefficients for P'(x) = P(g*x) = a0 + a1*g * x + a2*g^2 * x^2 + ....

use diagnostics;

{

$fudge=shift(@ARGV);

$coeff=shift(@ARGV);

$g = 1;

$comma = "";

foreach $i ( split ',', $coeff ) {

$t = $i*$g;

print "$comma$t";

$g = $g*$fudge;

if ($comma eq "") { $comma = ","; }

}

print "\n";

}

which can be used in anger as follows - suppose we want to convert the EEV photon fit for use on EEV2+AAO2+FAST data which has a gain of 2.80e/adu. Then provide as arguments to the script the gain (g=2.80), and the polynomial coefficients as a list of coefficients separated by commas (no spaces), as follows

% polyfudge.pl 2.80 1,-3.45119255147154e-07,5.40215125523544e-13

which prints out the result

1,-9.66333914412031e-07,4.23528658410458e-12

Page last updated: 25 June 2007.