IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 5, 2010, 9:42:25 PM (16 years ago)
Author:
eugene
Message:

psphotReadout* API modification to accept a filerule name; wrap lookup of filerule.NUM values in a function (missing = 1); drop deprecated psphotDetect and related; add function to cleanup input pmFPAfile; use psMetadataAddF32 instead of psMetadataAdd (... PS_DATA_F32); add psphotReadoutForcedKnownSources.c; add psphotAddKnownSources

Location:
trunk/psphot
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/psphot

  • trunk/psphot/src/psphotReadoutKnownSources.c

    r28013 r29936  
    33// in this psphotReadout-variant, we are only measuring the photometry for known sources, using
    44// a PSF generated for this observation from those sources
    5 bool psphotReadoutKnownSources(pmConfig *config, const pmFPAview *view, psArray *inSources) {
     5bool psphotReadoutKnownSources(pmConfig *config, const pmFPAview *view, const char *filerule, psArray *inSources) {
    66
    77    psTimerStart ("psphotReadout");
    88
    99    // set the photcode for this image
    10     if (!psphotAddPhotcode(config, view, "PSPHOT.INPUT")) {
     10    if (!psphotAddPhotcode(config, view, filerule)) {
    1111        psError(PSPHOT_ERR_CONFIG, false, "trouble defining the photcode");
    1212        return false;
     
    1414
    1515    // Generate the mask and weight images, including the user-defined analysis region of interest
    16     psphotSetMaskAndVariance (config, view, "PSPHOT.INPUT");
     16    psphotSetMaskAndVariance (config, view, filerule);
    1717
    1818    // Note that in this implementation, we do NOT model the background and we do not
     
    2020
    2121    // include externally-supplied sources (supplied as PSPHOT.INPUT.CMF)
    22     if (!psphotDetectionsFromSources (config, view, "PSPHOT.INPUT", inSources)) {
     22    if (!psphotDetectionsFromSources (config, view, filerule, inSources)) {
    2323        psError(PSPHOT_ERR_ARGUMENTS, true, "Can't find PSF stars");
    24         return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");
     24        return psphotReadoutCleanup (config, view, filerule);
    2525    }
    2626
    2727    // construct sources and measure basic stats
    28     if (!psphotSourceStats (config, view, "PSPHOT.INPUT", true)) {
     28    if (!psphotSourceStats (config, view, filerule, true)) {
    2929        psError(PSPHOT_ERR_UNKNOWN, false, "failure to generate sources");
    3030        return false;
     
    3232
    3333    // peak flux is wrong : use the peak measured in the moments analysis:
    34     if (!psphotRepairLoadedSources(config, view, "PSPHOT.INPUT")) {
     34    if (!psphotRepairLoadedSources(config, view, filerule)) {
    3535        psError(PSPHOT_ERR_UNKNOWN, false, "failure to repair sources");
    3636        return false;
     
    3838
    3939    // classify sources based on moments, brightness (psf is not known)
    40     if (!psphotRoughClass (config, view, "PSPHOT.INPUT")) {
     40    if (!psphotRoughClass (config, view, filerule)) {
    4141        psError (PSPHOT_ERR_UNKNOWN, false, "failed to determine rough source class");
    42         return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");
     42        return psphotReadoutCleanup (config, view, filerule);
    4343    }
    4444
    45     if (!psphotChoosePSF (config, view, "PSPHOT.INPUT")) {
     45    if (!psphotChoosePSF (config, view, filerule)) {
    4646        psError(PSPHOT_ERR_PSF, false, "Failed to construct a psf model");
    47         return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");
     47        return psphotReadoutCleanup (config, view, filerule);
    4848    }
    4949
    5050    // construct an initial model for each object
    51     psphotGuessModels (config, view, "PSPHOT.INPUT");
     51    psphotGuessModels (config, view, filerule);
    5252
    5353    // merge the newly selected sources into the existing list
    5454    // NOTE: merge OLD and NEW
    55     psphotMergeSources (config, view, "PSPHOT.INPUT");
     55    psphotMergeSources (config, view, filerule);
    5656
    5757    // linear PSF fit to source peaks
    58     psphotFitSourcesLinear (config, view, "PSPHOT.INPUT", false);
     58    psphotFitSourcesLinear (config, view, filerule, false);
    5959
    6060    // measure aperture photometry corrections
    61     if (!psphotApResid (config, view, "PSPHOT.INPUT")) {
     61    if (!psphotApResid (config, view, filerule)) {
    6262        psLogMsg ("psphot", 3, "failed on psphotApResid");
    63         return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");
     63        return psphotReadoutCleanup (config, view, filerule);
    6464    }
    6565
    6666    // calculate source magnitudes
    67     psphotMagnitudes(config, view, "PSPHOT.INPUT");
     67    psphotMagnitudes(config, view, filerule);
    6868
    6969    // drop the references to the image pixels held by each source
    70     psphotSourceFreePixels (config, view, "PSPHOT.INPUT");
     70    psphotSourceFreePixels (config, view, filerule);
    7171
    7272    // create the exported-metadata and free local data
    73     return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");
     73    return psphotReadoutCleanup (config, view, filerule);
    7474}
Note: See TracChangeset for help on using the changeset viewer.