Changeset 36356 for trunk/ppSkycell/src/ppSkycellLoop.c
- Timestamp:
- Dec 5, 2013, 1:32:51 PM (12 years ago)
- File:
-
- 1 edited
-
trunk/ppSkycell/src/ppSkycellLoop.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppSkycell/src/ppSkycellLoop.c
r35852 r36356 139 139 psArray *imageRegions = psArrayAlloc(data->numInputs); // Region for image 140 140 psArray *regionHDUs = psArrayAlloc(data->numInputs); 141 142 psVector *exptimes = psVectorAllocEmpty(data->numInputs, PS_TYPE_F64); 143 141 144 // Determine which projection cells we have to deal with. 142 145 for (int i = 0; i < data->numInputs; i++) { … … 187 190 } 188 191 } 189 190 if (!found) { 192 193 if (!found) { // Add new projection cell if we didn't find one. 191 194 psVectorAppend(crval1, wcs->crval1); 192 195 psVectorAppend(crval2, wcs->crval2); 193 196 psVectorAppend(cdelt1, wcs->cdelt1); 194 197 psVectorAppend(cdelt2, wcs->cdelt2); 198 195 199 psRegion *projRegion = psRegionAlloc(region->x0, region->x1, region->y0, region->y1); 196 200 psArrayAdd(projRegions, projRegions->n, projRegion); … … 200 204 psArrayAdd(regionHDUs,1,hdu); 201 205 numProj++; 206 202 207 } 203 } 204 208 209 // Save exptime 210 exptimes->data.F64[i] = psMetadataLookupF64(NULL, hdu->header, "EXPTIME"); 211 } 212 213 psStats *stats = psStatsAlloc(PS_STAT_ROBUST_MEDIAN); 214 psVectorStats(stats,exptimes,NULL, NULL, 0); 215 205 216 pmFPAfileActivate(data->config->files, false, NULL); 206 217 // Loop over projections … … 304 315 } 305 316 317 // Scale by exposure time 318 double exptime_factor = pow(exptimes->data.F64[j]/stats->robustMedian,data->exptimeOrder); 319 psBinaryOp(bin1RO->image,bin1RO->image,"/", 320 psScalarAlloc(exptime_factor, PS_TYPE_F64)); 321 psBinaryOp(bin2RO->image,bin2RO->image,"/", 322 psScalarAlloc(exptime_factor, PS_TYPE_F32)); 323 // End scaling 306 324 #if (0) 307 325 psRegion *imageRegion = imageRegions->data[j]; // Region for image … … 321 339 xOffset1,yOffset1,xOffset2,yOffset2); 322 340 341 // This is where any primary code would go. I'm unclear on how it would work. 342 343 344 345 323 346 // Overlay the data onto the appropriate pixels in the final outputs 324 347 // XXX Completely neglecting rotations … … 463 486 psMetadataAddS32(Fcell1->concepts,PS_LIST_TAIL,"CELL.YPARITY", PS_META_REPLACE,"",1); 464 487 psMetadataAddS32(Fcell1->concepts,PS_LIST_TAIL,"CELL.READDIR", PS_META_REPLACE,"",1); 465 488 psMetadataAddF64(Fcell1->concepts,PS_LIST_TAIL,"EXPTIME", PS_META_REPLACE, "", stats->robustMedian); 466 489 pmReadout *Fro1 = pmReadoutAlloc(Fcell1); 467 490 Fro1->image = image1; … … 538 561 psMetadataAddS32(Fcell2->concepts,PS_LIST_TAIL,"CELL.YPARITY", PS_META_REPLACE,"",1); 539 562 psMetadataAddS32(Fcell2->concepts,PS_LIST_TAIL,"CELL.READDIR", PS_META_REPLACE,"",1); 563 psMetadataAddF64(Fcell2->concepts,PS_LIST_TAIL,"EXPTIME", PS_META_REPLACE, "", stats->robustMedian); 540 564 541 565 pmReadout *Fro2 = pmReadoutAlloc(Fcell2);
Note:
See TracChangeset
for help on using the changeset viewer.
