Automatic adjustment of the LED (QHY-174-GPS)

Jean-Francois
Posts: 360
Joined: Sun Oct 13, 2019 10:52 am
Location: Germany

Automatic adjustment of the LED (QHY-174-GPS)

#1

Post by Jean-Francois »

Hello,

Here a (not final) version of my script for setting automatically the Start Pos and End Pos of the LED illumination.

The script saves an image in a temporary file on the disc (ideally, it would use the image directly from the memory ... it is planed for a following version of the script). The user can modify the directory (or create C:\Temp\) before use of the script.

The script sets the Start/End Pos values with +/- 10, +/- 100 up to the "power_threshold" value (that permits to limit the number of steps when the value is very large). The script performs an iterative search with a defined number of steps "search_loop".
A future version will use the fine steps results for solving the transition curve at the inflection point.
And I wish to have a visual view of the solution with some nice curves.

I test for several parameters (binning, exposure time, USB traffic, ...) in the most of the case, the script found both adjustment position.
Sometimes it does not found ... I see some "problems" ...

For example for the camera parameters: 1900x1200 binned with 2x2, 10 ms exposure and USB = 9:
SC guess value : 232776 / 978280 (false)
Manual search : 7090 / 1130250 (false because of "third transition"
Script after better starting values: 1130257 / 1874724 (the value can differ on other camera)

Note that the most of my tests were correct with the USB traffic = 0 and binning 1x1.

How to use the script ? ...
- start SharpCap
- connect QHY-174-GPS camera (I have no idea what happen if it is only the QHY-174 camera)
- switch on the LED illumination (for the first test, no GPS is needed, the camera must be covered)
- move the USB traffic or change the exposure time (so that SC fill the Start/End Pos values)
- show "The Image Histogram" window
- activate the "FX Selection Area" (for showing the red selection rectangle)
- move and scale the selection rectangle above the most intense region of the LED illumination
- start the script
- maybe modify "power_threshold", "search_loop" parameters (first to not modify larger than 10)

And here the script:

Code: Select all

import clr
clr.AddReference("System.Drawing")
clr.AddReference('System.Windows.Forms')
clr.AddReference('System.Drawing')
import sys
import time
import System.Drawing
import math

# (Begin) - Parameter to be changed by the user
temp_file = "c:\Temp\LED_test.tif"		# Change the directory, if necessary
search_loop = 8							# Number of fine search
power_threshold = 4						# (10**power_threshold) digit
# (End)   - Parameter to be changed by the user


print("GPS Calibration LED on/off  : %s") % (SharpCap.SelectedCamera.Controls[21].Value)
print
Cal_End_Pos = SharpCap.SelectedCamera.Controls[19].Value
Cal_Start_Pos = SharpCap.SelectedCamera.Controls[20].Value

print SharpCap.SelectedCamera.Controls[18]
print("Calibration Start Pos Adjust: %i") % (Cal_Start_Pos)
print("Calibration End Pos Adjust  : %i") % (Cal_End_Pos)
print("GPS Calibration LED on/off  : %s") % (SharpCap.SelectedCamera.Controls[21].Value)
print("GPS Freq Stabilizazion      : %s") % (SharpCap.SelectedCamera.Controls[22].Value)
print("GPS                         : %s") % (SharpCap.SelectedCamera.Controls[23].Value)
print

SharpCap.SelectedCamera.Controls.OutputFormat.Value = 'TIFF files (*.tif)'
cloneRect = SharpCap.Transforms.SelectionRect
print("Rectangle Selection : "), cloneRect
print

expos_ms = SharpCap.SelectedCamera.Controls.Exposure.ExposureMs

def rect_average():
	time.sleep(expos_ms / 990)		# Wait for the frame "used" the Pos Adjust value
	SharpCap.SelectedCamera.CaptureSingleFrameTo(temp_file)
	bm = System.Drawing.Bitmap(temp_file)
	cloneBitmap = bm.Clone(cloneRect, bm.PixelFormat)
	sum = 0.0
	nb_pixel = cloneRect.Height * cloneRect.Width
	for i in range(cloneRect.Height):
		for j in range(cloneRect.Width):
			pixel = cloneBitmap.GetPixel(j,i)
			sum += float(pixel.R)
	bm.Dispose()
	cloneBitmap.Dispose()
	return(sum/nb_pixel)

def Show_matrix(M):
    for i in range(len(M)):
        for j in range(len(M[0])):
            print str(M[i][j]) + "    ",
        print
    return

def Search_next_L(M, a):
    k = 0
    while (M[k][1] < a):
        k = k + 1
    return(math.floor((M[k][0] + M[k-1][0]) / 2.0))

def Search_next_R(M, a):
    k = 0
    while (M[k][1] > a):
        k = k + 1
    return(math.floor((M[k][0] + M[k-1][0]) / 2.0))

def LED_Start_search_L(Pos, LED, n):
    P = Pos
    L = LED
    for i in range(0,n):
        average = (min(L) + max(L)) / 2.0
        M = zip(P,L)
        M.sort()
        Pnew = Search_next_L(M,average)
        SharpCap.SelectedCamera.Controls[20].Value = Pnew
        P.append(Pnew)
        L.append(rect_average())
        print Pnew, "  ", L[-1]
    M = zip(P,L)
    M.sort()
    return(M)

def LED_Start_search_R(Pos, LED, n):
    P = Pos
    L = LED
    for i in range(0,n):
        average = (min(L) + max(L)) / 2.0
        M = zip(P,L)
        M.sort()
        Pnew = Search_next_R(M,average)
        SharpCap.SelectedCamera.Controls[19].Value = Pnew
        P.append(Pnew)
        L.append(rect_average())
        print Pnew, "  ", L[-1]
    M = zip(P,L)
    M.sort()
    return(M)


# *****************************************************************************
# LED Calibration Start Position Adjustment

# Need to be sure that the last value is used
SharpCap.SelectedCamera.Controls[20].Value = Cal_Start_Pos + 1
SharpCap.SelectedCamera.Controls[20].Value = Cal_Start_Pos - 1

cal_step = math.floor(math.log10(Cal_Start_Pos)) - 1
Pos = [Cal_Start_Pos]
print cal_step
if (cal_step > power_threshold):
	cal_step = power_threshold
print("Digit position selection:  "),
for p in range(int(cal_step), 0, -1):
	print 10**p,
	Pos.append(Cal_Start_Pos + 10**p)
	Pos.append(Cal_Start_Pos - 10**p)

print
print("SC Cal_Start_Pos  : "), Cal_Start_Pos
print("Cal_Start_Pos list: "), Pos

LED = []
for L in range(0,len(Pos)):
	SharpCap.SelectedCamera.Controls[20].Value = Pos[L]
	LED.append(round(rect_average(),3))
	print Pos[L], "   ", LED[L]

print
print("Min / Max  : "), min(LED), "  ", max(LED)
print("average: "), (min(LED) + max(LED)) / 2.0
M = zip(Pos, LED)
M.sort()
print
Result = LED_Start_search_L(Pos, LED, search_loop)
print
print

# END    LED Calibration Start Position Adjustment
# *****************************************************************************


# *****************************************************************************
# LED Calibration End Position Adjustment

# Need to be sure that the last value is used
SharpCap.SelectedCamera.Controls[19].Value =Cal_End_Pos + 1
SharpCap.SelectedCamera.Controls[19].Value =Cal_End_Pos - 1

cal_step = math.floor(math.log10(Cal_End_Pos)) - 1
Pos = [Cal_End_Pos]
print cal_step
if (cal_step > power_threshold):
	cal_step = power_threshold
print("Digit position selection:  "),
for p in range(int(cal_step), 0, -1):
	print 10**p,
	Pos.append(Cal_End_Pos + 10**p)
	Pos.append(Cal_End_Pos - 10**p)

print
print("SC Cal_End_Pos  : "), Cal_End_Pos
print("Cal_End_Pos list: "), Pos

LED = []
for L in range(0,len(Pos)):
	SharpCap.SelectedCamera.Controls[19].Value = Pos[L]
	LED.append(round(rect_average(),3))
	print Pos[L], "   ", LED[L]

print
print("Min / Max  : "), min(LED), "  ", max(LED)
print("Half height: "), (min(LED) + max(LED)) / 2.0
M = zip(Pos, LED)
M.sort()
print
Result = LED_Start_search_R(Pos, LED, search_loop)

# END    LED Calibration End Position Adjustment
# *****************************************************************************

Regards,
Jean-Francois
procyon12
Posts: 253
Joined: Tue Jan 14, 2020 11:32 am

Re: Automatic adjustment of the LED (QHY-174-GPS)

#2

Post by procyon12 »

Hello Jean-Francois,

First of all: Thanks you for your interesting work.

Secondly, the script is now very quick and works (I think) as you have implemented it. However, only in about 50% of my tests it found a calibration status like following described.

For occultation work the users normally have working previously created profiles. Working means in this sense (I think you should also work with GPS on): From the GPS status window you have a GPS lock, the exposure time is near the chosen one, the sys clock does not differ very much wrt the GPS time. Then you may have a look at the framerate at the bottom of the SC GUI and to be absolutely safe you record a short video and look for dropped frames (maybe with PyMovie/PyOTE and or Tangra).
Mostly you change near the predicted occultation time the exposure time only. And normally then the "autocalibration" works well. In some cases you are said "BadCalibrationData - Reduce EndPos". Then usually a very little correction of the EndPos will be sufficient.

Only in the above sense the calibration is interesting for the observation of occultations. Bear in mind that the Swiss DVTI-camera (same sensor) doesn't need any calibration. There can be other reasons for QHY implementing the calibration.

Indeed, there are cases where the autocalibration doesn't work right and also for longer exposure times a manual calibration is difficult. If your script can completely replace the autocalibration - O.K., but I think this will be a long way.

Maybe you should also involve K. Getrost. I do not know whether he is currently watching the forum.

This for the moment - I'm always ready to test ...

Christian
Jean-Francois
Posts: 360
Joined: Sun Oct 13, 2019 10:52 am
Location: Germany

Re: Automatic adjustment of the LED (QHY-174-GPS)

#3

Post by Jean-Francois »

Hello Christian,

Thank you that you test my script :-)
Right ... the script is not necessary for "trained" user with only a few defined profiles (binning, exposure time, ...).
You are a master in LED calibration ... after all the tests from the topic "QHY 174 GPS Calibration LED issue // USB Traffic weirdness".


