IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 8405


Ignore:
Timestamp:
Aug 16, 2006, 4:18:39 PM (20 years ago)
Author:
Paul Price
Message:

Change to output statistics of combined image.

Location:
trunk/ppMerge
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppMerge/configure.ac

    r7874 r8405  
    3535PKG_CHECK_MODULES([PSLIB], [pslib >= 0.9.0])
    3636PKG_CHECK_MODULES([PSMODULE], [psmodule >= 0.0.0])
     37PKG_CHECK_MODULES([PPSTATS], [ppStats >= 0.0.0])
    3738
    3839dnl handle profiler building
  • trunk/ppMerge/src/Makefile.am

    r7874 r8405  
    11bin_PROGRAMS = ppMerge
    22
    3 ppMerge_CFLAGS += $(PSMODULE_CFLAGS) $(PSLIB_CFLAGS)
    4 ppMerge_LDFLAGS += $(PSMODULE_LIBS) $(PSLIB_LIBS) -Wl,-Bdynamic
     3ppMerge_CFLAGS += $(PPSTATS_CFLAGS) $(PSMODULE_CFLAGS) $(PSLIB_CFLAGS)
     4ppMerge_LDFLAGS += $(PPSTATS_LIBS) $(PSMODULE_LIBS) $(PSLIB_LIBS) -Wl,-Bdynamic
    55
    66ppMerge_SOURCES =               \
  • trunk/ppMerge/src/ppMerge.c

    r7751 r8405  
    22#include <pslib.h>
    33#include <psmodules.h>
     4#include <ppStats.h>
    45
    56#include "ppMerge.h"
     
    4950    ppMergeCombine(scale, zero, data, options, config);
    5051
     52    if (data->statsFile) {
     53        psMetadata *stats = ppStats(NULL, data->out, NULL, config); // Statistics for output FPA
     54        psString statsOut = psMetadataConfigFormat(stats); // String to write out
     55        fprintf(data->statsFile, "%s", statsOut);
     56        psFree(statsOut);
     57        psFree(stats);
     58    }
     59
    5160    pmFPAPrint(stdout, data->out, true, true);
    5261
  • trunk/ppMerge/src/ppMerge.h

    r7067 r8405  
    33
    44#define TIMERNAME "ppMerge"
    5 #define RECIPENAME "PPMERGE"
     5#define PPMERGE_RECIPE "PPMERGE"
    66
    77#endif
  • trunk/ppMerge/src/ppMergeCheckInputs.c

    r8069 r8405  
    2323        psErrorStackPrint(stderr, "Can't open output image: %s\n", outName);
    2424        exit(EXIT_FAILURE);
     25    }
     26
     27    // Statistics file
     28    psString statsName = psMetadataLookupStr(NULL, config->arguments, "-stats"); // Name for statistics file
     29    if (statsName && strlen(statsName) > 0) {
     30        data->statsFile = fopen(statsName, "w");
     31        if (!data->statsFile) {
     32            psLogMsg(__func__, PS_LOG_WARN, "Unable to open statistics file %s --- ignored.\n",
     33                     statsName);
     34        }
    2535    }
    2636
  • trunk/ppMerge/src/ppMergeCombine.c

    r8069 r8405  
    11#include <stdio.h>
     2#include <unistd.h>
    23#include <assert.h>
    34#include <pslib.h>
     
    1213    if (psTraceGetLevel(__func__) > 9) {
    1314        psMemBlock **leaks = NULL;
    14         int numLeaks = psMemCheckLeaks(0, &leaks, NULL, false);
     15        int numLeaks = psMemCheckLeaks(0, &leaks, NULL, true);
    1516        size_t largestSize = 0;
    1617        psMemId largest = 0;
     
    2728        psTrace(__func__, 0, "Memory in use: %zd\n", totalSize);
    2829        psTrace(__func__, 0, "Largest block: %ld\n", largest);
     30        psTrace(__func__, 0, "sbrk(): %zd\n", sbrk(0));
    2931    }
    3032    return;
     
    121123                }
    122124                numScan++;
     125
     126                memCheck();
     127
    123128            } while (numRead > 0);
    124129            psFree(readout);            // Drop reference
  • trunk/ppMerge/src/ppMergeConfig.c

    r7829 r8405  
    3434    psMetadataAddBool(config->arguments, PS_LIST_TAIL, "-exptime", 0, "Scale by the exposure time?", false);
    3535    psMetadataAddS32(config->arguments, PS_LIST_TAIL, "-onoff", 0, "Number of on/off pairs", 0);
     36    psMetadataAddStr(config->arguments, PS_LIST_TAIL, "-stats", 0, "MDC file to hold statistics ", NULL);
    3637
    3738    if (argc == 1) {
  • trunk/ppMerge/src/ppMergeData.c

    r7759 r8405  
    2020    if (data->outFile) {
    2121        psFitsClose(data->outFile);
     22        data->outFile = NULL;
     23    }
     24    if (data->statsFile) {
     25        fclose(data->statsFile);
     26        data->statsFile = NULL;
    2227    }
    2328}
     
    3439    data->out = NULL;
    3540    data->outFile = NULL;
     41    data->statsFile = NULL;
    3642
    3743    return data;
  • trunk/ppMerge/src/ppMergeData.h

    r7759 r8405  
    1212    pmFPA *out;                         // Output FPA structure
    1313    psFits *outFile;                    // FITS file handle for output
     14    FILE *statsFile;                    // File stream for statistics output
    1415} ppMergeData;
    1516
  • trunk/ppMerge/src/ppMergeOptions.c

    r7260 r8405  
    122122    // Now we can read the recipe
    123123    bool mdok = true;                   // Status of MD lookup
    124     psMetadata *recipe = psMetadataLookupMD(&mdok, config->recipes, RECIPENAME); // Recipe information
     124    psMetadata *recipe = psMetadataLookupMD(&mdok, config->recipes, PPMERGE_RECIPE); // Recipe information
    125125    if (!mdok || !recipe) {
    126         psError(PS_ERR_IO, true, "Unable to find recipe %s", RECIPENAME);
     126        psError(PS_ERR_IO, true, "Unable to find recipe %s", PPMERGE_RECIPE);
    127127        exit(EXIT_FAILURE);
    128128    }
Note: See TracChangeset for help on using the changeset viewer.