IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 21458


Ignore:
Timestamp:
Feb 12, 2009, 10:05:21 AM (17 years ago)
Author:
Paul Price
Message:

Hadn't changed weight --> variance for the standalone psphot.

Location:
trunk/psphot/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/psphot/src/psphotArguments.c

    r21166 r21458  
    3333    if ((N = psArgumentGet(argc, argv, "-threads"))) {
    3434        psArgumentRemove(N, &argc, argv);
    35         int nThreads = atoi(argv[N]);
     35        int nThreads = atoi(argv[N]);
    3636        psMetadataAddS32(config->arguments, PS_LIST_TAIL, "NTHREADS", 0, "number of psphot threads", nThreads);
    3737        psArgumentRemove(N, &argc, argv);
    3838
    39         // create the thread pool with number of desired threads, supplying our thread launcher function
    40         psThreadPoolInit (nThreads);
     39        // create the thread pool with number of desired threads, supplying our thread launcher function
     40        psThreadPoolInit (nThreads);
    4141    }
    4242    psphotSetThreads();
     
    8282    if ((N = psArgumentGet (argc, argv, "-visual"))) {
    8383        psArgumentRemove (N, &argc, argv);
    84         psphotSetVisual (true);
    85         // pmSourceSetVisual (true);
     84        psphotSetVisual (true);
     85        // pmSourceSetVisual (true);
    8686    }
    8787
     
    118118    //
    119119    pmConfigFileSetsMD (config->arguments, &argc, argv, "MASK",   "-mask",   "-masklist");
    120     pmConfigFileSetsMD (config->arguments, &argc, argv, "WEIGHT", "-weight", "-weightlist");
     120    pmConfigFileSetsMD (config->arguments, &argc, argv, "VARIANCE", "-variance", "-variancelist");
    121121    pmConfigFileSetsMD (config->arguments, &argc, argv, "PSPHOT.PSF", "-psf", "-psflist");
    122122    pmConfigFileSetsMD (config->arguments, &argc, argv, "SRC",    "-src",    "-srclist");
  • trunk/psphot/src/psphotImageLoop.c

    r20769 r21458  
    1616    pmFPAfile *load = psMetadataLookupPtr (&status, config->files, "PSPHOT.LOAD");
    1717    if (!status) {
    18         psError(PSPHOT_ERR_PROG, false, "Can't find input data!");
    19         return false;
     18        psError(PSPHOT_ERR_PROG, false, "Can't find input data!");
     19        return false;
    2020    }
    2121    pmFPAfile *input = psMetadataLookupPtr (&status, config->files, "PSPHOT.INPUT");
    2222    if (!status) {
    23         psError(PSPHOT_ERR_PROG, false, "Can't find input data!");
    24         return false;
     23        psError(PSPHOT_ERR_PROG, false, "Can't find input data!");
     24        return false;
    2525    }
    2626
    2727    pmFPAview *view = pmFPAviewAlloc (0);
    28    
     28
    2929    // files associated with the science image
    3030    if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) ESCAPE ("failed input for fpa in psphot.");
    3131
    32     // for psphot, we force data to be read at the chip level 
     32    // for psphot, we force data to be read at the chip level
    3333    while ((chip = pmFPAviewNextChip (view, load->fpa, 1)) != NULL) {
    3434        psLogMsg ("psphot", 4, "Chip %d: %x %x\n", view->chip, chip->file_exists, chip->process);
    3535        if (! chip->process || ! chip->file_exists) { continue; }
    3636
    37         // load just the input image data (image, mask, weight)
    38         pmFPAfileActivate (config->files, false, NULL);
    39         pmFPAfileActivate (config->files, true, "PSPHOT.LOAD");
    40         pmFPAfileActivate (config->files, true, "PSPHOT.MASK");
    41         pmFPAfileActivate (config->files, true, "PSPHOT.WEIGHT");
    42         if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) ESCAPE ("failed input for Chip in psphot.");
     37        // load just the input image data (image, mask, weight)
     38        pmFPAfileActivate (config->files, false, NULL);
     39        pmFPAfileActivate (config->files, true, "PSPHOT.LOAD");
     40        pmFPAfileActivate (config->files, true, "PSPHOT.MASK");
     41        pmFPAfileActivate (config->files, true, "PSPHOT.VARIANCE");
     42        if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) ESCAPE ("failed input for Chip in psphot.");
    4343
    44         // mosaic the cells of a chip into a single contiguous (trimmed) chip
     44        // mosaic the cells of a chip into a single contiguous (trimmed) chip
    4545        if (!psphotMosaicChip(config, view, "PSPHOT.INPUT", "PSPHOT.LOAD")) ESCAPE ("Unable to mosaic chip.");
    4646
    47         // try to load other supporting data (PSF, SRC, etc).
    48         // do not re-load the following three files
    49         pmFPAfileActivate (config->files, true, NULL);
    50         pmFPAfileActivate (config->files, false, "PSPHOT.LOAD");
    51         pmFPAfileActivate (config->files, false, "PSPHOT.MASK");
    52         pmFPAfileActivate (config->files, false, "PSPHOT.WEIGHT");
    53         if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) ESCAPE ("failed input for Chip in psphot.");
     47        // try to load other supporting data (PSF, SRC, etc).
     48        // do not re-load the following three files
     49        pmFPAfileActivate (config->files, true, NULL);
     50        pmFPAfileActivate (config->files, false, "PSPHOT.LOAD");
     51        pmFPAfileActivate (config->files, false, "PSPHOT.MASK");
     52        pmFPAfileActivate (config->files, false, "PSPHOT.VARIANCE");
     53        if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) ESCAPE ("failed input for Chip in psphot.");
    5454
    55         // re-activate files so they will be closed and freed below
    56         pmFPAfileActivate (config->files, true, NULL);
     55        // re-activate files so they will be closed and freed below
     56        pmFPAfileActivate (config->files, true, NULL);
    5757
    58         // there is now only a single chip (multiple readouts?). loop over it and process
    59         while ((cell = pmFPAviewNextCell (view, input->fpa, 1)) != NULL) {
     58        // there is now only a single chip (multiple readouts?). loop over it and process
     59        while ((cell = pmFPAviewNextCell (view, input->fpa, 1)) != NULL) {
    6060            psLogMsg ("psphot", 5, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process);
    6161
    62             // process each of the readouts
    63             while ((readout = pmFPAviewNextReadout (view, input->fpa, 1)) != NULL) {
    64                 psLogMsg ("psphot", 6, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process);
    65                 if (! readout->data_exists) { continue; }
     62            // process each of the readouts
     63            while ((readout = pmFPAviewNextReadout (view, input->fpa, 1)) != NULL) {
     64                psLogMsg ("psphot", 6, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process);
     65                if (! readout->data_exists) { continue; }
    6666
    67                 // run the actual photometry analysis on this chip/cell/readout
    68                 if (!psphotReadout (config, view)) {
    69                     psError(psErrorCodeLast(), false, "failure in psphotReadout for chip %d, cell %d, readout %d\n", view->chip, view->cell, view->readout);
    70                     psFree (view);
    71                     return false;
    72                 }
    73             }
     67                // run the actual photometry analysis on this chip/cell/readout
     68                if (!psphotReadout (config, view)) {
     69                    psError(psErrorCodeLast(), false, "failure in psphotReadout for chip %d, cell %d, readout %d\n", view->chip, view->cell, view->readout);
     70                    psFree (view);
     71                    return false;
     72                }
     73            }
    7474
    75             status = true;
    76             status &= pmFPAfileDropInternal (config->files, "PSPHOT.BACKMDL");
    77             status &= pmFPAfileDropInternal (config->files, "PSPHOT.BACKMDL.STDEV");
    78             status &= pmFPAfileDropInternal (config->files, "PSPHOT.BACKGND");
    79             if (!status) {
    80                 psError(PSPHOT_ERR_PROG, false, "trouble dropping internal files");
    81                 psFree (view);
    82                 return false;
    83             }
    84         }
     75            status = true;
     76            status &= pmFPAfileDropInternal (config->files, "PSPHOT.BACKMDL");
     77            status &= pmFPAfileDropInternal (config->files, "PSPHOT.BACKMDL.STDEV");
     78            status &= pmFPAfileDropInternal (config->files, "PSPHOT.BACKGND");
     79            if (!status) {
     80                psError(PSPHOT_ERR_PROG, false, "trouble dropping internal files");
     81                psFree (view);
     82                return false;
     83            }
     84        }
    8585
    86         // save output which is saved at the chip level
    87         if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) ESCAPE ("failed output for Chip in psphot.");
     86        // save output which is saved at the chip level
     87        if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) ESCAPE ("failed output for Chip in psphot.");
    8888    }
    8989    // save output which is saved at the fpa level
     
    108108
    109109// PSPHOT.MASK
    110 // PSPHOT.WEIGHT
    111 // 
     110// PSPHOT.VARIANCE
     111//
  • trunk/psphot/src/psphotParseCamera.c

    r19141 r21458  
    1515    load->dataLevel = PM_FPA_LEVEL_CHIP; // force load at the CHIP level
    1616
    17     // if MASK or WEIGHT was supplied on command line, bind files to 'load'
     17    // if MASK or VARIANCE was supplied on command line, bind files to 'load'
    1818    // the mask and weight will be mosaicked with the image
    1919    pmFPAfileBindFromArgs (&status, load, config, "PSPHOT.MASK", "MASK");
     
    2727    }
    2828
    29     pmFPAfileBindFromArgs (&status, load, config, "PSPHOT.WEIGHT", "WEIGHT");
     29    pmFPAfileBindFromArgs (&status, load, config, "PSPHOT.VARIANCE", "VARIANCE");
    3030    if (!status) {
    3131        psError (PS_ERR_UNKNOWN, false, "failed to load find definition");
Note: See TracChangeset for help on using the changeset viewer.