Yes, the script is now quick ... but It could be improved ... may be not necessary for 10 or 100 ms, but for longer exposure time.
I do a test with 5 s ... I was quicker manually!
I remark that the LED Pos setting and the saving of one image is sometimes not synchronized ... mean: a preliminary version of the script saved the current image before the new image with the new Pos value appears. That is the reason why I add in the script a waiting time (exposure + 10%), so to be sure that the saved image is with the change Pos value. That is for 10 or 100 ms exposure time not relevant, but it is for > 2 s.

I have a general question for all "timing" users ... what is your typical exposure time with the QHY-174-GPS ?
(also the time with GPS and timing recording ... not for deepsky or moon imaging)


Regards,
Jean-Francois
procyon12
Posts: 253
Joined: Tue Jan 14, 2020 11:32 am

Re: Automatic adjustment of the LED (QHY-174-GPS)

#4

Post by procyon12 »

Hi,
what is your typical exposure time with the QHY-174-GPS ?
that's easy to answer:

The exposure time must be short enough to have sufficient temporal resolution over the duration of the event. And - at shorter times, the hardware restrictions occur more and more.
So, if hardware allows it, shortest exposure times are (2 ... 5) ... 10 ... 30 ms. On the other end, if you need long exposure times because the star is very weak: up to about 1000 ... 1500 ... (2000 ... 3000) ms. However, for exposure times > 640 ms you will get a remark on EURASTER (because of bad time resolution).
Have a look http://www.euraster.net/results/2020/index.html, a good overview.

Christian
Jean-Francois
Posts: 360
Joined: Sun Oct 13, 2019 10:52 am
Location: Germany

Re: Automatic adjustment of the LED (QHY-174-GPS)

#5

Post by Jean-Francois »

Hello Christian,

I have a new version of my script.
Thanks to Robin for the help on some difficult part of the script.
Advantage now is ... the script does not need to write a file on the disk. It uses now the data direct from the memory.

Last time you found that the script was quick ... wait to see the new script ... it was necessary to slow down, so that the user could "see" something :-)
No it is a joke, but for stability reason, I slow down a little bit the process.

I test with 8bit ... It is working fast each time. I have some time not correct result. I will investigate this later with a more general script.
But with 16bit I have the following problem ... SharpCap automatic setting does not work with exposure time above ~ 13 ms ... both LED parameters are too low (Start: ~4600, End: ~ 3200).

Code: Select all

import time
import math


# (Begin) - Parameter to be changed by the user
search_loop = 10						# Number of fine search
power_threshold = 3						# (10**power_threshold) digit
slope = 1.2								# value between 1.0 and 1.3
# (End)   - Parameter to be changed by the user


Cal_End_Pos = SharpCap.SelectedCamera.Controls[19].Value
Cal_Start_Pos = SharpCap.SelectedCamera.Controls[20].Value

