1.0.0-rc.87
This commit is contained in:
@@ -47,3 +47,22 @@ void FilterSpotsByCount(std::vector<SpotToSave> &input, int64_t count) {
|
||||
});
|
||||
input.resize(output_size);
|
||||
}
|
||||
|
||||
std::optional<float> GetResolution(const std::vector<SpotToSave> &spots) {
|
||||
if (spots.size() < 6)
|
||||
return std::nullopt;
|
||||
|
||||
std::vector<float> resolutions;
|
||||
resolutions.reserve(spots.size());
|
||||
|
||||
for (const auto &spot: spots) {
|
||||
if (!spot.ice_ring)
|
||||
resolutions.push_back(spot.d_A);
|
||||
}
|
||||
|
||||
std::ranges::sort(resolutions);
|
||||
|
||||
if (spots.size() < 20)
|
||||
return resolutions[2];
|
||||
return resolutions[static_cast<size_t>(spots.size() * 0.95)];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user