Changeset 28003 for branches/pap/ppSim/src/ppSimSequenceObject.c
- Timestamp:
- May 18, 2010, 12:49:05 PM (16 years ago)
- Location:
- branches/pap
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
ppSim/src/ppSimSequenceObject.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/pap
- Property svn:mergeinfo changed
-
branches/pap/ppSim/src/ppSimSequenceObject.c
r24099 r28003 1 1 # include "ppSimSequence.h" 2 2 3 bool ppSimSequenceObject (FILE *simfile, FILE *inject, psMetadata *sequence, int nSeq, psRandom *rng, const char *path, const char *basename, const char *ppSimCommand, const char *injectCommand ) {3 bool ppSimSequenceObject (FILE *simfile, FILE *inject, psMetadata *sequence, int nSeq, psRandom *rng, const char *path, const char *basename, const char *ppSimCommand, const char *injectCommand, psArray *files) { 4 4 5 5 bool status; … … 34 34 // loop over the filters & exposure times 35 35 for (int i = 0; i < filters->n; i++) { 36 36 37 37 // offset parameters 38 38 float dR = psMetadataLookupF32 (&status, sequence, "OFFSET.RA"); 39 39 float dD = psMetadataLookupF32 (&status, sequence, "OFFSET.DEC"); 40 40 41 41 int nR = psMetadataLookupS32 (&status, sequence, "OFFSET.NR"); 42 42 int nD = psMetadataLookupS32 (&status, sequence, "OFFSET.ND"); 43 43 44 44 // loop over the offset sequence 45 45 for (int iR = 0; iR < nR; iR++) { … … 50 50 float R = Ro + dR*(iR - 0.5*nR + 0.5) / cos (RAD_DEG*Do) / 3600.0; 51 51 float D = Do + dD*(iD - 0.5*nD + 0.5) / 3600.0; 52 52 53 53 // dither parameters 54 54 float dr = psMetadataLookupF32 (&status, sequence, "DITHER.RA"); 55 55 float dd = psMetadataLookupF32 (&status, sequence, "DITHER.DEC"); 56 56 57 57 int nr = psMetadataLookupS32 (&status, sequence, "DITHER.NR"); 58 58 int nd = psMetadataLookupS32 (&status, sequence, "DITHER.ND"); 59 59 60 60 // loop over the dither sequence 61 61 for (int ir = 0; ir < nr; ir++) { … … 65 65 float ra = R + dr*(ir - 0.5*nr + 0.5) / cos (RAD_DEG*D) / 3600.0; 66 66 float dec = D + dd*(id - 0.5*nd + 0.5) / 3600.0; 67 67 68 68 // rotation sequence parameters 69 69 float pos_min = psMetadataLookupF32 (&status, sequence, "POS_MIN"); … … 72 72 assert (pos_delta > 0.0); 73 73 assert (pos_max >= pos_min); 74 74 75 75 // loop over rotation sequence 76 76 for (float pos = pos_min; pos <= pos_max; pos += pos_delta) { 77 77 78 78 // define the output filename 79 79 psString filename = NULL; … … 95 95 psStringAppend (&command, " -dec %f", dec); 96 96 psStringAppend (&command, " -pa %f", pos); 97 psStringAppend (&command, " -obs_mode OBJECT.%s", (char *) filters->data[i]);97 psStringAppend (&command, " -obs_mode OBJECT.%s", (char *) filters->data[i]); 98 98 99 99 double frnd = psRandomUniform(rng); 100 100 float seeing = IQmin + (IQmax - IQmin)*frnd; 101 101 102 102 psStringAppend (&command, " -seeing %f", seeing); 103 103 … … 106 106 fprintf (simfile, "%s\n", command); 107 107 psFree (command); 108 108 109 109 // define the inject command 110 110 // path should be dirname/filename 111 command = psStringCopy (injectCommand); 112 psStringAppend (&command, " %s*.fits", filename); 113 fprintf (inject, "%s\n", command); 114 psFree (command); 111 112 // we use the filename above (really the file root) to construct the filenames 113 for (int i = 0; i < files->n; i++) { 114 command = psStringCopy (injectCommand); 115 psStringAppend (&command, " %s.%s", filename, (char *) files->data[i]); 116 fprintf (inject, "%s\n", command); 117 psFree (command); 118 } 119 115 120 psFree (filename); 116 117 121 nImage ++; 118 122 }
Note:
See TracChangeset
for help on using the changeset viewer.
