Completely adapted to generate raydata input file! it has been tested
for P waves too