Changeset 26895 for trunk/ppImage/src/ppImageBurntoolMask.c
- Timestamp:
- Feb 10, 2010, 7:38:09 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/ppImage/src/ppImageBurntoolMask.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppImage/src/ppImageBurntoolMask.c
r25299 r26895 3 3 #endif 4 4 5 /* #define PPIMAGE_BURNTOOL_DEBUG 1 */ 5 #define PPIMAGE_BURNTOOL_DEBUG 0 6 6 7 7 #include "ppImage.h" … … 23 23 return(false); 24 24 } 25 long Nrows = psFitsTableSize(fits); 25 long Nrows = psFitsTableSize(fits); 26 26 27 27 long row = 0; … … 33 33 psImage *image = mask->mask; 34 34 35 35 36 36 /* Set the maskValue from the recipes. */ 37 37 psImageMaskType maskValue = options->burntoolMask; 38 #if defPPIMAGE_BURNTOOL_DEBUG38 #if PPIMAGE_BURNTOOL_DEBUG 39 39 psLogMsg("ppImageBurntoolMask", 4, "Status: %ld %d\n",Nrows,maskValue); 40 40 #endif … … 47 47 48 48 if (psMetadataLookupS32(&status,rowMD,"cell") == burntool_cell) { 49 if (((options->burntoolTrails & 0x01)&&(psMetadataLookupS32(&status,rowMD," nfit") == 0))||50 ((options->burntoolTrails & 0x02)&&(psMetadataLookupS32(&status,rowMD,"up") == 1))||51 ((options->burntoolTrails & 0x04)&&(psMetadataLookupS32(&status,rowMD,"up") == 0))) {52 /* If the fit fails, burntool reports zero here. This53 signifies that it expected to see a trail (else why54 fit) but did not find it when it attempted to55 correct. */56 #if defPPIMAGE_BURNTOOL_DEBUG57 psLogMsg ("ppImageBurntoolMask", 4, "Masking! %d (%d %d %d) %d %d",58 psMetadataLookupS32(&status,rowMD,"cell"),59 ((options->burntoolTrails & 0x0001)&&(psMetadataLookupS32(&status,rowMD,"nfit") == 0)),60 ((options->burntoolTrails & 0x02)&&(psMetadataLookupS32(&status,rowMD,"up") == 1)),61 ((options->burntoolTrails & 0x04)&&(psMetadataLookupS32(&status,rowMD,"up") == 0)),62 options->burntoolTrails,63 maskValue64 );49 if (((options->burntoolTrails & 0x01)&&(psMetadataLookupS32(&status,rowMD,"func") == 4))|| 50 (((options->burntoolTrails & 0x02)&&(psMetadataLookupS32(&status,rowMD,"up") == 1))|| 51 ((options->burntoolTrails & 0x04)&&(psMetadataLookupS32(&status,rowMD,"up") == 0)))) { 52 /* If the fit fails, burntool reports zero here. This 53 signifies that it expected to see a trail (else why 54 fit) but did not find it when it attempted to 55 correct. */ 56 #if PPIMAGE_BURNTOOL_DEBUG 57 psLogMsg ("ppImageBurntoolMask", 4, "Masking! %d (%d %d %d) %d %d", 58 psMetadataLookupS32(&status,rowMD,"cell"), 59 ((options->burntoolTrails & 0x0001)&&(psMetadataLookupS32(&status,rowMD,"nfit") == 0)), 60 ((options->burntoolTrails & 0x02)&&(psMetadataLookupS32(&status,rowMD,"up") == 1)), 61 ((options->burntoolTrails & 0x04)&&(psMetadataLookupS32(&status,rowMD,"up") == 0)), 62 options->burntoolTrails, 63 maskValue 64 ); 65 65 #endif 66 for (int i = psMetadataLookupS32(&status,rowMD,"sxfit");67 i <= psMetadataLookupS32(&status,rowMD,"exfit");68 i++) {66 for (int i = psMetadataLookupS32(&status,rowMD,"sxfit"); 67 i <= psMetadataLookupS32(&status,rowMD,"exfit"); 68 i++) { 69 69 70 if (psMetadataLookupS32(&status,rowMD,"up") == 0) {71 for (int j = 0; j <= psMetadataLookupS32(&status,rowMD,"y1p"); j++) {72 /* #ifdef PPIMAGE_BURNTOOL_DEBUG */ 73 /* psLogMsg("ppImageBurntoolMask", 4, "Noisy!: %d %d %d %d\n", */ 74 /* i,j,image->data.PS_TYPE_IMAGE_MASK_DATA[j][i],maskValue); */ 75 /* #endif */ 76 image->data.PS_TYPE_IMAGE_MASK_DATA[j][i] |= maskValue;77 }78 }79 else {80 for (int j = psMetadataLookupS32(&status,rowMD,"y1m"); j < image->numRows ; j++) {81 /* #ifdef PPIMAGE_BURNTOOL_DEBUG */ 82 /* psLogMsg("ppImageBurntoolMask", 4, "Noisy!: %d %d %d %d\n", */ 83 /* i,j,image->data.PS_TYPE_IMAGE_MASK_DATA[j][i],maskValue); */ 84 /* #endif */ 85 image->data.PS_TYPE_IMAGE_MASK_DATA[j][i] |= maskValue;86 }87 }88 }70 if (psMetadataLookupS32(&status,rowMD,"up") == 0) { 71 for (int j = 0; j <= psMetadataLookupS32(&status,rowMD,"y1p"); j++) { 72 #if PPIMAGE_BURNTOOL_DEBUG 73 psLogMsg("ppImageBurntoolMask", 4, "Noisy!: %d %d %d %d\n", 74 i,j,image->data.PS_TYPE_IMAGE_MASK_DATA[j][i],maskValue); 75 #endif 76 image->data.PS_TYPE_IMAGE_MASK_DATA[j][i] |= maskValue; 77 } 78 } 79 else { 80 for (int j = psMetadataLookupS32(&status,rowMD,"y1m"); j < image->numRows ; j++) { 81 #if PPIMAGE_BURNTOOL_DEBUG 82 psLogMsg("ppImageBurntoolMask", 4, "Noisy!: %d %d %d %d\n", 83 i,j,image->data.PS_TYPE_IMAGE_MASK_DATA[j][i],maskValue); 84 #endif 85 image->data.PS_TYPE_IMAGE_MASK_DATA[j][i] |= maskValue; 86 } 87 } 88 } 89 89 90 90 } … … 95 95 return(status); 96 96 } 97 98 99 100
Note:
See TracChangeset
for help on using the changeset viewer.