print SharpCap.SelectedCamera.Controls[18]
print("Calibration Start Pos Adjust: %i") % (Cal_Start_Pos)
print("Calibration End Pos Adjust  : %i") % (Cal_End_Pos)
print("GPS Calibration LED on/off  : %s") % (SharpCap.SelectedCamera.Controls[21].Value)
print("GPS Freq Stabilizazion      : %s") % (SharpCap.SelectedCamera.Controls[22].Value)
print("GPS                         : %s") % (SharpCap.SelectedCamera.Controls[23].Value)
print

cloneRect = SharpCap.Transforms.SelectionRect
print("Rectangle Selection : "), cloneRect
print

expos_ms = SharpCap.SelectedCamera.Controls.Exposure.ExposureMs
wait_time = expos_ms / 1000.0 + 0.05

def framehandler(sender, args):
    if (dumpdata):
        global Mean
        cutout = args.Frame.CutROI(SharpCap.Transforms.SelectionRect)
        Stat = cutout.GetStats()
        Mean = Stat.Item1
        cutout.Release()

def evthandler(sender, args):
    if (SharpCap.SelectedCamera != None):
        SharpCap.SelectedCamera.FrameCaptured -= framehandler

def monitorFrames():
    SharpCap.SelectedCamera.FrameCaptured += framehandler

def Search_next_L(M, a):
    k = 0
    while (M[k][1] < a):
        k = k + 1
    return(math.floor((M[k][0] + M[k-1][0]) / 2.0))

def Search_next_R(M, a):
    k = 0
    while (M[k][1] > a):
        k = k + 1
    return(math.floor((M[k][0] + M[k-1][0]) / 2.0))

def LED_Start_search_L(Pos, LED, n):
    P = Pos
    L = LED
    for i in range(0,n):
        average = (min(L) + max(L)) / 2.0
        M = zip(P,L)
        M.sort()
        Pnew = Search_next_L(M,average)
        SharpCap.SelectedCamera.Controls[20].Value = Pnew
        time.sleep(wait_time)
        P.append(Pnew)
        L.append(Mean)
        print("%i   %7.3f") % (Pnew, L[-1])
        if (abs((L[-1] - average)/average) < 0.05):
            break
    M = zip(P,L)
    M.sort()
    return(M)

def LED_Start_search_R(Pos, LED, n):
    P = Pos
    L = LED
    loop = 0
    for i in range(0,n):
        average = (min(L) + max(L)) / 2.0
        M = zip(P,L)
        M.sort()
        Pnew = Search_next_R(M,average)
        SharpCap.SelectedCamera.Controls[19].Value = Pnew
        time.sleep(wait_time)
        P.append(Pnew)
        L.append(Mean)
        print("%i   %7.3f") % (Pnew, L[-1])
        if (abs((L[-1] - average)/average) < 0.05):
            break
    M = zip(P,L)
    M.sort()
    return(M)


dumpdata = True
SharpCap.CaptureEvent += evthandler
monitorFrames()


# *****************************************************************************
# LED Calibration Start Position Adjustment

cal_step = math.floor(math.log10(Cal_Start_Pos)) - 1
Pos = [Cal_Start_Pos]
if (cal_step > power_threshold):
    cal_step = power_threshold
print("Digit position selection:  "),
for p in range(int(cal_step), 0, -1):
    print 10**p,
    Pos.append(Cal_Start_Pos + 10**p)
    Pos.append(Cal_Start_Pos - 10**p)

Pos.sort()
print
print("SC Cal_Start_Pos  : "), Cal_Start_Pos
print("Cal_Start_Pos list: "), Pos

LED = []
loop = 1000
for L in range(0,len(Pos)):
    SharpCap.SelectedCamera.Controls[20].Value = Pos[L]

    time.sleep(wait_time)
    LED.append(Mean)

    if (L==0):
        print("%i   %8.3f") % (Pos[L], LED[L])
    else:
        print("%i   %8.3f") % (Pos[L], LED[L]),
        average = (LED[L]+LED[L-1])/2.0
        diff = LED[L]-LED[L-1]
        print
        if (abs(diff / average) > slope):
            loop = L
    if (loop == (L - 1)):
        break

print
print("Min / Max  : "), min(LED), "  ", max(LED)
print("average: "), (min(LED) + max(LED)) / 2.0
Pos = Pos[0 : len(LED)]
M = zip(Pos, LED)
M.sort()
print

time.sleep(wait_time)
Result = LED_Start_search_L(Pos, LED, search_loop)
Cal_Start_Pos = Pos[-1]
SharpCap.SelectedCamera.Controls[20].Value = Cal_Start_Pos

print
# END    LED Calibration Start Position Adjustment
# *****************************************************************************

# *****************************************************************************
# LED Calibration End Position Adjustment

cal_step = math.floor(math.log10(Cal_End_Pos)) - 1
Pos = [Cal_End_Pos]
if (cal_step > power_threshold):
    cal_step = power_threshold
print("Digit position selection:  "),
for p in range(int(cal_step), 0, -1):
    print 10**p,
    Pos.append(Cal_End_Pos + 10**p)
    Pos.append(Cal_End_Pos - 10**p)

Pos.sort()
print
print("SC Cal_End_Pos  : "), Cal_End_Pos
print("Cal_End_Pos list: "), Pos

LED = []
loop = 1000
for L in range(0,len(Pos)):
    SharpCap.SelectedCamera.Controls[19].Value = Pos[L]

    time.sleep(wait_time)
    LED.append(Mean)

    if (L==0):
        print("%i   %8.3f") % (Pos[L], LED[L])
    else:
        print("%i   %8.3f") % (Pos[L], LED[L]),
        average = (LED[L]+LED[L-1])/2.0
        diff = LED[L]-LED[L-1]
        print
        if (abs(diff / average) > slope):
            loop = L
    if (loop == (L - 1)):
        break

print
print("Min / Max  : "), min(LED), "  ", max(LED)
print("Half height: "), (min(LED) + max(LED)) / 2.0
Pos = Pos[0 : len(LED)]
M = zip(Pos, LED)
M.sort()
print

time.sleep(wait_time)
Result = LED_Start_search_R(Pos, LED, search_loop)
Cal_End_Pos = Pos[-1]
SharpCap.SelectedCamera.Controls[19].Value = Cal_End_Pos

# END    LED Calibration End Position Adjustment
# *****************************************************************************

dumpdata = False
print
print("***************************")
print("Cal_Start_Pos : %i") % (Cal_Start_Pos)
print("Cal_En_Pos    : %i") % (Cal_End_Pos)
print("***************************")


Regards,
Jean-Francois
procyon12
Posts: 253
Joined: Tue Jan 14, 2020 11:32 am

Re: Automatic adjustment of the LED (QHY-174-GPS)

#6

Post by procyon12 »

Hell Jean-Francois,

Tested (latest SC 3.3, W7-64):

There is always something like this:

GPS Frame Control
Calibration Start Pos Adjust: 9661
Calibration End Pos Adjust : 3006827
GPS Calibration LED on/off : Off
GPS Freq Stabilizazion : On
GPS : On

