Changeset 23239 for branches/cnb_branches/cnb_branch_20090215/Ohana
- Timestamp:
- Mar 9, 2009, 3:41:26 PM (17 years ago)
- Location:
- branches/cnb_branches/cnb_branch_20090215
- Files:
-
- 10 edited
- 3 copied
-
. (modified) (1 prop)
-
Ohana (modified) (1 prop)
-
Ohana/src/addstar/src/get2mass_full.c (modified) (10 diffs)
-
Ohana/src/addstar/src/sky_tessalation.c (modified) (5 diffs)
-
Ohana/src/imregister/base/get_fwhm.c (copied) (copied from trunk/Ohana/src/imregister/base/get_fwhm.c ) (1 prop)
-
Ohana/src/imregister/detrend/usage.c (copied) (copied from trunk/Ohana/src/imregister/detrend/usage.c ) (1 prop)
-
Ohana/src/imregister/imreg/load_probes.c (copied) (copied from trunk/Ohana/src/imregister/imreg/load_probes.c ) (1 prop)
-
Ohana/src/libdvo (modified) (1 prop)
-
Ohana/src/libdvo/lib (modified) (1 prop)
-
Ohana/src/libfits/lib (modified) (1 prop)
-
Ohana/src/libkapa/lib (modified) (1 prop)
-
Ohana/src/libohana/lib (modified) (1 prop)
-
Ohana/src/libtap/lib (modified) (1 prop)
Legend:
- Unmodified
- Added
- Removed
-
branches/cnb_branches/cnb_branch_20090215
- Property svn:mergeinfo changed
/branches/eam_branches/eam_branch_20090303 (added) merged: 23158,23175-23181,23202-23210,23220-23225 /trunk merged: 23211-23219,23226-23238
- Property svn:mergeinfo changed
-
branches/cnb_branches/cnb_branch_20090215/Ohana
-
Property svn:mergeinfo
set to
/trunk/Ohana merged eligible
-
Property svn:mergeinfo
set to
-
branches/cnb_branches/cnb_branch_20090215/Ohana/src/addstar/src/get2mass_full.c
r21536 r23239 1 1 # include "addstar.h" 2 2 # include "2mass.h" 3 4 // XXX check to see if desired output format is PS1_V1 or later? (use 16bit version if not?) 3 5 4 6 // fill in the data for a JHK triplet star. takes a pointer to the start of the line the … … 171 173 172 174 switch (qual) { 173 case ' X': star[0].measure.photFlags |= 0x0000; break;174 case ' U': star[0].measure.photFlags |= 0x0001; break;175 case ' F': star[0].measure.photFlags |= 0x0002; break;176 case ' E': star[0].measure.photFlags |= 0x0003; break;177 case ' A': star[0].measure.photFlags |= 0x0004; break;178 case ' B': star[0].measure.photFlags |= 0x0005; break;179 case ' C': star[0].measure.photFlags |= 0x0006; break;180 case ' D': star[0].measure.photFlags |= 0x0007; break;175 case 'A': star[0].measure.photFlags |= 0x00000001; break; // was: 0x0004 176 case 'B': star[0].measure.photFlags |= 0x00000002; break; // was: 0x0005 177 case 'C': star[0].measure.photFlags |= 0x00000004; break; // was: 0x0006 178 case 'D': star[0].measure.photFlags |= 0x00000008; break; // was: 0x0007 179 case 'E': star[0].measure.photFlags |= 0x00000010; break; // was: 0x0003 180 case 'F': star[0].measure.photFlags |= 0x00000020; break; // was: 0x0002 181 case 'U': star[0].measure.photFlags |= 0x00000040; break; // was: 0x0001 182 case 'X': star[0].measure.photFlags |= 0x00000080; break; // was: 0x0000 181 183 default: 182 184 fprintf (stderr, "error!\n"); … … 189 191 190 192 switch (qual) { 191 case '0': star[0].measure.photFlags |= 0x0000 ; break;192 case '1': star[0].measure.photFlags |= 0x00 10; break;193 case '2': star[0].measure.photFlags |= 0x00 20; break;194 case '3': star[0].measure.photFlags |= 0x00 30; break;195 case '4': star[0].measure.photFlags |= 0x00 40; break;196 case '6': star[0].measure.photFlags |= 0x00 50; break;197 case '9': star[0].measure.photFlags |= 0x00 60; break;193 case '0': star[0].measure.photFlags |= 0x00000100; break; // was: 0x0000 194 case '1': star[0].measure.photFlags |= 0x00000200; break; // was: 0x0010 195 case '2': star[0].measure.photFlags |= 0x00000400; break; // was: 0x0020 196 case '3': star[0].measure.photFlags |= 0x00000800; break; // was: 0x0030 197 case '4': star[0].measure.photFlags |= 0x00001000; break; // was: 0x0040 198 case '6': star[0].measure.photFlags |= 0x00002000; break; // was: 0x0050 199 case '9': star[0].measure.photFlags |= 0x00004000; break; // was: 0x0060 198 200 default: 199 201 fprintf (stderr, "error!\n"); … … 206 208 207 209 switch (qual) { 208 case 'p': star[0].measure.photFlags |= 0x000 0; break;209 case 'c': star[0].measure.photFlags |= 0x0 100; break;210 case 'd': star[0].measure.photFlags |= 0x0 200; break;211 case 's': star[0].measure.photFlags |= 0x0 300; break;212 case 'b': star[0].measure.photFlags |= 0x0 400; break;213 case '0': star[0].measure.photFlags |= 0x0 500; break;210 case 'p': star[0].measure.photFlags |= 0x00010000; break; // was: 0x0000 211 case 'c': star[0].measure.photFlags |= 0x00020000; break; // was: 0x0100 212 case 'd': star[0].measure.photFlags |= 0x00040000; break; // was: 0x0200 213 case 's': star[0].measure.photFlags |= 0x00080000; break; // was: 0x0300 214 case 'b': star[0].measure.photFlags |= 0x00010000; break; // was: 0x0400 215 case '0': star[0].measure.photFlags |= 0x00020000; break; // was: 0x0500 214 216 default: 215 217 fprintf (stderr, "error!\n"); … … 222 224 223 225 switch (qual) { 224 case '0': star[0].measure.photFlags &= ~0x00 08; break;225 case '1': star[0].measure.photFlags &= ~0x0008; break;226 default: star[0].measure.photFlags |= 0x00 08; break;226 case '0': star[0].measure.photFlags &= ~0x00300000; break; // was: ~0x0008 227 case '1': star[0].measure.photFlags |= 0x00100000; break; // was: ~0x0008 228 default: star[0].measure.photFlags |= 0x00200000; break; // was: 0x0008 227 229 } 228 230 return (TRUE); … … 232 234 233 235 switch (qual) { 234 case '0': star[0].measure.photFlags &= ~0x0080; break; 235 case '1': star[0].measure.photFlags &= ~0x0080; break; 236 default: 237 star[0].measure.photFlags |= 0x0080; 236 case '0': star[0].measure.photFlags &= ~0x00c00000; break; // was: ~0x0080 237 case '1': star[0].measure.photFlags |= 0x00400000; break; // was: ~0x0080 238 default: star[0].measure.photFlags |= 0x00800000; // was: 0x0080 238 239 star[0].measure.extNsigma = 100.0; 239 240 break; … … 245 246 246 247 switch (qual) { 247 case '0': star[0].measure.photFlags &= ~0x0 800; break;248 case '1': star[0].measure.photFlags &= ~0x0800; break;249 default: star[0].measure.photFlags |= 0x0 800; break;248 case '0': star[0].measure.photFlags &= ~0x03000000; break; // was: ~0x0800 249 case '1': star[0].measure.photFlags |= 0x01000000; break; // was: ~0x0800 250 default: star[0].measure.photFlags |= 0x02000000; break; // was: 0x0800 250 251 } 251 252 return (TRUE); … … 255 256 256 257 switch (qual) { 257 case '0': star[0].measure.photFlags &= ~0x 1000; break;258 case '1': star[0].measure.photFlags &= ~0x1000; break;259 default: star[0].measure.photFlags |= 0x 1000; break;258 case '0': star[0].measure.photFlags &= ~0x0c000000; break; // was: ~0x1000 259 case '1': star[0].measure.photFlags |= 0x04000000; break; // was: ~0x1000 260 default: star[0].measure.photFlags |= 0x08000000; break; // was: 0x1000 260 261 } 261 262 return (TRUE); … … 265 266 266 267 switch (qual) { 267 case '0': star[0].measure.photFlags &= ~0x 2000; break;268 case '1': star[0].measure.photFlags |= 0x 2000; break;268 case '0': star[0].measure.photFlags &= ~0x10000000; break; // was: ~0x2000 269 case '1': star[0].measure.photFlags |= 0x10000000; break; // was: 0x2000 269 270 default: abort(); 270 271 } … … 272 273 } 273 274 275 // unused photFlags: 276 // 0x0000.8000 277 // 0x0004.0000 278 // 0x0008.0000 279 // 0x2000.0000 280 // 0x4000.0000 281 // 0x8000.0000 -
branches/cnb_branches/cnb_branch_20090215/Ohana/src/addstar/src/sky_tessalation.c
r23199 r23239 240 240 // integer number of dec zones between -90 and +90 241 241 242 nDEC = 180.0 / CELLSIZE; 243 dDEC = 180.0 / nDEC; 242 // in fact, we place a single image on each pole, so the real range of dec is 180.0 - CELLSIZE: 243 244 nDEC = (180.0 - CELLSIZE) / CELLSIZE; 245 dDEC = (180.0 - CELLSIZE) / nDEC; 246 nDEC += 2; 247 248 // a test 249 // for (dec = 0.0 + 0.5*dDEC; dec < +90.0; dec += dDEC) { 244 250 245 251 // generate the a collection of rectangles for each ring 246 for (dec = -90.0 + 0.5*dDEC; dec < +90.0; dec += dDEC) {252 for (dec = -90.0; dec < +90.0 + 0.5*dDEC; dec += dDEC) { 247 253 248 254 ring = sky_rectangle_ring (dec, dDEC, &Nring); 255 if (!ring) continue; 249 256 250 257 // subdivide each image (Nx x Ny subcells) … … 529 536 SkyRectangle *sky_rectangle_ring (float dec, float dDEC, int *nring) { 530 537 531 int i, nRA, NX, NY; 532 float dRA, decLower; 538 int i, NX, NY, nRA; 533 539 SkyRectangle *ring; 540 float theta, dRA; 534 541 535 542 // 'dec' is a guess at the center of the cell; in fact, we need to choose decLower and … … 537 544 538 545 // we can determine the 'lower' bound (bound closest to the equator): 539 decLower = (dec > 0.0) ? dec - 0.5*dDEC : dec + 0.5*dDEC; 540 541 // Subdivide the 'lower' bound into an integer number of segments: 542 nRA = cos(dec*RAD_DEG) * 360.0 / CELLSIZE; // CELLSIZE is a projection size 543 dRA = 360.0 / nRA; // dRA is a size in RA degrees 546 float decLower = (dec > 0.0) ? dec - 0.5*dDEC : dec + 0.5*dDEC; 547 548 // solve for actual cellsize (\theta): tan(\delta_{n+1} - \theta/2) = tan(\delta_n + \theta/2)cos(\alpha_n / 2) 549 float decUpper = (dec > 0.0) ? dec + dDEC : dec - dDEC; 550 551 if (fabs(dec) + 0.5*dDEC > 90.0) { 552 // onPole = TRUE; 553 theta = dDEC; 554 nRA = 1; 555 dRA = theta / cos(decLower*RAD_DEG); // make a square at the pole 556 } else { 557 // onPole = FALSE; 558 // Subdivide the 'lower' bound into an integer number of segments: 559 nRA = cos(RAD_DEG*decLower) * 360.0 / CELLSIZE; // CELLSIZE is a projection size 560 dRA = 360.0 / nRA; // dRA is a size in RA degrees == \alpha_n 561 562 // tan(decUpper - theta/2) = tan(dec + theta/2) cos(dRA / 2); 563 564 // we solve this equation for theta (fairly ugly: expand the tangents into sin/cos, expand the 565 // sum-of-angle sine and cosine, multiply through, convert via half-angle formulae and write 566 // as a quadratic expression in sine(theta/2) 567 568 float sd1 = sin(RAD_DEG*decUpper); 569 float cd1 = cos(RAD_DEG*decUpper); 570 float sd2 = sin(RAD_DEG*dec); 571 float cd2 = cos(RAD_DEG*dec); 572 float k = cos(RAD_DEG*dRA/2.0); 573 574 float c1 = (sd1*cd2 + sd2*cd1)*(1.0 - k); 575 float c2 = (sd1*cd2 - sd2*cd1)*(1.0 + k); 576 float c3 = -(sd1*sd2 + cd1*cd2)*(1.0 + k); 577 578 float A = SQ(c3) + SQ(c2); 579 float B = 2*c1*c3; 580 float C = SQ(c1) - SQ(c2); 581 582 float arg = SQ(B) - 4.0*A*C; 583 584 float root; 585 586 if (dec >= 0.0) { 587 root = (-B + sqrt (arg)) / (2.0*A); 588 theta = +DEG_RAD*asin(root); 589 } else { 590 root = (-B - sqrt (arg)) / (2.0*A); 591 theta = -DEG_RAD*asin(root); 592 } 593 594 // the negative solution yields a negative cellsize 595 // float root2 = (-B - sqrt (arg)) / (2.0*A); 596 // float theta2 = DEG_RAD*asin(root2); 597 598 // test lines: 599 // float r1 = tan(RAD_DEG*(decUpper - 0.5*theta1)); 600 // float r2 = tan(RAD_DEG*(dec + 0.5*theta1)); 601 // fprintf (stdout, "%f %f %f %f %f %f %f %f %f %f %f\n", dec, decUpper, dRA, arg, root1, root2, theta1, theta2, r1, r2, k*r2); 602 } 603 fprintf (stdout, "%f %f %f x %f (%d)\n", dec, decUpper, dRA, theta, nRA); 544 604 545 605 // I think we need to return the value of dec for the next ring, but I am not sure... … … 559 619 560 620 // range values are in projected degrees 561 NX = cos(dec *RAD_DEG) * dRA* 3600.0 / SCALE;562 NY = dDEC* 3600.0 / SCALE;621 NX = cos(decLower*RAD_DEG) * dRA * 3600.0 / SCALE; 622 NY = theta * 3600.0 / SCALE; 563 623 564 624 // crpix1,crpix2 is the projection center … … 576 636 577 637 578 fprintf (stderr, "%f %f : %f %f\n",579 ring[i].coords.crval1, ring[i].coords.crval2,580 ring[i].coords.crpix1, ring[i].coords.crpix2);638 // fprintf (stderr, "%f %f : %f %f\n", 639 // ring[i].coords.crval1, ring[i].coords.crval2, 640 // ring[i].coords.crpix1, ring[i].coords.crpix2); 581 641 } 582 642 -
branches/cnb_branches/cnb_branch_20090215/Ohana/src/imregister/base/get_fwhm.c
-
Property svn:mergeinfo
set to
/branches/eam_branches/eam_branch_20090303/Ohana/src/imregister/base/get_fwhm.c merged eligible
-
Property svn:mergeinfo
set to
-
branches/cnb_branches/cnb_branch_20090215/Ohana/src/imregister/detrend/usage.c
-
Property svn:mergeinfo
set to
/branches/eam_branches/eam_branch_20090303/Ohana/src/imregister/detrend/usage.c merged eligible
-
Property svn:mergeinfo
set to
-
branches/cnb_branches/cnb_branch_20090215/Ohana/src/imregister/imreg/load_probes.c
-
Property svn:mergeinfo
set to
/branches/eam_branches/eam_branch_20090303/Ohana/src/imregister/imreg/load_probes.c merged eligible
-
Property svn:mergeinfo
set to
-
branches/cnb_branches/cnb_branch_20090215/Ohana/src/libdvo
- Property svn:ignore
-
old new 1 lib 1
-
- Property svn:ignore
-
branches/cnb_branches/cnb_branch_20090215/Ohana/src/libdvo/lib
- Property svn:ignore
-
old new 1 *.linux 2 *.lin64 3 *.sol 4 *.sun 5 *.sid 6 *.hp 7 *.irix 8 *.darwin.dylib 9 *.darwin_x86.dylib 1 *.a 2 *.so
-
- Property svn:ignore
-
branches/cnb_branches/cnb_branch_20090215/Ohana/src/libfits/lib
- Property svn:ignore
-
old new 1 *.linux 2 *.lin64 3 *.sol 4 *.sun 5 *.sid 6 *.hp 7 *.irix 8 *.darwin.dylib 9 *.darwin_x86.dylib 1 *.a 2 *.so
-
- Property svn:ignore
-
branches/cnb_branches/cnb_branch_20090215/Ohana/src/libkapa/lib
- Property svn:ignore
-
old new 1 *.linux 2 *.lin64 3 *.sol 4 *.sun 5 *.sid 6 *.hp 7 *.irix 8 *.darwin.dylib 9 *.darwin_x86.dylib 1 *.a 2 *.so
-
- Property svn:ignore
-
branches/cnb_branches/cnb_branch_20090215/Ohana/src/libohana/lib
- Property svn:ignore
-
old new 1 *.linux 2 *.lin64 3 *.sol 4 *.sun 5 *.sid 6 *.hp 7 *.irix 8 *.darwin.dylib 9 *.darwin_x86.dylib 1 *.a 2 *.so
-
- Property svn:ignore
-
branches/cnb_branches/cnb_branch_20090215/Ohana/src/libtap/lib
- Property svn:ignore
-
old new 1 *.linux 2 *.lin64 3 *.sol 4 *.sun 5 *.sid 6 *.hp 7 *.irix 8 *.darwin.dylib 9 *.darwin_x86.dylib 1 *.a 2 *.so
-
- Property svn:ignore
Note:
See TracChangeset
for help on using the changeset viewer.
