Changeset 37531
- Timestamp:
- Oct 27, 2014, 2:44:02 PM (12 years ago)
- Location:
- branches/eam_branches/ipp-20140904/Ohana/src
- Files:
-
- 15 edited
-
dvomerge/src/dvorepairCPT.c (modified) (1 diff)
-
dvomerge/src/dvorepairDeleteImageList.c (modified) (1 diff)
-
dvomerge/src/dvorepairFixTables.c (modified) (1 diff)
-
fakeastro/src/fit_fake_stars.c (modified) (3 diffs)
-
fakeastro/src/get_image_patch.c (modified) (3 diffs)
-
fakeastro/src/make_fake_images.c (modified) (1 diff)
-
fakeastro/src/make_fake_stars.c (modified) (2 diffs)
-
fakeastro/src/make_fake_stars_catalog.c (modified) (3 diffs)
-
libdvo/src/BoundaryTree.c (modified) (1 diff)
-
libdvo/src/coordops.c (modified) (2 diffs)
-
libdvo/src/skyregion_ops.c (modified) (2 diffs)
-
opihi/dvo/objectcoverage.c (modified) (1 diff)
-
opihi/dvo/skycoverage.c (modified) (1 diff)
-
relastro/src/UpdateObjects.c (modified) (2 diffs)
-
relphot/src/MosaicOps.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20140904/Ohana/src/dvomerge/src/dvorepairCPT.c
r37046 r37531 119 119 thisImage = MatchImage (image, Nimage, measure[i].t, measure[i].photcode, measure[i].imageID); 120 120 XY_to_RD (&average[Nave].R, &average[Nave].D, measure[i].Xccd, measure[i].Yccd, &thisImage[0].coords); 121 average[Nave].R = ohana_normalize_angle (average[Nave].R); 121 122 122 123 average[Nave].Nmeasure = 1; -
branches/eam_branches/ipp-20140904/Ohana/src/dvomerge/src/dvorepairDeleteImageList.c
r37378 r37531 400 400 thisImage = MatchImage (image, Nimage, measure[i].t, measure[i].photcode, measure[i].imageID); 401 401 XY_to_RD (&average[Nave].R, &average[Nave].D, measure[i].Xccd, measure[i].Yccd, &thisImage[0].coords); 402 average[Nave].R = ohana_normalize_angle (average[Nave].R); 402 403 403 404 average[Nave].Nmeasure = 1; -
branches/eam_branches/ipp-20140904/Ohana/src/dvomerge/src/dvorepairFixTables.c
r37046 r37531 259 259 thisImage = MatchImage (image, Nimage, measure[i].t, measure[i].photcode, measure[i].imageID); 260 260 XY_to_RD (&average[Nave].R, &average[Nave].D, measure[i].Xccd, measure[i].Yccd, &thisImage[0].coords); 261 average[Nave].R = ohana_normalize_angle (average[Nave].R); 261 262 262 263 average[Nave].Nmeasure = 1; -
branches/eam_branches/ipp-20140904/Ohana/src/fakeastro/src/fit_fake_stars.c
r37527 r37531 25 25 if (Nstars > 24) order_use = 2; // 6 stars per cell 26 26 if (Nstars > 63) order_use = 3; // 7 stars per cell 27 if (Nstars > 128) order_use = 4; // 8 stars per cell28 if (Nstars > 225) order_use = 5; // 9 stars per cell29 if (Nstars > 360) order_use = 6; // 10 stars per cell27 // if (Nstars > 128) order_use = 4; // 8 stars per cell 28 // if (Nstars > 225) order_use = 5; // 9 stars per cell 29 // if (Nstars > 360) order_use = 6; // 10 stars per cell 30 30 if (order_use < 1) { 31 31 fprintf (stderr, "insufficient measurements (%d) for linear fit\n", Nstars); … … 86 86 XY_to_LM (&Le, &Me, 0.0, 4850.0, &image[0].coords); 87 87 88 fprintf (stderr, "%s : (dL,dM)_1 : %f : (dL,dM)_2 : %f\n", image->name, hypot(Le-Lo, Me-Mo), hypot(Ls-Lo, Ms-Mo));88 if (FALSE) fprintf (stderr, "%s : (dL,dM)_1 : %f : (dL,dM)_2 : %f\n", image->name, hypot(Le-Lo, Me-Mo), hypot(Ls-Lo, Ms-Mo)); 89 89 } 90 90 … … 134 134 // if we have fitted the map above, Npolyterms needs to be -1 here: 135 135 XY_to_RD (&stars[i].average.R, &stars[i].average.D, stars[i].measure.Xccd, stars[i].measure.Yccd, &image[0].coords); 136 stars[i].average.R = ohana_normalize_angle (stars[i].average.R); 136 137 } 137 138 -
branches/eam_branches/ipp-20140904/Ohana/src/fakeastro/src/get_image_patch.c
r37467 r37531 20 20 XY_to_RD (&R, &D, Xpt[i]*image->NX, Ypt[i]*image->NY, &image->coords); 21 21 22 // fprintf (stderr, "%f %f -> %f %f\n", Xpt[i]*image->NX, Ypt[i]*image->NY, R, D); 22 23 Rmin = MIN(R,Rmin); 23 24 Rmax = MAX(R,Rmax); … … 32 33 region->Dmin = Dmin; 33 34 region->Dmax = Dmax; 35 36 // fprintf (stderr, "%f %f , %f %f\n", Rmin, Rmax, Dmin, Dmax); 34 37 35 38 return region; … … 48 51 int SkyRegionsOverlap (SkyRegion *region, SkyRegion *patch) { 49 52 50 if (region->Rmin >= patch->Rmax) return FALSE; 51 if (region->Rmax <= patch->Rmin) return FALSE; 53 // what are the assumptions? 54 // * patch->Rmin,Rmax are on the same side of the boundary 55 // * [-2,-1], [-2,+1], [358,361] : all OK 56 // * [358, 2] : NOT OK 57 58 myAssert (patch->Rmin <= patch->Rmax, "impossible!"); 59 52 60 if (region->Dmin >= patch->Dmax) return FALSE; 53 61 if (region->Dmax <= patch->Dmin) return FALSE; 62 63 int keepR0 = FALSE; 64 int keepR1 = FALSE; 65 int keepR2 = FALSE; 66 if (patch->Rmin < 0.0) { 67 float Rmin = patch->Rmin + 360.0; 68 float Rmax = patch->Rmax + 360.0; 69 keepR0 = (Rmin <= region->Rmax) && (Rmax >= region->Rmin); 70 } 71 if (patch->Rmax > 360.0) { 72 float Rmin = patch->Rmin - 360.0; 73 float Rmax = patch->Rmax - 360.0; 74 keepR1 = (Rmin <= region->Rmax) && (Rmax >= region->Rmin); 75 } 76 keepR2 = (patch->Rmin <= region->Rmax) && (patch->Rmax >= region->Rmin); 77 78 int keep = keepR0 || keepR1 || keepR2; 79 80 if (!keep) return FALSE; 54 81 return TRUE; 55 82 } -
branches/eam_branches/ipp-20140904/Ohana/src/fakeastro/src/make_fake_images.c
r37527 r37531 71 71 // gpc1-specific (assumes grizy map to 10101, etc) 72 72 fakeImage[N].photcode = fakeImage[0].photcode + iy*10 + ix; 73 74 char *ptr = strstr (fakeImage[N].name, "[PHU]"); 75 if (ptr) { 76 snprintf (ptr, 7, "[XY%d%d]", ix, iy); 77 } 73 78 N++; 74 79 } -
branches/eam_branches/ipp-20140904/Ohana/src/fakeastro/src/make_fake_stars.c
r37464 r37531 5 5 // patch is generous region around image, but limited ot this image 6 6 SkyRegion *imagePatch = get_image_patch (image); 7 8 // fprintf (stderr, "image patch: %f %f , %f %f\n", imagePatch->Rmin, imagePatch->Rmax, imagePatch->Dmin, imagePatch->Dmax); 7 9 8 10 int Nstars = 0; … … 14 16 // skylist matches catalog 15 17 18 // fprintf (stderr, "try catalog: %f %f , %f %f : ", skylist[0].regions[i][0].Rmin, skylist[0].regions[i][0].Rmax, skylist[0].regions[i][0].Dmin, skylist[0].regions[i][0].Dmax); 19 16 20 // XXX check that catalog overlaps patch 17 if (!SkyRegionsOverlap(skylist[0].regions[i], imagePatch)) continue; 21 if (!SkyRegionsOverlap(skylist[0].regions[i], imagePatch)) { continue; } 22 // fprintf (stderr, "skip\n"); 23 // fprintf (stderr, "keep\n"); 18 24 19 25 // generate fake measurements for this image -
branches/eam_branches/ipp-20140904/Ohana/src/fakeastro/src/make_fake_stars_catalog.c
r37523 r37531 50 50 StarPar *starpar = catalog->starpar; 51 51 52 double Rmid = 0.5*(imagePatch->Rmin + imagePatch->Rmax); 53 52 54 int i; 53 55 for (i = 0; i < catalog->Naverage; i++) { 54 56 55 57 // true position from src catalog 56 if (!IN_PATCH(imagePatch, average[i].R, average[i].D)) continue; 58 double ra = ohana_normalize_angle_to_midpoint (average[i].R, Rmid); 59 60 // int show = !strcmp (image->name, "o6600g0127o.672655.cm.955522.smf[XY01]") && ((average[i].R < 1.0) || (average[i].R > 359.0)); 61 int show = FALSE; 62 63 if (show) fprintf (stderr, "try: %f (%f) %f : %f %f , %f %f", average[i].R, ra, average[i].D, imagePatch->Rmin, imagePatch->Rmax, imagePatch->Dmin, imagePatch->Dmax); 64 65 if (!IN_PATCH(imagePatch, ra, average[i].D)) { 66 if (show) fprintf (stderr, "\n"); 67 continue; 68 } 69 if (show) fprintf (stderr, " * \n"); 57 70 58 71 int nStar = average[i].starparOffset; … … 85 98 // tzero, timeRef are in UNIX seconds, Toffset should be in years 86 99 double Toffset = (image->tzero - timeRef) / 365.25 / 86400.0; 100 // Toffset = 0.0; // XXX TEST 87 101 88 102 // uR,uD in linear (arcsec / yr) … … 100 114 double Dobs = Dtru + dDoff; 101 115 116 Robs = ohana_normalize_angle (Robs); 117 102 118 double X, Y; 103 119 RD_to_XY (&X, &Y, Robs, Dobs, &image->coords); 120 121 if ((fabs(Robs) < 0.1) || (fabs(Robs - 360.0) < 0.1)) { 122 // fprintf (stderr, "%f %f : %f %f : %f %f\n", Rtru, Dtru, Robs, Dobs, X, Y); 123 } 124 104 125 if (X < 0) continue; 105 126 if (Y < 0) continue; 106 127 if (X > image->NX) continue; 107 128 if (Y > image->NY) continue; 129 130 if (!strcmp (image->name, "o6600g0127o.672655.cm.955522.smf[XY01]")) { 131 // fprintf (stderr, "keep: %f %f\n", average[i].R, average[i].D); 132 } 108 133 109 134 stars[Nstars].measure.Xccd = X; -
branches/eam_branches/ipp-20140904/Ohana/src/libdvo/src/BoundaryTree.c
r37116 r37531 371 371 int BoundaryTreeCellCoords (BoundaryTree *tree, int *zone, int *band, double ra, double dec) { 372 372 373 ra = ohana_normalize_angle (ra); 374 373 375 // first, find the containing zone 374 376 -
branches/eam_branches/ipp-20140904/Ohana/src/libdvo/src/coordops.c
r37402 r37531 174 174 *dec = DEG_RAD*delta; 175 175 176 *ra = ohana_normalize_angle (*ra);176 // *ra = ohana_normalize_angle (*ra); 177 177 178 178 return (TRUE); … … 207 207 *dec = delta + coords[0].crval2; 208 208 209 *ra = ohana_normalize_angle (*ra);209 // *ra = ohana_normalize_angle (*ra); 210 210 211 211 return (TRUE); -
branches/eam_branches/ipp-20140904/Ohana/src/libdvo/src/skyregion_ops.c
r37514 r37531 268 268 } 269 269 270 if( Rmax > (Rmin+180.)) {271 272 double temp = Rmax;273 Rmax = Rmin;274 Rmin = temp;275 }276 277 270 list = SkyListByBounds (table, depth, Rmin, Rmax, Dmin, Dmax); 278 271 … … 283 276 } 284 277 278 // a region like -10 10 0 20 will become 350 10 0 20 and return all regions on both sides of 0,360 285 279 SkyList *SkyListByBounds (SkyTable *table, int depth, double Rmin, double Rmax, double Dmin, double Dmax) { 286 280 -
branches/eam_branches/ipp-20140904/Ohana/src/opihi/dvo/objectcoverage.c
r37386 r37531 163 163 for (xs = 0; xs < Nx; xs++) { 164 164 status = XY_to_RD (&r, &d, (double)(xs), (double)(ys), &coords); 165 status &= (r >= 0); 166 status &= (r <= 360); 165 r = ohana_normalize_angle (r); 167 166 if (status) { 168 167 V[ys*Nx + xs] = ShowDensity ? 0 : 2; -
branches/eam_branches/ipp-20140904/Ohana/src/opihi/dvo/skycoverage.c
r37386 r37531 227 227 for (xs = 0; xs < Nx; xs++) { 228 228 status = XY_to_RD (&r, &d, (double)(xs), (double)(ys), &coords); 229 status &= (r >= 0);230 status &= (r <= 360); 229 r = ohana_normalize_angle (r); 230 231 231 // are we in a part of the projection covering the sky or not? 232 232 if (status) { -
branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/UpdateObjects.c
r37455 r37531 357 357 XY_to_RD (&fitPM.Ro, &fitPM.Do, fitPM.Ro, fitPM.Do, &coords); 358 358 if (XVERB) fprintf (stderr, "project: %f %f : %f %f : %f\n", fitPM.Ro, fitPM.Do, fitPM.uR, fitPM.uD, fitPM.p); 359 if (fabs(fitPM.Ro) < 0.01) fprintf (stderr, "watch out for 0,360 boundary\n"); 360 // XXX : does this make sense at 0,360 boundary? 359 361 360 362 fitPM.p = fitPM.dp = 0.0; … … 408 410 average[0].flags |= ID_STAR_FIT_PAR; 409 411 fitStats->Npar ++; 412 413 if (fabs(fitPM.Ro) < 0.01) fprintf (stderr, "watch out for 0,360 boundary\n"); 410 414 411 415 // XXX a hard-wired hack... -
branches/eam_branches/ipp-20140904/Ohana/src/relphot/src/MosaicOps.c
r37386 r37531 641 641 Dmax = MAX (Dmax, D); 642 642 643 // XXX : this probably does not handle mosaics at RA = 0,360 well 644 643 645 /* we are using mosaic.Mcal, not image.Mcal. reset image.Mcal */ 644 646
Note:
See TracChangeset
for help on using the changeset viewer.
