- Timestamp:
- Apr 20, 2014, 5:52:37 PM (12 years ago)
- Location:
- branches/eam_branches/ipp-20140402
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
ppBackground/src/ppBackgroundStackLoop.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20140402
- Property svn:mergeinfo changed
/trunk (added) merged: 36642-36643,36645,36647,36649-36651,36653,36655,36657-36666,36668-36671
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20140402/ppBackground/src/ppBackgroundStackLoop.c
r36635 r36677 9 9 10 10 #include "ppBackgroundStack.h" 11 12 #define WCS_TOLERANCE 0.001 // Tolerance for WCS 13 11 14 12 15 bool ppBackgroundStackLoop(ppBackgroundStackData *data // Run-time data … … 76 79 pmFPAview *view = pmFPAviewAlloc(0); 77 80 81 // pmHDU *phu = pmFPAviewThisPHU(view, stack->fpa); 82 psF32 exptime = 1.0; 83 exptime = psMetadataLookupF32(NULL, stack->fpa->hdu->header, "EXPTIME"); 84 78 85 // PART 1: 79 86 // Determine the extent of the model map for this stack … … 116 123 if (tp->y > data->y_max) { data->y_max = tp->y; } 117 124 118 /* data->x_min -= data->ra_min; */119 /* data->x_max -= data->ra_min; */120 /* data->y_min -= data->dec_min; */121 /* data->y_max -= data->dec_min; */122 123 124 125 psStats *stats = psStatsAlloc(PS_STAT_ROBUST_MEDIAN | PS_STAT_ROBUST_STDEV); 125 126 psImageBinning *binning = psImageBinningAlloc(); 126 binning->nXruff = 15; // Number of samples 127 binning->nYruff = 15; 128 // binning->nXfine = ceil(data->ra_max - data->ra_min) + 1; // This is the range we're looking at 129 // binning->nYfine = ceil(data->dec_max - data->dec_min) + 1; 127 binning->nXruff = 13; // Number of samples 128 binning->nYruff = 13; 130 129 binning->nXfine = ceil(data->x_max - data->x_min) + 1; 131 130 binning->nYfine = ceil(data->y_max - data->y_min) + 1; … … 142 141 P_PSIMAGE_SET_ROW0(sizeImage, data->y_min); 143 142 data->modelMap = psImageMapAlloc(sizeImage,binning,stats); 144 /* psFree(sizeImage); */145 /* data->modelMap = psImageMapNoImageAlloc( binning,stats); */146 /* P_PSIMAGE_SET_COL0(data->modelMap->map, (data->x_min - binning->nXskip) / binning->nXbin); */147 /* P_PSIMAGE_SET_ROW0(data->modelMap->map, (data->y_min - binning->nYskip) / binning->nYbin); */148 149 // force col0/row0150 /* data->modelMap->map->col0 = data->modelMap->binning->nXskip; */151 /* data->modelMap->map->row0 = data->modelMap->binning->nYskip; */152 143 153 144 // PART 2: … … 169 160 170 161 // This is where an iterative solution loop would likely start. 171 {162 for (int iterator = 0; iterator < 4; iterator++) { 172 163 // Construct the offset information 173 164 printf("Model fit!\n"); … … 298 289 psPlaneTransformApply(tp, stack->fpa->toTPA, pix); 299 290 300 model->image->data.F32[y][x] = psImageMapEval(data->modelMap,tp->x,tp->y);291 model->image->data.F32[y][x] = exptime * psImageMapEval(data->modelMap,tp->x,tp->y); 301 292 corr->image->data.F32[y][x] = readout->image->data.F32[y][x] + model->image->data.F32[y][x]; 302 293 … … 306 297 psFree(fp); 307 298 psFree(tp); 299 300 // Copy WCS (from ppStackUpdateHeader) 301 pmHDU *inHDU = pmHDUFromCell(readout->parent); 302 model->parent->hdu = pmHDUAlloc(NULL); 303 corr->parent->hdu = pmHDUAlloc(NULL); 304 pmHDU *modHDU= pmHDUFromCell(model->parent); 305 pmHDU *corHDU= pmHDUFromCell(corr->parent); 306 307 if (!modHDU || !inHDU) { 308 psWarning("Unable to find HDU at FPA level to copy wcs!"); 309 } 310 else { 311 if (!pmAstromReadWCS(stack_model->fpa,model_cell->parent,inHDU->header,1.0)) { 312 psErrorClear(); 313 psWarning("Unable to read WCS astrometry from input FPA!"); 314 } 315 else { 316 if (!modHDU->header) { 317 modHDU->header = psMetadataAlloc(); 318 } 319 if (!pmAstromWriteWCS(modHDU->header, stack_model->fpa,model_cell->parent, WCS_TOLERANCE)) { 320 psErrorClear(); 321 psWarning("Unable to read WCS astrometry from input FPA!"); 322 } 323 } 324 if (!pmAstromReadWCS(stack_corr->fpa,corr_cell->parent,inHDU->header,1.0)) { 325 psErrorClear(); 326 psWarning("Unable to read WCS astrometry from input FPA!"); 327 } 328 else { 329 if (!corHDU->header) { 330 corHDU->header = psMetadataAlloc(); 331 } 332 if (!pmAstromWriteWCS(corHDU->header, stack_corr->fpa,corr_cell->parent, WCS_TOLERANCE)) { 333 psErrorClear(); 334 psWarning("Unable to read WCS astrometry from input FPA!"); 335 } 336 } 337 } // End WCS saving. 338 339 308 340 } // Close readout 309 341 printf(" I'm done with that readout\n"); … … 335 367 psFree(view); 336 368 psFree(data->modelMap); 369 psFree(sizeImage); 337 370 } 338 371
Note:
See TracChangeset
for help on using the changeset viewer.
