@@ -52,6 +52,8 @@ StarIdentifiers TetraStarIdAlgorithm::Go(const unsigned char *database,
52
52
// for(const Star &star : stars){
53
53
// std::cout << star.position.x << ", " << star.position.y << std::endl;
54
54
// }
55
+ // std::cout << catalog.size() << std::endl; // 5000 stars
56
+
55
57
56
58
TetraDatabase db;
57
59
db.fillStarTable ();
@@ -70,8 +72,10 @@ StarIdentifiers TetraStarIdAlgorithm::Go(const unsigned char *database,
70
72
copyStars.begin (), copyStars.end (),
71
73
[](const Star &a, const Star &b) { return a.magnitude > b.magnitude ; });
72
74
75
+
73
76
// TODO: implement the generator function
74
77
// Right now I'm just do a simplified way, taking the first 4 centroids
78
+
75
79
copyStars = std::vector<Star>(copyStars.begin (), copyStars.begin () + numPattStars);
76
80
77
81
std::vector<int > centroidIndices;
@@ -263,17 +267,26 @@ StarIdentifiers TetraStarIdAlgorithm::Go(const unsigned char *database,
263
267
ArgsortVector<Vec3>(catStarVecs, catRadii);
264
268
265
269
for (int i = 0 ; i < numPattStars; i++){
266
- std::cout << " centroid: " << centroidIndices[i]
267
- << " , starID: " << catSortedStarIDs[i];
268
- std::cout << std::endl;
269
- result.push_back (
270
- StarIdentifier (centroidIndices[i], catSortedStarIDs[i]));
270
+ // std::cout << "centroid: " << sortedCentroidIndices[i]
271
+ // << ", starID: " << catSortedStarIDs[i];
272
+ // std::cout << std::endl;
273
+
274
+ int centroidIndex = sortedCentroidIndices[i];
275
+ int resultStarID = catSortedStarIDs[i];
276
+
277
+ int catalogIndex = FindCatalogStarIndex (catalog, resultStarID);
278
+
279
+ // const CatalogStar *catStar = FindNamedStar(catalog, resultStarID);
280
+ std::cout << " catstar: " << catalogIndex << std::endl;
281
+
282
+ result.push_back (StarIdentifier (centroidIndex, catalogIndex));
283
+ // Ah, catalog is different than what Tetra expects
271
284
}
272
285
273
286
// TODO: StarIdentifier wants the catalog INDEX, not the real star ID
274
287
275
288
std::cout << " SUCCESS: stars successfully matched" << std::endl;
276
- return result; // TODO: work on this more
289
+ return result;
277
290
}
278
291
}
279
292
0 commit comments