This repository has been archived by the owner on May 10, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
notes.txt
74 lines (63 loc) · 1.85 KB
/
notes.txt
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
// Julian Day -> JulianDay
// Calendar Day -> time.Time
// Degree -> time.Duration
package main
import (
"github.com/dc0d/asterisk/astrobserve"
"github.com/dc0d/asterisk/def"
"github.com/dc0d/asterisk/def/position"
// "fmt"
"gopkg.in/mgo.v2"
// "gopkg.in/mgo.v2/bson"
"log"
"runtime"
"time"
)
func main() {
defer func() {
stop := astrobserve.ForStop{true, make(chan bool, 1)}
astrobserve.StopChan <- stop
<-stop.Answer
}()
t := time.Date(1976, time.January, 9, 23, 55, 30, 0, time.UTC)
t = t.Add(def.DurationFromHour(-3.5))
p := position.Position{Lon: (47. + 5./60.), Lat: (34. + 19./60.)}
cset := &astrobserve.ChartSet{}
cset.For(t, p)
session, err := mgo.Dial("127.0.0.1:27072")
if err != nil {
panic(err)
}
defer session.Close()
session.SetMode(mgo.Strong, true)
db := session.DB("test")
err = db.DropDatabase()
if err != nil {
log.Fatalln(err)
}
// cset.Id = bson.NewObjectId()
// err = c.Insert(cset)
// if err != nil {
// log.Fatal(err)
// }
// cres := astrobserve.ChartSet{}
// err = c.Find(bson.M{"_id": cset.Id}).One(&cres)
// if err != nil {
// log.Fatal(err)
// }
// log.Println("----------")
// for _, pli := range cres.List() {
// v := pli
// log.Printf("%+v\n", v)
// }
// log.Println("----------")
}
func init() {
runtime.GOMAXPROCS(3 * runtime.NumCPU())
}