Changeset 19315 for trunk/ppSim/src/ppSimSequenceFlat.c
- Timestamp:
- Sep 2, 2008, 9:14:17 AM (18 years ago)
- File:
-
- 1 edited
-
trunk/ppSim/src/ppSimSequenceFlat.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppSim/src/ppSimSequenceFlat.c
r19080 r19315 1 1 # include "ppSimSequence.h" 2 2 3 bool ppSimSequenceFlat (FILE *simfile, FILE *inject, psMetadata *sequence, int nSeq, psRandom *rng, const char *path, const char *basename, c har *camera, const char *injectCommand) {3 bool ppSimSequenceFlat (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; 6 7 if (camera == NULL) {8 camera = psMetadataLookupStr (&status, sequence, "CAMERA");9 }10 6 11 7 // determine the filters & exposure times … … 28 24 for (int i = 0; i < filters->n; i++) { 29 25 30 // loop over the filters & exposure times31 for (int j = 0; j < nSetup; j++) {26 // loop over the filters & exposure times 27 for (int j = 0; j < nSetup; j++) { 32 28 33 psString command = NULL; 29 // define the 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 } 34 36 35 psStringAppend (&command, "ppSim -type FLAT");36 psStringAppend (&command, " -camera %s", camera);37 // define the ppSim comand 38 psString command = NULL; 37 39 38 psStringAppend (&command, " -filter %s", (char *) filters->data[i]); 39 psStringAppend (&command, " -exptime %f", exptimes->data.F32[i]); 40 psStringAppend (&command, "%s -type FLAT", ppSimCommand); 40 41 41 // XXX need to add output filename 42 psString filename = NULL; 43 if (path) { 44 psStringAppend (&filename, "%s/%s.%03d.%03d", path, basename, nSeq, nImage); 45 } else { 46 psStringAppend (&filename, "%s.%03d.%03d", basename, nSeq, nImage); 42 psStringAppend (&command, " -filter %s", (char *) filters->data[i]); 43 psStringAppend (&command, " -exptime %f", exptimes->data.F32[i]); 44 45 psStringAppend (&command, " %s", filename); 46 47 fprintf (simfile, "%s\n", command); 48 psFree (command); 49 50 // define the inject command 51 // path should be dirname/filename 52 command = psStringCopy (injectCommand); 53 psStringAppend (&command, " %s*.fits", filename); 54 fprintf (inject, "%s\n", command); 55 psFree (command); 56 psFree (filename); 57 58 nImage ++; 47 59 } 48 psStringAppend (&command, " %s", filename);49 50 51 fprintf (simfile, "%s\n", command);52 psFree (command);53 54 // path should be dirname/filename55 command = psStringCopy (injectCommand);56 psStringAppend (&command, " --camera %s", camera);57 psStringAppend (&command, " %s*.fits", filename);58 fprintf (inject, "%s\n", command);59 psFree (command);60 psFree (filename);61 62 nImage ++;63 }64 60 } 65 61 return true;
Note:
See TracChangeset
for help on using the changeset viewer.
