Changeset 12973
- Timestamp:
- Apr 23, 2007, 3:05:14 PM (19 years ago)
- Location:
- trunk/ppSim/src
- Files:
-
- 2 edited
-
ppSimArguments.c (modified) (1 diff)
-
ppSimLoop.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppSim/src/ppSimArguments.c
r12971 r12973 171 171 usage(arguments, config); 172 172 } 173 psMetadataAddS32(config->arguments, PS_LIST_TAIL, " -bin", 0, "Binning in x and y", bin);173 psMetadataAddS32(config->arguments, PS_LIST_TAIL, "BINNING", 0, "Binning in x and y", bin); 174 174 175 175 psMetadataAddStr(config->arguments, PS_LIST_TAIL, "OUTPUT", 0, "Name of the output image", -
trunk/ppSim/src/ppSimLoop.c
r12939 r12973 19 19 int cell0, // Cell offset 20 20 int cellParity, // Cell parity 21 int binning, // Binning factor 21 22 int chip0, // Chip offset 22 23 int chipParity // Chip parity 23 24 ) 24 25 { 25 return (chip0 + chipParity * (cell0 + cellParity * pos));26 return (chip0 + binning * chipParity * (cell0 + cellParity * pos)); 26 27 } 27 28 … … 30 31 int cell0, // Cell offset 31 32 int cellParity, // Cell parity 33 int binning, // Binning factor 32 34 int chip0, // Chip offset 33 35 int chipParity // Chip parity 34 36 ) 35 37 { 36 return ((pos - chip0) * chipParity - cell0) * cellParity ;38 return ((pos - chip0) * chipParity - cell0) * cellParity / binning; 37 39 } 38 40 … … 95 97 96 98 // "Left", "Right", "Bottom" and "Top" don't take into account the parity 97 int cellLeft = cell2fpa(0, x0Cell, xParityCell, x0Chip, xParityChip);98 int cellRight = cell2fpa(xSize, x0Cell, xParityCell, x0Chip, xParityChip);99 int cellBottom = cell2fpa(0, y0Cell, yParityCell, y0Chip, yParityChip);100 int cellTop = cell2fpa(ySize, y0Cell, yParityCell, y0Chip, yParityChip);99 int cellLeft = cell2fpa(0, x0Cell, xParityCell, 1, x0Chip, xParityChip); 100 int cellRight = cell2fpa(xSize, x0Cell, xParityCell, 1, x0Chip, xParityChip); 101 int cellBottom = cell2fpa(0, y0Cell, yParityCell, 1, y0Chip, yParityChip); 102 int cellTop = cell2fpa(ySize, y0Cell, yParityCell, 1, y0Chip, yParityChip); 101 103 102 104 COMPARE(cellLeft, xMin, xMax); … … 262 264 float starsMag = psMetadataLookupF32(NULL, config->arguments, "STARS.MAG"); // Star brightest magnitude 263 265 float starsDensity = psMetadataLookupF32(NULL, config->arguments, "STARS.DENSITY"); // Density of fakes 266 int binning = psMetadataLookupS32(NULL, config->arguments, "BINNING"); // Binning in x and y 264 267 265 268 float expTime = psMetadataLookupF32(NULL, config->arguments, "EXPTIME"); // Exposure time … … 439 442 440 443 // Size, position and orientation of cell 441 int numCols = psMetadataLookupS32(NULL, cell->concepts, "CELL.XSIZE") ;442 int numRows = psMetadataLookupS32(NULL, cell->concepts, "CELL.YSIZE") ;444 int numCols = psMetadataLookupS32(NULL, cell->concepts, "CELL.XSIZE") / binning; 445 int numRows = psMetadataLookupS32(NULL, cell->concepts, "CELL.YSIZE") / binning; 443 446 int x0Cell = psMetadataLookupS32(NULL, cell->concepts, "CELL.X0"); 444 447 int y0Cell = psMetadataLookupS32(NULL, cell->concepts, "CELL.Y0"); … … 547 550 rowBias->data.F32[y] = psPolynomial1DEval(biasPoly, (float)(y + biasOffset) / 548 551 (float)numRows - 0.5) + biasLevel; 549 float yFPA = cell2fpa(y, y0Cell, yParityCell, y0Chip, yParityChip) * 2.0 /552 float yFPA = cell2fpa(y, y0Cell, yParityCell, binning, y0Chip, yParityChip) * 2.0 / 550 553 (bounds->y1 - bounds->y0); // Relative y position in FPA 551 554 552 555 for (int x = 0; x < numCols; x++) { 553 float xFPA = cell2fpa(x, x0Cell, xParityCell, x0Chip, xParityChip) * 2.0 /556 float xFPA = cell2fpa(x, x0Cell, xParityCell, binning, x0Chip, xParityChip) * 2.0 / 554 557 (bounds->x1 - bounds->x0); // Relative x position in FPA 555 558 … … 602 605 for (long j = 0; j < ra->n; j++) { 603 606 // Position on the cell and peak flux 604 float x = fpa2cell(ra->data.F32[j], x0Cell, xParityCell, x0Chip, xParityChip); 605 float y = fpa2cell(dec->data.F32[j], y0Cell, yParityCell, y0Chip, yParityChip); 607 float x = fpa2cell(ra->data.F32[j], x0Cell, xParityCell, binning, 608 x0Chip, xParityChip); 609 float y = fpa2cell(dec->data.F32[j], y0Cell, yParityCell, binning, 610 y0Chip, yParityChip); 606 611 float flux = mag->data.F32[j]; 607 612 star(signal, variance, x, y, flux, roughNoise, seeing, expCorr); … … 641 646 psMetadataAddF32(cell->concepts, PS_LIST_TAIL, "CELL.DARKTIME", PS_META_REPLACE, 642 647 "Dark time (sec)", expTime); 648 psMetadataAddS32(cell->concepts, PS_LIST_TAIL, "CELL.XBIN", PS_META_REPLACE, 649 "Binning in x", binning); 650 psMetadataAddS32(cell->concepts, PS_LIST_TAIL, "CELL.YBIN", PS_META_REPLACE, 651 "Binning in y", binning); 643 652 644 653 if (!pmFPAfileIOChecks(config, view, PM_FPA_AFTER)) {
Note:
See TracChangeset
for help on using the changeset viewer.
