|
|
I'm trying to load a series of data points from a file, but I'm only getting
about half of them loaded. The data file is structured with three float
values per line:
raInDeg decInDeg zval
Each triplet defining the rightascention, declination, and zvalue(redshift)
of a celestial body. The data ranges (after a bit of processing!) are:
raInDeg: 0 ~ 360
decInDeg: -90.0 ~ +90.0
zval: estimated at 0.0 ~ 10.0
Someone suggested that it might be commas between numbers,
but when I comma delimit the file, it no longer reads.
It reads about 4000 out of 9000 entries when I tab-delimit them.
Any suggestions?
pertinent source:
//////////////////////////////////////////////////////////
// Load the data file
//
#declare RA = 0;
#declare DECL =1;
#declare ZVAL = 2;
#fopen dataFile "d:/docs/raytracing/redshiftData.txt" read
#declare LinesInFile = 10000;
#declare celestialData = array[3][ LinesInFile ];
#declare i = 0;
#while ( defined(dataFile) )
#declare rightAscentionAsDegrees = 0.0;
#declare declinationAsDegrees = 0.0;
#declare zVal = 0.0;
#read( dataFile, rightAscentionAsDegrees, declinationAsDegrees, zVal )
#declare celestialData[RA][i] = rightAscentionAsDegrees;
#declare celestialData[DECL][i] = declinationAsDegrees;
#declare celestialData[ZVAL][i] = zVal;
#declare i = i+1;
#end
#debug concat( "\n\nTotal values read from file: ", str(i,5,0), "\n\n" )
#fclose dataFile
Post a reply to this message
|
|