|
Marine systems simulation
|
#include <netcdf_handler.h>
Public Member Functions | |
| void | readNCFile (const char *filename) |
| int | cacheCurrentField () |
| void | closeNCFile () |
| Close the NetCDF file and release the file handle. | |
| void | getDomainBounds (float *bounds) |
| int | getVar (char *name) |
| int | getCurrentSpeedAt (float x, float y, float z, float *value) |
| int | calculateDescriptorValues (float *values) |
| bool | isProfileFile () |
Handler for reading NetCDF current field files.
Provides methods for opening NetCDF files, caching current velocity data, and performing spatial interpolation at query positions. Four NetCDF file layouts are supported, selected automatically from the variable/dimension names found in the file.
| int NetcdfHandler::cacheCurrentField | ( | ) |
Cache the entire current velocity field in memory.
| int NetcdfHandler::calculateDescriptorValues | ( | float * | values | ) |
Compute min, mean, and max velocity magnitude statistics.
| [out] | values | Array of at least 3 floats: [minVal, meanVal, maxVal] [m/s]. |
| int NetcdfHandler::getCurrentSpeedAt | ( | float | x, |
| float | y, | ||
| float | z, | ||
| float * | value | ||
| ) |
Get interpolated current velocity at a position.
| [in] | x | X (east) coordinate [m]. |
| [in] | y | Y (north) coordinate [m]. |
| [in] | z | Z (depth) coordinate [m]. |
| [out] | value | Interpolated velocity components [u, v, w] [m/s]. |
| void NetcdfHandler::getDomainBounds | ( | float * | bounds | ) |
Get the spatial domain bounds of the loaded field.
| [out] | bounds | Array of at least 6 floats [xmin, xmax, ymin, ymax, zmin, zmax] [m]. |
| int NetcdfHandler::getVar | ( | char * | name | ) |
Get a NetCDF variable ID by name.
| [in] | name | Variable name string. |
| bool NetcdfHandler::isProfileFile | ( | ) |
Check whether the file is a depth-profile layout.
| void NetcdfHandler::readNCFile | ( | const char * | filename | ) |
Open and parse a NetCDF file.
| [in] | filename | Path to NetCDF file. |
Determines the file layout type from the variable and dimension names present in the file and loads the grid coordinate arrays.