GetLinearity

Description :

This function allows to analyze a set of images based on a window statistic to perform linearity analysis and returns four linearity plots and datas.
This function needs a window definition, and two offsets and noise figures to compute the optimal offset that minimizes the linearity figure results. The optimum offset is returned as result into a display message window.

Warning : pair of images with same exposure time is needed, so for instance :
ImagesArray[0] and ImagesArray[1] shall have the same exposure time.
ImagesArray[2] and ImagesArray[3] shall have the same exposure time, not necessary more or less compared to [0] and [1] pair, no exposure ordering is required.

Please have a look HERE to get important information about CCD testing functions.

Minimum version : 1.61

Syntax :

GETLINEARITY ImagesArray AmtImage X1 Y1 X2 Y2 OffsetMax OffsetMin RmsNoise UseMedian

Variables :

Parameters Inputs / Outputs Type Description
ImagesArray Input Array of image handler An array of images handles (that points the the pixel datas) that needs to be previously loaded.
AmtImage Input Integer Amount of images to analyze
X1 Input Integer Left bottom X image coordinates where the statistic will be computed
Y1 Input Integer Left bottom Y image coordinates where the statistic will be computed
X2 Input Integer Top right X image coordinates where the statistic will be computed
Y2 Input Integer Top right Y image coordinates where the statistic will be computed
offsetMax Input Floating point This figure set the maximum offset that will be used to compute linearity figures
offsetMin Input Floating point This figure set the minimum offset that will be used to compute linearity figures
RmsNoise Input Floating point Noise from the bias, helps to find the optimal offset between offsetMin and offsetMax
UseMedian Input Boolean If 0 statistic will use mean, if 1 statistic will use median and will be more robust to noise/spikes

See also :
GETNOISE
STAT
STATWINDOW
GETCONVERFACTOR

Example :

path$="C:\Prism\Images de test\ccd_test\linearity\"

// Loads files like 1.cpa ...
AmtImage=14
for i=1 AmtImage
str i i$
a$=i$+".cpa"
a$=path$+a$
print a$
open ImagesArray[i-1] a$
next i

X1=200
Y1=200
X2=500
Y2=500

STATWINDOW ImagesArray[0] X1 Y1 X2 Y2 Mean Quad Stddev Max Min Flux Median
OffsetMin=Median-100
OffsetMax=Median+100
Print Median " min=" OffsetMin " max=" OffsetMax
Print "noise=" Stddev
RmsNoise=Stddev
UseMedian=1
Print "-------------"

GETLINEARITY ImagesArray AmtImage X1 Y1 X2 Y2 OffsetMax OffsetMin RmsNoise UseMedian

for i=1 AmtImage
close ImagesArray[i-1]
next i