Changeset 32977
- Timestamp:
- Dec 19, 2011, 3:12:24 PM (14 years ago)
- Location:
- trunk/psModules/src/objects
- Files:
-
- 3 edited
-
pmSourceIO.c (modified) (5 diffs)
-
pmSourceIO.h (modified) (1 diff)
-
pmSourceIO_CMF_PS1_SV1.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/objects/pmSourceIO.c
r32971 r32977 59 59 static bool pmReadoutReadXSRC(pmFPAfile *file, char * exttype, psMetadata *hduHeader, psString xsrcname, psArray *sources, long *sourceIndex); 60 60 static bool pmReadoutReadXFIT(pmFPAfile *file, char * exttype, psMetadata *hduHeader, psString xfitname, psArray *sources, long *sourceIndex); 61 static bool pmReadoutReadXRAD(pmFPAfile *file, char * exttype, psMetadata *hduHeader, psString xfitname, psArray *sources, long *sourceIndex);61 static bool pmReadoutReadXRAD(pmFPAfile *file, pmReadout *readout, char * exttype, psMetadata *hduHeader, psString xfitname, psArray *sources, long *sourceIndex); 62 62 63 63 // lookup the EXTNAME values used for table data and image header segments … … 1097 1097 } 1098 1098 if (XRAD_OUTPUT && xradname) { 1099 if (!pmReadoutReadXRAD(file, exttype, hdu->header, xradname, sources, sourceIndex)) {1099 if (!pmReadoutReadXRAD(file, readout, exttype, hdu->header, xradname, sources, sourceIndex)) { 1100 1100 // XXX: is this an error? 1101 1101 psErrorClear(); … … 1253 1253 bool status = false; 1254 1254 if (file->type == PM_FPA_FILE_CMF) { 1255 #ifdef notyet1256 if (!strcmp (exttype, "SMPDATA")) {1257 status = pmSourcesRead_SMPDATA_XSRC (file->fits, hduHeader, sources);1258 }1259 if (!strcmp (exttype, "PS1_DEV_0")) {1260 status = pmSourcesRead_PS1_DEV_0_XSRC (file->fits, hduHeader, sources);1261 }1262 if (!strcmp (exttype, "PS1_DEV_1")) {1263 status = pmSourcesRead_PS1_DEV_1_XSRC (file->fits, hduHeader, sources);1264 }1265 if (!strcmp (exttype, "PS1_V1")) {1266 status = pmSourcesRead_CMF_PS1_V1_XSRC (file->fits, hduHeader, sources);1267 }1268 if (!strcmp (exttype, "PS1_V2")) {1269 status = pmSourcesRead_CMF_PS1_V2_XSRC (file->fits, hduHeader, sources);1270 }1271 if (!strcmp (exttype, "PS1_V3")) {1272 status = pmSourcesRead_CMF_PS1_V3_XSRC (file->fits, hduHeader, sources);1273 }1274 if (!strcmp (exttype, "PS1_V4")) {1275 status = pmSourcesRead_CMF_PS1_V4_XSRC (file->fits, hduHeader, sources);1276 }1277 #endif // notyet1278 1255 if (!strcmp (exttype, "PS1_SV1")) { 1279 1256 status = pmSourcesRead_CMF_PS1_SV1_XSRC (file->fits, hduHeader, sources, sourceIndex); 1280 1257 } 1281 #ifdef notyet1282 if (!strcmp (exttype, "PS1_DV1")) {1283 status = pmSourcesRead_CMF_PS1_DV1_XSRC (file->fits, hduHeader, sources);1284 }1285 if (!strcmp (exttype, "PS1_DV2")) {1286 status = pmSourcesRead_CMF_PS1_DV2_XSRC (file->fits, hduHeader, sources);1287 }1288 #endif // notyet1289 1258 } 1290 1259 psFree(tableHeader); … … 1312 1281 bool status = false; 1313 1282 if (file->type == PM_FPA_FILE_CMF) { 1314 #ifdef notyet1315 if (!strcmp (exttype, "SMPDATA")) {1316 status = pmSourcesRead_SMPDATA_XFIT (file->fits, hduHeader, sources);1317 }1318 if (!strcmp (exttype, "PS1_DEV_0")) {1319 status = pmSourcesRead_PS1_DEV_0_XFIT (file->fits, hduHeader, sources);1320 }1321 if (!strcmp (exttype, "PS1_DEV_1")) {1322 status = pmSourcesRead_PS1_DEV_1_XFIT (file->fits, hduHeader, sources);1323 }1324 if (!strcmp (exttype, "PS1_V1")) {1325 status = pmSourcesRead_CMF_PS1_V1_XFIT (file->fits, hduHeader, sources);1326 }1327 if (!strcmp (exttype, "PS1_V2")) {1328 status = pmSourcesRead_CMF_PS1_V2_XFIT (file->fits, hduHeader, sources);1329 }1330 if (!strcmp (exttype, "PS1_V3")) {1331 status = pmSourcesRead_CMF_PS1_V3_XFIT (file->fits, hduHeader, sources);1332 }1333 if (!strcmp (exttype, "PS1_V4")) {1334 status = pmSourcesRead_CMF_PS1_V4_XFIT (file->fits, hduHeader, sources);1335 }1336 #endif // notyet1337 1283 if (!strcmp (exttype, "PS1_SV1")) { 1338 1284 status = pmSourcesRead_CMF_PS1_SV1_XFIT (file->fits, hduHeader, sources, sourceIndex); 1339 1285 } 1340 #ifdef notyet1341 if (!strcmp (exttype, "PS1_DV1")) {1342 status = pmSourcesRead_CMF_PS1_DV1_XFIT (file->fits, hduHeader, sources);1343 }1344 if (!strcmp (exttype, "PS1_DV2")) {1345 status = pmSourcesRead_CMF_PS1_DV2_XFIT (file->fits, hduHeader, sources);1346 }1347 #endif // notyet1348 1286 } 1349 1287 psFree(tableHeader); 1350 1288 return status; 1351 1289 } 1352 static bool pmReadoutReadXRAD(pmFPAfile *file, char *exttype, psMetadata *hduHeader, psString extname, psArray *sources, long *sourceIndex)1290 static bool pmReadoutReadXRAD(pmFPAfile *file, pmReadout *readout, char *exttype, psMetadata *hduHeader, psString extname, psArray *sources, long *sourceIndex) 1353 1291 { 1354 1292 if (!psFitsMoveExtName (file->fits, extname)) { … … 1370 1308 bool status = false; 1371 1309 if (file->type == PM_FPA_FILE_CMF) { 1372 #ifdef notyet1373 if (!strcmp (exttype, "SMPDATA")) {1374 status = pmSourcesRead_SMPDATA_XRAD (file->fits, hduHeader, sources);1375 }1376 if (!strcmp (exttype, "PS1_DEV_0")) {1377 status = pmSourcesRead_PS1_DEV_0_XRAD (file->fits, hduHeader, sources);1378 }1379 if (!strcmp (exttype, "PS1_DEV_1")) {1380 status = pmSourcesRead_PS1_DEV_1_XRAD (file->fits, hduHeader, sources);1381 }1382 if (!strcmp (exttype, "PS1_V1")) {1383 status = pmSourcesRead_CMF_PS1_V1_XRAD (file->fits, hduHeader, sources);1384 }1385 if (!strcmp (exttype, "PS1_V2")) {1386 status = pmSourcesRead_CMF_PS1_V2_XRAD (file->fits, hduHeader, sources);1387 }1388 if (!strcmp (exttype, "PS1_V3")) {1389 status = pmSourcesRead_CMF_PS1_V3_XRAD (file->fits, hduHeader, sources);1390 }1391 if (!strcmp (exttype, "PS1_V4")) {1392 status = pmSourcesRead_CMF_PS1_V4_XRAD (file->fits, hduHeader, sources);1393 }1394 #endif // notyet1395 1310 if (!strcmp (exttype, "PS1_SV1")) { 1396 status = pmSourcesRead_CMF_PS1_SV1_XRAD (file->fits, hduHeader, sources, sourceIndex); 1397 } 1398 #ifdef notyet 1399 if (!strcmp (exttype, "PS1_DV1")) { 1400 status = pmSourcesRead_CMF_PS1_DV1_XRAD (file->fits, hduHeader, sources); 1401 } 1402 if (!strcmp (exttype, "PS1_DV2")) { 1403 status = pmSourcesRead_CMF_PS1_DV2_XRAD (file->fits, hduHeader, sources); 1404 } 1405 #endif // notyet 1311 status = pmSourcesRead_CMF_PS1_SV1_XRAD (file->fits, readout, hduHeader, sources, sourceIndex); 1312 } 1406 1313 } 1407 1314 psFree(tableHeader); -
trunk/psModules/src/objects/pmSourceIO.h
r32971 r32977 95 95 bool pmSourcesRead_CMF_PS1_SV1_XSRC (psFits *fits, psMetadata *header, psArray *sources, long *); 96 96 bool pmSourcesRead_CMF_PS1_SV1_XFIT (psFits *fits, psMetadata *header, psArray *sources, long *); 97 bool pmSourcesRead_CMF_PS1_SV1_XRAD (psFits *fits, p sMetadata *header, psArray *sources, long *);97 bool pmSourcesRead_CMF_PS1_SV1_XRAD (psFits *fits, pmReadout *readout, psMetadata *header, psArray *sources, long *); 98 98 psArray *pmSourcesRead_CMF_PS1_DV1 (psFits *fits, psMetadata *header); 99 99 psArray *pmSourcesRead_CMF_PS1_DV2 (psFits *fits, psMetadata *header); -
trunk/psModules/src/objects/pmSourceIO_CMF_PS1_SV1.c
r32971 r32977 1026 1026 } 1027 1027 1028 bool pmSourcesRead_CMF_PS1_SV1_XRAD(psFits *fits, p sMetadata *hduHeader, psArray *sources, long *sourceIndex)1028 bool pmSourcesRead_CMF_PS1_SV1_XRAD(psFits *fits, pmReadout *readout, psMetadata *hduHeader, psArray *sources, long *sourceIndex) 1029 1029 { 1030 1030 PS_ASSERT_PTR_NON_NULL(fits, false); … … 1037 1037 return false; 1038 1038 } 1039 1040 long seq_first = -1; 1041 long seq_last = -1; 1042 psVector *fwhmValues = psVectorAllocEmpty(10, PS_TYPE_F32); 1043 long max_entries = -1; 1044 long num_entries = -1; 1039 1045 1040 1046 for (long i = 0; i < numSources; i++) { … … 1061 1067 return false; 1062 1068 } 1069 if (seq_first == -1) { 1070 seq_first = seq; 1071 } 1072 if (seq == seq_first) { 1073 psF32 value = psMetadataLookupF32(&status, row, "PSF_FWHM"); 1074 psVectorAppend(fwhmValues, value); 1075 } 1076 if (seq == seq_last) { 1077 num_entries++; 1078 } else { 1079 num_entries = 1; 1080 seq_last = seq; 1081 } 1082 if (num_entries > max_entries) { 1083 max_entries = num_entries; 1084 } 1085 1063 1086 if (!source->radialAper) { 1064 1087 // XXX: where to find the number of models to expect? … … 1078 1101 } 1079 1102 1103 // check for consistency between the length of fwhmValues and the maximum number of entries for each row 1104 if (fwhmValues->n != max_entries) { 1105 psError(PS_ERR_PROGRAMMING, true, "number of PSF_FWHM values found %ld does not match expected number: %ld\n", 1106 fwhmValues->n, max_entries); 1107 psAssert(0, "fixme"); 1108 } 1109 1110 if (!readout->analysis) { 1111 readout->analysis = psMetadataAlloc(); 1112 } 1113 1114 psMetadataAddVector(readout->analysis, PS_LIST_TAIL, "STACK.PSF.FWHM.VALUES", PS_META_REPLACE, "PSF sizes", fwhmValues); 1115 psFree(fwhmValues); 1116 1080 1117 return true; 1081 1118 }
Note:
See TracChangeset
for help on using the changeset viewer.
