IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 16, 2010, 1:00:37 PM (16 years ago)
Author:
eugene
Message:

updating ppSim to handle cameras with multiple chips (or class_id generally)

File:
1 edited

Legend:

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

    r19315 r27967  
    11# include "ppSimSequence.h"
    22
    3 bool ppSimSequenceBias (FILE *simfile, FILE *inject, psMetadata *sequence, int nSeq, psRandom *rng, const char *path, const char *basename, const char *ppSimCommand, const char *injectCommand) {
     3bool ppSimSequenceBias (FILE *simfile, FILE *inject, psMetadata *sequence, int nSeq, psRandom *rng, const char *path, const char *basename, const char *ppSimCommand, const char *injectCommand, psArray *files) {
    44
    55    bool status, setLevel, setRange;
     
    1414    int nImage = 0;
    1515    for (int i = 0; i < nImages; i++) {
    16            
     16               
    1717        // define the output filename
    1818        psString filename = NULL;
     
    3030        if (setLevel) psStringAppend (&command, " -biaslevel %f", level);
    3131        if (setRange) psStringAppend (&command, " -biasrange %f", range);
    32      
     32         
    3333        psStringAppend (&command, " %s", filename);
    3434
    3535        fprintf (simfile, "%s\n", command);
    3636        psFree (command);
    37                            
     37                               
    3838        // define the inject command
    3939        // path should be dirname/filename
    40         command = psStringCopy (injectCommand);
    41         psStringAppend (&command, " %s*.fits",    filename);
    42         fprintf (inject, "%s\n", command);
    43         psFree (command);
     40       
     41        // we use the filename above (really the file root) to construct the filenames
     42        for (int i = 0; i < files->n; i++) {
     43            command = psStringCopy (injectCommand);
     44            psStringAppend (&command, " %s.%s", filename, (char *) files->data[i]);
     45            fprintf (inject, "%s\n", command);
     46            psFree (command);
     47        }
     48
    4449        psFree (filename);
    45 
    46         nImage ++;
     50        nImage ++;
    4751    }
    4852    return true;
Note: See TracChangeset for help on using the changeset viewer.