IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 24, 2005, 4:48:22 PM (21 years ago)
Author:
Paul Price
Message:

Can automatically identify FITS files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/archive/scripts/src/test_pmFPARead.c

    r4386 r4395  
    2525#endif
    2626
    27     (void)psTraceSetLevel(".", 10);
     27    (void)psTraceSetLevel(".", 0);
    2828    (void)psTraceSetLevel("readMultipleRegions", 0);
    2929    (void)psTraceSetLevel("portions", 0);
    3030    (void)psTraceSetLevel("pmFPARead", 10);
    3131    (void)psTraceSetLevel("pmFPAfromHeader", 10);
     32    (void)psTraceSetLevel("pmCameraFromHeader", 10);
     33
     34
    3235
    3336    if (argc != 3) {
    34         printf("Usage: %s CONFIG IMAGE\n", argv[0]);
     37        printf("Usage: %s IPP_CONFIG IMAGE\n", argv[0]);
    3538        exit(EXIT_FAILURE);
    3639    }
    37     const char *cameraName = argv[1];
     40    const char *ipprcName = argv[1];
    3841    const char *imageName = argv[2];
    3942
    4043    int badLines = 0;                   // Number of bad lines in camera configuration
    41     psMetadata *camera = psMetadataConfigParse(NULL, &badLines, cameraName, true); // Read camera config file
     44    psMetadata *ipprc = psMetadataConfigParse(NULL, &badLines, ipprcName, true); // Read IPP config file
    4245    if (badLines > 0) {
    43         psLogMsg(__func__, PS_LOG_WARN, "%d bad lines encountered while reading camera configuration %s\n",
    44                  badLines, cameraName);
     46        psLogMsg(__func__, PS_LOG_WARN, "%d bad lines encountered while reading IPP configuration %s\n",
     47                 badLines, ipprcName);
    4548    }
    4649
    4750    psFits *fits = psFitsAlloc(imageName);
     51    psMetadata *header = psFitsReadHeader(NULL, fits);
     52
     53    psMetadata *camera = pmCameraFromHeader(header, ipprc);
     54
    4855    papFPA *fpa = pmFPARead(fits, camera, NULL);
    4956    (void)pmFPAPrint(fpa);
     
    5562    printf("Test: %d %d\n", psCellGetValueS32(fpa, "ccd15", "left", "CELL.YPARITY"),
    5663           psCellGetValueS32(fpa, "ccd15", "right", "CELL.YPARITY"));
    57 
    58 //    (void)pmFPAPrint(fpa);
    5964
    6065    // Tidy up
Note: See TracChangeset for help on using the changeset viewer.