IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 19042


Ignore:
Timestamp:
Aug 12, 2008, 4:32:35 PM (18 years ago)
Author:
Paul Price
Message:

Allow additional cameras besides the one recorded in config->cameraName to survive culling. This is important for pswarp, where the skycell is of a different camera type (SIMPLE).

Location:
trunk/psModules/src/config
Files:
2 edited

Legend:

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

    r19008 r19042  
    6060}
    6161
    62 bool pmConfigCamerasCull(pmConfig *config)
     62bool pmConfigCamerasCull(pmConfig *config, const char *additional)
    6363{
    6464      PS_ASSERT_PTR_NON_NULL(config, false);
     
    7070      }
    7171
    72       // Get names of the root camera and its derivatives
    73       psArray *keep = psArrayAlloc(4);
    74       keep->data[0] = pmConfigCameraRootName(config->cameraName);
    75       keep->data[1] = pmConfigCameraChipName(config->cameraName);
    76       keep->data[2] = pmConfigCameraFPAName(config->cameraName);
    77       keep->data[3] = pmConfigCameraSkycellName(config->cameraName);
     72      psArray *keep = NULL;             // List of cameras to keep
     73      if (additional) {
     74          keep = psStringSplitArray(additional, " ,;", false);
     75      }
     76      psArrayAdd(keep, 1, config->cameraName);
     77
     78      int numKeep = keep->n;            // Number of cameras to keep
     79      for (int i = 0; i < numKeep; i++) {
     80          psString orig = keep->data[i];// Original name
     81          psString root = pmConfigCameraRootName(orig); // Camera root name
     82          psString chip = pmConfigCameraChipName(config->cameraName); // Chip-mosaicked name
     83          psString fpa  = pmConfigCameraFPAName(config->cameraName); // FPA-mosaicked name
     84          psString sky  = pmConfigCameraSkycellName(config->cameraName); // Skycell name
     85
     86          // Just in case we weren't given the root name
     87          psFree(keep->data[i]);
     88          keep->data[i] = root;
     89
     90          psArrayAdd(keep, 1, chip);
     91          psArrayAdd(keep, 1, fpa);
     92          psArrayAdd(keep, 1, sky);
     93
     94          psFree(chip);
     95          psFree(fpa);
     96          psFree(sky);
     97      }
    7898
    7999      bool result = configCull(cameras, keep); // Result of culling
  • trunk/psModules/src/config/pmConfigDump.h

    r18905 r19042  
    44 *  @author Paul Price, IfA
    55 *
    6  *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
    7  *  @date $Date: 2008-08-05 02:16:06 $
     6 *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
     7 *  @date $Date: 2008-08-13 02:32:35 $
    88 *  Copyright 2005-2006 Institute for Astronomy, University of Hawaii
    99 */
     
    2424
    2525/// Cull cameras from the configuration file, apart from the one in use
    26 bool pmConfigCamerasCull(pmConfig *config ///< Configuration
     26bool pmConfigCamerasCull(pmConfig *config, ///< Configuration
     27                         const char *additional ///< List of additional cameras to save, comma-separated
    2728    );
    2829
Note: See TracChangeset for help on using the changeset viewer.