Commit 09db6d01 authored by flechsig's avatar flechsig
Browse files

add multi array output

parent 719fa4df
......@@ -212,7 +212,7 @@ void evaluf(Matrix *put_in, struct ConfigStruct *cstp, struct Xgi_out *put_out)
put_in->copy(&put_out->amp); // copy input to output in field amp, address= 1
put_in->copy(&put_out->dphi_wrap);
put_in->copy(&put_out->dphi_unwrap);
rows= put_in->height;
cols= put_in->width;
data= put_out->amp.data; // Array address= 1
......@@ -458,8 +458,9 @@ void eval1d(double *data, int rows, int cols, struct ConfigStruct *cs, struct Xg
}
if (outphase)
//put_out->dphi_wrap.data
for (row= 0; row < rows; row++)
data[col+ row* cols]= atan2(out[row][1], out[row][0]);
put_out->dphi_wrap.data[col+ row* cols]= atan2(out[row][1], out[row][0]);
else // amplitude
for (row= 0; row < rows; row++)
data[col+ row* cols]= sqrt(pow(out[row][0], 2)+ pow(out[row][1], 2));
......@@ -513,7 +514,7 @@ void eval1d(double *data, int rows, int cols, struct ConfigStruct *cs, struct Xg
if (outphase)
for (col= 0; col < cols; col++)
data[col+ row* cols]= atan2(out[col][1], out[col][0]);
put_out->dphi_wrap.data[col+ row* cols]= atan2(out[col][1], out[col][0]);
else // amplitude
for (col= 0; col < cols; col++)
data[col+ row* cols]= sqrt(pow(out[col][0], 2)+ pow(out[col][1], 2));
......@@ -525,7 +526,10 @@ void eval1d(double *data, int rows, int cols, struct ConfigStruct *cs, struct Xg
} // else cols
if (outphase > 1)
unwrap_phase(data, rows, cols);
{
put_out->dphi_wrap.copy(&put_out->dphi_unwrap);
unwrap_phase(put_out->dphi_unwrap.data, rows, cols);
}
} // end eval1d
......@@ -596,7 +600,7 @@ void eval1d_zp(double *data, int rows, int cols, struct ConfigStruct *cs, struct
}
if (outphase)
for (i= 0; i< len0; i++)
data[col+ i* cols]= atan2(out[i+ i0][1], out[i+ i0][0]);
put_out->dphi_wrap.data[col+ i* cols]= atan2(out[i+ i0][1], out[i+ i0][0]);
else // amplitude
for (i= 0; i< len0; i++)
data[col+ i* cols]= sqrt(pow(out[i+ i0][0], 2)+ pow(out[i+ i0][1], 2));
......@@ -636,7 +640,7 @@ void eval1d_zp(double *data, int rows, int cols, struct ConfigStruct *cs, struct
}
if (outphase)
for (i= 0; i< len0; i++)
data[i+ row* cols]= atan2(out[i+ i0][1], out[i+ i0][0]);
put_out->dphi_wrap.data[i+ row* cols]= atan2(out[i+ i0][1], out[i+ i0][0]);
else // amplitude
for (i= 0; i< len0; i++)
data[i+ row* cols]= sqrt(pow(out[i+ i0][0], 2)+ pow(out[i+ i0][1], 2));
......@@ -648,8 +652,10 @@ void eval1d_zp(double *data, int rows, int cols, struct ConfigStruct *cs, struct
fftw_free(in);
fftw_free(out);
if (outphase > 1)
unwrap_phase(data, rows, cols);
{
put_out->dphi_wrap.copy(&put_out->dphi_unwrap);
unwrap_phase(put_out->dphi_unwrap.data, rows, cols);
}
} // end eval1d_zp
/* shift frequencies to center */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment