APSF //- Skymap Pro import script. //- Assumes data is in CSV format as exported by the DBLog2CSV.exe //- application provided in the Tools folder of a standard Skymap Pro //- installation. //- This script creates a new AstroPlanner plan document containing //- all the objects observed, together with the observations. //- Note that the import might take a while to do. Don't interrupt //- the app while this is happening. Go get some coffee instead. //- //- Paul Rodman, September 2007 //- //- NOTE: REQUIRES V1.5.9a14 or later. //- //- Version 1.0 (15 Sep 2007) //- Original version. // Format of DBLog2CSV.exe comma-separated output file: // Field # Contents // ------- -------- // 0 "Object" // 1 "ObjectType" // 2 "Magnitude" (mag*100) // 3 "RA" (ra*3600) // 4 "Dec" (dec*3600) // 5 "Alt" // 6 "Az" // 7 "Observer" // 8 "Date" (dd MMM yyyy hh:mm) // 9 "Duration" // 10 "SiteName" // 11 "SiteLat" // 12 "SiteLong" // 13 "SiteHeight" // 14 "Weather" // 15 "Seeing" // 16 "InsName" // 17 "InsAperture" // 18 "InsFocalRatio" // 19 "EyepieceName" // 20 "EyepieceFL" // 21 "EyepieceFOV" // 22 "EyepieceBarrel" // 23 "BarlowName" // 24 "BarlowPower" // 25 "Magnification" // 26 "FOV" // 27 "Aids" // 28 "Notes" // 29 "Image" dim f as APTextFile dim fields(-1),id,ids(-1) as string dim ob as APPlanObject dim obs as APObservation dim n as integer // Create and select a new plan print "You will now be asked for the name and path of a new plan document in which the objects and observations will be saved" n=NewPlan if n=0 then return // Cancelled if n<0 then print "Error: "+str(n) return end if SelectPlan(n) print "You will now be asked for the name and path of the Skymap Pro comma-separated file to import" // Open file to be imported f = ReadTextFile if f=nil then return // Skip heading line call f.ReadLine while not f.EOF fields=SplitComma(f.ReadLine) while ubound(fields)<29 fields.Append "" wend id=trim(fields(0)) if id<>"" then // Create object if necessary if ids.IndexOf(id)<0 then ids.Append id ob=NewObject() ob.ID=id ob.RA=val(fields(3))/3600.0 ob.Dec=val(fields(4))/3600.0 ob.Type=fields(1) if IsNumeric(fields(2)) then ob.Magnitude=val(fields(2))*0.01 else ob.Magnitude=99.0 n=n+1 end if // Create observation // Date: dd MMM yyyy hh:mm obs=ob.NewObservation(DateToDouble(left(fields(8),2)+"-"+ _ mid(fields(8),4,3)+"-"+mid(fields(8),8,4)+mid(fields(8),12))) obs.Site=fields(10) obs.Seeing=fields(15) obs.Telescope=fields(16) obs.Eyepiece=fields(19) obs.Aid=fields(23) obs.Notes=fields(28) end if wend f.Close Bleep