Changeset 18163 for trunk/psModules/src/camera/pmFPARead.c
- Timestamp:
- Jun 17, 2008, 12:16:38 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/camera/pmFPARead.c (modified) (25 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/camera/pmFPARead.c
r18140 r18163 82 82 static bool cellNumReadouts(pmCell *cell, // Cell of interest 83 83 psFits *fits, // FITS file 84 psDB *db 84 pmConfig *config // Configuration 85 85 ) 86 86 { … … 94 94 return false; 95 95 } 96 if (!pmCellReadHeader(cell, fits, db)) {96 if (!pmCellReadHeader(cell, fits, config)) { 97 97 psError(PS_ERR_IO, false, "Unable to read header for cell!\n"); 98 98 return false; … … 143 143 int numScans, // Number of scans to read at a time 144 144 fpaReadType type, // Type of image 145 p sDB *db // Database handle for concepts145 pmConfig *config // Configuration 146 146 ) 147 147 { … … 153 153 154 154 if (!pmConceptsReadCell(readout->parent, PM_CONCEPT_SOURCE_DEFAULTS | PM_CONCEPT_SOURCE_DATABASE, 155 true, db)) {155 true, config)) { 156 156 psError(PS_ERR_IO, false, "Failed to read concepts for cell."); 157 157 return false; … … 209 209 int numScans, // Number of scans to read at a time 210 210 fpaReadType type, // Type of image 211 p sDB *db // Database handle for concepts211 pmConfig *config// Configuration 212 212 ) 213 213 { … … 229 229 return false; 230 230 } 231 int naxis3 = cellNumReadouts(cell, fits, db); // Number of planes231 int naxis3 = cellNumReadouts(cell, fits, config); // Number of planes 232 232 if (z >= naxis3) { 233 233 // No more to read … … 237 237 int next; // Next position 238 238 int last; // Last position 239 if (!readoutScanProperties(&next, &last, readout, numScans, type, db)) {239 if (!readoutScanProperties(&next, &last, readout, numScans, type, config)) { 240 240 psError(PS_ERR_UNKNOWN, false, "Unable to determine readout properties."); 241 241 return false; … … 395 395 int overlap, // Number of scans (row/col) to overlap between scans 396 396 fpaReadType type, // Type of image 397 p sDB *db // Database handle for concepts397 pmConfig *config // Configuration 398 398 ) 399 399 { … … 416 416 } 417 417 418 int naxis3 = cellNumReadouts(cell, fits, db); // Number of image planes418 int naxis3 = cellNumReadouts(cell, fits, config); // Number of image planes 419 419 if (z >= naxis3) { 420 420 psError(PS_ERR_IO, false, "Desired image plane (%d) exceeds available number (%d).", … … 425 425 int next; // Next position 426 426 int last; // Last position 427 if (!readoutScanProperties(&next, &last, readout, numScans, type, db)) {427 if (!readoutScanProperties(&next, &last, readout, numScans, type, config)) { 428 428 psError(PS_ERR_UNKNOWN, false, "Unable to determine readout properties."); 429 429 return false; … … 532 532 static bool cellRead(pmCell *cell, // Cell into which to read 533 533 psFits *fits, // FITS file from which to read 534 p sDB *db, // Database handle, for concepts ingest534 pmConfig *config, // Configuration 535 535 fpaReadType type // Type to read 536 536 ) … … 578 578 579 579 // load in the concept information for this cell 580 if (!pmConceptsReadCell(cell, PM_CONCEPT_SOURCE_HEADER | PM_CONCEPT_SOURCE_DATABASE, true, db)) {580 if (!pmConceptsReadCell(cell, PM_CONCEPT_SOURCE_HEADER | PM_CONCEPT_SOURCE_DATABASE, true, config)) { 581 581 //psError(PS_ERR_UNKNOWN, false, "Failed to read concepts for cell"); 582 582 //return false; … … 653 653 static bool chipRead(pmChip *chip, // Chip into which to read 654 654 psFits *fits, // FITS file from which to read 655 p sDB *db, // Database handle, for concepts ingest655 pmConfig *config, // Configuration 656 656 fpaReadType type // Type to read 657 657 ) … … 664 664 for (int i = 0; i < cells->n; i++) { 665 665 pmCell *cell = cells->data[i]; // The cell of interest 666 success |= cellRead(cell, fits, db, type);666 success |= cellRead(cell, fits, config, type); 667 667 } 668 668 if (success) { … … 684 684 static bool fpaRead(pmFPA *fpa, // FPA into which to read 685 685 psFits *fits, // FITS file from which to read 686 p sDB *db, // Database handle, for concepts ingest686 pmConfig *config, // Configuration 687 687 fpaReadType type // Type to read 688 688 ) … … 695 695 for (int i = 0; i < chips->n; i++) { 696 696 pmChip *chip = chips->data[i]; // The cell of interest 697 success |= chipRead(chip, fits, db, type);697 success |= chipRead(chip, fits, config, type); 698 698 } 699 699 if (success) { … … 720 720 // pmReadoutReadNext is maintained here (for now) to maintain backwards compatibility. 721 721 // pmReadoutReadNext has been replaced by pmReadoutRead, pmReadoutReadChunk, pmReadoutMore 722 bool pmReadoutReadNext(bool *status, pmReadout *readout, psFits *fits, int z, int numScans, p sDB *db)722 bool pmReadoutReadNext(bool *status, pmReadout *readout, psFits *fits, int z, int numScans, pmConfig *config) 723 723 { 724 724 PS_ASSERT_PTR_NON_NULL(readout, false); … … 741 741 } 742 742 743 if (!pmCellReadHeader(cell, fits, db)) {743 if (!pmCellReadHeader(cell, fits, config)) { 744 744 psError(PS_ERR_IO, false, "Unable to read header for cell!\n"); 745 745 return false; … … 896 896 897 897 898 bool pmReadoutMore(pmReadout *readout, psFits *fits, int z, int numScans, p sDB *db)898 bool pmReadoutMore(pmReadout *readout, psFits *fits, int z, int numScans, pmConfig *config) 899 899 { 900 900 PS_ASSERT_PTR_NON_NULL(readout, false); 901 901 PS_ASSERT_FITS_NON_NULL(fits, false); 902 902 903 return readoutMore(readout, fits, z, numScans, FPA_READ_TYPE_IMAGE, db);904 } 905 906 bool pmReadoutReadChunk(pmReadout *readout, psFits *fits, int z, int numScans, int overlap, p sDB *db)903 return readoutMore(readout, fits, z, numScans, FPA_READ_TYPE_IMAGE, config); 904 } 905 906 bool pmReadoutReadChunk(pmReadout *readout, psFits *fits, int z, int numScans, int overlap, pmConfig *config) 907 907 { 908 908 PS_ASSERT_PTR_NON_NULL(readout, false); … … 911 911 PS_ASSERT_INT_NONNEGATIVE(numScans, false); 912 912 913 return readoutReadChunk(readout, fits, z, numScans, overlap, FPA_READ_TYPE_IMAGE, db);914 } 915 916 bool pmReadoutRead(pmReadout *readout, psFits *fits, int z, p sDB *db)913 return readoutReadChunk(readout, fits, z, numScans, overlap, FPA_READ_TYPE_IMAGE, config); 914 } 915 916 bool pmReadoutRead(pmReadout *readout, psFits *fits, int z, pmConfig *config) 917 917 { 918 918 PS_ASSERT_PTR_NON_NULL(readout, false); 919 919 PS_ASSERT_FITS_NON_NULL(fits, false); 920 920 921 return readoutReadChunk(readout, fits, z, 0, 0, FPA_READ_TYPE_IMAGE, db);922 } 923 924 int pmCellNumReadouts(pmCell *cell, psFits *fits, p sDB *db)921 return readoutReadChunk(readout, fits, z, 0, 0, FPA_READ_TYPE_IMAGE, config); 922 } 923 924 int pmCellNumReadouts(pmCell *cell, psFits *fits, pmConfig *config) 925 925 { 926 926 PS_ASSERT_PTR_NON_NULL(cell, false); 927 927 PS_ASSERT_FITS_NON_NULL(fits, false); 928 928 929 return cellNumReadouts(cell, fits, db);930 } 931 932 bool pmCellRead(pmCell *cell, psFits *fits, p sDB *db)929 return cellNumReadouts(cell, fits, config); 930 } 931 932 bool pmCellRead(pmCell *cell, psFits *fits, pmConfig *config) 933 933 { 934 934 PS_ASSERT_PTR_NON_NULL(cell, false); 935 935 PS_ASSERT_FITS_NON_NULL(fits, false); 936 936 937 return cellRead(cell, fits, db, FPA_READ_TYPE_IMAGE);938 } 939 940 bool pmChipRead(pmChip *chip, psFits *fits, p sDB *db)937 return cellRead(cell, fits, config, FPA_READ_TYPE_IMAGE); 938 } 939 940 bool pmChipRead(pmChip *chip, psFits *fits, pmConfig *config) 941 941 { 942 942 PS_ASSERT_PTR_NON_NULL(chip, false); 943 943 PS_ASSERT_FITS_NON_NULL(fits, false); 944 944 945 return chipRead(chip, fits, db, FPA_READ_TYPE_IMAGE);946 } 947 948 bool pmFPARead(pmFPA *fpa, psFits *fits, p sDB *db)945 return chipRead(chip, fits, config, FPA_READ_TYPE_IMAGE); 946 } 947 948 bool pmFPARead(pmFPA *fpa, psFits *fits, pmConfig *config) 949 949 { 950 950 PS_ASSERT_PTR_NON_NULL(fpa, false); 951 951 PS_ASSERT_FITS_NON_NULL(fits, false); 952 952 953 return fpaRead(fpa, fits, db, FPA_READ_TYPE_IMAGE);953 return fpaRead(fpa, fits, config, FPA_READ_TYPE_IMAGE); 954 954 } 955 955 … … 959 959 ////////////////////////////////////////////////////////////////////////////////////////////////////////////// 960 960 961 bool pmReadoutMoreMask(pmReadout *readout, psFits *fits, int z, int numScans, p sDB *db)961 bool pmReadoutMoreMask(pmReadout *readout, psFits *fits, int z, int numScans, pmConfig *config) 962 962 { 963 963 PS_ASSERT_PTR_NON_NULL(readout, false); 964 964 PS_ASSERT_FITS_NON_NULL(fits, false); 965 965 966 return readoutMore(readout, fits, z, numScans, FPA_READ_TYPE_MASK, db); 967 } 968 969 bool pmReadoutReadChunkMask(pmReadout *readout, psFits *fits, int z, int numScans, int overlap, psDB *db) 966 return readoutMore(readout, fits, z, numScans, FPA_READ_TYPE_MASK, config); 967 } 968 969 bool pmReadoutReadChunkMask(pmReadout *readout, psFits *fits, int z, int numScans, int overlap, 970 pmConfig *config) 970 971 { 971 972 PS_ASSERT_PTR_NON_NULL(readout, false); … … 974 975 PS_ASSERT_INT_NONNEGATIVE(numScans, false); 975 976 976 return readoutReadChunk(readout, fits, z, numScans, overlap, FPA_READ_TYPE_MASK, db);977 } 978 979 bool pmReadoutReadMask(pmReadout *readout, psFits *fits, int z, p sDB *db)977 return readoutReadChunk(readout, fits, z, numScans, overlap, FPA_READ_TYPE_MASK, config); 978 } 979 980 bool pmReadoutReadMask(pmReadout *readout, psFits *fits, int z, pmConfig *config) 980 981 { 981 982 PS_ASSERT_PTR_NON_NULL(readout, false); 982 983 PS_ASSERT_FITS_NON_NULL(fits, false); 983 984 984 return readoutReadChunk(readout, fits, z, 0, 0, FPA_READ_TYPE_MASK, db);985 } 986 987 bool pmCellReadMask(pmCell *cell, psFits *fits, p sDB *db)985 return readoutReadChunk(readout, fits, z, 0, 0, FPA_READ_TYPE_MASK, config); 986 } 987 988 bool pmCellReadMask(pmCell *cell, psFits *fits, pmConfig *config) 988 989 { 989 990 PS_ASSERT_PTR_NON_NULL(cell, false); 990 991 PS_ASSERT_FITS_NON_NULL(fits, false); 991 992 992 return cellRead(cell, fits, db, FPA_READ_TYPE_MASK);993 } 994 995 bool pmChipReadMask(pmChip *chip, psFits *fits, p sDB *db)993 return cellRead(cell, fits, config, FPA_READ_TYPE_MASK); 994 } 995 996 bool pmChipReadMask(pmChip *chip, psFits *fits, pmConfig *config) 996 997 { 997 998 PS_ASSERT_PTR_NON_NULL(chip, false); 998 999 PS_ASSERT_FITS_NON_NULL(fits, false); 999 1000 1000 return chipRead(chip, fits, db, FPA_READ_TYPE_MASK);1001 } 1002 1003 bool pmFPAReadMask(pmFPA *fpa, psFits *fits, p sDB *db)1001 return chipRead(chip, fits, config, FPA_READ_TYPE_MASK); 1002 } 1003 1004 bool pmFPAReadMask(pmFPA *fpa, psFits *fits, pmConfig *config) 1004 1005 { 1005 1006 PS_ASSERT_PTR_NON_NULL(fpa, false); 1006 1007 PS_ASSERT_FITS_NON_NULL(fits, false); 1007 1008 1008 return fpaRead(fpa, fits, db, FPA_READ_TYPE_MASK);1009 return fpaRead(fpa, fits, config, FPA_READ_TYPE_MASK); 1009 1010 } 1010 1011 … … 1013 1014 ////////////////////////////////////////////////////////////////////////////////////////////////////////////// 1014 1015 1015 bool pmReadoutMoreWeight(pmReadout *readout, psFits *fits, int z, int numScans, p sDB *db)1016 bool pmReadoutMoreWeight(pmReadout *readout, psFits *fits, int z, int numScans, pmConfig *config) 1016 1017 { 1017 1018 PS_ASSERT_PTR_NON_NULL(readout, false); 1018 1019 PS_ASSERT_FITS_NON_NULL(fits, false); 1019 1020 1020 return readoutMore(readout, fits, z, numScans, FPA_READ_TYPE_WEIGHT, db); 1021 } 1022 1023 bool pmReadoutReadChunkWeight(pmReadout *readout, psFits *fits, int z, int numScans, int overlap, psDB *db) 1021 return readoutMore(readout, fits, z, numScans, FPA_READ_TYPE_WEIGHT, config); 1022 } 1023 1024 bool pmReadoutReadChunkWeight(pmReadout *readout, psFits *fits, int z, int numScans, int overlap, 1025 pmConfig *config) 1024 1026 { 1025 1027 PS_ASSERT_PTR_NON_NULL(readout, false); … … 1028 1030 PS_ASSERT_INT_NONNEGATIVE(numScans, false); 1029 1031 1030 return readoutReadChunk(readout, fits, z, numScans, overlap, FPA_READ_TYPE_WEIGHT, db);1031 } 1032 1033 bool pmReadoutReadWeight(pmReadout *readout, psFits *fits, int z, p sDB *db)1032 return readoutReadChunk(readout, fits, z, numScans, overlap, FPA_READ_TYPE_WEIGHT, config); 1033 } 1034 1035 bool pmReadoutReadWeight(pmReadout *readout, psFits *fits, int z, pmConfig *config) 1034 1036 { 1035 1037 PS_ASSERT_PTR_NON_NULL(readout, false); 1036 1038 PS_ASSERT_FITS_NON_NULL(fits, false); 1037 1039 1038 return readoutReadChunk(readout, fits, z, 0, 0, FPA_READ_TYPE_WEIGHT, db);1039 } 1040 1041 bool pmCellReadWeight(pmCell *cell, psFits *fits, p sDB *db)1040 return readoutReadChunk(readout, fits, z, 0, 0, FPA_READ_TYPE_WEIGHT, config); 1041 } 1042 1043 bool pmCellReadWeight(pmCell *cell, psFits *fits, pmConfig *config) 1042 1044 { 1043 1045 PS_ASSERT_PTR_NON_NULL(cell, false); 1044 1046 PS_ASSERT_FITS_NON_NULL(fits, false); 1045 1047 1046 return cellRead(cell, fits, db, FPA_READ_TYPE_WEIGHT);1047 } 1048 1049 bool pmChipReadWeight(pmChip *chip, psFits *fits, p sDB *db)1048 return cellRead(cell, fits, config, FPA_READ_TYPE_WEIGHT); 1049 } 1050 1051 bool pmChipReadWeight(pmChip *chip, psFits *fits, pmConfig *config) 1050 1052 { 1051 1053 PS_ASSERT_PTR_NON_NULL(chip, false); 1052 1054 PS_ASSERT_FITS_NON_NULL(fits, false); 1053 1055 1054 return chipRead(chip, fits, db, FPA_READ_TYPE_WEIGHT);1055 } 1056 1057 bool pmFPAReadWeight(pmFPA *fpa, psFits *fits, p sDB *db)1056 return chipRead(chip, fits, config, FPA_READ_TYPE_WEIGHT); 1057 } 1058 1059 bool pmFPAReadWeight(pmFPA *fpa, psFits *fits, pmConfig *config) 1058 1060 { 1059 1061 PS_ASSERT_PTR_NON_NULL(fpa, false); 1060 1062 PS_ASSERT_FITS_NON_NULL(fits, false); 1061 1063 1062 return fpaRead(fpa, fits, db, FPA_READ_TYPE_WEIGHT);1064 return fpaRead(fpa, fits, config, FPA_READ_TYPE_WEIGHT); 1063 1065 } 1064 1066 … … 1067 1069 ////////////////////////////////////////////////////////////////////////////////////////////////////////////// 1068 1070 1069 bool pmCellReadHeaderSet(pmCell *cell, psFits *fits, p sDB *db)1071 bool pmCellReadHeaderSet(pmCell *cell, psFits *fits, pmConfig *config) 1070 1072 { 1071 1073 PS_ASSERT_PTR_NON_NULL(cell, false); 1072 1074 PS_ASSERT_FITS_NON_NULL(fits, false); 1073 1075 1074 return cellRead(cell, fits, db, FPA_READ_TYPE_HEADER);1075 } 1076 1077 bool pmChipReadHeaderSet(pmChip *chip, psFits *fits, p sDB *db)1076 return cellRead(cell, fits, config, FPA_READ_TYPE_HEADER); 1077 } 1078 1079 bool pmChipReadHeaderSet(pmChip *chip, psFits *fits, pmConfig *config) 1078 1080 { 1079 1081 PS_ASSERT_PTR_NON_NULL(chip, false); 1080 1082 PS_ASSERT_FITS_NON_NULL(fits, false); 1081 1083 1082 return chipRead(chip, fits, db, FPA_READ_TYPE_HEADER);1083 } 1084 1085 bool pmFPAReadHeaderSet(pmFPA *fpa, psFits *fits, p sDB *db)1084 return chipRead(chip, fits, config, FPA_READ_TYPE_HEADER); 1085 } 1086 1087 bool pmFPAReadHeaderSet(pmFPA *fpa, psFits *fits, pmConfig *config) 1086 1088 { 1087 1089 PS_ASSERT_PTR_NON_NULL(fpa, false); 1088 1090 PS_ASSERT_FITS_NON_NULL(fits, false); 1089 1091 1090 return fpaRead(fpa, fits, db, FPA_READ_TYPE_HEADER);1092 return fpaRead(fpa, fits, config, FPA_READ_TYPE_HEADER); 1091 1093 } 1092 1094
Note:
See TracChangeset
for help on using the changeset viewer.
