- Timestamp:
- Apr 6, 2016, 4:56:18 PM (10 years ago)
- Location:
- trunk/Ohana/src/relphot
- Files:
-
- 6 edited
-
include/relphot.h (modified) (1 diff)
-
src/RepairWarpMeasures.c (modified) (3 diffs)
-
src/relphot_objects.c (modified) (5 diffs)
-
src/select_images.c (modified) (1 diff)
-
src/setMrelCatalog.c (modified) (6 diffs)
-
src/setMrelFinal.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/relphot/include/relphot.h
r39513 r39517 639 639 int GetStackSeq (Image *image, double Rstk, double Dstk, unsigned short photcode, float X, float Y); 640 640 void sort_by_ra (double *R, double *D, int *I, int *S, int N); 641 642 void RepairWarpMeasuresOpenLogfile (); 643 void RepairWarpMeasuresCloseLogfile (); -
trunk/Ohana/src/relphot/src/RepairWarpMeasures.c
r39514 r39517 1 1 # include "relphot.h" 2 3 FILE *logfile = NULL; 4 5 void RepairWarpMeasuresOpenLogfile () { 6 7 char name[DVO_MAX_PATH]; 8 snprintf (name, DVO_MAX_PATH, "%s/repair.warp.log", HOSTDIR); 9 logfile = fopen (name, "w"); 10 if (!logfile) fprintf (stderr, "failed to open repair warp logfile %s\n", name); 11 } 12 13 void RepairWarpMeasuresCloseLogfile () { 14 if (!logfile) return; 15 fclose (logfile); 16 } 2 17 3 18 // XXX need to load_images first and generate some lookup tables … … 51 66 } 52 67 // the old imageID was wrong. replace with the new one: 68 if (logfile) fprintf (logfile, "fix stack %10.6f %10.6f %5d %6.1f %6.1f 0x%08x %d -> %d\n", average->R, average->D, measure->photcode, measure->Xccd, measure->Yccd, measure->detID, measure->imageID, image[im].imageID); 53 69 measure->imageID = image[im].imageID; 54 70 } else { … … 74 90 } 75 91 // the old imageID was wrong. replace with the new one: 92 if (logfile) fprintf (logfile, "fix stack %10.6f %10.6f %5d %6.1f %6.1f 0x%08x %d -> %d\n", average->R, average->D, measure->photcode, measure->Xccd, measure->Yccd, measure->detID, measure->imageID, image[im].imageID); 76 93 measure->imageID = image[im].imageID; 77 94 } -
trunk/Ohana/src/relphot/src/relphot_objects.c
r39513 r39517 15 15 16 16 Catalog catalog; 17 18 INITTIME; 17 19 18 20 // XXX need to decide how to determine PARALLEL mode... … … 32 34 if (db.dbstate == LCK_EMPTY) Shutdown ("ERROR: No images in catalog %s (1)", db.filename); 33 35 if (!dvo_image_load (&db, VERBOSE, FALSE)) Shutdown ("can't read image catalog %s", db.filename); 36 MARKTIME("read image table: %f sec\n", dtime); 34 37 // the raw FITS data is freed by dvo_image_load, leaving only the Image structure data 35 38 36 39 /* load regions and images based on specified sky patch (default depth) */ 37 40 load_images (&db, skylist, &UserPatch, TRUE); 41 MARKTIME("loaded images: %f sec\n", dtime); 38 42 39 43 // load the ZP corrections here … … 42 46 if (REPAIR_WARPS) { 43 47 FindWarpGroups (); 48 MARKTIME("setup warp groups: %f sec\n", dtime); 44 49 MakeStackIndex (); 50 MARKTIME("setup stack index: %f sec\n", dtime); 51 RepairWarpMeasuresOpenLogfile (); 45 52 } 46 53 … … 129 136 free_tiny_values(&catalog); 130 137 dvo_catalog_free (&catalog); 138 freeImageBins (1, FALSE); 139 freeMosaicBins (1, FALSE); 140 freeGridBins (1); 131 141 continue; 132 142 } … … 159 169 } 160 170 161 if (REPAIR_WARPS) FreeWarpGroups (); 171 if (REPAIR_WARPS) { 172 FreeWarpGroups (); 173 FreeStackGroups (); 174 RepairWarpMeasuresCloseLogfile (); 175 } 162 176 163 177 gfits_db_free (&db); -
trunk/Ohana/src/relphot/src/select_images.c
r39511 r39517 271 271 } 272 272 } 273 MARKTIME(" finish image selection: %f sec\n", dtime);273 MARKTIME("\nfinish image selection: %f sec\n", dtime); 274 274 275 275 if (VERBOSE) fprintf (stderr, "found "OFF_T_FMT" images\n", nimage); -
trunk/Ohana/src/relphot/src/setMrelCatalog.c
r39464 r39517 205 205 206 206 // ** Choose the calibration (depends on the mode : do I have an image reference or not?) 207 float Mcal = 0 , Mmos = 0, Mgrid =0;207 float Mcal = 0.0, Mmos = 0.0, Mgrid = 0.0, Mflat = 0.0; 208 208 off_t meas = measureOffset + k; 209 209 if (getImageEntry (meas, cat) < 0) { … … 215 215 } else { 216 216 // getMcal_alt returns image[].Mcal modified by flatcorr(image.photom_map_id,x,y) 217 // NOTE: getMcal_alt does not include measure.Mflat 217 218 Mcal = getMcal_alt (meas, cat, flatcorr, measureT[k].Xccd, measureT[k].Yccd); 218 219 if (isnan(Mcal)) SKIP_THIS_MEAS(Ncal); … … 221 222 Mgrid = getMgrid (meas, cat); 222 223 if (isnan(Mgrid)) SKIP_THIS_MEAS(Ngrid); 224 Mflat = isnan (measureT[k].Mflat) ? 0.0 : measureT[k].Mflat; 223 225 } 224 226 … … 244 246 if (CHECK_VALID_MAG(Map, dMap)) { 245 247 int Nap = results->aperData[Nsec].Nlist; 246 results->aperData[Nsec].flxlist[Nap] = Map - Mcal - Mmos - Mgrid;248 results->aperData[Nsec].flxlist[Nap] = Map + Mflat - Mcal - Mmos - Mgrid; 247 249 results->aperData[Nsec].errlist[Nap] = dMap; 248 250 results->aperData[Nsec].wgtlist[Nap] = useUbercalWeight ? UBERCAL_WEIGHT : 1.0; … … 259 261 if (CHECK_VALID_MAG(Mkron, dMkron)) { 260 262 int Nkron = results->kronData[Nsec].Nlist; 261 results->kronData[Nsec].flxlist[Nkron] = Mkron - Mcal - Mmos - Mgrid;263 results->kronData[Nsec].flxlist[Nkron] = Mkron + Mflat - Mcal - Mmos - Mgrid; 262 264 results->kronData[Nsec].errlist[Nkron] = dMkron; 263 265 results->kronData[Nsec].wgtlist[Nkron] = isUbercal ? UBERCAL_WEIGHT : 1.0; … … 272 274 if (CHECK_VALID_MAG(Mpsf, dMpsf)) { 273 275 int Npsf = results->psfData[Nsec].Nlist; 274 results->psfData[Nsec].flxlist[Npsf] = Mpsf - Mcal - Mmos - Mgrid;276 results->psfData[Nsec].flxlist[Npsf] = Mpsf + Mflat - Mcal - Mmos - Mgrid; 275 277 results->psfData[Nsec].errlist[Npsf] = dMpsf; 276 278 results->psfData[Nsec].wgtlist[Npsf] = isUbercal ? UBERCAL_WEIGHT : 1.0; -
trunk/Ohana/src/relphot/src/setMrelFinal.c
r39464 r39517 104 104 ALLOCATE (catalog[0].measureRank, char, catalog[0].Nmeasure); 105 105 setMeasureRank (catalog); 106 setMrelOutput (catalog, 1, flatcorr); 107 if (!simpleAverage) setMcalOutput (catalog, 1, flatcorr);106 setMrelOutput (catalog, 1, flatcorr); // sets the values secfilt.M = <measure.M + measure.Mflat - image.Mcal> 107 setMcalOutput (catalog, 1, flatcorr); // sets measure.Mcal = image.Mcal 108 108 109 109 /* clear ID_OBJ_POOR, ID_OBJ_FEW values before writing ??? */
Note:
See TracChangeset
for help on using the changeset viewer.
