Commit e38fc0c3cb525b25ea687cdc18d15beb766a9162
1 parent
332925ad
header file wavelength fixes, Linux fixes
Showing
1 changed file
with
7 additions
and
0 deletions
Show diff stats
stim/envi/agilent_binary.h
@@ -5,6 +5,8 @@ | @@ -5,6 +5,8 @@ | ||
5 | #include <string> | 5 | #include <string> |
6 | #include <fstream> | 6 | #include <fstream> |
7 | #include <complex> | 7 | #include <complex> |
8 | +#include <cstring> | ||
9 | +#include <chrono> | ||
8 | 10 | ||
9 | //CUDA | 11 | //CUDA |
10 | //#ifdef CUDA_FOUND | 12 | //#ifdef CUDA_FOUND |
@@ -62,17 +64,20 @@ public: | @@ -62,17 +64,20 @@ public: | ||
62 | /// Default constructor, sets the resolution to zero and the data pointer to NULL | 64 | /// Default constructor, sets the resolution to zero and the data pointer to NULL |
63 | agilent_binary(){ | 65 | agilent_binary(){ |
64 | memset(R, 0, sizeof(size_t) * 3); //set the resolution to zero | 66 | memset(R, 0, sizeof(size_t) * 3); //set the resolution to zero |
67 | + memset(Z, 0, sizeof(double) * 2); | ||
65 | ptr = NULL; | 68 | ptr = NULL; |
66 | } | 69 | } |
67 | 70 | ||
68 | /// Constructor with resolution | 71 | /// Constructor with resolution |
69 | agilent_binary(size_t x, size_t y, size_t z){ | 72 | agilent_binary(size_t x, size_t y, size_t z){ |
70 | alloc(x, y, z); | 73 | alloc(x, y, z); |
74 | + memset(Z, 0, sizeof(double) * 2); | ||
71 | } | 75 | } |
72 | 76 | ||
73 | /// Constructor with filename | 77 | /// Constructor with filename |
74 | agilent_binary(std::string filename){ | 78 | agilent_binary(std::string filename){ |
75 | ptr = NULL; | 79 | ptr = NULL; |
80 | + memset(Z, 0, sizeof(double) * 2); | ||
76 | load(filename); | 81 | load(filename); |
77 | } | 82 | } |
78 | 83 | ||
@@ -119,6 +124,8 @@ public: | @@ -119,6 +124,8 @@ public: | ||
119 | ptr = (T*) malloc(bytes()); //allocate space for the data | 124 | ptr = (T*) malloc(bytes()); //allocate space for the data |
120 | infile.read((char*)ptr, bytes()); //read the data | 125 | infile.read((char*)ptr, bytes()); //read the data |
121 | infile.close(); | 126 | infile.close(); |
127 | + Z[0] = 1; | ||
128 | + Z[1] = R[2]; | ||
122 | } | 129 | } |
123 | 130 | ||
124 | void save(std::string filename){ | 131 | void save(std::string filename){ |