Dim Path
Path = "C:\AAnew\ASTRONOMYSOFTWARE\_MessierMarathon\01Apr2011\"
for i = 1 To 110
Set doc1= CreateObject("MaxIm.Document")
Set doc2= CreateObject("MaxIm.Document")
Set doc3= CreateObject("MaxIm.Document")
doc1.OpenFile path + "M" + CStr(i) + "-70s-0001.fit"
doc1.Calibrate
doc1.ConvertColor 0, 100, 81, 100, 0, 1
doc1.FlattenBackground
doc1.SaveFile path + "b1.fit", 3, 0, 1
doc2.OpenFile path + "M" + CStr(i) + "-70s-0002.fit"
doc2.Calibrate
doc2.ConvertColor 0, 100, 81, 100, 0, 1
doc2.FlattenBackground
doc2.SaveFile path + "b2.fit", 3, 0, 1
doc3.OpenFile path + "M" + CStr(i) + "-70s-0003.fit"
doc3.Calibrate
doc3.ConvertColor 0, 100, 81, 100, 0, 1
doc3.FlattenBackground
doc3.SaveFile path + "b3.fit", 3, 0, 1
doc3.CombineImages 1, 0, 1, 0
doc3.AdjustSaturation 200
doc3.KernelFilter 6, 7
doc3.FlattenBackground
doc3.SaveFile path + "M" + CStr(i) + ".fit", 3, 0, 1
doc1.Close
doc2.Close
doc3.Close