Rectangle Selection : {X=250,Y=47,Width=224,Height=207}

Digit position selection: 100 10
SC Cal_Start_Pos : 9661
Cal_Start_Pos list: [9561L, 9651L, 9661L, 9671L, 9761L]
9561 311.994
9651 312.072
9661 311.653
9671 311.308
9761 312.718

Min / Max : 311.308143547 312.718426501
average: 312.013285024

Traceback (most recent call last):
File "<string>", line 149, in <module>
File "<string>", line 65, in LED_Start_search_L
Exception: Der double-Typ kann nicht implizit in long konvertiert werden. Es ist bereits eine explizite Konvertierung vorhanden (möglicherweise fehlt eine Umwandlung).
>>>


But with 16bit I have the following problem ... SharpCap automatic setting does not work with exposure time above ~ 13 ms ... both LED parameters are too low (Start: ~4600, End: ~ 3200)
This I cannot reproduce, what are your settings (Capt. Profile)?

BTW regarding Python: maybe you know PyMovie/Pyote (http://occultations.org/observing/software/pymovie/) to reduce occultation data? And for these SW one have to install Anaconda which includes Spyder (with numpy ...).

Cheers

Christian
Jean-Francois
Posts: 360
Joined: Sun Oct 13, 2019 10:52 am
Location: Germany

Re: Automatic adjustment of the LED (QHY-174-GPS)

#7

Post by Jean-Francois »

Hello Christian,

I test/use the different scripts only on the SC 3.2 version (32 or 64 bit).

I test now with the SC 3.3 beta ... and I have the same error as you have.

...
Digit position selection: 100 10
SC Cal_Start_Pos : 7421
Cal_Start_Pos list: [7321L, 7411L, 7421L, 7431L, 7521L]
7321 2.232
7411 39.234
7421 42.759

Min / Max : 2.23226291972 42.7587410510
average: 22.4955019854

Traceback (most recent call last):
File "<string>", line 150, in <module>
File "<string>", line 66, in LED_Start_search_L
Exception: Der double-Typ kann nicht implizit in long konvertiert werden. Es ist bereits eine explizite Konvertierung vorhanden (möglicherweise fehlt eine Umwandlung).
>>>

I think that (Iron)Python has only "integer" and "float" number format ... not "Long".
I know the Long or Double coming from C, C++ or C# ... Robin, is that correct ?

I try in my script to add explicit conversion from int to float ... but if the command "SharpCap.SelectedCamera.Controls[20].Value = Pnew"
wait for Long and receive only float ... I have no idea.

Also please use the SC 3.2 version for the next test.
In addition, the rectangle selection has to be place above the LED illumination area with the highest intensity (and maybe a little bit larger).


Regards,
Jean-Francois
procyon12
Posts: 253
Joined: Tue Jan 14, 2020 11:32 am

Re: Automatic adjustment of the LED (QHY-174-GPS)

#8

Post by procyon12 »

Hi,

Just tested various settings (SC 3.2.6433.0 32bit, W7-64):

Seems very good, there was no case with wrong/no calibration. And yes, very quick (like Tour de France :-))

Christian
Jean-Francois
Posts: 360
Joined: Sun Oct 13, 2019 10:52 am
Location: Germany

Re: Automatic adjustment of the LED (QHY-174-GPS)

#9

Post by Jean-Francois »

Hello,

I have a quick look of the value coming from the command "SharpCap.SelectedCamera.Controls[19].Value" in SC 3.2 and SC 3.3 ...

Why the value are now (integer) Long ? Only Robin can answer.

Here left with SC 3.2 and right with SC 3.3:
Long_integer_SC3.3.png
Long_integer_SC3.3.png (260.08 KiB) Viewed 2524 times
Regards,
Jean-Francois
Jean-Francois
Posts: 360
Joined: Sun Oct 13, 2019 10:52 am
Location: Germany

Re: Automatic adjustment of the LED (QHY-174-GPS)

#10

Post by Jean-Francois »

Hello,

I have not 1 new script, but 2 (for the price of none).

First how to use the script ? ...
- start SharpCap (SC 3.2 and SC 3.3, note that I test only on the 64 bit version)
- connect QHY-174-GPS camera (I have no idea what happen if it is only the QHY-174 camera)
- switch on the LED illumination ** (for the first test, no GPS is needed, the camera must be covered)
- move the USB traffic or change the exposure time (so that SC fill the Start/End Pos values)
- show "The Image Histogram" window
- activate the "FX Selection Area" (for showing the red selection rectangle)
- move and scale the selection rectangle above the most intense region of the LED illumination
- start the script
** I add in this new version the automatic switch-on of the LED in case that the LED is off (and switch-off after the LED calibration).

The first script is the "single" LED calibration with the actual settings (8/16 bit, exposure time, USB Traffic, ...).
I test with 8 bit + different USB Traffic => all OK with my camera/computer
I test with 16 bit => some problems (and some line code to solve it) ... the SC Start/End Position are all far to the correct values (~ 4000 delta).
If Robin correct the starting values for 16 bit, then it will be possible update the script (or it is a special case with my camera).

The second script performs the LED calibration from a list of user defined exposure time (you should modify the variable Time_List).
At the end, the script gives a summary of all the Start/End Position with the "LED-time" (for me in 8 bit all the time ~ 0.025 ms difference to the exposure time in SC).

Code: Select all

import time
import math


# (Begin) - Parameter to be changed by the user
search_loop = 10						# Number of fine search
power_threshold = 4						# (10**power_threshold) digit
slope = 1.2								# value between 1.0 and 1.3
# (End)   - Parameter to be changed by the user


Cal_End_Pos = SharpCap.SelectedCamera.Controls[19].Value
Cal_Start_Pos = SharpCap.SelectedCamera.Controls[20].Value
Colour_Space = SharpCap.SelectedCamera.Controls.ColourSpace.Value

LED_status = SharpCap.SelectedCamera.Controls[21].Value
print LED_status
if (LED_status == "Off"):
    SharpCap.SelectedCamera.Controls[21].Value = "On"

print SharpCap.SelectedCamera.Controls[18]
print("Calibration Start Pos Adjust: %i") % (Cal_Start_Pos)
print("Calibration End Pos Adjust  : %i") % (Cal_End_Pos)
print("GPS Calibration LED on/off  : %s") % (SharpCap.SelectedCamera.Controls[21].Value)
print("GPS Freq Stabilization      : %s") % (SharpCap.SelectedCamera.Controls[22].Value)
print("GPS                         : %s") % (SharpCap.SelectedCamera.Controls[23].Value)
print

cloneRect = SharpCap.Transforms.SelectionRect
print("Rectangle Selection : "), cloneRect
print

