--- trunk/madProps/madProps.c 2002/07/19 19:05:59 43 +++ trunk/madProps/madProps.c 2002/08/16 04:05:45 82 @@ -22,6 +22,7 @@ int main(argc, argv) int lineNum = 0; // keeps track of the line number int n_atoms; // the number of atoms int i,j; // loop counters + int isFirst; char read_buffer[2000]; /*the line buffer for reading */ char *foo; /*the pointer to the current string token */ @@ -47,8 +48,11 @@ int main(argc, argv) char cosCorr1[30]; char cosCorr2[30]; + int startFrame = 0; + int haveStartFrame = 0; + int endFrame = 0; + int haveEndFrame = 0; - program_name = argv[0]; /*save the program name in case we need it*/ for( i = 1; i < argc; i++){ @@ -75,12 +79,16 @@ int main(argc, argv) strcpy( muCorr, argv[i] ); } - else if( !strcmp( argv[i], "--CosCorr" ) ){ - calcCosCorr = 1; + else if( !strcmp( argv[i], "--startFrame" ) ){ + haveStartFrame = 1; i++; - strcpy( cosCorr1, argv[i] ); + startFrame = atoi(argv[i]); + } + + else if( !strcmp( argv[i], "--endFrame" ) ){ + haveEndFrame = 1; i++; - strcpy( cosCorr2, argv[i] ); + endFrame = atoi(argv[i]); } else{ @@ -168,6 +176,7 @@ int main(argc, argv) fflush( stdout ); nFrames = frameCount( in_name ); + if( !haveEndFrame ) endFrame = nFrames; printf( "done.\n" "nframes = %d\n" @@ -181,16 +190,27 @@ int main(argc, argv) exit(8); } - // create the array of frames + // create and initialize the array of frames dumpArray = (struct xyz_frame*)calloc( nFrames, sizeof( struct xyz_frame ) ); + for( i=0; i Calculate mu correlation of atom\n" " --CosCorr Calculate the cos correlation between atom1 and atom2\n" + " --startFrame Specifies a frame to start correlating\n" + " --endFrame Specifies a frame to stop correlating.\n" - "\n" "\n", program_name);