I am writing a program to read ain a file.
s axis -1.50000E+01 to -1.49000E+01
t axis -1.50000E+01 to -1.49000E+01
4.16402E-06 0.0077
repeat for new numbers (these values don't match those taken in below, I just pulled them out of a random part of the file)
the format doesn't really matter because I know it is reading in correctly. What does matter is what is happening to the data after I read it in
Some variables are not being affected by the operations done to them
see here
-14.9 -13.9 1 11 1 11 4.16402e-06 0.0077
-14.9 -13.8 1 12 1 11 4.16774e-06 0.0077
-14.9 -13.7 1 13 1 13 4.17141e-06 0.0077
-14.9 -13.6 1 14 1 13 4.17513e-06 0.0078
-14.9 -13.5 1 15 1 15 4.1789e-06 0.0078
-14.9 -13.4 1 16 1 16 4.18272e-06 0.0078
The 6th column should be the same as the fourth...
See the code below for details where is says //Map coordinate...
for (int pixel_number = 1; pixel_number <= 320; pixel_number++) {
//Determine pixel coordinates
In_file.ignore(INT_MAX, 's');
In_file.ignore(INT_MAX, 's');
In_file >> s_axis_1;
In_file.ignore(INT_MAX, '\n');
In_file.ignore(256 ,'s');
In_file >> t_axis_1;
In_file.ignore (INT_MAX, '\n');
//Get pixel value
In_file >> temp_value;
In_file.ignore();
In_file >> temp_error;
if (s_axis_1 == -3.65541E-14 || s_axis_1 == 3.65541E-14) {
s_axis_1 = 0;
}
if (t_axis_1 == -3.65541E-14 || t_axis_1 == 3.65541E-14) {
t_axis_1 = 0;
}
//Map coordiante of pixel to location in array
a = (s_axis_1 + 15)*10;
b = (t_axis_1 + 15)*10;
m = (int)a;
n = (int)b;
//Store the values
data[m][n].value = temp_value;
data[m][n].error = temp_error;
cout << s_axis_1 << " " << t_axis_1 << " " << a <<" " << b << " "
<< m << " " << n << " " <<temp_value << " " << temp_error <<endl;
}
} else {
cout << "Unable to open input file\n" << endl;
} //End above if statment
In_file.close();
Can anyone help??
Thanks in advance