IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 19756


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

Get directory for temporary files from recipe, rather than from output
root. We don't want to be putting temporary files in Nebulous!

File:
1 edited

Legend:

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

    r19745 r19756  
    188188    bool mdok;                          // Status of MD lookup
    189189    bool tempDelete = psMetadataLookupBool(&mdok, recipe, "TEMP.DELETE"); // Delete temporary files?
     190    const char *tempDir = psMetadataLookupStr(NULL, recipe, "TEMP.DIR"); // Directory for temporary images
     191    if (!tempDir) {
     192        psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Unable to find TEMP.DIR in recipe");
     193        return false;
     194    }
     195    const char *tempName = psMetadataLookupStr(NULL, config->arguments, "OUTPUT"); // Name for temporary files
     196    tempName = basename(tempName);
     197    if (!tempName) {
     198        psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Unable to construct basename for temporary files.");
     199        return false;
     200    }
     201
    190202    const char *tempImage = psMetadataLookupStr(NULL, recipe, "TEMP.IMAGE"); // Suffix for temporary images
    191203    const char *tempMask = psMetadataLookupStr(NULL, recipe, "TEMP.MASK"); // Suffix for temporary masks
    192204    const char *tempWeight = psMetadataLookupStr(NULL, recipe, "TEMP.WEIGHT"); // Suffix for temp weight maps
    193205    if (!tempImage || !tempMask || !tempWeight) {
    194         psError(PS_ERR_BAD_PARAMETER_VALUE, true,
     206        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
    195207                "Unable to find TEMP.IMAGE, TEMP.MASK and TEMP.WEIGHT in recipe");
    196208        return false;
     
    368380    memDump("psf");
    369381
    370     const char *outName = psMetadataLookupStr(NULL, config->arguments, "OUTPUT"); // Output root
    371     assert(outName);
    372382    psArray *imageNames = psArrayAlloc(num);
    373383    psArray *maskNames = psArrayAlloc(num);
     
    375385    for (int i = 0; i < num; i++) {
    376386        psString imageName = NULL, maskName = NULL, weightName = NULL; // Names for convolved images
    377         psStringAppend(&imageName, "%s.%d.%s", outName, i, tempImage);
    378         psStringAppend(&maskName, "%s.%d.%s", outName, i, tempMask);
    379         psStringAppend(&weightName, "%s.%d.%s", outName, i, tempWeight);
     387        psStringAppend(&imageName, "%s/%s.%d.%s", tempDir, tempName, i, tempImage);
     388        psStringAppend(&maskName, "%s/%s.%d.%s", tempDir, tempName, i, tempMask);
     389        psStringAppend(&weightName, "%s/%s.%d.%s", tempDir, tempName, i, tempWeight);
     390        psTrace("ppStack", 5, "Temporary files: %s %s %s\n", imageName, maskName, weightName);
    380391        imageNames->data[i] = imageName;
    381392        maskNames->data[i] = maskName;
Note: See TracChangeset for help on using the changeset viewer.