added funcs to get min/max of lon/lat values

This commit is contained in:
Djairo Hougee 2024-05-07 15:46:29 +02:00
parent 5d9228e549
commit e674dde67b
2 changed files with 41 additions and 1 deletions

View File

@ -55,6 +55,22 @@ int UVGrid::timeStep() const {
return times[1] - times[0]; return times[1] - times[0];
} }
double UVGrid::lonMin() const {
return this->lons.front();
}
double UVGrid::lonMax() const {
return this->lons.back();
}
double UVGrid::latMin() const {
return this->lats.front();
}
double UVGrid::latMax() const {
return this->lats.back();
}
void UVGrid::streamSlice(ostream &os, size_t t) { void UVGrid::streamSlice(ostream &os, size_t t) {
for (int x = 0; x < latSize; x++) { for (int x = 0; x < latSize; x++) {
for (int y = 0; y < lonSize; y++) { for (int y = 0; y < lonSize; y++) {

View File

@ -38,6 +38,30 @@ public:
*/ */
int timeStep() const; int timeStep() const;
/**
* Returns the lowest longitudinal value of grid.
* @return minimum longitude
*/
double lonMin() const;
/**
* Returns the highest longitudinal value of grid.
* @return maximum longitude
*/
double lonMax() const;
/**
* Returns the lowest latitudinal value of grid.
* @return minimum latitude
*/
double latMin() const;
/**
* Returns the higehst latitudinal value of grid.
* @return maximum latitude
*/
double latMax() const;
/** /**
* times, lats, lons are vector of length timeSize, latSize, lonSize respectively. * times, lats, lons are vector of length timeSize, latSize, lonSize respectively.
* The maintain the following invariant: * The maintain the following invariant: