fix: unit conversion and indexing
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user