- Timestamp:
- Apr 26, 2013, 9:07:23 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20130419/pswarp/src/pswarpDefineLayout.c
r35424 r35434 25 25 astrom = input; 26 26 } 27 if (!pswarpLoadAstrometry ( config, input, astrom)) {27 if (!pswarpLoadAstrometry (input, astrom, config)) { 28 28 psError(PSWARP_ERR_CONFIG, false, "problem loading input astrometry\n"); 29 29 return false; … … 41 41 return false; 42 42 } 43 if (!pswarpLoadAstrometry ( config, output, skycell)) {43 if (!pswarpLoadAstrometry (output, skycell, config)) { 44 44 psError(PSWARP_ERR_CONFIG, false, "problem loading output astrometry\n"); 45 45 return false; … … 50 50 51 51 // find the R,D center for the skycell, use for common projection 52 psProjection *frame = pswarpLocalFrame ( output->fpa);52 psProjection *frame = pswarpLocalFrame (skycell->fpa); 53 53 54 54 // generate Lmin,max, Mmin,max for both datasets 55 fprintf (stderr, "srcBounds:\n"); 56 // pswarpBounds *srcBounds = pswarpMakeBounds (astrom->fpa, frame); 55 57 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 57 62 pswarpFindOverlap (output->fpa, srcBounds, tgtBounds); 58 63 64 // XXX the loop below generates the output pixels. should this be deferred until 65 // we actually need them? 59 66 // Generate the output chips (pixels on output->fpa, concepts from skycell->fpa) 60 67 pmFPAview *view = pmFPAviewAlloc(0); … … 63 70 while ((chip = pmFPAviewNextChip (view, output->fpa, 1)) != NULL) { 64 71 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; } 66 73 pmCell *cell; 67 74 while ((cell = pmFPAviewNextCell (view, output->fpa, 1)) != NULL) { 68 75 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 70 79 71 80 // we've got the output astrom header 72 pmHDU *hdu = pmHDUFromCell( cell); ///< HDU for source81 pmHDU *hdu = pmHDUFromCell(refcell); ///< HDU for source 73 82 if (!hdu || !hdu->header) { 74 83 psError(PM_ERR_PROG, false, "Unable to find header for sky cell."); … … 92 101 // copy the image concepts from the skycell 93 102 bool status = false; 94 pmCell *refcell = pmFPAviewThisCell(view, skycell->fpa); ///< Target cell95 103 psMetadataItemSupplement(&status, cell->concepts, refcell->concepts, "CELL.XBIN"); 96 104 psMetadataItemSupplement(&status, cell->concepts, refcell->concepts, "CELL.YBIN"); … … 101 109 psMetadataItemSupplement(&status, cell->concepts, refcell->concepts, "CELL.X0"); 102 110 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 103 123 } 104 124 }
Note:
See TracChangeset
for help on using the changeset viewer.
