Changeset 36649 for trunk/ppBackground/src/ppBackgroundStackLoop.c
- Timestamp:
- Apr 3, 2014, 6:11:18 PM (12 years ago)
- File:
-
- 1 edited
-
trunk/ppBackground/src/ppBackgroundStackLoop.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppBackground/src/ppBackgroundStackLoop.c
r36642 r36649 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 … … 120 123 if (tp->y > data->y_max) { data->y_max = tp->y; } 121 124 122 /* data->x_min -= data->ra_min; */123 /* data->x_max -= data->ra_min; */124 /* data->y_min -= data->dec_min; */125 /* data->y_max -= data->dec_min; */126 127 128 125 psStats *stats = psStatsAlloc(PS_STAT_ROBUST_MEDIAN | PS_STAT_ROBUST_STDEV); 129 126 psImageBinning *binning = psImageBinningAlloc(); 130 127 binning->nXruff = 13; // Number of samples 131 128 binning->nYruff = 13; 132 // binning->nXfine = ceil(data->ra_max - data->ra_min) + 1; // This is the range we're looking at133 // binning->nYfine = ceil(data->dec_max - data->dec_min) + 1;134 129 binning->nXfine = ceil(data->x_max - data->x_min) + 1; 135 130 binning->nYfine = ceil(data->y_max - data->y_min) + 1; … … 146 141 P_PSIMAGE_SET_ROW0(sizeImage, data->y_min); 147 142 data->modelMap = psImageMapAlloc(sizeImage,binning,stats); 148 /* psFree(sizeImage); */149 /* data->modelMap = psImageMapNoImageAlloc( binning,stats); */150 /* P_PSIMAGE_SET_COL0(data->modelMap->map, (data->x_min - binning->nXskip) / binning->nXbin); */151 /* P_PSIMAGE_SET_ROW0(data->modelMap->map, (data->y_min - binning->nYskip) / binning->nYbin); */152 153 // force col0/row0154 /* data->modelMap->map->col0 = data->modelMap->binning->nXskip; */155 /* data->modelMap->map->row0 = data->modelMap->binning->nYskip; */156 143 157 144 // PART 2: … … 173 160 174 161 // This is where an iterative solution loop would likely start. 175 for (int iterator = 0; iterator < 2; iterator++) {162 for (int iterator = 0; iterator < 4; iterator++) { 176 163 // Construct the offset information 177 164 printf("Model fit!\n"); … … 310 297 psFree(fp); 311 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 312 340 } // Close readout 313 341 printf(" I'm done with that readout\n"); … … 339 367 psFree(view); 340 368 psFree(data->modelMap); 369 psFree(sizeImage); 341 370 } 342 371
Note:
See TracChangeset
for help on using the changeset viewer.
