Changeset 23936
- Timestamp:
- Apr 20, 2009, 2:38:45 PM (17 years ago)
- Location:
- trunk/magic/remove/src
- Files:
-
- 3 edited
-
streaksio.c (modified) (3 diffs)
-
streaksio.h (modified) (2 diffs)
-
streaksremove.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/magic/remove/src/streaksio.c
r23911 r23936 968 968 969 969 void 970 setMaskedToNAN(streakFiles *sfiles, psU 8maskMask, bool printCounts)970 setMaskedToNAN(streakFiles *sfiles, psU32 maskMask, bool printCounts) 971 971 { 972 972 int maskedPixels = 0; … … 991 991 // but I want to get the counts 992 992 double imageVal = psImageGet(image, x, y); 993 psU 8maskVal;993 psU32 maskVal; 994 994 if (sfiles->stage == IPP_STAGE_RAW) { 995 995 int xChip, yChip; … … 1044 1044 } 1045 1045 } 1046 1047 void 1048 strkGetMaskValues(streakFiles *sfiles, psU32 *maskStreak, psU32 *maskMask) 1049 { 1050 if (sfiles->inMask->header) { 1051 if (!pmConfigMaskReadHeader(sfiles->config, sfiles->inMask->header)) { 1052 streaksExit("failed to read mask values from file", PS_EXIT_CONFIG_ERROR); 1053 } 1054 } 1055 1056 bool status; 1057 psMetadata *masks = psMetadataLookupMetadata(&status, sfiles->config->recipes, "MASKS"); 1058 if (!status) { 1059 psError(PM_ERR_CONFIG, false, "failed to lookup MASKS in recipes\n"); 1060 streaksExit("", PS_EXIT_CONFIG_ERROR); 1061 } 1062 *maskStreak = psMetadataLookupU32(&status, masks, "STREAK"); 1063 if (!status) { 1064 psError(PM_ERR_CONFIG, false, "failed to lookup mask value for STREAK in recipes\n"); 1065 streaksExit("", PS_EXIT_CONFIG_ERROR); 1066 } 1067 1068 // optionally setting pixels with any mask bits execpt CONV.POOR to NAN 1069 // check old name first 1070 psU32 convPoor = (double) psMetadataLookupU32(&status, masks, "POOR.WARP"); 1071 if (!status) { 1072 convPoor = (double) psMetadataLookupU32(&status, masks, "CONV.POOR"); 1073 if (!status) { 1074 psError(PM_ERR_CONFIG, false, "failed to lookup mask value for CONV.POOR in recipes\n"); 1075 streaksExit("", PS_EXIT_CONFIG_ERROR); 1076 } 1077 } 1078 *maskMask = ~convPoor; 1079 } -
trunk/magic/remove/src/streaksio.h
r23487 r23936 16 16 void copyFitsOptions(sFile *out, sFile *rec, sFile *in); 17 17 void setupImageRefs(sFile *out, sFile *recoveryOut, sFile *in, int extnum, bool exciseAll); 18 void strkGetMaskValues(streakFiles *sfiles, psU32 *maskStreak, psU32 *maskMask); 18 19 19 20 void writeImage(sFile *sfile, psString extname, int extnum); … … 25 26 26 27 bool isExciseValue(double, double); 27 void setMaskedToNAN(streakFiles *sfiles, psU 8maskMask, bool printCounts);28 void setMaskedToNAN(streakFiles *sfiles, psU32 maskMask, bool printCounts); 28 29 29 30 bool replicateOutputs(streakFiles *sf); -
trunk/magic/remove/src/streaksremove.c
r23911 r23936 23 23 } 24 24 25 psMetadata *masks = psMetadataLookupMetadata(&status, config->recipes, "MASKS"); 26 if (!status) { 27 psError(PM_ERR_CONFIG, false, "failed to lookup MASKS in recipes\n"); 28 streaksExit("", PS_EXIT_CONFIG_ERROR); 29 } 30 double maskStreak = (double) psMetadataLookupU16(&status, masks, "STREAK"); 31 if (!status) { 32 psError(PM_ERR_CONFIG, false, "failed to lookup mask value for STREAK in recipes\n"); 33 streaksExit("", PS_EXIT_CONFIG_ERROR); 34 } 35 36 // optionally setting pixels with any mask bits execpt POOR.WARP to NAN 37 psU16 poorWarp = (double) psMetadataLookupU16(&status, masks, "CONV.POOR"); 38 if (!status) { 39 psError(PM_ERR_CONFIG, false, "failed to lookup mask value for POOR.WARP in recipes\n"); 40 streaksExit("", PS_EXIT_CONFIG_ERROR); 41 } 42 psU16 maskMask = ~poorWarp; 25 psU32 maskStreak = 0; 26 psU32 maskMask = 0; 43 27 44 28 psString streaksFileName = psMetadataLookupStr(NULL, config->arguments, "STREAKS"); … … 114 98 } 115 99 100 // now that we've read the input files, lookup the mask values 101 if (maskStreak == 0) { 102 strkGetMaskValues(sfiles, &maskStreak, &maskMask); 103 } 104 116 105 totalPixels += sfiles->inImage->numRows * sfiles->inImage->numCols; 117 106 … … 131 120 psTimerStart("EXCISE_NON_WARPED"); 132 121 122 // set non-warped pixels and variance to NAN, mask to maskStreak (since the pixel 123 // is excised as part of the destreaking process) 133 124 exciseNonWarpedPixels(sfiles, maskStreak); 134 125 … … 648 639 } 649 640 } 641 // XXX: check this 650 642 // Assumption: there are no mask and weight images for video cells 651 643 return;
Note:
See TracChangeset
for help on using the changeset viewer.
