IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 6, 2009, 4:24:20 PM (17 years ago)
Author:
bills
Message:

when destreaking warp and diff skyfiles, censor any sources whose coordinates are masked

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/magic/remove/src/streaksio.c

    r24556 r24691  
    2020    memset(sf, 0, sizeof(*sf));
    2121
     22    sf->config = config;
     23    sf->program_name = basename(program_name);
     24
    2225    if (remove) {
    2326        // remember pointer so that streaksExit can delete temps
     
    2528    }
    2629
    27     sf->config = config;
    28     sf->program_name = basename(program_name);
    2930
    3031    // error checking is done by sFileOpen. If a file can't be opened we just exit
     
    8081        } else {
    8182            sf->recWeight = sFileOpen(config, stage, "RECOVERY.WEIGHT", NULL, true);
     83        }
     84    }
     85    if (remove) {
     86        sf->inSources = sFileOpen(config, stage, "SOURCES", NULL, false);
     87        if (sf->inSources) {
     88            inputBasename = basename(sf->inSources->name);
     89            sf->outSources = sFileOpen(config, stage, "OUTPUT", inputBasename, true);
    8290        }
    8391    }
     
    607615        streaksExit("", PS_EXIT_DATA_ERROR);
    608616    }
    609 
     617 
    610618    bool status;
    611619    in->extname = psMetadataLookupStr(&status, in->header, "EXTNAME");
     
    929937        if (!replicate(sfiles->outWeight, sfiles->inWeight)) {
    930938            psError(PM_ERR_SYS, false, "failed to replicate outImage.");
     939            return false;
     940        }
     941    }
     942
     943    if (sfiles->outSources) {
     944        if (!replicate(sfiles->outSources, sfiles->inSources)) {
     945            psError(PM_ERR_SYS, false, "failed to replicate outSources.");
    931946            return false;
    932947        }
     
    9971012    }
    9981013
     1014    if (sfiles->outSources) {
     1015        if (!swapOutputToInput(sfiles->inSources, sfiles->outSources)) {
     1016            psError(PM_ERR_SYS, false, "failed to swap instances for sources.");
     1017            return false;
     1018        }
     1019    }
     1020
    9991021    if (!swapOutputToInput(sfiles->inImage, sfiles->outImage)) {
    10001022        psError(PM_ERR_SYS, false, "failed to swap instances for Image.");
    10011023        return false;
    10021024    }
     1025
    10031026
    10041027    return true;
     
    10421065    if (sfiles->outImage) {
    10431066        deleteFile(sfiles->outImage);
     1067    }
     1068
     1069    if (sfiles->outSources) {
     1070        deleteFile(sfiles->outSources);
    10441071    }
    10451072
Note: See TracChangeset for help on using the changeset viewer.