IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 14834


Ignore:
Timestamp:
Sep 13, 2007, 5:39:58 PM (19 years ago)
Author:
Paul Price
Message:

Cleaning up code to produce photometry. Moving the call to psphot into ppStackReadout.

Location:
trunk/ppStack/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppStack/src/ppStackArguments.c

    r14811 r14834  
    114114    psMetadataAddU8(arguments,  PS_LIST_TAIL, "-mask-blank", 0, "Mask value for blank region", 0);
    115115    psMetadataAddF32(arguments, PS_LIST_TAIL, "-threshold-mask", 0, "Threshold for mask deconvolution", NAN);
    116 
    117     // XXX I want to get this from the recipe as well.  (same for everything else...)
    118     psMetadataAddBool(arguments, PS_LIST_TAIL, "-photom", 0, "Mask value for blank region", FALSE);
     116    psMetadataAddBool(arguments, PS_LIST_TAIL, "-photometry", 0, "Do photometry on stacked image?", false);
    119117
    120118    if (argc == 1 || !psArgumentParse(arguments, &argc, argv) || argc != 3) {
     
    165163    VALUE_ARG_RECIPE_FLOAT("-threshold-mask", "THRESHOLD.MASK", F32);
    166164
     165    if (psMetadataLookupBool(NULL, arguments, "-photometry") ||
     166        psMetadataLookupBool(NULL, recipe, "PHOTOMETRY")) {
     167        psMetadataAddBool(config->arguments, PS_LIST_TAIL, "PHOTOMETRY", 0,
     168                          "Do photometry on stacked image?", true);
     169    }
     170
    167171    psTrace("ppStack", 1, "Done reading command-line arguments\n");
    168172    psFree(arguments);
  • trunk/ppStack/src/ppStackCamera.c

    r14811 r14834  
    229229    // we create a copy of the mosaicked image for psphot so we can write out a clean image
    230230    bool mdok = false;
    231     bool doPhotom = psMetadataLookupBool(&mdok, config->arguments, "PHOTOM"); // perform photometry
     231    bool doPhotom = psMetadataLookupBool(&mdok, config->arguments, "PHOTOMETRY"); // perform photometry
    232232    if (doPhotom) {
    233         // this file is just used as a carrier; output files (eg, PSPHOT.RESID) are defined by
     233        // This file, PSPHOT.INPUT, is just used as a carrier; output files (eg, PSPHOT.RESID) are defined by
    234234        // psphotDefineFiles
    235         pmFPAfile *psphotInput = pmFPAfileDefineFromFPA (config, output->fpa, 1, 1, "PSPHOT.INPUT");
    236         PS_ASSERT (psphotInput, false);
    237 
    238         // define associated psphot input/output files
    239         if (!psphotDefineFiles (config, psphotInput)) {
    240             psError(PSPHOT_ERR_CONFIG, false, "Trouble defining the additional input/output files for psphot");
     235        pmFPAfile *psphotInput = pmFPAfileDefineFromFPA(config, output->fpa, 1, 1, "PSPHOT.INPUT");
     236        if (!psphotInput) {
     237            psError(PS_ERR_IO, false, _("Unable to generate output file from PSPHOT.INPUT"));
     238            return false;
     239        }
     240
     241        // Define associated psphot input/output files
     242        if (!psphotDefineFiles(config, psphotInput)) {
     243            psError(PSPHOT_ERR_CONFIG, false,
     244                    "Trouble defining the additional input/output files for psphot");
    241245            return false;
    242246        }
  • trunk/ppStack/src/ppStackLoop.c

    r14404 r14834  
    88#include <psmodules.h>
    99#include <ppStats.h>
    10 #include <psphot.h>
    1110
    1211#include "ppStack.h"
     
    3837        return false;
    3938    }
    40 
    41     bool doPhotom = psMetadataLookupBool(&mdok, config->arguments, "PHOTOM"); // perform photometry
    4239
    4340    pmFPAview *view = pmFPAviewAlloc(0); // Pointer into FPA hierarchy
     
    8380                }
    8481
    85                 if (doPhotom) {
    86                   if (!psphotReadout (config, view)) {
    87                     psError(psErrorCodeLast(), false, "failure in psphotReadout for stacked image\n");
    88                     return false;
    89                   }
    90                 }
    91 
    9282                if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE)) {
    9383                    return false;
  • trunk/ppStack/src/ppStackReadout.c

    r14811 r14834  
    66#include <pslib.h>
    77#include <psmodules.h>
     8#include <psphot.h>
    89
    910#include "ppStack.h"
     
    1819{
    1920    // Get the recipe values
     21    bool mdok;                          // Status of MD lookup
    2022    int iter = psMetadataLookupS32(NULL, config->arguments, "ITER"); // Rejection iterations
    2123    float combineRej = psMetadataLookupF32(NULL, config->arguments, "COMBINE.REJ"); // Combination threshold
     
    2325    psMaskType maskBlank = psMetadataLookupU8(NULL, config->arguments, "MASK.BLANK"); // Mask for blank reg.
    2426    float threshold = psMetadataLookupF32(NULL, config->arguments, "THRESHOLD.MASK"); // Threshold for mask deconvolution
     27    bool photometry = psMetadataLookupBool(&mdok, config->arguments, "PHOTOMETRY"); // Perform photometry?
    2528
    2629    // Get the output target
     
    317320    psFree(cellList);
    318321
     322    if (photometry && !psphotReadout(config, view)) {
     323        psError(psErrorCodeLast(), false, "Unable to perform photometry on stacked image.\n");
     324        return false;
     325    }
     326
     327
     328
     329
    319330    psFree(stack);
    320331    psFree(outRO);                      // Drop reference
Note: See TracChangeset for help on using the changeset viewer.