fix: unit conversion and indexing

This commit is contained in:
robin
2024-04-30 12:34:10 +02:00
parent 824fb967a2
commit 0aa58537b1
6 changed files with 77 additions and 27 deletions

View File

@@ -39,7 +39,7 @@ const Vel &UVGrid::operator[](size_t timeIndex, size_t latIndex, size_t lonIndex
or lonIndex < 0 or lonIndex >= lonSize) {
throw std::out_of_range("Index out of bounds");
}
size_t index = timeIndex * (latSize * lonSize) + latIndex * lonIndex + lonIndex;
size_t index = timeIndex * (latSize * lonSize) + latIndex * lonSize + lonIndex;
return uvData[index];
}
@@ -63,4 +63,4 @@ void UVGrid::streamSlice(ostream &os, size_t t) {
}
os << endl;
}
}
}