Changeset 8427
- Timestamp:
- Aug 20, 2006, 5:36:41 PM (20 years ago)
- Location:
- trunk/Ohana/src/opihi
- Files:
-
- 31 edited
-
cmd.astro/csystem.c (modified) (1 diff)
-
cmd.astro/drizzle.c (modified) (1 diff)
-
cmd.data/queuedrop.c (modified) (2 diffs)
-
dvo/avextract.c (modified) (3 diffs)
-
dvo/calextract.c (modified) (3 diffs)
-
dvo/calmextract.c (modified) (3 diffs)
-
dvo/catalog.c (modified) (1 diff)
-
dvo/ccd.c (modified) (3 diffs)
-
dvo/cmatch.c (modified) (2 diffs)
-
dvo/cmd.c (modified) (3 diffs)
-
dvo/ddmags.c (modified) (3 diffs)
-
dvo/dmagaves.c (modified) (3 diffs)
-
dvo/dmagmeas.c (modified) (3 diffs)
-
dvo/dmags.c (modified) (3 diffs)
-
dvo/dmt.c (modified) (2 diffs)
-
dvo/fitcolors.c (modified) (4 diffs)
-
dvo/fitsed.c (modified) (5 diffs)
-
dvo/gstar.c (modified) (2 diffs)
-
dvo/imdata.c (modified) (2 diffs)
-
dvo/lcurve.c (modified) (2 diffs)
-
dvo/lightcurve.c (modified) (2 diffs)
-
dvo/mextract.c (modified) (4 diffs)
-
dvo/photometry.c (modified) (2 diffs)
-
dvo/pmeasure.c (modified) (2 diffs)
-
dvo/subpix.c (modified) (3 diffs)
-
include/external.h (modified) (1 diff)
-
include/pantasks.h (modified) (2 diffs)
-
include/shell.h (modified) (2 diffs)
-
lib.data/queues.c (modified) (2 diffs)
-
lib.shell/SocketOps.c (modified) (2 diffs)
-
lib.shell/version.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/cmd.astro/csystem.c
r8130 r8427 5 5 /* USAGE: csystem [C/G/E/H] [C/G/E/H] [epoch] */ 6 6 int i; 7 double X in, Yin, X, Y, Xo, xo, phi, T;7 double X, Y, Xo, xo, phi, T; 8 8 double sin_x, sin_y, cos_x, cos_y; 9 9 float *x, *y; -
trunk/Ohana/src/opihi/cmd.astro/drizzle.c
r8200 r8427 293 293 YY = (SYy*Sx2 - SYx*Sxy) / (Sx2*Sy2 - Sxy*Sxy); 294 294 YO = Y/N - YX*x/N - YY*y/N; 295 295 return (TRUE); 296 296 } 297 297 -
trunk/Ohana/src/opihi/cmd.data/queuedrop.c
r8192 r8427 5 5 int N; 6 6 char *Key; 7 char *var;8 7 char *line; 9 8 char *Value; … … 19 18 } 20 19 21 if ((argc != 2) || (Key == -1)) {20 if ((argc != 2) || (Key == NULL)) { 22 21 gprint (GP_ERR, "USAGE: queuedrop (queue) [-key N value]\n"); 23 22 return (FALSE); -
trunk/Ohana/src/opihi/dvo/avextract.c
r7917 r8427 54 54 if ((vec = SelectVector (argv[1], ANYVECTOR, TRUE)) == NULL) goto escape; 55 55 56 // XXX need to add interrupt test to this loop 56 57 for (i = 0; i < skylist[0].Nregions; i++) { 57 58 /* lock, load, unlock catalog */ 58 59 catalog.filename = skylist[0].filename[i]; 59 switch (lock_catalog (&catalog, LCK_SOFT)) { 60 case 2: 61 unlock_catalog (&catalog); 62 case 0: 63 continue; 60 catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_SECF; 61 62 // an error exit status here is a significant error 63 if (!dvo_catalog_open (&catalog, NULL, FALSE, "r")) { 64 fprintf (stderr, "ERROR: failure to open catalog file %s\n", catalog.filename); 65 exit (2); 64 66 } 65 catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_SECF; 66 if (!load_catalog (&catalog, FALSE)) { 67 unlock_catalog (&catalog); 68 continue; 69 } 70 unlock_catalog (&catalog); 67 dvo_catalog_unlock (&catalog); 71 68 72 69 for (j = 0; j < catalog.Naverage; j++) { … … 76 73 CHECK_REALLOCATE (vec[0].elements, float, NPTS, N, 2000); 77 74 } 78 if (catalog.average != NULL) free (catalog.average); 79 if (catalog.secfilt != NULL) free (catalog.secfilt); 80 if (catalog.measure != NULL) free (catalog.measure); 81 catalog.average = (Average *) NULL; 82 catalog.secfilt = (SecFilt *) NULL; 83 catalog.measure = (Measure *) NULL; 75 dvo_catalog_free (&catalog); 84 76 } 85 77 vec[0].Nelements = N; … … 95 87 escape: 96 88 SkyListFree (skylist, ((RegionName != NULL) || (RegionList != NULL))); 97 if (catalog.average != NULL) free (catalog.average); 98 if (catalog.secfilt != NULL) free (catalog.secfilt); 99 if (catalog.measure != NULL) free (catalog.measure); 89 dvo_catalog_free (&catalog); 100 90 if (RegionName != NULL) free (RegionName); 101 91 if (RegionList != NULL) free (RegionList); -
trunk/Ohana/src/opihi/dvo/calextract.c
r7917 r8427 62 62 /* lock, load, unlock catalog */ 63 63 catalog.filename = skylist[0].filename[Nr]; 64 switch (lock_catalog (&catalog, LCK_SOFT)) { 65 case 2: 66 unlock_catalog (&catalog); 67 case 0: 68 continue; 64 catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_SECF; 65 66 // an error exit status here is a significant error 67 if (!dvo_catalog_open (&catalog, NULL, FALSE, "r")) { 68 fprintf (stderr, "ERROR: failure to open catalog file %s\n", catalog.filename); 69 exit (2); 69 70 } 70 catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_SECF; 71 if (!load_catalog (&catalog, FALSE)) { 72 unlock_catalog (&catalog); 73 continue; 74 } 75 unlock_catalog (&catalog); 71 dvo_catalog_unlock (&catalog); 76 72 77 73 /* extract values, assign to vectors */ … … 115 111 } 116 112 } 117 if (catalog.average != (Average *) NULL) free (catalog.average); 118 if (catalog.measure != (Measure *) NULL) free (catalog.measure); 119 if (catalog.secfilt != (SecFilt *) NULL) free (catalog.secfilt); 120 catalog.average = (Average *) NULL; 121 catalog.secfilt = (SecFilt *) NULL; 122 catalog.measure = (Measure *) NULL; 113 dvo_catalog_free (&catalog); 123 114 } 124 115 … … 134 125 135 126 escape: 136 137 127 if (RegionName != NULL) free (RegionName); 138 128 if (RegionList != NULL) free (RegionList); -
trunk/Ohana/src/opihi/dvo/calmextract.c
r7917 r8427 75 75 /* lock, load, unlock catalog */ 76 76 catalog.filename = skylist[0].filename[Nr]; 77 switch (lock_catalog (&catalog, LCK_SOFT)) { 78 case 2: 79 unlock_catalog (&catalog); 80 case 0: 81 continue; 77 catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_SECF; 78 79 // an error exit status here is a significant error 80 if (!dvo_catalog_open (&catalog, NULL, FALSE, "r")) { 81 fprintf (stderr, "ERROR: failure to open catalog file %s\n", catalog.filename); 82 exit (2); 82 83 } 83 catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_SECF; 84 if (!load_catalog (&catalog, FALSE)) { 85 unlock_catalog (&catalog); 86 continue; 87 } 88 unlock_catalog (&catalog); 84 dvo_catalog_unlock (&catalog); 89 85 90 86 /* extract values, assign to vectors */ … … 141 137 if (M1 != NULL) free (M1); 142 138 } 143 if (catalog.average != (Average *) NULL) free (catalog.average); 144 if (catalog.measure != (Measure *) NULL) free (catalog.measure); 145 if (catalog.secfilt != (SecFilt *) NULL) free (catalog.secfilt); 146 catalog.average = (Average *) NULL; 147 catalog.secfilt = (SecFilt *) NULL; 148 catalog.measure = (Measure *) NULL; 139 dvo_catalog_free (&catalog); 149 140 } 150 141 … … 161 152 162 153 escape: 163 164 154 FreeImageSelection (); 165 155 SkyListFree (skylist, ((RegionName != NULL) || (RegionList != NULL))); -
trunk/Ohana/src/opihi/dvo/catalog.c
r7917 r8427 316 316 /* lock, load, unlock catalog */ 317 317 catalog.filename = filename; 318 switch (lock_catalog (&catalog, LCK_SOFT)) {319 case 2:320 unlock_catalog (&catalog);321 case 0:322 continue;323 }324 318 catalog.catflags = LOAD_AVES; 325 if (!load_catalog (&catalog, TRUE)) { 326 unlock_catalog (&catalog); 327 continue; 328 } 329 unlock_catalog (&catalog); 319 320 // an error exit status here is a significant error 321 if (!dvo_catalog_open (&catalog, NULL, FALSE, "r")) { 322 fprintf (stderr, "ERROR: failure to open catalog file %s\n", catalog.filename); 323 exit (2); 324 } 325 dvo_catalog_unlock (&catalog); 330 326 } 331 327 -
trunk/Ohana/src/opihi/dvo/ccd.c
r7917 r8427 59 59 /* lock, load, unlock catalog */ 60 60 catalog.filename = skylist[0].filename[k]; 61 switch (lock_catalog (&catalog, LCK_SOFT)) { 62 case 2: 63 unlock_catalog (&catalog); 64 case 0: 65 continue; 61 catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_SECF; 62 63 // an error exit status here is a significant error 64 if (!dvo_catalog_open (&catalog, NULL, FALSE, "r")) { 65 fprintf (stderr, "ERROR: failure to open catalog file %s\n", catalog.filename); 66 exit (2); 66 67 } 67 catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_SECF; 68 if (!load_catalog (&catalog, FALSE)) { 69 unlock_catalog (&catalog); 70 continue; 71 } 72 unlock_catalog (&catalog); 68 dvo_catalog_unlock (&catalog); 73 69 74 70 /* get correct mags, convert to X,Y */ … … 109 105 if (M2 != NULL) free (M2); 110 106 } 111 if (catalog.average != NULL) free (catalog.average); 112 if (catalog.secfilt != NULL) free (catalog.secfilt); 113 if (catalog.measure != NULL) free (catalog.measure); 114 catalog.average = (Average *) NULL; 115 catalog.secfilt = (SecFilt *) NULL; 116 catalog.measure = (Measure *) NULL; 107 dvo_catalog_free (&catalog); 117 108 } 118 109 SkyListFree (skylist, ((RegionName != NULL) || (RegionList != NULL))); … … 126 117 escape: 127 118 SkyListFree (skylist, ((RegionName != NULL) || (RegionList != NULL))); 128 if (catalog.average != NULL) free (catalog.average); 129 if (catalog.secfilt != NULL) free (catalog.secfilt); 130 if (catalog.measure != NULL) free (catalog.measure); 119 dvo_catalog_free (&catalog); 131 120 if (RegionName != NULL) free (RegionName); 132 121 if (RegionList != NULL) free (RegionList); -
trunk/Ohana/src/opihi/dvo/cmatch.c
r7917 r8427 29 29 /* load data from the photometry database file */ 30 30 catalog1.filename = filename; 31 switch (lock_catalog (&catalog1, LCK_SOFT)) { 32 case 2: 33 unlock_catalog (&catalog1); 34 case 0: 35 return (FALSE); 31 catalog1.catflags = LOAD_AVES | LOAD_MEAS | LOAD_SECF; 32 33 // an error exit status here is a significant error 34 if (!dvo_catalog_open (&catalog1, NULL, FALSE, "r")) { 35 fprintf (stderr, "ERROR: failure to open catalog file %s\n", catalog1.filename); 36 exit (2); 36 37 } 37 catalog1.catflags = LOAD_AVES | LOAD_MEAS | LOAD_SECF; 38 if (!load_catalog (&catalog1, TRUE)) { 39 unlock_catalog (&catalog1); 40 return (FALSE); 41 } 42 unlock_catalog (&catalog1); 38 dvo_catalog_unlock (&catalog1); 43 39 gprint (GP_ERR, "read %d stars from phot catalog file %s\n", catalog1.Naverage, filename); 44 40 … … 78 74 compare (&catalog1, &catalog2, rvec, dvec, mvec, drvec, ddvec, dmvec, radius); 79 75 80 free (catalog1.average);76 dvo_catalog_free (&catalog1); 81 77 free (catalog2.average); 82 78 -
trunk/Ohana/src/opihi/dvo/cmd.c
r7917 r8427 57 57 /* lock, load, unlock catalog */ 58 58 catalog.filename = skylist[0].filename[j]; 59 switch (lock_catalog (&catalog, LCK_SOFT)) { 60 case 2: 61 unlock_catalog (&catalog); 62 case 0: 63 continue; 59 catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_SECF; 60 61 // an error exit status here is a significant error 62 if (!dvo_catalog_open (&catalog, NULL, FALSE, "r")) { 63 fprintf (stderr, "ERROR: failure to open catalog file %s\n", catalog.filename); 64 exit (2); 64 65 } 65 catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_SECF; 66 if (!load_catalog (&catalog, FALSE)) { 67 unlock_catalog (&catalog); 68 continue; 69 } 70 unlock_catalog (&catalog); 66 dvo_catalog_unlock (&catalog); 71 67 72 68 /* get correct mags, convert to X,Y */ … … 107 103 if (M3 != NULL) free (M3); 108 104 } 109 if (catalog.average != NULL) free (catalog.average); 110 if (catalog.secfilt != NULL) free (catalog.secfilt); 111 if (catalog.measure != NULL) free (catalog.measure); 112 catalog.average = (Average *) NULL; 113 catalog.secfilt = (SecFilt *) NULL; 114 catalog.measure = (Measure *) NULL; 105 dvo_catalog_free (&catalog); 115 106 } 116 107 SkyListFree (skylist, ((RegionName != NULL) || (RegionList != NULL))); … … 124 115 escape: 125 116 SkyListFree (skylist, ((RegionName != NULL) || (RegionList != NULL))); 126 if (catalog.average != NULL) free (catalog.average); 127 if (catalog.secfilt != NULL) free (catalog.secfilt); 128 if (catalog.measure != NULL) free (catalog.measure); 117 dvo_catalog_free (&catalog); 129 118 if (RegionName != NULL) free (RegionName); 130 119 if (RegionList != NULL) free (RegionList); -
trunk/Ohana/src/opihi/dvo/ddmags.c
r7917 r8427 60 60 /* lock, load, unlock catalog */ 61 61 catalog.filename = skylist[0].filename[k]; 62 switch (lock_catalog (&catalog, LCK_SOFT)) { 63 case 2: 64 unlock_catalog (&catalog); 65 case 0: 66 continue; 62 catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_SECF; 63 64 // an error exit status here is a significant error 65 if (!dvo_catalog_open (&catalog, NULL, FALSE, "r")) { 66 fprintf (stderr, "ERROR: failure to open catalog file %s\n", catalog.filename); 67 exit (2); 67 68 } 68 catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_SECF; 69 if (!load_catalog (&catalog, TRUE)) { 70 unlock_catalog (&catalog); 71 continue; 72 } 73 unlock_catalog (&catalog); 69 dvo_catalog_unlock (&catalog); 70 74 71 // gprint (GP_ERR, "seaching %s with %d stars\n", catalog.filename, catalog.Naverage); 75 72 // ListPhotSelections (); … … 113 110 } 114 111 // gprint (GP_ERR, "selected %d stars\n", Npts); 115 116 if (catalog.average != NULL) free (catalog.average); 117 if (catalog.secfilt != NULL) free (catalog.secfilt); 118 if (catalog.measure != NULL) free (catalog.measure); 119 catalog.average = (Average *) NULL; 120 catalog.secfilt = (SecFilt *) NULL; 121 catalog.measure = (Measure *) NULL; 112 dvo_catalog_free (&catalog); 122 113 } 123 114 SkyListFree (skylist, ((RegionName != NULL) || (RegionList != NULL))); … … 130 121 escape: 131 122 SkyListFree (skylist, ((RegionName != NULL) || (RegionList != NULL))); 132 if (catalog.average != NULL) free (catalog.average); 133 if (catalog.secfilt != NULL) free (catalog.secfilt); 134 if (catalog.measure != NULL) free (catalog.measure); 123 dvo_catalog_free (&catalog); 135 124 if (RegionName != NULL) free (RegionName); 136 125 if (RegionList != NULL) free (RegionList); -
trunk/Ohana/src/opihi/dvo/dmagaves.c
r7917 r8427 51 51 /* lock, load, unlock catalog */ 52 52 catalog.filename = skylist[0].filename[j]; 53 switch (lock_catalog (&catalog, LCK_SOFT)) { 54 case 2: 55 unlock_catalog (&catalog); 56 case 0: 57 continue; 53 catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_SECF; 54 55 // an error exit status here is a significant error 56 if (!dvo_catalog_open (&catalog, NULL, FALSE, "r")) { 57 fprintf (stderr, "ERROR: failure to open catalog file %s\n", catalog.filename); 58 exit (2); 58 59 } 59 catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_SECF; 60 if (!load_catalog (&catalog, FALSE)) { 61 unlock_catalog (&catalog); 62 continue; 63 } 64 unlock_catalog (&catalog); 60 dvo_catalog_unlock (&catalog); 65 61 66 62 /* get correct mags, convert to X,Y */ … … 89 85 if (M1 != NULL) free (M1); 90 86 } 91 if (catalog.average != NULL) free (catalog.average); 92 if (catalog.secfilt != NULL) free (catalog.secfilt); 93 if (catalog.measure != NULL) free (catalog.measure); 94 catalog.average = (Average *) NULL; 95 catalog.secfilt = (SecFilt *) NULL; 96 catalog.measure = (Measure *) NULL; 87 dvo_catalog_free (&catalog); 97 88 } 98 89 SkyListFree (skylist, ((RegionName != NULL) || (RegionList != NULL))); … … 106 97 escape: 107 98 SkyListFree (skylist, ((RegionName != NULL) || (RegionList != NULL))); 108 if (catalog.average != NULL) free (catalog.average); 109 if (catalog.secfilt != NULL) free (catalog.secfilt); 110 if (catalog.measure != NULL) free (catalog.measure); 99 dvo_catalog_free (&catalog); 111 100 if (RegionName != NULL) free (RegionName); 112 101 if (RegionList != NULL) free (RegionList); -
trunk/Ohana/src/opihi/dvo/dmagmeas.c
r7917 r8427 59 59 /* lock, load, unlock catalog */ 60 60 catalog.filename = skylist[0].filename[j]; 61 switch (lock_catalog (&catalog, LCK_SOFT)) { 62 case 2: 63 unlock_catalog (&catalog); 64 case 0: 65 continue; 61 catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_SECF; 62 63 // an error exit status here is a significant error 64 if (!dvo_catalog_open (&catalog, NULL, FALSE, "r")) { 65 fprintf (stderr, "ERROR: failure to open catalog file %s\n", catalog.filename); 66 exit (2); 66 67 } 67 catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_SECF; 68 if (!load_catalog (&catalog, FALSE)) { 69 unlock_catalog (&catalog); 70 continue; 71 } 72 unlock_catalog (&catalog); 68 dvo_catalog_unlock (&catalog); 73 69 74 70 /* get correct mags, convert to X,Y */ … … 109 105 if (M3 != NULL) free (M3); 110 106 } 111 if (catalog.average != NULL) free (catalog.average); 112 if (catalog.secfilt != NULL) free (catalog.secfilt); 113 if (catalog.measure != NULL) free (catalog.measure); 114 catalog.average = (Average *) NULL; 115 catalog.secfilt = (SecFilt *) NULL; 116 catalog.measure = (Measure *) NULL; 107 dvo_catalog_free (&catalog); 117 108 } 118 109 FreeImageSelection (); … … 128 119 FreeImageSelection (); 129 120 SkyListFree (skylist, ((RegionName != NULL) || (RegionList != NULL))); 130 if (catalog.average != NULL) free (catalog.average); 131 if (catalog.secfilt != NULL) free (catalog.secfilt); 132 if (catalog.measure != NULL) free (catalog.measure); 121 dvo_catalog_free (&catalog); 133 122 if (RegionName != NULL) free (RegionName); 134 123 if (RegionList != NULL) free (RegionList); -
trunk/Ohana/src/opihi/dvo/dmags.c
r7917 r8427 58 58 /* lock, load, unlock catalog */ 59 59 catalog.filename = skylist[0].filename[j]; 60 switch (lock_catalog (&catalog, LCK_SOFT)) { 61 case 2: 62 unlock_catalog (&catalog); 63 case 0: 64 continue; 60 catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_SECF; 61 62 // an error exit status here is a significant error 63 if (!dvo_catalog_open (&catalog, NULL, FALSE, "r")) { 64 fprintf (stderr, "ERROR: failure to open catalog file %s\n", catalog.filename); 65 exit (2); 65 66 } 66 catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_SECF; 67 if (!load_catalog (&catalog, FALSE)) { 68 unlock_catalog (&catalog); 69 continue; 70 } 71 unlock_catalog (&catalog); 67 dvo_catalog_unlock (&catalog); 72 68 73 69 /* get correct mags, convert to X,Y */ … … 108 104 if (M3 != NULL) free (M3); 109 105 } 110 if (catalog.average != NULL) free (catalog.average); 111 if (catalog.secfilt != NULL) free (catalog.secfilt); 112 if (catalog.measure != NULL) free (catalog.measure); 113 catalog.average = (Average *) NULL; 114 catalog.secfilt = (SecFilt *) NULL; 115 catalog.measure = (Measure *) NULL; 106 dvo_catalog_free (&catalog); 116 107 } 117 108 … … 131 122 escape: 132 123 SkyListFree (skylist, ((RegionName != NULL) || (RegionList != NULL))); 133 if (catalog.average != NULL) free (catalog.average); 134 if (catalog.secfilt != NULL) free (catalog.secfilt); 135 if (catalog.measure != NULL) free (catalog.measure); 124 dvo_catalog_free (&catalog); 136 125 if (RegionName != NULL) free (RegionName); 137 126 if (RegionList != NULL) free (RegionList); -
trunk/Ohana/src/opihi/dvo/dmt.c
r7917 r8427 70 70 /* lock, load, unlock catalog */ 71 71 catalog.filename = skylist[0].filename[k]; 72 switch (lock_catalog (&catalog, LCK_SOFT)) { 73 case 2: 74 unlock_catalog (&catalog); 75 case 0: 76 continue; 72 catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_SECF; 73 74 // an error exit status here is a significant error 75 if (!dvo_catalog_open (&catalog, NULL, FALSE, "r")) { 76 fprintf (stderr, "ERROR: failure to open catalog file %s\n", catalog.filename); 77 exit (2); 77 78 } 78 catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_SECF; 79 if (!load_catalog (&catalog, TRUE)) { 80 unlock_catalog (&catalog); 81 continue; 82 } 83 unlock_catalog (&catalog); 79 dvo_catalog_unlock (&catalog); 84 80 85 81 for (i = 0; i < catalog.Naverage; i++) { … … 114 110 } 115 111 } 112 dvo_catalog_free (&catalog); 116 113 } 117 114 Yvec.Nelements = Xvec.Nelements = N; -
trunk/Ohana/src/opihi/dvo/fitcolors.c
r7960 r8427 2 2 # define NMIN_PTS 100 3 3 4 static void init_catalog (Catalog *catalog);5 4 static void free_catalog (Catalog *catalog, int Ncatalog); 6 5 … … 19 18 char name[64], filename[64], plotname[64], label[64]; 20 19 double *M1, *M2; 21 float *out, *colorFit, *deltaFit, color,dColor, C0, C1;20 float *out, *colorFit, *deltaFit, dColor, C0, C1; 22 21 float minDelta, maxDelta, minColor, maxColor; 23 22 int fd, Npx, Npy, NPX, NPY, Nplot, PLOT; … … 168 167 /* lock, load, unlock catalog */ 169 168 catalog[k].filename = skylist[0].filename[k]; 170 switch (lock_catalog (&catalog[k], LCK_SOFT)) {171 case 2: 172 unlock_catalog (&catalog[k]); 173 case 0:174 catalog[k].Naverage = 0;175 continue;169 catalog[k].catflags = LOAD_AVES | LOAD_MEAS | LOAD_SECF; 170 171 // an error exit status here is a significant error 172 if (!dvo_catalog_open (&catalog[k], NULL, FALSE, "r")) { 173 fprintf (stderr, "ERROR: failure to open catalog file %s\n", catalog[k].filename); 174 exit (2); 176 175 } 177 catalog[k].catflags = LOAD_AVES | LOAD_MEAS | LOAD_SECF; 178 if (!load_catalog (&catalog[k], TRUE)) { 179 catalog[k].Naverage = 0; 180 unlock_catalog (&catalog[k]); 181 continue; 182 } 183 unlock_catalog (&catalog[k]); 176 dvo_catalog_unlock (&catalog[k]); 184 177 // XXX make a subset catalog consisting of only Average and Measure values which meet 185 178 // the selection criteria … … 400 393 if (catalog == NULL) return; 401 394 for (i = 0; i < Ncatalog; i++) { 402 if (catalog[i].average != NULL) free (catalog[i].average); 403 if (catalog[i].secfilt != NULL) free (catalog[i].secfilt); 404 if (catalog[i].measure != NULL) free (catalog[i].measure); 395 dvo_catalog_free (&catalog[i]); 405 396 } 406 397 free (catalog); 407 398 } 408 409 static void init_catalog (Catalog *catalog) {410 catalog[0].average = NULL;411 catalog[0].secfilt = NULL;412 catalog[0].measure = NULL;413 catalog[0].Naverage = 0;414 catalog[0].Nsecfilt = 0;415 catalog[0].Nmeasure = 0;416 } -
trunk/Ohana/src/opihi/dvo/fitsed.c
r7960 r8427 24 24 25 25 int *hashcode; 26 int i, j, k, m, N, done, Nfit, NP1, NP2, NP, Np, Npts, NPTS; 27 int N1, N2, i1, i2, mode[4]; 26 int i, j, k, m, N, done, Nfit; 28 27 int Nsec, status; 29 28 void *oldsignal; 30 29 char *RegionName, *RegionList; 31 char name[64], filename[64], plotname[64], label[64]; 32 char line[1024], key[20]; 30 char name[64], line[1024], key[20]; 33 31 float *fitmags, *fiterrs, *wavecode, *vegaToAB; 34 float minWave, maxWave,color;32 float color; 35 33 double X, Y; 36 34 int fd, PLOT; … … 184 182 /* lock, load, unlock catalog */ 185 183 catalog.filename = skylist[0].filename[k]; 186 switch (lock_catalog (&catalog, LCK_SOFT)) {187 case 2:188 unlock_catalog (&catalog);189 case 0:190 catalog.Naverage = 0;191 continue;192 }193 184 catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_SECF; 194 if (!load_catalog (&catalog, TRUE)) { 195 catalog.Naverage = 0; 196 unlock_catalog (&catalog); 197 continue; 198 } 185 186 // an error exit status here is a significant error 187 if (!dvo_catalog_open (&catalog, NULL, FALSE, "r")) { 188 fprintf (stderr, "ERROR: failure to open catalog file %s\n", catalog.filename); 189 exit (2); 190 } 191 dvo_catalog_unlock (&catalog); 199 192 200 193 // perform the fit to all sources … … 258 251 // create the vectors for the example plots 259 252 if (PLOT) { 260 double tmp;261 253 // find plot range 262 254 SetLimitsRaw (NULL, SEDtable[minFit.row][0].mags, Nfilter, &graphdata); … … 326 318 if (!strcasecmp (key, "ESCAPE")) { 327 319 KiiCursorOff (fd); 328 unlock_catalog (&catalog);329 320 goto escape; 330 321 } 331 322 } 332 323 } 333 334 324 // we now have the min chisq row. use this to supply the other filter values.... 335 325 } 336 unlock_catalog(&catalog);326 dvo_catalog_free (&catalog); 337 327 } 338 328 gprint (GP_ERR, "fitted %d stars\n", Nfit); … … 366 356 finish: 367 357 if (skylist != NULL) SkyListFree (skylist, ((RegionName != NULL) || (RegionList != NULL))); 368 if (catalog.average != NULL) free (catalog.average);369 if (catalog.secfilt != NULL) free (catalog.secfilt);370 if (catalog.measure != NULL) free (catalog.measure);371 372 358 if (RegionName != NULL) free (RegionName); 373 359 if (RegionList != NULL) free (RegionList); -
trunk/Ohana/src/opihi/dvo/gstar.c
r7960 r8427 72 72 /* lock, load, unlock catalog */ 73 73 catalog.filename = skylist[0].filename[0]; 74 switch (lock_catalog (&catalog, LCK_SOFT)) {75 case 2:76 unlock_catalog (&catalog);77 case 0:78 return (FALSE);79 }80 74 catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_SECF; 81 if (!load_catalog (&catalog, TRUE)) { 82 unlock_catalog (&catalog); 83 return (FALSE); 84 } 85 unlock_catalog (&catalog); 75 76 // an error exit status here is a significant error 77 if (!dvo_catalog_open (&catalog, NULL, FALSE, "r")) { 78 fprintf (stderr, "ERROR: failure to open catalog file %s\n", catalog.filename); 79 exit (2); 80 } 81 dvo_catalog_unlock (&catalog); 86 82 87 83 Nstars = catalog.Naverage; … … 209 205 free (DEC); 210 206 free (N1); 211 if (catalog.average != 0) free (catalog.average); 212 if (catalog.measure != 0) free (catalog.measure); 213 if (catalog.secfilt != 0) free (catalog.secfilt); 207 dvo_catalog_free (&catalog); 214 208 215 209 freePhotcodeSequence (); -
trunk/Ohana/src/opihi/dvo/imdata.c
r7917 r8427 121 121 /* get file name and open */ 122 122 catalog.filename = skylist[0].filename[j]; 123 switch (lock_catalog (&catalog, LCK_SOFT)) { 124 case 2: 125 unlock_catalog (&catalog); 126 case 0: 127 continue; 128 } 129 catalog.catflags = LOAD_AVES; 130 if (!load_catalog (&catalog, TRUE)) { 131 unlock_catalog (&catalog); 132 continue; 133 } 134 unlock_catalog (&catalog); 123 catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_SECF; 124 125 // an error exit status here is a significant error 126 if (!dvo_catalog_open (&catalog, NULL, FALSE, "r")) { 127 fprintf (stderr, "ERROR: failure to open catalog file %s\n", catalog.filename); 128 exit (2); 129 } 130 dvo_catalog_unlock (&catalog); 135 131 136 132 /* assign vector values */ … … 203 199 break; 204 200 } 205 if (catalog.average != 0) { 206 free (catalog.average); 207 } 208 if (catalog.measure != 0) { 209 free (catalog.measure); 210 } 201 dvo_catalog_free (&catalog); 211 202 } 212 203 -
trunk/Ohana/src/opihi/dvo/lcurve.c
r7917 r8427 82 82 /* set filename, read in header */ 83 83 catalog.filename = skylist[0].filename[0]; 84 switch (lock_catalog (&catalog, LCK_SOFT)) { 85 case 2: 86 unlock_catalog (&catalog); 87 case 0: 88 return (FALSE); 84 catalog.catflags = LOAD_AVES | LOAD_MEAS; 85 86 // an error exit status here is a significant error 87 if (!dvo_catalog_open (&catalog, NULL, FALSE, "r")) { 88 fprintf (stderr, "ERROR: failure to open catalog file %s\n", catalog.filename); 89 exit (2); 89 90 } 90 catalog.catflags = LOAD_AVES | LOAD_MEAS; 91 if (!load_catalog (&catalog, TRUE)) { 92 unlock_catalog (&catalog); 93 return (FALSE); 94 } 95 unlock_catalog (&catalog); 91 dvo_catalog_unlock (&catalog); 96 92 97 93 Nstars = catalog.Naverage; … … 195 191 196 192 if (ErrorBars) free (dYvec.elements); 197 if (catalog.average != 0) free (catalog.average); 198 if (catalog.measure != 0) free (catalog.measure); 199 193 dvo_catalog_free (&catalog); 194 200 195 SkyListFree (skylist, FALSE); 201 196 return (TRUE); -
trunk/Ohana/src/opihi/dvo/lightcurve.c
r7917 r8427 58 58 /* set filename, read in header */ 59 59 catalog.filename = skylist[0].filename[0]; 60 switch (lock_catalog (&catalog, LCK_SOFT)) { 61 case 2: 62 unlock_catalog (&catalog); 63 case 0: 64 return (FALSE); 60 catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_SECF; 61 62 // an error exit status here is a significant error 63 if (!dvo_catalog_open (&catalog, NULL, FALSE, "r")) { 64 fprintf (stderr, "ERROR: failure to open catalog file %s\n", catalog.filename); 65 exit (2); 65 66 } 66 catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_SECF; 67 if (!load_catalog (&catalog, TRUE)) { 68 unlock_catalog (&catalog); 69 return (FALSE); 70 } 71 unlock_catalog (&catalog); 67 dvo_catalog_unlock (&catalog); 72 68 73 69 Nstars = catalog.Naverage; … … 143 139 free (DEC); 144 140 free (N1); 145 if (catalog.average != 0) free (catalog.average); 146 if (catalog.measure != 0) free (catalog.measure); 147 if (catalog.secfilt != 0) free (catalog.secfilt); 148 141 dvo_catalog_free (&catalog); 149 142 SkyListFree (skylist, FALSE); 150 143 return (TRUE); -
trunk/Ohana/src/opihi/dvo/mextract.c
r7917 r8427 14 14 15 15 /* defaults */ 16 catalog.average = (Average *) NULL; 17 catalog.secfilt = (SecFilt *) NULL; 18 catalog.measure = (Measure *) NULL; 16 skylist = NULL; 19 17 RegionName = NULL; 20 18 RegionList = NULL; 21 19 code = NULL; 22 20 mode = MAG_REL; 21 dvo_catalog_init (&catalog, TRUE); 23 22 24 23 /* load photcode information */ … … 57 56 for (i = 0; i < skylist[0].Nregions; i++) { 58 57 catalog.filename = skylist[0].filename[i]; 59 switch (lock_catalog (&catalog, LCK_SOFT)) { 60 case 2: 61 unlock_catalog (&catalog); 62 case 0: 63 continue; 58 catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_SECF; 59 60 // an error exit status here is a significant error 61 if (!dvo_catalog_open (&catalog, NULL, FALSE, "r")) { 62 fprintf (stderr, "ERROR: failure to open catalog file %s\n", catalog.filename); 63 exit (2); 64 64 } 65 catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_SECF; 66 if (!load_catalog (&catalog, FALSE)) { 67 unlock_catalog (&catalog); 68 continue; 69 } 70 unlock_catalog (&catalog); 65 dvo_catalog_unlock (&catalog); 71 66 72 67 for (j = 0; j < catalog.Naverage; j++) { … … 81 76 if (M1 != NULL) free (M1); 82 77 } 83 if (catalog.average != NULL) free (catalog.average); 84 if (catalog.secfilt != NULL) free (catalog.secfilt); 85 if (catalog.measure != NULL) free (catalog.measure); 86 catalog.average = (Average *) NULL; 87 catalog.secfilt = (SecFilt *) NULL; 88 catalog.measure = (Measure *) NULL; 78 dvo_catalog_free (&catalog); 89 79 } 90 80 vec[0].Nelements = N; … … 105 95 FreeImageSelection (); 106 96 SkyListFree (skylist, ((RegionName != NULL) || (RegionList != NULL))); 107 if (catalog.average != NULL) free (catalog.average); 108 if (catalog.secfilt != NULL) free (catalog.secfilt); 109 if (catalog.measure != NULL) free (catalog.measure); 97 dvo_catalog_free (&catalog); 110 98 if (RegionName != NULL) free (RegionName); 111 99 if (RegionList != NULL) free (RegionList); -
trunk/Ohana/src/opihi/dvo/photometry.c
r8132 r8427 324 324 char PhotCodeFile[256]; 325 325 326 if (VarConfig ("ZERO_PT", "%lf", &ZERO_POINT) == (char *) NULL) return (FALSE); 326 if (VarConfig ("ZERO_PT", "%lf", &ZERO_POINT) == (char *) NULL) { 327 gprint (GP_ERR, "ZERO_PT undefined in config\n"); 328 return (FALSE); 329 } 327 330 SetZeroPoint (ZERO_POINT); 328 331 329 if (VarConfig ("PHOTCODE_FILE", "%s", PhotCodeFile) == (char *) NULL) return (FALSE); 332 if (VarConfig ("PHOTCODE_FILE", "%s", PhotCodeFile) == (char *) NULL) { 333 gprint (GP_ERR, "PHOTCODE_FILE undefined in config\n"); 334 return (FALSE); 335 } 330 336 if (!LoadPhotcodes (PhotCodeFile)) { 331 337 gprint (GP_ERR, "error loading photcodes\n"); … … 354 360 gprint (GP_ERR, "NcodeSelect: %d, %d - %d\n", NcodeSelect, NcodeSign, NcodeValue); 355 361 gprint (GP_ERR, "FWHMSelect: %d, %d %f %f\n", FWHMSelect, FWHMsign, FWHMvalue, FWHMfrac); 362 return (TRUE); 356 363 } 357 364 -
trunk/Ohana/src/opihi/dvo/pmeasure.c
r7917 r8427 81 81 /* lock, load, unlock catalog */ 82 82 catalog.filename = skylist[0].filename[j]; 83 switch (lock_catalog (&catalog, LCK_SOFT)) { 84 case 2: 85 unlock_catalog (&catalog); 86 case 0: 87 continue; 83 catalog.catflags = LOAD_AVES | LOAD_MEAS; 84 85 // an error exit status here is a significant error 86 if (!dvo_catalog_open (&catalog, NULL, FALSE, "r")) { 87 fprintf (stderr, "ERROR: failure to open catalog file %s\n", catalog.filename); 88 exit (2); 88 89 } 89 catalog.catflags = LOAD_AVES | LOAD_MEAS; 90 if (!load_catalog (&catalog, TRUE)) { 91 unlock_catalog (&catalog); 92 continue; 93 } 94 unlock_catalog (&catalog); 90 dvo_catalog_unlock (&catalog); 95 91 96 92 /* data has been loaded, get ready to plot it */ … … 138 134 free (Zvec.elements); 139 135 140 if (catalog.average != 0) free (catalog.average); 141 if (catalog.measure != 0) free (catalog.measure); 136 dvo_catalog_free (&catalog); 142 137 } 143 138 return (TRUE); -
trunk/Ohana/src/opihi/dvo/subpix.c
r7917 r8427 42 42 /* lock, load, unlock catalog */ 43 43 catalog.filename = skylist[0].filename[0]; 44 switch (lock_catalog (&catalog, LCK_SOFT)) { 45 case 2: 46 unlock_catalog (&catalog); 47 case 0: 48 return (FALSE); 44 catalog.catflags = LOAD_AVES | LOAD_MEAS; 45 46 // an error exit status here is a significant error 47 if (!dvo_catalog_open (&catalog, NULL, FALSE, "r")) { 48 fprintf (stderr, "ERROR: failure to open catalog file %s\n", catalog.filename); 49 exit (2); 49 50 } 50 catalog.catflags = LOAD_AVES | LOAD_MEAS; 51 if (!load_catalog (&catalog, TRUE)) { 52 unlock_catalog (&catalog); 53 return (FALSE); 54 } 55 unlock_catalog (&catalog); 51 dvo_catalog_unlock (&catalog); 56 52 57 53 /* quick search of star list for Ra, Dec */ … … 88 84 free (entry); 89 85 free (index); 90 if (catalog.average != 0) free (catalog.average); 91 if (catalog.measure != 0) free (catalog.measure); 86 dvo_catalog_free (&catalog); 92 87 SkyListFree (skylist, FALSE); 93 88 return (TRUE); … … 152 147 } 153 148 154 if (catalog.average != 0) free (catalog.average); 155 if (catalog.measure != 0) free (catalog.measure); 149 dvo_catalog_free (&catalog); 156 150 free (image); 157 151 free (index); -
trunk/Ohana/src/opihi/include/external.h
r7917 r8427 11 11 # include <errno.h> 12 12 # include <pthread.h> 13 14 # include <netinet/ip.h> 15 # include <netdb.h> 16 # include <arpa/inet.h> 13 17 14 18 # include <ohana.h> -
trunk/Ohana/src/opihi/include/pantasks.h
r8192 r8427 5 5 # include <time.h> 6 6 # include <zlib.h> 7 # include <netinet/ip.h>8 # include <netdb.h>9 # include <arpa/inet.h>10 11 typedef struct sockaddr_in SockAddress;12 7 13 8 typedef enum { … … 210 205 void *ListenClients (void *data); 211 206 212 int InitServerSocket (SockAddress *Address);213 int WaitServerSocket (int InitSocket, SockAddress *Address);214 int GetClientSocket (char *hostname);215 int InitServerSocket_Named (char *hostname, SockAddress *Address);216 217 207 /* 218 208 void InitPrint (); -
trunk/Ohana/src/opihi/include/shell.h
r8424 r8427 17 17 18 18 typedef int CommandF (); 19 20 typedef struct sockaddr_in SockAddress; 19 21 20 22 /*** typedef structs used by shell functions ***/ … … 149 151 int gwrite PROTO((char *buffer, int size, int N, gpDest dest)); 150 152 153 /* socket functions */ 154 int InitServerSocket (SockAddress *Address); 155 int WaitServerSocket (int InitSocket, SockAddress *Address); 156 int GetClientSocket (char *hostname); 157 int InitServerSocket_Named (char *hostname, SockAddress *Address); 158 151 159 # endif 160 -
trunk/Ohana/src/opihi/lib.data/queues.c
r8190 r8427 232 232 key2 = ChooseKey (queue[0].lines[j], Key); 233 233 if (key2 == NULL) continue; 234 if (strcmp (key1, key2)) { 235 if (Key != -1) free (key2); 236 continue; 237 } 238 found = TRUE; 239 if (Key != -1) free (key2); 234 found = !strcmp (key1, key2); 235 free (key2); 240 236 } 241 237 if (!found) PushQueue (queue, tmp.lines[i]); 242 if (Key != -1)free (key1);238 free (key1); 243 239 } 244 240 for (i = 0; i < tmp.Nlines; i++) { … … 287 283 key2 = ChooseKey (queue[0].lines[j], Key); 288 284 if (key2 == NULL) continue; 289 if (strcmp (key1, key2)) { 290 if (Key != -1) free (key2); 291 continue; 285 found = !strcmp (key1, key2); 286 if (found) { 287 // XXX do I need to free queue[0].lines[j]?? 288 queue[0].lines[j] = strcreate (tmp.lines[i]); 292 289 } 293 queue[0].lines[j] = strcreate (tmp.lines[i]); 294 found = TRUE; 295 if (Key != -1) free (key2); 290 free (key2); 296 291 } 297 292 if (!found) PushQueue (queue, tmp.lines[i]); 298 if (Key != -1)free (key1);293 free (key1); 299 294 } 300 295 for (i = 0; i < tmp.Nlines; i++) { -
trunk/Ohana/src/opihi/lib.shell/SocketOps.c
r7938 r8427 1 # include " pantasks.h"1 # include "shell.h" 2 2 3 3 # define MY_PORT 2000 … … 273 273 VALID = NULL; 274 274 } 275 } 275 return (TRUE); 276 } -
trunk/Ohana/src/opihi/lib.shell/version.c
r8174 r8427 13 13 char *p, *q; 14 14 15 p = str casestr (input, "$NAME:");15 p = strstr (input, "$NAME:"); 16 16 if (p == NULL) return (unknown); 17 17
Note:
See TracChangeset
for help on using the changeset viewer.
