Changeset 14401 for trunk/Ohana/src/opihi/dvo/calextract.c
- Timestamp:
- Aug 4, 2007, 10:15:51 AM (19 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/opihi/dvo/calextract.c (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/dvo/calextract.c
r12332 r14401 7 7 int i, j, m, N, Nr, mode[2]; 8 8 int Nsecfilt, NSTAR; 9 char *RegionName, *RegionList;10 9 double M1, M2, dM2, color; 11 10 … … 14 13 Vector **vec; 15 14 SkyList *skylist; 15 SkyRegionSelection *selection; 16 16 17 17 /* these need to be freed in the end */ … … 19 19 catalog.secfilt = NULL; 20 20 catalog.measure = NULL; 21 RegionName = NULL;22 RegionList = NULL;23 21 skylist = NULL; 22 selection = NULL; 24 23 vec = NULL; 25 24 … … 30 29 /* command line arguments */ 31 30 SetSelectionParam (0); 32 if (!SetRegionSelection (&argc, argv, &RegionName, &RegionList)) goto escape; 31 32 // parse skyregion options 33 if ((selection = SetRegionSelection (&argc, argv)) == NULL) goto escape; 33 34 if (!SetPhotSelections (&argc, argv, 2)) goto usage; 34 35 … … 50 51 if ((vec[Np] = SelectVector ("cal:nphot", ANYVECTOR, TRUE)) == NULL) goto escape; 51 52 if ((vec[Nc] = SelectVector ("cal:ncode", ANYVECTOR, TRUE)) == NULL) goto escape; 52 if ((vec[Nt] = SelectVector ("cal:ncrit", ANYVECTOR, TRUE)) == NULL) goto escape;53 // if ((vec[Nt] = SelectVector ("cal:ncrit", ANYVECTOR, TRUE)) == NULL) goto escape; 53 54 if ((vec[Nx] = SelectVector ("cal:chisq", ANYVECTOR, TRUE)) == NULL) goto escape; 54 55 if ((vec[Nd1] = SelectVector ("cal:dm1", ANYVECTOR, TRUE)) == NULL) goto escape; … … 56 57 57 58 /* load region corresponding to selection above */ 58 if ((skylist = SelectRegions ( RegionName, RegionList)) == NULL) goto escape;59 if ((skylist = SelectRegions (selection)) == NULL) goto escape; 59 60 60 61 for (Nr = 0; Nr < skylist[0].Nregions; Nr++) { … … 73 74 dvo_catalog_unlock (&catalog); 74 75 76 # if (0) 75 77 /* extract values, assign to vectors */ 76 78 for (i = 0; i < catalog.Naverage; i++) { … … 104 106 vec[Nc ][0].elements[N] = ExtractAverages (code[0], mode[0], &catalog.average[i], &catalog.secfilt[i*Nsecfilt], &catalog.measure[m], AVE_NCODE); 105 107 vec[Np ][0].elements[N] = ExtractAverages (code[0], mode[0], &catalog.average[i], &catalog.secfilt[i*Nsecfilt], &catalog.measure[m], AVE_NPHOT); 106 vec[Nt ][0].elements[N] = ExtractAverages (code[0], mode[0], &catalog.average[i], &catalog.secfilt[i*Nsecfilt], &catalog.measure[m], AVE_NCRIT);108 // vec[Nt ][0].elements[N] = ExtractAverages (code[0], mode[0], &catalog.average[i], &catalog.secfilt[i*Nsecfilt], &catalog.measure[m], AVE_NCRIT); 107 109 N ++; 108 110 if (N == NSTAR) { … … 113 115 } 114 116 } 117 # endif 115 118 dvo_catalog_free (&catalog); 116 119 } 117 120 118 SkyListFree (skylist, ((RegionName != NULL) || (RegionList != NULL)));119 121 for (i = 0; i < NVEC; i++) { 120 122 vec[i][0].Nelements = N; 121 123 } 124 125 SkyListFree (skylist); 126 FreeSkyRegionSelection (selection); 122 127 return (TRUE); 123 128 … … 127 132 128 133 escape: 129 if (RegionName != NULL) free (RegionName); 130 if (RegionList != NULL) free (RegionList); 131 SkyListFree (skylist, ((RegionName != NULL) || (RegionList != NULL))); 134 SkyListFree (skylist); 135 FreeSkyRegionSelection (selection); 132 136 for (i = 0; i < NVEC; i++) { 133 137 DeleteVector (vec[i]);
Note:
See TracChangeset
for help on using the changeset viewer.
