Changeset 4585
- Timestamp:
- Jul 20, 2005, 4:27:25 AM (21 years ago)
- Location:
- trunk/Ohana/src/opihi
- Files:
-
- 1 added
- 18 edited
-
dvo/ImageOps.c (modified) (1 diff)
-
dvo/ImageSelection.c (added)
-
dvo/Makefile (modified) (1 diff)
-
dvo/avextract.c (modified) (4 diffs)
-
dvo/calextract.c (modified) (5 diffs)
-
dvo/calmextract.c (modified) (5 diffs)
-
dvo/ccd.c (modified) (7 diffs)
-
dvo/cmd.c (modified) (7 diffs)
-
dvo/ddmags.c (modified) (6 diffs)
-
dvo/dmagaves.c (modified) (7 diffs)
-
dvo/dmagmeas.c (modified) (5 diffs)
-
dvo/dmags.c (modified) (7 diffs)
-
dvo/elixir.c (modified) (1 diff)
-
dvo/fitcolors.c (modified) (5 diffs)
-
dvo/imdata.c (modified) (8 diffs)
-
dvo/mextract.c (modified) (4 diffs)
-
dvo/photometry.c (modified) (28 diffs)
-
dvo/region_list.c (modified) (3 diffs)
-
include/dvo1.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/dvo/ImageOps.c
r3462 r4585 2 2 3 3 void image_subset (Image *image, int Nimage, int **Subset, int *Nsubset, 4 Graphdata *graph, int RegionSelect,5 unsigned long int tzero, double trange, int TimeSelect)4 Graphdata *graph, int RegionSelect, 5 unsigned long int tzero, double trange, int TimeSelect) 6 6 { 7 7 -
trunk/Ohana/src/opihi/dvo/Makefile
r3688 r4585 28 28 $(SDIR)/init.$(ARCH).o \ 29 29 $(SDIR)/ImageOps.$(ARCH).o \ 30 $(SDIR)/ImageSelection.$(ARCH).o \ 30 31 $(SDIR)/LoadImages.$(ARCH).o \ 31 32 $(SDIR)/aregion.$(ARCH).o \ -
trunk/Ohana/src/opihi/dvo/avextract.c
r4420 r4585 3 3 int avextract (int argc, char **argv) { 4 4 5 int i, j, m, N, NPTS, param; 6 int Ngraph, Nsec, Nregions, mode; 7 char filename[256], catdir[256], *RegionName, *RegionList, *p; 8 5 9 Catalog catalog; 6 Graphdata graphsky;7 10 RegionFile *regions; 8 11 PhotCode *code; 9 12 Vector *vec; 10 13 11 char filename[256], catdir[256], *p; 12 int i, j, m, N, NPTS, param; 13 int Ngraph, Nsec, Nregions, mode; 14 14 /* defaults */ 15 15 regions = NULL; 16 16 catalog.average = NULL; 17 17 catalog.secfilt = NULL; 18 18 catalog.measure = NULL; 19 RegionName = NULL; 20 RegionList = NULL; 21 code = NULL; 22 mode = MAG_AVE; 19 23 20 24 /* load photcode information */ … … 22 26 Nsec = GetPhotcodeNsecfilt (); 23 27 24 /* load data about plot windows */25 Ngraph = 0;26 if (!GetGraphData (&graphsky, NULL, &Ngraph)) goto escape;27 28 28 /* find CATDIR in config system */ 29 VarConfig ("CATDIR", "%s", catdir); 30 31 /* grab value of photcode, if available */ 32 code = NULL; 33 mode = MAG_AVE; 34 if (N = get_argument (argc, argv, "-photcode")) { 35 remove_argument (N, &argc, argv); 36 code = GetPhotcodebyName (argv[N]); 37 if (code == NULL) { 38 fprintf (stderr, "photcode not found in photcode table\n"); 39 goto usage; 40 } 41 remove_argument (N, &argc, argv); 42 } 29 if (VarConfig ("CATDIR", "%s", catdir) == NULL) goto escape; 43 30 44 31 /* interpret command-line options */ 45 if (!SetPhotSelections (&argc, argv)) goto usage; 46 if (argc != 3) { goto usage; } 32 SetSelectionParam (0); 33 if (!SetRegionSelection (&argc, argv, &RegionName, &RegionList)) goto escape; 34 if (!SetPhotSelections (&argc, argv, 1)) goto usage; 47 35 48 /* identify selection */ 49 param = GetAverageParam (argv[2]); 36 /* interpret required command-line arguments: mextract (value) */ 37 if (argc != 2) { goto usage; } 38 param = GetAverageParam (argv[1]); 50 39 if (param == AVE_ZERO) { 51 if (!GetPhotcodeInfo (argv[ 2], &code, &mode)) {40 if (!GetPhotcodeInfo (argv[1], &code, &mode)) { 52 41 GetAverageParamHelp (); 53 42 goto escape; 54 43 } 55 44 param = AVE_MAG; 56 for (p = argv[ 2]; *p != 0; p++) {45 for (p = argv[1]; *p != 0; p++) { 57 46 if (*p == '.') *p = ':'; 58 47 } 59 48 } 60 if ( (vec = SelectVector (argv[2], ANYVECTOR, TRUE)) == NULL) goto escape;49 if (!TestPhotSelections (&code, param)) goto escape; 61 50 62 /* Need valid code for some params: */ 63 switch (param) { 64 case AVE_MAG: 65 case AVE_dMAG: 66 case AVE_Xm: 67 case AVE_TYPE: 68 case AVE_NCODE: 69 case AVE_NPHOT: 70 if (code == NULL) goto escape; 71 if (code[0].type == PHOT_DEP) goto escape; 72 if (code[0].type == PHOT_REF) goto escape; 73 break; 74 default: 75 break; 76 } 77 78 /* determine region-file names */ 79 if (!strcmp (argv[1], "all")) { 80 float Radius; 81 Radius = MAX (fabs(graphsky.xmax), fabs(graphsky.ymax)); 82 regions = find_regions (graphsky.coords.crval1, graphsky.coords.crval2, Radius, &Nregions); 83 if (!SetImageSelection (param, &graphsky, TRUE)) goto escape; 84 /* this is not really used by avextract -- no parameters require images */ 85 } else { 86 Nregions = 1; 87 ALLOCATE (regions, RegionFile, 1); 88 strcpy (regions[0].name, argv[1]); 89 if (!SetImageSelection (param, NULL, FALSE)) goto escape; 90 } 51 /* load region corresponding to selection above */ 52 if ((regions = SelectRegions (RegionName, RegionList, &Nregions)) == NULL) goto escape; 91 53 92 54 /* create storage vector */ 93 55 N = 0; 94 NPTS = 1 000;95 REALLOCATE (vec[0].elements, float, NPTS);56 NPTS = 1; 57 if ((vec = SelectVector (argv[1], ANYVECTOR, TRUE)) == NULL) goto escape; 96 58 97 59 for (i = 0; i < Nregions; i++) { … … 115 77 vec[0].elements[N] = ExtractAverages (code, mode, &catalog.average[j], &catalog.secfilt[j*Nsec], &catalog.measure[m], param); 116 78 N++; 117 if (N == NPTS - 1) { 118 NPTS += 2000; 119 REALLOCATE (vec[0].elements, float, NPTS); 120 } 79 CHECK_REALLOCATE (vec[0].elements, float, NPTS, N, 2000); 121 80 } 122 81 if (catalog.average != NULL) free (catalog.average); … … 131 90 132 91 if (regions != NULL) free (regions); 133 FreeImageSelection ();134 92 return (TRUE); 135 93 136 94 usage: 137 fprintf (stderr, "USAGE: avextract (from) (value) [options]\n"); 138 fprintf (stderr, " from: cpt name or 'all'\n"); 95 fprintf (stderr, "USAGE: avextract (value) [options]\n"); 139 96 fprintf (stderr, " value: average.parameter or photcode\n"); 140 return (FALSE);141 97 142 98 escape: 143 fprintf (stderr, "error in avextract\n");144 99 if (regions != NULL) free (regions); 145 FreeImageSelection ();146 100 if (catalog.average != NULL) free (catalog.average); 147 101 if (catalog.secfilt != NULL) free (catalog.secfilt); 148 102 if (catalog.measure != NULL) free (catalog.measure); 103 if (RegionName != NULL) free (RegionName); 104 if (RegionList != NULL) free (RegionList); 149 105 return (FALSE); 150 106 } -
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++) { -
trunk/Ohana/src/opihi/dvo/calmextract.c
r3462 r4585 6 6 int calmextract (int argc, char **argv) { 7 7 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; 11 double *M1, M2, dM2, color, Radius; 12 8 13 Catalog catalog; 9 Graphdata graphsky;10 14 RegionFile *regions; 11 15 PhotCode *code[2]; 12 16 Vector **vec; 13 14 int i, j, k, m, N, N1, Nr, mode[2];15 int Ngraph, NSTAR, Nstar, Nsec, Nregions, RegionList;16 char filename[256], catdir[256], RegionListFile[256];17 double *M1, M2, dM2, color, Radius;18 17 19 18 /* these need to be freed in the end */ … … 22 21 catalog.secfilt = NULL; 23 22 catalog.measure = NULL; 23 RegionName = NULL; 24 RegionList = NULL; 24 25 25 26 /* load photcode information */ 26 if (!InitPhotcodes ()) return (FALSE);27 if (!InitPhotcodes ()) goto escape; 27 28 Nsec = GetPhotcodeNsecfilt (); 28 29 29 /* load data about plot windows */30 Ngraph = 0;31 if (!GetGraphData (&graphsky, NULL, &Ngraph)) goto escape;32 33 30 /* find CATDIR in config system */ 34 VarConfig ("CATDIR", "%s", catdir); 35 36 /* specify catalog files */ 37 RegionList = FALSE; 38 if (N = get_argument (argc, argv, "-list")) { 39 RegionList = TRUE; 40 remove_argument (N, &argc, argv); 41 strcpy (RegionListFile, argv[N]); 42 remove_argument (N, &argc, argv); 43 } 31 if (VarConfig ("CATDIR", "%s", catdir) == NULL) goto escape; 44 32 45 33 /* command line arguments */ 46 if (!SetPhotSelections (&argc, argv)) goto usage; 34 if (!SetRegionSelection (&argc, argv, &RegionName, &RegionList)) goto escape; 35 if (!SetPhotSelections (&argc, argv, 2)) goto usage; 36 37 /* interpret required command-line arguments: calmextract F1 - F2 */ 47 38 if (argc != 4) goto usage; 48 39 if (strcmp (argv[2], "-")) goto usage; 49 40 if (!GetPhotcodeInfo (argv[1], &code[0], &mode[0])) goto usage; 50 41 if (!GetPhotcodeInfo (argv[3], &code[1], &mode[1])) goto usage; 51 /* code.type must be PHOT_REF */ 52 53 /* test PhotSelections: is photcode specified if needed? */ 54 if (!TestPhotSelections (&code)) { 55 fprintf (stderr, "photcode selection rules violated\n"); 56 fprintf (stderr, "average and ensemble restrictions require a corresponding photcode\n"); 57 goto escape; 58 } 59 42 if (!TestPhotSelections (&code[0], MEAS_ZERO)) goto escape; 60 43 61 44 /* returned vectors are dmag, mag, color, time, airmass, ra, dec, x, y, exptime */ … … 86 69 } 87 70 88 /* select region files */ 89 if (RegionList) { 90 regions = region_list (RegionListFile, &Nregions); 91 if (!SetImageSelection (MEAS_XMOSAIC, NULL, FALSE)) goto escape; 92 } else { 93 Radius = MAX (fabs(graphsky.xmax), fabs(graphsky.ymax)); 94 regions = find_regions (graphsky.coords.crval1, graphsky.coords.crval2, Radius, &Nregions); 95 if (!SetImageSelection (MEAS_XMOSAIC, &graphsky, TRUE)) goto escape; 96 } 71 /* load region corresponding to selection above */ 72 if ((regions = SelectRegions (RegionName, RegionList, &Nregions)) == NULL) goto escape; 73 if (!SetImageSelection (MEAS_XMOSAIC)) goto escape; 97 74 98 75 for (Nr = 0; Nr < Nregions; Nr++) { … … 177 154 vec[i][0].Nelements = N; 178 155 } 156 FreeImageSelection (); 179 157 return (TRUE); 180 158 … … 185 163 escape: 186 164 165 FreeImageSelection (); 187 166 if (regions != NULL) free (regions); 188 167 for (i = 0; i < NVEC; i++) { -
trunk/Ohana/src/opihi/dvo/ccd.c
r4470 r4585 3 3 int ccd (int argc, char **argv) { 4 4 5 Catalog catalog; 6 Graphdata graphsky; 7 RegionFile *regions; 8 PhotCode *code[4]; 9 Vector *xvec, *yvec; 10 11 char filename[256], catdir[256], *CPTfile; 5 char filename[256], catdir[256], *RegionName, *RegionList; 12 6 double Radius; 13 7 double *M1, *M2; 14 8 int i, m, k, Npts, NPTS, N; 15 9 int N1, N2, i1, i2, mode[4]; 16 int Ngraph, Nsec, Nregions, UseAverages; 10 int Ngraph, Nsec, Nregions; 11 12 Catalog catalog; 13 RegionFile *regions; 14 PhotCode *code[4]; 15 Vector *xvec, *yvec; 17 16 18 17 /* defaults */ … … 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)) return (FALSE);31 32 29 /* find CATDIR in config system */ 33 VarConfig ("CATDIR", "%s", catdir); 34 35 /* check for CPT selection */ 36 CPTfile = NULL; 37 if (N = get_argument (argc, argv, "-cpt")) { 38 remove_argument (N, &argc, argv); 39 CPTfile = strcreate (argv[N]); 40 remove_argument (N, &argc, argv); 41 } 30 if (VarConfig ("CATDIR", "%s", catdir) == NULL) goto escape; 42 31 43 32 /* interpret command-line options */ 44 if (!SetPhotSelections (&argc, argv)) goto usage; 33 if (!SetRegionSelection (&argc, argv, &RegionName, &RegionList)) goto escape; 34 if (!SetPhotSelections (&argc, argv, 4)) goto usage; 35 36 /* interpret command-line options */ 45 37 if (argc != 8) goto usage; 46 38 if (strcmp (argv[2], "-")) goto usage; 47 39 if (strcmp (argv[4], ":")) goto usage; 48 40 if (strcmp (argv[6], "-")) goto usage; 49 50 /* interpret command-line options */51 41 if (!GetPhotcodeInfo (argv[1], &code[0], &mode[0])) return (FALSE); 52 42 if (!GetPhotcodeInfo (argv[3], &code[1], &mode[1])) return (FALSE); 53 43 if (!GetPhotcodeInfo (argv[5], &code[2], &mode[2])) return (FALSE); 54 44 if (!GetPhotcodeInfo (argv[7], &code[3], &mode[3])) return (FALSE); 55 if ( (mode[2] == MAG_AVE) || (mode[2] == MAG_REF)) UseAverages = TRUE;45 if (!TestPhotSelections (&code[0], MEAS_ZERO)) goto escape; 56 46 57 /* determine region-file names */ 58 if (CPTfile == NULL) { 59 float Radius; 60 Radius = MAX (fabs(graphsky.xmax), fabs(graphsky.ymax)); 61 regions = find_regions (graphsky.coords.crval1, graphsky.coords.crval2, Radius, &Nregions); 62 } else { 63 Nregions = 1; 64 ALLOCATE (regions, RegionFile, 1); 65 strcpy (regions[0].name, CPTfile); 66 } 47 /* load region corresponding to selection above */ 48 if ((regions = SelectRegions (RegionName, RegionList, &Nregions)) == NULL) goto escape; 67 49 68 50 /* init vectors to save data */ … … 94 76 m = catalog.average[i].offset; 95 77 78 SetSelectionParam (0); 96 79 M1 = ExtractDMag (&code[0], &mode[0], &catalog.average[i], &catalog.secfilt[i*Nsec], &catalog.measure[m], &N1); 97 80 if (N1 == 0) goto skip; 98 81 82 SetSelectionParam (2); 99 83 M2 = ExtractDMag (&code[2], &mode[2], &catalog.average[i], &catalog.secfilt[i*Nsec], &catalog.measure[m], &N2); 100 84 if (N2 == 0) goto skip; … … 105 89 yvec[0].elements[Npts] = M2[i2]; 106 90 Npts++; 107 if (Npts == NPTS) {91 if (Npts >= NPTS) { 108 92 NPTS += 2000; 109 93 REALLOCATE (xvec[0].elements, float, NPTS); … … 128 112 129 113 usage: 130 fprintf (stderr, "USAGE: ccd F - F : measure.param\n");114 fprintf (stderr, "USAGE: ccd F - F : F - F\n"); 131 115 return (FALSE); 132 116 … … 136 120 if (catalog.secfilt != NULL) free (catalog.secfilt); 137 121 if (catalog.measure != NULL) free (catalog.measure); 122 if (RegionName != NULL) free (RegionName); 123 if (RegionList != NULL) free (RegionList); 138 124 return (FALSE); 139 125 } -
trunk/Ohana/src/opihi/dvo/cmd.c
r4470 r4585 3 3 int cmd (int argc, char **argv) { /* really need to think about upper limits & how to represent them */ 4 4 5 char filename[256], catdir[256], *RegionName, *RegionList; 6 double Radius, *M1, *M3; 7 int i, j, m, i1, i3, N1, N3, N; 8 int Npts, NPTS, mode[3]; 9 int Ngraph, Nsec, Nregions; 10 5 11 Catalog catalog; 6 12 Graphdata graphsky; … … 9 15 Vector *xvec, *yvec; 10 16 11 char filename[256], catdir[256], *CPTfile;12 double Radius, *M1, *M3;13 int i, j, m, i1, i3, N1, N3, N;14 int Npts, NPTS, mode[3];15 int Ngraph, Nsec, Nregions;16 17 17 /* defaults */ 18 18 regions = NULL; … … 20 20 catalog.secfilt = NULL; 21 21 catalog.measure = NULL; 22 RegionName = NULL; 23 RegionList = NULL; 22 24 23 25 /* load photcode information */ … … 25 27 Nsec = GetPhotcodeNsecfilt (); 26 28 27 /* load data about plot windows */28 Ngraph = 0;29 if (!GetGraphData (&graphsky, NULL, &Ngraph)) return (FALSE);30 31 29 /* find CATDIR in config system */ 32 VarConfig ("CATDIR", "%s", catdir); 33 34 /* check for CPT selection */ 35 CPTfile = NULL; 36 if (N = get_argument (argc, argv, "-cpt")) { 37 remove_argument (N, &argc, argv); 38 CPTfile = strcreate (argv[N]); 39 remove_argument (N, &argc, argv); 40 } 30 if (VarConfig ("CATDIR", "%s", catdir) == NULL) goto escape; 41 31 42 32 /* interpret command-line options */ 43 if (!SetPhotSelections (&argc, argv)) goto usage; 33 if (!SetRegionSelection (&argc, argv, &RegionName, &RegionList)) goto escape; 34 if (!SetPhotSelections (&argc, argv, 3)) goto usage; 35 36 /* interpret command-line options */ 44 37 if (argc != 6) { goto usage; } 45 38 if (strcmp (argv[2], "-")) goto usage; 46 39 if (strcmp (argv[4], ":")) goto usage; 47 48 /* interpret command-line options */49 40 if (!GetPhotcodeInfo (argv[1], &code[0], &mode[0])) return (FALSE); 50 41 if (!GetPhotcodeInfo (argv[3], &code[1], &mode[1])) return (FALSE); 51 42 if (!GetPhotcodeInfo (argv[5], &code[2], &mode[2])) return (FALSE); 43 if (!TestPhotSelections (&code[0], MEAS_ZERO)) goto escape; 52 44 53 /* determine region-file names */ 54 if (CPTfile == NULL) { 55 float Radius; 56 Radius = MAX (fabs(graphsky.xmax), fabs(graphsky.ymax)); 57 regions = find_regions (graphsky.coords.crval1, graphsky.coords.crval2, Radius, &Nregions); 58 } else { 59 Nregions = 1; 60 ALLOCATE (regions, RegionFile, 1); 61 strcpy (regions[0].name, CPTfile); 62 } 45 /* load region corresponding to selection above */ 46 if ((regions = SelectRegions (RegionName, RegionList, &Nregions)) == NULL) goto escape; 63 47 64 48 /* init vectors to save data */ … … 90 74 m = catalog.average[i].offset; 91 75 76 SetSelectionParam (0); 92 77 M1 = ExtractDMag (code, mode, &catalog.average[i], &catalog.secfilt[i*Nsec], &catalog.measure[m], &N1); 93 78 if (N1 == 0) goto skip; 94 79 80 SetSelectionParam (2); 95 81 M3 = ExtractMagnitudes (code[2], mode[2], &catalog.average[i], &catalog.secfilt[i*Nsec], &catalog.measure[m], &N3); 96 82 if (N3 == 0) goto skip; … … 101 87 yvec[0].elements[Npts] = M3[i3]; 102 88 Npts++; 103 if (Npts == NPTS) {89 if (Npts >= NPTS) { 104 90 NPTS += 2000; 105 91 REALLOCATE (xvec[0].elements, float, NPTS); … … 132 118 if (catalog.secfilt != NULL) free (catalog.secfilt); 133 119 if (catalog.measure != NULL) free (catalog.measure); 120 if (RegionName != NULL) free (RegionName); 121 if (RegionList != NULL) free (RegionList); 134 122 return (FALSE); 135 123 } -
trunk/Ohana/src/opihi/dvo/ddmags.c
r3689 r4585 3 3 int ddmags (int argc, char **argv) { 4 4 5 Catalog catalog; 6 Graphdata graphsky; 7 RegionFile *regions; 8 PhotCode *code[4]; 9 Vector *xvec, *yvec; 10 11 char filename[256], catdir[256]; 5 char filename[256], catdir[256], *RegionName, *RegionList; 12 6 double Radius; 13 7 double *M1, *M2; 14 8 int i, m, k, Npts, NPTS; 15 9 int N1, N2, i1, i2, mode[4]; 16 int Ngraph, Nsec, Nregions, UseAverages; 10 int Ngraph, Nsec, Nregions; 11 12 Catalog catalog; 13 RegionFile *regions; 14 PhotCode *code[4]; 15 Vector *xvec, *yvec; 17 16 18 17 /* defaults */ … … 21 20 catalog.secfilt = NULL; 22 21 catalog.measure = NULL; 23 24 /* find CATDIR in config system */ 25 VarConfig ("CATDIR", "%s", catdir); 22 RegionName = NULL; 23 RegionList = NULL; 26 24 27 25 /* load photcode information */ … … 29 27 Nsec = GetPhotcodeNsecfilt (); 30 28 31 /* load data about plot windows */ 32 Ngraph = 0; 33 if (!GetGraphData (&graphsky, NULL, &Ngraph)) return (FALSE); 34 35 /* find catalog files which overlap this region */ 36 Radius = MAX (fabs(graphsky.xmax), fabs(graphsky.ymax)); 37 regions = find_regions (graphsky.coords.crval1, graphsky.coords.crval2, Radius, &Nregions); 29 /* find CATDIR in config system */ 30 if (VarConfig ("CATDIR", "%s", catdir) == NULL) goto escape; 38 31 39 32 /* interpret command-line options */ 40 if (!SetPhotSelections (&argc, argv)) goto usage; 33 if (!SetRegionSelection (&argc, argv, &RegionName, &RegionList)) goto escape; 34 if (!SetPhotSelections (&argc, argv, 4)) goto usage; 35 36 /* interpret command-line options */ 41 37 if (argc != 8) goto usage; 42 38 if (strcmp (argv[2], "-")) goto usage; 43 39 if (strcmp (argv[4], ":")) goto usage; 44 40 if (strcmp (argv[6], "-")) goto usage; 45 46 /* interpret command-line options */47 41 if (!GetPhotcodeInfo (argv[1], &code[0], &mode[0])) return (FALSE); 48 42 if (!GetPhotcodeInfo (argv[3], &code[1], &mode[1])) return (FALSE); 49 43 if (!GetPhotcodeInfo (argv[5], &code[2], &mode[2])) return (FALSE); 50 44 if (!GetPhotcodeInfo (argv[7], &code[3], &mode[3])) return (FALSE); 51 if ((mode[2] == MAG_AVE) || (mode[2] == MAG_REF)) UseAverages = TRUE; 45 if (!TestPhotSelections (&code[0], MEAS_ZERO)) goto escape; 46 47 /* load region corresponding to selection above */ 48 if ((regions = SelectRegions (RegionName, RegionList, &Nregions)) == NULL) goto escape; 52 49 53 50 /* init vectors to save data */ … … 79 76 m = catalog.average[i].offset; 80 77 78 SetSelectionParam (0); 81 79 M1 = ExtractDMag (&code[0], &mode[0], &catalog.average[i], &catalog.secfilt[i*Nsec], &catalog.measure[m], &N1); 82 80 if (N1 == 0) goto skip; 83 81 82 SetSelectionParam (2); 84 83 M2 = ExtractDMag (&code[2], &mode[2], &catalog.average[i], &catalog.secfilt[i*Nsec], &catalog.measure[m], &N2); 85 84 if (N2 == 0) goto skip; … … 90 89 yvec[0].elements[Npts] = M2[i2]; 91 90 Npts++; 92 if (Npts == NPTS) {91 if (Npts >= NPTS) { 93 92 NPTS += 2000; 94 93 REALLOCATE (xvec[0].elements, float, NPTS); … … 120 119 if (catalog.secfilt != NULL) free (catalog.secfilt); 121 120 if (catalog.measure != NULL) free (catalog.measure); 121 if (RegionName != NULL) free (RegionName); 122 if (RegionList != NULL) free (RegionList); 122 123 return (FALSE); 123 124 } -
trunk/Ohana/src/opihi/dvo/dmagaves.c
r4470 r4585 3 3 int dmagaves (int argc, char **argv) { 4 4 5 Catalog catalog; 6 Graphdata graphsky; 7 RegionFile *regions; 8 PhotCode *code[3]; 9 Vector *xvec, *yvec; 10 11 char filename[256], catdir[256], *CPTfile; 5 char filename[256], catdir[256], *RegionName, *RegionList; 12 6 double Radius, *M1, M2; 13 7 int i, j, k, m, N1, N; 14 8 int Npts, NPTS, param, mode[3]; 15 9 int Ngraph, Nsec, Nregions; 10 11 Catalog catalog; 12 RegionFile *regions; 13 PhotCode *code[3]; 14 Vector *xvec, *yvec; 16 15 17 16 /* defaults */ … … 20 19 catalog.secfilt = NULL; 21 20 catalog.measure = NULL; 21 RegionName = NULL; 22 RegionList = NULL; 22 23 23 24 /* load photcode information */ … … 25 26 Nsec = GetPhotcodeNsecfilt (); 26 27 27 /* load data about plot windows */28 Ngraph = 0;29 if (!GetGraphData (&graphsky, NULL, &Ngraph)) return (FALSE);30 31 28 /* find CATDIR in config system */ 32 VarConfig ("CATDIR", "%s", catdir); 33 34 /* check for CPT selection */ 35 CPTfile = NULL; 36 if (N = get_argument (argc, argv, "-cpt")) { 37 remove_argument (N, &argc, argv); 38 CPTfile = strcreate (argv[N]); 39 remove_argument (N, &argc, argv); 40 } 29 if (VarConfig ("CATDIR", "%s", catdir) == NULL) goto escape; 41 30 42 31 /* interpret command-line options */ 43 if (!SetPhotSelections (&argc, argv)) goto usage; 32 if (!SetRegionSelection (&argc, argv, &RegionName, &RegionList)) goto escape; 33 if (!SetPhotSelections (&argc, argv, 3)) goto usage; 34 35 /* interpret command-line options: dmagaves F1 - F2 : (value) */ 44 36 if (argc != 6) { goto usage; } 45 37 if (strcmp (argv[2], "-")) goto usage; 46 38 if (strcmp (argv[4], ":")) goto usage; 39 if (!GetPhotcodeInfo (argv[1], &code[0], &mode[0])) goto usage; 40 if (!GetPhotcodeInfo (argv[3], &code[1], &mode[1])) goto usage; 41 if ((param = GetAverageParam (argv[5])) == AVE_ZERO) goto usage; 42 if (!TestPhotSelections (&code[2], param)) goto escape; 47 43 48 /* interpret command-line options */ 49 if (!GetPhotcodeInfo (argv[1], &code[0], &mode[0])) return (FALSE); 50 if (!GetPhotcodeInfo (argv[3], &code[1], &mode[1])) return (FALSE); 51 if ((param = GetAverageParam (argv[5])) == AVE_ZERO) { 52 GetAverageParamHelp (); 53 return (FALSE); 54 } 55 code[2] = GetPhotcodeEquivbyCode (code[0][0].code); 56 mode[2] = mode[0]; 57 58 /* test PhotSelections: is photcode specified if needed? */ 59 for (i = 0; i < 3; i++) { 60 if (!TestPhotSelections (&code[i])) { 61 fprintf (stderr, "photcode selection rules violated\n"); 62 fprintf (stderr, "average and ensemble restrictions require a corresponding photcode\n"); 63 goto escape; 64 } 65 } 66 67 /* determine region-file names */ 68 if (CPTfile == NULL) { 69 float Radius; 70 Radius = MAX (fabs(graphsky.xmax), fabs(graphsky.ymax)); 71 regions = find_regions (graphsky.coords.crval1, graphsky.coords.crval2, Radius, &Nregions); 72 } else { 73 Nregions = 1; 74 ALLOCATE (regions, RegionFile, 1); 75 strcpy (regions[0].name, CPTfile); 76 } 44 /* load region corresponding to selection above */ 45 if ((regions = SelectRegions (RegionName, RegionList, &Nregions)) == NULL) goto escape; 77 46 78 47 /* init vectors to save data */ … … 103 72 m = catalog.average[i].offset; 104 73 74 SetSelectionParam (0); 105 75 M1 = ExtractDMag (code, mode, &catalog.average[i], &catalog.secfilt[i*Nsec], &catalog.measure[m], &N1); 106 76 if (N1 == 0) goto skip; 107 77 78 SetSelectionParam (2); 108 79 M2 = ExtractAverages (code[2], mode[2], &catalog.average[i], &catalog.secfilt[i*Nsec], &catalog.measure[m], param); 109 80 … … 112 83 yvec[0].elements[Npts] = M2; 113 84 Npts++; 114 if (Npts == NPTS) {85 if (Npts >= NPTS) { 115 86 NPTS += 2000; 116 87 REALLOCATE (xvec[0].elements, float, NPTS); … … 128 99 catalog.measure = (Measure *) NULL; 129 100 } 130 FreeImageSelection ();131 101 if (regions != NULL) free (regions); 132 102 xvec[0].Nelements = yvec[0].Nelements = Npts; … … 138 108 139 109 escape: 140 FreeImageSelection ();141 110 if (regions != NULL) free (regions); 142 111 if (catalog.average != NULL) free (catalog.average); 143 112 if (catalog.secfilt != NULL) free (catalog.secfilt); 144 113 if (catalog.measure != NULL) free (catalog.measure); 114 if (RegionName != NULL) free (RegionName); 115 if (RegionList != NULL) free (RegionList); 145 116 return (FALSE); 146 117 } -
trunk/Ohana/src/opihi/dvo/dmagmeas.c
r4470 r4585 1 1 # include "dvo1.h" 2 double *ExtractByDMag (PhotCode **code, int *mode, Average *average, SecFilt *secfilt, Measure *measure, int *nlist, int param);3 2 4 3 int dmagmeas (int argc, char **argv) { 5 4 5 char filename[256], catdir[256], *RegionName, *RegionList; 6 double Radius, *M1, *M3; 7 int i, j, k, m, i1, i3, N1, N3, N; 8 int Npts, NPTS, param, mode[3]; 9 int Ngraph, Nsec, Nregions; 10 6 11 Catalog catalog; 7 Graphdata graphsky;8 12 RegionFile *regions; 9 13 PhotCode *code[3]; 10 14 Vector *xvec, *yvec; 11 12 char filename[256], catdir[256], *CPTfile;13 double Radius, *M1, *M3;14 int i, j, k, m, N1, N3, N;15 int Npts, NPTS, param, mode[3];16 int Ngraph, Nsec, Nregions;17 15 18 16 /* defaults */ … … 21 19 catalog.secfilt = NULL; 22 20 catalog.measure = NULL; 21 RegionName = NULL; 22 RegionList = NULL; 23 23 24 24 /* load photcode information */ … … 26 26 Nsec = GetPhotcodeNsecfilt (); 27 27 28 /* load data about plot windows */29 Ngraph = 0;30 if (!GetGraphData (&graphsky, NULL, &Ngraph)) return (FALSE);31 32 28 /* find CATDIR in config system */ 33 VarConfig ("CATDIR", "%s", catdir); 34 35 /* check for CPT selection */ 36 CPTfile = NULL; 37 if (N = get_argument (argc, argv, "-cpt")) { 38 remove_argument (N, &argc, argv); 39 CPTfile = strcreate (argv[N]); 40 remove_argument (N, &argc, argv); 41 } 29 if (VarConfig ("CATDIR", "%s", catdir) == NULL) goto escape; 42 30 43 31 /* interpret command-line options */ 44 if (!SetPhotSelections (&argc, argv)) goto usage; 32 if (!SetRegionSelection (&argc, argv, &RegionName, &RegionList)) goto escape; 33 if (!SetPhotSelections (&argc, argv, 3)) goto usage; 34 35 /* interpret command-line arguments: dmagmeas F1 - F2 : (value) */ 45 36 if (argc != 6) { goto usage; } 46 37 if (strcmp (argv[2], "-")) goto usage; 47 38 if (strcmp (argv[4], ":")) goto usage; 48 49 /* interpret command-line options */50 39 if (!GetPhotcodeInfo (argv[1], &code[0], &mode[0])) goto usage; 51 40 if (!GetPhotcodeInfo (argv[3], &code[1], &mode[1])) goto usage; 52 41 if ((param = GetMeasureParam (argv[5])) == MEAS_ZERO) goto usage; 42 if (!TestPhotSelections (&code[2], MEAS_ZERO)) goto escape; 53 43 54 /* test PhotSelections: is photcode specified if needed? */ 55 for (i = 0; i < 2; i++) { 56 if (!TestPhotSelections (&code[i])) { 57 fprintf (stderr, "photcode selection rules violated\n"); 58 fprintf (stderr, "average and ensemble restrictions require a corresponding photcode\n"); 59 goto escape; 60 } 61 } 62 63 /* determine region-file names */ 64 if (CPTfile == NULL) { 65 float Radius; 66 Radius = MAX (fabs(graphsky.xmax), fabs(graphsky.ymax)); 67 regions = find_regions (graphsky.coords.crval1, graphsky.coords.crval2, Radius, &Nregions); 68 } else { 69 Nregions = 1; 70 ALLOCATE (regions, RegionFile, 1); 71 strcpy (regions[0].name, CPTfile); 72 } 73 if (!SetImageSelection (param, &graphsky, TRUE)) return (FALSE); 44 /* load region corresponding to selection above */ 45 if ((regions = SelectRegions (RegionName, RegionList, &Nregions)) == NULL) goto escape; 46 if (!SetImageSelection (param)) goto escape; 74 47 75 48 /* init vectors to save data */ … … 101 74 m = catalog.average[i].offset; 102 75 76 SetSelectionParam (0); 103 77 M1 = ExtractDMag (code, mode, &catalog.average[i], &catalog.secfilt[i*Nsec], &catalog.measure[m], &N1); 104 78 if (N1 == 0) goto skip; 105 79 106 M3 = ExtractByDMag (code, mode, &catalog.average[i], &catalog.secfilt[i*Nsec], &catalog.measure[m], &N3, param); 107 if (N3 != N1) { fprintf (stderr, "mismatch: programming error\n"); goto escape; } 80 SetSelectionParam (2); 81 M3 = ExtractMeasures (code[2], mode[2], &catalog.average[i], &catalog.secfilt[i*Nsec], &catalog.measure[m], &N3, param); 82 if (N3 == 0) goto skip; 108 83 109 for (k = 0; k < N1; k++) { 110 xvec[0].elements[Npts] = M1[k]; 111 yvec[0].elements[Npts] = M3[k]; 112 Npts++; 113 if (Npts == NPTS) { 114 NPTS += 2000; 115 REALLOCATE (xvec[0].elements, float, NPTS); 116 REALLOCATE (yvec[0].elements, float, NPTS); 84 for (i1 = 0; i1 < N1; i1++) { 85 for (i3 = 0; i3 < N3; i3++) { 86 xvec[0].elements[Npts] = M1[i1]; 87 yvec[0].elements[Npts] = M3[i3]; 88 Npts++; 89 if (Npts >= NPTS) { 90 NPTS += 2000; 91 REALLOCATE (xvec[0].elements, float, NPTS); 92 REALLOCATE (yvec[0].elements, float, NPTS); 93 } 117 94 } 118 95 } … … 143 120 if (catalog.secfilt != NULL) free (catalog.secfilt); 144 121 if (catalog.measure != NULL) free (catalog.measure); 122 if (RegionName != NULL) free (RegionName); 123 if (RegionList != NULL) free (RegionList); 145 124 return (FALSE); 146 125 } -
trunk/Ohana/src/opihi/dvo/dmags.c
r4470 r4585 3 3 int dmags (int argc, char **argv) { 4 4 5 Catalog catalog; 6 Graphdata graphsky; 7 RegionFile *regions; 8 PhotCode *code[3]; 9 Vector *xvec, *yvec; 10 11 char filename[256], catdir[256], *CPTfile; 5 char filename[256], catdir[256], *RegionName, *RegionList; 12 6 double Radius, *M1, *M3; 13 7 int i, j, m, i1, i3, N1, N3, N; 14 8 int Npts, NPTS, mode[3]; 15 int Ngraph, Nsec, Nregions; 9 int Nsec, Nregions; 10 11 PhotCode *code[3]; 12 Catalog catalog; 13 RegionFile *regions; 14 Vector *xvec, *yvec; 16 15 17 16 /* defaults */ … … 20 19 catalog.secfilt = NULL; 21 20 catalog.measure = NULL; 21 RegionName = NULL; 22 RegionList = NULL; 22 23 23 24 /* load photcode information */ … … 25 26 Nsec = GetPhotcodeNsecfilt (); 26 27 27 /* load data about plot windows */28 Ngraph = 0;29 if (!GetGraphData (&graphsky, NULL, &Ngraph)) return (FALSE);30 31 28 /* find CATDIR in config system */ 32 VarConfig ("CATDIR", "%s", catdir); 33 34 /* check for CPT selection */ 35 CPTfile = NULL; 36 if (N = get_argument (argc, argv, "-cpt")) { 37 remove_argument (N, &argc, argv); 38 CPTfile = strcreate (argv[N]); 39 remove_argument (N, &argc, argv); 40 } 29 if (VarConfig ("CATDIR", "%s", catdir) == NULL) goto escape; 41 30 42 31 /* interpret command-line options */ 43 if (!SetPhotSelections (&argc, argv)) goto usage; 32 if (!SetRegionSelection (&argc, argv, &RegionName, &RegionList)) goto escape; 33 if (!SetPhotSelections (&argc, argv, 3)) goto usage; 34 35 /* interpret required command-line arguments: dmags F1 - F2 : F3 */ 44 36 if (argc != 6) { goto usage; } 45 37 if (strcmp (argv[2], "-")) goto usage; 46 38 if (strcmp (argv[4], ":")) goto usage; 47 48 /* interpret command-line options */49 39 if (!GetPhotcodeInfo (argv[1], &code[0], &mode[0])) goto usage; 50 40 if (!GetPhotcodeInfo (argv[3], &code[1], &mode[1])) goto usage; 51 41 if (!GetPhotcodeInfo (argv[5], &code[2], &mode[2])) goto usage; 42 if (!TestPhotSelections (&code[0], MEAS_ZERO)) goto escape; 52 43 53 /* test PhotSelections: is photcode specified if needed? */ 54 for (i = 0; i < 3; i++) { 55 if (!TestPhotSelections (&code[i])) { 56 fprintf (stderr, "photcode selection rules violated\n"); 57 fprintf (stderr, "average and ensemble restrictions require a corresponding photcode\n"); 58 goto escape; 59 } 60 } 61 62 /* determine region-file names */ 63 if (CPTfile == NULL) { 64 float Radius; 65 Radius = MAX (fabs(graphsky.xmax), fabs(graphsky.ymax)); 66 regions = find_regions (graphsky.coords.crval1, graphsky.coords.crval2, Radius, &Nregions); 67 } else { 68 Nregions = 1; 69 ALLOCATE (regions, RegionFile, 1); 70 strcpy (regions[0].name, CPTfile); 71 } 44 /* load region corresponding to selection above */ 45 if ((regions = SelectRegions (RegionName, RegionList, &Nregions)) == NULL) goto escape; 72 46 73 47 /* init vectors to save data */ … … 99 73 m = catalog.average[i].offset; 100 74 75 SetSelectionParam (0); 101 76 M1 = ExtractDMag (code, mode, &catalog.average[i], &catalog.secfilt[i*Nsec], &catalog.measure[m], &N1); 102 77 if (N1 == 0) goto skip; 103 78 79 SetSelectionParam (2); 104 80 M3 = ExtractMagnitudes (code[2], mode[2], &catalog.average[i], &catalog.secfilt[i*Nsec], &catalog.measure[m], &N3); 105 81 if (N3 == 0) goto skip; … … 110 86 yvec[0].elements[Npts] = M3[i3]; 111 87 Npts++; 112 if (Npts == NPTS) {88 if (Npts >= NPTS) { 113 89 NPTS += 2000; 114 90 REALLOCATE (xvec[0].elements, float, NPTS); … … 134 110 usage: 135 111 fprintf (stderr, "USAGE: dmags F - F : F\n"); 136 fprintf (stderr, " F : any photcodes with matched qualifiers:\n");112 fprintf (stderr, " F : any photcodes with matched qualifiers:\n"); 137 113 fprintf (stderr, " pri: F:inst, F:cat, F:sys, F:rel, F:cal, F:ave, F:ref\n"); 138 114 fprintf (stderr, " sec: F:inst, F:cat, F:sys, F:rel, F:cal, F:ave, F:ref\n"); 139 115 fprintf (stderr, " dep: F:inst, F:cat, F:sys, F:rel, F:cal\n"); 140 116 fprintf (stderr, " ref: F:cat\n"); 141 return (FALSE);142 117 143 118 escape: … … 146 121 if (catalog.secfilt != NULL) free (catalog.secfilt); 147 122 if (catalog.measure != NULL) free (catalog.measure); 123 if (RegionName != NULL) free (RegionName); 124 if (RegionList != NULL) free (RegionList); 148 125 return (FALSE); 149 126 } -
trunk/Ohana/src/opihi/dvo/elixir.c
r3648 r4585 129 129 130 130 mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH; 131 chmod (f , mode);131 chmod (fifo, mode); 132 132 fclearlockfile (fifo, f, LCK_XCLD, &state); 133 133 -
trunk/Ohana/src/opihi/dvo/fitcolors.c
r3688 r4585 13 13 int i, k, m, NP1, NP2, NP, Np, Npts, NPTS; 14 14 int N1, N2, i1, i2, mode[4]; 15 int Nsec, N graph, Nregions, Ncatalog, status;16 char catdir[256], filename[256] ;15 int Nsec, Nregions, Ncatalog, status; 16 char catdir[256], filename[256], *RegionName, *RegionList; 17 17 char *cmd, *outcmd, *camera; 18 18 double Radius; 19 19 double *M1, *M2; 20 20 float *out; 21 21 22 Catalog *catalog; 22 Graphdata graphsky;23 23 RegionFile *regions; 24 24 PhotCode **codelist, *tcode, *code[4]; … … 32 32 xvec = yvec = NULL; 33 33 34 /* find CATDIR in config system */35 VarConfig ("CATDIR", "%s", catdir);36 37 34 /* load photcode information */ 38 35 if (!InitPhotcodes ()) goto escape; 39 36 Nsec = GetPhotcodeNsecfilt (); 40 37 41 /*** determine appropriate catalog files (find_regions) ***/ 42 /* load data about plot windows */ 43 Ngraph = 0; 44 if (!GetGraphData (&graphsky, NULL, &Ngraph)) return (FALSE); 45 /* find catalog files which overlap this region */ 46 Radius = MAX (fabs(graphsky.xmax), fabs(graphsky.ymax)); 47 regions = find_regions (graphsky.coords.crval1, graphsky.coords.crval2, Radius, &Nregions); 38 /* find CATDIR in config system */ 39 if (VarConfig ("CATDIR", "%s", catdir) == NULL) goto escape; 48 40 49 41 /* interpret command-line options */ 50 /*** determine any restrictions (time, ?) ***/ 51 if (!SetPhotSelections (&argc, argv)) goto usage; 42 if (!SetRegionSelection (&argc, argv, &RegionName, &RegionList)) goto escape; 43 if (!SetPhotSelections (&argc, argv, 1)) goto usage; 44 45 /* interpret command-line options */ 52 46 if (argc != 4) goto usage; 53 54 /* vectors to save data */55 Npts = 0;56 NPTS = 1;57 if ((xvec = SelectVector ("tmp_x", ANYVECTOR, TRUE)) == NULL) goto escape;58 if ((yvec = SelectVector ("tmp_y", ANYVECTOR, TRUE)) == NULL) goto escape;59 47 60 48 /* determine relevant photcodes, colors */ … … 108 96 out[i] = -1; 109 97 } 98 99 /* load region corresponding to selection above */ 100 if ((regions = SelectRegions (RegionName, RegionList, &Nregions)) == NULL) goto escape; 110 101 111 102 /* loop over regions, extract data for each region */ … … 131 122 fprintf (stderr, "using %d regions\n", Nregions); 132 123 124 /* vectors to save data */ 125 Npts = 0; 126 NPTS = 1; 127 if ((xvec = SelectVector ("tmp_x", ANYVECTOR, TRUE)) == NULL) goto escape; 128 if ((yvec = SelectVector ("tmp_y", ANYVECTOR, TRUE)) == NULL) goto escape; 129 133 130 /*** generate the color-color vectors for the pairs ***/ 134 131 /* loop over chip photcode pairs */ … … 159 156 xvec[0].elements[Npts] = M2[i2]; 160 157 Npts++; 161 if (Npts == NPTS) {158 if (Npts >= NPTS) { 162 159 NPTS += 2000; 163 160 REALLOCATE (xvec[0].elements, float, NPTS); -
trunk/Ohana/src/opihi/dvo/imdata.c
r3462 r4585 135 135 vec[0].elements[N] = catalog.average[n].R - catalog.measure[i].dR / 360000.0; 136 136 N++; 137 if (N == NPTS - 1) { 138 NPTS += 1000; 139 REALLOCATE (vec[0].elements, float, NPTS); 140 } 137 CHECK_REALLOCATE (vec[0].elements, float, NPTS, N, 1000); 141 138 } 142 139 break; … … 147 144 vec[0].elements[N] = catalog.average[n].D - catalog.measure[i].dD / 360000.0; 148 145 N++; 149 if (N == NPTS - 1) { 150 NPTS += 1000; 151 REALLOCATE (vec[0].elements, float, NPTS); 152 } 146 CHECK_REALLOCATE (vec[0].elements, float, NPTS, N, 1000); 153 147 } 154 148 break; … … 158 152 vec[0].elements[N] = catalog.measure[i].M / 1000.0; 159 153 N++; 160 if (N == NPTS - 1) { 161 NPTS += 1000; 162 REALLOCATE (vec[0].elements, float, NPTS); 163 } 154 CHECK_REALLOCATE (vec[0].elements, float, NPTS, N, 1000); 164 155 } 165 156 break; … … 169 160 vec[0].elements[N] = catalog.measure[i].dM / 1000.0; 170 161 N++; 171 if (N == NPTS - 1) { 172 NPTS += 1000; 173 REALLOCATE (vec[0].elements, float, NPTS); 174 } 162 CHECK_REALLOCATE (vec[0].elements, float, NPTS, N, 1000); 175 163 } 176 164 break; … … 180 168 vec[0].elements[N] = catalog.measure[i].Mcal / 1000.0; 181 169 N++; 182 if (N == NPTS - 1) { 183 NPTS += 1000; 184 REALLOCATE (vec[0].elements, float, NPTS); 185 } 170 CHECK_REALLOCATE (vec[0].elements, float, NPTS, N, 1000); 186 171 } 187 172 break; … … 192 177 vec[0].elements[N] = catalog.average[n].M / 1000.0; 193 178 N++; 194 if (N == NPTS - 1) {195 NPTS += 1000;196 REALLOCATE (vec[0].elements, float, NPTS);197 }198 179 } 199 180 break; … … 203 184 vec[0].elements[N] = catalog.measure[i].source; 204 185 N++; 205 if (N == NPTS - 1) { 206 NPTS += 1000; 207 REALLOCATE (vec[0].elements, float, NPTS); 208 } 186 CHECK_REALLOCATE (vec[0].elements, float, NPTS, N, 1000); 209 187 } 210 188 break; … … 214 192 vec[0].elements[N] = TimeValue (catalog.measure[i].t, TimeReference, TimeFormat); 215 193 N++; 216 if (N == NPTS - 1) { 217 NPTS += 1000; 218 REALLOCATE (vec[0].elements, float, NPTS); 219 } 194 CHECK_REALLOCATE (vec[0].elements, float, NPTS, N, 1000); 220 195 } 221 196 break; -
trunk/Ohana/src/opihi/dvo/mextract.c
r3462 r4585 4 4 5 5 int i, j, k, m, N, N1, NPTS; 6 int param, mode, Nregions, N graph, Nsec;7 char filename[128], catdir[256], * p;8 double *M1;6 int param, mode, Nregions, Nsec; 7 char filename[128], catdir[256], *RegionName, *RegionList, *p; 8 double Radius, *M1; 9 9 10 10 PhotCode *code; 11 11 Catalog catalog; 12 12 RegionFile *regions; 13 Graphdata graphsky;14 13 Vector *vec; 15 14 15 /* defaults */ 16 16 regions = NULL; 17 17 catalog.average = (Average *) NULL; 18 18 catalog.secfilt = (SecFilt *) NULL; 19 19 catalog.measure = (Measure *) NULL; 20 RegionName = NULL; 21 RegionList = NULL; 22 code = NULL; 23 mode = MAG_REL; 20 24 21 25 /* load photcode information */ … … 23 27 Nsec = GetPhotcodeNsecfilt (); 24 28 25 /* load data about plot windows */26 Ngraph = 0;27 if (!GetGraphData (&graphsky, NULL, &Ngraph)) goto escape;28 29 29 /* find CATDIR in config system */ 30 VarConfig ("CATDIR", "%s", catdir); 31 32 /* specify catalog files 33 RegionList = FALSE; 34 if (N = get_argument (argc, argv, "-list")) { 35 RegionList = TRUE; 36 remove_argument (N, &argc, argv); 37 strcpy (RegionListFile, argv[N]); 38 remove_argument (N, &argc, argv); 39 } */ 30 if (VarConfig ("CATDIR", "%s", catdir) == NULL) goto escape; 40 31 41 32 /* interpret command-line options */ 42 if (!SetPhotSelections (&argc, argv)) goto usage; 43 if (argc != 3) goto usage; 33 SetSelectionParam (0); 34 if (!SetRegionSelection (&argc, argv, &RegionName, &RegionList)) goto escape; 35 if (!SetPhotSelections (&argc, argv, 1)) goto usage; 44 36 45 /* identify selection */ 46 code = NULL; 47 mode = MAG_REL; 48 param = GetMeasureParam (argv[2]); 37 /* interpret required command-line arguments: mextract (value) */ 38 if (argc != 2) goto usage; 39 param = GetMeasureParam (argv[1]); 49 40 if (param == MEAS_ZERO) { 50 if (!GetPhotcodeInfo (argv[ 2], &code, &mode)) {41 if (!GetPhotcodeInfo (argv[1], &code, &mode)) { 51 42 GetMeasureParam ("help"); 52 fprintf (stderr, "value may also be a valid photcode\n");53 fprintf (stderr, "photcodes or 'mag' may have optional magnitude type: mag,[Minst, Mcat, Msys, Mrel, Mcal]\n");54 43 goto escape; 55 44 } 56 45 param = MEAS_MAG; 57 for (p = argv[ 2]; *p != 0; p++) {46 for (p = argv[1]; *p != 0; p++) { 58 47 if (*p == '.') *p = ':'; 59 48 } 60 }61 /* test PhotSelections: is photcode specified if needed? */62 if (!TestPhotSelections (&code)) {63 fprintf (stderr, "photcode selection rules violated\n");64 fprintf (stderr, "average and ensemble restrictions require a corresponding photcode\n");65 goto escape;66 49 } 50 if (!TestPhotSelections (&code, MEAS_ZERO)) goto escape; 67 51 68 if ((vec = SelectVector (argv[2], ANYVECTOR, TRUE)) == NULL) goto escape; 69 70 /* determine region-file names */ 71 if (!strcmp (argv[1], "all")) { 72 float Radius; 73 Radius = MAX (fabs(graphsky.xmax), fabs(graphsky.ymax)); 74 regions = find_regions (graphsky.coords.crval1, graphsky.coords.crval2, Radius, &Nregions); 75 /* I don't have a tool to select images by the overlapping region */ 76 if (!SetImageSelection (param, &graphsky, TRUE)) goto escape; 77 } else { 78 Nregions = 1; 79 ALLOCATE (regions, RegionFile, 1); 80 strcpy (regions[0].name, argv[1]); 81 if (!SetImageSelection (param, NULL, FALSE)) goto escape; 82 } 52 /* load region corresponding to selection above */ 53 if ((regions = SelectRegions (RegionName, RegionList, &Nregions)) == NULL) goto escape; 54 if (!SetImageSelection (param)) goto escape; 83 55 84 56 /* create storage vector */ 85 N PTS = 1000;86 REALLOCATE (vec[0].elements, float, NPTS);87 vec[0].Nelements = N = 0;57 N = 0; 58 NPTS = 1; 59 if ((vec = SelectVector (argv[1], ANYVECTOR, TRUE)) == NULL) goto escape; 88 60 89 61 for (i = 0; i < Nregions; i++) { … … 110 82 vec[0].elements[N] = M1[k]; 111 83 N++; 112 if (N == NPTS - 1) { 113 NPTS += 2000; 114 REALLOCATE (vec[0].elements, float, NPTS); 115 } 84 CHECK_REALLOCATE (vec[0].elements, float, NPTS, N, 2000); 116 85 } 117 86 if (M1 != NULL) free (M1); … … 132 101 133 102 usage: 134 fprintf (stderr, "USAGE: mextract (from) (value) [options]\n"); 135 fprintf (stderr, " from: cpt name or 'all'\n"); 103 fprintf (stderr, "USAGE: mextract (value) [options]\n"); 136 104 fprintf (stderr, " value: measure.parameter or photcode\n"); 137 105 return (FALSE); 138 106 139 107 escape: 108 FreeImageSelection (); 140 109 if (regions != NULL) free (regions); 141 FreeImageSelection ();142 110 if (catalog.average != NULL) free (catalog.average); 143 111 if (catalog.secfilt != NULL) free (catalog.secfilt); 144 112 if (catalog.measure != NULL) free (catalog.measure); 113 if (RegionName != NULL) free (RegionName); 114 if (RegionList != NULL) free (RegionList); 145 115 return (FALSE); 146 116 } -
trunk/Ohana/src/opihi/dvo/photometry.c
r4420 r4585 3 3 /* match code to measure */ 4 4 # define TESTCODE(C,M) \ 5 switch (C[0].type) { \ 6 case PHOT_DEP: \ 7 case PHOT_REF: \ 8 if (C[0].code != M.source) continue; \ 9 break; \ 10 case PHOT_PRI: \ 11 case PHOT_SEC: \ 12 if (C[0].code != GetPhotcodeEquivCodebyCode (M.source)) continue; \ 13 break; \ 14 default: \ 15 break; \ 16 } 5 if ((C != NULL) && ApplySelections[SelectionParam]) { \ 6 switch (C[0].type) { \ 7 case PHOT_DEP: \ 8 case PHOT_REF: \ 9 if (C[0].code != M.source) continue; \ 10 break; \ 11 case PHOT_PRI: \ 12 case PHOT_SEC: \ 13 if (C[0].code != GetPhotcodeEquivCodebyCode (M.source)) continue; \ 14 break; \ 15 default: \ 16 break; \ 17 } } 17 18 18 19 /* exclusions based on measure.params */ 19 20 # define TESTMEASURE(M) \ 20 if (TimeSelect && (M.t < tzero)) continue; \ 21 if (TimeSelect && (M.t > tend)) continue; \ 22 if (ErrSelect && (M.dM > ErrValue)) continue; \ 23 if (TypeSelect && (TypeValue != GetMeasureTypeCode (&M))) continue; \ 24 if (iMagSelect && (PhotInst (&M) < iMagMin)) continue; \ 25 if (FlagSelect && (M.flags != FlagValue)) continue; 21 if (ApplySelections[SelectionParam]) { \ 22 if (TimeSelect && (M.t < tzero)) continue; \ 23 if (TimeSelect && (M.t > tend)) continue; \ 24 if (ErrSelect && (M.dM > ErrValue)) continue; \ 25 if (TypeSelect && (TypeValue != GetMeasureTypeCode (&M))) continue; \ 26 if (iMagSelect && (PhotInst (&M) < iMagMin)) continue; \ 27 if (FlagSelect && (M.flags != FlagValue)) continue; \ 28 } 26 29 27 30 # define SETMAG(MOUT,MEAS,MODE) \ … … 34 37 if (MODE == MAG_AVE) MOUT = PhotRel (&MEAS, average, secfilt); \ 35 38 if (MODE == MAG_REF) MOUT = PhotCal (&MEAS, average, secfilt, measure, GetPhotcodeEquivbyCode (MEAS.source)); \ 36 if (MagSelect && (MOUT > MagMax)) continue; \ 37 if (MagSelect && (MOUT < MagMin)) continue; 39 if (ApplySelections[SelectionParam]) { \ 40 if (MagSelect && (MOUT > MagMax)) continue; \ 41 if (MagSelect && (MOUT < MagMin)) continue; \ 42 } 38 43 39 44 /* selection criteria */ … … 51 56 static double TypefracValue; 52 57 58 /* apply selections or not */ 59 static int ApplySelections[4]; 60 static int SelectionParam; 61 53 62 /* applied to Average quantities */ 54 63 static int PhotcodeSelect; … … 69 78 static int TimeFormat; 70 79 71 /* db image table */ 72 static Image *image = NULL; 73 static int *subset = NULL; 74 static int Nimage = 0; 75 static int Nsubset = 0; 76 static Coords mosaic; 80 int GetTimeSelection (time_t *tz, time_t *te) { 81 *tz = tzero; 82 *te = tend; 83 return (TimeSelect); 84 } 77 85 78 86 int GetPhotcodeInfo (char *string, PhotCode **Code, int *Mode) { … … 156 164 } 157 165 166 int SetSelectionParam (int param) { 167 SelectionParam = param; 168 return (TRUE); 169 } 170 171 int GetSelectionParam () { 172 return (SelectionParam); 173 } 174 158 175 int GetMagMode (char *string) { 159 176 … … 196 213 fprintf (stderr, "value may be one of the following:\n"); 197 214 fprintf (stderr, " ra dR dec dD mag dmag Mrel Mcal photcode time fwhm dophot xccd yccd xmosaic ymosaic flags\n"); 215 fprintf (stderr, "value may also be a valid photcode\n"); 216 fprintf (stderr, "photcodes or 'mag' may have optional magnitude type: mag,[Minst, Mcat, Msys, Mrel, Mcal]\n"); 198 217 } 199 218 return (param); 200 219 } 201 220 202 int TestPhotSelections (PhotCode **code) {203 204 int NeedPhotcode;205 206 /* if i've supplied a photcode (code != NULL), i'm not allowed to restrict it */207 if ((code[0] != NULL) && PhotcodeSelect) return (FALSE);208 209 /* if I have an average or ensemble restriction, I must have a photcode */210 if (ChiSelect || NphotSelect || NcodeSelect || FWHMSelect) {211 if (code[0] != NULL) return (TRUE);212 if (PhotcodeSelect) {213 code[0] = PhotcodeValue;214 return (TRUE);215 }216 return (FALSE);217 }218 219 /* if I have a photcode restriction, apply it to the code */220 if (PhotcodeSelect) {221 code[0] = PhotcodeValue;222 return (TRUE);223 }224 return (TRUE);225 }226 227 221 int GetAverageParam (char *parname) { 228 222 … … 233 227 if (!strcasecmp (parname, "dec")) param = AVE_DEC; 234 228 if (!strcasecmp (parname, "dmag")) param = AVE_dMAG; 229 if (!strcasecmp (parname, "mag")) param = AVE_MAG; 235 230 if (!strcasecmp (parname, "Nmeas")) param = AVE_NMEAS; 236 231 if (!strcasecmp (parname, "Nmiss")) param = AVE_NMISS; … … 251 246 } 252 247 248 /* I've set some selections - if these require a photcode, check if I set one */ 249 int TestPhotSelections (PhotCode **code, int param) { 250 251 int NeedPhotcode; 252 253 /* if i've supplied a photcode (code != NULL), i'm not allowed to restrict it */ 254 if (code[0] != NULL) { 255 if (PhotcodeSelect) { 256 fprintf (stderr, "photcode selection rules violated: cannot restrict photcode with a photcode\n"); 257 return (FALSE); 258 } else { 259 return (TRUE); 260 } 261 } 262 263 /* if I have an average or ensemble restriction, I must have a photcode */ 264 NeedPhotcode = FALSE; 265 NeedPhotcode |= ChiSelect; 266 NeedPhotcode |= NphotSelect; 267 NeedPhotcode |= NcodeSelect; 268 NeedPhotcode |= ErrSelect; 269 NeedPhotcode |= TypeSelect; 270 NeedPhotcode |= TypefracSelect; 271 272 /* for measure tests, supply MEAS_ZERO */ 273 NeedPhotcode |= (param == AVE_Xm); 274 NeedPhotcode |= (param == AVE_MAG); 275 NeedPhotcode |= (param == AVE_dMAG); 276 NeedPhotcode |= (param == AVE_TYPE); 277 NeedPhotcode |= (param == AVE_NPHOT); 278 NeedPhotcode |= (param == AVE_NCODE); 279 280 if (NeedPhotcode || PhotcodeSelect) { 281 if (!PhotcodeSelect) return (FALSE); 282 code[0] = PhotcodeValue; 283 if (code[0][0].type == PHOT_DEP) return (FALSE); 284 if (code[0][0].type == PHOT_REF) return (FALSE); 285 } 286 return (TRUE); 287 } 288 253 289 void GetAverageParamHelp () { 254 290 fprintf (stderr, "value may be one of the following:\n"); … … 259 295 } 260 296 261 /* load images based on parameters and region, etc */262 int SetImageSelection (int mode, Graphdata *graphsky, int RegionSelect) {263 264 image = NULL;265 subset = NULL;266 267 switch (mode) {268 case MEAS_XCCD:269 case MEAS_YCCD:270 break;271 case MEAS_XMOSAIC:272 case MEAS_YMOSAIC:273 /* mosaic defines a frame with 0,0 at the mosaic center, and 1 arcsec / pixel */274 mosaic.crpix1 = mosaic.crpix2 = 0.0;275 mosaic.cdelt1 = mosaic.cdelt2 = 1.0 / 3600;276 mosaic.pc1_1 = mosaic.pc2_2 = 1.0;277 mosaic.pc1_2 = mosaic.pc2_1 = 0.0;278 mosaic.Npolyterms = 0;279 strcpy (mosaic.ctype, "RA---SIN");280 break;281 default:282 return (TRUE);283 }284 285 if ((image = LoadImages (&Nimage)) == NULL) return (FALSE);286 BuildChipMatch (image, Nimage);287 image_subset (image, Nimage, &subset, &Nsubset, graphsky, RegionSelect, tzero, (double) tend - tzero, TimeSelect);288 sort_image_subset (image, subset, Nsubset);289 return (TRUE);290 }291 292 /* free loaded images */293 void FreeImageSelection () {294 if (image != NULL) free (image);295 if (subset != NULL) free (subset);296 image = NULL;297 subset = NULL;298 return;299 }300 301 297 /* (re)load photcodes from photcode table */ 302 298 int InitPhotcodes () { … … 318 314 /* remove standard photometry filtering options, set selections */ 319 315 /* not all functions respect all selections... */ 320 int SetPhotSelections (int *argc, char **argv ) {321 322 int N;316 int SetPhotSelections (int *argc, char **argv, int Nparams) { 317 318 int i, N; 323 319 double trange; 324 320 … … 367 363 } 368 364 369 /* select on value of flag (MEASURE ONLY) */ 370 ChiSelect = FALSE; 371 if (N = get_argument (*argc, argv, "-chisq")) { 372 ChiSelect = TRUE; 373 remove_argument (N, argc, argv); 374 ChiLimit = atof (argv[N]); 365 /* select on value of Chisq (AVERAGE ONLY) */ 366 for (i = 0; i < 4; i++) ApplySelections[i] = TRUE; 367 if (N = get_argument (*argc, argv, "-apply")) { 368 remove_argument (N, argc, argv); 369 if (strlen(argv[N]) != Nparams) { 370 fprintf (stderr, "-apply selection must define all parameter choices\n"); 371 return (FALSE); 372 } 373 for (i = 0; i < Nparams; i++) { 374 if (toupper(argv[N][i]) == 'Y') { 375 ApplySelections[i] = TRUE; 376 } else { 377 ApplySelections[i] = FALSE; 378 } 379 } 375 380 remove_argument (N, argc, argv); 376 381 } … … 384 389 if (PhotcodeValue == NULL) { 385 390 fprintf (stderr, "photcode not found in photcode table\n"); 386 PhotcodeSelect = FALSE;391 return (FALSE);; 387 392 } 388 393 remove_argument (N, argc, argv); … … 422 427 } 423 428 429 /* select on value of Chisq (AVERAGE ONLY) */ 430 ChiSelect = FALSE; 431 if (N = get_argument (*argc, argv, "-chisq")) { 432 ChiSelect = TRUE; 433 remove_argument (N, argc, argv); 434 ChiLimit = atof (argv[N]); 435 remove_argument (N, argc, argv); 436 } 437 424 438 /* select on measurement type: 1,2,3 (AVERAGE ONLY) */ 425 439 TypeSelect = FALSE; … … 508 522 ALLOCATE (list, double, NLIST); 509 523 510 /* ch isq, fwhm, Nphot, Ncode*/511 /* if (!TestAverage (code, average, secfilt, measure)) return (list); */524 /* check selections based on averages & ensembles: chisq, Nphot, etc */ 525 if (!TestAverage (code, average, secfilt, measure)) return (list); 512 526 513 527 /* look for measures */ 514 528 for (i = 0; i < average[0].Nm; i++) { 515 if (code != NULL) { 516 TESTCODE (code, measure[i]); 517 } 518 /* exclusions based on measure.params */ 519 TESTMEASURE (measure[i]); 520 521 /* need to have the mag value to test MagSelect */ 522 SETMAG (M, measure[i], mode); 529 TESTCODE (code, measure[i]); /* skip measurements not matching photcode */ 530 TESTMEASURE (measure[i]); /* exclusions based on measure.params */ 531 SETMAG (M, measure[i], mode); /* set appropriate magnitude (also does MagSelect) */ 523 532 524 533 /* assign value */ 525 value = 0; 526 switch (param) { 527 case MEAS_MAG: /* magnitudes are already determined above */ 528 value = M; 529 break; 530 case MEAS_RA: /* OK */ 531 value = average[0].R - measure[i].dR / 360000.0; 532 break; 533 case MEAS_DEC: /* OK */ 534 value = average[0].D - measure[i].dD / 360000.0; 535 break; 536 case MEAS_dMAG: /* OK */ 537 value = 0.001*measure[i].dM; 538 break; 539 case MEAS_AIRMASS: /* OK */ 540 value = 0.001*measure[i].airmass; 541 break; 542 case MEAS_EXPTIME: /* OK */ 543 value = pow (10.0, measure[i].dt * 0.0004); 544 break; 545 case MEAS_PHOTCODE: /* OK */ 546 value = measure[i].source; 547 break; 548 case MEAS_TIME: /* OK */ 549 value = TimeValue (measure[i].t, TimeReference, TimeFormat); 550 break; 551 case MEAS_dR: /* OK */ 552 value = 0.01*measure[i].dR; 553 break; 554 case MEAS_dD: /* OK */ 555 value = 0.01*measure[i].dD; 556 break; 557 case MEAS_FWHM: /* OK */ 558 value = 0.01*measure[i].FWx; 559 break; 560 case MEAS_DOPHOT: /* OK */ 561 value = measure[i].dophot; 562 break; 563 case MEAS_FLAGS: /* ? */ 564 value = measure[i].flags; 565 break; 566 case MEAS_XCCD: /* OK */ 567 ra = average[0].R - measure[i].dR / 360000.0; 568 dec = average[0].D - measure[i].dD / 360000.0; 569 m = match_image_subset (image, subset, Nsubset, measure[i].t, measure[i].source); 570 if (m == -1) break; 571 if (!FindMosaicForImage (image, Nimage, m)) break; 572 RD_to_XY (&x, &y, ra, dec, &image[m].coords); 573 value = x; 574 break; 575 case MEAS_YCCD: /* OK */ 576 ra = average[0].R - measure[i].dR / 360000.0; 577 dec = average[0].D - measure[i].dD / 360000.0; 578 m = match_image_subset (image, subset, Nsubset, measure[i].t, measure[i].source); 579 if (m == -1) break; 580 if (!FindMosaicForImage (image, Nimage, m)) break; 581 RD_to_XY (&x, &y, ra, dec, &image[m].coords); 582 value = y; 583 break; 584 case MEAS_XMOSAIC: /* OK */ 585 ra = average[0].R - measure[i].dR / 360000.0; 586 dec = average[0].D - measure[i].dD / 360000.0; 587 m = match_image_subset (image, subset, Nsubset, measure[i].t, measure[i].source); 588 if (m == -1) break; 589 /* this should use the mosaic assoicated with the image */ 590 /* the solution here depends on image.coords having crref1,2 set to match the boresite center */ 591 /* XXX set the mosaic.coords to have a unity WRP transformation in which x,y = ra,dec */ 592 mosaic.crval1 = image[m].coords.crval1; 593 mosaic.crval2 = image[m].coords.crval2; 594 RD_to_XY (&x, &y, ra, dec, &mosaic); 595 value = x; 596 break; 597 case MEAS_YMOSAIC: /* OK */ 598 ra = average[0].R - measure[i].dR / 360000.0; 599 dec = average[0].D - measure[i].dD / 360000.0; 600 m = match_image_subset (image, subset, Nsubset, measure[i].t, measure[i].source); 601 if (m == -1) break; 602 /* same comments as above */ 603 mosaic.crval1 = image[m].coords.crval1; 604 mosaic.crval2 = image[m].coords.crval2; 605 RD_to_XY (&x, &y, ra, dec, &mosaic); 606 value = y; 607 break; 608 } 609 list[Nlist] = value; 534 list[Nlist] = GetMeasure (param, &average[0], &measure[i], M); 610 535 Nlist ++; 611 536 } … … 622 547 value = NO_MAG; 623 548 624 /* need valid code if param is: */ 625 switch (param) { 626 case AVE_MAG: 627 case AVE_dMAG: 628 case AVE_Xm: 629 case AVE_TYPE: 630 case AVE_NCODE: 631 case AVE_NPHOT: 632 if (code == NULL) return (NO_MAG); 633 break; 634 default: 635 break; 636 } 637 638 /* chisq, fwhm, Nphot, Ncode */ 549 /* this function requires code set for certain value of param. 550 use TestPhotSelectionsAverage to validate code/param choices */ 551 552 /* filter by average quantities (eg, chisq, Nphot, etc) */ 639 553 if (!TestAverage (code, average, secfilt, measure)) return (NO_MAG); 640 554 … … 728 642 } 729 643 730 /* determine the representative dophot type for this photcode */644 /* determine the representative dophot type for this photcode (must be PRI/SEC) */ 731 645 int DetermineTypeCode (Average *average, Measure *measure, int code) { 732 646 … … 785 699 } 786 700 701 /* test if this average object meets the specified selection criteria. 702 for photcode-dependent quantities, only test for PRI/SEC photcodes */ 787 703 int TestAverage (PhotCode *code, Average *average, SecFilt *secfilt, Measure *measure) { 788 704 789 int i, Nm, Type ;705 int i, Nm, Type, Select; 790 706 double fwhm, typefrac, dM, Xm; 791 707 792 /* exclusions based on average.params */ 793 if (ChiSelect) { 794 /* some average.params need a valid photcode for reference */ 795 if (code == NULL) return (FALSE); 796 Xm = PhotXm (code, average, secfilt); 797 if (Xm == -1) return (FALSE); 798 if (Xm > ChiLimit) return (FALSE); 799 } 800 801 /* for ErrSelect, check average errors */ 802 if (ErrSelect) { 803 if (code == NULL) return (FALSE); /* need a valid code */ 804 dM = iPhotdM (code, average, secfilt); 805 if (dM > ErrValue) return (NO_MAG); 806 } 807 708 if (!ApplySelections[SelectionParam]) return (TRUE); 709 808 710 /* pass objects with more than FWHMfrac points with FWHM above / below FWHMvalue */ 809 711 if (FWHMSelect) { … … 827 729 } 828 730 731 /* all selections below require a valid photcode */ 732 Select = ChiSelect || ErrSelect || NcodeSelect || NphotSelect || TypeSelect || TypefracSelect; 733 if (!Select) return (TRUE); 734 735 /* must have a valid code of some kind */ 736 if (code == NULL) return (FALSE); 737 738 /* only PRI/SEC photcodes apply the filter */ 739 if (code[0].type == PHOT_DEP) return (TRUE); 740 if (code[0].type == PHOT_REF) return (TRUE); 741 742 /* exclusions based on average.params */ 743 if (ChiSelect) { 744 Xm = PhotXm (code, average, secfilt); 745 if (Xm == -1) return (FALSE); 746 if (Xm > ChiLimit) return (FALSE); 747 } 748 749 /* for ErrSelect, check average errors */ 750 if (ErrSelect) { 751 dM = iPhotdM (code, average, secfilt); 752 if (dM > ErrValue) return (NO_MAG); 753 } 754 829 755 /* for NcodeSelect, count Nmeas for appropriate photcode */ 830 756 if (NcodeSelect) { … … 937 863 } 938 864 865 /* extract delta-mag pairs applying specified selections */ 939 866 double *ExtractDMag (PhotCode **code, int *mode, Average *average, SecFilt *secfilt, Measure *measure, int *nlist) { 940 867 941 int i, j, A1, A2, N1, N2, N list, NLIST;942 double *M1, *M2, *list ;943 944 /* check for special case of measure-measure */868 int i, j, A1, A2, N1, N2, Np, Nlist, NLIST; 869 double *M1, *M2, *list, NoMag; 870 871 /* check for special case of measure-measure - this is needed to drop self-matches */ 945 872 A1 = ((mode[0] == MAG_AVE) || (mode[0] == MAG_REF)); 946 873 A2 = ((mode[1] == MAG_AVE) || (mode[1] == MAG_REF)); … … 955 882 ALLOCATE (list, double, NLIST); 956 883 M1 = M2 = NULL; 884 NoMag = NO_MAG * 0.001; 957 885 958 886 /* one of the two is an average, must do independently */ … … 960 888 if (N1 == 0) goto skip; 961 889 890 Np = GetSelectionParam (); 891 SetSelectionParam (Np + 1); 962 892 M2 = ExtractMagnitudes (code[1], mode[1], average, secfilt, measure, &N2); 963 893 if (N2 == 0) goto skip; 964 894 965 /* average mags can return NO_MAG : skip them?*/895 /* magnitudes may be NO_MAG : set delta to NO_MAG */ 966 896 for (i = 0; i < N1; i++) { 967 897 for (j = 0; j < N2; j++) { 968 list[Nlist] = M1[i] - M2[j]; 898 if ((M1[i] == NoMag) || (M2[j] == NoMag)) { 899 list[Nlist] = NoMag; 900 } else { 901 list[Nlist] = M1[i] - M2[j]; 902 } 969 903 Nlist ++; 970 904 } 971 905 } 972 *nlist = Nlist;973 return (list);974 906 975 907 skip: 976 908 if (M1 != NULL) free (M1); 977 909 if (M2 != NULL) free (M2); 978 M1 = M2 = NULL;910 *nlist = Nlist; 979 911 return (list); 980 912 } 981 913 982 /* extract a list of delta-measure-mags from the specified average entry based on the pre-set selections */ 914 /* extract a list of delta-measure-mags from the specified average entry based on the 915 pre-set selections - does not return self-matched measurements */ 983 916 double *ExtractMeasuresDMag (PhotCode **code, int *mode, Average *average, SecFilt *secfilt, Measure *measure, int *nlist) { 984 917 985 int i, j, N list, NLIST;986 double *list, M1, M2, value ;918 int i, j, Np0, Np1, Nlist, NLIST; 919 double *list, M1, M2, value, NoMag; 987 920 988 921 *nlist = 0; … … 990 923 NLIST = MAX (1, average[0].Nm*average[0].Nm); 991 924 ALLOCATE (list, double, NLIST); 992 993 /* must have two code values */ 925 NoMag = NO_MAG * 0.001; 926 927 /* must have two code values - drop this test? this is programming case, not a user case */ 994 928 if (code == NULL) return (list); 995 929 if (code[0] == NULL) return (list); 996 930 if (code[1] == NULL) return (list); 997 931 998 /* exclude based on chisq for both codes */ 999 if (ChiSelect) { 1000 value = PhotXm (code[0], average, secfilt); 1001 if (value == -1) return (list); 1002 if (value > ChiLimit) return (list); 1003 value = PhotXm (code[1], average, secfilt); 1004 if (value == -1) return (list); 1005 if (value > ChiLimit) return (list); 1006 } 932 /* exclude based on average parameters for both codes */ 933 if (!TestAverage (code[0], average, secfilt, measure)) return (list); 934 if (!TestAverage (code[1], average, secfilt, measure)) return (list); 935 936 Np0 = GetSelectionParam (); 937 Np1 = Np0 + 1; 1007 938 1008 939 /* loop twice over all measures */ 1009 940 for (i = 0; i < average[0].Nm; i++) { 941 SetSelectionParam (Np0); 1010 942 TESTCODE (code[0], measure[i]); 1011 943 TESTMEASURE (measure[i]); … … 1013 945 for (j = 0; j < average[0].Nm; j++) { 1014 946 if (i == j) continue; 947 SetSelectionParam (Np1); 1015 948 TESTCODE (code[1], measure[j]); 1016 949 TESTMEASURE (measure[j]); 1017 950 SETMAG(M2, measure[j], mode[1]); 1018 list[Nlist] = M1 - M2; 951 if ((M1 == NoMag) || (M2 == NoMag)) { 952 list[Nlist] = NoMag; 953 } else { 954 list[Nlist] = M1 - M2; 955 } 1019 956 Nlist ++; 1020 957 } … … 1024 961 } 1025 962 963 /* extract a measurement list matching the number of dmag entries */ 1026 964 double *ExtractByDMag (PhotCode **code, int *mode, Average *average, SecFilt *secfilt, Measure *measure, int *nlist, int param) { 1027 965 … … 1037 975 } 1038 976 977 /* one of the two entries results in a single element. extract the other */ 1039 978 if (A1) { 1040 979 list = ExtractMeasures (code[1], mode[1], average, secfilt, measure, &N1, param); … … 1049 988 double *ExtractMeasuresByDMag (PhotCode **code, int *mode, int use_first, Average *average, SecFilt *secfilt, Measure *measure, int *nlist, int param) { 1050 989 1051 int i, j, k, m,n, Nlist, NLIST;990 int i, j, k, n, Nlist, NLIST; 1052 991 time_t t; 1053 992 int np, found; 1054 993 double *list, M1, M2, value; 1055 double ra, dec, x, y;1056 994 1057 995 *nlist = 0; … … 1082 1020 1083 1021 /* assign value */ 1084 value = 0; 1085 switch (param) { 1086 case MEAS_MAG: /* magnitudes are already determined above */ 1087 value = use_first ? M1 : M2; 1088 break; 1089 case MEAS_RA: /* OK */ 1090 value = average[0].R - measure[n].dR / 360000.0; 1091 break; 1092 case MEAS_DEC: /* OK */ 1093 value = average[0].D - measure[n].dD / 360000.0; 1094 break; 1095 case MEAS_dMAG: /* OK */ 1096 value = 0.001*measure[n].dM; 1097 break; 1098 case MEAS_AIRMASS: /* OK */ 1099 value = 0.001*measure[n].airmass; 1100 break; 1101 case MEAS_EXPTIME: /* OK */ 1102 value = pow (10.0, measure[n].dt * 0.0004); 1103 break; 1104 case MEAS_PHOTCODE: /* OK */ 1105 value = measure[n].source; 1106 break; 1107 case MEAS_TIME: /* OK */ 1108 value = TimeValue (measure[n].t, TimeReference, TimeFormat); 1109 break; 1110 case MEAS_dR: /* OK */ 1111 value = 0.01*measure[n].dR; 1112 break; 1113 case MEAS_dD: /* OK */ 1114 value = 0.01*measure[n].dD; 1115 break; 1116 case MEAS_FWHM: /* OK */ 1117 value = 0.01*measure[n].FWx; 1118 break; 1119 case MEAS_DOPHOT: /* OK */ 1120 value = measure[n].dophot; 1121 break; 1122 case MEAS_FLAGS: /* ? */ 1123 value = measure[n].flags; 1124 break; 1125 case MEAS_XCCD: /* OK */ 1126 ra = average[0].R - measure[n].dR / 360000.0; 1127 dec = average[0].D - measure[n].dD / 360000.0; 1128 m = match_image_subset (image, subset, Nsubset, measure[n].t, measure[n].source); 1129 if (m == -1) break; 1130 if (!FindMosaicForImage (image, Nimage, m)) break; 1131 RD_to_XY (&x, &y, ra, dec, &image[m].coords); 1132 value = x; 1133 break; 1134 case MEAS_YCCD: /* OK */ 1135 ra = average[0].R - measure[n].dR / 360000.0; 1136 dec = average[0].D - measure[n].dD / 360000.0; 1137 m = match_image_subset (image, subset, Nsubset, measure[n].t, measure[n].source); 1138 if (m == -1) break; 1139 if (!FindMosaicForImage (image, Nimage, m)) break; 1140 RD_to_XY (&x, &y, ra, dec, &image[m].coords); 1141 value = y; 1142 break; 1143 case MEAS_XMOSAIC: /* OK */ 1144 ra = average[0].R - measure[n].dR / 360000.0; 1145 dec = average[0].D - measure[n].dD / 360000.0; 1146 m = match_image_subset (image, subset, Nsubset, measure[n].t, measure[n].source); 1147 if (m == -1) break; 1148 mosaic.crval1 = image[m].coords.crval1; 1149 mosaic.crval2 = image[m].coords.crval2; 1150 RD_to_XY (&x, &y, ra, dec, &mosaic); 1151 value = x; 1152 break; 1153 case MEAS_YMOSAIC: /* OK */ 1154 ra = average[0].R - measure[n].dR / 360000.0; 1155 dec = average[0].D - measure[n].dD / 360000.0; 1156 m = match_image_subset (image, subset, Nsubset, measure[n].t, measure[n].source); 1157 if (m == -1) break; 1158 mosaic.crval1 = image[m].coords.crval1; 1159 mosaic.crval2 = image[m].coords.crval2; 1160 RD_to_XY (&x, &y, ra, dec, &mosaic); 1161 value = y; 1162 break; 1163 } 1164 list[Nlist] = value; 1022 list[Nlist] = GetMeasure (param, &average[0], &measure[n], (use_first ? M1 : M2)); 1165 1023 Nlist ++; 1166 1024 } … … 1170 1028 } 1171 1029 1030 double GetMeasure (int param, Average *average, Measure *measure, double mag) { 1031 1032 int m; 1033 double ra, dec, x, y; 1034 double value; 1035 Image *image; 1036 Coords *mosaic; 1037 1038 value = 0; 1039 switch (param) { 1040 case MEAS_MAG: /* magnitudes are already determined above */ 1041 value = mag; 1042 break; 1043 case MEAS_RA: /* OK */ 1044 value = average[0].R - measure[0].dR / 360000.0; 1045 break; 1046 case MEAS_DEC: /* OK */ 1047 value = average[0].D - measure[0].dD / 360000.0; 1048 break; 1049 case MEAS_dMAG: /* OK */ 1050 value = 0.001*measure[0].dM; 1051 break; 1052 case MEAS_AIRMASS: /* OK */ 1053 value = 0.001*measure[0].airmass; 1054 break; 1055 case MEAS_EXPTIME: /* OK */ 1056 value = pow (10.0, measure[0].dt * 0.0004); 1057 break; 1058 case MEAS_PHOTCODE: /* OK */ 1059 value = measure[0].source; 1060 break; 1061 case MEAS_TIME: /* OK */ 1062 value = TimeValue (measure[0].t, TimeReference, TimeFormat); 1063 break; 1064 case MEAS_dR: /* OK */ 1065 value = 0.01*measure[0].dR; 1066 break; 1067 case MEAS_dD: /* OK */ 1068 value = 0.01*measure[0].dD; 1069 break; 1070 case MEAS_FWHM: /* OK */ 1071 value = 0.01*measure[0].FWx; 1072 break; 1073 case MEAS_DOPHOT: /* OK */ 1074 value = measure[0].dophot; 1075 break; 1076 case MEAS_FLAGS: /* ? */ 1077 value = measure[0].flags; 1078 break; 1079 case MEAS_XCCD: /* OK */ 1080 ra = average[0].R - measure[0].dR / 360000.0; 1081 dec = average[0].D - measure[0].dD / 360000.0; 1082 image = MatchImage (measure[0].t, measure[0].source); 1083 if (image == NULL) break; 1084 RD_to_XY (&x, &y, ra, dec, &image[0].coords); 1085 value = x; 1086 break; 1087 case MEAS_YCCD: /* OK */ 1088 ra = average[0].R - measure[0].dR / 360000.0; 1089 dec = average[0].D - measure[0].dD / 360000.0; 1090 image = MatchImage (measure[0].t, measure[0].source); 1091 if (image == NULL) break; 1092 RD_to_XY (&x, &y, ra, dec, &image[0].coords); 1093 value = y; 1094 break; 1095 case MEAS_XMOSAIC: /* OK */ 1096 ra = average[0].R - measure[0].dR / 360000.0; 1097 dec = average[0].D - measure[0].dD / 360000.0; 1098 mosaic = MatchMosaic (measure[0].t, measure[0].source); 1099 if (mosaic == NULL) break; 1100 RD_to_XY (&x, &y, ra, dec, mosaic); 1101 value = x; 1102 break; 1103 case MEAS_YMOSAIC: /* OK */ 1104 ra = average[0].R - measure[0].dR / 360000.0; 1105 dec = average[0].D - measure[0].dD / 360000.0; 1106 mosaic = MatchMosaic (measure[0].t, measure[0].source); 1107 if (mosaic == NULL) break; 1108 RD_to_XY (&x, &y, ra, dec, mosaic); 1109 value = y; 1110 break; 1111 } 1112 return (value); 1113 } 1114 1115 /** the mosaic entries do not use the registered mosaic found 1116 by MatchImage (via FindMosaicForImage). Rather, they use 1117 a coordinate frame saved by SetImageSelection 1118 **/ -
trunk/Ohana/src/opihi/dvo/region_list.c
r3462 r4585 1 1 # include "dvo1.h" 2 3 static int RegionSelect; 4 5 int GetRegionSelection () { 6 return (RegionSelect); 7 } 8 9 int SetRegionSelection (int *argc, char **argv, char **RegionName, char **RegionList) { 10 11 int N; 12 13 RegionSelect = FALSE; 14 15 /* check for Region selection */ 16 *RegionName = NULL; 17 if (N = get_argument (*argc, argv, "-cpt")) { 18 remove_argument (N, argc, argv); 19 *RegionName = strcreate (argv[N]); 20 remove_argument (N, argc, argv); 21 return (TRUE); 22 } 23 /* check for Region list */ 24 *RegionList = NULL; 25 if (N = get_argument (*argc, argv, "-cptlist")) { 26 remove_argument (N, argc, argv); 27 *RegionList = strcreate (argv[N]); 28 remove_argument (N, argc, argv); 29 return (TRUE); 30 } 31 if ((*RegionName == NULL) && (*RegionList == NULL)) { 32 RegionSelect = TRUE; 33 return (TRUE); 34 } 35 36 fprintf (stderr, "-cpt and -cptlist are incompatible\n"); 37 free (*RegionName); 38 free (*RegionList); 39 *RegionName = NULL; 40 *RegionList = NULL; 41 return (FALSE); 42 } 43 44 RegionFile *SelectRegions (char *RegionName, char *RegionList, int *nregions) { 45 46 double Radius; 47 int Ngraph; 48 Graphdata graphsky; 49 RegionFile *regions; 50 51 /* determine region-file names */ 52 if (RegionName != NULL) { 53 *nregions = 1; 54 ALLOCATE (regions, RegionFile, 1); 55 strcpy (regions[0].name, RegionName); 56 free (RegionName); 57 RegionName = NULL; 58 return (regions); 59 } 60 if (RegionList != NULL) { 61 regions = region_list (RegionList, nregions); 62 free (RegionList); 63 RegionList = NULL; 64 return (regions); 65 } 66 67 Ngraph = 0; 68 if (!GetGraphData (&graphsky, NULL, &Ngraph)) { 69 fprintf (stderr, "region display not available\n"); 70 return (NULL); 71 } 72 73 Radius = MAX (fabs(graphsky.xmax), fabs(graphsky.ymax)); 74 regions = find_regions (graphsky.coords.crval1, graphsky.coords.crval2, Radius, nregions); 75 return (regions); 76 } 2 77 3 78 /* returns a list of region files names from file */ … … 12 87 fprintf (stderr, "ERROR: can't find region list file %s\n", filename); 13 88 *Nregions = 0; 14 return ( (RegionFile *)NULL);89 return (NULL); 15 90 } 16 91 … … 28 103 29 104 *Nregions = nregion; 30 31 105 return (regions); 32 33 106 } 34 107 -
trunk/Ohana/src/opihi/include/dvo1.h
r4420 r4585 40 40 41 41 /*** photometry functions ***/ 42 int SetPhotSelections PROTO((int *argc, char **argv)); 43 int SetImageSelection PROTO((int mode, Graphdata *graphsky, int state)); 44 void FreeImageSelection PROTO(()); 42 double *ExtractByDMag PROTO((PhotCode **code, int *mode, Average *average, SecFilt *secfilt, Measure *measure, int *nlist, int param)); 43 double *ExtractDMag PROTO((PhotCode **code, int *mode, Average *average, SecFilt *secfilt, Measure *measure, int *nlist)); 44 double *ExtractMagnitudes PROTO((PhotCode *code, int mode, Average *average, SecFilt *secfilt, Measure *measure, int *n)); 45 double *ExtractMeasures PROTO((PhotCode *code, int mode, Average *average, SecFilt *secfilt, Measure *measure, int *nlist, int param)); 46 double *ExtractMeasuresByDMag PROTO((PhotCode **code, int *mode, int use_first, Average *average, SecFilt *secfilt, Measure *measure, int *nlist, int param)); 47 double *ExtractMeasuresDMag PROTO((PhotCode **code, int *mode, Average *average, SecFilt *secfilt, Measure *measure, int *nlist)); 48 Image *MatchImage PROTO((unsigned int time, short int source)); 49 Coords *MatchMosaic PROTO((unsigned int time, short int source)); 50 int DetermineTypeCode PROTO((Average *average, Measure *measure, int code)); 51 double DetermineTypefrac PROTO((Average *average, Measure *measure, PhotCode *code)); 52 double ExtractAverages PROTO((PhotCode *code, int mode, Average *average, SecFilt *secfilt, Measure *measure, int param)); 53 void FreeImageSelection PROTO(()); 54 int GetAverageParam PROTO((char *parname)); 55 void GetAverageParamHelp PROTO(()); 56 int GetMagMode PROTO((char *string)); 57 double GetMeasure PROTO((int param, Average *average, Measure *measure, double mag)); 58 int GetMeasureParam PROTO((char *parname)); 59 int GetMeasureTypeCode PROTO((Measure *measure)); 60 int GetPhotcodeInfo PROTO((char *string, PhotCode **Code, int *Mode)); 61 int GetSelectionParam PROTO(()); 62 int InitPhotcodes PROTO(()); 63 int Quality PROTO((Measure *measure, int IsDophot)); 64 int SelectMags PROTO((int Nphot, int Tphot, int Ns, Average *average, Measure *measure, SecFilt *secfilt, int UL)); 65 int SetImageSelection PROTO((int mode)); 66 int SetPhotSelections PROTO((int *argc, char **argv, int Nparams)); 67 int SetSelectionParam PROTO((int param)); 68 int TestAverage PROTO((PhotCode *code, Average *average, SecFilt *secfilt, Measure *measure)); 69 int TestPhotSelections PROTO((PhotCode **code, int param)); 70 void print_value PROTO((FILE *f, double value, short int ival)); 45 71 46 int InitPhotcodes PROTO(()); 47 int GetPhotcodeInfo PROTO((char *string, PhotCode **Code, int *Mode)); 48 49 int GetAverageParam PROTO((char *parname)); 50 int GetMeasureParam PROTO((char *parname)); 51 int GetMagMode PROTO((char *string)); 52 int SelectMags PROTO((int Nphot, int Tphot, int Ns, Average *average, Measure *measure, SecFilt *secfilt, int UL)); 53 void print_value PROTO((FILE *f, double value, short int ival)); 54 int GetMeasureTypeCode PROTO((Measure *measure)); 55 int DetermineTypeCode PROTO((Average *average, Measure *measure, int Nphot)); 56 double ExtractAverages PROTO((PhotCode *code, int mode, Average *ave, SecFilt *sec, Measure *meas, int param)); 57 double *ExtractMagnitudes PROTO((PhotCode *code, int mode, Average *ave, SecFilt *sec, Measure *meas, int *n)); 58 double *ExtractMeasures PROTO((PhotCode *code, int mode, Average *ave, SecFilt *sec, Measure *meas, int *nlist, int param)); 59 double *ExtractDMag PROTO((PhotCode **code, int *mode, Average *average, SecFilt *secfilt, Measure *measure, int *nlist)); 60 double *ExtractMeasuresDMag PROTO((PhotCode **code, int *mode, Average *average, SecFilt *secfilt, Measure *measure, int *nlist)); 61 double *ExtractMeasuresByDMag PROTO((PhotCode **code, int *mode, int use_first, Average *average, SecFilt *secfilt, Measure *measure, int *nlist, int param)); 62 double DetermineTypefrac PROTO((Average *average, Measure *measure, PhotCode *code)); 63 void GetAverageParamHelp PROTO(()); 64 72 RegionFile *SelectRegions PROTO((char *RegionName, char *RegionList, int *nregions)); 65 73 66 74 # endif
Note:
See TracChangeset
for help on using the changeset viewer.
