Changeset 31091
- Timestamp:
- Mar 30, 2011, 9:42:02 AM (15 years ago)
- Location:
- branches/eam_branches/ipp-20110213/psModules/src
- Files:
-
- 5 edited
-
config/pmConfigRecipeValue.c (modified) (1 diff)
-
detrend/pmDetrendDB.c (modified) (4 diffs)
-
detrend/pmFringeStats.c (modified) (3 diffs)
-
imcombine/pmSubtractionMatch.c (modified) (1 diff)
-
imcombine/pmSubtractionStamps.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20110213/psModules/src/config/pmConfigRecipeValue.c
r26893 r31091 32 32 return NULL; 33 33 } 34 35 psMetadataItem *fpaItem = psMetadataLookup(recipe, valueName); // Value for FPA or menu of chips 34 psMetadata *format = config->format; 35 36 psMetadataItem *fpaItem; 37 fpaItem = psMetadataLookup(format, valueName); 38 if (!fpaItem) { 39 fpaItem = psMetadataLookup(recipe, valueName); // Value for FPA or menu of chips 40 } 41 36 42 if (!fpaItem) { 37 43 psError(PS_ERR_UNEXPECTED_NULL, false, "Unable to find value %s in recipe %s", valueName, recipeName); -
branches/eam_branches/ipp-20110213/psModules/src/detrend/pmDetrendDB.c
r29833 r31091 7 7 #include <pslib.h> 8 8 9 #include "pmErrorCodes.h" 9 10 #include "pmConfig.h" 10 11 #include "pmConfigCommand.h" … … 120 121 PS_ASSERT_PTR_NON_NULL(config, NULL); 121 122 123 psIOBuffer *buffer = NULL; 124 psPipe *pipe = NULL; 125 psMetadata *answer = NULL; 126 122 127 int status, exit_status; 123 128 psString line = NULL; … … 137 142 psFree (realCamera); 138 143 144 // require a filter for certain types of detrends: 145 if ((options->type == PM_DETREND_TYPE_FLAT) && !options->filter) { 146 psError (PM_ERR_CONFIG, false, "requesting a FLAT-class of detrend without a filter"); 147 goto failure; 148 } 149 if ((options->type == PM_DETREND_TYPE_FLATCORR) && !options->filter) { 150 psError (PM_ERR_CONFIG, false, "requesting a FLATCORR-class of detrend without a filter"); 151 goto failure; 152 } 153 if ((options->type == PM_DETREND_TYPE_FRINGE) && !options->filter) { 154 psError (PM_ERR_CONFIG, false, "requesting a FRINGE-class of detrend without a filter"); 155 goto failure; 156 } 157 158 // add the restrictions 139 159 if (options->filter) { 140 160 psStringAppend(&line, " -filter %s", options->filter); … … 155 175 psStringAppend(&line, " -airmass %f", options->twilight); 156 176 } 157 158 psIOBuffer *buffer = NULL;159 psPipe *pipe = NULL;160 psMetadata *answer = NULL;161 177 162 178 if (!pmConfigDatabaseCommand(&line, config)) { -
branches/eam_branches/ipp-20110213/psModules/src/detrend/pmFringeStats.c
r30550 r31091 1029 1029 psVector *science_values = psVectorAllocEmpty(4000,PS_TYPE_F32); 1030 1030 psVector *science_errors = psVectorAllocEmpty(4000,PS_TYPE_F32); 1031 1032 psStats *binStats = psStatsAlloc(PS_STAT_ROBUST_MEDIAN | PS_STAT_ROBUST_STDEV); 1031 psVector *science_counts = psVectorAllocEmpty(4000,PS_TYPE_S32); 1032 1033 psStats *binStats = psStatsAlloc(PS_STAT_CLIPPED_MEAN | PS_STAT_CLIPPED_STDEV); 1033 1034 for (int i = 0; i < 4000; i++) { 1034 1035 psVector *bin = bins->data[i]; 1035 if (bin->n > 2) {1036 if (bin->n > 10) { 1036 1037 psStatsInit(binStats); 1037 1038 1038 1039 psVectorStats(binStats,bin,NULL,NULL,1); 1039 1040 1040 if (isfinite(binStats->robustStdev) && 1041 isfinite(binStats->robustMedian) && 1042 binStats->robustStdev > 0) { 1041 if (isfinite(binStats->clippedStdev) && 1042 isfinite(binStats->clippedMean) && 1043 (binStats->clippedStdev > 0) && 1044 (binStats->clippedNvalues > 10) && 1045 (binStats->clippedNvalues > 0.5 * bin->n) 1046 ) { 1043 1047 psVectorAppend(fringe_positions,-0.1 + i * 5e-5); 1044 psVectorAppend(science_values, binStats->robustMedian); 1045 psVectorAppend(science_errors, binStats->robustStdev); 1048 psVectorAppend(science_values, binStats->clippedMean); 1049 psVectorAppend(science_errors, binStats->clippedStdev); 1050 psVectorAppend(science_counts, bin->n); 1046 1051 } 1047 1052 } … … 1052 1057 1053 1058 for (int i = 0; i < fringe_positions->n; i++) { 1054 psTrace("psModules.detrend",7,"FITDATA: %f %f %f \n",1059 psTrace("psModules.detrend",7,"FITDATA: %f %f %f %d\n", 1055 1060 fringe_positions->data.F32[i], 1056 1061 science_values->data.F32[i], 1057 science_errors->data.F32[i]); 1062 science_errors->data.F32[i], 1063 science_counts->data.S32[i]); 1058 1064 } 1059 1065 /* // Begin switch from old outlier removal and fitting code. */ … … 1071 1077 psFree(science_values); 1072 1078 psFree(science_errors); 1079 psFree(science_counts); 1073 1080 1074 1081 for (int i = 0; i <= poly->nX; i++) { -
branches/eam_branches/ipp-20110213/psModules/src/imcombine/pmSubtractionMatch.c
r30813 r31091 684 684 // if we failed, it might be due to the desired normWindow being larger than the current footprint. 685 685 // in this case, just adjust the footprint and try again. 686 if (tryAgain && (nTries >= 2)) {686 if (tryAgain && (nTries >= 5)) { 687 687 // unrecoverable error 688 688 psError(PM_ERR_STAMPS, true, "Unable to get stamp window (failure to converge)."); -
branches/eam_branches/ipp-20110213/psModules/src/imcombine/pmSubtractionStamps.c
r30813 r31091 926 926 927 927 // this is an unrecoverable error : something really bogus in the data 928 if (stamps->normWindow1 == 0) {928 if (stamps->normWindow1 <= 0) { 929 929 psError(PM_ERR_STAMPS, true, "Unable to determine normalisation window size (1)."); 930 930 psFree (stats); … … 935 935 return false; 936 936 } 937 if (stamps->normWindow2 == 0) {937 if (stamps->normWindow2 <= 0) { 938 938 psError(PM_ERR_STAMPS, true, "Unable to determine normalisation window size (2)."); 939 939 psFree (stats);
Note:
See TracChangeset
for help on using the changeset viewer.
