about summary refs log tree commit diff
path: root/csv
diff options
context:
space:
mode:
Diffstat (limited to 'csv')
-rw-r--r--csv/csv.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/csv/csv.go b/csv/csv.go
index 6f1b652..dc4cdf1 100644
--- a/csv/csv.go
+++ b/csv/csv.go
@@ -43,19 +43,23 @@ func Import(path string, start int, end int, slice []structs.Star) []structs.Sta
 	for linenr, line := range lines[start:end] {
 		x, errx := strconv.ParseFloat(line[0], 64)
 		y, erry := strconv.ParseFloat(line[1], 64)
+		z, errz := strconv.ParseFloat(line[2], 64)
 
 		// Handle errors
 		if errx != nil {
 			log.Printf("error reading value from csv in line nr. %d (%s)", linenr, errx)
 		}
-		if errx != nil {
+		if erry != nil {
 			log.Printf("error reading value from csv in line nr. %d (%s)", linenr, erry)
 		}
+		if errz != nil {
+			log.Printf("error reading value from csv in line nr. %d (%s)", linenr, errz)
+		}
 
 		// Create a temporary star for assembling the star
 		tempStar := structs.Star{
-			structs.Coord{x, y},
-			structs.Force{0, 0},
+			structs.Coord{X: x, Y: y, Z: z},
+			structs.Force{X: 0, Y: 0, Z: 0},
 			50000,
 		}