Changeset 7311 for trunk/psModules/src/camera/pmFPAfile.c
- Timestamp:
- Jun 2, 2006, 3:02:08 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/camera/pmFPAfile.c (modified) (55 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/camera/pmFPAfile.c
r7307 r7311 21 21 #include "pmPSF_IO.h" 22 22 #include "pmFPA_JPEG.h" 23 #define WERROR 0 // if true, warnings in this file are treated as errors 23 24 24 25 static void pmFPAfileFree(pmFPAfile *file) … … 84 85 return file; 85 86 } 87 88 static const char *depthEnumToName(pmFPAdepth depth) 89 { 90 const char *val = NULL; 91 92 switch (depth) { 93 case PM_FPA_DEPTH_NONE: 94 val = "NONE"; 95 break; 96 case PM_FPA_DEPTH_FPA: 97 val = "FPA"; 98 break; 99 case PM_FPA_DEPTH_CHIP: 100 val = "CHIP"; 101 break; 102 case PM_FPA_DEPTH_CELL: 103 val = "CELL"; 104 break; 105 case PM_FPA_DEPTH_READOUT: 106 val = "READOUT"; 107 break; 108 default: 109 psAbort(PS_FILE_LINE, "You can't get here; depth = %d", depth); 110 } 111 112 return val; 113 } 114 115 static pmFPAdepth depthNameToEnum(const char *name) 116 { 117 pmFPAdepth val; 118 119 if (name == NULL) { 120 val = PM_FPA_DEPTH_NONE; 121 } else if (!strcasecmp(name, "FPA")) { 122 val = PM_FPA_DEPTH_FPA; 123 } else if (!strcasecmp(name, "CHIP")) { 124 val = PM_FPA_DEPTH_CHIP; 125 } else if (!strcasecmp(name, "CELL")) { 126 val = PM_FPA_DEPTH_CELL; 127 } else if (!strcasecmp(name, "READOUT")) { 128 val = PM_FPA_DEPTH_READOUT; 129 } else { 130 val = PM_FPA_DEPTH_NONE; 131 } 132 133 return val; 134 } 135 86 136 87 137 pmFPAfile *pmFPAfileDefine(psMetadata *files, psMetadata *camera, pmFPA *fpa, char *name) … … 94 144 95 145 bool status; 96 char *depth;97 146 char *type; 98 147 … … 100 149 psMetadata *filerules = psMetadataLookupPtr (&status, camera, "FILERULES"); 101 150 if (filerules == NULL) { 102 psError StackPrint(stderr, "Can't find FILERULES in the CAMERA configuration!\n");151 psError(PS_ERR_IO, true, "Can't find FILERULES in the CAMERA configuration!"); 103 152 return NULL; 104 153 } … … 107 156 // check for alias name (type == STR, name is aliased name) 108 157 char *realname = psMetadataLookupStr (&status, filerules, name); 109 if ( realname == NULL)158 if (!realname || strlen(realname) == 0) { 110 159 realname = name; 160 } 111 161 112 162 psMetadata *data = psMetadataLookupPtr (&status, filerules, realname); 113 163 if (data == NULL) { 114 psError StackPrint(stderr, "Can't find file concept %s!\n", name);164 psError(PS_ERR_IO, true, "Can't find file concept %s!", name); 115 165 return NULL; 116 166 } … … 126 176 file->extxtra = psMemIncrRefCounter(psMetadataLookupStr (&status, data, "EXTNAME.XTRA")); 127 177 128 file->fileDepth = PM_FPA_DEPTH_NONE; 129 depth = psMetadataLookupStr (&status, data, "FILE.DEPTH"); 130 if (depth != NULL) { 131 if (!strcasecmp (depth, "FPA")) { 132 file->fileDepth = PM_FPA_DEPTH_FPA; 133 } 134 if (!strcasecmp (depth, "CHIP")) { 135 file->fileDepth = PM_FPA_DEPTH_CHIP; 136 } 137 if (!strcasecmp (depth, "CELL")) { 138 file->fileDepth = PM_FPA_DEPTH_CELL; 139 } 140 if (!strcasecmp (depth, "READOUT")) { 141 file->fileDepth = PM_FPA_DEPTH_READOUT; 142 } 143 } 178 file->fileDepth = depthNameToEnum(psMetadataLookupStr(&status, data, "FILE.DEPTH")); 144 179 if (file->fileDepth == PM_FPA_DEPTH_NONE) { 145 180 psLogMsg (__func__, 3, "warning: FILE.DEPTH is not set for %s\n", name); 146 181 } 147 182 148 file->dataDepth = PM_FPA_DEPTH_NONE; 149 depth = psMetadataLookupStr (&status, data, "DATA.DEPTH"); 150 if (depth != NULL) { 151 if (!strcasecmp (depth, "FPA")) { 152 file->dataDepth = PM_FPA_DEPTH_FPA; 153 } 154 if (!strcasecmp (depth, "CHIP")) { 155 file->dataDepth = PM_FPA_DEPTH_CHIP; 156 } 157 if (!strcasecmp (depth, "CELL")) { 158 file->dataDepth = PM_FPA_DEPTH_CELL; 159 } 160 if (!strcasecmp (depth, "READOUT")) { 161 file->dataDepth = PM_FPA_DEPTH_READOUT; 162 } 163 } 183 file->dataDepth = depthNameToEnum(psMetadataLookupStr (&status, data, "DATA.DEPTH")); 164 184 if (file->dataDepth == PM_FPA_DEPTH_NONE) { 165 185 psLogMsg (__func__, 3, "warning: DATA.DEPTH is not set for %s\n", name); … … 240 260 pmFPAfile *file = pmFPAfileDefine (files, format, fpa, name); 241 261 psFree (fpa); 262 if (!file) { 263 psErrorStackPrint(stderr, "file %s not defined\n", name); 264 return NULL; 265 } 242 266 return file; 243 267 } … … 257 281 258 282 if (file->state & PM_FPA_STATE_INACTIVE) { 283 psError(PS_ERR_IO, true, "Atempted to read an inactive file"); 259 284 return false; 260 285 } … … 265 290 266 291 if (file->mode == PM_FPA_MODE_NONE) { 292 psError(PS_ERR_IO, true, "File is mode PM_FPA_MODE_NONE"); 267 293 return false; 268 294 } 269 295 if (file->mode == PM_FPA_MODE_INTERNAL) { 296 psError(PS_ERR_IO, true, "File is mode PM_FPA_MODE_INTERNAL"); 270 297 return false; 271 298 } … … 279 306 // determine the file name 280 307 file->filename = pmFPAfileNameFromRule (file->filerule, file, view); 281 if (file->filename == NULL) 282 return false; 308 if (file->filename == NULL) { 309 psError(PS_ERR_IO, true, "Filename is NULL"); 310 return false; 311 } 283 312 284 313 // indirect filenames … … 288 317 file->filename = psMetadataLookupStr (&status, file->names, extra); 289 318 psFree (extra); 290 if (file->filename == NULL) 319 if (file->filename == NULL) { 291 320 psAbort ("pmFPAfile", "no file specified"); 321 } 292 322 // psMetadataLookupStr just returns a view, file->filename must be protected 293 323 psMemIncrRefCounter (file->filename); … … 298 328 // file->filename = pmDetrendSelect (extra); 299 329 psFree (extra); 300 if (file->filename == NULL) 330 if (file->filename == NULL) { 301 331 psAbort ("pmFPAfile", "no file specified"); 332 } 302 333 psMemIncrRefCounter (file->filename); 303 334 } … … 309 340 psTrace ("pmFPAfile", 5, "opening %s (type: %d)\n", file->filename, file->type); 310 341 file->fits = psFitsOpen (file->filename, mode); 311 if (file->fits == NULL) 312 psAbort (__func__, "error opening file %s\n", file->filename); 342 if (file->fits == NULL) { 343 psError(PS_ERR_IO, false, "error opening file %s\n", file->filename); 344 return false; 345 } 313 346 file->state = PM_FPA_STATE_OPEN; 314 347 break; … … 325 358 326 359 default: 327 fprintf (stderr, "warning:type mismatch for %s : %d\n", file->filename, file->type);360 psError(PS_ERR_IO, true, "type mismatch for %s : %d\n", file->filename, file->type); 328 361 return false; 329 362 } … … 336 369 PS_ASSERT_PTR_NON_NULL(view, false); 337 370 338 if (file->state & PM_FPA_STATE_INACTIVE) 339 return false; 340 341 if (file->mode != PM_FPA_MODE_READ) 342 return false; 371 if (file->state & PM_FPA_STATE_INACTIVE) { 372 psError(PS_ERR_IO, true, "Atempted to read an inactive file"); 373 return false; 374 } 375 376 if (file->mode != PM_FPA_MODE_READ) { 377 psError(PS_ERR_IO, true, "File isn't mode PM_FPA_MODE_READ"); 378 return false; 379 } 343 380 344 381 // get the current depth … … 347 384 // do we need to open this file? 348 385 if (depth == file->fileDepth) { 349 pmFPAfileOpen (file, view); 386 if (!pmFPAfileOpen (file, view)) { 387 psError(PS_ERR_IO, false, "Opening file"); 388 return false; 389 } 350 390 } 351 391 352 392 // do we need to read this file? 353 if (depth != file->dataDepth) 354 return false; 393 if (depth != file->dataDepth) { 394 #if WERROR 395 psError(PS_ERR_IO, true, "Desired depth %s doesn't match dataDepth %s", 396 depthEnumToName(depth), depthEnumToName(file->dataDepth)); 397 return false; 398 #else 399 400 return true; 401 #endif 402 403 } 355 404 356 405 switch (file->type) { … … 359 408 psTrace ("pmFPAfile", 5, "reading %s (type: %d)\n", file->filename, file->type); 360 409 } else { 361 psTrace ("pmFPAfile", 5, "skipping %s (type: %d)\n", file->filename, file->type); 410 psError(PS_ERR_UNKNOWN, false, "skipping %s (type: %d)\n", file->filename, file->type); 411 return false; 362 412 } 363 413 break; … … 381 431 382 432 default: 383 fprintf (stderr, "warning: type mismatch\n");433 psError(PS_ERR_IO, true, "warning: type mismatch; saw type %d", file->type); 384 434 return false; 385 435 } … … 393 443 394 444 if (file->state & PM_FPA_STATE_INACTIVE) { 445 psError(PS_ERR_IO, true, "Atempted to write an inactive file"); 395 446 return false; 396 447 } 397 448 398 449 if (file->mode != PM_FPA_MODE_WRITE) { 450 psError(PS_ERR_IO, true, "File isn't mode PM_FPA_MODE_WRITE"); 399 451 return false; 400 452 } … … 404 456 405 457 // do we need to write this file? 406 if (depth != file->dataDepth) 407 return false; 458 if (depth != file->dataDepth) { 459 #if WERROR 460 psError(PS_ERR_IO, true, "Desired depth %s doesn't match dataDepth %s", 461 depthEnumToName(depth), depthEnumToName(file->dataDepth)); 462 return false; 463 #else 464 465 return true; 466 #endif 467 468 } 408 469 409 470 // do we need to open this file? 410 471 if (depth >= file->fileDepth) { 411 pmFPAfileOpen (file, view); 472 if (!pmFPAfileOpen (file, view)) { 473 psError(PS_ERR_IO, false, "failed to open %s", file->filename); 474 return false; 475 } 412 476 } 413 477 … … 423 487 case PM_FPA_FILE_CMP: 424 488 case PM_FPA_FILE_CMF: 425 pmFPAviewWriteObjects (view, file); 426 psTrace ("pmFPAfile", 5, "wrote object %s (fpa: %p)\n", file->filename, file->fpa); 489 psTrace ("pmFPAfile", 5, "writing object %s (fpa: %p)\n", file->filename, file->fpa); 490 if (!pmFPAviewWriteObjects (view, file)) { 491 psError(PS_ERR_IO, false, "Failed to write object %s", file->filename); 492 return false; 493 } 494 427 495 break; 428 496 … … 451 519 452 520 if (file->state & PM_FPA_STATE_INACTIVE) { 453 return false; 454 } 455 if (file->mode != PM_FPA_MODE_WRITE) 456 return false; 521 psError(PS_ERR_IO, true, "Atempted to create an inactive file"); 522 return false; 523 } 524 if (file->mode != PM_FPA_MODE_WRITE) { 525 psError(PS_ERR_IO, true, "File isn't mode PM_FPA_MODE_WRITE"); 526 return false; 527 } 457 528 458 529 // get the current depth 459 530 pmFPAdepth depth = pmFPAviewDepth (view); 460 531 532 // XXX is this a sufficient check to avoid creating elements? 533 if (file->src == NULL) { 534 #if WERROR 535 psError(PS_ERR_IO, true, "file->src is NULL"); 536 return false; 537 #else 538 539 return true; 540 #endif 541 542 } 543 461 544 // do we need to write this file? 462 if (depth != file->dataDepth) 463 return false; 464 465 // XXX is this a sufficient check to avoid creating elements? 466 if (file->src == NULL) 467 return false; 545 if (depth != file->dataDepth) { 546 psError(PS_ERR_IO, true, "Desired depth %s doesn't match dataDepth %s", 547 depthEnumToName(depth), depthEnumToName(file->dataDepth)); 548 return false; 549 } 468 550 469 551 switch (file->type) { … … 484 566 485 567 default: 486 fprintf (stderr, "warning: type mismatch\n");568 psError(PS_ERR_IO, true, "Unsupported type: %d", file->type); 487 569 return false; 488 570 } … … 496 578 497 579 if (file->state & PM_FPA_STATE_INACTIVE) { 580 psError(PS_ERR_IO, true, "Atempted to close an inactive file"); 498 581 return false; 499 582 } … … 505 588 pmFPAdepth depth = pmFPAviewDepth (view); 506 589 if (file->fileDepth != depth) { 507 return false; 590 #if WERROR 591 psError(PS_ERR_IO, true, "Desired depth %s doesn't match fileDepth %s", 592 depthEnumToName(depth), depthEnumToName(file->fileDepth)); 593 return false; 594 #else 595 596 return true; 597 #endif 598 508 599 } 509 600 … … 531 622 532 623 default: 533 fprintf (stderr, "warning: type mismatch\n");624 psError(PS_ERR_IO, true, "type mismatch: %d", file->type); 534 625 return false; 535 626 } … … 560 651 bool status = false; 561 652 pmFPAfile *file = psMetadataLookupPtr (&status, files, name); 653 if (!status) { 654 psError(PS_ERR_IO, true, "Failed to look up file %s", name); 655 return false; 656 } 562 657 if (!file) { 658 psError(PS_ERR_IO, true, "file %s is NULL", name); 563 659 return false; 564 660 } … … 583 679 pmFPAfile *file = item->data.V; 584 680 585 if (place == PM_FPA_BEFORE) { 586 pmFPAfileRead (file, view); 587 pmFPAfileCreate (file, view); 588 } else { 589 pmFPAfileWrite (file, view); 590 pmFPAfileClose (file, view); 681 switch (place) { 682 case PM_FPA_BEFORE: 683 if (file->mode == PM_FPA_MODE_READ && !pmFPAfileRead (file, view)) { 684 psError(PS_ERR_IO, false, "failed in FPA_BEFORE block for %s", file->name); 685 psFree(iter); 686 return false; 687 } 688 if (file->mode == PM_FPA_MODE_WRITE && !pmFPAfileCreate(file, view)) { 689 psError(PS_ERR_IO, false, "failed in FPA_BEFORE block for %s", file->name); 690 psFree(iter); 691 return false; 692 } 693 break; 694 case PM_FPA_AFTER: 695 if (file->mode == PM_FPA_MODE_WRITE && !pmFPAfileWrite (file, view)) { 696 psError(PS_ERR_IO, false, "failed in FPA_AFTER block for %s", file->name); 697 psFree(iter); 698 return false; 699 } 700 if (!pmFPAfileClose(file, view)) { 701 psError(PS_ERR_IO, false, "failed in FPA_AFTER block for %s", file->name); 702 psFree(iter); 703 return false; 704 } 705 break; 706 default: 707 psAbort(PS_FILE_LINE, "You can't get here"); 591 708 } 592 709 } 593 710 psFree (iter); 711 594 712 return true; 595 713 } … … 627 745 628 746 pmFPAfile *file = psMetadataLookupPtr (&status, files, name); 629 if (file == NULL) 630 return false; 631 632 if (file->mode != PM_FPA_MODE_INTERNAL) 633 return false; 747 if (file == NULL) { 748 psError(PS_ERR_IO, true, "Failed to lookup %s", name); 749 return false; 750 } 751 752 if (file->mode != PM_FPA_MODE_INTERNAL) { 753 psError(PS_ERR_IO, true, "File %s has mode %d != PM_FPA_MODE_INTERNAL", name, file->mode); 754 return false; 755 } 634 756 635 757 psMetadataRemoveKey (files, name); … … 648 770 649 771 pmFPAfile *file = psMetadataLookupPtr (&status, files, name); 650 if (file == NULL) 651 return NULL; 772 if (file == NULL) { 773 return NULL; 774 } 652 775 653 776 // internal files have the readout as a separate element: … … 677 800 678 801 if (view->chip >= fpa->chips->n) { 802 psError(PS_ERR_IO, true, "Requested chip == %d >= fpa->chips->n == %d", view->chip, fpa->chips->n); 679 803 return false; 680 804 } … … 687 811 688 812 if (view->cell >= chip->cells->n) { 813 psError(PS_ERR_IO, true, "Requested cell == %d >= chip->cells->n == %d", view->cell, chip->cells->n); 689 814 return false; 690 815 } … … 695 820 return status; 696 821 } 822 psError(PS_ERR_UNKNOWN, true, "Returning false"); 697 823 return false; 698 824 699 825 // XXX pmReadoutRead, pmReadoutReadSegement disabled for now 700 # if (0) 701 702 if (view->readout >= cell->readouts->n) { 703 return false; 704 } 826 #if 0 827 828 if (view->readout >= cell->readouts->n) { 829 psError(PS_ERR_IO, true, "Requested readout == %d >= cell->readouts->n == %d", 830 view->readout, cell->readouts->n); 831 return false; 832 } 705 833 pmReadout *readout = cell->readouts->data[view->readout]; 706 834 … … 711 839 } 712 840 return true; 713 # endif841 #endif 714 842 } 715 843 … … 731 859 732 860 if (view->chip >= fpa->chips->n) { 861 psError(PS_ERR_IO, true, "Requested chip == %d >= fpa->chips->n == %d", view->chip, fpa->chips->n); 733 862 return false; 734 863 } … … 757 886 758 887 if (view->cell >= chip->cells->n) { 888 psError(PS_ERR_IO, true, "Requested cell == %d >= chip->cells->n == %d", view->cell, chip->cells->n); 759 889 return false; 760 890 } … … 762 892 763 893 if (view->readout == -1) { 764 pmCellWrite (cell, fits, NULL, true);765 return true;766 }894 return pmCellWrite (cell, fits, NULL, true); 895 } 896 psError(PS_ERR_UNKNOWN, true, "Returning false"); 767 897 return false; 768 898 769 899 // XXX disable readout write for now 770 # if (0) 771 772 if (view->readout >= cell->readouts->n) { 773 return false; 774 } 900 #if 0 901 902 if (view->readout >= cell->readouts->n) { 903 psError(PS_ERR_IO, true, "Requested readout == %d >= cell->readouts->n == %d", 904 view->readout, cell->readouts->n); 905 return false; 906 } 775 907 pmReadout *readout = cell->readouts->data[view->readout]; 776 908 … … 781 913 } 782 914 return true; 783 # endif915 #endif 784 916 } 785 917 … … 808 940 psArray *infiles = psMetadataLookupPtr(&status, config->arguments, argname); 809 941 if (!status) { 942 psError(PS_ERR_IO, false, "Failed to read %s from metadata\n", argname); 810 943 return NULL; 811 944 } 812 945 if (infiles->n < 1) { 946 psError(PS_ERR_IO, false, "Found n == %d files in %s from metadata\n", infiles->n, argname); 813 947 return NULL; 814 948 } … … 819 953 phu = psFitsReadHeader (NULL, fits); 820 954 format = pmConfigCameraFormatFromHeader (config, phu); 821 psFitsClose (fits); 955 psFitsClose (fits); // don't close phu; we'll use it below 956 if (!format) { 957 psError(PS_ERR_IO, false, "Failed to read CCD format from %s\n", infiles->data[0]); 958 psFree(phu); 959 return NULL; 960 } 822 961 823 962 // build the template fpa, set up the basic view 824 963 fpa = pmFPAConstruct (config->camera); 964 if (!fpa) { 965 psError(PS_ERR_IO, false, "Failed to construct FPA from %s", infiles->data[0]); 966 return NULL; 967 } 825 968 826 969 // load the given filerule (from config->camera) and associate it with the fpa … … 828 971 file = pmFPAfileDefine (config->files, config->camera, fpa, filename); 829 972 if (!file) { 830 psErrorStackPrint(stderr, "file %s not defined\n", filename); 973 psError(PS_ERR_IO, false, "file %s not defined", filename); 974 psFree(phu); 831 975 psFree (fpa); 832 976 psFree (format); … … 854 998 // set the view to the corresponding entry for this phu 855 999 pmFPAview *view = pmFPAAddSourceFromHeader (fpa, phu, format); 1000 if (!view) { 1001 psError(PS_ERR_IO, false, "Failed to set view from file %s", infiles->data[i]); 1002 psFree(phu); 1003 psFree (fpa); 1004 psFree (format); 1005 return NULL; 1006 } 856 1007 857 1008 // XXX is this the correct psMD to save the filename? … … 871 1022 872 1023 // XXX this this function through, then finish 873 # if 01024 #if 0 874 1025 // look for the given name on the argument list. 875 1026 // returns the file (a view to the one saved on config->files) … … 925 1076 file = pmFPAfileDefine (config->files, config->camera, fpa, filename); 926 1077 if (!file) { 927 psError StackPrint(stderr, "file %s not defined\n", filename);1078 psError(PS_ERR_IO, false, "file %s not defined", filename); 928 1079 psFree (fpa); 929 1080 psFree (format); … … 966 1117 return file; 967 1118 } 968 # endif1119 #endif 969 1120 970 1121 // create a new output pmFPAfile based on an existing FPA … … 979 1130 pmFPA *fpa = pmFPAConstruct (config->camera); 980 1131 pmFPAfile *file = pmFPAfileDefine (config->files, config->camera, fpa, filename); 1132 if (!file) { 1133 psErrorStackPrint(stderr, "file %s not defined\n", filename); 1134 return NULL; 1135 } 981 1136 file->src = src; // inherit output elements from this source pmFPA 982 1137 file->xBin = xBin; … … 1014 1169 file = pmFPAfileDefine (config->files, config->camera, NULL, filename); 1015 1170 if (!file) { 1016 psError StackPrint(stderr, "file %s not defined\n", filename);1171 psError(PS_ERR_IO, false, "file %s not defined\n", filename); 1017 1172 return NULL; 1018 1173 } … … 1120 1275 newName = psStringCopy (rule); 1121 1276 1277 if (strstr (newName, "{OUTPUT}") != NULL) { 1278 char *name = psMetadataLookupStr (NULL, file->names, "OUTPUT"); 1279 if (name != NULL) { 1280 newName = psStringSubstitute (newName, name, "{OUTPUT}"); 1281 } 1282 } 1122 1283 if (strstr (newName, "{CHIP.NAME}") != NULL) { 1123 1284 pmChip *chip = pmFPAviewThisChip (view, file->fpa); … … 1144 1305 } 1145 1306 } 1146 if (strstr (newName, "{OUTPUT}") != NULL) {1147 char *name = psMetadataLookupStr (NULL, file->names, "OUTPUT");1148 if (name != NULL) {1149 newName = psStringSubstitute (newName, name, "{OUTPUT}");1150 }1151 }1152 1307 return newName; 1153 1308 } … … 1167 1322 } 1168 1323 if (view->chip >= in->chips->n) { 1324 psError(PS_ERR_IO, true, "Requested chip == %d >= in->chips->n == %d", view->chip, in->chips->n); 1169 1325 return false; 1170 1326 } … … 1177 1333 } 1178 1334 if (view->cell >= inChip->cells->n) { 1335 psError(PS_ERR_IO, true, "Requested cell == %d>= inChip->cells->n == %d", 1336 view->cell, inChip->cells->n); 1179 1337 return false; 1180 1338 } … … 1186 1344 return true; 1187 1345 } 1346 psError(PS_ERR_UNKNOWN, true, "Returning false"); 1188 1347 return false; 1189 1348 … … 1203 1362 if (view->chip == -1) { 1204 1363 pmFPAAddSourceFromView (out, view, format); 1205 pmFPACopyStructure (out, in, xBin, yBin); 1206 return true; 1364 return pmFPACopyStructure (out, in, xBin, yBin); 1207 1365 } 1208 1366 if (view->chip >= in->chips->n) { 1367 psError(PS_ERR_IO, true, "Requested chip == %d >= in->chips->n == %d", view->chip, in->chips->n); 1209 1368 return false; 1210 1369 } … … 1214 1373 if (view->cell == -1) { 1215 1374 pmFPAAddSourceFromView (out, view, format); 1216 pmChipCopyStructure (outChip, inChip, xBin, yBin); 1217 return true; 1375 return pmChipCopyStructure (outChip, inChip, xBin, yBin); 1218 1376 } 1219 1377 if (view->cell >= inChip->cells->n) { 1378 psError(PS_ERR_IO, true, "Requested cell == %d>= inChip->cells->n == %d", 1379 view->cell, inChip->cells->n); 1220 1380 return false; 1221 1381 } … … 1225 1385 if (view->readout == -1) { 1226 1386 pmFPAAddSourceFromView (out, view, format); 1227 pmCellCopyStructure (outCell, inCell, xBin, yBin);1228 return true;1229 }1387 return pmCellCopyStructure (outCell, inCell, xBin, yBin); 1388 } 1389 psError(PS_ERR_UNKNOWN, true, "Returning false"); 1230 1390 return false; 1231 1391
Note:
See TracChangeset
for help on using the changeset viewer.
