- Timestamp:
- Aug 13, 2009, 4:08:06 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/simtest_nebulous_branches/ppSim/src/ppSimSequenceBias.c
r19315 r25069 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, const char *ppSimCommand, 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, const char *camera) { 4 4 5 5 bool status, setLevel, setRange; … … 14 14 int nImage = 0; 15 15 for (int i = 0; i < nImages; i++) { 16 17 // define the output filename18 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 }16 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 } 24 24 25 // define the ppSim command26 psString command = NULL;25 // define the ppSim command 26 psString command = NULL; 27 27 28 psStringAppend (&command, "%s -type BIAS", ppSimCommand);28 psStringAppend (&command, "%s -type BIAS", ppSimCommand); 29 29 30 if (setLevel) psStringAppend (&command, " -biaslevel %f", level);31 if (setRange) psStringAppend (&command, " -biasrange %f", range);32 33 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); 34 34 35 fprintf (simfile, "%s\n", command); 36 psFree (command); 35 fprintf (simfile, "%s\n", command); 36 psFree (command); 37 38 // define the inject command 39 // path should be dirname/filename 40 // for SIMTEST camera nebulous insertion append .fits 41 // SIMMOSAIC nebulous insertions are appended with ChipXX.fits 42 // non-nebulous insertions use *.fits 43 const char *neb = "neb"; 44 45 if (strncmp (path, neb, 3) == 0) { 37 46 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); 47 if (strcmp (camera, "SIMTEST") == 0) { 48 command = psStringCopy (injectCommand); 49 psStringAppend (&command, " %s.fits", filename); 50 fprintf (inject, "%s\n", command); 51 52 } else if (strcmp (camera, "SIMMOSAIC") == 0) { 53 for (int i = 0; i < 2; i++) { 54 for (int j = 0; j < 2; j++) { 55 command = psStringCopy (injectCommand); 56 psStringAppend (&command, " %s.Chip%d%d.fits", filename, i, j); 57 fprintf (inject, "%s\n", command); 58 command = NULL; 59 } 60 } 61 62 } else { 63 psLogMsg ("ppSimSequence", PS_LOG_WARN, "unsupported camera type for nebulous insertion"); 64 exit (1); 65 } 66 67 } else { 68 command = psStringCopy (injectCommand); 69 psStringAppend (&command, " %s*.fits", filename); 70 fprintf (inject, "%s\n", command); 71 } 45 72 46 nImage ++; 73 psFree (command); 74 psFree (filename); 75 nImage ++; 47 76 } 48 77 return true;
Note:
See TracChangeset
for help on using the changeset viewer.
