Changeset 5439
- Timestamp:
- Oct 21, 2005, 5:53:44 PM (21 years ago)
- Location:
- trunk/Ohana/src
- Files:
-
- 7 edited
-
addstar/doc/notes.txt (modified) (2 diffs)
-
libautocode/Makefile (modified) (2 diffs)
-
libdvo/Makefile (modified) (1 diff)
-
opihi/dvo/find_regions.c (modified) (1 diff)
-
opihi/dvo2/Makefile (modified) (2 diffs)
-
opihi/dvo2/skydbsearch.c (modified) (1 diff)
-
opihi/include/dvo2.h (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/addstar/doc/notes.txt
r5397 r5439 1 1 2 todo goals: 2 todo: 3 4 * sky db tools 5 * parallel servers 6 * threaded addstard 7 * dvo_load daemon 8 * getstar (program and c-client) 9 * parallal / proper-motion data 10 * other additional Average / Measure columns 11 * deal with Myyyy as sky value 12 * better way to interpret flips header info for sky? 13 * fix unlink empty file problem 14 * programs like relphot and dvo need to be provided 15 with sorted measure tables; add this as a feature 16 of the load_catalog API? 17 18 done: 3 19 4 20 o move addstar/gstars to AddstarClientOptions … … 9 25 o address the cat & ref modes in client/server 10 26 o add airmass quality to options 11 12 * deal with Myyyy as sky value13 * better way to interpret flips header info for sky?14 * fix unlink empty file problem15 * programs like relphot and dvo need to be provided16 with sorted measure tables; add this as a feature17 of the load_catalog API?18 27 19 28 2005.10.19 -
trunk/Ohana/src/libautocode/Makefile
r5345 r5439 51 51 $(SRC)/Stars.$(ARCH).o \ 52 52 $(SRC)/GSCRegion.$(ARCH).o \ 53 $(SRC)/AddstarClientOptions.$(ARCH).o 53 $(SRC)/AddstarClientOptions.$(ARCH).o \ 54 $(SRC)/SkyRegion.$(ARCH).o 54 55 55 56 LIBINC = \ … … 82 83 $(INC)/Stars.h \ 83 84 $(INC)/GSCRegion.h \ 84 $(INC)/AddstarClientOptions.h 85 $(INC)/AddstarClientOptions.h \ 86 $(INC)/SkyRegion.h 85 87 86 88 objects: $(LIBOBJ) -
trunk/Ohana/src/libdvo/Makefile
r5346 r5439 71 71 $(ASRC)/Stars.$(ARCH).o \ 72 72 $(ASRC)/GSCRegion.$(ARCH).o \ 73 $(ASRC)/AddstarClientOptions.$(ARCH).o 73 $(ASRC)/AddstarClientOptions.$(ARCH).o \ 74 $(ASRC)/SkyRegion.$(ARCH).o 74 75 75 76 ACOM = $(ADEF)/autocode.c $(ADEF)/autocode.h $(ADEF)/common.h -
trunk/Ohana/src/opihi/dvo/find_regions.c
r4689 r5439 15 15 int NLINES, done, NREGIONS, nregion; 16 16 17 VarConfig (" GSCFILE", "%s", filename);17 VarConfig ("SKYFILE", "%s", filename); 18 18 f = fopen (filename, "r"); 19 19 if (f == NULL) { -
trunk/Ohana/src/opihi/dvo2/Makefile
r5242 r5439 17 17 INCS = -I$(INC) -I$(LINC) -I$(XINC) 18 18 LFLAGS = -L$(LLIB) -L$(LIB) 19 LIBS1 = -lsocket -lnsl -lreadline -ltermcap -l FITS -lohana -lm19 LIBS1 = -lsocket -lnsl -lreadline -ltermcap -ldvo -lFITS -lohana -lm 20 20 LIBS2 = -lbasiccmd -ldatacmd -lastrocmd -lshell -ldata 21 21 LIBS = $(LIBS2) $(LIBS1) … … 47 47 install: $(DESTBIN)/dvo2 48 48 49 # utilities ################################################# 50 $(BIN)/%.$(ARCH): 51 @if [ ! -d $(BIN) ]; then mkdir -p $(BIN); fi 52 $(CC) $^ -o $@ $(LFLAGS) $(LIBS) 53 @echo "compiled $*" 54 @echo "" 49 mkst = \ 50 $(SDIR)/mkskytable.$(ARCH).o \ 51 $(SDIR)/skydbutils.$(ARCH).o 55 52 56 $(DESTBIN)/%: $(BIN)/%.$(ARCH) 57 @if [ ! -d $(DESTBIN) ]; then mkdir -p $(DESTBIN); fi 58 rm -f $(DESTBIN)/$* 59 cp $(BIN)/$*.$(ARCH) $(DESTBIN)/$* 60 @echo "installed $*" 61 @echo "" 53 $(BIN)/mkskytable.$(ARCH): $(mkst) 54 mkskytable: $(BIN)/mkskytable.$(ARCH) 55 mkskytable.install: $(DESTBIN)/mkskytable 62 56 63 $(LIB)/%.$(ARCH).a: 64 @if [ ! -d $(LIB) ]; then mkdir -p $(LIB); fi 65 rm -f $@ 66 ar rcv $@ $^ 67 $(RANLIB) $@ 68 @echo "compiled library $*" 69 @echo "" 57 .PHONY: dvo 58 .PHONY: mkskytable 70 59 71 $(DESTLIB)/%.a: $(LIB)/%.$(ARCH).a 72 @if [ ! -d $(DESTLIB) ]; then mkdir -p $(DESTLIB); fi 73 @echo "" 74 rm -f $@ 75 cp $^ $@ 76 77 clean: 78 rm -f $(BIN)/*.$(ARCH) 79 rm -f $(LIB)/*.$(ARCH).a 80 rm -f `find . -name "*.o"` 81 rm -f `find . -name "*~"` 82 rm -f `find . -name "#*"` 83 84 dist: clean 85 rm -f $(BIN)/* 86 rm -f $(LIB)/* 87 88 lib%.clean: 89 rm -f $(LIB)/lib$*.$(ARCH).a 90 rm -f $($*) 91 @echo "" 92 93 %.clean: 94 rm -f $(BIN)/$*.$(ARCH) 95 @echo "" 96 97 %.$(ARCH).o : %.c 98 $(CC) $(CFLAGS) -c $*.c -o $@ 60 include ../Makefile.Common 99 61 100 62 101 102 ## -*- makefile -*-103 # deprecated functions: verify & delete104 #$(SDIR)/abszero.$(ARCH).o \105 #$(SDIR)/cals.$(ARCH).o \106 #$(SDIR)/dumpmags.$(ARCH).o \107 #$(SDIR)/extract.$(ARCH).o \108 #$(SDIR)/gtypes.$(ARCH).o \109 #$(SDIR)/photresid.$(ARCH).o \110 #$(SDIR)/resid.$(ARCH).o \111 #$(SDIR)/zeropts.$(ARCH).o112 #$(SDIR)/objload.$(ARCH).o \ - make sure we have vect to tv113 #$(SDIR)/ccdextract.$(ARCH).o \114 #$(SDIR)/cmdextract.$(ARCH).o \115 #$(SDIR)/dmagextract.$(ARCH).o \116 #$(SDIR)/ddmagextract.$(ARCH).o \117 118 # future functions, not fully implemented119 #$(SDIR)/detrend.$(ARCH).o \120 #$(SDIR)/getxtra.$(ARCH).o \121 #$(SDIR)/addxtra.$(ARCH).o \122 123 # functions that need to be updated124 #$(SDIR)/gregions.$(ARCH).o \125 -
trunk/Ohana/src/opihi/dvo2/skydbsearch.c
r5438 r5439 181 181 } 182 182 183 SkyRegion *SkyBuildTable (SkyRegion *seed, int Nseed, int level, int depth) {184 185 /* given a table of Rmin, Dmin, Rmax, Dmax, name, at level 3, generate186 all higher levels and 'depth' extra levels */187 188 /* levels:189 0 - fullsky.cpt190 1 - n????.cpt, s????.cpt191 2 - r????.cpt192 3 - ????.cpt193 4 - ????.??.cpt194 */195 196 SkyRegion *db;197 198 /* allocate at least 30 for levels 0 & 1 */199 NREGION = 100;200 ALLOCATE (db, SkyRegion, NREGION);201 202 /* full sky */203 strcpy (region[0].name, "fullsky.cpt");204 region[0].Rmin = 0; region[0].Rmax = 360;205 region[0].Dmin = -90; region[0].Dmax = 90;206 region[0].depth = 0;207 region[0].child = FALSE;208 N = 1;209 210 region[0].childS = N;211 /* north dec bands */212 for (dec = 0; dec < 90; dec += 7.5) {213 sprintf (region[N].name, "n%04d.cpt", (int) 100*dec);214 region[N].Rmin = 0; region[N].Rmax = 360;215 region[N].Dmin = dec; region[N].Dmax = dec + 7.5;216 region[N].depth = 1;217 region[N].child = FALSE;218 N++;219 }220 /* south dec bands */221 for (dec = 0; dec > -90; dec -= 7.5) {222 sprintf (region[N].name, "s%04d.cpt", (int) 100*dec);223 region[N].Rmin = 0; region[N].Rmax = 360;224 region[N].Dmin = dec - 7.5; region[N].Dmax = dec;225 region[N].depth = 1;226 region[N].child = FALSE;227 N++;228 }229 region[0].childE = N;230 231 /* subdivide dec bands based on seed */232 Rnumber = 0;233 childS = region[0].childS;234 childE = region[0].childE;235 for (i = childS; i < childE; i++) {236 237 Nnew = 0;238 NNEW = 100;239 ALLOCATE (new, SkyRegion, NNEW);240 241 for (j = 0; j < Nseed; j++) {242 /* skip seeds outside of parent bound */243 if (seed[j].Rmin > region[i].Rmax) continue;244 if (seed[j].Rmax < region[i].Rmin) continue;245 if (seed[j].Dmin > region[i].Dmax) continue;246 if (seed[j].Dmax < region[i].Dmin) continue;247 248 for (k = 0; k < Nnew; k++) {249 if ((seed[j].Rmin == new[k].Rmin) &&250 (seed[j].Rmax == new[k].Rmax)) {251 goto next_seed;252 }253 if ((seed[j].Rmin == new[k].Rmin) ^^254 (seed[j].Rmax != new[k].Rmax)) {255 fprintf (stderr, "inconsistent blocks in seed file\n");256 return (NULL);257 }258 }259 /* new region spans full DEC band. */260 new[Nnew].Dmin = region[i].Dmin;261 new[Nnew].Dmax = region[i].Dmax;262 263 Ntall = (region[i].Dmax - region[i].Dmin) / (seed[j].Dmax - seed[j].Dmin);264 265 /* fi266 267 new[Nnew].Rmin = seed[j].Rmin;268 new[Nnew].Rmax = seed[j].Rmax;269 new[Nnew].depth = 2;270 new[Nnew].child = FALSE;271 strncpy (root, region[i].name, 5); root[5] = 0;272 sprintf (new[Nnew].name, "%s/r%04d.cpt", root, Rnumber);273 Rnumber ++;274 Nnew ++;275 if (Nnew == NNEW) {276 NNEW += 100;277 REALLOCATE (new, SkyRegion, NNEW);278 }279 next_seed:280 }281 /* update db list */282 region[i].childS = N;283 region[i].childE = N + Nnew;284 NREGION = N + Nnew + 100;285 REALLOCATE (db, SkyRegion, NREGION);286 memcpy (®ion[N], new, Nnew*sizeof(SkyRegion));287 free (new);288 N += Nnew;289 }290 291 /* subdivide ra strips based on seed */292 childS = region[region[0].childS].childS;293 childE = region[region[0].childE - 1].childE;294 nextS = N;295 for (i = childS; i < childE; i++) {296 297 Nnew = 0;298 NNEW = 100;299 ALLOCATE (new, SkyRegion, NNEW);300 301 for (j = 0; j < Nseed; j++) {302 if (seed[j].Rmin > region[i].Rmax) continue;303 if (seed[j].Rmax < region[i].Rmin) continue;304 if (seed[j].Dmin > region[i].Dmax) continue;305 if (seed[j].Dmax < region[i].Dmin) continue;306 307 for (k = 0; k < Nnew; k++) {308 if ((seed[j].Dmin == new[k].Dmin) &&309 (seed[j].Dmax == new[k].Dmax)) {310 goto next_seed;311 }312 if ((seed[j].Dmin == new[k].Dmin) ^^313 (seed[j].Dmax != new[k].Dmax)) {314 fprintf (stderr, "inconsistent blocks in seed file\n");315 return (NULL);316 }317 }318 new[Nnew].Dmin = seed[j].Dmin;319 new[Nnew].Dmax = seed[j].Dmax;320 new[Nnew].Rmin = region[i].Rmin;321 new[Nnew].Rmax = region[i].Rmax;322 new[Nnew].depth = 3;323 new[Nnew].child = FALSE;324 strcpy (new[Nnew].name, seed[j].name);325 Nnew ++;326 if (Nnew == NNEW) {327 NNEW += 100;328 REALLOCATE (new, SkyRegion, NNEW);329 }330 next_seed:331 }332 333 /* update db list */334 region[i].childS = N;335 region[i].childE = N + Nnew;336 NREGION = N + Nnew + 100;337 REALLOCATE (db, SkyRegion, NREGION);338 memcpy (®ion[N], new, Nnew*sizeof(SkyRegion));339 free (new);340 N += Nnew;341 }342 nextE = N;343 344 /* subdivide entries once more */345 childS = nextS;346 childE = nextE;347 for (i = childS; i < childE; i++) {348 Rnumber = 0;349 region[i].childS = N;350 dDec = (region[i].Dmax - region[i].Dmin) / 5.0;351 dRa = (region[i].Rmax - region[i].Rmin) / 5.0;352 for (nx = 0; nx < 5; nx++) {353 for (ny = 0; ny < 5; ny++) {354 region[N].Dmin = region[i].Dmin + dDec * (nx + 0);355 region[N].Dmax = region[i].Dmax + dDec * (nx + 1);356 region[N].Rmin = region[i].Rmin + dDec * (nx + 0);357 region[N].Rmax = region[i].Rmax + dDec * (nx + 1);358 region[N].depth = 3;359 region[N].child = FALSE;360 strncpy (root, region[i].name, 10); root[10] = 0;361 sprintf (region[N].name, "%s.%02d.cpt", root, Rnumber);362 Rnumber ++;363 N ++;364 if (N == NREGION) {365 NREGION += 100;366 REALLOCATE (new, SkyRegion, NREGION);367 }368 }369 }370 }371 372 }373 374 183 /* region is pointer to entry in db */ 375 184 SkyRegion *SkyExtend (SkyRegion *db, SkyRegion *region) { -
trunk/Ohana/src/opihi/include/dvo2.h
r5438 r5439 1 # include "external.h" 2 # include "shell.h" 3 # include "dvomath.h" 4 # include "convert.h" 5 # include "display.h" 6 # include "data.h" 1 # include "astro.h" 7 2 8 3 # ifndef DVO2_H … … 23 18 } SkyRegionList; 24 19 20 # if (0) 25 21 typedef struct { 26 22 float Rmin, Rmax; … … 31 27 char name[24]; 32 28 } SkyRegion; /* 48 bytes */ 29 # endif 33 30 34 31 SkyRegion *SkyFindPoint (SkyRegion *db, SkyCoord c, int depth); … … 36 33 SkyRegion **SkyFindArea (SkyRegion *db, SkyCoord c1, SkyCoord c2, int *nlist); 37 34 SkyRegion *SkyFindAreaDB (SkyRegion *db, SkyRegion *ref, SkyCoord c1, SkyCoord c2, int *Nregion); 38 SkyRegion *SkyBuildTable (SkyRegion *seed, int Nseed, int level, int depth);39 35 40 36 SkyRegion *SkyMakeRegions (int Nlevels, int *nlist); … … 43 39 SkyRegion *SkyDivide (SkyRegion *in); 44 40 41 SkyRegionTable *SkyBuildTable (SkyRegion *seed, int Nseed); 42 SkyRegion *SkyRegionsFromGSC (char *filename, int *nregions); 43 int FindDecBand (double dec, double *DEC0, double *DEC1); 44 45 45 # endif
Note:
See TracChangeset
for help on using the changeset viewer.
