Changeset 19315 for trunk/ppSim/src/ppSimSequenceBias.c
- Timestamp:
- Sep 2, 2008, 9:14:17 AM (18 years ago)
- File:
-
- 1 edited
-
trunk/ppSim/src/ppSimSequenceBias.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppSim/src/ppSimSequenceBias.c
r19080 r19315 1 1 # include "ppSimSequence.h" 2 2 3 bool ppSimSequenceBias (FILE *simfile, FILE *inject, psMetadata *sequence, int nSeq, psRandom *rng, const char *path, const char *basename, c har *camera, const char *injectCommand) {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) { 4 4 5 5 bool status, setLevel, setRange; 6 7 if (camera == NULL) {8 camera = psMetadataLookupStr (&status, sequence, "CAMERA");9 }10 6 11 7 // optional details … … 19 15 for (int i = 0; i < nImages; i++) { 20 16 21 psString command = NULL; 17 // define the output filename 18 psString filename = NULL; 19 if (path) { 20 psStringAppend (&filename, "%s/%s.%03d.%03d", path, basename, nSeq, nImage); 21 } else { 22 psStringAppend (&filename, "%s.%03d.%03d", basename, nSeq, nImage); 23 } 22 24 23 psStringAppend (&command, "ppSim -type BIAS"); 24 psStringAppend (&command, " -camera %s", camera);25 // define the ppSim command 26 psString command = NULL; 25 27 26 if (setLevel) psStringAppend (&command, " -biaslevel %f", level); 27 if (setRange) psStringAppend (&command, " -biasrange %f", range); 28 psStringAppend (&command, "%s -type BIAS", ppSimCommand); 28 29 29 // XXX need to add output filename 30 psString filename = NULL; 31 if (path) { 32 psStringAppend (&filename, "%s/%s.%03d.%03d", path, basename, nSeq, nImage); 33 } else { 34 psStringAppend (&filename, "%s.%03d.%03d", basename, nSeq, nImage); 35 } 36 psStringAppend (&command, " %s", filename); 30 if (setLevel) psStringAppend (&command, " -biaslevel %f", level); 31 if (setRange) psStringAppend (&command, " -biasrange %f", range); 32 33 psStringAppend (&command, " %s", filename); 37 34 38 fprintf (simfile, "%s\n", command);39 psFree (command);35 fprintf (simfile, "%s\n", command); 36 psFree (command); 40 37 41 // path should be dirname/filename 42 command = psStringCopy (injectCommand); 43 psStringAppend (&command, " --camera %s", camera);44 psStringAppend (&command, " %s*.fits", filename);45 fprintf (inject, "%s\n", command);46 psFree (command);47 psFree (filename);38 // define the inject command 39 // path should be dirname/filename 40 command = psStringCopy (injectCommand); 41 psStringAppend (&command, " %s*.fits", filename); 42 fprintf (inject, "%s\n", command); 43 psFree (command); 44 psFree (filename); 48 45 49 nImage ++;46 nImage ++; 50 47 } 51 48 return true;
Note:
See TracChangeset
for help on using the changeset viewer.
