IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 16704


Ignore:
Timestamp:
Feb 27, 2008, 5:38:21 PM (18 years ago)
Author:
Paul Price
Message:

Adding recipe options to choose the suffix for temporary files.

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippconfig/recipes/ppStack.config

    r16683 r16704  
    33ITER            S32     1               # Number of rejection iterations
    44COMBINE.REJ     F32     2.0             # Rejection threshold in combination (sigma)
    5 CONVOLVE.REJ    F32     10.0            # Rejection threshold in convolution (sigma)
     5CONVOLVE.REJ    F32     5.0             # Rejection threshold in convolution (sigma)
    66EXTENT          F32     3.0             # Extent of Gaussian convolution (sigma)
    77MASK.BAD        STR     BLANK,SAT,BAD   # Mask value of bad pixels
     
    1616PSF.ORDER       S32     3               # Order of spatial variation for PSF generation
    1717PSF.MODEL       STR     PS_MODEL_RGAUSS # Model for PSF generation
     18
     19TEMP.IMAGE      STR     conv.im.fits    # Suffix for convolved images
     20TEMP.MASK       STR     conv.mk.fits    # Suffix for convolved masks
     21TEMP.IMAGE      STR     conv.wt.fits    # Suffix for convolved weight maps
     22TEMP.DELETE     BOOL    TRUE            # Delete temporary files on completion?
  • trunk/ppStack/src/ppStackArguments.c

    r16622 r16704  
    124124    psMetadataAddBool(arguments, PS_LIST_TAIL, "-variance", 0, "Use variance for rejection?", false);
    125125    psMetadataAddBool(arguments, PS_LIST_TAIL, "-safe", 0, "Play safe with small numbers of pixels to combine?", false);
     126    psMetadataAddStr(arguments, PS_LIST_TAIL, "-temp-image", 0, "Suffix for temporary images", NULL);
     127    psMetadataAddStr(arguments, PS_LIST_TAIL, "-temp-mask", 0, "Suffix for temporary masks", NULL);
     128    psMetadataAddStr(arguments, PS_LIST_TAIL, "-temp-weight", 0, "Suffix for temporary weight maps", NULL);
     129    psMetadataAddBool(arguments, PS_LIST_TAIL, "-temp-delete", 0, "Delete temporary files on completion?", false);
    126130
    127131    if (argc == 1 || !psArgumentParse(arguments, &argc, argv) || argc != 3) {
     
    188192    }
    189193
     194    valueArgStr(config, arguments, "-temp-image",  "TEMP.IMAGE",  config->arguments);
     195    valueArgStr(config, arguments, "-temp-mask",   "TEMP.MASK",   config->arguments);
     196    valueArgStr(config, arguments, "-temp-weight", "TEMP.WEIGHT", config->arguments);
     197
     198    if (psMetadataLookupBool(NULL, arguments, "-temp-delete") ||
     199        psMetadataLookupBool(NULL, recipe, "TEMP.DELETE")) {
     200        psMetadataAddBool(config->arguments, PS_LIST_TAIL, "TEMP.DELETE", 0,
     201                          "Delete temporary files on completion?", true);
     202    }
     203
     204
    190205    psTrace("ppStack", 1, "Done reading command-line arguments\n");
    191206    psFree(arguments);
  • trunk/ppStack/src/ppStackLoop.c

    r16693 r16704  
    44
    55#include <stdio.h>
     6#include <unistd.h>
    67#include <string.h>
    78#include <pslib.h>
     
    1112#include "ppStack.h"
    1213
    13 #define TESTING
     14//#define TESTING
    1415
    1516// Here follows lists of files for activation/deactivation at various stages.  Each must be NULL-terminated.
     
    185186    assert(config);
    186187
     188    bool mdok;                          // Status of MD lookup
    187189    psMaskType maskBlank = psMetadataLookupU8(NULL, config->arguments, "MASK.BLANK"); // Mask for blank reg.
    188 
    189     bool mdok;                          // Status of MD lookup
     190    bool tempDelete = psMetadataLookupBool(&mdok, config->arguments, "TEMP.DELETE"); // Delete temporary files?
     191    const char *tempImage = psMetadataLookupStr(NULL, config->arguments, "TEMP.IMAGE"); // Suffix for temporary images
     192    const char *tempMask = psMetadataLookupStr(NULL, config->arguments, "TEMP.MASK"); // Suffix for temporary masks
     193    const char *tempWeight = psMetadataLookupStr(NULL, config->arguments, "TEMP.WEIGHT"); // Suffix for temporary weight (variance) maps
     194    if (!tempImage || !tempMask || !tempWeight) {
     195        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "Unable to find TEMP.IMAGE, TEMP.MASK and TEMP.WEIGHT");
     196        return false;
     197    }
     198
    190199    const char *statsName = psMetadataLookupStr(&mdok, config->arguments, "STATS"); // Filename for statistics
    191200    psMetadata *stats = NULL;           // Container for statistics
     
    286295    }
    287296
    288     const char *suffix = "conv.fits";   // Suffix for convolved images; ultimately this will be from recipe
    289297    const char *outName = psMetadataLookupStr(NULL, config->arguments, "OUTPUT"); // Output root
    290298    assert(outName);
     
    294302    for (int i = 0; i < num; i++) {
    295303        psString imageName = NULL, maskName = NULL, weightName = NULL; // Names for convolved images
    296         psStringAppend(&imageName, "%s.im-%d.%s", outName, i, suffix);
    297         psStringAppend(&maskName, "%s.mk-%d.%s", outName, i, suffix);
    298         psStringAppend(&weightName, "%s.wt-%d.%s", outName, i, suffix);
     304        psStringAppend(&imageName, "%s.%d.%s", outName, i, tempImage);
     305        psStringAppend(&maskName, "%s.%d.%s", outName, i, tempMask);
     306        psStringAppend(&weightName, "%s.%d.%s", outName, i, tempWeight);
    299307        imageNames->data[i] = imageName;
    300308        maskNames->data[i] = maskName;
     
    508516            psFitsClose(maskFits->data[i]);
    509517            psFitsClose(weightFits->data[i]);
     518            if (tempDelete && (unlink(imageNames->data[i]) || unlink(maskNames->data[i]) ||
     519                               unlink(weightNames->data[i]))) {
     520                psWarning("Unable to delete temporary files for image %d", i);
     521            }
    510522        }
    511523
  • trunk/ppStack/src/ppStackReadout.c

    r16693 r16704  
    1212#define WCS_TOLERANCE 0.001             // Tolerance for WCS
    1313
    14 #define REJECTION_FILES                 // Write rejection mask?
    15 #define INSPECTION_FILES                // Write inspection mask?
    16 #define COMBINED_FILES                  // Write combined images?
    17 
     14//#define REJECTION_FILES                 // Write rejection mask?
     15//#define INSPECTION_FILES                // Write inspection mask?
     16//#define COMBINED_FILES                  // Write combined images?
    1817
    1918
Note: See TracChangeset for help on using the changeset viewer.