Changeset 17672 for branches/eam_branch_20080511/ppSim/src/ppSimLoop.c
- Timestamp:
- May 13, 2008, 4:56:38 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branch_20080511/ppSim/src/ppSimLoop.c
r17630 r17672 1 1 #include "ppSim.h" 2 3 # define ESCAPE(CODE,MSG) { \ 4 psError(CODE, false, MSG); \ 5 psFree (rng); \ 6 return false; } 2 7 3 8 bool ppSimLoop(pmConfig *config) … … 8 13 pmFPAfile *file = psMetadataLookupPtr(NULL, config->files, OUTPUT_FILE); // Output file 9 14 assert(file); 15 10 16 pmFPA *fpa = file->fpa; // FPA for file 11 17 assert(fpa); 12 18 13 p pSimType type = psMetadataLookupS32(NULL, config->arguments, "TYPE"); // Type of image to simulate19 psMetadata *recipe = psMetadataLookupMetadata(NULL, config->recipes, PPSIM_RECIPE); // Recipe 14 20 15 21 psRandom *rng = psRandomAlloc(PS_RANDOM_TAUS, 0); // Random number generator 16 22 17 int binning = psMetadataLookupS32(NULL, config->arguments, "BINNING"); // Binning in x and y 18 19 // Load forced-photometry positions 20 if (type == PPSIM_TYPE_OBJECT) { 21 psArray *spots = ppSimLoadSpots (fpa, config); 22 } 23 24 // Load catalogue stars 23 char *typeStr = psMetadataLookupStr(NULL, recipe, "IMAGE.TYPE"); // Type of image to simulate 24 ppSimType type = ppSimTypeFromString (typeStr); // Type of image to simulate 25 int binning = psMetadataLookupS32(NULL, recipe, "BINNING"); // Binning in x and y 26 25 27 psArray *stars = psArrayAllocEmpty (1); 26 if (type == PPSIM_TYPE_OBJECT) {27 ppSimLoadStars (stars, fpa, config);28 }29 30 // Add random stars31 if (type == PPSIM_TYPE_OBJECT) {32 ppSimMakeStars (stars, fpa, config, rng);33 }34 35 // Add random galaxies36 28 psArray *galaxies = psArrayAllocEmpty (1); 37 29 if (type == PPSIM_TYPE_OBJECT) { 38 ppSimMakeGalaxies (galaxies, fpa, config, rng); 30 // Load forced-photometry positions 31 if (!ppSimLoadSpots (fpa, config)) ESCAPE (PS_ERR_UNKNOWN, "failed to load forced-photometry spots"); 32 33 // Load catalogue stars 34 if (!ppSimLoadStars (stars, fpa, config)) ESCAPE (PS_ERR_UNKNOWN, "failed to load catalog stars"); 35 36 // Add random stars 37 if (!ppSimMakeStars (stars, fpa, config, rng)) ESCAPE (PS_ERR_UNKNOWN, "failed to make random stars"); 38 39 // Add random galaxies 40 if (!ppSimMakeGalaxies (galaxies, fpa, config, rng)) ESCAPE (PS_ERR_UNKNOWN, "failed to make random galaxies"); 39 41 } 40 42 … … 176 178 } 177 179 178 ppSimMosaicChip(config, blankMask, view, "PPSIM.CHIP", "PPSIM.OUTPUT");179 180 180 // we perform photometry on the readouts of this chip in the output 181 181 ppSimPhotom (config, view);
Note:
See TracChangeset
for help on using the changeset viewer.
