IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 16, 2007, 8:52:31 AM (19 years ago)
Author:
eugene
Message:

adding input psf

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppSim/src/ppSimUtils.c

    r14463 r14531  
    22
    33// Generate a header containing WCS keywords
     4// this function is called with only one of fpa, chip, cell not NULL
    45bool ppSimInitHeader(pmConfig *config,
    56                     pmFPA *fpa,
     
    1112    float dec0 = psMetadataLookupF32(NULL, config->arguments, "DEC"); // Boresight Dec (radians)
    1213    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
    2516
    2617    int binning = psMetadataLookupS32(NULL, config->arguments, "BINNING"); // Binning in x and y
     
    2920    int xParity, yParity;
    3021    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
    3132        x0 = PPSIM_FPA_TO_CELL(0.0, x0Cell, xParityCell, binning, x0Chip, xParityChip);
    3233        y0 = PPSIM_FPA_TO_CELL(0.0, y0Cell, yParityCell, binning, y0Chip, yParityChip);
     
    3536    }
    3637    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
    3743        x0 = PPSIM_FPA_TO_CELL(0.0, 0, 1, binning, x0Chip, xParityChip);
    3844        y0 = PPSIM_FPA_TO_CELL(0.0, 0, 1, binning, y0Chip, yParityChip);
Note: See TracChangeset for help on using the changeset viewer.