IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 15, 2009, 4:02:42 PM (17 years ago)
Author:
eugene
Message:

updates from trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/20090715/magic/censorObjects/src/censorLoop.c

    r24714 r25406  
    2222 */
    2323bool censorLoop (pmConfig *config) {
    24 
    2524    pmChip *chip;
    2625    pmCell *cell;
     
    2827
    2928    psTimerStart ("censor");
     29
     30
     31
    3032
    3133    // select the current recipe
     
    5153
    5254    pmFPAview *view = pmFPAviewAlloc (0);
     55
    5356    bool badMaskFile = false;
    5457
     
    5962    if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) ESCAPE;
    6063
     64    // check PHU header to see if we are using mosaic-level or per-chip astrometry
     65    bool bilevelAstrometry = false;
     66    pmHDU *phu = pmFPAviewThisPHU (view, input->fpa);
     67    if (phu) {
     68      char *ctype = psMetadataLookupStr (NULL, phu->header, "CTYPE1");
     69      if (ctype) bilevelAstrometry = !strcmp (&ctype[4], "-DIS");
     70    }
     71    if (bilevelAstrometry) {
     72      pmAstromReadBilevelMosaic (input->fpa, phu->header);
     73    }
     74
    6175    while ((chip = pmFPAviewNextChip (view, input->fpa, 1)) != NULL) {
    6276        psTrace ("censor", 4, "Chip %d: %x %x\n", view->chip, chip->file_exists, chip->process);
    6377        if (!chip->process || !chip->file_exists) { continue; }
    64 
     78       
    6579        // check on the mask file at this level if possible
    6680        badMaskFile = censorBadFileByView(badMaskFile, inMask, config, view);
    6781
    6882        if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) ESCAPE;
     83
     84        // read WCS data from the corresponding header
     85
     86        pmHDU *hdu = pmFPAviewThisHDU (view, input->fpa);
     87       
     88        if (bilevelAstrometry) {
     89          if (!pmAstromReadBilevelChip (chip, hdu->header)) {
     90            psWarning("Could not get WCS information from header for chip %d, skipping", view->chip);
     91            continue;
     92          }
     93        } else {
     94          if (!pmAstromReadWCS(input->fpa, chip, hdu->header, 1.0)) {
     95            psWarning( "Unable to read WCS astrometry from chip %d, skipping", view->chip);
     96            continue;
     97          }
     98        }
    6999
    70100        while ((cell = pmFPAviewNextCell (view, input->fpa, 1)) != NULL) {
Note: See TracChangeset for help on using the changeset viewer.