' folders needed - they must be create by hand before starting the sessions - I use to create a foldare using the date cartella = "c:\130421\m94\" cartella1 ="c:\130421\bin6\" cartella2 ="c:\130421\nonRiuscite\" ' it's a kind of log file - please write here new file accadimenti = "c:\130421\130421.txt" ' code of the object that will be the name of the saved files - you can change it code = "m94_60s_" ' imaging time for each subs in seconds - you can change it t = 60 ' total number of exposures - you can change it totale = 2400 ' don't touch i = 1 ' maximum distance of the object from the center for moving the telescope - you can change it following your expectation maxDist = 0.05 ' object to be imaged (see instructions for telescope list) objId = Telescope.List.Name(1) ' don't touch maxPsn = 20 ' don't touch psn = 0 ' maximum distance from the center to start automatic goto - usually this will never be used maxDistGoto = 0.4 ' don't touch these block of variables k = 0 kk = 0 maxAumento = 5 aumento = 0 n1 = 0 limitePSN = 0 sub centra(objId) plateSolve(objId) if risultatoPlateSolve = 1 then analizzaImmagine(objId) if dist < maxDist then print "non serve centrare...espongo" Output.Save(accadimenti) Telescope.SyncTo(Image.RA,Image.DEC) else Telescope.SyncTo(Image.RA,Image.DEC) gotoOggetto(objId) verificaCentro(objId) endif else fileZ = cartella1 + code + n + ".fit" Image.Save(fileZ) print fileZ print "plateSolve non riuscito" Output.Save(accadimenti) k = 0 Image.Stars.Find(k) kk = Image.Stars.Count if kk > 3 Then print kk print "trovate stelle ma non eseguo goto" print aumento Output.Save(accadimenti) if aumento < maxAumento Then aumento1 = aumento+1 aumento = aumento1 Else gotoOggetto(objId) aumento = 0 VerificaCentro(objid) Endif else print kk print "mancanza stelle - nuvole ?" Output.Save(accadimenti) endif endif endsub sub verificaCentro(objId) while dist > maxDist esponiPerCentrare(1,1) plateSolve(objId) if risultatoPlateSolve = 1 then analizzaImmagine(objId) if (dist < maxDistGoto) and (dist > maxDist) then muoviTelescopio(obJid) else if (dist > maxDistGoto) then print "superato maxDistGoto - procedo con SyncTo e goto" Telescope.SyncTo(Image.RA,Image.DEC) gotoOggetto(objId) endif endif else k = 0 Image.Stars.Find(k) kk = Image.Stars.Count if kk > 3 Then print kk print "trovate stelle - eseguo goto" Output.Save(accadimenti) Telescope.SyncTo(Image.RA,Image.DEC) gotoOggetto(objId) analizzaImmagine() else print kk print "mancanza stelle - nuvole ?" Output.Save(accadimenti) endif endif endwhile endsub sub analizzaImmagine(objId) dist = Image.DistanceFrom(ra,de) print dist,Image.RA,Image.DEC raOff = Image.RA - ra deOff = Image.DEC - de azza = code + n print azza,raOff,deOff Output.Save(accadimenti) endsub sub plateSolve(objId) minPSolve = 4 nPSolve = 4 maxPSolve = 180 vPSolve = 4 print "verifico se devo centrare" ra = Telescope.List.Ra(1) de = Telescope.List.Dec(1) while vPSolve < maxPSolve risultatoPlateSolve = Image.FindCoordinates(ra,de,vPSolve,5) print risultatoPlateSolve, vPSolve if risultatoPlateSolve = 1 Then Break Endif vPSolve = nPSolve+vPSolve endwhile endsub sub muoviTelescopio(objId) print "Muovo il telescopio" Output.Save(accadimenti) Telescope.Goto(ra - raOff, de - deOff) pause(10) endsub sub gotoOggetto(objId) print "eseguoGoto" ra = Telescope.List.Ra(1) de = Telescope.List.Dec(1) Telescope.Goto(ra,de) pause(20) endsub sub esponi(expo,num) ' camera binning - pls change value among brackets if you need Camera.Binning(2) Camera.Start(expo) Camera.Wait n = str(num) while len(n) < 4 n = "0" + n endwhile file = cartella + code + n + ".fit" Image.FlipV Pause(1) Image.Save(file) print file endsub sub sequenza(objId,numExp) for i = 1 to numExp esponi(t,i) centra(objId) next i endsub sub esponiPerCentrare(expo,num) ' camera binning - pls change value among brackets if you need - but this sub is for centering only Camera.Binning(2) ' among brackets it's the exposure time for recentering only - you can change if yo need Camera.Start(8) Camera.Wait n1 = n1 + 1 n1 = str(n1) while len(n1) < 4 n1 = "0" + n1 endwhile fileX = cartella2 + code + n1 + ".fit" Image.FlipV Pause(1) Image.Save(fileX) print fileX endsub sub verificaPlateSolve(objId) if psn > maxPsn then limitePSN = 1 else psn = psn +1 endif endsub sub verificaPlateSolve1(objId) Image.Stars.Find(k) kk = Image.Stars.Count endsub sequenza(1,totale)