20 #include "../include/flat_file.h" 40 fp = fopen(locs_file,
"r");
43 printf(
"cannot read locations file\n");
44 printf(
"%s: \n",locs_file);
51 locations->
x = (
double *) malloc(n *
sizeof(
double));
52 locations->
y = (
double *) malloc(n *
sizeof(
double));
55 while ((read = getline(&line, &len, fp)) != -1) {
56 pch = strtok(line,
",");
59 locations->
x[i] = atof(pch);
60 pch = strtok (NULL,
",");
61 locations->
y[i] = atof(pch);
62 pch = strtok (NULL,
",");
89 double *z_vec = (
double *) malloc(n *
sizeof(
double));
91 fp = fopen(obsfile,
"r");
94 printf(
"cannot open observations file\n");
98 while ((read = getline(&line, &len, fp)) != -1)
99 z_vec[count++]=atof(line);
double * y
Values in Y dimension.
double * x
Values in X dimension.
double * readObsFile(char *obsfile, int n)
Read real observation file.
location * readLocsFile(char *locs_file, int n)
Read 2D locations from a given.