- Timestamp:
- Oct 23, 2021, 1:48:02 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-dev-20210817/psModules/src/detrend/pmPatternIO.c
r41851 r41856 8 8 #include "pmFPAview.h" 9 9 #include "pmFPAfile.h" 10 #include "pmFPAUtils.h" 10 11 #include "pmFPAfileFitsIO.h" 11 12 #include "pmFPAHeader.h" … … 455 456 /**************** PatternRowAmp(litude) I/O *************************/ 456 457 457 # if (0) 458 /********************* Read Data functions *****************************/ 459 460 bool pmPatternRowAmpReadForView (const pmFPAview *view, pmFPAfile *file, const pmConfig *config) 458 bool pmPatternRowAmpRead (const pmFPAview *view, pmFPAfile *file, const pmConfig *config) 461 459 { 462 460 // read the full model in one pass: require the level to be FPA … … 499 497 } 500 498 499 int nGood = 0; 500 int nTotal = 0; 501 501 while (haveData) { 502 502 … … 511 511 // determine the chip: 512 512 char *extname = psMetadataLookupStr (&status, header, "EXTNAME"); 513 psLogMsg ("psModules.detrend", 4, "read %ld rows from Pattern Row Amplitude file, extname %s\n", model->n, extname); 513 psLogMsg ("psModules.detrend", 8, "read %ld rows from Pattern Row Amplitude file, extname %s\n", model->n, extname); 514 nTotal += model->n; 514 515 515 516 // I expect to find a name of the form: chipName.ptn (eg, XY01.ptn) 516 517 // where chipName like 'XY01' 517 psAssert (strlen(extname) == 10, "invalid extension %s", extname);518 psAssert (strlen(extname) == 8, "invalid extension %s", extname); 518 519 psAssert (extname[5] == 'p', "invalid extension %s", extname); 519 520 psAssert (extname[6] == 't', "invalid extension %s", extname); … … 530 531 for (int i = 0; i < model->n; i++) { 531 532 psMetadata *row = model->data[i]; 532 char *cellName = psMetadataLookupStr(&status, row, "cellname"); 533 float *amplitude = psMetadataLookupF32(&status, row, "medianValue"); 533 534 char *cellName = psMetadataLookupStr(&status, row, "CELL_NAME"); 535 if (!cellName) continue; 536 537 float amplitude = psMetadataLookupF32(&status, row, "VALUE_MEDIAN"); 534 538 535 539 int cellNumber = pmChipFindCell (chip, cellName); 536 pmCell *cell = chip->data[cellNumber]; 540 pmCell *cell = chip->cells->data[cellNumber]; 541 if (!cell) continue; 537 542 538 543 psMetadataAddF32 (cell->analysis, PS_LIST_TAIL, "PTN.ROW.AMP", PS_META_REPLACE, "", amplitude); 544 nGood ++; 539 545 } 546 540 547 psFree (model); 541 548 psFree (header); … … 544 551 haveData = psFitsMoveExtNum (file->fits, 1, true); 545 552 } 546 547 return true; 548 } 549 # endif 553 psLogMsg ("psModules.detrend", 4, "read %d of %d rows from Pattern Row Amplitude file\n", nGood, nTotal); 554 555 return true; 556 }
Note:
See TracChangeset
for help on using the changeset viewer.
