26int main (
int argc,
char *argv[] )
37 fprintf( stderr,
"useage: %s [mimumum mass] [maximum mass] [number of "
38 "templates]\n", argv[0] );
42 if ( (mmin = atof( argv[1] )) < 0 || (mmax = atof( argv[2] )) < 0 )
44 fprintf( stderr,
"template masses must be positive.\n" );
47 if ( (ntmplts = atoi( argv[3] )) < 1 )
49 fprintf( stderr,
"number of templates must be greater than zero.\n" );
57 if ( ! (
fp = fopen(
"/dev/urandom",
"r" )) )
59 perror(
"could not open /dev/urandom" );
63 for (
i = 0;
i < 8; ++
i )
65 long int rbyte = (
long int) fgetc(
fp );
66 seed += rbyte << (
i * 8 );
73 if ( ! (bankfp = fopen(
"bank.ilwd",
"w" )) )
75 perror(
"could not open bank.ilwd" );
79 if ( ! (txtfp = fopen(
"bank.txt",
"w" )) )
81 perror(
"could not open bank.txt" );
86 "<ilwd name='tmpltBank::sequence' comment='seed:%ld' size='7'>\n"
87 "<lstring name='real:domain' size='4'>TIME</lstring>\n"
88 "<int_4u name='gps_sec:start_time' units='sec'>0</int_4u>\n"
89 "<int_4u name='gps_nan:start_time' units='nanosec'>0</int_4u>\n"
90 "<int_4u name='gps_sec:stop_time' units='sec'>0</int_4u>\n"
91 "<int_4u name='gps_nan:stop_time' units='nanosec'>0</int_4u>\n"
92 "<real_8 name='time:step_size' units='sec'>1.0e+00</real_8>\n"
93 "<real_8 dims='2,%d' name='data' ndim='2' units='mass,mass'>",
97 for (
i = 0;
i < 2 * ntmplts; ++
i )
99 double mass = mmin + ( mmax - mmin ) *
drand48();
110 if (
i != (2 * ntmplts - 1) )
116 fprintf( bankfp,
"</real_8>\n</ilwd>" );
int main(int argc, char *argv[])