Commit 0eacb7ab authored by Johan Richard's avatar Johan Richard
Browse files

Multiprocessing ok

parent 8383e963
......@@ -142,11 +142,9 @@ void newdo_itos(double **im, double dlsds, double zs,
{
extern struct g_pixel imFrame;
extern struct point gsource_global[NGGMAX][NGGMAX];
register int ii, jj, k, is, js;
const extern struct g_mode M;
const extern struct g_pixel ps;
int offscl=0; // 0 if OK, 1 if offscale
double xpix,ypix;
register int is,k;
double ech=1.0;
......@@ -174,9 +172,10 @@ void newdo_itos(double **im, double dlsds, double zs,
* For each pixel in the source plane
*/
#pragma omp parallel for schedule(dynamic,1)
#pragma omp parallel for schedule(static,1)
for (is = 0; is < ps.nx; is++)
{
register int js;
for(js = 0; js < ps.ny; js++)
{
source[js][is]=0.0;
......@@ -195,7 +194,8 @@ void newdo_itos(double **im, double dlsds, double zs,
/*
* Loop over all images
*/
for (k = 0; k < ni; k++)
register int kk;
for (kk = 0; kk < ni; kk++)
{
/*
* If the image is within one contour then put flux of closest pixel.
......@@ -203,10 +203,12 @@ void newdo_itos(double **im, double dlsds, double zs,
int kcont;
for (kcont = 0; kcont < imFrame.ncont; kcont++)
{
if(inconvexe(pImage[k],npcont[kcont],I[kcont])>0)
if(inconvexe(pImage[kk],npcont[kcont],I[kcont])>0)
{
double xw = pImage[k].x / (-3600.) / cos(M.ref_dec * DTR) + M.ref_ra;
double yw = pImage[k].y / 3600. + M.ref_dec;
double xw = pImage[kk].x / (-3600.) / cos(M.ref_dec * DTR) + M.ref_ra;
double yw = pImage[kk].y / 3600. + M.ref_dec;
double xpix,ypix;
int offscl=0; // 0 if OK, 1 if offscale
#pragma omp critical
{
wcs2pix(imFrame.wcsinfo, xw , yw, &xpix, &ypix, &offscl);
......
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