IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 18, 2010, 12:49:05 PM (16 years ago)
Author:
eugene
Message:

merging changes from trunk into branches/pap

Location:
branches/pap
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/pap

  • branches/pap/ppSim/src/ppSimSequenceDark.c

    r19315 r28003  
    11# include "ppSimSequence.h"
    22
    3 bool ppSimSequenceDark (FILE *simfile, FILE *inject, psMetadata *sequence, int nSeq, psRandom *rng, const char *path, const char *basename, const char *ppSimCommand, const char *injectCommand) {
     3bool ppSimSequenceDark (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, setRate;
     
    3939
    4040            psStringAppend (&command, "%s -type DARK", ppSimCommand);
    41      
     41         
    4242            if (setRate) {
    4343                double frnd = psRandomUniform(rng);
     
    5252            fprintf (simfile, "%s\n", command);
    5353            psFree (command);
    54                            
     54                               
    5555            // define the inject command
    5656            // path should be dirname/filename
    57             command = psStringCopy (injectCommand);
    58             psStringAppend (&command, " %s*.fits",    filename);
    59             fprintf (inject, "%s\n", command);
    60             psFree (command);
    61             psFree (filename);
     57       
     58            // we use the filename above (really the file root) to construct the filenames
     59            for (int i = 0; i < files->n; i++) {
     60                command = psStringCopy (injectCommand);
     61                psStringAppend (&command, " %s.%s", filename, (char *) files->data[i]);
     62                fprintf (inject, "%s\n", command);
     63                psFree (command);
     64            }
    6265
    63             nImage ++;
    64         }
     66            psFree (filename);
     67            nImage ++;
     68        }
    6569    }
    6670    return true;
Note: See TracChangeset for help on using the changeset viewer.