Changeset 25069 for branches/simtest_nebulous_branches/ppSim
- Timestamp:
- Aug 13, 2009, 4:08:06 PM (17 years ago)
- Location:
- branches/simtest_nebulous_branches/ppSim/src
- Files:
-
- 6 edited
-
ppSimSequence.c (modified) (1 diff)
-
ppSimSequence.h (modified) (1 diff)
-
ppSimSequenceBias.c (modified) (2 diffs)
-
ppSimSequenceDark.c (modified) (3 diffs)
-
ppSimSequenceFlat.c (modified) (3 diffs)
-
ppSimSequenceObject.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/simtest_nebulous_branches/ppSim/src/ppSimSequence.c
r23259 r25069 180 180 181 181 if (!strcasecmp (type, "BIAS")) { 182 ppSimSequenceBias (simfile, inject, sequence, i, rng, path, basename, ppSimCommandReal, injectCommandReal );182 ppSimSequenceBias (simfile, inject, sequence, i, rng, path, basename, ppSimCommandReal, injectCommandReal, camera); 183 183 continue; 184 184 } 185 185 if (!strcasecmp (type, "DARK")) { 186 ppSimSequenceDark (simfile, inject, sequence, i, rng, path, basename, ppSimCommandReal, injectCommandReal );186 ppSimSequenceDark (simfile, inject, sequence, i, rng, path, basename, ppSimCommandReal, injectCommandReal, camera); 187 187 continue; 188 188 } 189 189 if (!strcasecmp (type, "FLAT")) { 190 ppSimSequenceFlat (simfile, inject, sequence, i, rng, path, basename, ppSimCommandReal, injectCommandReal );190 ppSimSequenceFlat (simfile, inject, sequence, i, rng, path, basename, ppSimCommandReal, injectCommandReal, camera); 191 191 continue; 192 192 } 193 193 if (!strcasecmp (type, "OBJECT")) { 194 ppSimSequenceObject (simfile, inject, sequence, i, rng, path, basename, ppSimCommandReal, injectCommandReal );194 ppSimSequenceObject (simfile, inject, sequence, i, rng, path, basename, ppSimCommandReal, injectCommandReal, camera); 195 195 continue; 196 196 } -
branches/simtest_nebulous_branches/ppSim/src/ppSimSequence.h
r19315 r25069 12 12 #include <psastro.h> 13 13 14 bool ppSimSequenceBias (FILE *simfile, FILE *inject, psMetadata *sequence, int nSeq, psRandom *rng, const char *path, const char *basename, const char *ppSimCommand, const char *injectCommand );15 bool ppSimSequenceDark (FILE *simfile, FILE *inject, psMetadata *sequence, int nSeq, psRandom *rng, const char *path, const char *basename, const char *ppSimCommand, const char *injectCommand );16 bool ppSimSequenceFlat (FILE *simfile, FILE *inject, psMetadata *sequence, int nSeq, psRandom *rng, const char *path, const char *basename, const char *ppSimCommand, const char *injectCommand );17 bool ppSimSequenceObject (FILE *simfile, FILE *inject, psMetadata *sequence, int nSeq, psRandom *rng, const char *path, const char *basename, const char *ppSimCommand, const char *injectCommand );14 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); 15 bool ppSimSequenceDark (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); 16 bool ppSimSequenceFlat (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); 17 bool ppSimSequenceObject (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); 18 18 19 19 #endif -
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; -
branches/simtest_nebulous_branches/ppSim/src/ppSimSequenceDark.c
r19315 r25069 1 1 # include "ppSimSequence.h" 2 2 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 ) {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, const char *camera) { 4 4 5 5 bool status, setRate; … … 9 9 min = psMetadataLookupF32 (&status, sequence, "DARK.MIN"); 10 10 if (status) { 11 max = psMetadataLookupF32 (&status, sequence, "DARK.MAX");12 setRate = true;11 max = psMetadataLookupF32 (&status, sequence, "DARK.MAX"); 12 setRate = true; 13 13 } 14 14 … … 22 22 for (int i = 0; i < nImages->n; i++) { 23 23 24 float exptime = exptimes->data.F32[i];25 float n = nImages->data.S32[i];24 float exptime = exptimes->data.F32[i]; 25 float n = nImages->data.S32[i]; 26 26 27 for (int j = 0; j < n; j++) {27 for (int j = 0; j < n; j++) { 28 28 29 // XXX need to add output filename30 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 }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 36 37 // define the ppSim command38 psString command = NULL;37 // define the ppSim command 38 psString command = NULL; 39 39 40 psStringAppend (&command, "%s -type DARK", ppSimCommand);41 42 if (setRate) {43 double frnd = psRandomUniform(rng);44 float rate = min + (max - min)*frnd;45 psStringAppend (&command, " -darkrate %f", rate);46 }40 psStringAppend (&command, "%s -type DARK", ppSimCommand); 41 42 if (setRate) { 43 double frnd = psRandomUniform(rng); 44 float rate = min + (max - min)*frnd; 45 psStringAppend (&command, " -darkrate %f", rate); 46 } 47 47 48 psStringAppend (&command, " -exptime %f", exptime);48 psStringAppend (&command, " -exptime %f", exptime); 49 49 50 psStringAppend (&command, " %s", filename);50 psStringAppend (&command, " %s", filename); 51 51 52 fprintf (simfile, "%s\n", command); 53 psFree (command); 54 55 // define the inject command 56 // 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); 52 fprintf (simfile, "%s\n", command); 53 psFree (command); 54 55 // define the inject command 56 // path should be dirname/filename 57 // for SIMTEST camera nebulous insertion append .fits 58 // SIMMOSAIC nebulous insertions are appended with ChipXX.fits 59 // non-nebulous insertions use *.fits 60 const char *neb = "neb"; 62 61 63 nImage ++; 64 } 62 if (strncmp (path, neb, 3) == 0) { 63 64 if (strcmp (camera, "SIMTEST") == 0) { 65 command = psStringCopy (injectCommand); 66 psStringAppend (&command, " %s.fits", filename); 67 fprintf (inject, "%s\n", command); 68 69 } else if (strcmp (camera, "SIMMOSAIC") == 0) { 70 for (int i = 0; i < 2; i++) { 71 for (int j = 0; j < 2; j++) { 72 command = psStringCopy (injectCommand); 73 psStringAppend (&command, " %s.Chip%d%d.fits", filename, i, j); 74 fprintf (inject, "%s\n", command); 75 command = NULL; 76 } 77 } 78 79 } else { 80 psLogMsg ("ppSimSequence", PS_LOG_WARN, "unsupported camera type for nebulous insertion"); 81 exit (1); 82 } 83 84 } else { 85 command = psStringCopy (injectCommand); 86 psStringAppend (&command, " %s*.fits", filename); 87 fprintf (inject, "%s\n", command); 88 } 89 90 psFree (command); 91 psFree (filename); 92 nImage ++; 93 } 65 94 } 66 95 return true; -
branches/simtest_nebulous_branches/ppSim/src/ppSimSequenceFlat.c
r19315 r25069 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, const char *ppSimCommand, 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, const char *camera) { 4 4 5 5 bool status; … … 12 12 13 13 if (filters->n != exptimes->n) { 14 psLogMsg ("ppSimSequence", PS_LOG_WARN, "mis-match in filter and exptime lists");15 exit (1);14 psLogMsg ("ppSimSequence", PS_LOG_WARN, "mis-match in filter and exptime lists"); 15 exit (1); 16 16 } 17 17 … … 24 24 for (int i = 0; i < filters->n; i++) { 25 25 26 // loop over the filters & exposure times 27 for (int j = 0; j < nSetup; j++) { 28 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); 26 // loop over the filters & exposure times 27 for (int j = 0; j < nSetup; j++) { 28 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 } 36 37 // define the ppSim comand 38 psString command = NULL; 39 40 psStringAppend (&command, "%s -type FLAT", ppSimCommand); 41 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 // for SIMTEST camera nebulous insertion append .fits 53 // SIMMOSAIC nebulous insertions are appended with ChipXX.fits 54 // non-nebulous insertions use *.fits 55 const char *neb = "neb"; 56 57 if (strncmp (path, neb, 3) == 0) { 58 if (strcmp (camera, "SIMTEST") == 0) { 59 command = psStringCopy (injectCommand); 60 psStringAppend (&command, " %s.fits", filename); 61 fprintf (inject, "%s\n", command); 62 63 } else if (strcmp (camera, "SIMMOSAIC") == 0) { 64 for (int i = 0; i < 2; i++) { 65 for (int j = 0; j < 2; j++) { 66 command = psStringCopy (injectCommand); 67 psStringAppend (&command, " %s.Chip%d%d.fits", filename, i, j); 68 fprintf (inject, "%s\n", command); 69 command = NULL; 70 } 71 } 72 73 } else { 74 psLogMsg ("ppSimSequence", PS_LOG_WARN, "unsupported camera type for nebulous insertion"); 75 exit (1); 76 } 77 78 } else { 79 command = psStringCopy (injectCommand); 80 psStringAppend (&command, " %s*.fits", filename); 81 fprintf (inject, "%s\n", command); 82 } 83 84 psFree (command); 85 psFree (filename); 86 nImage ++; 35 87 } 36 37 // define the ppSim comand38 psString command = NULL;39 40 psStringAppend (&command, "%s -type FLAT", ppSimCommand);41 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 command51 // path should be dirname/filename52 command = psStringCopy (injectCommand);53 psStringAppend (&command, " %s*.fits", filename);54 fprintf (inject, "%s\n", command);55 psFree (command);56 psFree (filename);57 58 nImage ++;59 }60 88 } 61 89 return true; -
branches/simtest_nebulous_branches/ppSim/src/ppSimSequenceObject.c
r24099 r25069 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, const char *camera) { 4 4 5 5 bool status; … … 25 25 26 26 if (filters->n != exptimes->n) { 27 psLogMsg ("ppSimSequence", PS_LOG_WARN, "mis-match in filter and exptime lists");28 exit (1);27 psLogMsg ("ppSimSequence", PS_LOG_WARN, "mis-match in filter and exptime lists"); 28 exit (1); 29 29 } 30 30 … … 34 34 // loop over the filters & exposure times 35 35 for (int i = 0; i < filters->n; i++) { 36 37 // offset parameters38 float dR = psMetadataLookupF32 (&status, sequence, "OFFSET.RA");39 float dD = psMetadataLookupF32 (&status, sequence, "OFFSET.DEC");40 41 int nR = psMetadataLookupS32 (&status, sequence, "OFFSET.NR");42 int nD = psMetadataLookupS32 (&status, sequence, "OFFSET.ND");43 44 // loop over the offset sequence45 for (int iR = 0; iR < nR; iR++) {46 for (int iD = 0; iD < nD; iD++) {36 37 // offset parameters 38 float dR = psMetadataLookupF32 (&status, sequence, "OFFSET.RA"); 39 float dD = psMetadataLookupF32 (&status, sequence, "OFFSET.DEC"); 40 41 int nR = psMetadataLookupS32 (&status, sequence, "OFFSET.NR"); 42 int nD = psMetadataLookupS32 (&status, sequence, "OFFSET.ND"); 43 44 // loop over the offset sequence 45 for (int iR = 0; iR < nR; iR++) { 46 for (int iD = 0; iD < nD; iD++) { 47 47 48 // RA & DEC in degrees XXX (should be radians...)49 // offsets are in arcseconds50 float R = Ro + dR*(iR - 0.5*nR + 0.5) / cos (RAD_DEG*Do) / 3600.0;51 float D = Do + dD*(iD - 0.5*nD + 0.5) / 3600.0;52 53 // dither parameters54 float dr = psMetadataLookupF32 (&status, sequence, "DITHER.RA");55 float dd = psMetadataLookupF32 (&status, sequence, "DITHER.DEC");56 57 int nr = psMetadataLookupS32 (&status, sequence, "DITHER.NR");58 int nd = psMetadataLookupS32 (&status, sequence, "DITHER.ND");59 60 // loop over the dither sequence61 for (int ir = 0; ir < nr; ir++) {62 for (int id = 0; id < nd; id++) {48 // RA & DEC in degrees XXX (should be radians...) 49 // offsets are in arcseconds 50 float R = Ro + dR*(iR - 0.5*nR + 0.5) / cos (RAD_DEG*Do) / 3600.0; 51 float D = Do + dD*(iD - 0.5*nD + 0.5) / 3600.0; 52 53 // dither parameters 54 float dr = psMetadataLookupF32 (&status, sequence, "DITHER.RA"); 55 float dd = psMetadataLookupF32 (&status, sequence, "DITHER.DEC"); 56 57 int nr = psMetadataLookupS32 (&status, sequence, "DITHER.NR"); 58 int nd = psMetadataLookupS32 (&status, sequence, "DITHER.ND"); 59 60 // loop over the dither sequence 61 for (int ir = 0; ir < nr; ir++) { 62 for (int id = 0; id < nd; id++) { 63 63 64 // ra, dec in degrees; offsets in arcsec65 float ra = R + dr*(ir - 0.5*nr + 0.5) / cos (RAD_DEG*D) / 3600.0;66 float dec = D + dd*(id - 0.5*nd + 0.5) / 3600.0;67 68 // rotation sequence parameters69 float pos_min = psMetadataLookupF32 (&status, sequence, "POS_MIN");70 float pos_max = psMetadataLookupF32 (&status, sequence, "POS_MAX");71 float pos_delta = psMetadataLookupF32 (&status, sequence, "POS_DELTA");72 assert (pos_delta > 0.0);73 assert (pos_max >= pos_min);74 75 // loop over rotation sequence76 for (float pos = pos_min; pos <= pos_max; pos += pos_delta) {77 78 // define the output filename79 psString filename = NULL;80 if (path) {81 psStringAppend (&filename, "%s/%s.%03d.%03d", path, basename, nSeq, nImage);82 } else {83 psStringAppend (&filename, "%s.%03d.%03d", basename, nSeq, nImage);84 }64 // ra, dec in degrees; offsets in arcsec 65 float ra = R + dr*(ir - 0.5*nr + 0.5) / cos (RAD_DEG*D) / 3600.0; 66 float dec = D + dd*(id - 0.5*nd + 0.5) / 3600.0; 67 68 // rotation sequence parameters 69 float pos_min = psMetadataLookupF32 (&status, sequence, "POS_MIN"); 70 float pos_max = psMetadataLookupF32 (&status, sequence, "POS_MAX"); 71 float pos_delta = psMetadataLookupF32 (&status, sequence, "POS_DELTA"); 72 assert (pos_delta > 0.0); 73 assert (pos_max >= pos_min); 74 75 // loop over rotation sequence 76 for (float pos = pos_min; pos <= pos_max; pos += pos_delta) { 77 78 // define the output filename 79 psString filename = NULL; 80 if (path) { 81 psStringAppend (&filename, "%s/%s.%03d.%03d", path, basename, nSeq, nImage); 82 } else { 83 psStringAppend (&filename, "%s.%03d.%03d", basename, nSeq, nImage); 84 } 85 85 86 // define the ppSim command87 psString command = NULL;86 // define the ppSim command 87 psString command = NULL; 88 88 89 psStringAppend (&command, "%s -type OBJECT", ppSimCommand);90 psStringAppend (&command, " -filter %s", (char *) filters->data[i]);91 psStringAppend (&command, " -exptime %f", exptimes->data.F32[i]);92 psStringAppend (&command, " -skymags %f", skymags->data.F32[i]);89 psStringAppend (&command, "%s -type OBJECT", ppSimCommand); 90 psStringAppend (&command, " -filter %s", (char *) filters->data[i]); 91 psStringAppend (&command, " -exptime %f", exptimes->data.F32[i]); 92 psStringAppend (&command, " -skymags %f", skymags->data.F32[i]); 93 93 94 psStringAppend (&command, " -ra %f", ra);95 psStringAppend (&command, " -dec %f", dec);96 psStringAppend (&command, " -pa %f", pos);97 psStringAppend (&command, " -obs_mode OBJECT.%s", (char *) filters->data[i]);94 psStringAppend (&command, " -ra %f", ra); 95 psStringAppend (&command, " -dec %f", dec); 96 psStringAppend (&command, " -pa %f", pos); 97 psStringAppend (&command, " -obs_mode OBJECT.%s", (char *) filters->data[i]); 98 98 99 double frnd = psRandomUniform(rng);100 float seeing = IQmin + (IQmax - IQmin)*frnd;101 102 psStringAppend (&command, " -seeing %f", seeing);99 double frnd = psRandomUniform(rng); 100 float seeing = IQmin + (IQmax - IQmin)*frnd; 101 102 psStringAppend (&command, " -seeing %f", seeing); 103 103 104 psStringAppend (&command, " %s", filename);104 psStringAppend (&command, " %s", filename); 105 105 106 fprintf (simfile, "%s\n", command); 107 psFree (command); 108 109 // define the inject command 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); 115 psFree (filename); 106 fprintf (simfile, "%s\n", command); 107 psFree (command); 108 109 // define the inject command 110 // path should be dirname/filename 111 // for SIMTEST camera nebulous insertion append .fits 112 // SIMMOSAIC nebulous insertions are appended with ChipXX.fits 113 // non-nebulous insertions use *.fits 114 const char *neb = "neb"; 116 115 117 nImage ++; 118 } 119 } 120 } 116 if (strncmp (path, neb, 3) == 0) { 117 118 if (strcmp (camera, "SIMTEST") == 0) { 119 command = psStringCopy (injectCommand); 120 psStringAppend (&command, " %s.fits", filename); 121 fprintf (inject, "%s\n", command); 122 123 } else if (strcmp (camera, "SIMMOSAIC") == 0) { 124 for (int i = 0; i < 2; i++) { 125 for (int j = 0; j < 2; j++) { 126 command = psStringCopy (injectCommand); 127 psStringAppend (&command, " %s.Chip%d%d.fits", filename, i, j); 128 fprintf (inject, "%s\n", command); 129 command = NULL; 130 } 131 } 132 133 } else { 134 psLogMsg ("ppSimSequence", PS_LOG_WARN, "unsupported camera type for nebulous insertion"); 135 exit (1); 136 137 } 138 139 } else { 140 command = psStringCopy (injectCommand); 141 psStringAppend (&command, " %s*.fits", filename); 142 fprintf (inject, "%s\n", command); 143 } 144 145 psFree (command); 146 psFree (filename); 147 nImage ++; 148 } 149 } 150 } 151 } 121 152 } 122 }123 153 } 124 154 return true;
Note:
See TracChangeset
for help on using the changeset viewer.
