Changeset 4585 for trunk/Ohana/src/opihi/dvo/calextract.c
- Timestamp:
- Jul 20, 2005, 4:27:25 AM (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
r3689 r4585 5 5 int calextract (int argc, char **argv) { 6 6 7 int i, j, m, N, Nr, Nregions, mode[2]; 8 int Nsec, NSTAR; 9 char filename[256], catdir[256], *RegionName, *RegionList; 10 double Radius, M1, M2, dM2, color; 11 7 12 Catalog catalog; 8 Graphdata graphsky;9 13 RegionFile *regions; 10 14 PhotCode *code[2]; 11 15 Vector **vec; 12 13 int i, j, m, N, Nr, Nregions, mode[2];14 int RegionList, Ngraph, Nsec, NSTAR;15 char filename[256], catdir[256], RegionListFile[256];16 double Radius, M1, M2, dM2, color;17 16 18 17 /* these need to be freed in the end */ … … 21 20 catalog.secfilt = NULL; 22 21 catalog.measure = NULL; 22 RegionName = NULL; 23 RegionList = NULL; 23 24 24 25 /* load photcode information */ … … 26 27 Nsec = GetPhotcodeNsecfilt (); 27 28 28 /* load data about plot windows */29 Ngraph = 0;30 if (!GetGraphData (&graphsky, NULL, &Ngraph)) goto escape;31 32 29 /* find CATDIR in config system */ 33 VarConfig ("CATDIR", "%s", catdir); 34 35 /* specify catalog files */ 36 RegionList = FALSE; 37 if (N = get_argument (argc, argv, "-list")) { 38 RegionList = TRUE; 39 remove_argument (N, &argc, argv); 40 strcpy (RegionListFile, argv[N]); 41 remove_argument (N, &argc, argv); 42 } 30 if (VarConfig ("CATDIR", "%s", catdir) == NULL) goto escape; 43 31 44 32 /* command line arguments */ 45 if (!SetPhotSelections (&argc, argv)) goto usage; 33 SetSelectionParam (0); 34 if (!SetRegionSelection (&argc, argv, &RegionName, &RegionList)) goto escape; 35 if (!SetPhotSelections (&argc, argv, 2)) goto usage; 36 46 37 if (argc != 4) goto usage; 47 38 if (strcmp (argv[2], "-")) goto usage; … … 66 57 if ((vec[Nd2] = SelectVector ("cal:dm2", ANYVECTOR, TRUE)) == NULL) goto escape; 67 58 68 /* select region files */ 69 if (RegionList) { 70 regions = region_list (RegionListFile, &Nregions); 71 } else { 72 Radius = MAX (fabs(graphsky.xmax), fabs(graphsky.ymax)); 73 regions = find_regions (graphsky.coords.crval1, graphsky.coords.crval2, Radius, &Nregions); 74 } 59 /* load region corresponding to selection above */ 60 if ((regions = SelectRegions (RegionName, RegionList, &Nregions)) == NULL) goto escape; 75 61 76 62 for (Nr = 0; Nr < Nregions; Nr++) { … … 150 136 escape: 151 137 138 if (RegionName != NULL) free (RegionName); 139 if (RegionList != NULL) free (RegionList); 152 140 if (regions != NULL) free (regions); 153 141 for (i = 0; i < NVEC; i++) {
Note:
See TracChangeset
for help on using the changeset viewer.
