Changeset 34268 for trunk/psModules/src/objects/pmSourceIO.c
- Timestamp:
- Aug 1, 2012, 11:50:55 AM (14 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/objects/pmSourceIO.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/objects/pmSourceIO.c
r33463 r34268 1031 1031 if (!exttype) psAbort("cannot read table type"); 1032 1032 1033 # define PM_SOURCES_READ_PSF(NAME,TYPE) \ 1034 if (!strcmp (exttype, NAME)) { \ 1035 sources = pmSourcesRead_##TYPE(file->fits, hdu->header); \ 1036 } 1037 1033 1038 // XXX these are case-sensitive since the EXTYPE is case-sensitive 1034 1039 if (file->type == PM_FPA_FILE_CMF) { 1035 if (!strcmp (exttype, "SMPDATA")) { 1036 sources = pmSourcesRead_SMPDATA (file->fits, hdu->header); 1037 } 1038 if (!strcmp (exttype, "PS1_DEV_0")) { 1039 sources = pmSourcesRead_PS1_DEV_0 (file->fits, hdu->header); 1040 } 1041 if (!strcmp (exttype, "PS1_DEV_1")) { 1042 sources = pmSourcesRead_PS1_DEV_1 (file->fits, hdu->header); 1043 } 1044 if (!strcmp (exttype, "PS1_V1")) { 1045 sources = pmSourcesRead_CMF_PS1_V1 (file->fits, hdu->header); 1046 } 1047 if (!strcmp (exttype, "PS1_V2")) { 1048 sources = pmSourcesRead_CMF_PS1_V2 (file->fits, hdu->header); 1049 } 1050 if (!strcmp (exttype, "PS1_V3")) { 1051 sources = pmSourcesRead_CMF_PS1_V3 (file->fits, hdu->header); 1052 } 1053 if (!strcmp (exttype, "PS1_V4")) { 1054 sources = pmSourcesRead_CMF_PS1_V4 (file->fits, hdu->header); 1055 } 1056 if (!strcmp (exttype, "PS1_SV1")) { 1057 sources = pmSourcesRead_CMF_PS1_SV1 (file->fits, hdu->header); 1058 } 1059 if (!strcmp (exttype, "PS1_DV1")) { 1060 sources = pmSourcesRead_CMF_PS1_DV1 (file->fits, hdu->header); 1061 } 1062 if (!strcmp (exttype, "PS1_DV2")) { 1063 sources = pmSourcesRead_CMF_PS1_DV2 (file->fits, hdu->header); 1064 } 1040 PM_SOURCES_READ_PSF("SMPDATA", SMPDATA); 1041 PM_SOURCES_READ_PSF("PS1_DEV_0", PS1_DEV_0); 1042 PM_SOURCES_READ_PSF("PS1_DEV_1", PS1_DEV_1); 1043 PM_SOURCES_READ_PSF("PS1_CAL_0", PS1_CAL_0); 1044 PM_SOURCES_READ_PSF("PS1_V1", CMF_PS1_V1); 1045 PM_SOURCES_READ_PSF("PS1_V2", CMF_PS1_V2); 1046 PM_SOURCES_READ_PSF("PS1_V3", CMF_PS1_V3); 1047 PM_SOURCES_READ_PSF("PS1_V4", CMF_PS1_V4); 1048 PM_SOURCES_READ_PSF("PS1_SV1", CMF_PS1_SV1); 1049 PM_SOURCES_READ_PSF("PS1_DV1", CMF_PS1_DV1); 1050 PM_SOURCES_READ_PSF("PS1_DV2", CMF_PS1_DV2); 1065 1051 1066 1052 long *sourceIndex = NULL; … … 1088 1074 } 1089 1075 if (XSRC_OUTPUT && xsrcname) { 1076 // a cmf file may have an XSRC extension, but it is not required 1090 1077 if (!pmReadoutReadXSRC(file, exttype, hdu->header, xsrcname, sources, sourceIndex)) { 1091 // XXX: is this an error? 1092 psErrorClear(); 1078 // do anything? 1093 1079 } 1094 1080 psFree(xsrcname); 1095 1081 } 1096 1082 if (XFIT_OUTPUT && xfitname) { 1083 // a cmf file may have an XFIT extension, but it is not required 1097 1084 if (!pmReadoutReadXFIT(file, exttype, hdu->header, xfitname, sources, sourceIndex)) { 1098 // XXX: is this an error? 1099 psErrorClear(); 1085 // do anything? 1100 1086 } 1101 1087 psFree(xfitname); 1102 1088 } 1103 1089 if (XRAD_OUTPUT && xradname) { 1090 // a cmf file may have an XRAD extension, but it is not required 1104 1091 if (!pmReadoutReadXRAD(file, readout, exttype, hdu->header, xradname, sources, sourceIndex)) { 1105 // XXX: is this an error? 1106 psErrorClear(); 1092 // do anything? 1107 1093 } 1108 1094 psFree(xradname); … … 1241 1227 { 1242 1228 if (!psFitsMoveExtName (file->fits, xsrcname)) { 1243 ps Error(PS_ERR_UNKNOWN, false, "cannot find xsrc extension %s in %s", xsrcname, file->filename);1229 psWarning ("cannot find xsrc extension %s in %s, skipping", xsrcname, file->filename); 1244 1230 return false; 1245 1231 } … … 1255 1241 } 1256 1242 1257 // XXX these are case-sensitive since the EXTYPE is case-sensitive 1243 # define PM_SOURCES_READ_XSRC(NAME,TYPE) \ 1244 if (!strcmp (exttype, NAME)) { \ 1245 status = pmSourcesRead_##TYPE##_XSRC(file->fits, hduHeader, sources, sourceIndex); \ 1246 } 1247 1258 1248 bool status = false; 1259 1249 if (file->type == PM_FPA_FILE_CMF) { 1260 if (!strcmp (exttype, "PS1_SV1")) { 1261 status = pmSourcesRead_CMF_PS1_SV1_XSRC (file->fits, hduHeader, sources, sourceIndex); 1262 } 1250 PM_SOURCES_READ_XSRC("SMPDATA", SMPDATA); 1251 PM_SOURCES_READ_XSRC("PS1_DEV_0", PS1_DEV_0); 1252 PM_SOURCES_READ_XSRC("PS1_DEV_1", PS1_DEV_1); 1253 PM_SOURCES_READ_XSRC("PS1_CAL_0", PS1_CAL_0); 1254 PM_SOURCES_READ_XSRC("PS1_V1", CMF_PS1_V1); 1255 PM_SOURCES_READ_XSRC("PS1_V2", CMF_PS1_V2); 1256 PM_SOURCES_READ_XSRC("PS1_V3", CMF_PS1_V3); 1257 PM_SOURCES_READ_XSRC("PS1_V4", CMF_PS1_V4); 1258 PM_SOURCES_READ_XSRC("PS1_SV1", CMF_PS1_SV1); 1259 PM_SOURCES_READ_XSRC("PS1_DV1", CMF_PS1_DV1); 1260 PM_SOURCES_READ_XSRC("PS1_DV2", CMF_PS1_DV2); 1263 1261 } 1264 1262 psFree(tableHeader); … … 1269 1267 { 1270 1268 if (!psFitsMoveExtName (file->fits, extname)) { 1271 ps Error(PS_ERR_UNKNOWN, false, "cannot find extension %s in %s", extname, file->filename);1269 psWarning ("cannot find xfit extension %s in %s, skipping", extname, file->filename); 1272 1270 return false; 1273 1271 } … … 1283 1281 } 1284 1282 1285 // XXX these are case-sensitive since the EXTYPE is case-sensitive 1283 # define PM_SOURCES_READ_XFIT(NAME,TYPE) \ 1284 if (!strcmp (exttype, NAME)) { \ 1285 status = pmSourcesRead_##TYPE##_XFIT(file->fits, hduHeader, sources, sourceIndex); \ 1286 } 1287 1286 1288 bool status = false; 1287 1289 if (file->type == PM_FPA_FILE_CMF) { 1288 if (!strcmp (exttype, "PS1_SV1")) { 1289 status = pmSourcesRead_CMF_PS1_SV1_XFIT (file->fits, hduHeader, sources, sourceIndex); 1290 } 1290 PM_SOURCES_READ_XFIT("SMPDATA", SMPDATA); 1291 PM_SOURCES_READ_XFIT("PS1_DEV_0", PS1_DEV_0); 1292 PM_SOURCES_READ_XFIT("PS1_DEV_1", PS1_DEV_1); 1293 PM_SOURCES_READ_XFIT("PS1_CAL_0", PS1_CAL_0); 1294 PM_SOURCES_READ_XFIT("PS1_V1", CMF_PS1_V1); 1295 PM_SOURCES_READ_XFIT("PS1_V2", CMF_PS1_V2); 1296 PM_SOURCES_READ_XFIT("PS1_V3", CMF_PS1_V3); 1297 PM_SOURCES_READ_XFIT("PS1_V4", CMF_PS1_V4); 1298 PM_SOURCES_READ_XFIT("PS1_SV1", CMF_PS1_SV1); 1299 PM_SOURCES_READ_XFIT("PS1_DV1", CMF_PS1_DV1); 1300 PM_SOURCES_READ_XFIT("PS1_DV2", CMF_PS1_DV2); 1291 1301 } 1292 1302 psFree(tableHeader); … … 1296 1306 { 1297 1307 if (!psFitsMoveExtName (file->fits, extname)) { 1298 ps Error(PS_ERR_UNKNOWN, false, "cannot find extension %s in %s", extname, file->filename);1308 psWarning ("cannot find xrad extension %s in %s, skipping", extname, file->filename); 1299 1309 return false; 1300 1310 } … … 1310 1320 } 1311 1321 1312 // XXX these are case-sensitive since the EXTYPE is case-sensitive 1322 # define PM_SOURCES_READ_XRAD(NAME,TYPE) \ 1323 if (!strcmp (exttype, NAME)) { \ 1324 status = pmSourcesRead_##TYPE##_XRAD(file->fits, readout, hduHeader, sources, sourceIndex); \ 1325 } 1326 1313 1327 bool status = false; 1314 1328 if (file->type == PM_FPA_FILE_CMF) { 1315 if (!strcmp (exttype, "PS1_SV1")) { 1316 status = pmSourcesRead_CMF_PS1_SV1_XRAD (file->fits, readout, hduHeader, sources, sourceIndex); 1317 } 1329 PM_SOURCES_READ_XRAD("SMPDATA", SMPDATA); 1330 PM_SOURCES_READ_XRAD("PS1_DEV_0", PS1_DEV_0); 1331 PM_SOURCES_READ_XRAD("PS1_DEV_1", PS1_DEV_1); 1332 PM_SOURCES_READ_XRAD("PS1_CAL_0", PS1_CAL_0); 1333 PM_SOURCES_READ_XRAD("PS1_V1", CMF_PS1_V1); 1334 PM_SOURCES_READ_XRAD("PS1_V2", CMF_PS1_V2); 1335 PM_SOURCES_READ_XRAD("PS1_V3", CMF_PS1_V3); 1336 PM_SOURCES_READ_XRAD("PS1_V4", CMF_PS1_V4); 1337 PM_SOURCES_READ_XRAD("PS1_SV1", CMF_PS1_SV1); 1338 PM_SOURCES_READ_XRAD("PS1_DV1", CMF_PS1_DV1); 1339 PM_SOURCES_READ_XRAD("PS1_DV2", CMF_PS1_DV2); 1318 1340 } 1319 1341 psFree(tableHeader);
Note:
See TracChangeset
for help on using the changeset viewer.
