Changeset 31443
- Timestamp:
- May 5, 2011, 10:11:07 AM (15 years ago)
- Location:
- branches/eam_branches/ipp-20110404/psModules/src
- Files:
-
- 7 edited
-
camera/pmFPAWrite.c (modified) (4 diffs)
-
extras/pmVisualUtils.c (modified) (1 diff)
-
imcombine/pmStack.c (modified) (1 diff)
-
imcombine/pmStackReject.c (modified) (1 diff)
-
objects/pmFootprintAssignPeaks.c (modified) (2 diffs)
-
objects/pmFootprintCullPeaks.c (modified) (1 diff)
-
objects/pmFootprintIDs.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20110404/psModules/src/camera/pmFPAWrite.c
r27992 r31443 690 690 pmHDU *hdu = pmHDUFromCell(cell); // HDU for cell 691 691 psMetadata *header = psMetadataCopy(NULL, hdu->header); // Header to write 692 692 693 psMetadataAddS32(header, PS_LIST_TAIL, "COVARIANCE.CENTRE.X", PS_META_REPLACE, 693 694 "Centre of covariance matrix in x", -xMinCovar); … … 697 698 // Turn off compression 698 699 int bitpix = fits->options ? fits->options->bitpix : 0; // Desired bits per pixel 700 psFitsScaling scaling = fits->options ? fits->options->scaling : 0; // Current scaling method. 699 701 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); */ 700 705 if (!psFitsSetCompression(fits, PS_FITS_COMPRESS_NONE, NULL, 0, 0, 0)) { 701 706 psError(PS_ERR_UNKNOWN, false, "Unable to set FITS compression to NONE"); … … 708 713 if (fits->options) { 709 714 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. 710 718 } 711 719 … … 732 740 fits->options->bitpix = bitpix; 733 741 } 742 if (fits->options) { 743 fits->options->scaling = scaling; 744 } 734 745 if (!psFitsCompressionApply(fits, compress)) { 735 746 psError(PS_ERR_UNKNOWN, false, "Unable to restore FITS compression"); -
branches/eam_branches/ipp-20110404/psModules/src/extras/pmVisualUtils.c
r31153 r31443 416 416 return; 417 417 } else { 418 int nwritten = 0; 418 419 if (comp->level == PM_DEFAULT_VISUAL_LEVEL) { 419 420 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); 421 422 } else { 422 423 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); 424 425 } 425 426 } -
branches/eam_branches/ipp-20110404/psModules/src/imcombine/pmStack.c
r31153 r31443 37 37 # if (0) 38 38 #define TESTING // Enable test output 39 #define TEST_X 3 40// x coordinate to examine40 #define TEST_Y 938// y coordinate to examine39 #define TEST_X 3145 // x coordinate to examine 40 #define TEST_Y 2334 // y coordinate to examine 41 41 #define TEST_RADIUS 0.5 // Radius to examine 42 42 # endif -
branches/eam_branches/ipp-20110404/psModules/src/imcombine/pmStackReject.c
r30622 r31443 125 125 PS_ASSERT_FLOAT_LARGER_THAN_OR_EQUAL(threshold, 0.0, NULL); 126 126 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 127 134 PS_ASSERT_ARRAY_NON_NULL(subRegions, NULL); 128 135 PS_ASSERT_ARRAY_NON_NULL(subKernels, NULL); -
branches/eam_branches/ipp-20110404/psModules/src/objects/pmFootprintAssignPeaks.c
r31153 r31443 35 35 assert (peaks->n == 0 || psMemCheckPeak(peaks->data[0])); 36 36 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)) { 41 38 return PS_ERR_NONE; 42 39 } 40 43 41 /* 44 42 * Create an image filled with the object IDs, and use it to assign pmPeaks to the … … 59 57 60 58 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; 63 60 64 61 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 102 102 float beta = nsigma_delta * ALPHA; 103 103 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 105 106 106 107 // create a vector to store the threshold bins used for each peak -
branches/eam_branches/ipp-20110404/psModules/src/objects/pmFootprintIDs.c
r31153 r31443 66 66 67 67 if (footprints->n == 0) { 68 // XXX this was an error, but is an allowed condition -- NULL returned image means no footprints for any peaks69 // psError(PS_ERR_BAD_PARAMETER_SIZE, true, "You didn't provide any footprints");70 68 return NULL; 71 69 }
Note:
See TracChangeset
for help on using the changeset viewer.
