Skip to content

Commit

Permalink
move value before pix index
Browse files Browse the repository at this point in the history
  • Loading branch information
oguyon committed Sep 16, 2023
1 parent e0e8062 commit ad88043
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 26 deletions.
14 changes: 3 additions & 11 deletions plugins/milk-extra-src/image_filter/gaussfilter.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ imageID gauss_filter(
imageID ID;
imageID IDout;
imageID IDtmp;
float *array;

long ii, jj, kk;
long naxes[3];
long naxis;
Expand Down Expand Up @@ -106,6 +106,8 @@ imageID gauss_filter(
filtersizec = data.image[ID].md[0].size[1] / 2 - 1;
}


float *__restrict array;
array = (float *) malloc((2 * filtersizec + 1) * sizeof(float));
if(array == NULL)
{
Expand Down Expand Up @@ -201,12 +203,8 @@ imageID gauss_filter(

for(ii = 0; ii < naxes[0]; ii++)
{
// printf("A jj : 0 -> %ld/%ld\n", naxes[1]-(2*filtersizec+1), naxes[1]);
// fflush(stdout);
for(jj = 0; jj < naxes[1] - (2 * filtersizec + 1); jj++)
{
// printf("00: %ld/%ld\n", k*naxes[0]*naxes[1]+(jj+filtersizec)*naxes[0]+ii, naxes[0]*naxes[1]*naxes[2]);
// printf("01: %ld/%ld\n", (jj+j)*naxes[0]+ii, naxes[0]*naxes[1]);
fflush(stdout);
for(j = 0; j < (2 * filtersizec + 1); j++)
{
Expand All @@ -218,8 +216,6 @@ imageID gauss_filter(
}
}

// printf("B jj : 0 -> %d/%ld\n", filtersizec, naxes[1]);
// fflush(stdout);
for(jj = 0; jj < filtersizec; jj++)
{
tot = 0.0;
Expand All @@ -230,9 +226,6 @@ imageID gauss_filter(
}
for(j = filtersizec - jj; j < jmax; j++)
{
// printf("02: %ld/%ld\n", k*naxes[0]*naxes[1]+jj*naxes[0]+ii, naxes[0]*naxes[1]*naxes[2]);
// printf("03: %ld/%ld\n", (jj-filtersizec+j)*naxes[0]+ii, naxes[0]*naxes[1]);
fflush(stdout);
data.image[IDout].array.F[k * naxes[0] * naxes[1] +
jj * naxes[0] + ii] +=
array[j] *
Expand Down Expand Up @@ -266,7 +259,6 @@ imageID gauss_filter(
}
}

// save_fl_fits("gtmp","gtmp");
delete_image_ID("gtmp", DELETE_IMAGE_ERRMODE_WARNING);

free(array);
Expand Down
6 changes: 3 additions & 3 deletions src/COREMOD_arith/image_set_2Dpix.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ static errno_t help_function()

errno_t image_set_2Dpix(
IMGID inimg,
double value,
uint32_t colindex,
uint32_t rowindex,
double value
uint32_t rowindex
)
{
DEBUG_TRACE_FSTART();
Expand Down Expand Up @@ -159,7 +159,7 @@ static errno_t compute_function()

INSERT_STD_PROCINFO_COMPUTEFUNC_START
{
image_set_2Dpix(inimg, *colindex, *rowindex, *pixval);
image_set_2Dpix(inimg, *pixval, *colindex, *rowindex);
processinfo_update_output_stream(processinfo, inimg.ID);

}
Expand Down
4 changes: 2 additions & 2 deletions src/COREMOD_arith/image_set_2Dpix.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

errno_t image_set_2Dpix(
IMGID inimg,
double value,
uint32_t colindex,
uint32_t rowindex,
double value
uint32_t rowindex
);

errno_t CLIADDCMD_COREMOD_arith__imset_2Dpix();
Expand Down
6 changes: 3 additions & 3 deletions src/COREMOD_arith/image_set_col.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ static errno_t help_function()

errno_t image_set_col(
IMGID inimg,
uint32_t colindex,
double value
double value,
uint32_t colindex
)
{
DEBUG_TRACE_FSTART();
Expand Down Expand Up @@ -184,7 +184,7 @@ static errno_t compute_function()

INSERT_STD_PROCINFO_COMPUTEFUNC_START
{
image_set_col(inimg, *colindex, *pixval);
image_set_col(inimg, *pixval, *colindex);
processinfo_update_output_stream(processinfo, inimg.ID);

}
Expand Down
4 changes: 2 additions & 2 deletions src/COREMOD_arith/image_set_col.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

errno_t image_set_col(
IMGID inimg,
uint32_t colindex,
double value
double value,
uint32_t colindex
);

errno_t CLIADDCMD_COREMOD_arith__imset_col();
Expand Down
6 changes: 3 additions & 3 deletions src/COREMOD_arith/image_set_row.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ static errno_t help_function()

errno_t image_set_row(
IMGID inimg,
uint32_t rowindex,
double value
double value,
uint32_t rowindex
)
{
DEBUG_TRACE_FSTART();
Expand Down Expand Up @@ -184,7 +184,7 @@ static errno_t compute_function()

INSERT_STD_PROCINFO_COMPUTEFUNC_START
{
image_set_row(inimg, *rowindex, *pixval);
image_set_row(inimg, *pixval, *rowindex);
processinfo_update_output_stream(processinfo, inimg.ID);

}
Expand Down
4 changes: 2 additions & 2 deletions src/COREMOD_arith/image_set_row.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

errno_t image_set_row(
IMGID inimg,
uint32_t rowindex,
double value
double value,
uint32_t rowindex
);

errno_t CLIADDCMD_COREMOD_arith__imset_row();
Expand Down

0 comments on commit ad88043

Please sign in to comment.