IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 29, 2009, 3:29:21 PM (17 years ago)
Author:
Paul Price
Message:

Working, but producing error: 'All data points have the same value: 0.000000.'

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppSkycell/src/ppSkycellLoop.c

    r23996 r24000  
    4444
    4545    REGION_RANGE(0, 0);                 // Lower left
     46    psTrace("ppSkycell", 9, "Start: %.0f %.0f", toCoords->x, toCoords->y);
    4647    REGION_RANGE(0, numRows);           // Upper left
    4748    REGION_RANGE(numCols, 0);           // Lower right
    4849    REGION_RANGE(numCols, numRows);     // Upper right
     50    psTrace("ppSkycell", 9, "Stop: %.0f %.0f\n", toCoords->x, toCoords->y);
    4951
    5052    return region;
     
    185187    for (int i = 0; i < numProj; i++) {
    186188        psRegion *projRegion = projRegions->data[i]; // Region for skycell projection
     189        psTrace("ppSkycell", 2, "Projection %d: [%.0f:%.0f,%.0f:%.0f]\n",
     190                i, projRegion->x0, projRegion->x1, projRegion->y0, projRegion->y1);
    187191        int xSize = projRegion->x1 - projRegion->x0 + 1; // Size of unbinned image
    188192        int ySize = projRegion->y1 - projRegion->y0 + 1; // Size of unbinned image
     
    218222            psFree(view);
    219223
     224            // Flip images; no idea why this has to be done, but apparently it does
     225            {
     226                psImage *rot = psImageRotate(NULL, inRO->image, M_PI, NAN, PS_INTERPOLATE_BILINEAR);
     227                psFree(inRO->image);
     228                inRO->image = rot;
     229            }
     230            if (inRO->mask) {
     231                psImage *rot = psImageRotate(NULL, inRO->mask, M_PI, 0, PS_INTERPOLATE_FLAT);
     232                psFree(inRO->mask);
     233                inRO->mask = rot;
     234            }
     235
    220236            pmReadout *bin1RO = pmReadoutAlloc(NULL), *bin2RO = pmReadoutAlloc(NULL); // Binned readouts
    221237            if (!pmReadoutRebin(bin1RO, inRO, data->maskVal, data->bin1, data->bin1)) {
     
    246262            psFree(file->fpa);
    247263            file->fpa = NULL;
     264            if (data->masksName) {
     265                pmFPAfile *file = pmFPAfileSelectSingle(data->config->files, "PPSKYCELL.MASK", j);
     266                psFree(file->fpa);
     267            }
    248268            pmFPAfileActivate(data->config->files, false, NULL);
    249 
    250             psTrace("ppSkycell", 10, "Blah blah blah\n");
    251         }
    252 
     269        }
     270
     271        pmFPAfileActivate(data->config->files, true, "PPSKYCELL.JPEG1");
     272        pmFPAfileActivate(data->config->files, true, "PPSKYCELL.JPEG2");
     273        pmFPAview *view = filesIterateDown(data->config); // View to readout
     274
     275        pmCell *cell1 = pmFPAfileThisCell(data->config->files, view, "PPSKYCELL.JPEG1"); // Rebinned cell 1
     276        pmCell *cell2 = pmFPAfileThisCell(data->config->files, view, "PPSKYCELL.JPEG2"); // Rebinned cell 2
     277        psFree(view);
     278        pmReadout *ro1 = pmReadoutAlloc(cell1), *ro2 = pmReadoutAlloc(cell2); // Binned readouts
     279
     280        ro1->image = image1;
     281        ro2->image = image2;
     282
     283        ro1->data_exists = cell1->data_exists = cell1->parent->data_exists = true;
     284        ro2->data_exists = cell2->data_exists = cell2->parent->data_exists = true;
     285
     286        pmFPAfile *file1 = pmFPAfileSelectSingle(data->config->files, "PPSKYCELL.JPEG1", 0);
     287        file1->save = true;
     288        file1->index = i;
     289        pmFPAfile *file2 = pmFPAfileSelectSingle(data->config->files, "PPSKYCELL.JPEG2", 0);
     290        file2->save = true;
     291        file2->index = i;
     292
     293#if 0
    253294        {
    254295            psString filename = NULL;   // Filename for image
     
    268309            psFitsClose(fits);
    269310        }
    270 
    271         psFree(image1);
    272         psFree(image2);
     311#endif
     312
    273313    }
    274314
Note: See TracChangeset for help on using the changeset viewer.