IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 9, 2013, 12:26:48 PM (13 years ago)
Author:
eugene
Message:

major upgrades to pswarp to enable skycell warp -> chip

File:
1 edited

Legend:

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

    r34800 r35563  
    1616 * NOTE: in this function, the coordinates are transformed from the OUTPUT to the INPUT
    1717 */
    18 bool pswarpTransformReadout(pmReadout *output, pmReadout *input, pmConfig *config)
     18bool pswarpTransformReadout(pmReadout *output, pmReadout *input, pmConfig *config, bool backgroundWarp)
    1919{
    2020    // XXX this implementation currently ignores the use of the region
     
    5252    }
    5353
    54     // XXX unused int nThreads = psMetadataLookupS32(&mdok, config->arguments, "NTHREADS"); // Number of threads
    55     // XXX unused if (!mdok) {
    56     // XXX unused     nThreads = 0;
    57     // XXX unused }
    5854    float poorFrac = psMetadataLookupF32(NULL, config->arguments, "POOR.FRAC"); ///< Flux fraction for "poor"
    5955
     
    6157    // output coordinates to input coordinates
    6258    pswarpMapGrid *grid = pswarpMapGridFromImage(input, output, nGridX, nGridY);
    63     //    if (psMetadataLookupBool(NULL,config->arguments,"BACKGROUND_WARPING")) {
    6459   
    6560    // XXX optionally modify the grid based on this result and force the maxError < XXX
     
    117112    psAssert (xGridMax < grid->nXpts, "xGridMax too big\n");
    118113    psAssert (yGridMax < grid->nYpts, "yGridMax too big\n");
     114
     115    // fprintf (stderr, "warp %d,%d - %d,%d\n", xGridMin, yGridMin, xGridMax, yGridMax);
    119116
    120117    // create jobs and supply them to the threads
     
    132129            args->goodPixels = 0;
    133130
    134             if (psMetadataLookupBool(NULL,config->arguments,"BACKGROUND_WARPING")) {
     131            if (backgroundWarp) {
    135132              args->background_warping = true;
    136133              args->offset_x = psMetadataLookupF32(NULL,config->arguments,"BKG_WARP_XOFFSET");
    137134              args->offset_y = psMetadataLookupF32(NULL,config->arguments,"BKG_WARP_YOFFSET");
    138135            }
    139 
    140136           
    141137            // allocate a job
     
    210206    psFree(interp);
    211207
    212     if (goodPixels > 0 && psMetadataLookupBool(&mdok, recipe, "SOURCES")) {
    213       if (!psMetadataLookupBool(NULL,config->arguments,"BACKGROUND_WARPING")) {
    214         if (!pswarpTransformSources(output, input, config)) {
    215           psError(psErrorCodeLast(), false, "Unable to interpolate image.");
    216           return false;
     208    if (goodPixels > 0 && !backgroundWarp && psMetadataLookupBool(&mdok, recipe, "SOURCES")) {
     209        if (!pswarpTransformSources(output, input, config)) {
     210            psError(psErrorCodeLast(), false, "Unable to transform sources.");
     211            return false;
    217212        }
    218       }
    219213    }
    220214
Note: See TracChangeset for help on using the changeset viewer.