expos_ms = SharpCap.SelectedCamera.Controls.Exposure.ExposureMs
#wait_time = 2.1 *(expos_ms / 1000.0)
wait_time = 2.1 *(expos_ms / 1000.0) + 0.1

def framehandler(sender, args):
    if (dumpdata):
        global Mean
        cutout = args.Frame.CutROI(SharpCap.Transforms.SelectionRect)
        Stat = cutout.GetStats()
        Mean = Stat.Item1
        cutout.Release()

def evthandler(sender, args):
    if (SharpCap.SelectedCamera != None):
        SharpCap.SelectedCamera.FrameCaptured -= framehandler

def monitorFrames():
    SharpCap.SelectedCamera.FrameCaptured += framehandler

def Search_next_L(M, a):
    k = 0
    while (M[k][1] < a):
        k = k + 1
    return(math.floor((M[k][0] + M[k-1][0]) / 2.0))

def Search_next_R(M, a):
    k = 0
    while (M[k][1] > a):
        k = k + 1
    return(math.floor((M[k][0] + M[k-1][0]) / 2.0))

def LED_Start_search_L(Pos, LED, n):
    P = Pos
    L = LED
    for i in range(0,n):
        average = (min(L) + max(L)) / 2.0
        M = zip(P,L)
        M.sort()
        Pnew = Search_next_L(M,average)
        SharpCap.SelectedCamera.Controls[20].Value = int(Pnew)
        time.sleep(wait_time)
        P.append(Pnew)
        L.append(Mean)
        print("%i   %7.3f") % (Pnew, L[-1])
        if (abs((L[-1] - average)/average) < 0.05):
            break
    M = zip(P,L)
    M.sort()
    return(M)

def LED_Start_search_R(Pos, LED, n):
    P = Pos
    L = LED
    loop = 0
    for i in range(0,n):
        average = (min(L) + max(L)) / 2.0
        M = zip(P,L)
        M.sort()
        Pnew = Search_next_R(M,average)
        SharpCap.SelectedCamera.Controls[19].Value = int(Pnew)
        time.sleep(wait_time)
        P.append(Pnew)
        L.append(Mean)
        print("%i   %7.3f") % (Pnew, L[-1])
        if (abs((L[-1] - average)/average) < 0.05):
            break
    M = zip(P,L)
    M.sort()
    return(M)


dumpdata = True
SharpCap.CaptureEvent += evthandler
monitorFrames()


# *****************************************************************************
# LED Calibration Start Position Adjustment

if (Colour_Space == "MONO16"):
    cal_step = math.floor(math.log10(Cal_Start_Pos))
if (Colour_Space == "MONO8"):
    cal_step = math.floor(math.log10(Cal_Start_Pos)) - 1

Pos = [Cal_Start_Pos]
if (cal_step > power_threshold):
    cal_step = power_threshold
print("Digit position selection:  "),
for p in range(int(cal_step), 0, -1):
    print 10**p,
    if (Colour_Space == "MONO16"):
        Pos.append(Cal_Start_Pos + 10**(p+1))
    Pos.append(Cal_Start_Pos + 10**p)
    Pos.append(Cal_Start_Pos - 10**p)

Pos.sort()
print
print("SC Cal_Start_Pos  : "), Cal_Start_Pos
print("Cal_Start_Pos list: "), Pos

LED = []
loop = 1000
for L in range(0,len(Pos)):
    SharpCap.SelectedCamera.Controls[20].Value = int(Pos[L])

    time.sleep(wait_time)
    LED.append(Mean)

    if (L==0):
        print("%i   %8.3f") % (Pos[L], LED[L])
    else:
        print("%i   %8.3f") % (Pos[L], LED[L]),
        average = (LED[L]+LED[L-1])/2.0
        diff = LED[L]-LED[L-1]
        print
        if (abs(diff / average) > slope):
            loop = L
    if (loop == (L - 1)):
        break

print
print("Min / Max  : "), min(LED), "  ", max(LED)
print("average: "), (min(LED) + max(LED)) / 2.0
Pos = Pos[0 : len(LED)]
M = zip(Pos, LED)
M.sort()
print

time.sleep(wait_time)
Result = LED_Start_search_L(Pos, LED, search_loop)
Cal_Start_Pos = Pos[-1]
SharpCap.SelectedCamera.Controls[20].Value = int(Cal_Start_Pos)

print
# END    LED Calibration Start Position Adjustment
# *****************************************************************************

# *****************************************************************************
# LED Calibration End Position Adjustment

cal_step = math.floor(math.log10(Cal_End_Pos)) - 1
Pos = [Cal_End_Pos]
if (cal_step > power_threshold):
    cal_step = power_threshold
print("Digit position selection:  "),
for p in range(int(cal_step), 0, -1):
    print 10**p,
    Pos.append(Cal_End_Pos + 10**p)
    Pos.append(Cal_End_Pos - 10**p)


Pos.sort()
print
print("SC Cal_End_Pos  : "), Cal_End_Pos
print("Cal_End_Pos list: "), Pos

LED = []
loop = 1000
for L in range(0,len(Pos)):
    SharpCap.SelectedCamera.Controls[19].Value = int(Pos[L])

    time.sleep(wait_time)
    LED.append(Mean)

    if (L==0):
        print("%i   %8.3f") % (Pos[L], LED[L])
    else:
        print("%i   %8.3f") % (Pos[L], LED[L]),
        average = (LED[L]+LED[L-1])/2.0
        diff = LED[L]-LED[L-1]
        print
        if (abs(diff / average) > slope):
            loop = L
    if (loop == (L - 1)):
        break

print
print("Min / Max  : "), min(LED), "  ", max(LED)
print("Half height: "), (min(LED) + max(LED)) / 2.0
Pos = Pos[0 : len(LED)]
M = zip(Pos, LED)
M.sort()
print

time.sleep(wait_time)
Result = LED_Start_search_R(Pos, LED, search_loop)
Cal_End_Pos = Pos[-1]
SharpCap.SelectedCamera.Controls[19].Value = int(Cal_End_Pos)

# END    LED Calibration End Position Adjustment
# *****************************************************************************

dumpdata = False
print
print("***************************")
print("Cal_Start_Pos : %i") % (Cal_Start_Pos)
print("Cal_En_Pos    : %i") % (Cal_End_Pos)
print("***************************")

if (LED_status == "Off"):
    SharpCap.SelectedCamera.Controls[21].Value = "Off"


And here the script for a list of exposure time:

Code: Select all

import time
import math


# (Begin) - Parameter to be changed by the user
search_loop = 12						# Number of fine search
power_threshold = 4						# (10**power_threshold) digit
slope = 1.2								# value between 1.0 and 1.3

Time_List = [20] # [ms]

