Quote:
Originally Posted by
vgersh99
post a header, please.
If you 6 columns, and the real/TOTAL number of columns (per row) is 1977, 1977 / 6 = 329 (not evenly divided - remainder=3).
329 rows of 6 columns represents the REAL row of data, correct?
What happens with the remainder of 3? Are you sure it's 1977 REAL rows or is it something else?
We can translate the 6 column matrix into a REAL matrix of (1977 or whatever) and then invert it - should be easily done.
Pleas answer the above questions.
Yes, I'm sure the real rows consists of 1977 numbers. The header looks like this:
NCOLS 1977
NROWS 1253
XLLCORNER 554650.000000
YLLCORNER 8040950.000000
CELLSIZE 25
NODATA_VALUE 9999900.000000
The dataset represents a seabed image. The bottom left corner is given by the XLL and YLL numbers in UTM coordinates. The cellsize is the resolution in meters. The numbers in the datafile represents the depth below seasurface. So the whole file is an image of the seabed with 1977x1253 pixels.
My problem is that the software I'm loading it into, is not the same as the one having generated the datafile. The image is displayed starting with the first row (of 1977 numbers) from the bottom left corner and then continuing upwards, and ending in the upper right corner with the last number in the 1253th row. The numbers is, however, stored in the datafile with the first row (of 1977 numbers) starting from the UPPER left corner, and continuing downwards ending in the lower right corner. This means that the seabed image is displayed mirrored along the middle row, which I of course don't want it to be.
The data is stored such that the first 1977 numbers represents the first row, the next 1977 numbers represent the second row, etc. And as you calculated, that means that every row consist of 329 rows pluss a reminder of three (which is half a row) = 329 * 6 + 3 = 1977. I guess this makes it more complicated, but not impossible to solve? Every row in the datafile consists of 6 numbers, except the last which only has three numbers.
So, what I need is a code which can rearrange this datafile to these specifications. That means that the last 1977 numbers becomes the first 1977 numbers (in the same order), the second last 1977 numbers becomes the second first 1977 numbers, etc.
I hope I made myself understandable, and that someone can help me.