Script d'acquisition pour le PAP,  utilisé lors de l'eclipse du 11 Aout 99 pour la camera 2x2K avec le CN212


print "test de recherche de temps de Pose"

bin=2
Path$="C:\CCD_2K_Eclipse_99\"
offset=320

rem mettre un temps de pose "mini" ou on pense que ca ne saturera pas, car ca converge plus vite !
tempsposeInitial=50

rem valeurs qui NE tiennent pas compte du BINNING
X1=1024 - 300
X2=1024 + 300
Y1=1024 - 100
Y2=1024 + 100
SETBINNINGX bin
SETBINNINGY bin

maxiter=10
failure=0

SETWINDOW X1 Y1 X2 y2
iter=0

rem une iteration prend 6.5sec en bin 2x2
 

for i=1 maxiter
 
  print "Next iter. -> tempsDePose="  tempsposeInitial
 
  StartExposure tempsposeInitial

  WAITFORENDEXPOSURE

  GETLASTIMAGEEXPOSURE img
 
  STAT img Moyen MoyenCar Ecart Max Min Flux Mediane

  close img

  print "Max= " Max

  Max=max-offset

  if Max>16000 then
   tempsposeInitialR=tempsposeInitial/3.0

   ROUND tempsposeInitialR  tempsposeInitial
   if tempsposeinitial<50 then
     tempsposeInitial = 50
   endif

  else
 
   if max>14000 then
    i=maxiter
    print "temps de pose trouve !!"

   else
 
    TempsposeInitialR = TempsposeInitial * (15000/Max)
    ROUND tempsposeInitialR  tempsposeInitial

 
    if tempsposeinitial>2000 then
     tempsposeInitial = 2000
     i=maxiter
     print "temps de pose trunque au max!!"
     failure=1
    endif

    if tempsposeinitial<50 then
     tempsposeInitial = 50
     i=maxiter
     print "temps de pose trunque au min!!"
     failure=2
    endif

   endif
  endif
 
iter=iter+1
next i

print "tempsDePose FINAL="  tempsposeInitial "ms , iter= " iter
 
 

SETWINDOWFULLFRAME

StartExposure tempsposeInitial
print "Lecture image 1"
WAITFORENDEXPOSURE
GETLASTIMAGEEXPOSURE img
SAVECPA img Path$+"eclipse01bin2x2.cpa"
Close Img

StartExposure tempsposeInitial
print "Lecture image 2"
WAITFORENDEXPOSURE
GETLASTIMAGEEXPOSURE img
SAVECPA img Path$+"eclipse02bin2x2.cpa"
Close Img
 

StartExposure tempsposeInitial
print "Lecture image 3"
WAITFORENDEXPOSURE
GETLASTIMAGEEXPOSURE img
SAVECPA img Path$+"eclipse03bin2x2.cpa"
Close Img
 

StartExposure tempsposeInitial
print "Lecture image 4"
WAITFORENDEXPOSURE
GETLASTIMAGEEXPOSURE img
SAVECPA img Path$+"eclipse04bin2x2.cpa"
Close Img

rem si pause binning 1x1 augemnter le temps de pose par 4
SETBINNINGX 1
SETBINNINGY 1
tempsposeInitial=tempsposeInitial*4
StartExposure tempsposeInitial
print "Lecture image 5 bin 1x1"
WAITFORENDEXPOSURE
GETLASTIMAGEEXPOSURE img
SAVECPA img Path$+"eclipse05bin1x1.cpa"
Close Img
 

Print "Termine"