#Time_List = [1.0,1.05,1.1,1.15,1.2,1.25,1.3,1.35,1.4,1.45,1.5,1.55,1.6,1.65,1.7,1.75,1.8,1.85,1.9,1.95,2.0] # [ms]
#Time_List = [2.0,2.2,2.4,2.6,2.8,3.0,3.2,3.4,3.6,3.8,4.0,4.2,4.4,4.6,4.8,5.0,5.2,5.4,5.6,5.8,6.0,6.2,6.4,6.6,6.8,7.0,7.2,7.4,7.6,7.8,8.0,8.2,8.4,8.6,8.8,9.0,9.2,9.4,9.6,9.8,10.0] # [ms]
#Time_List = [7.05,7.1,7.15,7.2,7.25,7.3,7.35,7.4,7.45,7.5,7.55,7.6,7.65,7.7,7.75,7.8,7.85,7.9,7.95] # [ms]
#Time_List = [1,1.5,2,2.5,3,3.5,4,5,6,7,7.2,7.4,7.6,7.8,8,9,10,11,12,13,14,15,20,40,60,80,100,150,200,250,500,750,1000] # [ms]
#Time_List = [10,20,30,40,50,60,70,80,90,100]
#Time_List = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50] # [ms]
#Time_List = [51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100] # [ms]
#Time_List = [12.1,12.2,12.3,12.4,12.5,12.6,12.7,12.8,12.9] # [ms]

# (End)   - Parameter to be changed by the user

SharpCap.SelectedCamera.Controls.Exposure.ExposureMs = Time_List[0]

LED_status = SharpCap.SelectedCamera.Controls[21].Value
if (LED_status == "Off"):
    SharpCap.SelectedCamera.Controls[21].Value = "On"

print "Date:",  time.ctime()
print SharpCap.SelectedCamera.Controls[18]
print("GPS Calibration LED on/off  : %s") % (SharpCap.SelectedCamera.Controls[21].Value)
print("GPS Freq Stabilization      : %s") % (SharpCap.SelectedCamera.Controls[22].Value)
print("GPS                         : %s") % (SharpCap.SelectedCamera.Controls[23].Value)

cloneRect = SharpCap.Transforms.SelectionRect
print("Rectangle Selection         : "), cloneRect
print


def framehandler(sender, args):
    if (dumpdata):
        global Mean
        cutout = args.Frame.CutROI(SharpCap.Transforms.SelectionRect)
        Stat = cutout.GetStats()
        Mean = Stat.Item1
        cutout.Release()

def evthandler(sender, args):
    if (SharpCap.SelectedCamera != None):
        SharpCap.SelectedCamera.FrameCaptured -= framehandler

def monitorFrames():
    SharpCap.SelectedCamera.FrameCaptured += framehandler

def Search_next_L(M, a):
    k = 0
    while (M[k][1] < a):
        k = k + 1
    return(math.floor((M[k][0] + M[k-1][0]) / 2.0))

def Search_next_R(M, a):
    k = 0
    while (M[k][1] > a):
        k = k + 1
    return(math.floor((M[k][0] + M[k-1][0]) / 2.0))

def LED_Start_search(Pos, LED, n):
    P = Pos
    L = LED
    for i in range(0,n):
        average = (min(L) + max(L)) / 2.0
        M = zip(P,L)
        M.sort()
        Pnew = Search_next_L(M,average)
        SharpCap.SelectedCamera.Controls[20].Value = int(Pnew)
        time.sleep(wait_time)
        P.append(Pnew)
        L.append(Mean)
        print("%i   %7.3f") % (Pnew, L[-1])
        if (abs((L[-1] - average)/average) < 0.1):
            break
    M = zip(P,L)
    M.sort()
    return(M)

def LED_End_search(Pos, LED, n):
    P = Pos
    L = LED
    for i in range(0,n):
        average = (min(L) + max(L)) / 2.0
        M = zip(P,L)
        M.sort()
        Pnew = Search_next_R(M,average)
        SharpCap.SelectedCamera.Controls[19].Value = int(Pnew)
        time.sleep(wait_time)
        P.append(Pnew)
        L.append(Mean)
        print("%i   %7.3f") % (Pnew, L[-1])
        if (abs((L[-1] - average)/average) < 0.1):
            break
    M = zip(P,L)
    M.sort()
    return(M)


# LED Calibration Start Position Adjustment
def LED_Start(expos_ms):
    if (Colour_Space == "MONO16"):
        cal_step = math.floor(math.log10(Cal_Start_Pos))
    if (Colour_Space == "MONO8"):
        cal_step = math.floor(math.log10(Cal_Start_Pos)) - 1

    Pos = [Cal_Start_Pos]
    if (cal_step > power_threshold):
        cal_step = power_threshold
    print
    print("Digit position selection:  "),
    for p in range(int(cal_step), 0, -1):
        print 10**p,
        if (Colour_Space == "MONO16"):
            Pos.append(Cal_Start_Pos + 10**(p+1))
        Pos.append(Cal_Start_Pos + 10**p)
        Pos.append(Cal_Start_Pos - 10**p)

    Pos.sort()
    print
    print("Cal_Start_Pos list: "), Pos

    LED = []
    loop = 1000
    for L in range(0,len(Pos)):
        SharpCap.SelectedCamera.Controls[20].Value = int(Pos[L])
        
        time.sleep(wait_time)
        LED.append(Mean)
        
        if (L==0):
            print("%i   %8.3f") % (Pos[L], LED[L])
        else:
            print("%i   %8.3f") % (Pos[L], LED[L]),
            average = (LED[L]+LED[L-1])/2.0
            diff = LED[L]-LED[L-1]
            print
            if (abs(diff / average) > slope):
                loop = L
        if (loop == (L - 1)):
            print "Break"
            break

    print("Min / Max  : %6.3f   %6.3f") % (min(LED), max(LED))
    print("Half height: %6.3f") % ((min(LED) + max(LED)) / 2.0)
    Pos = Pos[0 : len(LED)]
    M = zip(Pos, LED)
    M.sort()

    time.sleep(wait_time)
    Result = LED_Start_search(Pos, LED, search_loop)

    SharpCap.SelectedCamera.Controls[20].Value = int(Pos[-1])
    print
    return(Pos[-1])

