IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 26896


Ignore:
Timestamp:
Feb 10, 2010, 7:38:54 PM (16 years ago)
Author:
eugene
Message:

updates from eam_branches/20091201

Location:
trunk/pswarp/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/pswarp/src/pswarpDefine.c

    r25741 r26896  
    7777        psFree(readout);                // Drop reference
    7878
    79         psMetadataItemSupplement(target->concepts, source->concepts, "CELL.XBIN");
    80         psMetadataItemSupplement(target->concepts, source->concepts, "CELL.YBIN");
    81         psMetadataItemSupplement(target->concepts, source->concepts, "CELL.XSIZE");
    82         psMetadataItemSupplement(target->concepts, source->concepts, "CELL.YSIZE");
    83         psMetadataItemSupplement(target->concepts, source->concepts, "CELL.XPARITY");
    84         psMetadataItemSupplement(target->concepts, source->concepts, "CELL.YPARITY");
    85         psMetadataItemSupplement(target->concepts, source->concepts, "CELL.X0");
    86         psMetadataItemSupplement(target->concepts, source->concepts, "CELL.Y0");
     79        bool status = false;
     80        psMetadataItemSupplement(&status, target->concepts, source->concepts, "CELL.XBIN");
     81        psMetadataItemSupplement(&status, target->concepts, source->concepts, "CELL.YBIN");
     82        psMetadataItemSupplement(&status, target->concepts, source->concepts, "CELL.XSIZE");
     83        psMetadataItemSupplement(&status, target->concepts, source->concepts, "CELL.YSIZE");
     84        psMetadataItemSupplement(&status, target->concepts, source->concepts, "CELL.XPARITY");
     85        psMetadataItemSupplement(&status, target->concepts, source->concepts, "CELL.YPARITY");
     86        psMetadataItemSupplement(&status, target->concepts, source->concepts, "CELL.X0");
     87        psMetadataItemSupplement(&status, target->concepts, source->concepts, "CELL.Y0");
    8788    }
    8889
  • trunk/pswarp/src/pswarpLoop.c

    r25847 r26896  
    162162        pmChip *chip;
    163163        pmFPAview *view = pmFPAviewAlloc(0);
    164         pmFPAfileIOChecks (config, view, PM_FPA_BEFORE);
     164        if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) {
     165            return false;
     166        }
    165167        while ((chip = pmFPAviewNextChip (view, input->fpa, 1)) != NULL) {
    166168            psTrace ("pswarp", 4, "Chip %d: %x %x\n", view->chip, chip->file_exists, chip->process);
    167169            if (!chip->process || !chip->file_exists) { continue; }
    168             pmFPAfileIOChecks(config, view, PM_FPA_BEFORE);
     170            if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE)) {
     171                return false;
     172            }
    169173            pmCell *cell;
    170174            while ((cell = pmFPAviewNextCell (view, input->fpa, 1)) != NULL) {
    171175                psTrace ("pswarp", 4, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process);
    172176                if (!cell->process || !cell->file_exists) { continue; }
    173                 pmFPAfileIOChecks (config, view, PM_FPA_BEFORE);
    174                 pmFPAfileIOChecks (config, view, PM_FPA_AFTER);
    175             }
    176             pmFPAfileIOChecks (config, view, PM_FPA_AFTER);
    177         }
    178         pmFPAfileIOChecks (config, view, PM_FPA_AFTER);
     177                if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE) ||
     178                    !pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) {
     179                    return false;
     180                }
     181            }
     182            if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) {
     183                return false;
     184            }
     185        }
     186        if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) {
     187            return false;
     188        }
    179189        psFree(view);
    180190
     
    211221
    212222    // files associated with the science image
    213     pmFPAfileIOChecks (config, view, PM_FPA_BEFORE);
     223    if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) {
     224        return false;
     225    }
    214226
    215227    pmChip *chip;
     
    217229        psTrace ("pswarp", 4, "Chip %d: %x %x\n", view->chip, chip->file_exists, chip->process);
    218230        if (!chip->process || !chip->file_exists) { continue; }
    219         pmFPAfileIOChecks (config, view, PM_FPA_BEFORE);
     231        if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) {
     232            return false;
     233        }
    220234
    221235        // read WCS data from the corresponding header
     
    242256            psTrace ("pswarp", 4, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process);
    243257            if (!cell->process || !cell->file_exists) { continue; }
    244             pmFPAfileIOChecks (config, view, PM_FPA_BEFORE);
     258            if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) {
     259                return false;
     260            }
    245261
    246262            psListAdd(cells, PS_LIST_TAIL, cell);
     
    249265            pmReadout *readout;
    250266            while ((readout = pmFPAviewNextReadout(view, input->fpa, 1)) != NULL) {
    251                 pmFPAfileIOChecks(config, view, PM_FPA_BEFORE);
     267                if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE)) {
     268                    return false;
     269                }
    252270                if (!readout->data_exists) {
    253271                    continue;
    254272                }
    255273
    256                 // Copy the sources from the astrometry carrier to the input, so they can be accessed by
     274                // Copy the detections from the astrometry carrier to the input, so they can be accessed by
    257275                // pswarpTransformReadout
    258276                pmReadout *astromRO = pmFPAviewThisReadout(view, astrom->fpa); // Readout for astrometry
    259                 psArray *sources = psMetadataLookupPtr(&mdok, astromRO->analysis,
    260                                                        "PSPHOT.SOURCES"); // Sources from astrometry
    261                 if (sources) {
    262                     psMetadataAddPtr(readout->analysis, PS_LIST_TAIL, "PSPHOT.SOURCES", PS_DATA_ARRAY,
    263                                      "Sources from input astrometry", sources);
     277                pmDetections *detections = psMetadataLookupPtr(&mdok, astromRO->analysis, "PSPHOT.DETECTIONS"); // Sources from astrometry
     278                if (detections) {
     279                    psMetadataAddPtr(readout->analysis, PS_LIST_TAIL, "PSPHOT.DETECTIONS", PS_DATA_ARRAY, "Sources from input astrometry", detections);
    264280                }
    265281
    266282                pswarpTransformReadout(output, readout, config);
    267283
    268                 pmFPAfileIOChecks(config, view, PM_FPA_AFTER);
    269             }
    270             pmFPAfileIOChecks(config, view, PM_FPA_AFTER);
    271         }
    272         pmFPAfileIOChecks(config, view, PM_FPA_AFTER);
     284                if (!pmFPAfileIOChecks(config, view, PM_FPA_AFTER)) {
     285                    return false;
     286                }
     287            }
     288            if (!pmFPAfileIOChecks(config, view, PM_FPA_AFTER)) {
     289                return false;
     290            }
     291        }
     292        if (!pmFPAfileIOChecks(config, view, PM_FPA_AFTER)) {
     293            return false;
     294        }
    273295    }
    274296
     
    370392    }
    371393
    372     pmFPAfileIOChecks(config, view, PM_FPA_AFTER);
     394    if (!pmFPAfileIOChecks(config, view, PM_FPA_AFTER)) {
     395        return false;
     396    }
    373397
    374398    // Done with the detector side of things
     
    478502        }
    479503        fprintf(statsFile, "%s", statsMDC);
    480         psFree((void*)statsMDC);
     504        psFree(statsMDC);
    481505        fclose(statsFile);
    482506        pmConfigRunFilenameAddWrite(config, "STATS", statsName);
  • trunk/pswarp/src/pswarpParseCamera.c

    r26517 r26896  
    143143        }
    144144        psphotInput->src = psMemIncrRefCounter(output->fpa);
     145        // specify the number of psphot input images
     146        psMetadataAddS32 (config->arguments, PS_LIST_TAIL, "PSPHOT.INPUT.NUM", PS_META_REPLACE, "number of inputs", 1);
    145147
    146148        pmFPAfile *psphotInSources = pmFPAfileDefineSkycell(config, output->fpa, "PSPHOT.INPUT.CMF");
  • trunk/pswarp/src/pswarpTransformReadout.c

    r25043 r26896  
    107107        psImageInit(output->mask, maskBad);
    108108    }
     109
     110    // Ensure threading is off for the covariance calculation, since we are threading on a different level.
     111    psImageCovarianceSetThreads(false);
    109112
    110113    // create jobs and supply them to the threads
  • trunk/pswarp/src/pswarpTransformSources.c

    r25758 r26896  
    3131
    3232    // Transform sources
    33     psArray *inSources = psMetadataLookupPtr(&mdok, input->analysis, "PSPHOT.SOURCES"); // Sources in source
     33    pmDetections *inDetections = psMetadataLookupPtr(&mdok, input->analysis, "PSPHOT.DETECTIONS"); // Sources in source
     34    if (!inDetections) return true;
     35    psArray *inSources = inDetections->allSources;
    3436    if (!inSources) return true;
    3537
    3638    pswarpMapGrid *sourceGrid = pswarpMapGridFromImage(output, input, nGridX, nGridY); // Grid for sources
    3739
    38     psArray *outSources = psMemIncrRefCounter(psMetadataLookupPtr(&mdok, output->analysis, "PSPHOT.SOURCES")); // Target sources
     40    pmDetections *outDetections = psMemIncrRefCounter(psMetadataLookupPtr(&mdok, output->analysis, "PSPHOT.DETECTIONS")); // Target sources
     41    if (!outDetections) {
     42        outDetections = pmDetectionsAlloc();
     43        psMetadataAddPtr(output->analysis, PS_LIST_TAIL, "PSPHOT.DETECTIONS", PS_DATA_ARRAY, "Warped sources", outDetections);
     44    }
     45    psArray *outSources = outDetections->allSources;
    3946    if (!outSources) {
    40         outSources = psArrayAllocEmpty(SOURCE_ARRAY_BUFFER);
    41         psMetadataAddPtr(output->analysis, PS_LIST_TAIL, "PSPHOT.SOURCES", PS_DATA_ARRAY,
    42                          "Warped sources", outSources);
     47        outDetections->allSources = psArrayAllocEmpty(SOURCE_ARRAY_BUFFER);
     48        outSources = outDetections->allSources;
    4349    }
    4450
     
    5763            psError(PS_ERR_UNKNOWN, false, "Unable to get grid coordinates for source at %f,%f\n",
    5864                    xIn, yIn);
    59             psFree(outSources);
     65            psFree(outDetections);
    6066            psFree(sourceGrid);
    6167            return false;
     
    7278            psError(PS_ERR_UNKNOWN, false, "Unable to transform coordinates for source at %f,%f\n",
    7379                    xIn, yIn);
    74             psFree(outSources);
     80            psFree(outDetections);
    7581            psFree(sourceGrid);
    7682            return false;
     
    142148    }
    143149    psFree(sourceGrid);
    144     psFree(outSources);             // Drop reference
     150    psFree(outDetections);             // Drop reference
    145151    return true;
    146152}
Note: See TracChangeset for help on using the changeset viewer.