Changeset 12300 for trunk/psModules/src/detrend/pmDetrendDB.c
- Timestamp:
- Mar 7, 2007, 3:22:17 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/detrend/pmDetrendDB.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/detrend/pmDetrendDB.c
r11876 r12300 47 47 options->version = NULL; 48 48 options->dettype = NULL; 49 options->exptime = 0.0; 50 options->airmass = 0.0; 51 options->dettemp = 0.0; 52 options->twilight = 0.0; 49 options->exptime = 0.0; 50 options->airmass = 0.0; 51 options->dettemp = 0.0; 52 options->twilight = 0.0; 53 53 54 54 options->exptimeSet = false; // not selected … … 120 120 char *type = NULL; 121 121 if (options->dettype) { 122 type = psMemIncrRefCounter (options->dettype);122 type = psMemIncrRefCounter (options->dettype); 123 123 } else { 124 type = pmDetrendTypeToString (options->type);124 type = pmDetrendTypeToString (options->type); 125 125 } 126 126 unsigned int nFail; … … 189 189 190 190 bool mdstatus; 191 results->level = 0;192 191 int detID = psMetadataLookupS32 (&mdstatus, md, "det_id"); 192 if (!mdstatus) { 193 psError(PS_ERR_UNEXPECTED_NULL, true, "Unable to find det_id in output from detselect."); 194 psLogMsg ("psModule.detrend", PS_LOG_ERROR, "detselect response:\n %s\n", buffer->data); 195 goto failure; 196 } 193 197 int iteration = psMetadataLookupS32 (&mdstatus, md, "iteration"); 198 if (!mdstatus) { 199 psError(PS_ERR_UNEXPECTED_NULL, true, "Unable to find iteration in output from detselect."); 200 psLogMsg ("psModule.detrend", PS_LOG_ERROR, "detselect response:\n %s\n", buffer->data); 201 goto failure; 202 } 203 psString fileLevel = psMetadataLookupStr(&mdstatus, md, "file_level"); 204 if (!mdstatus || !fileLevel || strlen(fileLevel) == 0) { 205 psError(PS_ERR_UNEXPECTED_NULL, true, "Unable to find file_level in output from detselect."); 206 psLogMsg ("psModule.detrend", PS_LOG_ERROR, "detselect response:\n %s\n", buffer->data); 207 goto failure; 208 } 194 209 195 210 results->detID = NULL; // it should be NULL already from the Alloc above 196 211 psStringAppend (&results->detID, " -det_id %d -iteration %d ", detID, iteration); 212 results->level = psMemIncrRefCounter(fileLevel); 197 213 198 214 psTrace("psModules.detrend", 5, "generated detID %s\n", results->detID); … … 225 241 226 242 PS_ASSERT_PTR_NON_NULL(detID, NULL); 227 PS_ASSERT_PTR_NON_NULL(classID, NULL);228 243 229 244 bool status; … … 232 247 233 248 // generate the detselect command 234 psStringAppend (&line, "detselect -select %s -class_id %s", detID, classID); 249 psStringAppend (&line, "detselect -select %s", detID); 250 if (classID && strlen(classID) > 0) { 251 psStringAppend(&line, " -class_id %s", classID); 252 } 235 253 pmConfigDatabaseCommand(&line, config); 236 254 pmConfigTraceCommand(&line);
Note:
See TracChangeset
for help on using the changeset viewer.
