IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 16, 2006, 3:50:43 PM (20 years ago)
Author:
magnier
Message:

updates from day when MHPCC CVS was down

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/config/pmConfig.c

    r7576 r7589  
    33 *  @author PAP, IfA
    44 *
    5  *  @version $Revision: 1.23 $ $Name: not supported by cvs2svn $
    6  *  @date $Date: 2006-06-15 02:24:19 $
     5 *  @version $Revision: 1.24 $ $Name: not supported by cvs2svn $
     6 *  @date $Date: 2006-06-17 01:50:43 $
    77 *
    88 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    332332            // XXX: Only stdout and stderr are provided for now; this section should be
    333333            // expanded in the future to do files, and perhaps even sockets.
    334             if (!!psLogSetDestination(psMessageDestination(argv[argNum]))) {
     334            if (!psLogSetDestination(psMessageDestination(logDest))) {
    335335                psLogMsg(__func__, PS_LOG_WARN, "Unable to set log destination to %s\n", argv[argNum]);
    336336            }
     
    546546    }
    547547    return format;
     548}
     549
     550// Work out what camera we have, based on the FITS header and a set of rules specified in the IPP
     551// configuration; return the camera configuration and format
     552psMetadata *pmConfigCameraByName(
     553    pmConfig *config,                   // The configuration
     554    const char *cameraName   // The camera name header
     555)
     556{
     557    PS_ASSERT_PTR_NON_NULL(cameraName, NULL);
     558    PS_ASSERT_PTR_NON_NULL(config, NULL);
     559
     560    psMetadata *cameras = psMetadataLookupMD(NULL, config->site, "CAMERAS");
     561    if (!cameras) {
     562        psError(PS_ERR_IO, true, "Unable to find CAMERAS in the configuration.");
     563        return NULL;
     564    }
     565
     566    char *cameraPath = psMetadataLookupStr(NULL, cameras, cameraName);
     567    if (!cameraPath) {
     568        psError(PS_ERR_IO, true, "Unable to find requested CAMERA in the configuration.");
     569        return NULL;
     570    }
     571
     572    psMetadata *camera = NULL; // Camera to test against what we've got:
     573
     574    if (!readConfig(&camera, cameraPath, cameraName)) {
     575        psLogMsg(__func__, PS_LOG_WARN, "Trouble reading reading camera configuration %s", cameraName);
     576        psFree(camera);
     577        return NULL;
     578    }
     579
     580    return camera;
    548581}
    549582
Note: See TracChangeset for help on using the changeset viewer.