Changeset 5451 for trunk/Ohana/src/opihi/dvo/calextract.c
- Timestamp:
- Oct 27, 2005, 7:10:17 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/opihi/dvo/calextract.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/dvo/calextract.c
r5320 r5451 5 5 int calextract (int argc, char **argv) { 6 6 7 int i, j, m, N, Nr, Nregions,mode[2];7 int i, j, m, N, Nr, mode[2]; 8 8 int Nsec, NSTAR; 9 char filename[256], catdir[256],*RegionName, *RegionList;9 char *RegionName, *RegionList; 10 10 double M1, M2, dM2, color; 11 11 12 PhotCode *code[2]; 12 13 Catalog catalog; 13 RegionFile *regions; 14 PhotCode *code[2]; 14 SkyList *skylist; 15 15 Vector **vec; 16 16 17 17 /* these need to be freed in the end */ 18 regions = NULL;19 18 catalog.average = NULL; 20 19 catalog.secfilt = NULL; … … 27 26 if (!InitPhotcodes ()) return (FALSE); 28 27 Nsec = GetPhotcodeNsecfilt (); 29 30 /* find CATDIR in config system */31 if (VarConfig ("CATDIR", "%s", catdir) == NULL) goto escape;32 28 33 29 /* command line arguments */ … … 59 55 60 56 /* load region corresponding to selection above */ 61 if (( regions = SelectRegions (RegionName, RegionList, &Nregions)) == NULL) goto escape;57 if ((skylist = SelectRegions (RegionName, RegionList)) == NULL) goto escape; 62 58 63 for (Nr = 0; Nr < Nregions; Nr++) {59 for (Nr = 0; Nr < skylist[0].Nregions; Nr++) { 64 60 if (Nr && !(Nr % 500)) { fprintf (stderr, "."); } 65 61 66 62 /* lock, load, unlock catalog */ 67 sprintf (filename, "%s/%s", catdir, regions[Nr].name); 68 catalog.filename = filename; 63 catalog.filename = (char *) skylist[0].regions[Nr][0].filename; 69 64 switch (lock_catalog (&catalog, LCK_SOFT)) { 70 65 case 2: … … 127 122 catalog.measure = (Measure *) NULL; 128 123 } 129 if (regions != NULL) free (regions); 124 125 SkyListFree (skylist, ((RegionName != NULL) || (RegionList != NULL))); 130 126 for (i = 0; i < NVEC; i++) { 131 127 vec[i][0].Nelements = N; … … 141 137 if (RegionName != NULL) free (RegionName); 142 138 if (RegionList != NULL) free (RegionList); 143 if (regions != NULL) free (regions);139 SkyListFree (skylist, ((RegionName != NULL) || (RegionList != NULL))); 144 140 for (i = 0; i < NVEC; i++) { 145 141 DeleteVector (vec[i]);
Note:
See TracChangeset
for help on using the changeset viewer.
