Skip to content

Commit

Permalink
Fixed output?
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristopherRabotin committed Apr 17, 2017
1 parent b356d68 commit 249c672
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions cmd/designer/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ type Result struct {

// CSV returns the CSV of this result
func (r Result) CSV() string {
rtn := fmt.Sprintf("%s,%f,", r.launch, r.c3)
rtn := fmt.Sprintf("%.3f (%s),%f,", julian.TimeToJD(r.launch), r.launch.Format(dateFormat), r.c3)
for _, flyby := range r.flybys {
rtn += flyby.CSV()
}
rtn += fmt.Sprintf("%s,%f,", r.arrival, r.vInf)
rtn += fmt.Sprintf("%.3f (%s),%f,", julian.TimeToJD(r.arrival), r.arrival.Format(dateFormat), r.vInf)
return rtn
}

Expand Down Expand Up @@ -54,7 +54,10 @@ type GAResult struct {
// CSV returns the CSV of this result
func (g GAResult) CSV() string {
if g.DT != (time.Time{}) {
return fmt.Sprintf("%f (%s),%f,%f,%f,", julian.TimeToJD(g.DT), g.DT.Format(dateFormat), g.deltaV, g.radius, smd.Rad2deg(g.phi))
if g.phi != 0 {
return fmt.Sprintf("%f (%s),%f,%f,%f,", julian.TimeToJD(g.DT), g.DT.Format(dateFormat), g.deltaV, g.radius, smd.Rad2deg(g.phi))
}
return fmt.Sprintf("%f (%s),%f,%f,", julian.TimeToJD(g.DT), g.DT.Format(dateFormat), g.deltaV, g.radius)
}
return ""
}
Expand Down

0 comments on commit 249c672

Please sign in to comment.