Changeset 6673
- Timestamp:
- Mar 22, 2006, 5:09:57 PM (20 years ago)
- Location:
- branches/rel10_ifa/psModules/src/astrom
- Files:
-
- 2 added
- 4 edited
-
Makefile.am (modified) (2 diffs)
-
pmFPA.c (modified) (2 diffs)
-
pmFPA.h (modified) (2 diffs)
-
pmFPAConstruct.c (modified) (11 diffs)
-
pmFPAUtils.c (added)
-
pmFPAUtils.h (added)
Legend:
- Unmodified
- Added
- Removed
-
branches/rel10_ifa/psModules/src/astrom/Makefile.am
r6663 r6673 8 8 pmFPAMaskWeight.c \ 9 9 pmFPARead.c \ 10 pmFPAUtils.c \ 10 11 pmFPAWrite.c \ 11 12 pmHDU.c \ 12 pmHDU GetLowest.c \13 pmHDUUtils.c \ 13 14 pmReadout.c \ 14 15 pmConcepts.c \ … … 29 30 pmFPAMaskWeight.h \ 30 31 pmFPARead.h \ 32 pmFPAUtils.h \ 31 33 pmFPAWrite.h \ 32 34 pmHDU.h \ 33 pmHDU GetLowest.h \35 pmHDUUtils.h \ 34 36 pmReadout.h \ 35 37 psAdditionals.h \ -
branches/rel10_ifa/psModules/src/astrom/pmFPA.c
r6586 r6673 12 12 * XXX: Should we implement non-linear cell->chip transforms? 13 13 * 14 * @version $Revision: 1.1.4. 3$ $Name: not supported by cvs2svn $15 * @date $Date: 2006-03- 15 02:37:16$14 * @version $Revision: 1.1.4.4 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2006-03-23 03:09:57 $ 16 16 * 17 17 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 363 363 } 364 364 365 pmHDU *pmHDUFromFPA(pmFPA *fpa // FPA for which to find HDU366 )367 {368 return fpa->hdu;369 }370 371 pmHDU *pmHDUFromChip(pmChip *chip // Chip for which to find HDU372 )373 {374 pmHDU *hdu = chip->hdu; // The HDU information375 if (!hdu) {376 hdu = pmHDUFromFPA(chip->parent); // Grab HDU info from the FPA377 }378 379 return hdu;380 }381 382 pmHDU *pmHDUFromCell(pmCell *cell // Cell for which to find HDU383 )384 {385 pmHDU *hdu = cell->hdu; // The HDU information386 if (!hdu) {387 hdu = pmHDUFromChip(cell->parent); // Grab HDU info from the chip388 }389 390 return hdu;391 }392 393 365 static psBool cellCheckParents(pmCell *cell) 394 366 { -
branches/rel10_ifa/psModules/src/astrom/pmFPA.h
r6552 r6673 7 7 * @author GLG, MHPCC 8 8 * 9 * @version $Revision: 1.1.4. 3$ $Name: not supported by cvs2svn $10 * @date $Date: 2006-03- 09 03:08:08$9 * @version $Revision: 1.1.4.4 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2006-03-23 03:09:57 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 194 194 ); 195 195 196 // Find the HDU in the FPA hierarchy197 pmHDU *pmHDUFromFPA(pmFPA *fpa // FPA for which to find HDU198 );199 pmHDU *pmHDUFromChip(pmChip *chip // Chip for which to find HDU200 );201 pmHDU *pmHDUFromCell(pmCell *cell // Cell for which to find HDU202 );203 196 204 197 /** Verify parent links. -
branches/rel10_ifa/psModules/src/astrom/pmFPAConstruct.c
r6663 r6673 9 9 #include "pmFPAConstruct.h" 10 10 #include "pmFPAview.h" 11 #include "pmFPAUtils.h" 11 12 12 13 ////////////////////////////////////////////////////////////////////////////////////////////////////////////// … … 32 33 33 34 return cellData; 34 }35 36 // Find a chip by name; return the index37 static int findChip(pmFPA *fpa, // FPA in which to find the chip38 const char *name // Name of the chip39 )40 {41 psArray *chips = fpa->chips; // Array of chips42 for (int i = 0; i < chips->n; i++) {43 pmChip *chip = chips->data[i]; // The chip of interest44 psString testName = psMetadataLookupStr(NULL, chip->concepts, "CHIP.NAME"); // Name of this chip45 if (strcmp(name, testName) == 0) {46 return i;47 }48 }49 50 psError(PS_ERR_IO, true, "Unable to find chip %s\n", name);51 return -1;52 }53 54 // Find a cell by name; return the index55 static int findCell(pmChip *chip, // Chip in which to find the cell56 const char *name // Name of the cell57 )58 {59 psArray *cells = chip->cells; // Array of cells60 for (int i = 0; i < cells->n; i++) {61 pmCell *cell = cells->data[i]; // The cell of interest62 psString testName = psMetadataLookupStr(NULL, cell->concepts, "CELL.NAME"); // Name of this cell63 if (strcmp(name, testName) == 0) {64 return i;65 }66 }67 68 psError(PS_ERR_IO, true, "Unable to find cell %s\n", name);69 return -1;70 35 } 71 36 … … 232 197 // Get the chip 233 198 phuChipName = phuNameFromHeader("CHIP.NAME", formatSpec, phu); // Name of the chip 234 int chipNum = findChip(fpa, phuChipName); // Chip number199 int chipNum = pmFPAFindChip(fpa, phuChipName); // Chip number 235 200 if (chipNum == -1) { 236 201 psError(PS_ERR_IO, true, "Unable to find chip %s in FPA.\n", phuChipName); … … 257 222 // Added this for possible future plans which might allow PHU=CELL 258 223 phuCellName = phuNameFromHeader("CELL.NAME", formatSpec, phu); // Name of the cell 259 int cellNum = findCell(chip, phuCellName); // Cell number224 int cellNum = pmChipFindCell(chip, phuCellName); // Cell number 260 225 if (cellNum == -1) { 261 226 psError(PS_ERR_IO, true, "Unable to find cell %s in chip %s.\n", phuCellName, phuChipName); … … 330 295 "(%s) --- there may be problems when reading!\n", chipName, phuChipName); 331 296 // Find the other chip 332 int chipNum = findChip(fpa, chipName); // The chip we're looking for297 int chipNum = pmFPAFindChip(fpa, chipName); // The chip we're looking for 333 298 if (chipNum == -1) { 334 299 psLogMsg(__func__, PS_LOG_WARN, "Unable to find chip %s in fpa --- ignored.\n", chipName); … … 338 303 } 339 304 psString cellName = values->data[i]; // The name of the cell specified 340 int cellNum = findCell(chip, cellName); // The cell we're looking for305 int cellNum = pmChipFindCell(chip, cellName); // The cell we're looking for 341 306 if (cellNum == -1) { 342 307 psLogMsg(__func__, PS_LOG_WARN, "Unable to find cell %s in chip %s --- ignored.\n", … … 388 353 psString chipName = names->data[i]; // The name of the chip 389 354 psString cellName = values->data[i]; // The name of the cell 390 int chipNum = findChip(fpa, chipName); // The chip we're looking for355 int chipNum = pmFPAFindChip(fpa, chipName); // The chip we're looking for 391 356 if (chipNum == -1) { 392 357 psLogMsg(__func__, PS_LOG_WARN, "Unable to find chip %s in FPA --- ignored.\n", chipName); … … 394 359 } 395 360 chip = fpa->chips->data[chipNum]; 396 int cellNum = findCell(chip, cellName); // The cell we're looking for361 int cellNum = pmChipFindCell(chip, cellName); // The cell we're looking for 397 362 if (cellNum == -1) { 398 363 psLogMsg(__func__, PS_LOG_WARN, "Unable to find cell %s in chip %s --- ignored\n", … … 429 394 // Need to look up the name of the chip 430 395 chipName = phuNameFromHeader("CHIP.NAME", formatSpec, phu); 431 int chipNum = findChip(fpa, chipName);396 int chipNum = pmFPAFindChip(fpa, chipName); 432 397 if (chipNum == -1) { 433 398 psLogMsg(__func__, PS_LOG_WARN, "Unable to find chip %s in FPA --- ignored.\n", chipName); … … 444 409 chipName = names->data[i]; 445 410 cellName = cellType; 446 int chipNum = findChip(fpa, chipName); // The chip we're looking for411 int chipNum = pmFPAFindChip(fpa, chipName); // The chip we're looking for 447 412 if (chipNum == -1) { 448 413 psLogMsg(__func__, PS_LOG_WARN, "Unable to find chip %s in FPA --- ignored.\n", … … 455 420 cellName = names->data[i]; 456 421 } 457 int cellNum = findCell(chip, cellName); // The cell we're looking for422 int cellNum = pmChipFindCell(chip, cellName); // The cell we're looking for 458 423 if (cellNum == -1) { 459 424 psLogMsg(__func__, PS_LOG_WARN, "Unable to find cell %s in chip %s --- ignored.\n",
Note:
See TracChangeset
for help on using the changeset viewer.
