Changeset 5451 for trunk/Ohana/src/opihi/dvo/dmagaves.c
- Timestamp:
- Oct 27, 2005, 7:10:17 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/opihi/dvo/dmagaves.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/dvo/dmagaves.c
r5320 r5451 3 3 int dmagaves (int argc, char **argv) { 4 4 5 char filename[256], catdir[256],*RegionName, *RegionList;5 char *RegionName, *RegionList; 6 6 double *M1, M2; 7 7 int i, j, k, m, N1; 8 8 int Npts, NPTS, param, mode[3]; 9 int Nsec , Nregions;9 int Nsec; 10 10 11 PhotCode *code[3]; 11 12 Catalog catalog; 12 RegionFile *regions; 13 PhotCode *code[3]; 13 SkyList *skylist; 14 14 Vector *xvec, *yvec; 15 15 16 16 /* defaults */ 17 regions = NULL;18 17 catalog.average = NULL; 19 18 catalog.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 */ … … 44 40 45 41 /* load region corresponding to selection above */ 46 if (( regions = SelectRegions (RegionName, RegionList, &Nregions)) == NULL) goto escape;42 if ((skylist = SelectRegions (RegionName, RegionList)) == NULL) goto escape; 47 43 48 44 /* init vectors to save data */ … … 52 48 if ((yvec = SelectVector ("yv", ANYVECTOR, TRUE)) == NULL) goto escape; 53 49 54 for (j = 0; j < Nregions; j++) {50 for (j = 0; j < skylist[0].Nregions; j++) { 55 51 /* lock, load, unlock catalog */ 56 sprintf (filename, "%s/%s", catdir, regions[j].name); 57 catalog.filename = filename; 52 catalog.filename = (char *) skylist[0].regions[j][0].filename; 58 53 switch (lock_catalog (&catalog, LCK_SOFT)) { 59 54 case 2: … … 101 96 catalog.measure = (Measure *) NULL; 102 97 } 103 if (regions != NULL) free (regions);98 SkyListFree (skylist, ((RegionName != NULL) || (RegionList != NULL))); 104 99 xvec[0].Nelements = yvec[0].Nelements = Npts; 105 100 return (TRUE); … … 110 105 111 106 escape: 112 if (regions != NULL) free (regions);107 SkyListFree (skylist, ((RegionName != NULL) || (RegionList != NULL))); 113 108 if (catalog.average != NULL) free (catalog.average); 114 109 if (catalog.secfilt != NULL) free (catalog.secfilt);
Note:
See TracChangeset
for help on using the changeset viewer.
