IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 3667 for trunk/stac/src/stac.c


Ignore:
Timestamp:
Apr 5, 2005, 12:13:28 PM (21 years ago)
Author:
Paul Price
Message:

Cleaning up stac.c to work with TESTING. shiftSize now working. Added stacWriteMaps.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/stac/src/stac.c

    r3666 r3667  
    7171        sprintf(errName,"%s.err",config->inputs->data[i]);
    7272        psFits *errorFile = psFitsAlloc(errName);
    73         if (!psFitsWriteImage(errorFile, NULL, error, 0, NULL)) {
     73        if (!psFitsWriteImage(errorFile, NULL, errors->data[i], 0, NULL)) {
    7474            psErrorStackPrint(stderr, "Unable to write image: %s\n", errName);
    7575        }
     
    9191        char shiftName[MAXCHAR];        // Filename of shift image
    9292        char errName[MAXCHAR];          // Filename of error image
    93         sprintf(shiftName,"%s.shift1",config->inputs->data[n],numTransforms);
    94         sprintf(errName,"%s.shifterr1",config->inputs->data[n],numTransforms);
    95         psTrace("stac.transform.test", 6,
    96                 "Output files have size: %dx%d\n",outImage->numCols,outImage->numRows);
     93        sprintf(shiftName,"%s.shift1",config->inputs->data[i]);
     94        sprintf(errName,"%s.shifterr1",config->inputs->data[i]);
    9795        psFits *shiftFile = psFitsAlloc(shiftName);
    9896        psFits *errFile = psFitsAlloc(errName);
    99         if (!psFitsWriteImage(shiftFile, NULL, outImage, 0, NULL)) {
     97        psImage *trans = transformed->data[i]; // Transformed image
     98        psImage *transErr = transformedErrors->data[i]; // Transformed error image
     99        if (!psFitsWriteImage(shiftFile, NULL, trans, 0, NULL)) {
    100100            psErrorStackPrint(stderr, "Unable to write image: %s\n", shiftName);
    101101        }
    102102        psTrace("stac", 1, "Shifted image written to %s\n", shiftName);
    103         if (!psFitsWriteImage(errFile, NULL, outError, 0, NULL)) {
     103        if (!psFitsWriteImage(errFile, NULL, transErr, 0, NULL)) {
    104104            psErrorStackPrint(stderr, "Unable to write image: %s\n", errName);
    105105        }
     
    137137#ifdef TESTING
    138138    // Write rejection images out to check
    139     for (int i = 0; i < nImages; i++) {
     139    for (int i = 0; i < rejected->n; i++) {
    140140        char rejName[MAXCHAR];  // Filename of rejection image
    141         sprintf(rejName,"%s.shiftrej",config->inputs->data[i]);
     141        sprintf(rejName, "%s.shiftrej", config->inputs->data[i]);
    142142       
    143143        psFits *rejFile = psFitsAlloc(rejName);
    144         if (!psFitsWriteImage(rejFile, NULL, (*rejected)->data[i], 0, NULL)) {
     144        if (!psFitsWriteImage(rejFile, NULL, rejected->data[i], 0, NULL)) {
    145145            psErrorStackPrint(stderr, "Unable to write image: %s\n", rejName);
    146146        }
     
    151151    // Write out pre-combined image
    152152    char preName[MAXCHAR];              // Filename of precombined image
    153     sprintf(preName,"%s.pre",config->output);
     153    sprintf(preName, "%s.pre", config->output);
    154154    psFits *preFile = psFitsAlloc(preName);
    155155    if (!psFitsWriteImage(preFile, NULL, combined, 0, NULL)) {
Note: See TracChangeset for help on using the changeset viewer.