# LED Calibration End Position Adjustment
def LED_End(expos_ms):
    SharpCap.SelectedCamera.Controls[19].Value = Cal_End_Pos + 1
    SharpCap.SelectedCamera.Controls[19].Value = Cal_End_Pos - 1

    cal_step = math.floor(math.log10(Cal_End_Pos)) - 1
    Pos = [Cal_End_Pos]
    if (cal_step > power_threshold):
        cal_step = power_threshold
    print
    print("Digit position selection:  "),
    for p in range(int(cal_step), 0, -1):
        print 10**p,
        Pos.append(Cal_End_Pos + 10**p)
        Pos.append(Cal_End_Pos - 10**p)

    Pos.sort()
    print
    print("Cal_End_Pos list: "), Pos

    LED = []
    loop = 1000
    for L in range(0,len(Pos)):
        SharpCap.SelectedCamera.Controls[19].Value = int(Pos[L])

        time.sleep(wait_time)
        LED.append(Mean)

        if (L==0):
            print("%i   %8.3f") % (Pos[L], LED[L])
        else:
            print("%i   %8.3f") % (Pos[L], LED[L]),
            average = (LED[L]+LED[L-1])/2.0
            diff = LED[L]-LED[L-1]
            print
            if (abs(diff / average) > slope):
                loop = L
        if (loop == (L - 1)):
            print "Break"
            break

    print("Min / Max  : %6.3f   %6.3f") % (min(LED), max(LED))
    print("Half height: %6.3f") % ((min(LED) + max(LED)) / 2.0)
    Pos = Pos[0 : len(LED)]
    M = zip(Pos, LED)
    M.sort()

    time.sleep(wait_time)
    Result = LED_End_search(Pos, LED, search_loop)

    SharpCap.SelectedCamera.Controls[19].Value = int(Pos[-1])

    print
    return(Pos[-1])

# *****************************************************************************

print "Time sequence  [ms] :", Time_List
Cal_Start = []
Cal_End = []
SC_Start = []
SC_End = []
time_start = time.clock()

dumpdata = True
SharpCap.CaptureEvent += evthandler
monitorFrames()

for T in range(0,len(Time_List)):
    SharpCap.SelectedCamera.Controls.Exposure.ExposureMs = Time_List[T]
    expos_ms = SharpCap.SelectedCamera.Controls.Exposure.ExposureMs
    wait_time = 2.1 *(expos_ms / 1000.0) + 0.1
    Cal_End_Pos = SharpCap.SelectedCamera.Controls[19].Value
    Cal_Start_Pos = SharpCap.SelectedCamera.Controls[20].Value
    SC_End.append(int(Cal_End_Pos))
    SC_Start.append(int(Cal_Start_Pos))
    print
    print "Exposure Time: ", Time_List[T], " ms"
    print("=================================")
    Cal_Start.append(int(LED_Start(Time_List[T])))
    Cal_End.append(int(LED_End(Time_List[T])))
    SharpCap.SelectedCamera.Controls[19].Value = Cal_End[-1]
    SharpCap.SelectedCamera.Controls[20].Value = Cal_Start[-1]

time_end = time.clock()
print
print
print("Camera Settings:")
print("========================================================")
print("Colour Space : "), SharpCap.SelectedCamera.Controls.ColourSpace.Value
print("Binning      : "), SharpCap.SelectedCamera.Controls.Binning.Value
print("USB Traffic  : "), SharpCap.SelectedCamera.Controls.Usb.Value
print
print "Calculation time: ", round((time_end - time_start)/60, 2), " minutes"
print
print(" [ms]  Cal_Start    Cal_End       Exp.   LED-time    Delta   SC_Start     SC_End ")
print("================================================================================")
for T in range(0,len(Time_List)):
    LED_time = (Cal_End[T] - Cal_Start[T]) / 75000.0
    Diff_time = Time_List[T] - LED_time
    print("%5s %10s %10s %10.2f %10.3f %8.3f") % (Time_List[T],Cal_Start[T],Cal_End[T],Time_List[T],LED_time,Diff_time),
    print("%10s %10s") % (SC_Start[T],SC_End[T])

dumpdata = False

if (LED_status == "Off"):
    SharpCap.SelectedCamera.Controls[21].Value = "Off"

For example here the result of several LED calibration ...
You can try to calibrate manually the same list ... it is now much quicker with my script ;)

Code: Select all

Colour Space :  MONO8
Binning      :  1x1
USB Traffic  :  0

Calculation time:  0.85  minutes

 [ms]  Cal_Start    Cal_End       Exp.   LED-time    Delta   SC_Start     SC_End 
================================================================================
  1.0     486083     559530       1.00      0.979    0.021     486718     559715
 1.05     482502     559530       1.05      1.027    0.023     482968     559715
  1.1     478467     559530       1.10      1.081    0.019     479218     559715
 1.15     474885     559530       1.15      1.129    0.021     475468     559715
  1.2     471301     559530       1.20      1.176    0.024     471718     559715
 1.25     467270     559530       1.25      1.230    0.020     467968     559715
  1.3     463685     559530       1.30      1.278    0.022     464218     559715
 1.35     459653     559530       1.35      1.332    0.018     460468     559715
  1.4     456069     559530       1.40      1.379    0.021     456718     559715
 1.45     452484     559530       1.45      1.427    0.023     452968     559715
  1.5     448453     559530       1.50      1.481    0.019     449218     559715
 1.55     444868     559530       1.55      1.529    0.021     445468     559715
  1.6     441283     559530       1.60      1.577    0.023     441718     559715
 1.65     437252     559530       1.65      1.630    0.020     437968     559715
  1.7     433668     559530       1.70      1.678    0.022     434218     559715
 1.75     430084     559530       1.75      1.726    0.024     430468     559715
  1.8     426051     559530       1.80      1.780    0.020     426718     559715
 1.85     422467     559530       1.85      1.828    0.022     422968     559715
  1.9     418435     559530       1.90      1.881    0.019     419218     559715
 1.95     414854     559530       1.95      1.929    0.021     415468     559715
    2     411269     559530       2.00      1.977    0.023     411718     559715


Colour Space :  MONO8
Binning      :  1x1
USB Traffic  :  0

Calculation time:  2.89  minutes

 [ms]  Cal_Start    Cal_End       Exp.   LED-time    Delta   SC_Start     SC_End 
