IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 18918


Ignore:
Timestamp:
Aug 5, 2008, 11:18:27 AM (18 years ago)
Author:
Paul Price
Message:

Adding configuration dumping. Required reorganisation of how recipe values get into the program. Formerly, the command-line and recipe values were parsed and the result was put on config->arguments. Now, we want whatever was altered by the command-line to be reflected in the recipe (which is dumped), so using the recipe as the storage. Not yet tested, but will do so soon.

Location:
trunk/ppStack/src
Files:
6 edited

Legend:

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

    r18785 r18918  
    4949        } \
    5050    } \
    51     psMetadataAdd##TYPE(config->arguments, PS_LIST_TAIL, RECIPENAME, 0, NULL, value); \
     51    psMetadataAdd##TYPE(recipe, PS_LIST_TAIL, RECIPENAME, PS_META_REPLACE, NULL, value); \
    5252}
    5353
     
    6464        } \
    6565    } \
    66     psMetadataAdd##TYPE(config->arguments, PS_LIST_TAIL, RECIPENAME, 0, NULL, value); \
     66    psMetadataAdd##TYPE(recipe, PS_LIST_TAIL, RECIPENAME, PS_META_REPLACE, NULL, value); \
    6767}
    6868
     
    8080    } \
    8181    psMaskType value = pmConfigMaskGet(name, config); \
    82     psMetadataAddU8(config->arguments, PS_LIST_TAIL, RECIPENAME, 0, NULL, value); \
     82    psMetadataAddU8(recipe, PS_LIST_TAIL, RECIPENAME, PS_META_REPLACE, NULL, value); \
    8383}
    8484
     
    9494        } \
    9595    } \
    96     psMetadataAddS32(config->arguments, PS_LIST_TAIL, RECIPENAME, 0, NULL, psStatsOptionFromString(stat)); \
     96    psMetadataAddS32(recipe, PS_LIST_TAIL, RECIPENAME, PS_META_REPLACE, \
     97                     NULL, psStatsOptionFromString(stat)); \
    9798}
    9899
     
    106107    psString value = psMetadataLookupStr(NULL, arguments, argName); // Value of interest
    107108    if (value && strlen(value) > 0) {
    108         return psMetadataAddStr(target, PS_LIST_TAIL, mdName, 0, NULL, value);
     109        return psMetadataAddStr(target, PS_LIST_TAIL, mdName, PS_META_REPLACE, NULL, value);
    109110    }
    110111    return false;
     
    128129        }
    129130    }
    130     return psMetadataAddStr(target, PS_LIST_TAIL, mdName, 0, NULL, value);
     131    return psMetadataAddStr(target, PS_LIST_TAIL, mdName, PS_META_REPLACE, NULL, value);
    131132}
    132133
     
    142143    psMetadataAddStr(arguments, PS_LIST_TAIL, "-stats", 0, "Statistics file", NULL);
    143144    psMetadataAddS32(arguments, PS_LIST_TAIL, "-iter", 0, "Number of rejection iterations", 0);
    144     psMetadataAddF32(arguments, PS_LIST_TAIL, "-combine-rej", 0, "Combination rejection thresold (sigma)", NAN);
     145    psMetadataAddF32(arguments, PS_LIST_TAIL, "-combine-rej", 0,
     146                     "Combination rejection thresold (sigma)", NAN);
    145147    psMetadataAddU8(arguments,  PS_LIST_TAIL, "-mask-bad", 0, "Mask value for bad pixels", 0);
    146148    psMetadataAddU8(arguments,  PS_LIST_TAIL, "-mask-blank", 0, "Mask value for blank region", 0);
    147149    psMetadataAddF32(arguments, PS_LIST_TAIL, "-threshold-mask", 0, "Threshold for mask deconvolution", NAN);
    148     psMetadataAddF32(arguments, PS_LIST_TAIL, "-image-rej", 0, "Pixel rejection fraction threshold for rejecting entire image", NAN);
     150    psMetadataAddF32(arguments, PS_LIST_TAIL, "-image-rej", 0,
     151                     "Pixel rejection fraction threshold for rejecting entire image", NAN);
    149152    psMetadataAddS32(arguments, PS_LIST_TAIL, "-rows", 0, "Rows to read at once", 0);
    150153    psMetadataAddBool(arguments, PS_LIST_TAIL, "-photometry", 0, "Do photometry on stacked image?", false);
    151     psMetadataAddS32(arguments, PS_LIST_TAIL, "-psf-instances", 0, "Number of instances for PSF generation", 0);
     154    psMetadataAddS32(arguments, PS_LIST_TAIL, "-psf-instances", 0,
     155                     "Number of instances for PSF generation", 0);
    152156    psMetadataAddF32(arguments, PS_LIST_TAIL, "-psf-radius", 0, "Radius for PSF generation", NAN);
    153     psMetadataAddStr(arguments, PS_LIST_TAIL, "-psf-model", 0, "Model name for PSF generation", "PS_MODEL_RGAUSS");
     157    psMetadataAddStr(arguments, PS_LIST_TAIL, "-psf-model", 0, "Model name for PSF generation", NULL);
    154158    psMetadataAddS32(arguments, PS_LIST_TAIL, "-psf-order", 0, "Spatial order for PSF generation", 0);
    155159    psMetadataAddBool(arguments, PS_LIST_TAIL, "-variance", 0, "Use variance for rejection?", false);
    156     psMetadataAddBool(arguments, PS_LIST_TAIL, "-safe", 0, "Play safe with small numbers of pixels to combine?", false);
     160    psMetadataAddBool(arguments, PS_LIST_TAIL, "-safe", 0,
     161                      "Play safe with small numbers of pixels to combine?", false);
    157162    psMetadataAddF32(arguments, PS_LIST_TAIL, "-source-radius", 0, "Source exclusion radius", NAN);
    158163    psMetadataAddS32(arguments, PS_LIST_TAIL, "-source-iter", 0, "Source clipping iterations", 0);
     
    160165    psMetadataAddS32(arguments, PS_LIST_TAIL, "-source-min", 0, "Source minimum overlap", 0);
    161166    psMetadataAddBool(arguments, PS_LIST_TAIL, "-renorm", 0, "Renormalise variance maps?", false);
    162     psMetadataAddStr(arguments, PS_LIST_TAIL, "-renorm-mean", 0, "Statistic for mean in renormalisation", NULL);
    163     psMetadataAddStr(arguments, PS_LIST_TAIL, "-renorm-stdev", 0, "Statistic for stdev in renormalisation", NULL);
     167    psMetadataAddStr(arguments, PS_LIST_TAIL, "-renorm-mean", 0,
     168                     "Statistic for mean in renormalisation", NULL);
     169    psMetadataAddStr(arguments, PS_LIST_TAIL, "-renorm-stdev", 0,
     170                     "Statistic for stdev in renormalisation", NULL);
    164171    psMetadataAddS32(arguments, PS_LIST_TAIL, "-renorm-width", 0, "Width of renormalisation boxes", 0);
    165172    psMetadataAddStr(arguments, PS_LIST_TAIL, "-temp-image", 0, "Suffix for temporary images", NULL);
    166173    psMetadataAddStr(arguments, PS_LIST_TAIL, "-temp-mask", 0, "Suffix for temporary masks", NULL);
    167174    psMetadataAddStr(arguments, PS_LIST_TAIL, "-temp-weight", 0, "Suffix for temporary weight maps", NULL);
    168     psMetadataAddBool(arguments, PS_LIST_TAIL, "-temp-delete", 0, "Delete temporary files on completion?", false);
     175    psMetadataAddBool(arguments, PS_LIST_TAIL, "-temp-delete", 0,
     176                      "Delete temporary files on completion?", false);
    169177
    170178    if (argc == 1 || !psArgumentParse(arguments, &argc, argv) || argc != 3) {
     
    173181
    174182    const char *stampsName = psMetadataLookupStr(NULL, arguments, "-stamps"); // Name of stamps file
    175     psMetadataAddStr(config->arguments, PS_LIST_TAIL, "STAMPS", 0, "Stamps file", stampsName);
    176     // if (!stampsName && !psMetadataLookupPtr(&mdok, config->arguments, "PPSTACK.SOURCES")) {
    177     // psError(PS_ERR_BAD_PARAMETER_VALUE, true, "One of -sources or -stamps must be specified.");
    178     //goto ERROR;
    179     // }
     183    psMetadataAddStr(arguments, PS_LIST_TAIL, "STAMPS", 0, "Stamps file", stampsName);
    180184
    181185    unsigned int numBad = 0;                     // Number of bad lines
     
    185189        return false;
    186190    }
    187     psMetadataAddMetadata(config->arguments, PS_LIST_TAIL, "INPUTS", 0,
    188                           "Metadata with input details", inputs);
     191    psMetadataAddMetadata(arguments, PS_LIST_TAIL, "INPUTS", 0, "Metadata with input details", inputs);
    189192    psFree(inputs);
    190     psMetadataAddStr(config->arguments, PS_LIST_TAIL, "OUTPUT", 0,
    191                      "Root name of the output image list", argv[2]);
    192 
    193     valueArgStr(arguments, "-stats", "STATS", config->arguments);
    194 
    195     if (psMetadataLookupBool(NULL, arguments, "-photometry")) {
    196         psMetadataAddBool(config->arguments, PS_LIST_TAIL, "PHOTOMETRY", PS_META_REPLACE,
    197                           "Do photometry on stacked image?", true);
    198     }
     193    psMetadataAddStr(arguments, PS_LIST_TAIL, "OUTPUT", 0, "Root name of the output image list", argv[2]);
     194
     195    valueArgStr(arguments, "-stats", "STATS", arguments);
     196
     197    psMetadataAddBool(arguments, PS_LIST_TAIL, "PHOTOMETRY", PS_META_REPLACE,
     198                      "Do photometry on stacked image?",
     199                      psMetadataLookupBool(NULL, arguments, "-photometry"));
    199200
    200201    return true;
     
    207208    psMetadata *arguments = config->arguments; // Command-line arguments
    208209
    209     psMetadata *recipe = psMetadataLookupMetadata(NULL, config->recipes, PPSTACK_RECIPE); // Recipe for ppSim
     210    psMetadata *recipe = psMetadataLookupMetadata(NULL, config->recipes, PPSTACK_RECIPE); // Recipe
    210211    if (!recipe) {
    211212        psError(PS_ERR_UNEXPECTED_NULL, false, "Unable to find recipe %s", PPSTACK_RECIPE);
     
    229230    VALUE_ARG_RECIPE_FLOAT("-psf-radius",  "PSF.RADIUS",    F32);
    230231    VALUE_ARG_RECIPE_INT("-psf-order",     "PSF.ORDER",     S32, 0);
    231     valueArgStr(arguments, "-psf-model", "PSF.MODEL", config->arguments);
     232    valueArgRecipeStr(arguments, recipe, "-psf-model", "PSF.MODEL", recipe);
    232233
    233234    if (psMetadataLookupBool(NULL, arguments, "-photometry") ||
    234235        psMetadataLookupBool(NULL, recipe, "PHOTOMETRY")) {
    235         psMetadataAddBool(config->arguments, PS_LIST_TAIL, "PHOTOMETRY", PS_META_REPLACE,
     236        psMetadataAddBool(arguments, PS_LIST_TAIL, "PHOTOMETRY", PS_META_REPLACE,
    236237                          "Do photometry on stacked image?", true);
    237238    }
     
    239240    if (psMetadataLookupBool(NULL, arguments, "-variance") ||
    240241        psMetadataLookupBool(NULL, recipe, "VARIANCE")) {
    241         psMetadataAddBool(config->arguments, PS_LIST_TAIL, "VARIANCE", 0,
    242                           "Use variance for rejection?", true);
     242        psMetadataAddBool(arguments, PS_LIST_TAIL, "VARIANCE", 0, "Use variance for rejection?", true);
    243243    }
    244244
    245245    if (psMetadataLookupBool(NULL, arguments, "-safe") ||
    246246        psMetadataLookupBool(NULL, recipe, "SAFE")) {
    247         psMetadataAddBool(config->arguments, PS_LIST_TAIL, "SAFE", 0,
     247        psMetadataAddBool(arguments, PS_LIST_TAIL, "SAFE", 0,
    248248                          "Play safe with small number of pixels to combine?", true);
    249249    }
     
    251251    if (psMetadataLookupBool(NULL, arguments, "-renorm") ||
    252252        psMetadataLookupBool(NULL, recipe, "RENORM")) {
    253         psMetadataAddBool(config->arguments, PS_LIST_TAIL, "RENORM", 0, "Renormalise variance maps?", true);
     253        psMetadataAddBool(arguments, PS_LIST_TAIL, "RENORM", 0, "Renormalise variance maps?", true);
    254254    }
    255255    VALUE_ARG_RECIPE_INT("-renorm-width", "RENORM.WIDTH", S32, 0);
     
    257257    VALUE_ARG_RECIPE_STAT("-renorm-stdev", "RENORM.STDEV");
    258258
    259     valueArgRecipeStr(arguments, recipe, "-temp-image",  "TEMP.IMAGE",  config->arguments);
    260     valueArgRecipeStr(arguments, recipe, "-temp-mask",   "TEMP.MASK",   config->arguments);
    261     valueArgRecipeStr(arguments, recipe, "-temp-weight", "TEMP.WEIGHT", config->arguments);
     259    valueArgRecipeStr(arguments, recipe, "-temp-image",  "TEMP.IMAGE",  recipe);
     260    valueArgRecipeStr(arguments, recipe, "-temp-mask",   "TEMP.MASK",   recipe);
     261    valueArgRecipeStr(arguments, recipe, "-temp-weight", "TEMP.WEIGHT", recipe);
    262262
    263263    if (psMetadataLookupBool(NULL, arguments, "-temp-delete") ||
    264264        psMetadataLookupBool(NULL, recipe, "TEMP.DELETE")) {
    265         psMetadataAddBool(config->arguments, PS_LIST_TAIL, "TEMP.DELETE", 0,
     265        psMetadataAddBool(arguments, PS_LIST_TAIL, "TEMP.DELETE", 0,
    266266                          "Delete temporary files on completion?", true);
    267267    }
    268268
    269     psTrace("ppStack", 1, "Done reading command-line arguments\n");
     269    psTrace("ppStack", 1, "Done parsing arguments\n");
     270
     271    // Dump configuration, now that's it's settled
     272    {
     273        pmConfigCamerasCull(config);
     274        pmConfigRecipesCull(config, "PPSTACK,PPSUB,PPSTATS,PSPHOT,MASKS");
     275
     276        const char *outroot = psMetadataLookupStr(NULL, arguments, "OUTPUT"); // Output root name
     277        psAssert(outroot, "Should be there, we put it there!");
     278
     279        pmFPAfile *input = psMetadataLookupPtr(NULL, config->files, "PPSTACK.INPUT"); // Input file
     280        pmConfigDump(config, input->fpa, outroot);
     281    }
     282
    270283    return true;
    271284
  • trunk/ppStack/src/ppStackLoop.c

    r18591 r18918  
    203203    assert(config);
    204204
     205    psMetadata *recipe = psMetadataLookupMetadata(NULL, config->recipes, PPSTACK_RECIPE); // ppStack recipe
     206    psAssert(recipe, "We've thrown an error on this before.");
     207
    205208    bool mdok;                          // Status of MD lookup
    206     bool tempDelete = psMetadataLookupBool(&mdok, config->arguments, "TEMP.DELETE"); // Delete temporary files?
    207     const char *tempImage = psMetadataLookupStr(NULL, config->arguments, "TEMP.IMAGE"); // Suffix for temporary images
    208     const char *tempMask = psMetadataLookupStr(NULL, config->arguments, "TEMP.MASK"); // Suffix for temporary masks
    209     const char *tempWeight = psMetadataLookupStr(NULL, config->arguments, "TEMP.WEIGHT"); // Suffix for temporary weight (variance) maps
     209    bool tempDelete = psMetadataLookupBool(&mdok, recipe, "TEMP.DELETE"); // Delete temporary files?
     210    const char *tempImage = psMetadataLookupStr(NULL, recipe, "TEMP.IMAGE"); // Suffix for temporary images
     211    const char *tempMask = psMetadataLookupStr(NULL, recipe, "TEMP.MASK"); // Suffix for temporary masks
     212    const char *tempWeight = psMetadataLookupStr(NULL, recipe, "TEMP.WEIGHT"); // Suffix for temp weight maps
    210213    if (!tempImage || !tempMask || !tempWeight) {
    211         psError(PS_ERR_BAD_PARAMETER_VALUE, true, "Unable to find TEMP.IMAGE, TEMP.MASK and TEMP.WEIGHT");
    212         return false;
    213     }
    214 
    215     float threshold = psMetadataLookupF32(NULL, config->arguments, "THRESHOLD.MASK"); // Threshold for mask deconvolution
    216     float imageRej = psMetadataLookupF32(NULL, config->arguments, "IMAGE.REJ"); // Maximum fraction of image to reject before rejecting entire image
     214        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
     215                "Unable to find TEMP.IMAGE, TEMP.MASK and TEMP.WEIGHT in recipe");
     216        return false;
     217    }
     218
     219    float threshold = psMetadataLookupF32(NULL, recipe, "THRESHOLD.MASK"); // Threshold for mask deconvolution
     220    float imageRej = psMetadataLookupF32(NULL, recipe, "IMAGE.REJ"); // Maximum fraction of image to reject
     221                                                                     // before rejecting entire image
    217222
    218223    const char *statsName = psMetadataLookupStr(&mdok, config->arguments, "STATS"); // Filename for statistics
     
    238243    }
    239244    int num = psMetadataLookupS32(NULL, config->arguments, "INPUTS.NUM"); // Number of inputs
    240     int numScans = psMetadataLookupS32(NULL, config->arguments, "ROWS"); // Number of scans to read at once
     245    int numScans = psMetadataLookupS32(NULL, recipe, "ROWS"); // Number of scans to read at once
     246
    241247    psMetadata *ppsub = psMetadataLookupMetadata(NULL, config->recipes, "PPSUB"); // PPSUB recipe
    242     int overlap = 2 * psMetadataLookupS32(NULL, ppsub, "KERNEL.SIZE"); // Overlap by kernel size between consecutive scans
     248    int overlap = 2 * psMetadataLookupS32(NULL, ppsub,
     249                                          "KERNEL.SIZE"); // Overlap by kernel size between consecutive scans
    243250
    244251    if (!pmConfigMaskSetBits(NULL, NULL, config)) {
     
    770777        memDump("final");
    771778
    772         if (psMetadataLookupBool(&mdok, config->arguments, "PHOTOMETRY")) {
     779        if (psMetadataLookupBool(&mdok, recipe, "PHOTOMETRY")) {
    773780
    774781            fileActivation(config, combineFiles, false);
  • trunk/ppStack/src/ppStackMatch.c

    r18591 r18918  
    2727    pmReadout *output = pmReadoutAlloc(NULL); // Output readout, for holding results temporarily
    2828
     29    psMetadata *recipe = psMetadataLookupMetadata(NULL, config->recipes, PPSTACK_RECIPE); // ppStack recipe
     30    psAssert(recipe, "We've thrown an error on this before.");
     31
    2932    // Look up appropriate values from the ppSub recipe
    30     psMetadata *recipe = psMetadataLookupMetadata(NULL, config->recipes, "PPSUB"); // PPSUB recipe
    31     int size = psMetadataLookupS32(NULL, recipe, "KERNEL.SIZE"); // Kernel half-size
     33    psMetadata *ppsub = psMetadataLookupMetadata(NULL, config->recipes, "PPSUB"); // PPSUB recipe
     34    int size = psMetadataLookupS32(NULL, ppsub, "KERNEL.SIZE"); // Kernel half-size
    3235
    3336    psMaskType maskIn = pmConfigMaskGet("MASK.VALUE", config); // Bits to mask going in to pmSubtractionMatch
     
    3538
    3639    bool mdok;                          // Status of MD lookup
    37     bool renorm = psMetadataLookupBool(&mdok, config->arguments, "RENORM"); // Renormalise variances?
    38     psStatsOptions renormMean = psMetadataLookupS32(&mdok, config->arguments,
    39                                                     "RENORM.MEAN"); // Statistic for mean
    40     psStatsOptions renormStdev = psMetadataLookupS32(&mdok, config->arguments,
    41                                                      "RENORM.STDEV"); // Statistic for stdev
    42     int renormWidth = psMetadataLookupS32(&mdok, config->arguments,
    43                                           "RENORM.WIDTH"); // Width for renormalisation box
    44     float penalty = psMetadataLookupF32(NULL, config->arguments, "PENALTY"); // Penalty for wideness
     40    bool renorm = psMetadataLookupBool(&mdok, recipe, "RENORM"); // Renormalise variances?
     41    psStatsOptions renormMean = psMetadataLookupS32(&mdok, recipe, "RENORM.MEAN"); // Statistic for mean
     42    psStatsOptions renormStdev = psMetadataLookupS32(&mdok, recipe, "RENORM.STDEV"); // Statistic for stdev
     43    int renormWidth = psMetadataLookupS32(&mdok, recipe, "RENORM.WIDTH"); // Width for renormalisation box
     44    float penalty = psMetadataLookupF32(NULL, ppsub, "PENALTY"); // Penalty for wideness
    4545
    4646    if (!pmReadoutMaskNonfinite(readout, maskIn)) {
     
    5353        assert(sources);
    5454
    55         int order = psMetadataLookupS32(NULL, recipe, "SPATIAL.ORDER"); // Spatial polynomial order
    56         float regionSize = psMetadataLookupF32(NULL, recipe, "REGION.SIZE"); // Size of iso-kernel regs
    57         float spacing = psMetadataLookupF32(NULL, recipe, "STAMP.SPACING"); // Typical stamp spacing
    58         int footprint = psMetadataLookupS32(NULL, recipe, "STAMP.FOOTPRINT"); // Stamp half-size
    59         float threshold = psMetadataLookupF32(NULL, recipe, "STAMP.THRESHOLD"); // Threshold for stmps
    60         int iter = psMetadataLookupS32(NULL, recipe, "ITER"); // Rejection iterations
    61         float rej = psMetadataLookupF32(NULL, recipe, "REJ"); // Rejection threshold
     55        int order = psMetadataLookupS32(NULL, ppsub, "SPATIAL.ORDER"); // Spatial polynomial order
     56        float regionSize = psMetadataLookupF32(NULL, ppsub, "REGION.SIZE"); // Size of iso-kernel regs
     57        float spacing = psMetadataLookupF32(NULL, ppsub, "STAMP.SPACING"); // Typical stamp spacing
     58        int footprint = psMetadataLookupS32(NULL, ppsub, "STAMP.FOOTPRINT"); // Stamp half-size
     59        float threshold = psMetadataLookupF32(NULL, ppsub, "STAMP.THRESHOLD"); // Threshold for stmps
     60        int iter = psMetadataLookupS32(NULL, ppsub, "ITER"); // Rejection iterations
     61        float rej = psMetadataLookupF32(NULL, ppsub, "REJ"); // Rejection threshold
    6262        pmSubtractionKernelsType type = pmSubtractionKernelsTypeFromString(
    63             psMetadataLookupStr(NULL, recipe, "KERNEL.TYPE")); // Kernel type
    64         psVector *widths = psMetadataLookupPtr(NULL, recipe, "ISIS.WIDTHS"); // ISIS Gaussian widths
    65         psVector *orders = psMetadataLookupPtr(NULL, recipe, "ISIS.ORDERS"); // ISIS Polynomial orders
    66         int inner = psMetadataLookupS32(NULL, recipe, "INNER"); // Inner radius
    67         int ringsOrder = psMetadataLookupS32(NULL, recipe, "RINGS.ORDER"); // RINGS polynomial order
    68         int binning = psMetadataLookupS32(NULL, recipe, "SPAM.BINNING"); // Binning for SPAM kernel
    69         float badFrac = psMetadataLookupF32(NULL, recipe, "BADFRAC"); // Maximum bad fraction
    70         bool optimum = psMetadataLookupBool(&mdok, recipe, "OPTIMUM"); // Derive optimum parameters?
    71         float optMin = psMetadataLookupF32(&mdok, recipe, "OPTIMUM.MIN"); // Minimum width for search
    72         float optMax = psMetadataLookupF32(&mdok, recipe, "OPTIMUM.MAX"); // Maximum width for search
    73         float optStep = psMetadataLookupF32(&mdok, recipe, "OPTIMUM.STEP"); // Step for search
    74         float optThresh = psMetadataLookupF32(&mdok, recipe, "OPTIMUM.TOL"); // Tolerance for search
    75         int optOrder = psMetadataLookupS32(&mdok, recipe, "OPTIMUM.ORDER"); // Order for search
     63            psMetadataLookupStr(NULL, ppsub, "KERNEL.TYPE")); // Kernel type
     64        psVector *widths = psMetadataLookupPtr(NULL, ppsub, "ISIS.WIDTHS"); // ISIS Gaussian widths
     65        psVector *orders = psMetadataLookupPtr(NULL, ppsub, "ISIS.ORDERS"); // ISIS Polynomial orders
     66        int inner = psMetadataLookupS32(NULL, ppsub, "INNER"); // Inner radius
     67        int ringsOrder = psMetadataLookupS32(NULL, ppsub, "RINGS.ORDER"); // RINGS polynomial order
     68        int binning = psMetadataLookupS32(NULL, ppsub, "SPAM.BINNING"); // Binning for SPAM kernel
     69        float badFrac = psMetadataLookupF32(NULL, ppsub, "BADFRAC"); // Maximum bad fraction
     70        bool optimum = psMetadataLookupBool(&mdok, ppsub, "OPTIMUM"); // Derive optimum parameters?
     71        float optMin = psMetadataLookupF32(&mdok, ppsub, "OPTIMUM.MIN"); // Minimum width for search
     72        float optMax = psMetadataLookupF32(&mdok, ppsub, "OPTIMUM.MAX"); // Maximum width for search
     73        float optStep = psMetadataLookupF32(&mdok, ppsub, "OPTIMUM.STEP"); // Step for search
     74        float optThresh = psMetadataLookupF32(&mdok, ppsub, "OPTIMUM.TOL"); // Tolerance for search
     75        int optOrder = psMetadataLookupS32(&mdok, ppsub, "OPTIMUM.ORDER"); // Order for search
    7676
    7777        // These values are specified specifically for stacking
  • trunk/ppStack/src/ppStackPSF.c

    r16991 r18918  
    1212{
    1313    // Get the recipe values
    14     int psfInstances = psMetadataLookupS32(NULL, config->arguments, "PSF.INSTANCES"); // Number of instances for PSF
    15     float psfRadius = psMetadataLookupF32(NULL, config->arguments, "PSF.RADIUS"); // Radius for PSF
    16     const char *psfModel = psMetadataLookupStr(NULL, config->arguments, "PSF.MODEL"); // Model for PSF
    17     int psfOrder = psMetadataLookupS32(NULL, config->arguments, "PSF.ORDER"); // Spatial order for PSF
     14    psMetadata *recipe = psMetadataLookupMetadata(NULL, config->recipes, PPSTACK_RECIPE); // ppStack recipe
     15    psAssert(recipe, "We've thrown an error on this before.");
     16
     17    int psfInstances = psMetadataLookupS32(NULL, recipe, "PSF.INSTANCES"); // Number of instances for PSF
     18    float psfRadius = psMetadataLookupF32(NULL, recipe, "PSF.RADIUS"); // Radius for PSF
     19    const char *psfModel = psMetadataLookupStr(NULL, recipe, "PSF.MODEL"); // Model for PSF
     20    int psfOrder = psMetadataLookupS32(NULL, recipe, "PSF.ORDER"); // Spatial order for PSF
    1821
    1922    // Solve for the target PSF
  • trunk/ppStack/src/ppStackReadout.c

    r18591 r18918  
    2727    static int sectionNum = 0;          // Section number; for debugging outputs
    2828
    29 
    3029    // Get the recipe values
     30    psMetadata *recipe = psMetadataLookupMetadata(NULL, config->recipes, PPSTACK_RECIPE); // ppStack recipe
     31    psAssert(recipe, "We've thrown an error on this before.");
     32
    3133    bool mdok;                          // Status of MD lookup
    32     int iter = psMetadataLookupS32(NULL, config->arguments, "ITER"); // Rejection iterations
    33     float combineRej = psMetadataLookupF32(NULL, config->arguments, "COMBINE.REJ"); // Combination threshold
     34    int iter = psMetadataLookupS32(NULL, recipe, "ITER"); // Rejection iterations
     35    float combineRej = psMetadataLookupF32(NULL, recipe, "COMBINE.REJ"); // Combination threshold
    3436    psMaskType maskVal = pmConfigMaskGet("BLANK", config); // Value to mask
    35     bool useVariance = psMetadataLookupBool(&mdok, config->arguments, "VARIANCE"); // Use variance for rejection?
    36     bool safe = psMetadataLookupBool(&mdok, config->arguments, "SAFE"); // Play safe when combining small numbers of pixels?
     37    bool useVariance = psMetadataLookupBool(&mdok, recipe, "VARIANCE"); // Use variance for rejection?
     38    bool safe = psMetadataLookupBool(&mdok, recipe, "SAFE"); // Be safe when combining small numbers of pixels
     39
    3740    psMetadata *ppsub = psMetadataLookupMetadata(NULL, config->recipes, "PPSUB"); // PPSUB recipe
    3841    int kernelSize = psMetadataLookupS32(NULL, ppsub, "KERNEL.SIZE"); // Kernel half-size
    39 
    4042
    4143    int num = readouts->n;              // Number of inputs
     
    137139
    138140    // Get the recipe values
     141    psMetadata *recipe = psMetadataLookupMetadata(NULL, config->recipes, PPSTACK_RECIPE); // ppStack recipe
     142    psAssert(recipe, "We've thrown an error on this before.");
     143
    139144    bool mdok;                          // Status of MD lookup
    140145    psMaskType maskVal = pmConfigMaskGet("BLANK", config); // Value to mask
    141     bool useVariance = psMetadataLookupBool(&mdok, config->arguments, "VARIANCE"); // Use variance for rejection?
     146    bool useVariance = psMetadataLookupBool(&mdok, recipe, "VARIANCE"); // Use variance for rejection?
    142147
    143148    int num = readouts->n;              // Number of inputs
  • trunk/ppStack/src/ppStackSources.c

    r18490 r18918  
    330330
    331331    // Read recipe values
    332     float radius = psMetadataLookupF32(NULL, config->arguments, "SOURCE.RADIUS"); // Exclusion radius
    333     int minOverlap = psMetadataLookupS32(NULL, config->arguments, "SOURCE.MIN"); // Minimum number
    334     int iter = psMetadataLookupS32(NULL, config->arguments, "SOURCE.ITER"); // Clipping iterations
    335     float rej = psMetadataLookupF32(NULL, config->arguments, "SOURCE.REJ"); // Clipping rejection
     332    psMetadata *recipe = psMetadataLookupMetadata(NULL, config->recipes, PPSTACK_RECIPE); // ppStack recipe
     333    psAssert(recipe, "We've thrown an error on this before.");
     334    float radius = psMetadataLookupF32(NULL, recipe, "SOURCE.RADIUS"); // Exclusion radius
     335    int minOverlap = psMetadataLookupS32(NULL, recipe, "SOURCE.MIN"); // Minimum number
     336    int iter = psMetadataLookupS32(NULL, recipe, "SOURCE.ITER"); // Clipping iterations
     337    float rej = psMetadataLookupF32(NULL, recipe, "SOURCE.REJ"); // Clipping rejection
    336338
    337339    // Look for overlaps with existing lists
     
    370372    PS_ASSERT_PTR_NON_NULL(config, NULL);
    371373
    372     float radius = psMetadataLookupF32(NULL, config->arguments, "SOURCE.RADIUS"); // Exclusion radius
     374    psMetadata *recipe = psMetadataLookupMetadata(NULL, config->recipes, PPSTACK_RECIPE); // ppStack recipe
     375    psAssert(recipe, "We've thrown an error on this before.");
     376    float radius = psMetadataLookupF32(NULL, recipe, "SOURCE.RADIUS"); // Exclusion radius
    373377
    374378    int numLists = 0;                   // Number of lists
Note: See TracChangeset for help on using the changeset viewer.