Changeset 18030
- Timestamp:
- Jun 9, 2008, 1:00:32 PM (18 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
-
ppMerge/src/ppMergeFiles.c (modified) (3 diffs)
-
ppMerge/src/ppMergeLoop.c (modified) (2 diffs)
-
ppStack/src/ppStackLoop.c (modified) (4 diffs)
-
psModules/src/camera/pmFPARead.c (modified) (13 diffs)
-
psModules/src/camera/pmFPARead.h (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppMerge/src/ppMergeFiles.c
r17227 r18030 34 34 { 35 35 pmFPAfile *file = pmFPAfileSelectSingle(config->files, "PPMERGE.INPUT", num); 36 if (!pmReadoutReadChunk(readout, file->fits, 0, rows, 0 )) {36 if (!pmReadoutReadChunk(readout, file->fits, 0, rows, 0, config->database)) { 37 37 psError(PS_ERR_UNKNOWN, false, "Unable to read readout."); 38 38 return false; … … 41 41 if (psMetadataLookupBool(&mdok, config->arguments, "INPUTS.MASKS")) { 42 42 pmFPAfile *file = pmFPAfileSelectSingle(config->files, "PPMERGE.INPUT.MASK", num); 43 if (!pmReadoutReadChunkMask(readout, file->fits, 0, rows, 0 )) {43 if (!pmReadoutReadChunkMask(readout, file->fits, 0, rows, 0, config->database)) { 44 44 psError(PS_ERR_UNKNOWN, false, "Unable to read readout mask."); 45 45 return false; … … 48 48 if (psMetadataLookupBool(&mdok, config->arguments, "INPUTS.WEIGHTS")) { 49 49 pmFPAfile *file = pmFPAfileSelectSingle(config->files, "PPMERGE.INPUT.WEIGHT", num); 50 if (!pmReadoutReadChunkWeight(readout, file->fits, 0, rows, 0 )) {50 if (!pmReadoutReadChunkWeight(readout, file->fits, 0, rows, 0, config->database)) { 51 51 psError(PS_ERR_UNKNOWN, false, "Unable to read readout weight."); 52 52 return false; -
trunk/ppMerge/src/ppMergeLoop.c
r18025 r18030 165 165 #define READ_CHUNK(NAME,TYPE) { \ 166 166 pmFPAfile *file = pmFPAfileSelectSingle(config->files, NAME, i); \ 167 if (!pmReadoutReadChunk##TYPE(inRO, file->fits, 0, rows, 0 )) { \167 if (!pmReadoutReadChunk##TYPE(inRO, file->fits, 0, rows, 0, config->database)) { \ 168 168 psError(PS_ERR_IO, false, "Unable to read chunk %d for file %s %d", \ 169 169 numChunk, NAME, i); \ … … 219 219 #define MORE_CHUNK(NAME,TYPE) { \ 220 220 pmFPAfile *file = pmFPAfileSelectSingle(config->files, NAME, i); \ 221 more &= pmReadoutMore##TYPE(inRO, file->fits, 0, rows ); \221 more &= pmReadoutMore##TYPE(inRO, file->fits, 0, rows, config->database); \ 222 222 } 223 223 -
trunk/ppStack/src/ppStackLoop.c
r17682 r18030 430 430 } 431 431 432 if (!pmReadoutReadChunk(readout, imageFits->data[i], 0, numScans, overlap) || 433 !pmReadoutReadChunkMask(readout, maskFits->data[i], 0, numScans, overlap) || 434 !pmReadoutReadChunkWeight(readout, weightFits->data[i], 0, numScans, overlap)) { 432 if (!pmReadoutReadChunk(readout, imageFits->data[i], 0, numScans, overlap, 433 config->database) || 434 !pmReadoutReadChunkMask(readout, maskFits->data[i], 0, numScans, overlap, 435 config->database) || 436 !pmReadoutReadChunkWeight(readout, weightFits->data[i], 0, numScans, overlap, 437 config->database)) { 435 438 psError(PS_ERR_IO, false, "Unable to read chunk %d for file %d", numChunk, i); 436 439 psFree(readouts); … … 471 474 continue; 472 475 } 473 more &= pmReadoutMore(readout, imageFits->data[i], 0, numScans );474 more &= pmReadoutMoreMask(readout, maskFits->data[i], 0, numScans );475 more &= pmReadoutMoreWeight(readout, weightFits->data[i], 0, numScans );476 more &= pmReadoutMore(readout, imageFits->data[i], 0, numScans, config->database); 477 more &= pmReadoutMoreMask(readout, maskFits->data[i], 0, numScans, config->database); 478 more &= pmReadoutMoreWeight(readout, weightFits->data[i], 0, numScans, config->database); 476 479 } 477 480 } … … 551 554 assert(readout); 552 555 553 if (!pmReadoutReadChunk(readout, imageFits->data[i], 0, numScans, 0) || 554 !pmReadoutReadChunkMask(readout, maskFits->data[i], 0, numScans, 0) || 555 !pmReadoutReadChunkWeight(readout, weightFits->data[i], 0, numScans, 0)) { 556 if (!pmReadoutReadChunk(readout, imageFits->data[i], 0, numScans, 0, config->database) || 557 !pmReadoutReadChunkMask(readout, maskFits->data[i], 0, numScans, 0, config->database) || 558 !pmReadoutReadChunkWeight(readout, weightFits->data[i], 0, numScans, 0, 559 config->database)) { 556 560 psError(PS_ERR_IO, false, "Unable to read chunk %d for file %d", numChunk, i); 557 561 psFree(readouts); … … 593 597 continue; 594 598 } 595 more &= pmReadoutMore(readout, imageFits->data[i], 0, numScans );596 more &= pmReadoutMoreMask(readout, maskFits->data[i], 0, numScans );597 more &= pmReadoutMoreWeight(readout, weightFits->data[i], 0, numScans );599 more &= pmReadoutMore(readout, imageFits->data[i], 0, numScans, config->database); 600 more &= pmReadoutMoreMask(readout, maskFits->data[i], 0, numScans, config->database); 601 more &= pmReadoutMoreWeight(readout, weightFits->data[i], 0, numScans, config->database); 598 602 } 599 603 } -
trunk/psModules/src/camera/pmFPARead.c
r18026 r18030 97 97 return false; 98 98 } 99 if (!pmConceptsReadCell(cell, PM_CONCEPT_SOURCE_HEADER | PM_CONCEPT_SOURCE_CELLS | 100 PM_CONCEPT_SOURCE_DEFAULTS | PM_CONCEPT_SOURCE_DATABASE, true, NULL)) { 99 if (!pmConceptsReadCell(cell, PM_CONCEPT_SOURCE_HEADER | PM_CONCEPT_SOURCE_CELLS, true, NULL)) { 101 100 psError(PS_ERR_IO, false, "Failed to read concepts for cell.\n"); 102 101 return false; … … 142 141 pmReadout *readout, // Readout of interest 143 142 int numScans, // Number of scans to read at a time 144 fpaReadType type // Type of image 143 fpaReadType type, // Type of image 144 psDB *db // Database handle for concepts 145 145 ) 146 146 { … … 151 151 psImage *image = *readoutImageByType(readout, type); // Appropriate image from readout 152 152 153 if (!pmConceptsReadCell(readout->parent, PM_CONCEPT_SOURCE_DEFAULTS | PM_CONCEPT_SOURCE_DATABASE, 154 true, db)) { 155 psError(PS_ERR_IO, false, "Failed to read concepts for cell."); 156 return false; 157 } 153 158 // Header and concepts have been read by a call to cellNumReadouts(), so we can just assume they're there. 154 159 … … 202 207 int z, // Plane number 203 208 int numScans, // Number of scans to read at a time 204 fpaReadType type // Type of image 209 fpaReadType type, // Type of image 210 psDB *db // Database handle for concepts 205 211 ) 206 212 { … … 230 236 int next; // Next position 231 237 int last; // Last position 232 if (!readoutScanProperties(&next, &last, readout, numScans, type )) {238 if (!readoutScanProperties(&next, &last, readout, numScans, type, db)) { 233 239 psError(PS_ERR_UNKNOWN, false, "Unable to determine readout properties."); 234 240 return false; … … 387 393 int numScans, // Number of scans (row or col depends on CELL.READDIR); 0 for all 388 394 int overlap, // Number of scans (row/col) to overlap between scans 389 fpaReadType type // Type of image 395 fpaReadType type, // Type of image 396 psDB *db // Database handle for concepts 390 397 ) 391 398 { … … 417 424 int next; // Next position 418 425 int last; // Last position 419 if (!readoutScanProperties(&next, &last, readout, numScans, type )) {426 if (!readoutScanProperties(&next, &last, readout, numScans, type, db)) { 420 427 psError(PS_ERR_UNKNOWN, false, "Unable to determine readout properties."); 421 428 return false; … … 888 895 889 896 890 bool pmReadoutMore(pmReadout *readout, psFits *fits, int z, int numScans )897 bool pmReadoutMore(pmReadout *readout, psFits *fits, int z, int numScans, psDB *db) 891 898 { 892 899 PS_ASSERT_PTR_NON_NULL(readout, false); 893 900 PS_ASSERT_FITS_NON_NULL(fits, false); 894 901 895 return readoutMore(readout, fits, z, numScans, FPA_READ_TYPE_IMAGE );896 } 897 898 bool pmReadoutReadChunk(pmReadout *readout, psFits *fits, int z, int numScans, int overlap )902 return readoutMore(readout, fits, z, numScans, FPA_READ_TYPE_IMAGE, db); 903 } 904 905 bool pmReadoutReadChunk(pmReadout *readout, psFits *fits, int z, int numScans, int overlap, psDB *db) 899 906 { 900 907 PS_ASSERT_PTR_NON_NULL(readout, false); … … 903 910 PS_ASSERT_INT_NONNEGATIVE(numScans, false); 904 911 905 return readoutReadChunk(readout, fits, z, numScans, overlap, FPA_READ_TYPE_IMAGE );906 } 907 908 bool pmReadoutRead(pmReadout *readout, psFits *fits, int z )912 return readoutReadChunk(readout, fits, z, numScans, overlap, FPA_READ_TYPE_IMAGE, db); 913 } 914 915 bool pmReadoutRead(pmReadout *readout, psFits *fits, int z, psDB *db) 909 916 { 910 917 PS_ASSERT_PTR_NON_NULL(readout, false); 911 918 PS_ASSERT_FITS_NON_NULL(fits, false); 912 919 913 return readoutReadChunk(readout, fits, z, 0, 0, FPA_READ_TYPE_IMAGE );920 return readoutReadChunk(readout, fits, z, 0, 0, FPA_READ_TYPE_IMAGE, db); 914 921 } 915 922 … … 951 958 ////////////////////////////////////////////////////////////////////////////////////////////////////////////// 952 959 953 bool pmReadoutMoreMask(pmReadout *readout, psFits *fits, int z, int numScans )960 bool pmReadoutMoreMask(pmReadout *readout, psFits *fits, int z, int numScans, psDB *db) 954 961 { 955 962 PS_ASSERT_PTR_NON_NULL(readout, false); 956 963 PS_ASSERT_FITS_NON_NULL(fits, false); 957 964 958 return readoutMore(readout, fits, z, numScans, FPA_READ_TYPE_MASK );959 } 960 961 bool pmReadoutReadChunkMask(pmReadout *readout, psFits *fits, int z, int numScans, int overlap )965 return readoutMore(readout, fits, z, numScans, FPA_READ_TYPE_MASK, db); 966 } 967 968 bool pmReadoutReadChunkMask(pmReadout *readout, psFits *fits, int z, int numScans, int overlap, psDB *db) 962 969 { 963 970 PS_ASSERT_PTR_NON_NULL(readout, false); … … 966 973 PS_ASSERT_INT_NONNEGATIVE(numScans, false); 967 974 968 return readoutReadChunk(readout, fits, z, numScans, overlap, FPA_READ_TYPE_MASK );969 } 970 971 bool pmReadoutReadMask(pmReadout *readout, psFits *fits, int z )975 return readoutReadChunk(readout, fits, z, numScans, overlap, FPA_READ_TYPE_MASK, db); 976 } 977 978 bool pmReadoutReadMask(pmReadout *readout, psFits *fits, int z, psDB *db) 972 979 { 973 980 PS_ASSERT_PTR_NON_NULL(readout, false); 974 981 PS_ASSERT_FITS_NON_NULL(fits, false); 975 982 976 return readoutReadChunk(readout, fits, z, 0, 0, FPA_READ_TYPE_MASK );983 return readoutReadChunk(readout, fits, z, 0, 0, FPA_READ_TYPE_MASK, db); 977 984 } 978 985 … … 1005 1012 ////////////////////////////////////////////////////////////////////////////////////////////////////////////// 1006 1013 1007 bool pmReadoutMoreWeight(pmReadout *readout, psFits *fits, int z, int numScans )1014 bool pmReadoutMoreWeight(pmReadout *readout, psFits *fits, int z, int numScans, psDB *db) 1008 1015 { 1009 1016 PS_ASSERT_PTR_NON_NULL(readout, false); 1010 1017 PS_ASSERT_FITS_NON_NULL(fits, false); 1011 1018 1012 return readoutMore(readout, fits, z, numScans, FPA_READ_TYPE_WEIGHT );1013 } 1014 1015 bool pmReadoutReadChunkWeight(pmReadout *readout, psFits *fits, int z, int numScans, int overlap )1019 return readoutMore(readout, fits, z, numScans, FPA_READ_TYPE_WEIGHT, db); 1020 } 1021 1022 bool pmReadoutReadChunkWeight(pmReadout *readout, psFits *fits, int z, int numScans, int overlap, psDB *db) 1016 1023 { 1017 1024 PS_ASSERT_PTR_NON_NULL(readout, false); … … 1020 1027 PS_ASSERT_INT_NONNEGATIVE(numScans, false); 1021 1028 1022 return readoutReadChunk(readout, fits, z, numScans, overlap, FPA_READ_TYPE_WEIGHT );1023 } 1024 1025 bool pmReadoutReadWeight(pmReadout *readout, psFits *fits, int z )1029 return readoutReadChunk(readout, fits, z, numScans, overlap, FPA_READ_TYPE_WEIGHT, db); 1030 } 1031 1032 bool pmReadoutReadWeight(pmReadout *readout, psFits *fits, int z, psDB *db) 1026 1033 { 1027 1034 PS_ASSERT_PTR_NON_NULL(readout, false); 1028 1035 PS_ASSERT_FITS_NON_NULL(fits, false); 1029 1036 1030 return readoutReadChunk(readout, fits, z, 0, 0, FPA_READ_TYPE_WEIGHT );1037 return readoutReadChunk(readout, fits, z, 0, 0, FPA_READ_TYPE_WEIGHT, db); 1031 1038 } 1032 1039 -
trunk/psModules/src/camera/pmFPARead.h
r16580 r18030 4 4 * @author Paul Price, IfA 5 5 * 6 * @version $Revision: 1.1 2$ $Name: not supported by cvs2svn $7 * @date $Date: 2008-0 2-22 01:20:24$6 * @version $Revision: 1.13 $ $Name: not supported by cvs2svn $ 7 * @date $Date: 2008-06-09 22:59:02 $ 8 8 * Copyright 2005-2006 Institute for Astronomy, University of Hawaii 9 9 */ … … 19 19 psFits *fits, ///< FITS file from which to read 20 20 int z, ///< Readout number/plane; zero-offset indexing 21 int numScans ///< Number of scans (rows/cols) to read 21 int numScans, ///< Number of scans (rows/cols) to read 22 psDB *db ///< Database handle for concepts 22 23 ); 23 24 … … 29 30 int z, ///< Readout number/plane; zero-offset indexing 30 31 int numScans, ///< Number of scans (rows/cols) to read 31 int overlap ///< Overlap between consecutive reads 32 int overlap, ///< Overlap between consecutive reads 33 psDB *db ///< Database handle for concepts 32 34 ); 33 35 … … 35 37 bool pmReadoutRead(pmReadout *readout, ///< Readout of interest 36 38 psFits *fits, ///< FITS file from which to read 37 int z ///< Readout number/plane; zero-offset indexing 39 int z, ///< Readout number/plane; zero-offset indexing 40 psDB *db ///< Database handle for concepts 38 41 ); 39 42 … … 92 95 psFits *fits, ///< FITS file from which to read 93 96 int z, ///< Readout number/plane; zero-offset indexing 94 int numScans ///< Number of scans (rows/cols) to read 97 int numScans, ///< Number of scans (rows/cols) to read 98 psDB *db ///< Database handle for concepts 95 99 ); 96 100 … … 102 106 int z, ///< Readout number/plane; zero-offset indexing 103 107 int numScans, ///< Number of scans (rows/cols) to read 104 int overlap ///< Overlap between consecutive reads 108 int overlap, ///< Overlap between consecutive reads 109 psDB *db ///< Database handle for concepts 105 110 ); 106 111 … … 108 113 bool pmReadoutReadMask(pmReadout *readout, ///< Readout of interest 109 114 psFits *fits, ///< FITS file from which to read 110 int z ///< Readout number/plane; zero-offset indexing 115 int z, ///< Readout number/plane; zero-offset indexing 116 psDB *db ///< Database handle for concepts 111 117 ); 112 118 … … 141 147 psFits *fits, ///< FITS file from which to read 142 148 int z, ///< Readout number/plane; zero-offset indexing 143 int numScans ///< Number of scans (rows/cols) to read 149 int numScans, ///< Number of scans (rows/cols) to read 150 psDB *db ///< Database handle for concepts 144 151 ); 145 152 … … 151 158 int z, ///< Readout number/plane; zero-offset indexing 152 159 int numScans, ///< Number of scans (rows/cols) to read 153 int overlap ///< Overlap between consecutive reads 160 int overlap, ///< Overlap between consecutive reads 161 psDB *db ///< Database handle for concepts 154 162 ); 155 163 … … 157 165 bool pmReadoutReadWeight(pmReadout *readout, ///< Readout of interest 158 166 psFits *fits, ///< FITS file from which to read 159 int z ///< Readout number/plane; zero-offset indexing 167 int z, ///< Readout number/plane; zero-offset indexing 168 psDB *db ///< Database handle for concepts 160 169 ); 161 170
Note:
See TracChangeset
for help on using the changeset viewer.
