IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 7639


Ignore:
Timestamp:
Jun 22, 2006, 10:38:23 AM (20 years ago)
Author:
eugene
Message:

various cleanups

Location:
trunk/ppImage/src
Files:
7 edited

Legend:

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

    r7581 r7639  
    3535    return EXIT_SUCCESS;
    3636}
     37
     38void ppImageFileCheck (pmConfig *config) {
     39
     40    // add the output names to the output-type files
     41    psMetadataItem *item = NULL;
     42    psMetadataIterator *iter = psMetadataIteratorAlloc (config->files, PS_LIST_HEAD, NULL);
     43    while ((item = psMetadataGetAndIncrement (iter)) != NULL) {
     44        pmFPAfile *file = item->data.V;
     45        pmFPA *fpa = file->fpa;
     46        fprintf (stderr, "file %s\n", file->name);
     47        if (!fpa) {
     48            fprintf (stderr, "  has no FPA\n");
     49            continue;
     50        }
     51        if (fpa->hdu) {
     52            if (fpa->hdu->images) fprintf (stderr, "  (%d,%d) images\n", -1, -1);
     53            if (fpa->hdu->weights) fprintf (stderr, "  (%d,%d) weights\n", -1, -1);
     54            if (fpa->hdu->masks) fprintf (stderr, "  (%d,%d) masks\n", -1, -1);
     55            if (fpa->hdu->header) fprintf (stderr, "  (%d,%d) header\n", -1, -1);
     56            continue;
     57        }
     58        fprintf (stderr, "  has no fpa data (%d,%d)\n", -1, -1);
     59        for (int i = 0; i < fpa->chips->n; i++) {
     60            pmChip *chip = fpa->chips->data[i];
     61            if (chip->hdu) {
     62                if (chip->hdu->images) fprintf (stderr, "  (%d,%d) images\n", i, -1);
     63                if (chip->hdu->weights) fprintf (stderr, "  (%d,%d) weights\n", i, -1);
     64                if (chip->hdu->masks) fprintf (stderr, "  (%d,%d) masks\n", i, -1);
     65                if (chip->hdu->header) fprintf (stderr, "  (%d,%d) header\n", i, -1);
     66                continue;
     67            }
     68            fprintf (stderr, "  has no chip data (%d,%d)\n", i, -1);
     69            for (int j = 0; j < chip->cells->n; j++) {
     70                pmCell *cell = chip->cells->data[j];
     71                if (cell->hdu) {
     72                    if (cell->hdu->images) fprintf (stderr, "  (%d,%d) images\n", i, j);
     73                    if (cell->hdu->weights) fprintf (stderr, "  (%d,%d) weights\n", i, j);
     74                    if (cell->hdu->masks) fprintf (stderr, "  (%d,%d) masks\n", i, j);
     75                    if (cell->hdu->header) fprintf (stderr, "  (%d,%d) header\n", i, j);
     76                    continue;
     77                }
     78                fprintf (stderr, "  has no cell data (%d,%d)\n", i, j);
     79            }
     80        }
     81    }
     82    psFree (iter);
     83}
  • trunk/ppImage/src/ppImage.h

    r7621 r7639  
    4343bool ppImageMosaicFPA (pmConfig *config, char *outFile, char *inFile);
    4444
     45void ppImageFileCheck (pmConfig *config);
     46
    4547#endif
  • trunk/ppImage/src/ppImageAstrom.c

    r7621 r7639  
    2020        input->mode = PM_FPA_MODE_REFERENCE;
    2121
    22         pmFPAfileDefineOutput (config, input->fpa, "PSPHOT.OUTPUT");
     22        pmFPAfileDefineOutput (config, input->fpa, "PSASTRO.OUTPUT");
    2323    }
     24
     25    psastroConvertFPA (input->fpa, recipe);
    2426
    2527    // interpret the available initial astrometric information
     
    3941    }
    4042
     43    psastroDataSave (config);
     44
     45    psFree (refs);
    4146    return true;
    4247}
  • trunk/ppImage/src/ppImageCleanup.c

    r7581 r7639  
    1212    pmConfigDone();
    1313    pmModelGroupCleanup();
    14     // fprintf (stderr, "found %d leaks at %s\n", psMemCheckLeaks (0, NULL, NULL, false), "ppImage");
    15     fprintf (stderr, "found %d leaks at %s\n", psMemCheckLeaks (0, NULL, stdout, false), "ppImage");
     14    fprintf (stderr, "found %d leaks at %s\n", psMemCheckLeaks (0, NULL, NULL, false), "ppImage");
     15    // fprintf (stderr, "found %d leaks at %s\n", psMemCheckLeaks (0, NULL, stdout, false), "ppImage");
    1616    return;
    1717}
  • trunk/ppImage/src/ppImageLoop.c

    r7621 r7639  
    77    pmCell *cell;
    88    pmReadout *readout;
     9    psMemId ID;
    910
    1011    pmFPAfile *input = psMetadataLookupPtr (&status, config->files, "PPIMAGE.INPUT");
     
    2223        psLogMsg ("ppImageLoop", 4, "Chip %d: %x %x\n", view->chip, chip->file_exists, chip->process);
    2324        if (!chip->process || !chip->file_exists) { continue; }
     25
     26        ID = psMemGetId();
    2427        if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) return false;
    2528
     
    3639                // perform the detrend analysis
    3740                if (!ppImageDetrendReadout (config, options, view)) return false;
    38 
     41               
    3942                if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) return false;
    4043            }
     
    5053
    5154        if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) return false;
     55
     56        fprintf (stderr, "done chip\n");
     57        // fprintf (stderr, "found %d leaks at %s\n", psMemCheckLeaks (ID, NULL, stdout, false), "chips");
     58        // ppImageFileCheck (config);
    5259    }
    5360
     
    5764    // we perform astrometry on all chips after sources have been detected
    5865    if (options->doAstromChip || options->doAstromMosaic) ppImageAstrom (config);
    59    
     66
    6067    if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) return false;
    6168
  • trunk/ppImage/src/ppImageMosaic.c

    r7621 r7639  
    4242    }
    4343
     44    for (int i = 0; i < in->fpa->chips->n; i++) {
     45        pmChip *chip = in->fpa->chips->data[i];
     46        for (int j = 0; j < chip->cells->n; j++) {
     47            pmCell *cell = chip->cells->data[j];
     48            psMetadataPrint (stdout, cell->concepts, 2);
     49        }
     50    }
     51
    4452    pmFPAview *view = pmFPAviewAlloc (0);
    4553    pmFPAAddSourceFromView (out->fpa, view, out->format);
  • trunk/ppImage/src/ppImagePhotom.c

    r7621 r7639  
    3131        input->mode = PM_FPA_MODE_REFERENCE;
    3232
    33         pmFPAfileDefineOutput (config, input->fpa, "PSPHOT.OUTPUT");
     33        pmFPAfile *outfile = pmFPAfileDefineOutput (config, input->fpa, "PSPHOT.OUTPUT");
     34        outfile->freeLevel = PM_FPA_LEVEL_FPA;
    3435    }
    3536
     
    8081            // run the actual photometry analysis
    8182            psphotReadout (config, view);
     83            fprintf (stderr, "psphot done\n");
    8284        }
    8385    }
Note: See TracChangeset for help on using the changeset viewer.