Commit aa6fb23b authored by Johan Richard's avatar Johan Richard
Browse files

Small corrections to o_global.c for cleanset 4

parent 82245305
......@@ -281,9 +281,8 @@ void o_global_free()
else if (M.iclean == 4 )
{
free(sflux);
// free_square_double(ero, imFrame.ny);
free_square_double(ero, imFrame.ny);
free_square_double(fluxmap, imFrame.ny*imFrame.nx);
free_square_int(nimage,imFrame.ny);
}
else
{
......@@ -432,23 +431,24 @@ void readConstraints()
for( j = 0; j < wFrame.ny; j++ )
if( wo[j][i] < 0. )
{
fprintf(stderr, "ERROR: negative value found in %s.\n", wFrame.pixfile);
NPRINTF(stderr, "ERROR: negative value found in %s.\n", wFrame.pixfile);
exit(-1);
}
fprintf(stderr, "wFrame.nx= %d\t imFrame.nx=%d\n", wFrame.nx, imFrame.nx);
NPRINTF(stderr, "wFrame.nx= %d\t wFrame.ny=%d\n", wFrame.nx, wFrame.ny);
// Test of dimension matching
if ( wFrame.nx != imFrame.nx || wFrame.ny != imFrame.ny )
{
fprintf(stderr, "ERROR: dimensions mismatch in %s and %s", wFrame.pixfile, imFrame.pixfile);
{
NPRINTF(stderr, "ERROR: dimensions mismatch in %s and %s", wFrame.pixfile, imFrame.pixfile);
exit(-1);
}
}
// Pre-compute the loglikelihood normalization factor
lhood_wo = 0.;
for( i = 0; i < wFrame.nx; i++ )
for( j = 0; j < wFrame.ny; j++ )
if( wo[i][j] > 0 )
lhood_wo -= log( 2.*M_PI*wo[i][j] );
lhood_wo -= log( 2.*M_PI*wo[j][i] );
}
......@@ -826,13 +826,13 @@ int getNParameters()
int ipx;
parameters = 0;
//check M.iclean =4 case first
if (M.iclean == 4)
{ //Initializing sflux
parameters = ps.nx*ps.ny;
}
for ( i = 0; i < G.no_lens; i ++ )
for ( ipx = CX; ipx <= PMASS; ipx ++ )
if ( block[i][ipx] != 0 )
......
Supports Markdown
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