IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 15, 2011, 4:50:36 PM (15 years ago)
Author:
bills
Message:

Modify ppMops to use psFitsReadTableAllColumns and psFitsWriteTableAllColumns. These
functions store the columns in psVectors. This avoids the memory explosion that
results by storing the table as an array of metadatas representing rows.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppTranslate/src/ppMops.c

    r32176 r32406  
    33
    44#include "ppMops.h"
     5
     6void test()
     7{
     8    psMetadata *md = psMetadataAlloc();
     9
     10    psVector *vec = psVectorAlloc(42, PS_TYPE_S32);
     11
     12    psMetadataAddVector(md, PS_LIST_TAIL, "TEST", 0, NULL, vec);
     13
     14    psFree(vec);
     15    psFree(md);
     16
     17    psLibFinalize();
     18
     19    fprintf (stderr, "found %d leaks at %s\n",
     20        psMemCheckLeaks2 (0,
     21                NULL, stdout, false, 500), "ppMops");
     22
     23    exit(0);
     24}
    525
    626/*
     
    3959    psLibInit(NULL);
    4060
     61    // test();
     62
    4163    ppMopsArguments *args = ppMopsArgumentsParse(argc, argv); // Parsed arguments
    4264    if (!args) {
     
    4567    }
    4668
     69
    4770    psArray *detections = ppMopsRead(args); // Detections from each input
    4871    if (!detections) {
     
    5174    }
    5275
    53     ppMopsDetections *merged = ppMopsMerge(detections); // Merged detections
    54     psFree(detections);
    55     if (!merged) {
     76    if (!ppMopsPurgeDuplicates(detections)) {
    5677        psErrorStackPrint(stderr, "Unable to merge detections");
    5778        exit(PS_EXIT_SYS_ERROR);
    5879    }
    5980
    60     if (!ppMopsWrite(merged, args)) {
     81    if (!ppMopsWrite(detections, args)) {
    6182        psErrorStackPrint(stderr, "Unable to write detections");
    6283        exit(PS_EXIT_SYS_ERROR);
    6384    }
    6485
    65     psFree(merged);
     86    for (int i = 0; i < detections->n; i++) {
     87        psFree(detections->data[i]);
     88    }
     89    psFree(detections);
    6690    psFree(args);
    67     psFree(detections);
    6891
    6992    psLibFinalize();
Note: See TracChangeset for help on using the changeset viewer.