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/psphotReadoutMinimal.c

    r28013 r29936  
    77// NOTE: ppSub needs to perform extended source analysis for comets and trails.
    88
    9 bool psphotReadoutMinimal(pmConfig *config, const pmFPAview *view) {
     9bool psphotReadoutMinimal(pmConfig *config, const pmFPAview *view, const char *filerule) {
    1010
    1111    // measure the total elapsed time in psphotReadout.  XXX the current threading plan
     
    1818
    1919    // set the photcode for this image
    20     if (!psphotAddPhotcode(config, view, "PSPHOT.INPUT")) {
     20    if (!psphotAddPhotcode(config, view, filerule)) {
    2121        psError(PSPHOT_ERR_CONFIG, false, "trouble defining the photcode");
    2222        return false;
     
    2424
    2525    // Generate the mask and weight images, including the user-defined analysis region of interest
    26     psphotSetMaskAndVariance (config, view, "PSPHOT.INPUT");
     26    psphotSetMaskAndVariance (config, view, filerule);
    2727
    2828    // load the psf model, if suppled.  FWHM_X,FWHM_Y,etc are saved on readout->analysis
    29     if (!psphotLoadPSF (config, view)) {
     29    if (!psphotLoadPSF (config, view, filerule)) {
    3030      psError (PSPHOT_ERR_CONFIG, false, "missing psf model");
    31       return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");
     31      return psphotReadoutCleanup (config, view, filerule);
    3232    }
    3333
    3434    // find the detections (by peak and/or footprint) in the image. (final pass)
    35     if (!psphotFindDetections(config, view, "PSPHOT.INPUT", false)) {
     35    if (!psphotFindDetections(config, view, filerule, false)) {
    3636        psError (PSPHOT_ERR_UNKNOWN, false, "failure in peak analysis");
    37         return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");
     37        return psphotReadoutCleanup (config, view, filerule);
    3838    }
    3939
    4040    // construct sources and measure basic stats (saved on detections->newSources)
    41     if (!psphotSourceStats (config, view, "PSPHOT.INPUT", false)) { // pass 1
     41    if (!psphotSourceStats (config, view, filerule, false)) { // pass 1
    4242        psError(PSPHOT_ERR_UNKNOWN, false, "failure to generate sources");
    43         return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");
     43        return psphotReadoutCleanup (config, view, filerule);
    4444    }
    4545
    4646    // find blended neighbors of very saturated stars
    47     psphotDeblendSatstars (config, view, "PSPHOT.INPUT");
     47    psphotDeblendSatstars (config, view, filerule);
    4848
    4949    // mark blended peaks PS_SOURCE_BLEND
    50     if (!psphotBasicDeblend (config, view, "PSPHOT.INPUT")) {
     50    if (!psphotBasicDeblend (config, view, filerule)) {
    5151        psLogMsg ("psphot", 3, "failed on deblend analysis");
    52         return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");
     52        return psphotReadoutCleanup (config, view, filerule);
    5353    }
    5454
    5555    // classify sources based on moments, brightness (use supplied psf shape parameters)
    56     if (!psphotRoughClass (config, view, "PSPHOT.INPUT")) {
     56    if (!psphotRoughClass (config, view, filerule)) {
    5757        psLogMsg ("psphot", 3, "failed to find a valid PSF clump for image");
    58         return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");
     58        return psphotReadoutCleanup (config, view, filerule);
    5959    }
    6060
    6161    // construct an initial model for each object
    62     psphotGuessModels (config, view, "PSPHOT.INPUT");
     62    psphotGuessModels (config, view, filerule);
    6363
    6464    // merge the newly selected sources into the existing list
    65     psphotMergeSources (config, view, "PSPHOT.INPUT");
     65    psphotMergeSources (config, view, filerule);
    6666
    6767    // linear PSF fit to source peaks
    68     psphotFitSourcesLinear (config, view, "PSPHOT.INPUT", false);
     68    psphotFitSourcesLinear (config, view, filerule, false);
    6969
    7070// XXX eventually, add the extended source fits here
    7171# if (0)
    7272    // measure source size for the remaining sources
    73     psphotSourceSize (config, view, "PSPHOT.INPUT");
     73    psphotSourceSize (config, view, filerule);
    7474
    75     psphotExtendedSourceAnalysis (config, view, "PSPHOT.INPUT");
     75    psphotExtendedSourceAnalysis (config, view, filerule);
    7676
    77     psphotExtendedSourceFits (config, view, "PSPHOT.INPUT");
     77    psphotExtendedSourceFits (config, view, filerule);
    7878# endif
    7979
    8080    // calculate source magnitudes
    81     psphotMagnitudes(config, view, "PSPHOT.INPUT");
     81    psphotMagnitudes(config, view, filerule);
    8282
    8383    // XXX ensure this is measured if the analysis succeeds (even if quality is low)
    84     if (!psphotEfficiency(config, view, "PSPHOT.INPUT")) {
     84    if (!psphotEfficiency(config, view, filerule)) {
    8585        psErrorStackPrint(stderr, "Unable to determine detection efficiencies from fake sources");
    8686        psErrorClear();
     
    8888
    8989    // drop the references to the image pixels held by each source
    90     psphotSourceFreePixels (config, view, "PSPHOT.INPUT");
     90    psphotSourceFreePixels (config, view, filerule);
    9191
    9292    // create the exported-metadata and free local data
    93     return psphotReadoutCleanup (config, view, "PSPHOT.INPUT");
     93    return psphotReadoutCleanup (config, view, filerule);
    9494}
Note: See TracChangeset for help on using the changeset viewer.