Changeset 18163 for trunk/psModules/src/detrend/pmDark.c
- Timestamp:
- Jun 17, 2008, 12:16:38 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/detrend/pmDark.c (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/detrend/pmDark.c
r18132 r18163 25 25 // Look up the value of an ordinate in a readout 26 26 static bool ordinateLookup(float *value, // Value of ordinate, to return 27 bool *inRange, // is value within min : max range?27 bool *inRange, // is value within min : max range? 28 28 const char *name, // Name of ordinate (concept name) 29 29 bool scale, // Scale the value? … … 70 70 if (*value < min || *value > max) { 71 71 psWarning("Value of concept %s (%f) outside range (%f:%f)", name, *value, min, max); 72 *inRange = false;72 *inRange = false; 73 73 } 74 74 *value = 2.0 * (*value - min) / (max - min) - 1.0; … … 175 175 continue; 176 176 } 177 if (!inRange) {177 if (!inRange) { 178 178 roMask->data.U8[j] = 0xff; 179 179 val->data.F32[i] = NAN; … … 282 282 mask->data.PS_TYPE_MASK_DATA[r] = readout->mask->data.PS_TYPE_MASK_DATA[yIn][xIn]; 283 283 } 284 285 } 286 287 // XXX test288 if (0 && (i == 377) && (j == 80)) {289 FILE *f = fopen ("test.dat", "w"); 290 for (int r = 0; r < inputs->n; r++) { 291 fprintf (f, "%d %d %d ", i, j, mask->data.U8[r]);292 psVector *value = values->data[r];293 for (int tmpj = 0; tmpj < value->n; tmpj++) {294 fprintf (f, "%f ", value->data.F32[tmpj]);295 }296 fprintf (f, "%f\n", pixels->data.F32[r]);297 }298 fclose (f);299 }284 285 } 286 287 // XXX test 288 if (0 && (i == 377) && (j == 80)) { 289 FILE *f = fopen ("test.dat", "w"); 290 for (int r = 0; r < inputs->n; r++) { 291 fprintf (f, "%d %d %d ", i, j, mask->data.U8[r]); 292 psVector *value = values->data[r]; 293 for (int tmpj = 0; tmpj < value->n; tmpj++) { 294 fprintf (f, "%f ", value->data.F32[tmpj]); 295 } 296 fprintf (f, "%f\n", pixels->data.F32[r]); 297 } 298 fclose (f); 299 } 300 300 301 301 if (!psPolynomialMDClipFit(poly, pixels, NULL, mask, maskVal, values, iter, rej)) { … … 426 426 } 427 427 428 bool pmFPAWriteDark(pmFPA *fpa, psFits *fits, p sDB *db, bool blank, bool recurse)428 bool pmFPAWriteDark(pmFPA *fpa, psFits *fits, pmConfig *config, bool blank, bool recurse) 429 429 { 430 430 PS_ASSERT_PTR_NON_NULL(fpa, false); 431 431 PS_ASSERT_FITS_NON_NULL(fits, false); 432 432 433 if (!pmFPAWrite(fpa, fits, db, blank, recurse)) {433 if (!pmFPAWrite(fpa, fits, config, blank, recurse)) { 434 434 psError(PS_ERR_IO, false, "Unable to write FPA dark images"); 435 435 return false; … … 481 481 } 482 482 483 bool pmChipWriteDark(pmChip *chip, psFits *fits, p sDB *db, bool blank, bool recurse)483 bool pmChipWriteDark(pmChip *chip, psFits *fits, pmConfig *config, bool blank, bool recurse) 484 484 { 485 485 PS_ASSERT_PTR_NON_NULL(chip, false); 486 486 PS_ASSERT_FITS_NON_NULL(fits, false); 487 487 488 if (!pmChipWrite(chip, fits, db, blank, recurse)) {488 if (!pmChipWrite(chip, fits, config, blank, recurse)) { 489 489 psError(PS_ERR_IO, false, "Unable to write chip dark images"); 490 490 return false; … … 532 532 } 533 533 534 bool pmCellWriteDark(pmCell *cell, psFits *fits, p sDB *db, bool blank)534 bool pmCellWriteDark(pmCell *cell, psFits *fits, pmConfig *config, bool blank) 535 535 { 536 536 PS_ASSERT_PTR_NON_NULL(cell, false); … … 538 538 539 539 // Allow the usual pmFPAWrite functions to handle the heavy lifting for the images 540 if (!pmCellWrite(cell, fits, db, blank)) {540 if (!pmCellWrite(cell, fits, config, blank)) { 541 541 psError(PS_ERR_UNKNOWN, false, "Unable to write dark cell."); 542 542 return false; … … 623 623 624 624 625 bool pmFPAReadDark(pmFPA *fpa, psFits *fits, p sDB *db)625 bool pmFPAReadDark(pmFPA *fpa, psFits *fits, pmConfig *config) 626 626 { 627 627 PS_ASSERT_PTR_NON_NULL(fpa, false); 628 628 PS_ASSERT_FITS_NON_NULL(fits, false); 629 629 630 if (!pmFPARead(fpa, fits, db)) {630 if (!pmFPARead(fpa, fits, config)) { 631 631 psError(PS_ERR_UNKNOWN, false, "Unable to read dark FPA."); 632 632 return false; … … 658 658 } 659 659 660 bool pmChipReadDark(pmChip *chip, psFits *fits, p sDB *db)660 bool pmChipReadDark(pmChip *chip, psFits *fits, pmConfig *config) 661 661 { 662 662 PS_ASSERT_PTR_NON_NULL(chip, false); 663 663 PS_ASSERT_FITS_NON_NULL(fits, false); 664 664 665 if (!pmChipRead(chip, fits, db)) {665 if (!pmChipRead(chip, fits, config)) { 666 666 psError(PS_ERR_UNKNOWN, false, "Unable to read dark chip."); 667 667 return false; … … 690 690 691 691 692 bool pmCellReadDark(pmCell *cell, psFits *fits, p sDB *db)692 bool pmCellReadDark(pmCell *cell, psFits *fits, pmConfig *config) 693 693 { 694 694 PS_ASSERT_PTR_NON_NULL(cell, false); … … 696 696 697 697 // Allow the usual pmFPARead functions to handle the heavy lifting for the images 698 if (!pmCellRead(cell, fits, db)) {698 if (!pmCellRead(cell, fits, config)) { 699 699 psError(PS_ERR_UNKNOWN, false, "Unable to read dark cell."); 700 700 return false;
Note:
See TracChangeset
for help on using the changeset viewer.
