IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 6, 2012, 6:32:19 PM (14 years ago)
Author:
watersc1
Message:

merge from trunk. Preliminary versions of stacktool/warptool updates and regenerate_background.pl script. The warp code is finished and tested, and I still need to get the stack version resolved.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/czw_branch/20120906/ppViz/src/ppVizPSF/ppVizPSFLoop.c

    r27667 r34772  
    2020        return NULL;
    2121    }
    22 
     22    fprintf(stderr,"Woo!\n");
    2323    pmChip *chip;                       // Chip from FPA
    2424    while ((chip = pmFPAviewNextChip(view, psfFile->fpa, 1))) {
     
    5656                psWarning("More than one readout present for chip %d, cell %d", view->chip, view->cell);
    5757            }
    58 
     58            fprintf(stderr,"Woo!\n");
    5959            pmReadout *readout;         // Readout from cell
    6060            while ((readout = pmFPAviewNextReadout(view, psfFile->fpa, 1))) {
     61              fprintf(stderr,"Woo?\n");
    6162                if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE)) {
    6263                    psError(PS_ERR_UNKNOWN, false, "Error loading data from files.");
    6364                    return false;
    6465                }
    65                 if (!readout->data_exists) {
    66                     continue;
    67                 }
    68 
     66                fprintf(stderr,"Woo2?\n");
    6967                pmPSF *psf = psMetadataLookupPtr(NULL, chip->analysis, "PSPHOT.PSF");              // PSF
    7068                assert(psf);
     
    7270                bool mdok;              // Status of MD lookup
    7371                psArray *sources = psMetadataLookupPtr(&mdok, readout->analysis, "PSPHOT.SOURCES"); // Sources
     72
     73                if (sources && !readout->data_exists) {  // This fails if -sources not specified
     74                    continue;
     75                }
     76                readout->data_exists = true;
     77                fprintf(stderr,"Woo! %ld\n", sources ? sources->n : -1);
     78
     79                fprintf(stderr,"%d\n",mdok);
    7480                int numCols = 0, numRows = 0;              // Size of image
    7581                psVector *xOffset = NULL, *yOffset = NULL; // Offset from source to true position
     
    8086                    psLogMsg("ppVizPSF", PS_LOG_INFO, "Generating %dx%d image", numCols, numRows);
    8187                }
    82                 if (sources) {
     88                if (sources && !sources->n) {
    8389                    psMemIncrRefCounter(sources);
    8490                    psLogMsg("ppVizPSF", PS_LOG_INFO, "Using %ld input sources from CMF file", sources->n);
     
    8995
    9096                if (data->fakeNum > 0 && isfinite(data->fakeMag)) {
     97                  fprintf(stderr,"Here! fakes\n");
    9198                    long numOld = 0; // Old number of sources
    9299                    long numNew = -1; // New number of sources
     
    118125                }
    119126                if (!sources && !data->input) {
     127                  fprintf(stderr,"Here! default\n");
    120128                    // Generate fake image with only a single realisation of the PSF
    121129                    sources = psArrayAlloc(1);
     
    151159                psFree(psf->residuals);
    152160                psf->residuals = NULL;
    153 
     161                fprintf(stderr,"still here");
    154162                if (sources) {
     163                  fprintf(stderr,"Here! sources?\n");
    155164                    if (!pmReadoutFakeFromSources(readout, numCols, numRows, sources, 0, xOffset, yOffset,
    156165                                                  psf, data->minFlux, 0, false, true)) {
     
    159168                    }
    160169                } else if (data->input) {
     170
    161171                    psVector *x = data->input->data[0]; // x coordinates
    162172                    psVector *y = data->input->data[1]; // y coordinates
    163173                    psVector *mag = data->input->data[2]; // Magnitudes
     174                    fprintf(stderr,"Here! input? %d %d %g %d %ld\n",numCols,numRows,data->minFlux,1,x->n);
    164175                    if (!pmReadoutFakeFromVectors(readout, numCols, numRows, x, y, mag, xOffset, yOffset,
    165176                                                  psf, data->minFlux, 0, false, true)) {
     
    168179                    }
    169180                }
    170 
     181               
    171182                psFree(sources);
    172183                psFree(xOffset);
Note: See TracChangeset for help on using the changeset viewer.