Changeset 25080 for trunk/magic/censorObjects/src/censorLoop.c
- Timestamp:
- Aug 14, 2009, 3:17:41 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/magic/censorObjects/src/censorLoop.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/magic/censorObjects/src/censorLoop.c
r24714 r25080 22 22 */ 23 23 bool censorLoop (pmConfig *config) { 24 24 //bool status; 25 25 pmChip *chip; 26 26 pmCell *cell; … … 28 28 29 29 psTimerStart ("censor"); 30 31 32 30 33 31 34 // select the current recipe … … 35 38 return false; 36 39 } 40 41 // physical pixel scale in microns per pixel 42 //double pixelScale = psMetadataLookupF32 (&status, recipe, "PSASTRO.PIXEL.SCALE"); 43 //if (!status) { 44 // psError(PS_ERR_IO, true, "Failed to lookup pixel scale"); 45 // return false; 46 //} 47 37 48 38 49 // select the input data sources … … 50 61 } 51 62 63 64 #if 0 65 pmFPAfileActivate(config->files, false, NULL); 66 pmFPAfileActivate(config->files, true, "CENSOR.INPUT"); 67 #endif 68 52 69 pmFPAview *view = pmFPAviewAlloc (0); 70 71 72 73 74 53 75 bool badMaskFile = false; 54 76 … … 59 81 if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) ESCAPE; 60 82 83 84 // check PHU header to see if we are using mosaic-level or per-chip astrometry 85 bool bilevelAstrometry = false; 86 pmHDU *phu = pmFPAviewThisPHU (view, input->fpa); 87 if (phu) { 88 char *ctype = psMetadataLookupStr (NULL, phu->header, "CTYPE1"); 89 if (ctype) bilevelAstrometry = !strcmp (&ctype[4], "-DIS"); 90 } 91 if (bilevelAstrometry) { 92 pmAstromReadBilevelMosaic (input->fpa, phu->header); 93 } 94 95 96 61 97 while ((chip = pmFPAviewNextChip (view, input->fpa, 1)) != NULL) { 62 98 psTrace ("censor", 4, "Chip %d: %x %x\n", view->chip, chip->file_exists, chip->process); 63 99 if (!chip->process || !chip->file_exists) { continue; } 64 100 65 101 // check on the mask file at this level if possible 66 102 badMaskFile = censorBadFileByView(badMaskFile, inMask, config, view); 67 103 68 104 if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) ESCAPE; 105 106 // read WCS data from the corresponding header 107 108 pmHDU *hdu = pmFPAviewThisHDU (view, input->fpa); 109 110 // int nAstro = psMetadataLookupS32 (&status, hdu->header, "NASTRO"); 111 // if (!nAstro) {psLogMsg ("censor", 3, "nothing %f sec\n", psTimerMark ("censor"));} 112 113 //continue; 114 if (bilevelAstrometry) { 115 if (!pmAstromReadBilevelChip (chip, hdu->header)) { 116 psWarning("Could not get WCS information from header for chip %d, skipping", view->chip); 117 continue; 118 } 119 } else { 120 if (!pmAstromReadWCS(input->fpa, chip, hdu->header, 1.0)) { 121 psWarning( "Unable to read WCS astrometry from chip %d, skipping", view->chip); 122 continue; 123 } 124 } 125 126 127 128 69 129 70 130 while ((cell = pmFPAviewNextCell (view, input->fpa, 1)) != NULL) {
Note:
See TracChangeset
for help on using the changeset viewer.
