IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 9, 2006, 4:54:12 PM (20 years ago)
Author:
Paul Price
Message:

pmFPAMosaic testing.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppImage/src/ppTest.c

    r7361 r7476  
    8787    // Construct camera in preparation for reading
    8888    pmFPA *fpa = pmFPAConstruct(config->camera);
    89 
    90 //////////////////////////////////////////////////////////////////////////////////////////////////////////////
    91 // NEW
    92 //////////////////////////////////////////////////////////////////////////////////////////////////////////////
    93 
    94     // Add in a source file
    9589    pmFPAview *view = pmFPAAddSourceFromHeader(fpa, phu, cameraFormat);
    9690    printf("View chip: %d\n", view->chip);
    9791    printf("View cell: %d\n", view->cell);
    9892
     93//////////////////////////////////////////////////////////////////////////////////////////////////////////////
     94// The action happens here
     95//////////////////////////////////////////////////////////////////////////////////////////////////////////////
     96
     97
     98#if 1
     99    // A mosaic
     100    psMetadata *mosaicCamera = psMetadataConfigParse(NULL, NULL, "/home/mithrandir/price/ipp/config/mcshort_mosaic/camera.config", true);
     101    pmFPA *mosaicFPA = pmFPAConstruct(mosaicCamera);
     102    psMetadata *mosaicFormat = psMetadataConfigParse(NULL, NULL, "/home/mithrandir/price/ipp/config/mcshort_mosaic/format_mosaic.config", true);
     103    pmFPAview *mosaicView = pmFPAviewAlloc(0);
     104    pmFPAAddSourceFromView(mosaicFPA, mosaicView, mosaicFormat);
     105#endif
     106
    99107    // Read the FPA
    100 #if 1
    101108    pmFPARead(fpa, inFile, NULL);
    102 #else
     109
     110#if 0
    103111    psArray *chips = fpa->chips;
    104112    //pmFPAWrite(fpa, outFile, NULL, false);
    105113    for (int i = 0; i < chips->n; i++) {
    106114        pmChip *chip = chips->data[i];
     115        //pmChipRead(chip, inFile, NULL);
    107116        //pmChipWrite(chip, outFile, NULL, false);
    108117        psArray *cells = chip->cells;
     
    110119            pmCell *cell = cells->data[j];
    111120            //pmCellWrite(cell, outFile, NULL, false);
    112 #if 0
    113121            pmReadout *readout = pmReadoutAlloc(cell);
    114122            for (int z = 0; pmReadoutReadNext(readout, inFile, z, 512); z++) {
     
    120128            }
    121129            psFree(readout);
    122 #else
    123             pmCellRead(cell, inFile, NULL);
    124             printf("Read chip %d, cell %d\n", i, j);
    125 #endif
    126130        }
    127         //pmChipMosaic(chip);
    128         //psFree(chip);
     131        pmChipMosaic(mosaicFPA->chips->data[0], chip);
    129132    }
    130133#endif
    131134
     135    pmFPAMosaic(mosaicFPA, fpa);
    132136
    133137#if 1
    134     // Copy to new camera format
    135     pmFPA *newFPA = pmFPAConstruct(config->camera);
    136     psMetadata *newFormat = psMetadataConfigParse(NULL, NULL, "/home/mithrandir/price/ipp/config/mcshort/format_spliced.config", true);
    137     pmFPAAddSourceFromView(newFPA, view, newFormat);
    138     //pmFPACopyStructure(newFPA, fpa, 5, 5);
    139     pmFPACopy(newFPA, fpa);
    140     //pmConfigConformHeader(phu, newFormat);
    141     //pmHDUGenerateForFPA(newFPA);
    142     pmFPAWrite(newFPA, outFile, NULL, true, true);
    143     pmFPAPrint(newFPA, true, true);
    144     psFree(newFormat);
    145     psFree(newFPA);
     138    pmFPAWrite(mosaicFPA, outFile, NULL, true, true);
     139    pmFPAPrint(mosaicFPA, true, true);
     140    psFree(mosaicCamera);
     141    psFree(mosaicFormat);
     142    psFree(mosaicView);
     143    psFree(mosaicFPA);
    146144#endif
    147145
     146#if 1
    148147    psFitsClose(outFile);
     148#endif
     149
    149150    psFree(view);
     151    psFree(phu);
    150152    psFree(fpa);
    151153    psFree(config);
    152154    psFitsClose(inFile);
    153     psFree(phu);
    154155    psFree(cameraFormat);
    155156
     
    159160    pmConceptsDone();
    160161    pmConfigDone();
     162
     163
    161164    ppMemCheck();
    162165
Note: See TracChangeset for help on using the changeset viewer.