Changeset 18718
- Timestamp:
- Jul 24, 2008, 3:54:50 PM (18 years ago)
- Location:
- trunk/Ohana/src/opihi
- Files:
-
- 1 added
- 3 edited
-
cmd.astro/Makefile (modified) (1 diff)
-
cmd.astro/init.c (modified) (2 diffs)
-
cmd.astro/radec.c (added)
-
lib.data/convert.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/cmd.astro/Makefile
r17283 r18718 41 41 $(SRC)/precess.$(ARCH).o \ 42 42 $(SRC)/profile.$(ARCH).o \ 43 $(SRC)/radec.$(ARCH).o \ 43 44 $(SRC)/region.$(ARCH).o \ 44 45 $(SRC)/rotcurve.$(ARCH).o \ -
trunk/Ohana/src/opihi/cmd.astro/init.c
r17283 r18718 27 27 int precess PROTO((int, char **)); 28 28 int profile PROTO((int, char **)); 29 int radec PROTO((int, char **)); 29 30 int region PROTO((int, char **)); 30 31 int rotcurve PROTO((int, char **)); … … 62 63 {1, "precess", precess, "precess coordinates"}, 63 64 {1, "profile", profile, "radial profile at X, Y"}, 65 {1, "radec", radec, "convert to/from radec in hms or dd"}, 64 66 {1, "region", region, "define sky region for plot"}, 65 67 {1, "rotcurve", rotcurve, "convert CO images to polar coords"}, -
trunk/Ohana/src/opihi/lib.data/convert.c
r14590 r18718 7 7 int hh_hms (double hh, int *hr, int *mn, double *sc) { 8 8 9 int flag;9 int N, flag; 10 10 11 11 flag = SIGN(hh); 12 hh *= flag; 13 hh = 24.0*(hh/24.0 - (int)(hh/24.0)); 14 *sc = 60.0*(60.0*hh - (int)(60.0*hh)); 15 *mn = 60.0*(hh - (int)hh); 12 hh = fabs(hh); 13 14 // rationalize hh to range -24.0 < hh < 24.0 15 if (hh >= 24.0) { 16 N = (int)(hh/24.0); 17 hh -= 24.0*N; 18 } 19 16 20 *hr = (int) hh; 21 *mn = (int) 60*(hh - *hr); 22 *sc = 3600.0*(hh - *hr - *mn / 60.0); 23 if (*sc > 59.99) { 24 *sc = 0.0; 25 *mn += 1.0; 26 } 17 27 *hr *= flag; 18 28 return (TRUE); … … 49 59 sprintf (line, "-%02d:%02d:%05.2f", abs(hr), mn, sc); 50 60 } else { 51 sprintf (line, " %02d:%02d:%05.2f", hr, mn, sc);61 sprintf (line, "+%02d:%02d:%05.2f", hr, mn, sc); 52 62 } 53 63 } … … 64 74 sprintf (line, "-%02d:%02d:%05.2f", abs(dg), mn, sc); 65 75 } else { 66 sprintf (line, " %02d:%02d:%05.2f", dg, mn, sc);76 sprintf (line, "+%02d:%02d:%05.2f", dg, mn, sc); 67 77 } 68 78 return (TRUE);
Note:
See TracChangeset
for help on using the changeset viewer.
