Changeset 5900
- Timestamp:
- Jan 4, 2006, 10:00:28 PM (21 years ago)
- Location:
- trunk/Ohana/src
- Files:
-
- 13 edited
-
addstar/include/addstar.h (modified) (1 diff)
-
addstar/src/rfits.c (modified) (1 diff)
-
addstar/src/rtext.c (modified) (1 diff)
-
libautocode/generate (modified) (2 diffs)
-
libdvo/src/skyregion_io.c (modified) (2 diffs)
-
opihi/dvo/Makefile (modified) (1 diff)
-
opihi/dvo/catdir.c (modified) (1 diff)
-
opihi/dvo/dvo.c (modified) (3 diffs)
-
opihi/dvo/init.c (modified) (2 diffs)
-
opihi/dvo/region_list.c (modified) (2 diffs)
-
opihi/include/shell.h (modified) (1 diff)
-
opihi/lib.shell/opihi.c (modified) (2 diffs)
-
opihi/lib.shell/startup.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/addstar/include/addstar.h
r5585 r5900 130 130 Stars *rd_gsc PROTO((char *filename, int *nstars)); 131 131 int replace_match PROTO((Average *average, Measure *measure, Stars *star)); 132 Stars *rfits PROTO((FILE *f, int *nstars));133 Stars *rtext PROTO((FILE *f, int *nstars));132 Stars *rfits PROTO((FILE *f, unsigned int *nstars)); 133 Stars *rtext PROTO((FILE *f, unsigned int *nstars)); 134 134 void save_pt_catalog PROTO((Catalog *catalog)); /*** choose new name ***/ 135 135 double scat_subpix PROTO((double x, double y)); -
trunk/Ohana/src/addstar/src/rfits.c
r4864 r5900 1 1 # include "addstar.h" 2 2 3 Stars *rfits (FILE *f, int *nstars) {3 Stars *rfits (FILE *f, unsigned int *nstars) { 4 4 5 5 int i, Nstars; -
trunk/Ohana/src/addstar/src/rtext.c
r4844 r5900 4 4 # define BLOCK 1000 5 5 6 Stars *rtext (FILE *f, int *nstars) {6 Stars *rtext (FILE *f, unsigned int *nstars) { 7 7 8 8 int j, N, Nextra, Ninstar, Nskip, Nbytes, nbytes; -
trunk/Ohana/src/libautocode/generate
r5448 r5900 119 119 if ($type eq "unsigned int") { $pt1 = "J"; } 120 120 if ($type eq "e_time") { $pt1 = "J"; } 121 if ($type eq "e_void") { $pt1 = "L"; }122 # e_void is a 64 bit pointer, cast to size_t123 121 if ($type eq "float") { $pt1 = "E"; } 124 122 if ($type eq "double") { $pt1 = "D"; } 123 124 if ($type eq "e_void") { $pt1 = "B"; $Np = 8*$Np; } 125 # e_void is a 64 bit pointer, cast to size_t. its value is not loaded 126 # from the table. 127 125 128 if (!$pt1) { die "unknown type $type"; } 126 129 … … 190 193 if ($type eq "unsigned int") { $pt1 = sprintf "I%s", $length; } 191 194 if ($type eq "e_time") { $pt1 = sprintf "I%s", $length; } 192 if ($type eq "e_void") { $pt1 = sprintf "I%s", $length; }193 195 if ($type eq "float") { $pt1 = sprintf "F%s", $length; } 194 196 if ($type eq "double") { $pt1 = sprintf "F%s", $length; } 197 198 if ($type eq "e_void") { $pt1 = sprintf "I%s", $length; } 199 195 200 if (!$pt1) { die "unknown type $type"; } 196 201 -
trunk/Ohana/src/libdvo/src/skyregion_io.c
r5451 r5900 90 90 int status; 91 91 92 /* first option: catdir/SkyTable.fits */ 92 /* first option: CATDIR/SkyTable.fits */ 93 sprintf (filename, "%s/SkyTable.fits", catdir); 94 if (stat (filename, &filestat)) goto SKYFILE; 95 if (!check_file_access (filename, FALSE, verbose)) goto SKYFILE; 96 sky = SkyTableLoad (filename, verbose); 97 if (sky == NULL) { 98 fprintf (stderr, "error loading sky table\n"); 99 exit (1); 100 } 101 return (sky); 102 103 SKYFILE: 104 /* second option: SKYFILE */ 105 if (skyfile == NULL) goto GSCFILE; 106 if (skyfile[0] != 0) goto GSCFILE; 107 if (stat (skyfile, &filestat)) goto GSCFILE; 108 if (!check_file_access (skyfile, FALSE, verbose)) goto GSCFILE; 109 sky = SkyTableLoad (skyfile, verbose); 110 if (sky == NULL) { 111 fprintf (stderr, "error loading sky table\n"); 112 exit (1); 113 } 114 /* set the depths to the default depth */ 115 SkyTableSetDepth (sky, depth); 116 117 /* create CATDIR copy */ 93 118 sprintf (filename, "%s/SkyTable.fits", catdir); 94 119 check_file_access (filename, FALSE, verbose); 120 SkyTableSave (sky, filename); 121 fits_convert_SkyRegion (sky[0].regions, sizeof (SkyTable), sky[0].Nregions); 122 return (sky); 95 123 96 /* check for file existence */ 97 status = stat (filename, &filestat); 98 if (status == 0) { /* file exists, are permissions OK? */ 99 sky = SkyTableLoad (filename, verbose); 100 if (sky == NULL) { 101 fprintf (stderr, "error loading sky table\n"); 102 exit (1); 103 } 104 return (sky); 105 } 106 107 /* first option: SKY_TABLE */ 108 if ((skyfile != NULL) && (skyfile[0] != 0)) { 109 status = stat (skyfile, &filestat); 110 if (status == 0) { /* file exists, are permissions OK? */ 111 sky = SkyTableLoad (skyfile, verbose); 112 if (sky == NULL) { 113 fprintf (stderr, "error loading sky table\n"); 114 exit (1); 115 } 116 SkyTableSetDepth (sky, depth); 117 118 /* write CATDIR copy */ 119 sprintf (filename, "%s/SkyTable.fits", catdir); 120 check_file_access (filename, FALSE, verbose); 121 SkyTableSave (sky, filename); 122 fits_convert_SkyRegion (sky[0].regions, sizeof (SkyTable), sky[0].Nregions); 123 return (sky); 124 } 125 } 126 124 GSCFILE: 125 /* third option: GSCFILE */ 127 126 sky = SkyTableFromGSC (gscfile, depth, verbose); 128 127 if (sky == NULL) { … … 131 130 } 132 131 133 /* write CATDIR copy */132 /* create CATDIR copy */ 134 133 sprintf (filename, "%s/SkyTable.fits", catdir); 135 134 check_file_access (filename, FALSE, verbose); 136 135 SkyTableSave (sky, filename); 137 136 fits_convert_SkyRegion (sky[0].regions, sizeof (SkyRegion), sky[0].Nregions); 138 139 137 return (sky); 140 138 } -
trunk/Ohana/src/opihi/dvo/Makefile
r5850 r5900 45 45 $(SDIR)/calextract.$(ARCH).o \ 46 46 $(SDIR)/calmextract.$(ARCH).o \ 47 $(SDIR)/catdir.$(ARCH).o \ 47 48 $(SDIR)/ccd.$(ARCH).o \ 48 49 $(SDIR)/cmatch.$(ARCH).o \ -
trunk/Ohana/src/opihi/dvo/catdir.c
r5451 r5900 3 3 int catdir_define (int argc, char **argv) { 4 4 5 int VERBOSE;5 int status, N, VERBOSE; 6 6 7 7 VERBOSE = FALSE; -
trunk/Ohana/src/opihi/dvo/dvo.c
r5451 r5900 8 8 9 9 /* program-dependent initialization */ 10 void initialize(int argc, char **argv) {10 void program_init (int argc, char **argv) { 11 11 12 12 auto_break = TRUE; … … 18 18 InitDVO (); 19 19 20 if ( SetCATDIR (NULL, TRUE)) {20 if (!SetCATDIR (NULL, TRUE)) { 21 21 fprintf (stderr, "CATDIR is not defined\n"); 22 22 } … … 28 28 set_str_variable ("PROMPT", opihi_prompt); 29 29 set_str_variable ("RCFILE", opihi_rcfile); 30 30 31 # ifdef HELPDIR_DEFAULT 31 32 set_str_variable ("HELPDIR", MACRO_NAME(HELPDIR_DEFAULT)); 32 33 # endif 33 34 34 { /* check history file permission */35 FILE *f;36 f = fopen (opihi_history, "a");37 if (f == NULL) /* no current history file here */38 fprintf (stderr, "can't save history.\n");39 else40 fclose (f);41 stifle_history (200);42 read_history (opihi_history);43 }44 45 signal (SIGINT, SIG_IGN);46 35 return; 47 36 } -
trunk/Ohana/src/opihi/dvo/init.c
r5451 r5900 6 6 int calmextract PROTO((int, char **)); 7 7 int catlog PROTO((int, char **)); 8 int catdir_define PROTO((int, char **)); 8 9 int ccd PROTO((int, char **)); 9 10 int cmatch PROTO((int, char **)); … … 61 62 {"calextract", calextract, "extract photometry calibration"}, 62 63 {"calmextract", calmextract, "extract photometry calibration"}, 64 {"catdir", catdir_define,"re-define CATDIR"}, 63 65 {"ccd", ccd, "plot color-color diagram"}, 64 66 {"cmatch", cmatch, "match two catalogs"}, -
trunk/Ohana/src/opihi/dvo/region_list.c
r5451 r5900 30 30 if (VarConfig ("SKYFILE", "%s", skyfile) == NULL) skyfile[0] = 0; 31 31 if (VarConfig ("SKYDEPTH", "%d", &skydepth) == NULL) skydepth = 2; 32 33 if (verbose) { 34 fprintf (stderr, "CATDIR %s\n", catdir); 35 fprintf (stderr, "GSCFILE %s\n", gscfile); 36 fprintf (stderr, "SKYFILE %s\n", skyfile); 37 fprintf (stderr, "SKYDEPTH %d\n", skydepth); 38 } 32 39 33 40 /* load the SkyTable at this point */ … … 81 88 int Ngraph; 82 89 Graphdata graphsky; 83 SkyTable *sky;84 90 SkyList *skylist; 85 91 char filename[256]; -
trunk/Ohana/src/opihi/include/shell.h
r4763 r5900 44 44 45 45 /*** basic opihi shell functions ***/ 46 void initialize PROTO((int argc, char **argv)); 46 void general_init PROTO((int argc, char **argv)); 47 void program_init PROTO((int argc, char **argv)); 47 48 void startup PROTO((int argc, char **argv)); 48 49 int multicommand PROTO((char *line)); -
trunk/Ohana/src/opihi/lib.shell/opihi.c
r4763 r5900 8 8 pid_t ppid; 9 9 10 initialize (argc, argv); 10 general_init (argc, argv); 11 program_init (argc, argv); 11 12 startup (argc, argv); 12 13 prompt = get_variable("PROMPT"); … … 45 46 } 46 47 } 48 49 /* 50 startup sequence: 51 52 - general_init 53 - program_init 54 - startup (exit if non-interactive) 55 - welcome 56 57 */ -
trunk/Ohana/src/opihi/lib.shell/startup.c
r4689 r5900 1 1 # include "opihi.h" 2 2 3 /* program-independent initialization */ 4 void startup (int argc, char **argv) { 3 /* program-independent initialization 4 * these steps do not depend on the opihi implementation 5 * (ie, the supplied commands or data structures) 6 */ 5 7 6 long A, B; 7 8 signal (SIGINT, SIG_IGN); 8 void general_init (int argc, char **argv) { 9 9 10 10 /* init srand for rnd numbers elsewhere */ 11 long A, B; 11 12 A = time(NULL); 12 13 for (B = 0; A == time(NULL); B++); 13 14 srand48(B); 14 15 15 if (0) { 16 /* fix the history list to remove the timestamp */ 17 char *c; 18 int i; 19 HIST_ENTRY **entry; 20 21 entry = history_list (); 22 if (entry != (HIST_ENTRY **) NULL) { 23 for (i = 0; entry[i]; i++) { 24 if ((strlen (entry[i][0].line) > 19) && 25 (entry[i][0].line[2] == '/') && 26 (entry[i][0].line[5] == '/') && 27 (entry[i][0].line[11] == ':') && 28 (entry[i][0].line[14] == ':') && 29 (entry[i][0].line[17] == ':')) { 30 c = entry[i][0].line + 19; 31 memmove (entry[i][0].line, c, strlen(c) + 1); 32 } 33 } 34 } 16 /* set signals */ 17 signal (SIGINT, SIG_IGN); 18 19 /* load config data (.ptolemyrc) */ 20 if (!ConfigInit (&argc, argv)) { 21 fprintf (stderr, "can't find config file. some functions will be unavailable\n"); 35 22 } 36 37 { 23 24 return; 25 } 26 27 void startup (int argc, char **argv) { 38 28 39 29 int i, N, status, ONLY_INPUT, LOAD_RC; … … 57 47 */ 58 48 59 if (!ConfigInit (&argc, argv)) { 60 fprintf (stderr, "can't find config file. some functions will be unavailable\n"); 49 50 51 /* check history file permission */ 52 { 53 FILE *f; 54 char *opihi_history; 55 56 opihi_history = get_variable ("RCFILE"); 57 f = fopen (opihi_history, "a"); 58 if (f == NULL) /* no current history file here */ 59 fprintf (stderr, "can't save history.\n"); 60 else 61 fclose (f); 62 stifle_history (200); 63 read_history (opihi_history); 64 } 65 66 if (0) { 67 /* fix the history list to remove the timestamp */ 68 char *c; 69 int i; 70 HIST_ENTRY **entry; 71 72 entry = history_list (); 73 if (entry != (HIST_ENTRY **) NULL) { 74 for (i = 0; entry[i]; i++) { 75 if ((strlen (entry[i][0].line) > 19) && 76 (entry[i][0].line[2] == '/') && 77 (entry[i][0].line[5] == '/') && 78 (entry[i][0].line[11] == ':') && 79 (entry[i][0].line[14] == ':') && 80 (entry[i][0].line[17] == ':')) { 81 c = entry[i][0].line + 19; 82 memmove (entry[i][0].line, c, strlen(c) + 1); 83 } 84 } 61 85 } 62 86
Note:
See TracChangeset
for help on using the changeset viewer.
