IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 31443


Ignore:
Timestamp:
May 5, 2011, 10:11:07 AM (15 years ago)
Author:
eugene
Message:

merging updates from trunk

Location:
branches/eam_branches/ipp-20110404/psModules/src
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20110404/psModules/src/camera/pmFPAWrite.c

    r27992 r31443  
    690690    pmHDU *hdu = pmHDUFromCell(cell);   // HDU for cell
    691691    psMetadata *header = psMetadataCopy(NULL, hdu->header); // Header to write
     692
    692693    psMetadataAddS32(header, PS_LIST_TAIL, "COVARIANCE.CENTRE.X", PS_META_REPLACE,
    693694                     "Centre of covariance matrix in x", -xMinCovar);
     
    697698    // Turn off compression
    698699    int bitpix = fits->options ? fits->options->bitpix : 0; // Desired bits per pixel
     700    psFitsScaling scaling = fits->options ? fits->options->scaling : 0; // Current scaling method.
    699701    psFitsCompression *compress = psFitsCompressionGet(fits); // Current compression options
     702   
     703/*     fprintf(stderr,"Attempting to write chip %s cell %s extension %s with scaling %d\n", */
     704/*          chipName,cellName,extname,fits->options->scaling); */
    700705    if (!psFitsSetCompression(fits, PS_FITS_COMPRESS_NONE, NULL, 0, 0, 0)) {
    701706        psError(PS_ERR_UNKNOWN, false, "Unable to set FITS compression to NONE");
     
    708713    if (fits->options) {
    709714        fits->options->bitpix = 0;
     715    }
     716    if (fits->options) {
     717        fits->options->scaling = psFitsScalingFromString("STDEV_POSITIVE"); // This is a bit of a hack. We don't really have a default value.
    710718    }
    711719
     
    732740        fits->options->bitpix = bitpix;
    733741    }
     742    if (fits->options) {
     743        fits->options->scaling = scaling;
     744    }
    734745    if (!psFitsCompressionApply(fits, compress)) {
    735746        psError(PS_ERR_UNKNOWN, false, "Unable to restore FITS compression");
  • branches/eam_branches/ipp-20110404/psModules/src/extras/pmVisualUtils.c

    r31153 r31443  
    416416        return;
    417417    } else {
     418        int nwritten = 0;
    418419        if (comp->level == PM_DEFAULT_VISUAL_LEVEL) {
    419420            sprintf(line,"%*s%-*s %d\n", depth, "", 20 - depth, comp->name, defLevel);
    420             fwrite (line, 1, strlen(line), output);
     421            nwritten = fwrite (line, 1, strlen(line), output);
    421422        } else {
    422423            sprintf(line, "%*s%-*s %d\n", depth, "", 20 - depth, comp->name, comp->level);
    423             fwrite (line, 1, strlen(line), output);
     424            nwritten = fwrite (line, 1, strlen(line), output);
    424425        }
    425426    }
  • branches/eam_branches/ipp-20110404/psModules/src/imcombine/pmStack.c

    r31153 r31443  
    3737# if (0)
    3838#define TESTING                         // Enable test output
    39 #define TEST_X 340                       // x coordinate to examine
    40 #define TEST_Y 938                       // y coordinate to examine
     39#define TEST_X 3145                       // x coordinate to examine
     40#define TEST_Y 2334                       // y coordinate to examine
    4141#define TEST_RADIUS 0.5                 // Radius to examine
    4242# endif
  • branches/eam_branches/ipp-20110404/psModules/src/imcombine/pmStackReject.c

    r30622 r31443  
    125125    PS_ASSERT_FLOAT_LARGER_THAN_OR_EQUAL(threshold, 0.0, NULL);
    126126    PS_ASSERT_FLOAT_LESS_THAN_OR_EQUAL(threshold, 1.0, NULL);
     127
     128    if (!subRegions || !subKernels) {
     129      psTrace("psModules.imcombine",2,"Do not have the necessary kernels and regions, returning input pixels.");
     130      psPixels *out = psPixelsCopy(NULL,in);
     131      return out;
     132    }
     133   
    127134    PS_ASSERT_ARRAY_NON_NULL(subRegions, NULL);
    128135    PS_ASSERT_ARRAY_NON_NULL(subKernels, NULL);
  • branches/eam_branches/ipp-20110404/psModules/src/objects/pmFootprintAssignPeaks.c

    r31153 r31443  
    3535    assert (peaks->n == 0 || psMemCheckPeak(peaks->data[0]));
    3636   
    37     if (footprints->n == 0) {
    38         if (peaks->n > 0) {
    39             return psError(PS_ERR_BAD_PARAMETER_SIZE, true, "Your list of footprints is empty");
    40         }
     37    if ((footprints->n == 0) && (peaks->n == 0)) {
    4138        return PS_ERR_NONE;
    4239    }
     40
    4341    /*
    4442     * Create an image filled with the object IDs, and use it to assign pmPeaks to the
     
    5957       
    6058        if (ids) { assert (x >= 0 && x < numCols && y >= 0 && y < numRows);}
    61         int id = ids ? ids->data.S32[y][x - col0] : 0;
    62         // XXX I think the '[x - col0]' above is just wrong (should be [x], but never gets triggerd.
     59        int id = ids ? ids->data.S32[y][x] : 0;
    6360
    6461        if (id == 0) {                  // peak isn't in a footprint, so make one for it
  • branches/eam_branches/ipp-20110404/psModules/src/objects/pmFootprintCullPeaks.c

    r31153 r31443  
    102102        float beta = nsigma_delta * ALPHA;
    103103        float beta2 = PS_SQR(beta);
    104         int nBins = sqrt(4.0*(maxFlux - min_threshold)/beta2) + 10; // let's be extra generous
     104        float value = 4.0*(maxFlux - min_threshold)/beta2;
     105        int nBins = (value > 1.0) ? sqrt(value) + 10 : 10; // let's be extra generous
    105106
    106107        // create a vector to store the threshold bins used for each peak
  • branches/eam_branches/ipp-20110404/psModules/src/objects/pmFootprintIDs.c

    r31153 r31443  
    6666
    6767   if (footprints->n == 0) {
    68        // XXX this was an error, but is an allowed condition -- NULL returned image means no footprints for any peaks
    69        // psError(PS_ERR_BAD_PARAMETER_SIZE, true, "You didn't provide any footprints");
    7068       return NULL;
    7169   }
Note: See TracChangeset for help on using the changeset viewer.