================================================================================
    1     486083     559530       1.00      0.979    0.021     486718     559715
    2     411266     559530       2.00      1.977    0.023     411718     559715
    3     336006     559530       3.00      2.980    0.020     336718     559715
    4     261189     559530       4.00      3.978    0.022     261718     559715
    5     185924     559530       5.00      4.981    0.019     186718     559715
    6     111107     559530       6.00      5.979    0.021     111718     559715
    7      36294     559530       7.00      6.976    0.024      36718     559715
    8       6276     604330       8.00      7.974    0.026       6301     604298
    9       6276     679144       9.00      8.972    0.028       6301     679298
   10       6276     754408      10.00      9.975    0.025       6301     754298
   11       6276     829225      11.00     10.973    0.027       6301     829298
   12       6276     904039      12.00     11.970    0.030       6301     904298
   13       6276     979303      13.00     12.974    0.026       6301     979298
   14       6276    1054120      14.00     13.971    0.029       6301    1054298
   15       6276    1129386      15.00     14.975    0.025       6301    1129298
   16       6276    1204200      16.00     15.972    0.028       6301    1204298
   17       6276    1279015      17.00     16.970    0.030       6301    1279298
   18       6276    1354282      18.00     17.973    0.027       6301    1354298
   19       6276    1429095      19.00     18.971    0.029       6301    1429298
   20       6276    1504361      20.00     19.974    0.026       6301    1504298
   21       6276    1579176      21.00     20.972    0.028       6301    1579298
   22       6276    1654440      22.00     21.976    0.024       6301    1654298
   23       6276    1729256      23.00     22.973    0.027       6301    1729298
   24       6276    1804071      24.00     23.971    0.029       6301    1804298
   25       6276    1879335      25.00     24.974    0.026       6301    1879298
   26       6276    1954151      26.00     25.972    0.028       6301    1954298
   27       6276    2029415      27.00     26.975    0.025       6301    2029298
   28       6276    2104231      28.00     27.973    0.027       6301    2104298
   29       6276    2179050      29.00     28.970    0.030       6301    2179298
   30       6276    2254313      30.00     29.974    0.026       6301    2254298
   31       6276    2329127      31.00     30.971    0.029       6301    2329298
   32       6276    2404392      32.00     31.975    0.025       6301    2404298
   33       6276    2479209      33.00     32.972    0.028       6301    2479298
   34       6276    2554025      34.00     33.970    0.030       6301    2554298
   35       6276    2629290      35.00     34.974    0.026       6301    2629298
   36       6276    2704106      36.00     35.971    0.029       6301    2704298
   37       6276    2779369      37.00     36.975    0.025       6301    2779298
   38       6276    2854183      38.00     37.972    0.028       6301    2854298
   39       6276    2929447      39.00     38.976    0.024       6301    2929298
   40       6276    3004265      40.00     39.973    0.027       6301    3004298
   41       6276    3079081      41.00     40.971    0.029       6301    3079298
   42       6276    3154344      42.00     41.974    0.026       6301    3154298
   43       6276    3229162      43.00     42.972    0.028       6301    3229298
   44       6276    3304426      44.00     43.975    0.025       6301    3304298
   45       6276    3379240      45.00     44.973    0.027       6301    3379298
   46       6276    3454057      46.00     45.970    0.030       6301    3454298
   47       6276    3529319      47.00     46.974    0.026       6301    3529298
   48       6276    3604137      48.00     47.971    0.029       6301    3604298
   49       6276    3679401      49.00     48.975    0.025       6301    3679298
   50       6276    3754217      50.00     49.973    0.027       6301    3754298


Colour Space :  MONO8
Binning      :  1x1
USB Traffic  :  0

Calculation time:  4.77  minutes

 [ms]  Cal_Start    Cal_End       Exp.   LED-time    Delta   SC_Start     SC_End 
================================================================================
   51       6276    3829032      51.00     50.970    0.030       6301    3829298
   52       6276    3904295      52.00     51.974    0.026       6301    3904298
   53       6276    3979113      53.00     52.971    0.029       6301    3979298
   54       6276    4054375      54.00     53.975    0.025       6301    4054298
   55       6276    4129194      55.00     54.972    0.028       6301    4129298
   56       6276    4204457      56.00     55.976    0.024       6301    4204298
   57       6276    4279273      57.00     56.973    0.027       6301    4279298
   58       6276    4354088      58.00     57.971    0.029       6301    4354298
   59       6276    4429353      59.00     58.974    0.026       6301    4429298
   60       6276    4504169      60.00     59.972    0.028       6301    4504298
   61       6276    4579433      61.00     60.975    0.025       6301    4579298
   62       6276    4654248      62.00     61.973    0.027       6301    4654298
   63       6276    4729064      63.00     62.971    0.029       6301    4729298
   64       6276    4804330      64.00     63.974    0.026       6301    4804298
   65       6276    4879144      65.00     64.972    0.028       6301    4879298
   66       6276    4954408      66.00     65.975    0.025       6301    4954298
   67       6276    5029225      67.00     66.973    0.027       6301    5029298
   68       6276    5104041      68.00     67.970    0.030       6301    5104298
   69       6276    5179303      69.00     68.974    0.026       6301    5179298
   70       6276    5254120      70.00     69.971    0.029       6301    5254298
   71       6276    5329386      71.00     70.975    0.025       6301    5329298
   72       6276    5404200      72.00     71.972    0.028       6301    5404298
   73       6276    5479015      73.00     72.970    0.030       6301    5479298
   74       6276    5554282      74.00     73.973    0.027       6301    5554298
   75       6276    5629095      75.00     74.971    0.029       6301    5629298
   76       6276    5704361      76.00     75.974    0.026       6301    5704298
   77       6276    5779176      77.00     76.972    0.028       6301    5779298
   78       6276    5854440      78.00     77.976    0.024       6301    5854298
   79       6276    5929256      79.00     78.973    0.027       6301    5929298
   80       6276    6004071      80.00     79.971    0.029       6301    6004298
   81       6276    6079335      81.00     80.974    0.026       6301    6079298
   82       6276    6154151      82.00     81.972    0.028       6301    6154298
   83       6276    6229415      83.00     82.975    0.025       6301    6229298
   84       6276    6304231      84.00     83.973    0.027       6301    6304298
   85       6276    6379050      85.00     84.970    0.030       6301    6379298
   86       6276    6454313      86.00     85.974    0.026       6301    6454298
   87       6276    6529127      87.00     86.971    0.029       6301    6529298
   88       6276    6604392      88.00     87.975    0.025       6301    6604298
   89       6276    6679209      89.00     88.972    0.028       6301    6679298
   90       6276    6754025      90.00     89.970    0.030       6301    6754298
   91       6276    6829290      91.00     90.974    0.026       6301    6829298
   92       6276    6904106      92.00     91.971    0.029       6301    6904298
   93       6276    6979369      93.00     92.975    0.025       6301    6979298
   94       6276    7054183      94.00     93.972    0.028       6301    7054298
   95       6276    7129447      95.00     94.976    0.024       6301    7129298
   96       6276    7204265      96.00     95.973    0.027       6301    7204298
   97       6276    7279081      97.00     96.971    0.029       6301    7279298
   98       6276    7354344      98.00     97.974    0.026       6301    7354298
   99       6276    7429162      99.00     98.972    0.028       6301    7429298
  100       6276    7504426     100.00     99.975    0.025       6301    7504298
In some case, the LED calibration time can be shorter, but for the use for all exposure time, I add some delay before a new image is used after the setting of the LED Start/End Position.

If you find a combination of settings that produce an error, please communicate the used camera settings.

Feature request for SC 3.3.1 ... a button in the control panel "GPS Controls" that perform the same LED calibration as my script.

Regards,
Jean-Francois
Post Reply