Changeset 2798
- Timestamp:
- Dec 23, 2004, 7:33:48 AM (22 years ago)
- Location:
- trunk/Ohana/src/opihi/dvo
- Files:
-
- 2 edited
-
detrend.c (modified) (3 diffs)
-
imsearch.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/dvo/detrend.c
r2598 r2798 12 12 double trange; 13 13 int TypeSelect, CCDSelect, FilterSelect; 14 char *Filter , *Type;15 int type, mode, CCD;14 char *Filter; 15 int Type, mode, CCD; 16 16 int NVALUE; 17 17 float *value; … … 66 66 if (N = get_argument (argc, argv, "-type")) { 67 67 remove_argument (N, &argc, argv); 68 Type = strcreate (argv[N]); 68 Type = get_image_type (argv[N]); 69 if (Type == T_UNDEF) { 70 fprintf (stderr, "ERROR: invalid image type %s\n", argv[N]); 71 return (FALSE); 72 } 69 73 remove_argument (N, &argc, argv); 70 74 TypeSelect = TRUE; 71 }72 type = TYPE_NONE;73 if (TypeSelect) {74 if (!strncasecmp (Type, "obj", 3)) {75 type = TYPE_OBJECT;76 }77 if (!strncasecmp (Type, "bias", 4)) {78 type = TYPE_BIAS;79 }80 if (!strncasecmp (Type, "dark", 4)) {81 type = TYPE_DARK;82 }83 if (!strncasecmp (Type, "flat", 4)) {84 type = TYPE_FLAT;85 }86 if (type == TYPE_NONE) {87 fprintf (stderr, "invalid image type %s\n", Type);88 return (FALSE);89 }90 75 } 91 76 … … 173 158 if (FilterSelect && (strcasecmp (pimage[i].filter, Filter))) continue; 174 159 if (CCDSelect && (pimage[i].ccd != CCD)) continue; 175 if (TypeSelect && (pimage[i].type != type)) continue;160 if (TypeSelect && (pimage[i].type != Type)) continue; 176 161 177 162 /* assign correct value */ -
trunk/Ohana/src/opihi/dvo/imsearch.c
r2598 r2798 1 1 # include "dvo.h" 2 3 static char typename[5][32] = {"none", "object", "dark", "bias", "flat"};4 static char modename[3][32] = {"none", "mef", "single"};5 2 6 3 imsearch (int argc, char **argv) { … … 12 9 int i, Nimage, status, N, TimeSelect, SaveNames; 13 10 int ModeSelect, TypeSelect, CCDSelect, FilterSelect; 14 char *Filter, * Type, *Mode, *pmode, *ptype, *obstime;15 int type, mode, CCD;11 char *Filter, *obstime; 12 int Type, Mode, CCD; 16 13 unsigned long int tzero; 17 14 double trange; … … 44 41 if (N = get_argument (argc, argv, "-type")) { 45 42 remove_argument (N, &argc, argv); 46 Type = strcreate (argv[N]); 43 Type = get_image_type (argv[N]); 44 if (Type == T_UNDEF) { 45 fprintf (stderr, "ERROR: invalid image type %s\n", argv[N]); 46 return (FALSE); 47 } 47 48 remove_argument (N, &argc, argv); 48 49 TypeSelect = TRUE; … … 52 53 if (N = get_argument (argc, argv, "-mode")) { 53 54 remove_argument (N, &argc, argv); 54 Mode = strcreate (argv[N]); 55 Mode = get_image_mode (argv[N]); 56 if (Mode == M_UNDEF) { 57 fprintf (stderr, "ERROR: invalid image mode %s\n", argv[N]); 58 exit (1); 59 } 55 60 remove_argument (N, &argc, argv); 56 61 ModeSelect = TRUE; … … 79 84 fprintf (stderr, "USAGE: imsearch [-time start range] [-type type] [-mode mode] [-ccd N] [-filter name]\n"); 80 85 exit (1); 81 }82 83 type = TYPE_NONE;84 if (TypeSelect) {85 if (!strncasecmp (Type, "obj", 3)) {86 type = TYPE_OBJECT;87 }88 if (!strncasecmp (Type, "bias", 4)) {89 type = TYPE_BIAS;90 }91 if (!strncasecmp (Type, "dark", 4)) {92 type = TYPE_DARK;93 }94 if (!strncasecmp (Type, "flat", 4)) {95 type = TYPE_FLAT;96 }97 if (type == TYPE_NONE) {98 fprintf (stderr, "invalid image type %s\n", Type);99 return (FALSE);100 }101 }102 103 mode = MODE_NONE;104 if (ModeSelect) {105 if (!strncasecmp (Mode, "mef", 3)) {106 mode = MODE_MEF;107 }108 if (!strncasecmp (Mode, "single", 4) || !strncasecmp (Mode, "split", 4)) {109 mode = MODE_SINGLE;110 }111 if (mode == MODE_NONE) {112 fprintf (stderr, "invalid image mode %s\n", Mode);113 return (FALSE);114 }115 86 } 116 87 … … 149 120 if (ModeSelect && (pimage[i].mode != mode)) continue; 150 121 if (CCDSelect && (pimage[i].ccd != CCD)) continue; 151 if (TypeSelect && (pimage[i].type != type)) continue; 152 153 if ((pimage[i].mode < 0) || (pimage[i].mode > 2)) 154 pmode = modename[0]; 155 else 156 pmode = modename[(int)pimage[i].mode]; 157 158 if ((pimage[i].type < 0) || (pimage[i].type > 4)) 159 ptype = typename[0]; 160 else 161 ptype = typename[(int)pimage[i].type]; 122 if (TypeSelect && (pimage[i].type != Type)) continue; 162 123 163 124 obstime = ctime (&pimage[i].obstime); 164 125 obstime[strlen(obstime)-1] = 0; 165 fprintf (stdout, "%5d %6s %6s %2d %2d ", i, ptype, pmode, pimage[i].ccd, pimage[i].type); 126 127 fprintf (stdout, "%5d %6s %6s %2d %2d ", i, get_type_name(pimage[i].type), get_mode_name(pimage[i].mode), pimage[i].ccd, pimage[i].type); 166 128 fprintf (stdout, "%s %s ", pimage[i].pathname, pimage[i].filename); 167 129 fprintf (stdout, "%s %s %f %s\n", pimage[i].filter, pimage[i].instrument, pimage[i].exptime, obstime);
Note:
See TracChangeset
for help on using the changeset viewer.
