Changeset 14531 for trunk/ppSim/src/ppSimUtils.c
- Timestamp:
- Aug 16, 2007, 8:52:31 AM (19 years ago)
- File:
-
- 1 edited
-
trunk/ppSim/src/ppSimUtils.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppSim/src/ppSimUtils.c
r14463 r14531 2 2 3 3 // Generate a header containing WCS keywords 4 // this function is called with only one of fpa, chip, cell not NULL 4 5 bool ppSimInitHeader(pmConfig *config, 5 6 pmFPA *fpa, … … 11 12 float dec0 = psMetadataLookupF32(NULL, config->arguments, "DEC"); // Boresight Dec (radians) 12 13 float pa = psMetadataLookupF32(NULL, config->arguments, "PA"); // Position angle (radians) 13 float scale = psMetadataLookupF32(NULL, config->arguments, "SCALE") * 14 M_PI / 3600.0 / 180.0; // Plate scale (radians/pixel) 15 16 int x0Chip = psMetadataLookupS32(NULL, chip->concepts, "CHIP.X0"); 17 int y0Chip = psMetadataLookupS32(NULL, chip->concepts, "CHIP.Y0"); 18 int xParityChip = psMetadataLookupS32(NULL, chip->concepts, "CHIP.XPARITY"); 19 int yParityChip = psMetadataLookupS32(NULL, chip->concepts, "CHIP.YPARITY"); 20 21 int x0Cell = psMetadataLookupS32(NULL, cell->concepts, "CELL.X0"); 22 int y0Cell = psMetadataLookupS32(NULL, cell->concepts, "CELL.Y0"); 23 int xParityCell = psMetadataLookupS32(NULL, cell->concepts, "CELL.XPARITY"); 24 int yParityCell = psMetadataLookupS32(NULL, cell->concepts, "CELL.YPARITY"); 14 float scale = psMetadataLookupF32(NULL, config->arguments, "SCALE"); // plate scale in arcsec / pixel 15 scale *= M_PI / 3600.0 / 180.0; // convert plate scale to radians/pixel 25 16 26 17 int binning = psMetadataLookupS32(NULL, config->arguments, "BINNING"); // Binning in x and y … … 29 20 int xParity, yParity; 30 21 if (cell) { 22 int x0Chip = psMetadataLookupS32(NULL, cell->parent->concepts, "CHIP.X0"); 23 int y0Chip = psMetadataLookupS32(NULL, cell->parent->concepts, "CHIP.Y0"); 24 int xParityChip = psMetadataLookupS32(NULL, cell->parent->concepts, "CHIP.XPARITY"); 25 int yParityChip = psMetadataLookupS32(NULL, cell->parent->concepts, "CHIP.YPARITY"); 26 27 int x0Cell = psMetadataLookupS32(NULL, cell->concepts, "CELL.X0"); 28 int y0Cell = psMetadataLookupS32(NULL, cell->concepts, "CELL.Y0"); 29 int xParityCell = psMetadataLookupS32(NULL, cell->concepts, "CELL.XPARITY"); 30 int yParityCell = psMetadataLookupS32(NULL, cell->concepts, "CELL.YPARITY"); 31 31 32 x0 = PPSIM_FPA_TO_CELL(0.0, x0Cell, xParityCell, binning, x0Chip, xParityChip); 32 33 y0 = PPSIM_FPA_TO_CELL(0.0, y0Cell, yParityCell, binning, y0Chip, yParityChip); … … 35 36 } 36 37 if (chip) { 38 int x0Chip = psMetadataLookupS32(NULL, chip->concepts, "CHIP.X0"); 39 int y0Chip = psMetadataLookupS32(NULL, chip->concepts, "CHIP.Y0"); 40 int xParityChip = psMetadataLookupS32(NULL, chip->concepts, "CHIP.XPARITY"); 41 int yParityChip = psMetadataLookupS32(NULL, chip->concepts, "CHIP.YPARITY"); 42 37 43 x0 = PPSIM_FPA_TO_CELL(0.0, 0, 1, binning, x0Chip, xParityChip); 38 44 y0 = PPSIM_FPA_TO_CELL(0.0, 0, 1, binning, y0Chip, yParityChip);
Note:
See TracChangeset
for help on using the changeset viewer.
