Changeset 5451 for trunk/Ohana/src/opihi/dvo/calmextract.c
- Timestamp:
- Oct 27, 2005, 7:10:17 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/opihi/dvo/calmextract.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/dvo/calmextract.c
r5320 r5451 7 7 8 8 int i, j, k, m, N, N1, Nr, mode[2]; 9 int NSTAR, Nstar, Nsec , Nregions;10 char filename[256], catdir[256],*RegionName, *RegionList;9 int NSTAR, Nstar, Nsec; 10 char *RegionName, *RegionList; 11 11 double *M1, M2, dM2, color; 12 12 13 13 Catalog catalog; 14 RegionFile *regions;15 14 PhotCode *code[2]; 15 SkyList *skylist; 16 16 Vector **vec; 17 17 18 18 /* these need to be freed in the end */ 19 regions = NULL;20 19 catalog.average = NULL; 21 20 catalog.secfilt = NULL; … … 28 27 if (!InitPhotcodes ()) goto escape; 29 28 Nsec = GetPhotcodeNsecfilt (); 30 31 /* find CATDIR in config system */32 if (VarConfig ("CATDIR", "%s", catdir) == NULL) goto escape;33 29 34 30 /* command line arguments */ … … 71 67 72 68 /* load region corresponding to selection above */ 73 if (( regions = SelectRegions (RegionName, RegionList, &Nregions)) == NULL) goto escape;74 if (!SetImageSelection (MEAS_XMOSAIC )) goto escape;69 if ((skylist = SelectRegions (RegionName, RegionList)) == NULL) goto escape; 70 if (!SetImageSelection (MEAS_XMOSAIC, ((RegionName == NULL) && (RegionList == NULL)))) goto escape; 75 71 76 for (Nr = 0; Nr < Nregions; Nr++) {72 for (Nr = 0; Nr < skylist[0].Nregions; Nr++) { 77 73 if (Nr && !(Nr % 500)) { fprintf (stderr, "."); } 78 74 79 75 /* lock, load, unlock catalog */ 80 sprintf (filename, "%s/%s", catdir, regions[Nr].name); 81 catalog.filename = filename; 76 catalog.filename = (char *) skylist[0].regions[Nr][0].filename; 82 77 switch (lock_catalog (&catalog, LCK_SOFT)) { 83 78 case 2: … … 153 148 catalog.measure = (Measure *) NULL; 154 149 } 155 if (regions != NULL) free (regions); 150 151 SkyListFree (skylist, ((RegionName != NULL) || (RegionList != NULL))); 156 152 for (i = 0; i < NVEC; i++) { 157 153 vec[i][0].Nelements = N; … … 167 163 168 164 FreeImageSelection (); 169 if (regions != NULL) free (regions);165 SkyListFree (skylist, ((RegionName != NULL) || (RegionList != NULL))); 170 166 for (i = 0; i < NVEC; i++) { 171 167 DeleteVector (vec[i]);
Note:
See TracChangeset
for help on using the changeset viewer.
