Changeset 37421
- Timestamp:
- Sep 23, 2014, 9:53:29 AM (12 years ago)
- Location:
- branches/eam_branches/ipp-20140904/Ohana/src
- Files:
-
- 3 edited
-
libdvo/include/libdvo_astro.h (modified) (1 diff)
-
libdvo/src/coord_systems.c (modified) (4 diffs)
-
opihi/cmd.astro/csystem.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20140904/Ohana/src/libdvo/include/libdvo_astro.h
r37386 r37421 5 5 COORD_NONE, 6 6 COORD_CELESTIAL, 7 COORD_GALACTIC, 8 COORD_ECLIPTIC 7 COORD_GALACTIC, // based on Liu et al 2011 8 COORD_ECLIPTIC, 9 COORD_GALACTIC_REID_2004, // an older definition of the galactic plane 9 10 } CoordTransformSystem; 10 11 -
branches/eam_branches/ipp-20140904/Ohana/src/libdvo/src/coord_systems.c
r37386 r37421 39 39 // \delta^p_J = +27d 07' 41.7087" 40 40 // \theta_J = 122.93192526 deg 41 41 42 // these differ from the above at the several milliarcsec level 42 43 43 44 44 // These values were used in the past, but transform to/from B1950.0 … … 46 46 // transform->Xo = 282.25*RAD_DEG; 47 47 // transform->xo = 33.00; 48 49 break; 50 case COORD_GALACTIC_REID_2004: 51 52 // J2000 FK5 transformation from Reid et al 2004, ApJ 616, 872 53 transform->phi = (27.128336111 - 90.0)*RAD_DEG; // +27d 07' 42.01" (J2000) 54 transform->Xo = (192.859508333 + 90.0)*RAD_DEG; // 12h 51m 26.282s (J2000) 55 transform->xo = 32.932; 56 57 // comments from LSD code (lsd/builtins/misc.py, Mario Juric) 58 // # Appendix of Reid et al. (http://adsabs.harvard.edu/cgi-bin/bib_query?2004ApJ...616..872R) 59 // # This convention is also used by LAMBDA/WMAP (http://lambda.gsfc.nasa.gov/toolbox/tb_coordconv.cfm) 60 61 // _angp = np.radians(192.859508333) # 12h 51m 26.282s (J2000) 62 // _dngp = np.radians(27.128336111) # +27d 07' 42.01" (J2000) 63 // _l0 = np.radians(32.932) 48 64 49 65 break; … … 86 102 switch (output) { 87 103 case COORD_CELESTIAL: 88 // J2000 transformation from Liu et al 2011 ( )104 // J2000 transformation from Liu et al 2011 (A&A 526, A16) 89 105 transform->phi = 62.8717488056*RAD_DEG; 90 106 transform->Xo = 32.9319185700*RAD_DEG; 91 107 transform->xo = 282.8594812080; 108 109 // These values were used in the past, but transform to/from B1950.0 110 // transform->phi = 62.60*RAD_DEG; 111 // transform->Xo = 33.00*RAD_DEG; 112 // transform->xo = 282.25; 113 break; 114 case COORD_GALACTIC: 115 transform->phi = 0.0; 116 transform->Xo = 0.0; 117 transform->xo = 0.0; 118 transform->isIdentity = TRUE; 119 break; 120 case COORD_ECLIPTIC: 121 return NULL; 122 default: 123 abort(); 124 } 125 break; 126 case COORD_GALACTIC_REID_2004: 127 switch (output) { 128 case COORD_CELESTIAL: 129 // J2000 FK5 transformation from Reid et al 2004, ApJ 616, 872 130 transform->phi = (90.0 - 27.128336111)*RAD_DEG; // +27d 07' 42.01" (J2000) 131 transform->Xo = 32.932*RAD_DEG; 132 transform->xo = (192.859508333 + 90.0); // 12h 51m 26.282s (J2000) 92 133 93 134 // These values were used in the past, but transform to/from B1950.0 … … 143 184 Y *= RAD_DEG; 144 185 186 double cosY = cos(Y); 187 double sinY = sin(Y); 188 189 double cosX = cos(X); 190 double sinX = sin(X); 191 145 192 // recast with constants extracted: 146 sin_y = cos (Y)*sin(X)*transform->sin_phi_cos_Xo - cos(Y)*cos(X)*transform->sin_phi_sin_Xo + sin(Y)*transform->cos_phi;193 sin_y = cosY*sinX*transform->sin_phi_cos_Xo - cosY*cosX*transform->sin_phi_sin_Xo + sinY*transform->cos_phi; 147 194 cos_y = sqrt (1 - sin_y*sin_y); 148 195 149 sin_x = cos (Y)*sin(X)*transform->cos_phi_cos_Xo - cos(Y)*cos(X)*transform->cos_phi_sin_Xo - sin(Y)*transform->sin_phi;150 cos_x = cos (Y)*cos(X)*transform->cos_Xo + cos(Y)*sin(X)*transform->sin_Xo;196 sin_x = cosY*sinX*transform->cos_phi_cos_Xo - cosY*cosX*transform->cos_phi_sin_Xo - sinY*transform->sin_phi; 197 cos_x = cosY*cosX*transform->cos_Xo + cosY*sinX*transform->sin_Xo; 151 198 152 199 // atan2 returns -pi : +pi -
branches/eam_branches/ipp-20140904/Ohana/src/opihi/cmd.astro/csystem.c
r34342 r37421 13 13 if (argc != 5) goto syntax; 14 14 15 switch (argv[1][0]) { 16 case 'C': input = COORD_CELESTIAL; break; 17 case 'G': input = COORD_GALACTIC; break; 18 case 'E': input = COORD_ECLIPTIC; break; 19 default: goto syntax; 15 if (!strcmp(argv[1], "G2004")) { 16 input = COORD_GALACTIC_REID_2004; 17 } else { 18 switch (argv[1][0]) { 19 case 'C': input = COORD_CELESTIAL; break; 20 case 'G': input = COORD_GALACTIC; break; 21 case 'E': input = COORD_ECLIPTIC; break; 22 default: goto syntax; 23 } 20 24 } 21 25 22 switch (argv[2][0]) { 23 case 'C': output = COORD_CELESTIAL; break; 24 case 'G': output = COORD_GALACTIC; break; 25 case 'E': output = COORD_ECLIPTIC; break; 26 default: goto syntax; 26 if (!strcmp(argv[2], "G2004")) { 27 output = COORD_GALACTIC_REID_2004; 28 } else { 29 switch (argv[2][0]) { 30 case 'C': output = COORD_CELESTIAL; break; 31 case 'G': output = COORD_GALACTIC; break; 32 case 'E': output = COORD_ECLIPTIC; break; 33 default: goto syntax; 34 } 27 35 } 28 36
Note:
See TracChangeset
for help on using the changeset viewer.
