Changeset 5451 for trunk/Ohana/src/opihi/dvo/mextract.c
- Timestamp:
- Oct 27, 2005, 7:10:17 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/opihi/dvo/mextract.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/dvo/mextract.c
r5320 r5451 4 4 5 5 int i, j, k, m, N, N1, NPTS; 6 int param, mode, N regions, Nsec;7 char filename[128], catdir[256],*RegionName, *RegionList, *p;6 int param, mode, Nsec; 7 char *RegionName, *RegionList, *p; 8 8 double *M1; 9 9 10 10 PhotCode *code; 11 11 Catalog catalog; 12 RegionFile *regions;12 SkyList *skylist; 13 13 Vector *vec; 14 14 15 15 /* defaults */ 16 regions = NULL;17 16 catalog.average = (Average *) NULL; 18 17 catalog.secfilt = (SecFilt *) NULL; … … 26 25 if (!InitPhotcodes ()) goto escape; 27 26 Nsec = GetPhotcodeNsecfilt (); 28 29 /* find CATDIR in config system */30 if (VarConfig ("CATDIR", "%s", catdir) == NULL) goto escape;31 27 32 28 /* interpret command-line options */ … … 51 47 52 48 /* load region corresponding to selection above */ 53 if (( regions = SelectRegions (RegionName, RegionList, &Nregions)) == NULL) goto escape;54 if (!SetImageSelection (param )) goto escape;49 if ((skylist = SelectRegions (RegionName, RegionList)) == NULL) goto escape; 50 if (!SetImageSelection (param, ((RegionName == NULL) && (RegionList == NULL)))) goto escape; 55 51 56 52 /* create storage vector */ … … 59 55 if ((vec = SelectVector (argv[1], ANYVECTOR, TRUE)) == NULL) goto escape; 60 56 61 for (i = 0; i < Nregions; i++) { 62 /* lock, load, unlock catalog */ 63 sprintf (filename, "%s/%s", catdir, regions[i].name); 64 catalog.filename = filename; 57 for (i = 0; i < skylist[0].Nregions; i++) { 58 catalog.filename = (char *) skylist[0].regions[i][0].filename; 65 59 switch (lock_catalog (&catalog, LCK_SOFT)) { 66 60 case 2: … … 97 91 REALLOCATE (vec[0].elements, float, MAX(1,N)); 98 92 99 if (regions != NULL) free (regions);100 93 FreeImageSelection (); 94 SkyListFree (skylist, ((RegionName != NULL) || (RegionList != NULL))); 95 if (RegionName != NULL) free (RegionName); 96 if (RegionList != NULL) free (RegionList); 101 97 return (TRUE); 102 98 … … 108 104 escape: 109 105 FreeImageSelection (); 110 if (regions != NULL) free (regions);106 SkyListFree (skylist, ((RegionName != NULL) || (RegionList != NULL))); 111 107 if (catalog.average != NULL) free (catalog.average); 112 108 if (catalog.secfilt != NULL) free (catalog.secfilt);
Note:
See TracChangeset
for help on using the changeset viewer.
