IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 26, 2013, 9:07:23 AM (13 years ago)
Author:
eugene
Message:

major mods to allow multichip output

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20130419/pswarp/src/pswarpDefineLayout.c

    r35424 r35434  
    2525        astrom = input;
    2626    }
    27     if (!pswarpLoadAstrometry (config, input, astrom)) {
     27    if (!pswarpLoadAstrometry (input, astrom, config)) {
    2828        psError(PSWARP_ERR_CONFIG, false, "problem loading input astrometry\n");
    2929        return false;
     
    4141        return false;
    4242    }
    43     if (!pswarpLoadAstrometry (config, output, skycell)) {
     43    if (!pswarpLoadAstrometry (output, skycell, config)) {
    4444        psError(PSWARP_ERR_CONFIG, false, "problem loading output astrometry\n");
    4545        return false;
     
    5050
    5151    // find the R,D center for the skycell, use for common projection
    52     psProjection *frame = pswarpLocalFrame (output->fpa);
     52    psProjection *frame = pswarpLocalFrame (skycell->fpa);
    5353
    5454    // generate Lmin,max, Mmin,max for both datasets
     55    fprintf (stderr, "srcBounds:\n");
     56    // pswarpBounds *srcBounds = pswarpMakeBounds (astrom->fpa, frame);
    5557    pswarpBounds *srcBounds = pswarpMakeBounds (input->fpa, frame);
    56     pswarpBounds *tgtBounds = pswarpMakeBounds (output->fpa, frame);
     58
     59    fprintf (stderr, "srcBounds:\n");
     60    pswarpBounds *tgtBounds = pswarpMakeBounds (skycell->fpa, frame);
     61
    5762    pswarpFindOverlap (output->fpa, srcBounds, tgtBounds);
    5863
     64    // XXX the loop below generates the output pixels. should this be deferred until
     65    // we actually need them?
    5966    // Generate the output chips (pixels on output->fpa, concepts from skycell->fpa)
    6067    pmFPAview *view = pmFPAviewAlloc(0);
     
    6370    while ((chip = pmFPAviewNextChip (view, output->fpa, 1)) != NULL) {
    6471        psTrace ("pswarp", 4, "Chip %d: %x %x\n", view->chip, chip->file_exists, chip->process);
    65         if (!chip->process || !chip->file_exists) { continue; }
     72        if (!chip->process) { continue; }
    6673        pmCell *cell;
    6774        while ((cell = pmFPAviewNextCell (view, output->fpa, 1)) != NULL) {
    6875            psTrace ("pswarp", 4, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process);
    69             if (!cell->process || !cell->file_exists) { continue; }
     76            if (!cell->process) { continue; }
     77
     78            pmCell *refcell = pmFPAviewThisCell(view, skycell->fpa); ///< Target cell
    7079
    7180            // we've got the output astrom header
    72             pmHDU *hdu = pmHDUFromCell(cell); ///< HDU for source
     81            pmHDU *hdu = pmHDUFromCell(refcell); ///< HDU for source
    7382            if (!hdu || !hdu->header) {
    7483                psError(PM_ERR_PROG, false, "Unable to find header for sky cell.");
     
    92101            // copy the image concepts from the skycell
    93102            bool status = false;
    94             pmCell *refcell = pmFPAviewThisCell(view, skycell->fpa); ///< Target cell
    95103            psMetadataItemSupplement(&status, cell->concepts, refcell->concepts, "CELL.XBIN");
    96104            psMetadataItemSupplement(&status, cell->concepts, refcell->concepts, "CELL.YBIN");
     
    101109            psMetadataItemSupplement(&status, cell->concepts, refcell->concepts, "CELL.X0");
    102110            psMetadataItemSupplement(&status, cell->concepts, refcell->concepts, "CELL.Y0");
     111
     112            chip->data_exists = true;
     113            chip->file_exists = true;
     114            cell->data_exists = true;
     115            cell->file_exists = true;
     116
     117# if (0)
     118            // ******* this chunk comes from pswarpLoop, but should be done when the output chip is generated
     119            pmHDU *outHDU = pmHDUFromCell (cell);           ///< HDU for the output warped image
     120            outHDU->header = psMetadataCopy(outHDU->header, hdu->header);
     121            pswarpVersionHeader(outHDU->header);
     122# endif
    103123        }
    104124    }
Note: See TracChangeset for help on using the changeset viewer.