Changeset 74
- Timestamp:
- May 15, 2003, 11:21:54 PM (23 years ago)
- Location:
- trunk/Ohana/src/imregister/imreg
- Files:
-
- 9 edited
-
ConfigPID.c (modified) (2 diffs)
-
SetSignals.c (modified) (2 diffs)
-
args.imregister.c (modified) (1 diff)
-
args.imsearch.c (modified) (2 diffs)
-
iminfo.c (modified) (3 diffs)
-
imregclient.c (modified) (3 diffs)
-
modify.c (modified) (4 diffs)
-
output.c (modified) (3 diffs)
-
submit.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/imregister/imreg/ConfigPID.c
r69 r74 1 # include ".h" 1 # include "imregister.h" 2 # include "imreg.h" 2 3 3 4 static char *PIDMaster = (char *) NULL; … … 77 78 return (TRUE); 78 79 } 80 81 int Shutdown (int status) { 82 83 RemovePID (); 84 exit (status); 85 } -
trunk/Ohana/src/imregister/imreg/SetSignals.c
r69 r74 1 # include "controller.h" 1 # include "imregister.h" 2 # include "imreg.h" 2 3 3 4 void SIG_DIE (int sig) { … … 109 110 if (!LoadPID (pidfile, &pid, username, machine)) { 110 111 fprintf (stderr, "imstatreg is not running\n"); 111 exit ( 0);112 exit (2); 112 113 } 113 114 -
trunk/Ohana/src/imregister/imreg/args.imregister.c
r70 r74 20 20 remove_argument (N, &argc, argv); 21 21 NoReg = TRUE; 22 } 23 24 NeedType = FALSE; 25 if (N = get_argument (argc, argv, "-needtype")) { 26 remove_argument (N, &argc, argv); 27 NeedType = TRUE; 22 28 } 23 29 -
trunk/Ohana/src/imregister/imreg/args.imsearch.c
r70 r74 29 29 /* image type (dark, flat, bias, etc) */ 30 30 criteria.TypeSelect = FALSE; 31 criteria.Type = T_ NONE;31 criteria.Type = T_UNDEF; 32 32 if (N = get_argument (argc, argv, "-type")) { 33 33 remove_argument (N, &argc, argv); 34 for (i = 0; (i < NTYPE) && (criteria.Type == T_ NONE); i++) {34 for (i = 0; (i < NTYPE) && (criteria.Type == T_UNDEF); i++) { 35 35 if (!strncasecmp (argv[N], typename[i], strlen(argv[N]))) criteria.Type = i; 36 36 } 37 if (criteria.Type == T_ NONE) {37 if (criteria.Type == T_UNDEF) { 38 38 fprintf (stderr, "ERROR: invalid image type %s\n", argv[N]); 39 39 exit (1); … … 251 251 output.modify_type = TRUE; 252 252 remove_argument (N, &argc, argv); 253 output.type == T_ NONE;254 for (i = 0; (i < NTYPE) && (output.type == T_ NONE); i++) {253 output.type == T_UNDEF; 254 for (i = 0; (i < NTYPE) && (output.type == T_UNDEF); i++) { 255 255 if (!strncasecmp (argv[N], typename[i], strlen(argv[N]))) output.type = i; 256 256 } 257 if (output.type == T_ NONE) {257 if (output.type == T_UNDEF) { 258 258 fprintf (stderr, "ERROR: invalid image type %s\n", argv[N]); 259 259 exit (1); -
trunk/Ohana/src/imregister/imreg/iminfo.c
r70 r74 36 36 Naxes = 2; 37 37 extend = FALSE; 38 image[0].mode = M ODE_SINGLE;38 image[0].mode = M_SINGLE; 39 39 image[0].flag = 0; 40 40 image[0].ccd = 0; … … 45 45 if (extend) { /* MEF file */ 46 46 fits_scan (&header, "NEXTEND", "%d", 1, &Nextend); 47 image[0].mode = M ODE_MEF;47 image[0].mode = M_MEF; 48 48 image[0].ccd = Nextend; 49 49 } 50 50 if (Naxes == 3) { /* data cube */ 51 51 fits_scan (&header, "NAXIS3", "%d", 1, &Nextend); 52 image[0].mode = M ODE_CUBE;52 image[0].mode = M_CUBE; 53 53 image[0].ccd = Nextend; 54 54 dtime = (float *)&image[0].junk[0]; 55 55 fits_scan (&header, "SEQTIME", "%f", 1, dtime); 56 56 } 57 if (SingleIsSplit && (image[0].mode == M ODE_SINGLE)) {58 image[0].mode = M ODE_SPLIT;57 if (SingleIsSplit && (image[0].mode == M_SINGLE)) { 58 image[0].mode = M_SPLIT; 59 59 image[0].ccd = MatchCCDNameHeader (&header); 60 60 } … … 64 64 fits_scan (&header, ImagetypeKeyword, "%s", 1, &Imagetype); 65 65 66 image[0].type = T YPE_NONE;66 image[0].type = T_NONE; 67 67 if (!strcasecmp (Imagetype, "OBJECT")) { 68 image[0].type = T YPE_OBJECT;68 image[0].type = T_OBJECT; 69 69 } 70 70 if (!strcasecmp (Imagetype, "DARK")) { 71 image[0].type = T YPE_DARK;71 image[0].type = T_DARK; 72 72 } 73 73 if (!strcasecmp (Imagetype, "BIAS")) { 74 image[0].type = T YPE_BIAS;74 image[0].type = T_BIAS; 75 75 } 76 76 if (!strcasecmp (Imagetype, "FLAT")) { 77 image[0].type = T YPE_FLAT;77 image[0].type = T_FLAT; 78 78 } 79 79 if (!strcasecmp (Imagetype, "SKYFLAT")) { 80 image[0].type = TYPE_FLAT; 80 image[0].type = T_FLAT; 81 } 82 if (NeedType && (image[0].type == T_NONE)) { 83 fprintf (stderr, "ERROR: skipping unknown image type\n"); 84 exit (1); 81 85 } 82 86 -
trunk/Ohana/src/imregister/imreg/imregclient.c
r69 r74 18 18 /* get stats file (has sky, bias, etc) */ 19 19 switch (image[0].mode) { 20 case M ODE_MEF:21 case M ODE_SPLIT:20 case M_MEF: 21 case M_SPLIT: 22 22 f = fopen (statfile, "r"); 23 23 if (f == (FILE *) NULL) { … … 30 30 Nentry = 1; 31 31 break; 32 case M ODE_SINGLE:32 case M_SINGLE: 33 33 f = fopen (statfile, "r"); 34 34 if (f == (FILE *) NULL) { … … 40 40 Nentry = 1; 41 41 break; 42 case M ODE_CUBE:42 case M_CUBE: 43 43 f = fopen (statfile, "r"); 44 44 if (f == (FILE *) NULL) { -
trunk/Ohana/src/imregister/imreg/modify.c
r70 r74 34 34 35 35 if (output.mef2split) { 36 if (image[i].mode == M ODE_MEF) {36 if (image[i].mode == M_MEF) { 37 37 root = filerootname (image[i].filename); 38 38 ext = fileextname (image[i].filename); … … 41 41 snprintf (image[i].pathname, 128, "%s/%s", path, root); 42 42 snprintf (image[i].filename, 64, "%s%02d.%s", root, image[i].ccd, ext); 43 image[i].mode = M ODE_SPLIT;43 image[i].mode = M_SPLIT; 44 44 free (root); 45 45 free (ext); … … 49 49 50 50 if (output.split2mef) { 51 if (image[i].mode == M ODE_SPLIT) {51 if (image[i].mode == M_SPLIT) { 52 52 ext = fileextname (image[i].filename); 53 53 root = filebasename (image[i].pathname); … … 56 56 snprintf (image[i].pathname, 128, "%s", path); 57 57 snprintf (image[i].filename, 64, "%s.%s", root, ext); 58 image[i].mode = M ODE_MEF;58 image[i].mode = M_MEF; 59 59 free (root); 60 60 free (ext); -
trunk/Ohana/src/imregister/imreg/output.c
r70 r74 178 178 char ccdstr[64]; 179 179 int i, j; 180 char * pmode, *ptype, *timestr, *root, *path;180 char *modestr, *typestr, *timestr, *root, *path; 181 181 182 182 /* print the selected entries */ … … 185 185 i = match[j]; 186 186 187 if ((image[i].mode < 0) || (image[i].mode >= NMODE)) 188 pmode = modename[0]; 189 else 190 pmode = modename[(int)image[i].mode]; 191 192 if ((image[i].type < 0) || (image[i].type >= NTYPE)) 193 ptype = typename[0]; 194 else 195 ptype = typename[(int)image[i].type]; 196 197 if (RegTimeMode) 198 timestr = sec_to_date (image[i].regtime); 199 else 200 timestr = sec_to_date (image[i].obstime); 187 modestr = ((image[i].mode < 0) || (image[i].mode >= NMODE)) ? modename[0] : modename[(int)image[i].mode]; 188 typestr = ((image[i].type < 0) || (image[i].type >= NTYPE)) ? typename[0] : typename[(int)image[i].type]; 189 timestr = RegTimeMode ? sec_to_date (image[i].regtime) : sec_to_date (image[i].obstime); 201 190 202 191 if (CCDSeq) { … … 214 203 215 204 /* do i want ccdstr? add a dot? 654321o.ccd00.ext */ 216 if (image[i].mode == M ODE_MEF) {217 fprintf (stdout, "%s/%s %s/%s%02d %s %s\n", image[i].pathname, image[i].filename, root, root, image[i].ccd, ccdstr, pmode);218 } 219 220 if (image[i].mode == M ODE_SPLIT) {205 if (image[i].mode == M_MEF) { 206 fprintf (stdout, "%s/%s %s/%s%02d %s %s\n", image[i].pathname, image[i].filename, root, root, image[i].ccd, ccdstr, modestr); 207 } 208 209 if (image[i].mode == M_SPLIT) { 221 210 path = basename (image[i].pathname); 222 211 fprintf (stdout, "%s/%s %s/%s %s %s\n", image[i].pathname, image[i].filename, path, root, ccdstr, "SPLIT"); 223 212 } 224 213 225 if ((image[i].mode == M ODE_SINGLE) || (image[i].mode == MODE_CUBE)) {226 fprintf (stdout, "%s/%s %s 0 %s\n", image[i].pathname, image[i].filename, root, pmode);214 if ((image[i].mode == M_SINGLE) || (image[i].mode == M_CUBE)) { 215 fprintf (stdout, "%s/%s %s 0 %s\n", image[i].pathname, image[i].filename, root, modestr); 227 216 } 228 217 } else { 229 218 /* this is somewhat poor: I have predefined a subset of value, and I can't guarantee that 'filter' has no spaces */ 230 fprintf (stdout, "%5d %6s %6s %s ", i, ptype, pmode, ccdstr);219 fprintf (stdout, "%5d %6s %6s %s ", i, typestr, modestr, ccdstr); 231 220 fprintf (stdout, "%s %s ", image[i].pathname, image[i].filename); 232 221 fprintf (stdout, "%s %f %s %f %f %f\n", image[i].filter, image[i].exptime, -
trunk/Ohana/src/imregister/imreg/submit.c
r68 r74 17 17 */ 18 18 19 if (image[0].mode == M ODE_MEF) {19 if (image[0].mode == M_MEF) { 20 20 for (i = 0; i < image[0].ccd; i++) { 21 21 root = filerootname (image[0].filename); 22 22 sprintf (line, "%s/%s %s/%s%s %s %s", image[0].pathname, image[0].filename, root, root, ccdn[i], ccds[i], "MEF"); 23 23 if (!WriteFIFO (ImstatFifo, line)) return (FALSE); 24 if (image[0].type == T YPE_OBJECT) {24 if (image[0].type == T_OBJECT) { 25 25 if (!WriteFIFO (PtolemyFifo, line)) return (FALSE); 26 26 } … … 28 28 } 29 29 30 if (image[0].mode == M ODE_SINGLE) {30 if (image[0].mode == M_SINGLE) { 31 31 root = filerootname (image[0].filename); 32 32 sprintf (line, "%s/%s %s %02d %s", image[0].pathname, image[0].filename, root, 0, "SINGLE"); 33 33 if (!WriteFIFO (ImstatFifo, line)) return (FALSE); 34 if (image[0].type == T YPE_OBJECT) {34 if (image[0].type == T_OBJECT) { 35 35 if (!WriteFIFO (PtolemyFifo, line)) return (FALSE); 36 36 } 37 37 } 38 38 39 if (image[0].mode == M ODE_CUBE) {39 if (image[0].mode == M_CUBE) { 40 40 root = filerootname (image[0].filename); 41 41 sprintf (line, "%s/%s %s %02d %s", image[0].pathname, image[0].filename, root, 0, "CUBE"); 42 42 if (!WriteFIFO (ImstatFifo, line)) return (FALSE); 43 if (image[0].type == T YPE_OBJECT) {43 if (image[0].type == T_OBJECT) { 44 44 if (!WriteFIFO (PtolemyFifo, line)) return (FALSE); 45 45 } 46 46 } 47 47 48 if (image[0].mode == M ODE_SPLIT) {48 if (image[0].mode == M_SPLIT) { 49 49 path = basename (image[0].pathname); 50 50 root = filerootname (image[0].filename); 51 51 sprintf (line, "%s/%s %s/%s %02d %s", image[0].pathname, image[0].filename, path, root, image[0].ccd, "SPLIT"); 52 52 if (!WriteFIFO (ImstatFifo, line)) return (FALSE); 53 if (image[0].type == T YPE_OBJECT) {53 if (image[0].type == T_OBJECT) { 54 54 if (!WriteFIFO (PtolemyFifo, line)) return (FALSE); 55 55 }
Note:
See TracChangeset
for help on using the changeset viewer.
