- Timestamp:
- Apr 4, 2010, 9:54:36 AM (16 years ago)
- Location:
- trunk/Ohana/src/opihi
- Files:
-
- 2 added
- 7 edited
-
dvo/Makefile (modified) (2 diffs)
-
dvo/avextract.c (modified) (1 diff)
-
dvo/avmatch.c (added)
-
dvo/dbCmdlineFields.c (modified) (1 diff)
-
dvo/find_matches.c (added)
-
dvo/init.c (modified) (2 diffs)
-
dvo/mextract.c (modified) (1 diff)
-
dvo/skyregion.c (modified) (1 diff)
-
include/dvoshell.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/dvo/Makefile
r27435 r27594 28 28 $(SRC)/dvomisc.$(ARCH).o \ 29 29 $(SRC)/region_list.$(ARCH).o \ 30 $(SRC)/find_matches.$(ARCH).o \ 30 31 $(SRC)/photometry.$(ARCH).o \ 31 32 $(SRC)/dbBooleanCond.$(ARCH).o \ … … 43 44 cmds = \ 44 45 $(SRC)/avextract.$(ARCH).o \ 46 $(SRC)/avmatch.$(ARCH).o \ 45 47 $(SRC)/badimages.$(ARCH).o \ 46 48 $(SRC)/calextract.$(ARCH).o \ -
trunk/Ohana/src/opihi/dvo/avextract.c
r27587 r27594 182 182 183 183 if ((argc > N + 1) && !strcasecmp (argv[N+1], "fields")) { 184 gprint (GP_ERR, " USAGE: avextract field[,field,field...] where (expression)\n");185 184 gprint (GP_ERR, " RA : right ascension (J2000) [degrees]\n"); 186 185 gprint (GP_ERR, " DEC : declination [degrees]\n"); -
trunk/Ohana/src/opihi/dvo/dbCmdlineFields.c
r27491 r27594 57 57 status = FALSE; 58 58 59 // examine each argv[i] entry until we reach a 'where' or a 'matched'59 // examine each argv[i] entry until we reach a 'where', a 'matched', or the end of the line 60 60 for (i = 1; (i < argc) && strcasecmp (argv[i], "where") && strcasecmp (argv[i], "match"); i++) { 61 61 // split the word by "," -
trunk/Ohana/src/opihi/dvo/init.c
r25757 r27594 2 2 3 3 int avextract PROTO((int, char **)); 4 int avmatch PROTO((int, char **)); 4 5 int badimages PROTO((int, char **)); 5 6 int calextract PROTO((int, char **)); … … 55 56 static Command cmds[] = { 56 57 {1, "avextract", avextract, "extract average data values"}, 58 {1, "avmatch", avmatch, "extract average data values matched to RA,DEC points"}, 57 59 {1, "badimages", badimages, "look for images with anomalous astrometry"}, 58 60 {1, "calextract", calextract, "extract photometry calibration"}, -
trunk/Ohana/src/opihi/dvo/mextract.c
r27587 r27594 202 202 203 203 if ((argc > N + 1) && !strcasecmp (argv[N+1], "fields")) { 204 gprint (GP_ERR, " USAGE: avextract field[,field,field...] where (expression)\n");205 204 gprint (GP_ERR, " RA : right ascension (J2000) for detection [degrees]\n"); 206 205 gprint (GP_ERR, " DEC : declination for detection [degrees]\n"); -
trunk/Ohana/src/opihi/dvo/skyregion.c
r14402 r27594 44 44 return TRUE; 45 45 } 46 47 /* find region which overlaps c at given depth (-1 : populated ) */ 48 int SkyRegionByPoint_r (SkyTable *table, SkyList *list, int depth, double ra, double dec) { 49 50 int i, Ns, Ne, No; 51 SkyRegion *skyregion; 52 53 list[0].Nregions = 0; 54 list[0].ownElements = FALSE; // this list is only holding a view to the elements 55 56 skyregion = table[0].regions; 57 58 Ns = 0; 59 Ne = 1; 60 61 while (1) { 62 No = -1; 63 for (i = Ns; (i < Ne) && (i < table[0].Nregions); i++) { 64 if (ra < skyregion[i].Rmin) continue; 65 if (ra > skyregion[i].Rmax) continue; 66 if (dec < skyregion[i].Dmin) continue; 67 if (dec > skyregion[i].Dmax) continue; 68 No = i; 69 break; 70 } 71 if (No == -1) return (FALSE); 72 if ((depth == -1) && (skyregion[No].table)) break; 73 if (depth == skyregion[No].depth) break; 74 if ((depth > skyregion[No].depth) && !skyregion[No].child) return (FALSE); 75 76 /* need to check Ns, Ne, or guarantee valid range */ 77 Ns = skyregion[No].childS; 78 Ne = skyregion[No].childE; 79 } 80 81 list[0].regions[0] = &skyregion[No]; 82 list[0].filename[0] = table[0].filename[No]; 83 list[0].Nregions = 1; 84 return (TRUE); 85 } 86 87 SkyList *SelectRegionsByCoordVectors (Vector *RA, Vector *DEC) { 88 89 int i, j, Npts, Nout, NOUT, *found; 90 double ra, dec; 91 SkyList *new, *list; 92 SkyTable *sky; 93 94 sky = GetSkyTable (); 95 96 Npts = RA->Nelements; 97 ALLOCATE (found, int, Npts); 98 memset (found, 0, Npts*sizeof(int)); 99 100 ALLOCATE (new, SkyList, 1); 101 ALLOCATE (new[0].regions, SkyRegion *, 1); 102 ALLOCATE (new[0].filename, char *, 1); 103 104 // output list 105 Nout = 0; 106 NOUT = 100; 107 ALLOCATE (list, SkyList, 1); 108 ALLOCATE (list[0].regions, SkyRegion *, NOUT); 109 ALLOCATE (list[0].filename, char *, NOUT); 110 list[0].Nregions = 0; 111 list[0].ownElements = FALSE; // this list is only holding a view to the elements 112 113 for (i = 0; i < Npts; i++) { 114 if (found[i]) continue; 115 116 SkyRegionByPoint_r (sky, new, -1, RA->elements.Flt[i], DEC->elements.Flt[i]); 117 if (new->Nregions == 0) continue; 118 assert (new->Nregions == 1); 119 // append new region to output list 120 list[0].regions[Nout] = new[0].regions[0]; 121 list[0].filename[Nout] = new[0].filename[0]; 122 Nout ++; 123 if (Nout >= NOUT) { 124 NOUT += 100; 125 REALLOCATE (list[0].regions, SkyRegion *, NOUT); 126 REALLOCATE (list[0].filename, char *, NOUT); 127 } 128 found[i] = TRUE; 129 130 // scan over the remaining points to find any that lie within this region 131 // if we sorted the ra,dec inputs we could break out of this more quickly 132 for (j = i + 1; j < Npts; j++) { 133 ra = RA->elements.Flt[j]; 134 dec = DEC->elements.Flt[j]; 135 if (ra < new[0].regions[0][0].Rmin) continue; 136 if (ra > new[0].regions[0][0].Rmax) continue; 137 if (dec < new[0].regions[0][0].Dmin) continue; 138 if (dec > new[0].regions[0][0].Dmax) continue; 139 found[j] = TRUE; 140 } 141 } 142 143 free (found); 144 SkyListFree (new); 145 146 return (list); 147 } 148 -
trunk/Ohana/src/opihi/include/dvoshell.h
r27587 r27594 314 314 SkyRegionSelection *SetRegionSelection PROTO((int *argc, char **argv)); 315 315 316 int SkyRegionByPoint_r PROTO((SkyTable *table, SkyList *list, int depth, double ra, double dec)); 317 SkyList *SelectRegionsByCoordVectors PROTO((Vector *RA, Vector *DEC)); 318 319 int find_matches_by_vectors PROTO((SkyRegion *region, Catalog *catalog, Vector *RAvec, Vector *DECvec, float RADIUS, off_t *index)); 320 316 321 int SetImageSelection PROTO((int mode, SkyRegionSelection *selection)); 317 322 int SetPhotSelections PROTO((int *argc, char **argv, int Nparams));
Note:
See TracChangeset
for help on using the changeset viewer.
