Marine systems simulation
Loading...
Searching...
No Matches
netcdf_handler.h
1#pragma once
2
3#include "netcdf.h"
4
5#include <cmath>
6#include <fstream>
7#include <iostream>
8#include <string>
9#include <vector>
10
19{
25 const int U_V_FILE = 0;
26 const int Z_X_VELOCITY_FILE = 1;
27 const int Z_PROFILE_FILE = 2;
28 const int U_V_W_FILE = 3;
30
31 int ncid;
32 int type = U_V_FILE;
33
38 size_t dim1 = -1;
39 size_t dim2 = -1;
40 size_t dim3 = -1;
42
45 int xdim = -1;
46 int ydim = -1;
47 int zdim = -1;
49
55 float* geo1;
56 float* geo2;
57 float* geo3;
59
62 float low1, low2, low3;
63 float diff1, diff2, diff3;
65
68 float minVal;
69 float meanVal;
70 float maxVal;
72
73 bool hasCachedValues = false;
74
80 std::vector<std::vector<std::vector<float>>> currentFieldU;
81 std::vector<std::vector<std::vector<float>>> currentFieldV;
82 std::vector<std::vector<std::vector<float>>> currentFieldW;
84
85public:
93 void readNCFile(const char* filename);
94
99
102
107 void getDomainBounds(float* bounds);
108
114 int getVar(char* name);
115
124 int getCurrentSpeedAt(float x, float y, float z, float* value);
125
131 int calculateDescriptorValues(float* values);
132
137};
Definition netcdf_handler.h:19
void closeNCFile()
Close the NetCDF file and release the file handle.
int calculateDescriptorValues(float *values)
int cacheCurrentField()
void getDomainBounds(float *bounds)
int getVar(char *name)
bool isProfileFile()
int getCurrentSpeedAt(float x, float y, float z, float *value)
void readNCFile(const char *filename)