IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 4, 2008, 11:12:16 AM (18 years ago)
Author:
Paul Price
Message:

Removing print to stderr outside of trace.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/pswarp/src/pswarpTransformReadout.c

    r18839 r18884  
    2020
    2121    // output mask bits
    22     psMaskType maskIn   = psMetadataLookupU8(&mdok, recipe, "MASK.INPUT"); 
    23     psMaskType maskPoor = pmConfigMaskGet("POOR.WARP", config); 
    24     psMaskType maskBad  = pmConfigMaskGet("BAD.WARP", config); 
     22    psMaskType maskIn   = psMetadataLookupU8(&mdok, recipe, "MASK.INPUT");
     23    psMaskType maskPoor = pmConfigMaskGet("POOR.WARP", config);
     24    psMaskType maskBad  = pmConfigMaskGet("BAD.WARP", config);
    2525    psAssert (mdok, "MASK.INPUT was not defined");
    2626
     
    2929
    3030    // Flux fraction for "poor"
    31     float poorFrac = psMetadataLookupF32(NULL, config->arguments, "POOR.FRAC"); 
     31    float poorFrac = psMetadataLookupF32(NULL, config->arguments, "POOR.FRAC");
    3232
    3333    // pswarpMapGridFromImage builds a set of locally-linear maps which convert the
     
    4343
    4444    if (input->weight && !output->weight) {
    45         output->weight = psImageAlloc(output->image->numCols, output->image->numRows, PS_TYPE_F32);
    46         psImageInit(output->weight, NAN);
     45        output->weight = psImageAlloc(output->image->numCols, output->image->numRows, PS_TYPE_F32);
     46        psImageInit(output->weight, NAN);
    4747    }
    4848    if ((input->mask || maskPoor || maskBad) && !output->mask) {
    49         output->mask = psImageAlloc(output->image->numCols, output->image->numRows, PS_TYPE_MASK);
    50         psImageInit(output->mask, maskBad);
     49        output->mask = psImageAlloc(output->image->numCols, output->image->numRows, PS_TYPE_MASK);
     50        psImageInit(output->mask, maskBad);
    5151    }
    5252
     
    5656    // create jobs and supply them to the threads
    5757    for (int gridY = 0; gridY < grid->nYpts; gridY++) {
    58         for (int gridX = 0; gridX < grid->nXpts; gridX++) {
     58        for (int gridX = 0; gridX < grid->nXpts; gridX++) {
    5959
    60             pswarpTransformTileArgs *args = pswarpTransformTileArgsAlloc();
     60            pswarpTransformTileArgs *args = pswarpTransformTileArgsAlloc();
    6161
    62             // these items are just views to the data; they are not freed with args
    63             args->input = input;
    64             args->output = output;
    65             args->grid = grid;
    66             args->interp = interp;
    67             args->region = region;
     62            // these items are just views to the data; they are not freed with args
     63            args->input = input;
     64            args->output = output;
     65            args->grid = grid;
     66            args->interp = interp;
     67            args->region = region;
    6868
    69             args->gridX = gridX;
    70             args->gridY = gridY;
    71             args->goodPixels = 0;
     69            args->gridX = gridX;
     70            args->gridY = gridY;
     71            args->goodPixels = 0;
    7272
    73             // allocate a job
    74             psThreadJob *job = psThreadJobAlloc ("PSWARP_TRANSFORM_TILE");
     73            // allocate a job
     74            psThreadJob *job = psThreadJobAlloc ("PSWARP_TRANSFORM_TILE");
    7575
    76             // construct the arguments for this job
    77             // job is pswarpTransformTile (gridX, gridY);
    78             psArrayAdd (job->args, 1, args);
    79             // fprintf (stderr, "adding job %d,%d, Nargs: %ld\n", gridX, gridY, job->args->n);
     76            // construct the arguments for this job
     77            // job is pswarpTransformTile (gridX, gridY);
     78            psArrayAdd (job->args, 1, args);
     79            // fprintf (stderr, "adding job %d,%d, Nargs: %ld\n", gridX, gridY, job->args->n);
    8080
    81             // call: pswarpTransformTile (args);
    82             if (!psThreadJobAddPending (job)) {
    83                 psError(PS_ERR_UNKNOWN, false, "Unable to warp image.");
    84                 return false;
    85             }
    86             psFree (args);
    87         }
     81            // call: pswarpTransformTile (args);
     82            if (!psThreadJobAddPending (job)) {
     83                psError(PS_ERR_UNKNOWN, false, "Unable to warp image.");
     84                return false;
     85            }
     86            psFree (args);
     87        }
    8888    }
    8989
     
    9191    // wait here for the threaded jobs to finish
    9292    if (!psThreadPoolWait ()) {
    93         psError(PS_ERR_UNKNOWN, false, "Unable to interpolate image.");
    94         return false;
     93        psError(PS_ERR_UNKNOWN, false, "Unable to interpolate image.");
     94        return false;
    9595    }
    96     fprintf (stderr, "success for threaded jobs\n");
    9796
    9897    // each job records its own goodPixel values; sum them here
     
    10099    psThreadJob *job = NULL;
    101100    while ((job = psThreadJobGetDone()) != NULL) {
    102         if (job->args->n < 1) {
    103             fprintf (stderr, "error with job\n");
    104         } else {
    105             pswarpTransformTileArgs *args = job->args->data[0];
    106             // fprintf (stderr, "finished job %d,%d, Nargs: %ld\n", args->gridX, args->gridY, job->args->n);
    107             goodPixels += args->goodPixels;
    108         }
    109         psFree (job);
     101        if (job->args->n < 1) {
     102            fprintf (stderr, "error with job\n");
     103        } else {
     104            pswarpTransformTileArgs *args = job->args->data[0];
     105            // fprintf (stderr, "finished job %d,%d, Nargs: %ld\n", args->gridX, args->gridY, job->args->n);
     106            goodPixels += args->goodPixels;
     107        }
     108        psFree (job);
    110109    }
    111110    psFree(interp);
     
    115114    // Store the variance factor and number of good pixels
    116115    if (goodPixels > 0) {
    117         // Variance factor: large factor --> small scale
    118         float varFactor = psImageInterpolateVarianceFactor(input->image->numCols / 2.0 + input->image->col0, input->image->numRows / 2.0 + input->image->row0, interp); 
     116        // Variance factor: large factor --> small scale
     117        float varFactor = psImageInterpolateVarianceFactor(input->image->numCols / 2.0 + input->image->col0, input->image->numRows / 2.0 + input->image->row0, interp);
    119118        psMetadataItem *vfItem = psMetadataLookup(output->analysis, PSWARP_ANALYSIS_VARFACTOR);
    120119        if (vfItem) {
     
    135134
    136135    if (goodPixels > 0) {
    137         if (!pswarpTransformSources (output, input, config)) {
    138             psError(PS_ERR_UNKNOWN, false, "Unable to interpolate image.");
    139             return false;
    140         }
     136        if (!pswarpTransformSources (output, input, config)) {
     137            psError(PS_ERR_UNKNOWN, false, "Unable to interpolate image.");
     138            return false;
     139        }
    141140    }
    142141
Note: See TracChangeset for help on using the changeset viewer.