IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 26781


Ignore:
Timestamp:
Feb 5, 2010, 1:19:36 PM (16 years ago)
Author:
eugene
Message:

updates to psphot APIs to enable stack photometry

Location:
branches/eam_branches/20091201/pswarp/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/20091201/pswarp/src/pswarpLoop.c

    r26535 r26781  
    254254                }
    255255
    256                 // Copy the sources from the astrometry carrier to the input, so they can be accessed by
     256                // Copy the detections from the astrometry carrier to the input, so they can be accessed by
    257257                // pswarpTransformReadout
    258258                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);
     259                pmDetections *detections = psMetadataLookupPtr(&mdok, astromRO->analysis, "PSPHOT.DETECTIONS"); // Sources from astrometry
     260                if (detections) {
     261                    psMetadataAddPtr(readout->analysis, PS_LIST_TAIL, "PSPHOT.DETECTIONS", PS_DATA_ARRAY, "Sources from input astrometry", detections);
    264262                }
    265263
  • branches/eam_branches/20091201/pswarp/src/pswarpTransformSources.c

    r25758 r26781  
    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.