Changeset 2803
- Timestamp:
- Dec 23, 2004, 7:48:29 AM (22 years ago)
- Location:
- trunk/Ohana/src/imregister
- Files:
-
- 61 edited
-
Makefile (modified) (1 diff)
-
base/ConfigFilter.c (modified) (1 diff)
-
base/misc.c (modified) (5 diffs)
-
base/parse_time.c (modified) (1 diff)
-
base/sort.c (modified) (1 diff)
-
detrend/altpath.c (modified) (2 diffs)
-
detrend/args.detregister.c (modified) (9 diffs)
-
detrend/args.detsearch.c (modified) (24 diffs)
-
detrend/criteria.c (modified) (1 diff)
-
detrend/db.c (modified) (2 diffs)
-
detrend/delete.c (modified) (1 diff)
-
detrend/entry.c (modified) (2 diffs)
-
detrend/imdef.c (modified) (2 diffs)
-
detrend/modify.c (modified) (1 diff)
-
detrend/output.c (modified) (5 diffs)
-
detrend/recipe.c (modified) (2 diffs)
-
imreg/ConfigPID.c (modified) (2 diffs)
-
imreg/args.imregister.c (modified) (6 diffs)
-
imreg/args.imsearch.c (modified) (14 diffs)
-
imreg/cadc.c (modified) (3 diffs)
-
imreg/db.c (modified) (5 diffs)
-
imreg/iminfo.c (modified) (1 diff)
-
imreg/imregclient.c (modified) (4 diffs)
-
imreg/match.c (modified) (1 diff)
-
imreg/modify.c (modified) (1 diff)
-
imreg/output.c (modified) (2 diffs)
-
imreg/unique.c (modified) (1 diff)
-
include/detrend.h (modified) (1 diff)
-
include/imreg.h (modified) (1 diff)
-
include/imregister.h (modified) (3 diffs)
-
include/photreg.h (modified) (1 diff)
-
include/spreg.h (modified) (1 diff)
-
photreg/args.photreg.c (modified) (11 diffs)
-
photreg/args.photsearch.c (modified) (12 diffs)
-
photreg/db.c (modified) (3 diffs)
-
photreg/define.c (modified) (1 diff)
-
photreg/getImageData.c (modified) (2 diffs)
-
photreg/output.c (modified) (3 diffs)
-
spreg/ConfigInit.c (modified) (1 diff)
-
spreg/args.spregister.c (modified) (4 diffs)
-
spreg/args.spsearch.c (modified) (10 diffs)
-
spreg/db.c (modified) (1 diff)
-
spreg/match.c (modified) (1 diff)
-
spreg/modify.c (modified) (1 diff)
-
spreg/output.c (modified) (3 diffs)
-
spreg/spinfo.c (modified) (2 diffs)
-
spreg/unique.c (modified) (1 diff)
-
src/cameraconfig.c (modified) (22 diffs)
-
src/convertimreg.c (modified) (3 diffs)
-
src/detsearch.c (modified) (3 diffs)
-
src/filtnames.c (modified) (4 diffs)
-
src/imphotmerge.c (modified) (5 diffs)
-
src/imphotsearch.c (modified) (10 diffs)
-
src/imphotset.c (modified) (5 diffs)
-
src/imregister.c (modified) (2 diffs)
-
src/imsearch.c (modified) (2 diffs)
-
src/imstatreg.c (modified) (2 diffs)
-
src/photcode.c (modified) (2 diffs)
-
src/photreg.c (modified) (1 diff)
-
src/photsearch.c (modified) (2 diffs)
-
src/spregister.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/imregister/Makefile
r2767 r2803 21 21 INCS = -I$(INC) -I$(LINC) -I$(XINC) 22 22 LIBS = -L$(LLIB) -lFITS -lohana -lm 23 # CFLAGS = $(INCS) -Wall -W unused23 # CFLAGS = $(INCS) -Wall -Werror 24 24 CFLAGS = $(INCS) 25 25 LFLAGS = $(LIBS) -
trunk/Ohana/src/imregister/base/ConfigFilter.c
r82 r2803 64 64 int MatchFilterList (char *line) { 65 65 66 char *p , tmp[31];66 char *p; 67 67 int i, blank; 68 68 -
trunk/Ohana/src/imregister/base/misc.c
r2771 r2803 105 105 int mode; 106 106 107 mode = FORMAT_DATE; 108 107 109 p1 = line; 108 110 tmp = strtod (p1, &p2); … … 123 125 mode = FORMAT_JD; 124 126 } 125 } else {126 mode = FORMAT_DATE;127 127 } 128 128 return (mode); … … 404 404 int status, cmode; 405 405 struct stat filestat; 406 char line [256];406 char line[256]; 407 407 408 408 status = stat (filename, &filestat); … … 419 419 } 420 420 } 421 422 421 423 422 int get_filter_arguments (int *argc, char **argv, int **Filt, int *Nfilt) { … … 459 458 460 459 461 intget_version (int argc, char **argv, char *version) {460 void get_version (int argc, char **argv, char *version) { 462 461 463 462 int N; -
trunk/Ohana/src/imregister/base/parse_time.c
r2770 r2803 75 75 for (c = strchr (line, 0x2d); c != (char *) NULL; c = strchr (line, 0x2d)) { *c = ' '; } 76 76 77 Nf = 0; 77 78 switch (mode) { 78 79 case 1: -
trunk/Ohana/src/imregister/base/sort.c
r70 r2803 1 # include <string.h> 1 2 2 3 void sort (float *value, int N) { -
trunk/Ohana/src/imregister/detrend/altpath.c
r124 r2803 5 5 6 6 int i, j, n, found, status; 7 int Nimage, Nlist , Ncurrent, Nadd, Nremove;8 int *list, *current , *curfound, *add, *remove;7 int Nimage, Nlist; 8 int *list, *current; 9 9 char *dBPath, infile[256], outfile[256], line[1024]; 10 10 DetReg *image; … … 106 106 107 107 fprintf (stderr, "unknown altpath mode: %d\n", output.Altpath); 108 return (TRUE); 108 109 } 109 110 -
trunk/Ohana/src/imregister/detrend/args.detregister.c
r3 r2803 16 16 /* define time range */ 17 17 descriptor[0].TimeSelect = FALSE; 18 if ( N = get_argument (argc, argv, "-time")) {18 if ((N = get_argument (argc, argv, "-time"))) { 19 19 remove_argument (N, &argc, argv); 20 20 if (!str_to_time (argv[N], &descriptor[0].tstart)) { … … 33 33 /* set optional label */ 34 34 descriptor[0].label = strcreate ("detrend"); 35 if ( N = get_argument (argc, argv, "-label")) {35 if ((N = get_argument (argc, argv, "-label"))) { 36 36 remove_argument (N, &argc, argv); 37 37 descriptor[0].label = strcreate (argv[N]); … … 41 41 /* set optional label */ 42 42 descriptor[0].imageID = strcreate ("test"); 43 if ( N = get_argument (argc, argv, "-ID")) {43 if ((N = get_argument (argc, argv, "-ID"))) { 44 44 remove_argument (N, &argc, argv); 45 45 descriptor[0].imageID = strcreate (argv[N]); … … 49 49 /* set optional order */ 50 50 descriptor[0].order = 0; 51 if ( N = get_argument (argc, argv, "-order")) {51 if ((N = get_argument (argc, argv, "-order"))) { 52 52 remove_argument (N, &argc, argv); 53 53 descriptor[0].order = atoi (argv[N]); … … 56 56 57 57 /* define image type */ 58 descriptor[0].type = T_ NONE;59 if ( N = get_argument (argc, argv, "-type")) {58 descriptor[0].type = T_UNDEF; 59 if ((N = get_argument (argc, argv, "-type"))) { 60 60 remove_argument (N, &argc, argv); 61 for (i = 0; i < NTYPE; i++) { 62 if (!strncasecmp (argv[N], typename[i], strlen(typename[i]))) { 63 descriptor[0].type = i; 64 } 65 } 66 if (descriptor[0].type == T_NONE) { 61 descriptor[0].type = get_image_type (argv[N]); 62 if (descriptor[0].type == T_UNDEF) { 67 63 fprintf (stderr, "ERROR: invalid image type %s\n", argv[N]); 68 64 exit (1); … … 73 69 /* define ccd number */ 74 70 descriptor[0].CCDSelect = FALSE; 75 if ( N = get_argument (argc, argv, "-ccd")) {71 if ((N = get_argument (argc, argv, "-ccd"))) { 76 72 remove_argument (N, &argc, argv); 77 73 descriptor[0].CCD = -1; … … 92 88 descriptor[0].Exptime = 0.0; 93 89 descriptor[0].ExptimeSelect = FALSE; 94 if ( N = get_argument (argc, argv, "-exptime")) {90 if ((N = get_argument (argc, argv, "-exptime"))) { 95 91 remove_argument (N, &argc, argv); 96 92 descriptor[0].Exptime = atof (argv[N]); … … 101 97 /* define filter */ 102 98 descriptor[0].filter = FILTER_NONE; 103 if ( N = get_argument (argc, argv, "-filter")) {99 if ((N = get_argument (argc, argv, "-filter"))) { 104 100 remove_argument (N, &argc, argv); 105 101 for (i = 0; (i < NFILTER) && (descriptor[0].filter == FILTER_NONE); i++) { … … 122 118 exit (1); 123 119 } 124 120 return (TRUE); 125 121 } -
trunk/Ohana/src/imregister/detrend/args.detsearch.c
r2450 r2803 6 6 7 7 int i, N; 8 int MosaicSelect, ImageSelect, RangeSelect,bad, Recipe, Ncrit;8 int MosaicSelect, ImageSelect, bad, Recipe, Ncrit; 9 9 char *ImageFile, *ImageMode, *ImageExtend; 10 Header header;11 char line[256];12 10 Criteria base, *crit; 13 int Ntimes, Nfilt,*filt;11 int *filt; 14 12 unsigned long *tstart, *tstop; 15 13 16 if ( N = get_argument (argc, argv, "-h")) { usage (); }17 if ( N = get_argument (argc, argv, "--help")) { usage (); }14 if ((N = get_argument (argc, argv, "-h"))) { usage (); } 15 if ((N = get_argument (argc, argv, "--help"))) { usage (); } 18 16 bzero (&base, sizeof (Criteria)); 19 17 … … 23 21 ConfigFilter (); 24 22 23 ImageFile = ImageMode = ImageExtend = NULL; 24 25 25 /* mosaic-based selection */ 26 26 MosaicSelect = FALSE; 27 if ( N = get_argument (argc, argv, "-mosaic")) {27 if ((N = get_argument (argc, argv, "-mosaic"))) { 28 28 remove_argument (N, &argc, argv); 29 29 ImageFile = strcreate (argv[N]); … … 45 45 /* image-based selection */ 46 46 ImageSelect = FALSE; 47 if ( N = get_argument (argc, argv, "-image")) {47 if ((N = get_argument (argc, argv, "-image"))) { 48 48 remove_argument (N, &argc, argv); 49 49 ImageFile = strcreate (argv[N]); … … 68 68 /* define image type */ 69 69 base.TypeSelect = FALSE; 70 base.Type = T_NONE; 71 if (N = get_argument (argc, argv, "-type")) { 72 remove_argument (N, &argc, argv); 73 for (i = 0; (i < NTYPE) && (base.Type == T_NONE); i++) { 74 if (!strncasecmp (argv[N], typename[i], strlen(typename[i]))) { 75 base.Type = i; 76 } 77 } 78 if (base.Type == T_NONE) { 70 base.Type = T_UNDEF; 71 if ((N = get_argument (argc, argv, "-type"))) { 72 remove_argument (N, &argc, argv); 73 base.Type = get_image_type (argv[N]); 74 if (base.Type == T_UNDEF) { 79 75 fprintf (stderr, "ERROR: invalid image type %s\n", argv[N]); 80 76 exit (1); … … 87 83 /* image mode (mef, splt, etc) */ 88 84 base.ModeSelect = FALSE; 89 base.Mode = M_NONE; 90 if (N = get_argument (argc, argv, "-mode")) { 91 remove_argument (N, &argc, argv); 92 for (i = 0; (i < NMODE) && (base.Mode == M_NONE); i++) { 93 if (!strncasecmp (argv[N], modename[i], strlen(argv[N]))) base.Mode = i; 94 } 95 if (base.Mode == M_NONE) { 85 base.Mode = M_UNDEF; 86 if ((N = get_argument (argc, argv, "-mode"))) { 87 remove_argument (N, &argc, argv); 88 base.Mode = get_image_mode (argv[N]); 89 if (base.Mode == M_UNDEF) { 96 90 fprintf (stderr, "ERROR: invalid image mode %s\n", argv[N]); 97 91 exit (1); … … 104 98 tstart = tstop = (unsigned long *) NULL; 105 99 base.TimeSelect = base.tstart = base.tstop = 0; 106 if ( N = get_argument (argc, argv, "-time")) {100 if ((N = get_argument (argc, argv, "-time"))) { 107 101 remove_argument (N, &argc, argv); 108 102 bad = get_argument (argc, argv, "-trange"); … … 131 125 /* define ccd number */ 132 126 base.CCDSelect = FALSE; 133 if ( N = get_argument (argc, argv, "-ccd")) {127 if ((N = get_argument (argc, argv, "-ccd"))) { 134 128 base.CCD = -1; 135 129 remove_argument (N, &argc, argv); … … 149 143 /* define exposure time */ 150 144 base.ExptimeSelect = FALSE; 151 if ( N = get_argument (argc, argv, "-exptime")) {145 if ((N = get_argument (argc, argv, "-exptime"))) { 152 146 remove_argument (N, &argc, argv); 153 147 base.Exptime = atof (argv[N]); … … 158 152 /* varients on the standard selection */ 159 153 base.EntrySelect = FALSE; 160 if ( N = get_argument (argc, argv, "-entry")) {154 if ((N = get_argument (argc, argv, "-entry"))) { 161 155 remove_argument (N, &argc, argv); 162 156 base.Entry = atoi (argv[N]); … … 165 159 } 166 160 base.MatchNumber = -1; 167 if ( N = get_argument (argc, argv, "-match")) {161 if ((N = get_argument (argc, argv, "-match"))) { 168 162 remove_argument (N, &argc, argv); 169 163 base.MatchNumber = atoi (argv[N]); … … 171 165 } 172 166 base.LabelSelect = FALSE; 173 if ( N = get_argument (argc, argv, "-label")) {167 if ((N = get_argument (argc, argv, "-label"))) { 174 168 remove_argument (N, &argc, argv); 175 169 base.Label = strcreate (argv[N]); … … 178 172 } 179 173 base.NameSelect = FALSE; 180 if ( N = get_argument (argc, argv, "-name")) {174 if ((N = get_argument (argc, argv, "-name"))) { 181 175 remove_argument (N, &argc, argv); 182 176 base.Name = strcreate (argv[N]); … … 187 181 /* these options affect the output mode */ 188 182 output.Close = FALSE; 189 if ( N = get_argument (argc, argv, "-close")) {183 if ((N = get_argument (argc, argv, "-close"))) { 190 184 if (!base.TimeSelect && !ImageSelect && !MosaicSelect) { 191 185 fprintf (stderr, "ERROR: syntax error in -close requires one of: -time -trange -image -mosaic\n"); … … 196 190 } 197 191 output.TimeMode = START; 198 if ( N = get_argument (argc, argv, "-tstop")) {192 if ((N = get_argument (argc, argv, "-tstop"))) { 199 193 remove_argument (N, &argc, argv); 200 194 output.TimeMode = STOP; 201 195 } 202 if ( N = get_argument (argc, argv, "-treg")) {196 if ((N = get_argument (argc, argv, "-treg"))) { 203 197 remove_argument (N, &argc, argv); 204 198 output.TimeMode = REG; 205 199 } 206 200 output.ElixirSmart = FALSE; 207 if ( N = get_argument (argc, argv, "-ve")) {201 if ((N = get_argument (argc, argv, "-ve"))) { 208 202 remove_argument (N, &argc, argv); 209 203 output.ElixirSmart = TRUE; 210 204 } 211 205 output.verbose = TRUE; 212 if ( N = get_argument (argc, argv, "-quiet")) {206 if ((N = get_argument (argc, argv, "-quiet"))) { 213 207 remove_argument (N, &argc, argv); 214 208 output.verbose = FALSE; 215 209 } 216 210 output.table = (char *) NULL; 217 if ( N = get_argument (argc, argv, "-fits")) {211 if ((N = get_argument (argc, argv, "-fits"))) { 218 212 remove_argument (N, &argc, argv); 219 213 output.table = strcreate (argv[N]); … … 221 215 } 222 216 output.bintable = (char *) NULL; 223 if ( N = get_argument (argc, argv, "-binfits")) {217 if ((N = get_argument (argc, argv, "-binfits"))) { 224 218 remove_argument (N, &argc, argv); 225 219 output.bintable = strcreate (argv[N]); … … 227 221 } 228 222 output.Criteria = FALSE; 229 if ( N = get_argument (argc, argv, "-criteria")) {223 if ((N = get_argument (argc, argv, "-criteria"))) { 230 224 output.Criteria = TRUE; 231 225 remove_argument (N, &argc, argv); 232 226 } 233 227 output.Chipname = FALSE; 234 if ( N = get_argument (argc, argv, "-chipname")) {228 if ((N = get_argument (argc, argv, "-chipname"))) { 235 229 output.Chipname = TRUE; 236 230 remove_argument (N, &argc, argv); … … 239 233 /* these options modify behavior */ 240 234 output.Select = FALSE; 241 if ( N = get_argument (argc, argv, "-select")) {235 if ((N = get_argument (argc, argv, "-select"))) { 242 236 remove_argument (N, &argc, argv); 243 237 output.Select = TRUE; … … 246 240 /* these options modify behavior */ 247 241 Recipe = FALSE; 248 if ( N = get_argument (argc, argv, "-recipe")) {242 if ((N = get_argument (argc, argv, "-recipe"))) { 249 243 remove_argument (N, &argc, argv); 250 244 Recipe = TRUE; 251 if (base.Type != T_ NONE) {245 if (base.Type != T_UNDEF) { 252 246 fprintf (stderr, "-recipe and -type cannot be combined\n"); 253 247 exit (1); … … 257 251 /* options which alter the database */ 258 252 output.Delete = FALSE; 259 if ( N = get_argument (argc, argv, "-del")) {253 if ((N = get_argument (argc, argv, "-del"))) { 260 254 remove_argument (N, &argc, argv); 261 255 output.Delete = TRUE; 262 256 } 263 if ( N = get_argument (argc, argv, "-delete")) {257 if ((N = get_argument (argc, argv, "-delete"))) { 264 258 remove_argument (N, &argc, argv); 265 259 output.Delete = TRUE; … … 267 261 268 262 output.Altpath = NONE; 269 if ( N = get_argument (argc, argv, "-altpath")) {263 if ((N = get_argument (argc, argv, "-altpath"))) { 270 264 if (output.Delete) { 271 265 fprintf (stderr, "can't combine -delete and -altpath flags\n"); … … 284 278 285 279 output.Modify = FALSE; 286 if ( N = get_argument (argc, argv, "-modify")) {280 if ((N = get_argument (argc, argv, "-modify"))) { 287 281 if (output.Delete) { 288 282 fprintf (stderr, "can't combine -delete and -modify flags\n"); … … 318 312 if ((base.Type == T_DARK) || (base.Type == T_BIAS) || (base.Type == T_MASK)) { 319 313 if (base.FilterSelect) { 320 fprintf (stderr, "ERROR: filter invalid with type %s\n", typename[base.Type]);314 fprintf (stderr, "ERROR: filter invalid with type %s\n", get_type_name(base.Type)); 321 315 exit (1); 322 316 } … … 324 318 /* 325 319 if ((base.Type != T_DARK) && base.ExptimeSelect) { 326 fprintf (stderr, "ERROR: exptime invalid with type %s\n", typename[base.Type]);320 fprintf (stderr, "ERROR: exptime invalid with type %s\n", get_type_name(base.Type)); 327 321 exit (1); 328 322 } … … 340 334 341 335 /* set up criteria based on image, mosaic, or base (all mutually exclusive) */ 336 crit = NULL; 342 337 if (ImageSelect) 343 338 crit = ImageCriteria (base, ImageFile, ImageExtend, ImageMode, &Ncrit); -
trunk/Ohana/src/imregister/detrend/criteria.c
r23 r2803 11 11 match.image = -1; 12 12 13 crit = 0; 13 14 close = FALSE; 14 15 for (i = 0; (i < Ncriteria) && (match.state == MATCH_NONE); i++) { -
trunk/Ohana/src/imregister/detrend/db.c
r6 r2803 181 181 182 182 ConvertStruct ((char *) new, sizeof (DetReg), Nnew, "detreg"); 183 fits_vadd_rows (&vtable, new, Nnew, sizeof(DetReg));183 fits_vadd_rows (&vtable, (char *) new, Nnew, sizeof(DetReg)); 184 184 185 185 /* write subset to file */ … … 209 209 int close_db () { 210 210 if (dbstate == LCK_UNLOCK) return (TRUE); 211 if (dbstate == LCK_EMPTY) return (TRUE); 211 212 fclearlockfile (dBFile, f, lockstate, &dbstate); 212 213 return (TRUE); -
trunk/Ohana/src/imregister/detrend/delete.c
r3 r2803 4 4 int DeleteSubset (Match *match, int Nmatch) { 5 5 6 int i, j , status;6 int i, j; 7 7 int *keep, Ndel, Nimage, Nsubset; 8 8 DetReg *image, *subset; -
trunk/Ohana/src/imregister/detrend/entry.c
r21 r2803 35 35 struct stat statbuf; 36 36 37 38 37 filter_basename = filterhash[newdata[0].filter]; 39 38 dBPath = get_dBPath (); 40 39 41 40 if (newdata[0].type == T_FLAT) { 42 sprintf (path, "%s/%s", typename[newdata[0].type], filter_basename);41 sprintf (path, "%s/%s", get_type_name(newdata[0].type), filter_basename); 43 42 } else { 44 sprintf (path, "%s", typename[newdata[0].type]);43 sprintf (path, "%s", get_type_name(newdata[0].type)); 45 44 } 46 45 sprintf (fullpath, "%s/%s", dBPath, path); … … 64 63 case T_BIAS: 65 64 case T_MASK: 66 sprintf (rootname, "%s.%s.%d.%02d", ID, typename[newdata[0].type], (int)newdata[0].exptime, newdata[0].ccd);65 sprintf (rootname, "%s.%s.%d.%02d", ID, get_type_name(newdata[0].type), (int)newdata[0].exptime, newdata[0].ccd); 67 66 break; 68 67 default: 69 sprintf (rootname, "%s.%s.%s.%02d", ID, typename[newdata[0].type], filter_basename, newdata[0].ccd);68 sprintf (rootname, "%s.%s.%s.%02d", ID, get_type_name(newdata[0].type), filter_basename, newdata[0].ccd); 70 69 } 71 70 -
trunk/Ohana/src/imregister/detrend/imdef.c
r2450 r2803 15 15 16 16 /* first decide on image TYPE */ 17 if (descriptor[0].type == T_ NONE) {17 if (descriptor[0].type == T_UNDEF) { 18 18 if (!fits_scan (&header, ImagetypeKeyword, "%s", 1, line)) { 19 19 fprintf (stderr, "ERROR: failure to read %s from header\n", ImagetypeKeyword); 20 20 exit (1); 21 21 } 22 for (i = 0; i < NTYPE; i++) { 23 if (!strcasecmp (line, typename[i])) { 24 descriptor[0].type = i; 25 } 26 } 27 if (descriptor[0].type == T_NONE) { 22 descriptor[0].type = get_image_type (line); 23 if (descriptor[0].type == T_UNDEF) { 28 24 fprintf (stderr, "ERROR: invalid image type %s\n", line); 29 25 exit (1); … … 129 125 /* set the exposure time, if needed */ 130 126 if (descriptor[0].ExptimeSelect && (descriptor[0].type != T_DARK)) { 131 fprintf (stderr, "exposure time is not allowed for type %s\n", typename[descriptor[0].type]);127 fprintf (stderr, "exposure time is not allowed for type %s\n", get_type_name(descriptor[0].type)); 132 128 exit (1); 133 129 } -
trunk/Ohana/src/imregister/detrend/modify.c
r63 r2803 8 8 DetReg *image; 9 9 10 value = M_UNDEF; 10 11 image = get_images (&Nimage); 12 11 13 ALLOCATE (list, int, Nimage); 12 14 if (!strcasecmp (output.ModifyEntry, "mode")) { 13 for (i = 0; i < NMODE; i++) { 14 if (!strncasecmp (output.ModifyValue, modename[i], strlen(modename[i]))) { 15 value = i; 16 goto valid_mode; 17 } 15 value = get_image_mode (output.ModifyValue); 16 if (value == M_UNDEF) { 17 fprintf (stderr, "ERROR: invalid image mode %s\n", output.ModifyValue); 18 exit (1); 18 19 } 19 fprintf (stderr, "ERROR: invalid image mode %s\n", output.ModifyValue);20 exit (1);21 20 } 22 21 if (!strcasecmp (output.ModifyEntry, "order")) { 23 22 value = atoi (output.ModifyValue); 24 23 } 25 valid_mode:26 24 27 25 /* list matched images */ -
trunk/Ohana/src/imregister/detrend/output.c
r2450 r2803 27 27 int DumpFitsBintable (char *filename, DetReg *image, Match *match, int Nmatch) { 28 28 29 int i, j , Nx;29 int i, j; 30 30 Header header, theader; 31 31 Matrix matrix; … … 42 42 } 43 43 ConvertStruct ((char *) subset, sizeof (DetReg), Nmatch, "detreg"); 44 fits_add_rows (&table, subset, Nmatch, sizeof (DetReg));44 fits_add_rows (&table, (char *) subset, Nmatch, sizeof (DetReg)); 45 45 46 46 fits_write_header (filename, &header); … … 144 144 stopstr = sec_to_date (newdata[0].tstop); 145 145 regstr = sec_to_date (newdata[0].treg); 146 typestr = typename[newdata[0].type];147 modestr = modename[newdata[0].mode];146 typestr = get_type_name(newdata[0].type); 147 modestr = get_mode_name(newdata[0].mode); 148 148 filtstr = filterhash[newdata[0].filter]; 149 149 … … 215 215 } 216 216 217 typestr = typename[MIN (MAX (detdata[i].type, 0), NTYPE - 1)];218 modestr = modename[MIN (MAX (detdata[i].mode, 0), NMODE - 1)];217 typestr = get_type_name(detdata[i].type); 218 modestr = get_mode_name(detdata[i].mode); 219 219 filtstr = filterhash[MIN (MAX (detdata[i].filter, 0), NFILTER - 1)]; 220 220 … … 269 269 270 270 fprintf (stdout, "%19s %19s %7s %6s %s %6.1f\n", 271 start, stop, typename[criteria[i].Type], filterhash[criteria[i].Filter],271 start, stop, get_type_name(criteria[i].Type), filterhash[criteria[i].Filter], 272 272 ccds[criteria[i].CCD], criteria[i].Exptime); 273 273 -
trunk/Ohana/src/imregister/detrend/recipe.c
r70 r2803 4 4 Criteria *ExpandRecipe (Criteria *base, int *Ncrit) { 5 5 6 int i, j,N, Ns, NS;6 int i, N, Ns, NS; 7 7 Criteria *crit; 8 8 int Nbase; 9 9 10 10 Nbase = *Ncrit; 11 N s = 0;11 NS = Ns = 0; 12 12 ALLOCATE (crit, Criteria, 1); 13 13 … … 22 22 crit[Ns] = base[N]; 23 23 crit[Ns].TypeSelect = TRUE; 24 crit[Ns].Type = T_NONE; 25 26 for (j = 0; j < NTYPE; j++) { 27 if (!strcasecmp (typename[j], RecipeType[i])) { 28 crit[Ns].Type = j; 29 } 30 } 31 if (crit[Ns].Type == T_NONE) { 24 crit[Ns].Type = get_image_type (RecipeType[i]); 25 if (crit[Ns].Type == T_UNDEF) { 32 26 fprintf (stderr, "ERROR: invalid image type %s\n", RecipeType[i]); 33 27 exit (1); -
trunk/Ohana/src/imregister/imreg/ConfigPID.c
r74 r2803 4 4 static char *PIDMaster = (char *) NULL; 5 5 6 ConfigPID (char *pidfile) {6 int ConfigPID (char *pidfile) { 7 7 8 8 pid_t pid; … … 50 50 fprintf (stderr, " remove %s if elixir has died unexpectedly\n", pidfile); 51 51 Shutdown (1); 52 return (FALSE); 52 53 } 53 54 -
trunk/Ohana/src/imregister/imreg/args.imregister.c
r91 r2803 11 11 12 12 SingleIsSplit = FALSE; 13 if ( N = get_argument (argc, argv, "-split")) {13 if ((N = get_argument (argc, argv, "-split"))) { 14 14 remove_argument (N, &argc, argv); 15 15 SingleIsSplit = TRUE; … … 17 17 18 18 NoReg = FALSE; 19 if ( N = get_argument (argc, argv, "-noreg")) {19 if ((N = get_argument (argc, argv, "-noreg"))) { 20 20 remove_argument (N, &argc, argv); 21 21 NoReg = TRUE; … … 23 23 24 24 output.verbose = FALSE; 25 if ( N = get_argument (argc, argv, "-v")) {25 if ((N = get_argument (argc, argv, "-v"))) { 26 26 remove_argument (N, &argc, argv); 27 27 output.verbose = TRUE; … … 29 29 30 30 NeedType = FALSE; 31 if ( N = get_argument (argc, argv, "-needtype")) {31 if ((N = get_argument (argc, argv, "-needtype"))) { 32 32 remove_argument (N, &argc, argv); 33 33 NeedType = TRUE; … … 73 73 74 74 /* check for daemon mode */ 75 if ( N = get_argument (argc, argv, "-daemon")) {75 if ((N = get_argument (argc, argv, "-daemon"))) { 76 76 remove_argument (N, &argc, argv); 77 77 CLIENT = FALSE; … … 82 82 83 83 LOOP_DELAY = 60; 84 if ( N = get_argument (argc, argv, "-delay")) {84 if ((N = get_argument (argc, argv, "-delay"))) { 85 85 remove_argument (N, &argc, argv); 86 86 LOOP_DELAY = atof(argv[N]); -
trunk/Ohana/src/imregister/imreg/args.imsearch.c
r74 r2803 13 13 14 14 /* set timezone (set static in misc.c) */ 15 if ( N = get_argument (argc, argv, "-tz")) {15 if ((N = get_argument (argc, argv, "-tz"))) { 16 16 remove_argument (N, &argc, argv); 17 17 dt = atof (argv[N]); … … 30 30 criteria.TypeSelect = FALSE; 31 31 criteria.Type = T_UNDEF; 32 if (N = get_argument (argc, argv, "-type")) { 33 remove_argument (N, &argc, argv); 34 for (i = 0; (i < NTYPE) && (criteria.Type == T_UNDEF); i++) { 35 if (!strncasecmp (argv[N], typename[i], strlen(argv[N]))) criteria.Type = i; 36 } 32 if ((N = get_argument (argc, argv, "-type"))) { 33 remove_argument (N, &argc, argv); 34 criteria.Type = get_image_type (argv[N]); 37 35 if (criteria.Type == T_UNDEF) { 38 36 fprintf (stderr, "ERROR: invalid image type %s\n", argv[N]); … … 41 39 remove_argument (N, &argc, argv); 42 40 criteria.TypeSelect = TRUE; 43 }44 45 /* exposure time */46 criteria.ExptimeSelect = FALSE;47 if (N = get_argument (argc, argv, "-etime")) {48 remove_argument (N, &argc, argv);49 criteria.Exptime = atof (argv[N]);50 remove_argument (N, &argc, argv);51 criteria.ExptimeSelect = TRUE;52 41 } 53 42 54 43 /* image mode (split, mef, single) */ 55 44 criteria.ModeSelect = FALSE; 56 criteria.Mode = M_NONE; 57 if (N = get_argument (argc, argv, "-mode")) { 58 remove_argument (N, &argc, argv); 59 for (i = 0; (i < NMODE) && (criteria.Mode == M_NONE); i++) { 60 if (!strncasecmp (argv[N], modename[i], strlen(argv[N]))) criteria.Mode = i; 61 } 62 if (criteria.Mode == M_NONE) { 45 criteria.Mode = M_UNDEF; 46 if ((N = get_argument (argc, argv, "-mode"))) { 47 remove_argument (N, &argc, argv); 48 criteria.Mode = get_image_mode (argv[N]); 49 if (criteria.Mode == M_UNDEF) { 63 50 fprintf (stderr, "ERROR: invalid image mode %s\n", argv[N]); 64 51 exit (1); … … 68 55 } 69 56 57 /* exposure time */ 58 criteria.ExptimeSelect = FALSE; 59 if ((N = get_argument (argc, argv, "-etime"))) { 60 remove_argument (N, &argc, argv); 61 criteria.Exptime = atof (argv[N]); 62 remove_argument (N, &argc, argv); 63 criteria.ExptimeSelect = TRUE; 64 } 65 70 66 /* ccd number */ 71 67 criteria.CCDSelect = FALSE; 72 if ( N = get_argument (argc, argv, "-ccd")) {68 if ((N = get_argument (argc, argv, "-ccd"))) { 73 69 remove_argument (N, &argc, argv); 74 70 criteria.CCD = -1; … … 87 83 } 88 84 /* select CCD seq number */ 89 if ( N = get_argument (argc, argv, "-ccdn")) {85 if ((N = get_argument (argc, argv, "-ccdn"))) { 90 86 remove_argument (N, &argc, argv); 91 87 criteria.CCD = atoi (argv[N]); … … 96 92 /* filter name */ 97 93 criteria.FilterSelect = FALSE; 98 if ( N = get_argument (argc, argv, "-filter")) {94 if ((N = get_argument (argc, argv, "-filter"))) { 99 95 remove_argument (N, &argc, argv); 100 96 criteria.Filter = strcreate (argv[N]); … … 108 104 /* string in image name */ 109 105 criteria.NameSelect = FALSE; 110 if ( N = get_argument (argc, argv, "-name")) {106 if ((N = get_argument (argc, argv, "-name"))) { 111 107 remove_argument (N, &argc, argv); 112 108 criteria.Name = strcreate (argv[N]); … … 117 113 /* processed state */ 118 114 criteria.ProcSelect = FALSE; 119 if ( N = get_argument (argc, argv, "-proc")) {115 if ((N = get_argument (argc, argv, "-proc"))) { 120 116 criteria.ProcSelect = TRUE; 121 117 remove_argument (N, &argc, argv); … … 132 128 133 129 criteria.DistSelect = FALSE; 134 if ( N = get_argument (argc, argv, "-dist")) {130 if ((N = get_argument (argc, argv, "-dist"))) { 135 131 criteria.DistSelect = TRUE; 136 132 remove_argument (N, &argc, argv); … … 147 143 148 144 /*** command-line options which modify the output list */ 149 if ( N = get_argument (argc, argv, "-treg")) {145 if ((N = get_argument (argc, argv, "-treg"))) { 150 146 remove_argument (N, &argc, argv); 151 147 SetOutputMode ("RegTimeMode"); 152 148 } 153 if ( N = get_argument (argc, argv, "-seq")) {149 if ((N = get_argument (argc, argv, "-seq"))) { 154 150 remove_argument (N, &argc, argv); 155 151 SetOutputMode ("CCDSeq"); 156 152 } 157 if ( N = get_argument (argc, argv, "-pt")) {153 if ((N = get_argument (argc, argv, "-pt"))) { 158 154 remove_argument (N, &argc, argv); 159 155 SetOutputMode ("PTstyle"); 160 156 } 161 157 output.table = (char *) NULL; 162 if ( N = get_argument (argc, argv, "-table")) {158 if ((N = get_argument (argc, argv, "-table"))) { 163 159 remove_argument (N, &argc, argv); 164 160 output.table = strcreate (argv[N]); … … 166 162 } 167 163 output.cadctable = (char *) NULL; 168 if ( N = get_argument (argc, argv, "-cadctable")) {164 if ((N = get_argument (argc, argv, "-cadctable"))) { 169 165 remove_argument (N, &argc, argv); 170 166 output.cadctable = strcreate (argv[N]); … … 172 168 } 173 169 output.bintable = (char *) NULL; 174 if ( N = get_argument (argc, argv, "-bintable")) {170 if ((N = get_argument (argc, argv, "-bintable"))) { 175 171 remove_argument (N, &argc, argv); 176 172 output.bintable = strcreate (argv[N]); … … 187 183 output.unique = FALSE; 188 184 189 if ( N = get_argument (argc, argv, "-delete")) {185 if ((N = get_argument (argc, argv, "-delete"))) { 190 186 remove_argument (N, &argc, argv); 191 187 output.delete = TRUE; 192 188 } 193 189 194 if ( N = get_argument (argc, argv, "-unique")) {190 if ((N = get_argument (argc, argv, "-unique"))) { 195 191 remove_argument (N, &argc, argv); 196 192 output.unique = TRUE; 197 193 } 198 194 199 if ( N = get_argument (argc, argv, "-modify")) {195 if ((N = get_argument (argc, argv, "-modify"))) { 200 196 if (output.delete) { 201 197 fprintf (stderr, "can't specify more than one modifier at a time\n"); … … 251 247 output.modify_type = TRUE; 252 248 remove_argument (N, &argc, argv); 253 output.type == T_UNDEF; 254 for (i = 0; (i < NTYPE) && (output.type == T_UNDEF); i++) { 255 if (!strncasecmp (argv[N], typename[i], strlen(argv[N]))) output.type = i; 256 } 249 output.type = get_image_type (argv[N]); 257 250 if (output.type == T_UNDEF) { 258 251 fprintf (stderr, "ERROR: invalid image type %s\n", argv[N]); -
trunk/Ohana/src/imregister/imreg/cadc.c
r2451 r2803 18 18 double left, right, center, outer, top, bottom; 19 19 double iqx, iqy, iqr, iqf, iqo; 20 FILE *p;21 20 22 21 /* set REFCCD for use in GetREFIQ */ … … 155 154 int *GetUniqueObsID (RegImage *image, int *index, int *entry, int Nindex, int *Nmatch) { 156 155 157 int i, j, k, m, N, NMATCH, REFCCD;156 int i, j, N, NMATCH; 158 157 int *match; 159 158 … … 185 184 int GetREFCCD (RegImage *image, int *index, int *entry, int Nindex, int start) { 186 185 187 int i, j, k, m,N, NMATCH;186 int i, N, NMATCH; 188 187 int *match; 189 188 -
trunk/Ohana/src/imregister/imreg/db.c
r2454 r2803 29 29 30 30 int Nbytes; 31 char *data; 31 32 32 33 /* assign pointers to new data block */ … … 41 42 42 43 /* add padding space to buffer */ 43 REALLOCATE ((char *) image, char, Nbytes); 44 data = (char *) image; 45 REALLOCATE (data, char, Nbytes); 46 image = (RegImage *) data; 47 44 48 table.buffer = (char *) image; 45 49 table.size = Nbytes; … … 163 167 164 168 ConvertStruct ((char *) new, sizeof (RegImage), Nnew, "regimage"); 165 fits_vadd_rows (&vtable, new, Nnew, sizeof(RegImage));169 fits_vadd_rows (&vtable, (char *) new, Nnew, sizeof(RegImage)); 166 170 167 171 /* write subset to file */ … … 197 201 int close_db () { 198 202 203 if (dbstate == LCK_EMPTY) return (TRUE); 204 199 205 fits_free_header (&header); 200 206 fits_free_matrix (&matrix); … … 208 214 209 215 int close_lock_db () { 216 217 if (dbstate == LCK_EMPTY) return (TRUE); 210 218 211 219 fits_free_header (&header); -
trunk/Ohana/src/imregister/imreg/iminfo.c
r74 r2803 64 64 fits_scan (&header, ImagetypeKeyword, "%s", 1, &Imagetype); 65 65 66 image[0].type = T_NONE; 67 if (!strcasecmp (Imagetype, "OBJECT")) { 68 image[0].type = T_OBJECT; 69 } 70 if (!strcasecmp (Imagetype, "DARK")) { 71 image[0].type = T_DARK; 72 } 73 if (!strcasecmp (Imagetype, "BIAS")) { 74 image[0].type = T_BIAS; 75 } 76 if (!strcasecmp (Imagetype, "FLAT")) { 77 image[0].type = T_FLAT; 78 } 79 if (!strcasecmp (Imagetype, "SKYFLAT")) { 80 image[0].type = T_FLAT; 81 } 82 if (NeedType && (image[0].type == T_NONE)) { 66 /* grab the image type : if not defined, set to 'none' */ 67 image[0].type = get_image_type (Imagetype); 68 if (NeedType && (image[0].type == T_UNDEF)) { 83 69 fprintf (stderr, "ERROR: skipping unknown image type\n"); 84 70 exit (1); 71 } else { 72 image[0].type = T_NONE; 85 73 } 86 74 -
trunk/Ohana/src/imregister/imreg/imregclient.c
r74 r2803 7 7 RegImage *image; 8 8 char *TempDB; 9 int i, Nentry, Nslice, status ;9 int i, Nentry, Nslice, status, tmpint; 10 10 float *dtime; 11 11 … … 13 13 sprintf (TempDB, "%s.bfr", ImageDB); 14 14 15 Nentry = 0; 15 16 image = iminfo (fitsfile); 16 17 … … 36 37 exit (1); 37 38 } 38 status = fscanf (f, "%d %f %f", &image[0].ccd, &image[0].sky, &image[0].fwhm); 39 status = fscanf (f, "%d %f %f", &tmpint, &image[0].sky, &image[0].fwhm); 40 image[0].ccd = tmpint; 39 41 fclose (f); 40 42 Nentry = 1; … … 53 55 for (i = 0; i < Nentry; i++) { 54 56 image[i] = image[0]; 55 status = fscanf (f, "%d %f %f", &image[i].ccd, &image[i].sky, &image[i].fwhm); 57 status = fscanf (f, "%d %f %f", &tmpint, &image[i].sky, &image[i].fwhm); 58 image[i].ccd = tmpint; 56 59 if (image[i].ccd == Nslice) continue; 57 60 image[i].obstime += *dtime*image[i].ccd; -
trunk/Ohana/src/imregister/imreg/match.c
r26 r2803 15 15 ALLOCATE (match, int, NMATCH); 16 16 17 Nname = 0; 17 18 if (criteria.NameSelect) Nname = strlen (criteria.Name); 18 19 -
trunk/Ohana/src/imregister/imreg/modify.c
r74 r2803 9 9 int Nimage; 10 10 RegImage *image; 11 12 Nold = 0; 13 tmppath = NULL; 11 14 12 15 image = get_images (&Nimage); -
trunk/Ohana/src/imregister/imreg/output.c
r2452 r2803 143 143 obsstr = sec_to_date (subset[0].obstime); 144 144 regstr = sec_to_date (subset[0].regtime); 145 typestr = typename[(int)subset[0].type];146 modestr = modename[(int)subset[0].mode];145 typestr = get_type_name(subset[0].type); 146 modestr = get_mode_name(subset[0].mode); 147 147 ccdstr = ccds[(int)subset[0].ccd]; 148 148 … … 185 185 i = match[j]; 186 186 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];187 modestr = get_mode_name (image[i].mode); 188 typestr = get_type_name (image[i].type); 189 189 timestr = RegTimeMode ? sec_to_date (image[i].regtime) : sec_to_date (image[i].obstime); 190 190 -
trunk/Ohana/src/imregister/imreg/unique.c
r69 r2803 8 8 int N, NMATCH; 9 9 int *match, *entry; 10 int reject;11 10 RegImage *image; 12 11 char idxline[128]; -
trunk/Ohana/src/imregister/include/detrend.h
r2453 r2803 109 109 Criteria *ExpandRecipe (Criteria *base, int *Ncrit); 110 110 111 int escape (int mode, char *message); 112 int DumpFitsBintable (char *filename, DetReg *image, Match *match, int Nmatch); 113 int cmp_crit (Criteria *crit, DetReg *image); 114 int set_crit (Criteria *crit, DetReg *image); 115 int ckpathname (char *newpath); 116 int PrintCriteria (); 117 int SetAltpath (Match *match, int Nmatch); 118 -
trunk/Ohana/src/imregister/include/imreg.h
r2453 r2803 106 106 MosaicLayout *CreateMegaCam (); 107 107 int GetREFCCD (RegImage *image, int *index, int *entry, int Nindex, int start); 108 109 int imregclient (char *fitsfile, char *statfile, char *datfile); 110 void SIG_DIE (int sig); 111 void SIG_PIPE (int sig); 112 void SetSignals (); 113 void KillProcess (char *pidfile); 114 void StatusProcess (char *pidfile); 115 int close_lock_db (); 116 int ConfigPID (char *pidfile); 117 int print_db_status (char *message); 118 int escape (int mode, char *message); 119 120 int LoadPID (char *file, pid_t *pid, char *username, char *machine); 121 int Shutdown (int status); 122 void RemovePID (); 123 int rconnect (char *hostname, char *command, int *rsock, int *wsock); 124 125 int InitFifo (Fifo *fifo, int Nalloc, int Nextra); 126 int FlushFifo (Fifo *fifo); 127 int ShiftFifo (Fifo *fifo); 128 int ReadtoFifo (Fifo *fifo, int sock); 129 void FreeFifo (Fifo *fifo); 130 int SockScan (char *string, Fifo *fifo, int sock); 131 int memstr (char *m1, char *m2, int n); 132 133 int *unique_entries (int *subset, int *Nmatch); -
trunk/Ohana/src/imregister/include/imregister.h
r2772 r2803 4 4 # include <time.h> 5 5 # include <ctype.h> 6 # include <stdlib.h> 6 7 7 8 /* config variables from very old versions - remove? … … 85 86 void sort (float *value, int N); 86 87 void dsort (double *value, int N); 88 void sortstr (char **S, int *X, int N); 89 void sortpair (int *X, int *Y, int N); 87 90 88 91 void ConfigCamera (); … … 96 99 double get_fwhm (char *filename); 97 100 98 intget_version (int argc, char **argv, char *version);101 void get_version (int argc, char **argv, char *version); 99 102 int set_db (char *filename); 103 void warn_scan (Header *header, char *field, char *format, int N, void *var); 100 104 105 void clean_spaces (char *line); 101 106 102 107 /* where is this defined ?? */ 103 108 char *basename (char *); 104 105 # define T_UNDEF -1106 # define NTYPE 11107 enum {T_NONE, T_OBJECT, T_DARK, T_BIAS, T_FLAT, T_MASK, T_FRINGE, T_SCATTER, T_MODES, T_FRINGEPTS, T_ANY};108 static char typename[NTYPE][32] = {"none", "object", "dark", "bias", "flat", "mask", "fringe", "scatter", "modes", "frpts", "any"};109 static char typecode[NTYPE] = {'x', 'o', 'd', 'b', 'f', 'm', 'r', 's', 'M', 'F'};110 111 # define M_UNDEF -1112 # define NMODE 7113 enum {M_NONE, M_MEF, M_SPLIT, M_SINGLE, M_CUBE, M_SLICE, M_MODES};114 static char modename[NMODE][32] = {"none", "MEF", "SPLIT", "SINGLE", "CUBE", "SLICE", "MODES"}; -
trunk/Ohana/src/imregister/include/photreg.h
r2488 r2803 46 46 void set_timezone (double dt); 47 47 void DumpCADCTable (char *filename, PhotPars *image, int *match, int Nmatch); 48 void getImageData (char *Image, char *ImageCCD, char *ImageMode); 49 void set_Binary_name (char *name); 50 void set_ASCII_name (char *string); 51 int load_old_db (); 52 int escape (int mode, char *message); -
trunk/Ohana/src/imregister/include/spreg.h
r2769 r2803 141 141 MosaicLayout *CreateMegaCam (); 142 142 int GetREFCCD (Spectrum *spectrum, int *index, int *entry, int Nindex, int start); 143 144 void showinfo (Spectrum *spec); 145 int escape (int mode, char *message); 146 int set_spectra (Spectrum *new, int Nnew); 147 Spectrum *get_spectra (int *N); 148 149 int fits_scan_nchar (Header *header, int size, char *field, int N,...); 150 void warn_scan_nchar (Header *header, int size, char *field, int N, void *var); 151 152 int *unique_entries (int *subset, int *Nmatch); -
trunk/Ohana/src/imregister/photreg/args.photreg.c
r2454 r2803 8 8 int *list, Nlist; 9 9 int N, required, Ntimes; 10 double dtime;11 10 unsigned long *tstart, *tstop; 12 11 PhotCode *photcode, *depcode; … … 14 13 ConfigInit (&argc, argv); 15 14 15 photcode = NULL; 16 16 output.modify = TRUE; 17 17 required = 0x0; … … 29 29 /* set the required database */ 30 30 output.db = strcreate ("phot"); 31 if ( N = get_argument (argc, argv, "-trans")) {31 if ((N = get_argument (argc, argv, "-trans"))) { 32 32 remove_argument (N, &argc, argv); 33 33 output.db = strcreate ("trans"); … … 36 36 /*** optional fields ***/ 37 37 strcpy (newdata[0].label, "elixir"); 38 if ( N = get_argument (argc, argv, "-label")) {38 if ((N = get_argument (argc, argv, "-label"))) { 39 39 remove_argument (N, &argc, argv); 40 40 strcpy (newdata[0].label, argv[N]); … … 43 43 44 44 newdata[0].Nmeas = 1; 45 if ( N = get_argument (argc, argv, "-Nmeas")) {45 if ((N = get_argument (argc, argv, "-Nmeas"))) { 46 46 remove_argument (N, &argc, argv); 47 47 newdata[0].Nmeas = atoi (argv[N]); … … 50 50 51 51 newdata[0].Ntime = 1; 52 if ( N = get_argument (argc, argv, "-Ntime")) {52 if ((N = get_argument (argc, argv, "-Ntime"))) { 53 53 remove_argument (N, &argc, argv); 54 54 newdata[0].Ntime = atoi (argv[N]); … … 57 57 58 58 output.offset = FALSE; 59 if ( N = get_argument (argc, argv, "-offset")) {59 if ((N = get_argument (argc, argv, "-offset"))) { 60 60 remove_argument (N, &argc, argv); 61 61 output.offset = TRUE; … … 70 70 71 71 /* observed zero point */ 72 if ( N = get_argument (argc, argv, "-zp")) {72 if ((N = get_argument (argc, argv, "-zp"))) { 73 73 remove_argument (N, &argc, argv); 74 74 newdata[0].ZP = atof (argv[N]); … … 78 78 79 79 /* error on observed zero point */ 80 if ( N = get_argument (argc, argv, "-dzp")) {80 if ((N = get_argument (argc, argv, "-dzp"))) { 81 81 remove_argument (N, &argc, argv); 82 82 newdata[0].dZP = atof (argv[N]); … … 86 86 87 87 /* photcode system */ 88 if ( N = get_argument (argc, argv, "-photcode")) {88 if ((N = get_argument (argc, argv, "-photcode"))) { 89 89 remove_argument (N, &argc, argv); 90 90 if ((photcode = GetPhotcodebyName (argv[N])) == NULL) { … … 120 120 newdata[0].ZPo = 0.001*photcode[0].C + 0.001*depcode[0].C; 121 121 if (output.offset) newdata[0].ZP += newdata[0].ZPo; 122 return (TRUE); 122 123 } 123 124 -
trunk/Ohana/src/imregister/photreg/args.photsearch.c
r126 r2803 23 23 24 24 criteria.PhotCodeSelect = FALSE; 25 if ( N = get_argument (argc, argv, "-photcode")) {25 if ((N = get_argument (argc, argv, "-photcode"))) { 26 26 remove_argument (N, &argc, argv); 27 if ((criteria.photcode = GetPhotcodeCodebyName (argv[N])) == NULL) {27 if ((criteria.photcode = GetPhotcodeCodebyName (argv[N])) == 0) { 28 28 fprintf (stderr, "ERROR: photcode not found in table\n"); 29 29 exit (1); … … 34 34 35 35 criteria.LabelSelect = FALSE; 36 if ( N = get_argument (argc, argv, "-label")) {36 if ((N = get_argument (argc, argv, "-label"))) { 37 37 remove_argument (N, &argc, argv); 38 38 criteria.Label = strcreate (argv[N]); … … 42 42 43 43 output.delete = FALSE; 44 if ( N = get_argument (argc, argv, "-delete")) {44 if ((N = get_argument (argc, argv, "-delete"))) { 45 45 remove_argument (N, &argc, argv); 46 46 output.delete = TRUE; … … 48 48 49 49 output.equiv = FALSE; 50 if ( N = get_argument (argc, argv, "-equiv")) {50 if ((N = get_argument (argc, argv, "-equiv"))) { 51 51 remove_argument (N, &argc, argv); 52 52 output.equiv = TRUE; … … 54 54 55 55 output.offset = FALSE; 56 if ( N = get_argument (argc, argv, "-offset")) {56 if ((N = get_argument (argc, argv, "-offset"))) { 57 57 remove_argument (N, &argc, argv); 58 58 output.offset = TRUE; … … 60 60 61 61 output.table = (char *) NULL; 62 if ( N = get_argument (argc, argv, "-table")) {62 if ((N = get_argument (argc, argv, "-table"))) { 63 63 remove_argument (N, &argc, argv); 64 64 output.table = strcreate (argv[N]); … … 67 67 68 68 output.bintable = (char *) NULL; 69 if ( N = get_argument (argc, argv, "-bintable")) {69 if ((N = get_argument (argc, argv, "-bintable"))) { 70 70 remove_argument (N, &argc, argv); 71 71 output.bintable = strcreate (argv[N]); … … 74 74 75 75 output.verbose = FALSE; 76 if ( N = get_argument (argc, argv, "-v")) {76 if ((N = get_argument (argc, argv, "-v"))) { 77 77 remove_argument (N, &argc, argv); 78 78 output.verbose = TRUE; … … 80 80 81 81 output.convert = FALSE; 82 if ( N = get_argument (argc, argv, "-convert")) {82 if ((N = get_argument (argc, argv, "-convert"))) { 83 83 remove_argument (N, &argc, argv); 84 84 output.convert = TRUE; … … 89 89 } 90 90 91 if ( N = get_argument (argc, argv, "-image")) {91 if ((N = get_argument (argc, argv, "-image"))) { 92 92 remove_argument (N, &argc, argv); 93 93 if (argc < N + 3) { … … 102 102 103 103 output.db = strcreate ("phot"); 104 if ( N = get_argument (argc, argv, "-trans")) {104 if ((N = get_argument (argc, argv, "-trans"))) { 105 105 remove_argument (N, &argc, argv); 106 106 output.db = strcreate ("trans"); … … 123 123 criteria.photcode = equiv; 124 124 } 125 return (TRUE); 125 126 } -
trunk/Ohana/src/imregister/photreg/db.c
r90 r2803 70 70 71 71 /* add padding space to buffer */ 72 REALLOCATE ((char *) image, char, Nbytes);73 72 table.buffer = (char *) image; 73 REALLOCATE (table.buffer, char, Nbytes); 74 image = (PhotPars *) table.buffer; 74 75 table.size = Nbytes; 75 76 … … 245 246 246 247 ConvertStruct ((char *) new, sizeof (PhotPars), Nnew, "photpars"); 247 fits_vadd_rows (&vtable, new, Nnew, sizeof(PhotPars));248 fits_vadd_rows (&vtable, (char *) new, Nnew, sizeof(PhotPars)); 248 249 249 250 /* write subset to file */ … … 290 291 fd = fileno (f); 291 292 fprintf (stderr, "db: %s, fd: %d\n", dBFile, fd); 293 return (TRUE); 292 294 } 293 295 -
trunk/Ohana/src/imregister/photreg/define.c
r126 r2803 4 4 static char *BinaryName = (char *) NULL; 5 5 6 intset_Binary_name (char *name) {6 void set_Binary_name (char *name) { 7 7 BinaryName = name; 8 8 } -
trunk/Ohana/src/imregister/photreg/getImageData.c
r2454 r2803 2 2 # include "photreg.h" 3 3 4 getImageData (char *Image, char *ImageCCD, char *ImageMode) {4 void getImageData (char *Image, char *ImageCCD, char *ImageMode) { 5 5 6 6 Header header; … … 66 66 } 67 67 criteria.PhotCodeSelect = TRUE; 68 68 return; 69 69 } -
trunk/Ohana/src/imregister/photreg/output.c
r2454 r2803 6 6 static char *ASCIIName = (char *) NULL; 7 7 8 set_ASCII_name (char *string) {8 void set_ASCII_name (char *string) { 9 9 ASCIIName = string; 10 10 } … … 50 50 } 51 51 ConvertStruct ((char *) subset, sizeof (PhotPars), Nmatch, "photpars"); 52 fits_add_rows (&table, subset, Nmatch, sizeof (PhotPars));52 fits_add_rows (&table, (char *) subset, Nmatch, sizeof (PhotPars)); 53 53 54 54 fits_write_header (filename, &header); … … 155 155 newdata[0].K, newdata[0].X, startstr, stopstr, 156 156 c1, c2, newdata[0].Nmeas, newdata[0].Ntime, code, photsys, newdata[0].label); 157 if (!fits_add_rows (&table, line, 1, strlen(line))) escape (IGNORE, (FILE *) NULL, (char *) NULL, NULL,"error writing dataline");157 if (!fits_add_rows (&table, line, 1, strlen(line))) escape (IGNORE, "error writing dataline"); 158 158 159 159 free (line); -
trunk/Ohana/src/imregister/spreg/ConfigInit.c
r2488 r2803 6 6 void ConfigInit (int *argc, char **argv) { 7 7 8 int i, NDB; 9 char *config, *file, ElixirBase[80]; 8 char *config, *file; 10 9 11 10 /*** load configuration info ***/ -
trunk/Ohana/src/imregister/spreg/args.spregister.c
r2768 r2803 9 9 10 10 NoReg = FALSE; 11 if ( N = get_argument (argc, argv, "-noreg")) {11 if ((N = get_argument (argc, argv, "-noreg"))) { 12 12 remove_argument (N, &argc, argv); 13 13 NoReg = TRUE; … … 15 15 16 16 DUMP = FALSE; 17 if ( N = get_argument (argc, argv, "-dump")) {17 if ((N = get_argument (argc, argv, "-dump"))) { 18 18 remove_argument (N, &argc, argv); 19 19 DUMP = TRUE; … … 21 21 22 22 output.verbose = FALSE; 23 if ( N = get_argument (argc, argv, "-v")) {23 if ((N = get_argument (argc, argv, "-v"))) { 24 24 remove_argument (N, &argc, argv); 25 25 output.verbose = TRUE; … … 27 27 28 28 NeedType = FALSE; 29 if ( N = get_argument (argc, argv, "-needtype")) {29 if ((N = get_argument (argc, argv, "-needtype"))) { 30 30 remove_argument (N, &argc, argv); 31 31 NeedType = TRUE; -
trunk/Ohana/src/imregister/spreg/args.spsearch.c
r2488 r2803 6 6 7 7 double dt; 8 int N , i;8 int N; 9 9 10 10 ConfigInit (&argc, argv); /* load elixir config data */ 11 11 12 12 /* set timezone (set static in misc.c) */ 13 if ( N = get_argument (argc, argv, "-tz")) {13 if ((N = get_argument (argc, argv, "-tz"))) { 14 14 remove_argument (N, &argc, argv); 15 15 dt = atof (argv[N]); … … 27 27 /* exposure time */ 28 28 criteria.ExptimeSelect = FALSE; 29 if ( N = get_argument (argc, argv, "-etime")) {29 if ((N = get_argument (argc, argv, "-etime"))) { 30 30 remove_argument (N, &argc, argv); 31 31 criteria.Exptime = atof (argv[N]); … … 41 41 criteria.ModeSelect = FALSE; 42 42 /* 43 criteria.Mode = M_ NONE;44 if ( N = get_argument (argc, argv, "-mode")) {43 criteria.Mode = M_UNDEF; 44 if ((N = get_argument (argc, argv, "-mode"))) { 45 45 remove_argument (N, &argc, argv); 46 for (i = 0; (i < NMODE) && (criteria.Mode == M_NONE); i++) { 47 if (!strncasecmp (argv[N], modename[i], strlen(argv[N]))) criteria.Mode = i; 48 } 49 if (criteria.Mode == M_NONE) { 46 criteria.Mode = get_image_mode (argv[N]); 47 if (criteria.Mode == M_UNDEF) { 50 48 fprintf (stderr, "ERROR: invalid image mode %s\n", argv[N]); 51 49 exit (1); … … 58 56 /* string in image name */ 59 57 criteria.FilenameSelect = FALSE; 60 if ( N = get_argument (argc, argv, "-filename")) {58 if ((N = get_argument (argc, argv, "-filename"))) { 61 59 remove_argument (N, &argc, argv); 62 60 criteria.Filename = strcreate (argv[N]); … … 67 65 /* string in image name */ 68 66 criteria.ObjectSelect = FALSE; 69 if ( N = get_argument (argc, argv, "-object")) {67 if ((N = get_argument (argc, argv, "-object"))) { 70 68 remove_argument (N, &argc, argv); 71 69 criteria.Object = strcreate (argv[N]); … … 76 74 /* string in image name */ 77 75 criteria.TelescopeSelect = FALSE; 78 if ( N = get_argument (argc, argv, "-tel")) {76 if ((N = get_argument (argc, argv, "-tel"))) { 79 77 remove_argument (N, &argc, argv); 80 78 criteria.Telescope = strcreate (argv[N]); … … 85 83 /* string in image name */ 86 84 criteria.InstrumentSelect = FALSE; 87 if ( N = get_argument (argc, argv, "-inst")) {85 if ((N = get_argument (argc, argv, "-inst"))) { 88 86 remove_argument (N, &argc, argv); 89 87 criteria.Instrument = strcreate (argv[N]); … … 93 91 94 92 /*** command-line options which modify the output list */ 95 if ( N = get_argument (argc, argv, "-treg")) {93 if ((N = get_argument (argc, argv, "-treg"))) { 96 94 remove_argument (N, &argc, argv); 97 95 SetOutputMode ("RegTimeMode"); 98 96 } 99 97 output.table = (char *) NULL; 100 if ( N = get_argument (argc, argv, "-table")) {98 if ((N = get_argument (argc, argv, "-table"))) { 101 99 remove_argument (N, &argc, argv); 102 100 output.table = strcreate (argv[N]); … … 104 102 } 105 103 output.bintable = (char *) NULL; 106 if ( N = get_argument (argc, argv, "-bintable")) {104 if ((N = get_argument (argc, argv, "-bintable"))) { 107 105 remove_argument (N, &argc, argv); 108 106 output.bintable = strcreate (argv[N]); … … 116 114 output.unique = FALSE; 117 115 118 if ( N = get_argument (argc, argv, "-delete")) {116 if ((N = get_argument (argc, argv, "-delete"))) { 119 117 remove_argument (N, &argc, argv); 120 118 output.delete = TRUE; 121 119 } 122 120 123 if ( N = get_argument (argc, argv, "-unique")) {121 if ((N = get_argument (argc, argv, "-unique"))) { 124 122 remove_argument (N, &argc, argv); 125 123 output.unique = TRUE; 126 124 } 127 125 128 if ( N = get_argument (argc, argv, "-modify")) {126 if ((N = get_argument (argc, argv, "-modify"))) { 129 127 if (output.delete) { 130 128 fprintf (stderr, "can't specify more than one modifier at a time\n"); -
trunk/Ohana/src/imregister/spreg/db.c
r2768 r2803 242 242 243 243 /* add padding space to buffer */ 244 REALLOCATE ((char *) spectrum, char, Nbytes);245 244 table.buffer = (char *) spectrum; 245 REALLOCATE (table.buffer, char, Nbytes); 246 spectrum = (Spectrum *) table.buffer; 246 247 table.size = Nbytes; 247 248 -
trunk/Ohana/src/imregister/spreg/match.c
r2488 r2803 15 15 NMATCH = 1000; 16 16 ALLOCATE (match, int, NMATCH); 17 18 Nfilename = Nobject = Ntelescope = Ninstrument = 0; 17 19 18 20 if (criteria.FilenameSelect) Nfilename = strlen (criteria.Filename); -
trunk/Ohana/src/imregister/spreg/modify.c
r2488 r2803 6 6 int i, j, Nold; 7 7 char *tmppath; 8 char *ext, *root, *path;9 8 int Nspectrum; 10 9 Spectrum *spectrum; 10 11 Nold = 0; 12 tmppath = NULL; 11 13 12 14 spectrum = get_spectra (&Nspectrum); -
trunk/Ohana/src/imregister/spreg/output.c
r2768 r2803 41 41 void DumpFitsBintable (char *filename, Spectrum *spectrum, int *match, int Nmatch) { 42 42 43 int i, j , Nx;43 int i, j; 44 44 Header header, theader; 45 45 Matrix matrix; … … 56 56 } 57 57 ConvertStruct ((char *) subset, sizeof (Spectrum), Nmatch, "spectrum"); 58 fits_add_rows (&table, subset, Nmatch, sizeof (Spectrum));58 fits_add_rows (&table, (char *) subset, Nmatch, sizeof (Spectrum)); 59 59 60 60 fits_write_header (filename, &header); … … 68 68 69 69 int i; 70 char *obsstr, *regstr, *line, dummy[64]; 71 char *modestr, *typestr, *ccdstr, *datestr; 70 char *obsstr, *regstr, *line, dummy[64], *datestr; 72 71 unsigned long tsecond; 73 72 Header header, theader; -
trunk/Ohana/src/imregister/spreg/spinfo.c
r2768 r2803 6 6 Spectrum *spectrum; 7 7 Header header; 8 int Naxes, Nextend; 9 char Imagetype[80], line[80]; 8 char line[80]; 10 9 struct timeval now; 11 10 char *name, *cwd, *tempname; 12 11 double tmp; 13 float *dtime;14 12 15 13 ALLOCATE (spectrum, Spectrum, 1); … … 59 57 warn_scan_nchar (&header, 16, TelescopeKeyword, 1, spectrum[0].telescope); 60 58 61 clean_spaces ( &spectrum[0].objname);62 clean_spaces ( &spectrum[0].instrument);63 clean_spaces ( &spectrum[0].telescope);59 clean_spaces (spectrum[0].objname); 60 clean_spaces (spectrum[0].instrument); 61 clean_spaces (spectrum[0].telescope); 64 62 65 63 warn_scan (&header, ExptimeKeyword, "%f", 1, &spectrum[0].exptime); -
trunk/Ohana/src/imregister/spreg/unique.c
r2488 r2803 5 5 int *unique_entries (int *subset, int *Nmatch) { 6 6 7 int i, j, k,m, Nspectrum, Nsubset;7 int i, j, m, Nspectrum, Nsubset; 8 8 int N, NMATCH; 9 9 int *match, *entry; 10 int reject;11 10 Spectrum *spectrum; 12 11 char idxline[128]; -
trunk/Ohana/src/imregister/src/cameraconfig.c
r90 r2803 1 # include <ohana.h> 2 static char *version = "cameraconfig $Revision: 1.1 $"; 3 4 main (int argc, char **argv) { 1 # include "imregister.h" 2 static char *version = "cameraconfig $Revision: 1.2 $"; 3 4 void usage (); 5 6 int main (int argc, char **argv) { 5 7 6 8 int i, Nccd, Nx, Ny, mosaic_x, mosaic_y, N, use_biassec; … … 8 10 char *config, *file; 9 11 char CameraConfig[256]; 10 char field[64], name[64],line[256], keyword[64];12 char field[64], line[256], keyword[64]; 11 13 char ID[64], *IDsel; 12 14 double x, y, Xo, Yo, theta; … … 16 18 char datasec[64], biassec[64]; 17 19 20 bzero (ID, 64); 18 21 get_version (argc, argv, version); 19 22 … … 47 50 48 51 /* command line options */ 49 if ( N = get_argument (argc, argv, "-h")) usage ();52 if ((N = get_argument (argc, argv, "-h"))) usage (); 50 53 51 54 /* command line options */ 52 55 NCCD = FALSE; 53 if ( N = get_argument (argc, argv, "-Nccd")) {56 if ((N = get_argument (argc, argv, "-Nccd"))) { 54 57 remove_argument (N, &argc, argv); 55 58 NCCD = TRUE; … … 57 60 58 61 AXES = FALSE; 59 if ( N = get_argument (argc, argv, "-axes")) {62 if ((N = get_argument (argc, argv, "-axes"))) { 60 63 remove_argument (N, &argc, argv); 61 64 AXES = TRUE; … … 63 66 64 67 AXIS0 = FALSE; 65 if ( N = get_argument (argc, argv, "-axis0")) {68 if ((N = get_argument (argc, argv, "-axis0"))) { 66 69 remove_argument (N, &argc, argv); 67 70 AXIS0 = TRUE; … … 69 72 70 73 AXIS1 = FALSE; 71 if ( N = get_argument (argc, argv, "-axis1")) {74 if ((N = get_argument (argc, argv, "-axis1"))) { 72 75 remove_argument (N, &argc, argv); 73 76 AXIS1 = TRUE; … … 75 78 76 79 MOSAIC_X = FALSE; 77 if ( N = get_argument (argc, argv, "-mosaicx")) {80 if ((N = get_argument (argc, argv, "-mosaicx"))) { 78 81 remove_argument (N, &argc, argv); 79 82 MOSAIC_X = TRUE; 80 83 } 81 84 MOSAIC_Y = FALSE; 82 if ( N = get_argument (argc, argv, "-mosaicy")) {85 if ((N = get_argument (argc, argv, "-mosaicy"))) { 83 86 remove_argument (N, &argc, argv); 84 87 MOSAIC_Y = TRUE; … … 86 89 87 90 CCDS = FALSE; 88 if ( N = get_argument (argc, argv, "-ccds")) {91 if ((N = get_argument (argc, argv, "-ccds"))) { 89 92 remove_argument (N, &argc, argv); 90 93 CCDS = TRUE; … … 92 95 93 96 CCDN = FALSE; 94 if ( N = get_argument (argc, argv, "-ccdn")) {97 if ((N = get_argument (argc, argv, "-ccdn"))) { 95 98 remove_argument (N, &argc, argv); 96 99 CCDN = TRUE; … … 98 101 99 102 SEQ = FALSE; 100 if ( N = get_argument (argc, argv, "-seq")) {103 if ((N = get_argument (argc, argv, "-seq"))) { 101 104 remove_argument (N, &argc, argv); 102 105 SEQ = TRUE; … … 104 107 105 108 XOFF = FALSE; 106 if ( N = get_argument (argc, argv, "-xoff")) {109 if ((N = get_argument (argc, argv, "-xoff"))) { 107 110 remove_argument (N, &argc, argv); 108 111 XOFF = TRUE; … … 110 113 111 114 YOFF = FALSE; 112 if ( N = get_argument (argc, argv, "-yoff")) {115 if ((N = get_argument (argc, argv, "-yoff"))) { 113 116 remove_argument (N, &argc, argv); 114 117 YOFF = TRUE; … … 116 119 117 120 XO = FALSE; 118 if ( N = get_argument (argc, argv, "-Xo")) {121 if ((N = get_argument (argc, argv, "-Xo"))) { 119 122 remove_argument (N, &argc, argv); 120 123 XO = TRUE; … … 122 125 123 126 YO = FALSE; 124 if ( N = get_argument (argc, argv, "-Yo")) {127 if ((N = get_argument (argc, argv, "-Yo"))) { 125 128 remove_argument (N, &argc, argv); 126 129 YO = TRUE; … … 128 131 129 132 THETA = FALSE; 130 if ( N = get_argument (argc, argv, "-theta")) {133 if ((N = get_argument (argc, argv, "-theta"))) { 131 134 remove_argument (N, &argc, argv); 132 135 THETA = TRUE; … … 134 137 135 138 XFLIP = FALSE; 136 if ( N = get_argument (argc, argv, "-xflip")) {139 if ((N = get_argument (argc, argv, "-xflip"))) { 137 140 remove_argument (N, &argc, argv); 138 141 XFLIP = TRUE; … … 140 143 141 144 YFLIP = FALSE; 142 if ( N = get_argument (argc, argv, "-yflip")) {145 if ((N = get_argument (argc, argv, "-yflip"))) { 143 146 remove_argument (N, &argc, argv); 144 147 YFLIP = TRUE; … … 146 149 147 150 DATASEC = FALSE; 148 if ( N = get_argument (argc, argv, "-datasec")) {151 if ((N = get_argument (argc, argv, "-datasec"))) { 149 152 remove_argument (N, &argc, argv); 150 153 DATASEC = TRUE; 151 154 } 152 155 BIASSEC = FALSE; 153 if ( N = get_argument (argc, argv, "-biassec")) {156 if ((N = get_argument (argc, argv, "-biassec"))) { 154 157 remove_argument (N, &argc, argv); 155 158 BIASSEC = TRUE; 156 159 } 157 160 USE_BIASSEC = FALSE; 158 if ( N = get_argument (argc, argv, "-usebiassec")) {161 if ((N = get_argument (argc, argv, "-usebiassec"))) { 159 162 remove_argument (N, &argc, argv); 160 163 USE_BIASSEC = TRUE; … … 162 165 163 166 GetID = FALSE; 164 if (N = get_argument (argc, argv, "-ID")) { 167 IDsel = 0; 168 if ((N = get_argument (argc, argv, "-ID"))) { 165 169 GetID = TRUE; 166 170 remove_argument (N, &argc, argv); 171 IDsel = strcreate (argv[N]); 172 remove_argument (N, &argc, argv); 173 } 174 175 GetN = FALSE; 176 Nsel = 0; 177 if ((N = get_argument (argc, argv, "-N"))) { 178 GetN = TRUE; 179 remove_argument (N, &argc, argv); 167 180 Nsel = atoi (argv[N]); 168 remove_argument (N, &argc, argv);169 }170 171 GetN = FALSE;172 if (N = get_argument (argc, argv, "-N")) {173 GetN = TRUE;174 remove_argument (N, &argc, argv);175 IDsel = strcreate (argv[N]);176 181 remove_argument (N, &argc, argv); 177 182 } … … 208 213 ID, &x, &y, &dx, &dy, datasec, biassec, &Xo, &Yo, &theta); 209 214 210 if (Get ID && (Nsel == i)) fprintf (stdout, "%s\n", ID);211 if (Get N && strnumcmp (IDsel, ID)) fprintf (stdout, "%d\n", i);215 if (GetN && (Nsel == i)) fprintf (stdout, "%d\n", i); 216 if (GetID && strnumcmp (IDsel, ID)) fprintf (stdout, "%s\n", ID); 212 217 if (SEQ) fprintf (stdout, "%d ", i); 213 218 if (CCDS) fprintf (stdout, "%s ", ID); … … 231 236 } 232 237 233 usage () {238 void usage () { 234 239 235 240 fprintf (stderr, "cameraconfig [option] : lookup camera parameters\n"); -
trunk/Ohana/src/imregister/src/convertimreg.c
r3 r2803 1 1 # include "imregister.h" 2 2 # include "imreg.h" 3 static char *version = "convertimreg $Revision: 3. 0$";3 static char *version = "convertimreg $Revision: 3.1 $"; 4 4 5 5 int main (int argc, char **argv) { … … 22 22 23 23 /* load old-style pseudo-FITS table db */ 24 lockstate = LCK_SOFT; 24 25 25 26 /* lock database (soft) */ 26 f = fsetlockfile (argv[1], 300.0, LCK_SOFT, &dbstate);27 f = fsetlockfile (argv[1], 300.0, lockstate, &dbstate); 27 28 if (f == (FILE *) NULL) { 28 29 fprintf (stderr, "ERROR: can't open db\n"); … … 54 55 55 56 DumpFitsBintable (argv[2], pimage, match, Nimage); 57 exit (0); 56 58 } -
trunk/Ohana/src/imregister/src/detsearch.c
r75 r2803 1 1 # include "imregister.h" 2 2 # include "detrend.h" 3 static char *version = "detsearch $Revision: 3. 1$";3 static char *version = "detsearch $Revision: 3.2 $"; 4 4 5 5 int main (int argc, char **argv) { … … 18 18 if (!status) { 19 19 close_db (); 20 fprintf (stderr, "database missing or empty\n"); 20 21 exit (0); 21 22 } … … 29 30 match = UniqueSubset (match, &Nmatch); 30 31 if (Nmatch == 0) { 31 if (output.verbose) fprintf (stderr, "ERROR: can't find any valid detrend files (%s %s %d)\n", typename[criteria[0].Type], filtername[criteria[0].Filter], criteria[0].CCD);32 if (output.verbose) fprintf (stderr, "ERROR: can't find any valid detrend files (%s %s %d)\n", get_type_name(criteria[0].Type), filtername[criteria[0].Filter], criteria[0].CCD); 32 33 close_db (); 33 34 exit (1); -
trunk/Ohana/src/imregister/src/filtnames.c
r90 r2803 1 # include <ohana.h>2 static char *version = "filtnames $Revision: 1. 1$";1 # include "imregister.h" 2 static char *version = "filtnames $Revision: 1.2 $"; 3 3 4 4 typedef struct { … … 7 7 } FiltCode; 8 8 9 main (int argc, char **argv) {9 int main (int argc, char **argv) { 10 10 11 11 int i, code, Ncode, Nmatch, Nfield, N, Select, CalibrationData; … … 36 36 /* image type (dark, flat, bias, etc) */ 37 37 Select = TRUE; 38 if ( N = get_argument (argc, argv, "-all")) {38 if ((N = get_argument (argc, argv, "-all"))) { 39 39 remove_argument (N, &argc, argv); 40 40 Select = FALSE; … … 43 43 /* image type (dark, flat, bias, etc) */ 44 44 CalibrationData = FALSE; 45 if ( N = get_argument (argc, argv, "-cal")) {45 if ((N = get_argument (argc, argv, "-cal"))) { 46 46 remove_argument (N, &argc, argv); 47 47 CalibrationData = TRUE; -
trunk/Ohana/src/imregister/src/imphotmerge.c
r127 r2803 2 2 3 3 Image *LoadImageTable (FILE *f, Header *header, int *nimage); 4 static char *version = "imphotcopy $Revision: 1. 1$";4 static char *version = "imphotcopy $Revision: 1.2 $"; 5 5 6 main (int argc, char **argv) {6 int main (int argc, char **argv) { 7 7 8 8 Header header, theader; … … 35 35 /* select by image photcode */ 36 36 PhotCodeSelect = FALSE; 37 if (N = get_argument (argc, argv, "-photcode")) { 37 PHOTCODE = 0; 38 if ((N = get_argument (argc, argv, "-photcode"))) { 38 39 remove_argument (N, &argc, argv); 39 40 if (!(PHOTCODE = GetPhotcodeCodebyName (argv[N]))) { … … 47 48 /* string in image name */ 48 49 NameSelect = (char *) NULL; 49 if (N = get_argument (argc, argv, "-name")) { 50 NameSelectLength = 0; 51 if ((N = get_argument (argc, argv, "-name"))) { 50 52 remove_argument (N, &argc, argv); 51 53 NameSelect = strcreate (argv[N]); … … 55 57 56 58 FitsOutput = (char *) NULL; 57 if ( N = get_argument (argc, argv, "-fits")) {59 if ((N = get_argument (argc, argv, "-fits"))) { 58 60 remove_argument (N, &argc, argv); 59 61 FitsOutput = strcreate (argv[N]); … … 62 64 63 65 VERBOSE = FALSE; 64 if ( N = get_argument (argc, argv, "-v")) {66 if ((N = get_argument (argc, argv, "-v"))) { 65 67 remove_argument (N, &argc, argv); 66 68 VERBOSE = TRUE; -
trunk/Ohana/src/imregister/src/imphotsearch.c
r2455 r2803 2 2 3 3 static char PhotError[] = "unknown"; 4 static char *version = "imphotsearch $Revision: 1.3 $"; 5 6 main (int argc, char **argv) { 4 static char *version = "imphotsearch $Revision: 1.4 $"; 5 6 int DumpFitsTable (char *filename, Image *image, int Nentry, int *index, int Nkeep); 7 8 int main (int argc, char **argv) { 7 9 8 10 FILE *f; … … 12 14 int Nimage, nimage, *index, Ntimes; 13 15 unsigned long *tstart, *tstop; 14 int VERBOSE, FORCE_READ, PHOTCODE, dbstate , lockstate;16 int VERBOSE, FORCE_READ, PHOTCODE, dbstate; 15 17 Image *image; 16 18 int PhotCodeSelect, Nin; … … 38 40 /* select by image photcode */ 39 41 PhotCodeSelect = FALSE; 40 if (N = get_argument (argc, argv, "-photcode")) { 42 PHOTCODE = 0; 43 if ((N = get_argument (argc, argv, "-photcode"))) { 41 44 remove_argument (N, &argc, argv); 42 45 if (!(PHOTCODE = GetPhotcodeCodebyName (argv[N]))) { … … 50 53 /* string in image name */ 51 54 NameSelect = (char *) NULL; 52 if (N = get_argument (argc, argv, "-name")) { 55 NameSelectLength = 0; 56 if ((N = get_argument (argc, argv, "-name"))) { 53 57 remove_argument (N, &argc, argv); 54 58 NameSelect = strcreate (argv[N]); … … 59 63 /* string in image name */ 60 64 CodeSelect = FALSE; 61 if (N = get_argument (argc, argv, "-code")) { 65 Code = 0; 66 if ((N = get_argument (argc, argv, "-code"))) { 62 67 CodeSelect = TRUE; 63 68 remove_argument (N, &argc, argv); … … 67 72 68 73 FitsOutput = (char *) NULL; 69 if ( N = get_argument (argc, argv, "-fits")) {74 if ((N = get_argument (argc, argv, "-fits"))) { 70 75 remove_argument (N, &argc, argv); 71 76 FitsOutput = strcreate (argv[N]); … … 74 79 75 80 VERBOSE = FALSE; 76 if ( N = get_argument (argc, argv, "-v")) {81 if ((N = get_argument (argc, argv, "-v"))) { 77 82 remove_argument (N, &argc, argv); 78 83 VERBOSE = TRUE; … … 80 85 81 86 FORCE_READ = FALSE; 82 if ( N = get_argument (argc, argv, "-force")) {87 if ((N = get_argument (argc, argv, "-force"))) { 83 88 remove_argument (N, &argc, argv); 84 89 FORCE_READ = TRUE; … … 131 136 exit (1); 132 137 } 133 fclearlockfile (dBFile, f, lockstate, &dbstate);138 fclearlockfile (dBFile, f, LCK_SOFT, &dbstate); 134 139 135 140 /* allocate space for reference lists */ … … 176 181 } 177 182 178 DumpFitsTable (char *filename, Image *image, int Nentry, int *index, int Nkeep) {183 int DumpFitsTable (char *filename, Image *image, int Nentry, int *index, int Nkeep) { 179 184 180 185 Header header, theader; -
trunk/Ohana/src/imregister/src/imphotset.c
r127 r2803 2 2 3 3 static char PhotError[] = "unknown"; 4 static char *version = "imphotset $Revision: 1. 1$";4 static char *version = "imphotset $Revision: 1.2 $"; 5 5 6 6 Image *LoadImageTable (FILE *f, Header *header, int *nimage); 7 7 8 main (int argc, char **argv) {8 int main (int argc, char **argv) { 9 9 10 10 Header header; … … 42 42 /* select by image photcode */ 43 43 PhotCodeSelect = FALSE; 44 if (N = get_argument (argc, argv, "-photcode")) { 44 photcode = NULL; 45 if ((N = get_argument (argc, argv, "-photcode"))) { 45 46 remove_argument (N, &argc, argv); 46 47 if ((photcode = GetPhotcodebyName (argv[N])) == NULL) { … … 54 55 /* select by image name */ 55 56 NameSelect = (char *) NULL; 56 if (N = get_argument (argc, argv, "-name")) { 57 NameSelectLength = 0; 58 if ((N = get_argument (argc, argv, "-name"))) { 57 59 remove_argument (N, &argc, argv); 58 60 NameSelect = strcreate (argv[N]); … … 63 65 /* desired action */ 64 66 ModifyFlag = FALSE; 65 if (N = get_argument (argc, argv, "-flag")) { 67 ModifyValue = ModifyEntry = NULL; 68 if ((N = get_argument (argc, argv, "-flag"))) { 66 69 remove_argument (N, &argc, argv); 67 70 ModifyEntry = strcreate (argv[N]); … … 73 76 74 77 VERBOSE = FALSE; 75 if ( N = get_argument (argc, argv, "-v")) {78 if ((N = get_argument (argc, argv, "-v"))) { 76 79 remove_argument (N, &argc, argv); 77 80 VERBOSE = TRUE; -
trunk/Ohana/src/imregister/src/imregister.c
r75 r2803 1 1 # include "imregister.h" 2 2 # include "imreg.h" 3 static char *version = "imregister $Revision: 3. 2$";3 static char *version = "imregister $Revision: 3.3 $"; 4 4 5 5 int main (int argc, char **argv) { … … 12 12 args (argc, argv); 13 13 image = iminfo (argv[1]); 14 15 Nnew = 0; 16 pimage = NULL; 14 17 15 18 /* define new entries (pimage, Nnew) */ -
trunk/Ohana/src/imregister/src/imsearch.c
r70 r2803 1 1 # include "imregister.h" 2 2 # include "imreg.h" 3 static char *version = "imsearch $Revision: 3. 1$";3 static char *version = "imsearch $Revision: 3.2 $"; 4 4 5 5 int main (int argc, char **argv) { … … 16 16 if (!status) { 17 17 close_db (); 18 fprintf (stderr, "database missing or empty\n"); 18 19 exit (0); 19 20 } -
trunk/Ohana/src/imregister/src/imstatreg.c
r98 r2803 1 1 # include "imregister.h" 2 2 # include "imreg.h" 3 static char *version = "imstatreg $Revision: 3. 6$";3 static char *version = "imstatreg $Revision: 3.7 $"; 4 4 5 5 int main (int argc, char **argv) { 6 6 7 7 RegImage *image; 8 float *dtime; 9 int i, *match, Nmatch, status, child, Nentry; 10 char *TempDB, *LogFile, *ccdname; 8 int *match, Nmatch, status, child, Nentry; 9 char *TempDB, *LogFile; 11 10 FILE *f; 12 11 … … 25 24 26 25 /* fork in background */ 27 if ( child = fork ()) {26 if ((child = fork ())) { 28 27 if (child == -1) { 29 28 fprintf (stderr, "error forking imstatreg -daemon \n"); -
trunk/Ohana/src/imregister/src/photcode.c
r3 r2803 1 1 # include "imregister.h" 2 static char *version = "photcode $Revision: 3. 0$";2 static char *version = "photcode $Revision: 3.1 $"; 3 3 4 4 int main (int argc, char **argv) { 5 5 6 6 Header header; 7 char detector[80], filter[80], FilterList[256],*ID;7 char detector[80], filter[80], *ID; 8 8 int i, ccd, VERBOSE, N, Nfilter; 9 char *photname;10 9 11 10 get_version (argc, argv, version); … … 15 14 16 15 VERBOSE = TRUE; 17 if ( N = get_argument (argc, argv, "-quiet")) {16 if ((N = get_argument (argc, argv, "-quiet"))) { 18 17 remove_argument (N, &argc, argv); 19 18 VERBOSE = FALSE; -
trunk/Ohana/src/imregister/src/photreg.c
r90 r2803 1 1 # include "imregister.h" 2 2 # include "photreg.h" 3 static char *version = "photreg $Revision: 1. 1$";3 static char *version = "photreg $Revision: 1.2 $"; 4 4 5 main (int argc, char **argv) {5 int main (int argc, char **argv) { 6 6 7 7 int status; -
trunk/Ohana/src/imregister/src/photsearch.c
r90 r2803 1 1 # include "imregister.h" 2 2 # include "photreg.h" 3 static char *version = "photsearch $Revision: 1. 1$";3 static char *version = "photsearch $Revision: 1.2 $"; 4 4 5 main (int argc, char **argv) {5 int main (int argc, char **argv) { 6 6 7 7 int status, Nmatch; … … 24 24 25 25 OutputSubset (match, Nmatch); 26 exit (0); 26 27 } -
trunk/Ohana/src/imregister/src/spregister.c
r2769 r2803 1 1 # include "imregister.h" 2 2 # include "spreg.h" 3 static char *version = "spregister $Revision: 1. 2$";3 static char *version = "spregister $Revision: 1.3 $"; 4 4 5 5 int main (int argc, char **argv) { 6 6 7 7 Spectrum *spectrum, *pspectrum; 8 int i, status, Nnew; 9 float *dtime; 8 int status, Nnew; 10 9 11 10 get_version (argc, argv, version); … … 26 25 } 27 26 append_db (pspectrum, Nnew); 27 exit (0); 28 28 } 29 29
Note:
See TracChangeset
for help on using the changeset viewer.
