Changeset 36406
- Timestamp:
- Dec 18, 2013, 11:53:21 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/bills_branches/bills_201312/psphot/src/psmakecff.c
r36375 r36406 2 2 # include <config.h> 3 3 # endif 4 5 // psmakecff : A program to make read a cmf file and write a cff file 6 // The real work is done in psModules. 4 7 5 8 #include <stdio.h> … … 8 11 #include "psphot.h" 9 12 13 // For simplicilty, this program's (simple) functions are all contained in this file. 10 14 static pmConfig* psmakecffArguments(int, char**); 11 15 static bool psmakecffParseCamera(pmConfig *); … … 25 29 // psphotVersionPrint(); 26 30 27 // load input data (config and images (signal, noise, mask)28 31 if (!psmakecffParseCamera (config)) { 29 32 psErrorStackPrint(stderr, "Error setting up the camera\n"); … … 31 34 } 32 35 33 // call psphot for each readout34 36 if (!psmakecffImageLoop (config)) { 35 37 psErrorStackPrint(stderr, "Error in the psphot image loop\n"); … … 37 39 } 38 40 39 // psLogMsg ("psphot", PS_LOG_WARN, "complete psphot run: %f sec\n", psTimerMark ("complete"));40 41 // psErrorCode exit_status = psphotGetExitStatus();42 // psphotCleanup (config);43 41 exit (0); 44 42 } … … 73 71 return config; 74 72 } 73 75 74 static bool psmakecffParseCamera(pmConfig *config) { 76 75 bool status = false; … … 127 126 psAssert (recipe, "missing recipe?"); 128 127 129 // psImageMaskType maskTest = psMetadataLookupImageMask(&status, recipe, "MASK.PSPHOT");130 128 131 129 // for psphot, we force data to be read at the chip level 132 130 while ((chip = pmFPAviewNextChip (view, input->fpa, 1)) != NULL) { 133 psLogMsg ("psmakec mf", 4, "Chip %d: %x %x\n", view->chip, chip->file_exists, chip->process);131 psLogMsg ("psmakecff", 4, "Chip %d: %x %x\n", view->chip, chip->file_exists, chip->process); 134 132 if (! chip->process || ! chip->file_exists) { continue; } 135 133 136 #ifdef notdef137 pmFPAfileActivate (config->files, false, NULL);138 pmFPAfileActivate (config->files, true, "PSPHOT.LOAD");139 #endif140 134 if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) ESCAPE ("failed input for Chip in psmakecff."); 141 135 142 136 // there is now only a single chip (multiple readouts?). loop over it and process 143 137 while ((cell = pmFPAviewNextCell (view, input->fpa, 1)) != NULL) { 144 psLogMsg ("psmakec mf", 5, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process);138 psLogMsg ("psmakecff", 5, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process); 145 139 146 140 // process each of the readouts 147 141 while ((readout = pmFPAviewNextReadout (view, input->fpa, 1)) != NULL) { 148 psLogMsg ("psmakec mf", 6, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process);142 psLogMsg ("psmakecff", 6, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process); 149 143 if (! readout->data_exists) { continue; } 150 144 151 145 pmHDU *hdu = pmHDUGetHighest(input->fpa, chip, cell); 152 146 if (hdu && hdu != lastHDU) { 147 // XXX: probably should do this 153 148 // psphotVersionHeaderFull(hdu->header); 154 149 lastHDU = hdu; … … 157 152 158 153 } 159 // Defer output and closing of files until we've (possibly) done the NFrames analysis below160 // pmFPAfileActivate (config->files, false, NULL);161 162 154 if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) ESCAPE ("failed pmFPAfileIOChecks for Chip in psmakecff."); 163 155 } 164 156 if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) ESCAPE ("failed pmFPAfileIOChecks for FPA in psphot."); 165 157 166 // fail if we failed to handle anerror158 // fail if we encountered an unhandled error 167 159 if (psErrorCodeLast() != PS_ERR_NONE) psAbort ("failed to handle an error!"); 168 160
Note:
See TracChangeset
for help on using the changeset viewer.
