Changeset 31635 for trunk/Ohana/src/relastro
- Timestamp:
- Jun 16, 2011, 11:18:00 AM (15 years ago)
- Location:
- trunk/Ohana/src/relastro
- Files:
-
- 1 added
- 8 edited
-
Makefile (modified) (1 diff)
-
include/relastro.h (modified) (2 diffs)
-
src/ConfigInit.c (modified) (1 diff)
-
src/args.c (modified) (1 diff)
-
src/high_speed_catalogs.c (modified) (2 diffs)
-
src/high_speed_objects.c (modified) (14 diffs)
-
src/high_speed_utils.c (added)
-
src/initialize.c (modified) (2 diffs)
-
src/relastroVisual.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/relastro/Makefile
r29001 r31635 61 61 $(SRC)/high_speed_catalogs.$(ARCH).o \ 62 62 $(SRC)/high_speed_objects.$(ARCH).o \ 63 $(SRC)/high_speed_utils.$(ARCH).o \ 63 64 $(SRC)/relastroVisual.$(ARCH).o 64 65 -
trunk/Ohana/src/relastro/include/relastro.h
r31160 r31635 131 131 int NphotcodesGroupA, NphotcodesGroupB; 132 132 PhotCode **photcodesGroupA, **photcodesGroupB; 133 char WHERE_A[10000], WHERE_B[10000]; 134 SkyRegionSelection SELECTION; 133 135 134 136 int AreaSelect; … … 361 363 362 364 int GetScatterRawRef(float *dLsig, float *dMsig, float *dRsig, int *nKeep, StarData *raw, StarData *ref, int Nstars, float SigmaLimit); 365 366 int initializeConstraints(); 367 int applyConstraintsA(); 368 int applyConstraintsB(); 369 void setupAreaSelection(SkyRegion *region); 370 -
trunk/Ohana/src/relastro/src/ConfigInit.c
r30616 r31635 48 48 ScanConfig(config, "PHOTCODE_FILE", "%s", 0, MasterPhotcodeFile); 49 49 50 // Defaults for WHERE_A are established in db_utils.c: intializeConstraints 51 ScanConfig(config, "WHERE_A", "%s", 0, WHERE_A); 52 ScanConfig(config, "WHERE_B", "%s", 0, WHERE_B); 53 50 54 sprintf (ImageCat, "%s/Images.dat", CATDIR); 51 55 -
trunk/Ohana/src/relastro/src/args.c
r31160 r31635 307 307 fprintf (stderr, " -update-chips\n"); 308 308 fprintf (stderr, " -update-mosaics\n"); 309 fprintf (stderr, " -high-speed (code[,code,code]) (code[,code,code]) (radius) \n\n");309 fprintf (stderr, " -high-speed (code[,code,code]) (code[,code,code]) (radius) (whereA) (whereB) (output catdir)\n\n"); 310 310 fprintf (stderr, " additional options: \n"); 311 311 fprintf (stderr, " -time (start)(stop)\n"); -
trunk/Ohana/src/relastro/src/high_speed_catalogs.c
r31602 r31635 9 9 Catalog catalog; 10 10 11 // tell libdvo the CATDIR 12 dvo_set_catdir(CATDIR); 13 11 14 // load the current sky table (layout of all SkyRegions) 12 15 sky = SkyTableLoadOptimal (CATDIR, SKY_TABLE, GSCFILE, FALSE, SKY_DEPTH, VERBOSE); … … 16 19 if (UserCatalog) { 17 20 skylist = SkyRegionByPoint (sky, -1, UserCatalogRA, UserCatalogDEC); 21 setupAreaSelection(skylist->regions[0]); 18 22 } else { 19 23 skylist = SkyListByPatch (sky, -1, &UserPatch); 24 setupAreaSelection(&UserPatch); 20 25 } 26 27 initializeConstraints(); 21 28 22 29 // load data from each region file, only use bright stars -
trunk/Ohana/src/relastro/src/high_speed_objects.c
r31160 r31635 4 4 # define NEXT_J { j++; continue; } 5 5 6 // XXX these were used to spot-check specific objects7 # define REF_RA1 192.4557818 # define REF_DEC1 2.5631029 # define REF_RA2 192.44430211310 # define REF_DEC2 2.578655911211 6 int high_speed_objects (SkyRegion *region, Catalog *catalog) { 12 7 … … 14 9 15 10 off_t i, j, m, J, ni, nj, *N1, Nslow, Ninvalid, NgroupA, NgroupB, NgroupAbad, NgroupBbad,l,i1,Noff,Nmeasure,Naverage, NAVERAGE, NMEASURE; 16 int *slowMoving, *groupA, *groupB, status, foundA, foundB, Nmatch, valid,Nmatchmeas,Nepoch,nv[2],Nmatchmeasobj; 11 int *slowMoving, *groupA, *groupB, status, Nmatch, Nmatchmeas,Nepoch,nv[2],Nmatchmeasobj; 12 int foundA, foundB; 17 13 double *X1, *Y1; 18 14 double dX, dY, dR, RADIUS2; … … 20 16 Catalog catalog1; 21 17 22 int zcode, zNsec, ycode, yNsec, jcode, jNsec, hcode, hNsec, kcode, kNsec, USNO_R, USNO_N,Nsecfilt;18 int Nsecfilt; 23 19 char filename[1024]; 24 20 Noff = strlen(CATDIR); 25 sprintf (filename, "%s /%s", HIGH_SPEED_DIR, &catalog[0].filename[Noff]);26 printf("%s\n",filename);21 sprintf (filename, "%s%s", HIGH_SPEED_DIR, &catalog[0].filename[Noff]); 22 fprintf(stderr, "%s\n",filename); 27 23 dvo_catalog_init(&catalog1, TRUE); /*initialise new catalogue*/ 28 24 catalog1.filename = strcreate(filename); … … 33 29 Naverage=catalog[0].Naverage; 34 30 Nmeasure=catalog[0].Nmeasure; 35 // ALLOCATE (catalog1.average, Average,Naverage);36 // ALLOCATE (catalog1.measure, Measure,Nmeasure);37 // ALLOCATE(catalog1.secfilt, SecFilt,catalog[0].Naverage*Nsecfilt);38 31 catalog1.filename = filename; // based on the input name, need to keep everything below the catdir portion 39 32 catalog1.Nsecfilt = Nsecfilt; … … 56 49 REALLOCATE(catalog1.secfilt, SecFilt, NAVERAGE*Nsecfilt); 57 50 58 ycode = GetPhotcodeCodebyName("y");59 yNsec = GetPhotcodeNsec(ycode);60 61 zcode = GetPhotcodeCodebyName("z");62 zNsec = GetPhotcodeNsec(zcode);63 64 jcode = GetPhotcodeCodebyName("J");65 jNsec = GetPhotcodeNsec(jcode);66 67 hcode = GetPhotcodeCodebyName("H");68 hNsec = GetPhotcodeNsec(hcode);69 70 kcode = GetPhotcodeCodebyName("K");71 kNsec = GetPhotcodeNsec(kcode);72 73 USNO_R = GetPhotcodeCodebyName("USNO_RED");74 USNO_N = GetPhotcodeCodebyName("USNO_N");75 76 51 // high-speed between different surveys (easier case): 77 52 // we have two sets of photcodes (A) and (B) and are looking for objects … … 94 69 memset (groupB, 0, catalog[0].Naverage*sizeof(int)); 95 70 96 fprintf (stderr, "checking "OFF_T_FMT" objects\n", catalog[0].Naverage);71 if (VERBOSE) fprintf (stderr, "checking "OFF_T_FMT" objects\n", catalog[0].Naverage); 97 72 Nslow = 0; 98 73 Ninvalid = 0; … … 100 75 NgroupBbad = 0; 101 76 102 fprintf (stdout, "# RA_A DEC_A RA_B DEC_B : pmx pmy dR dt: z dz y dy J dJ H dH K dK\n");103 //................270.2346670 20.2471540 270.2170434 20.2717396 : -59.11 88.78 106.66 : 0.000 0.000 19.582 0.112 16.041 0.110 15.388 0.098 14.858 0.001104 105 77 // mark (exclude) objects with both sets of target photcodes 106 78 for (i = 0; i < catalog[0].Naverage; i++) { 107 108 // if (i % 100 == 0) fprintf (stderr, ".");109 110 // radius = hypot((REF_DEC1 - catalog[0].average[i].D), (REF_RA1 - catalog[0].average[i].R));111 // if (radius < 0.0001) {112 // fprintf (stderr, "found it\n");113 // }114 // radius = hypot((REF_DEC2 - catalog[0].average[i].D), (REF_RA2 - catalog[0].average[i].R));115 // if (radius < 0.0001) {116 // fprintf (stderr, "found it\n");117 // }118 119 79 // do any of the measures for this object match group A? 120 80 m = catalog[0].average[i].measureOffset; … … 132 92 for (j = 0; !foundB && (j < catalog[0].average[i].Nmeasure); j++, m++) { 133 93 134 135 94 if (MeasMatchesPhotcode(&catalog[0].measure[m], photcodesGroupB, NphotcodesGroupB)) { 136 95 foundB = TRUE; … … 138 97 } 139 98 99 // object found in both - mark as slow moving 140 100 if (foundA && foundB) { 141 101 slowMoving[i] = TRUE; … … 144 104 } 145 105 146 // additional constraints: 147 // * group A : require 148 149 // 2MASS detections: 106 // Apply additional constraints: 150 107 if (foundA && !foundB) { 151 // average-based tests: 152 153 154 valid = TRUE; 155 valid &= ((catalog[0].average[i].flags & 0x02000000) == 0); 156 valid &= ((catalog[0].average[i].flags & 0x08000000) > 0); 157 valid &= ((catalog[0].secfilt[i*Nsecfilt + yNsec].M < 1.0)||(isnan(catalog[0].secfilt[i*Nsecfilt + yNsec].M))); 158 valid &= (((catalog[0].secfilt[i*Nsecfilt + zNsec].M < 1.0))||(isnan(catalog[0].secfilt[i*Nsecfilt + zNsec].M))); 159 // XXX color restrictions are applied in the pair-wise matching below 160 161 // measure-based tests: 162 /* m = catalog[0].average[i].measureOffset; 163 for (j = 0; valid && (j < catalog[0].average[i].Nmeasure); j++, m++) { 164 if (catalog[0].measure[m].photcode == USNO_R) { 165 valid &= ((catalog[0].measure[m].M > 20.0) || isnan(catalog[0].measure[m].M)); 166 } 167 if (catalog[0].measure[m].photcode == USNO_N) { 168 valid &= ((catalog[0].measure[m].M > 18.0) || isnan(catalog[0].measure[m].M)); 169 } 170 }*/ 171 172 // ((objflags & 524288) == 524288) && 173 // ((objflags & 262144) == 0) && 174 // (z<1.0) && 175 // (y<1.0) && 176 // ((yp[$i]-J)>1.25) && ((yp[$i]-J)<5.0) && 177 // ((USNO_RED<1.0)||(USNO_RED>20.0)) && 178 // ((USNO_N>18.0)||(USNO_N<1.0)) 179 180 if (valid) { 181 groupA[i] = TRUE; 182 NgroupA ++; 183 continue; 184 } else { 185 NgroupAbad ++; 186 // fprintf (stderr, "skip "OFF_T_FMT" (group A)\n", i); 187 } 188 } 189 190 // PS1 detections: 191 if (foundB && !foundA) { 192 193 // average-based tests: 194 valid = TRUE; 195 valid &= ((catalog[0].average[i].flags & 0x01000000) == 0); 196 197 valid &= ((catalog[0].average[i].flags & 0x04000000) > 0); 198 199 valid &= ((catalog[0].secfilt[i*Nsecfilt + jNsec].M < 1.0)||(isnan(catalog[0].secfilt[i*Nsecfilt + jNsec].M))); 200 valid &= ((catalog[0].secfilt[i*Nsecfilt + yNsec].Nused > 1)||(catalog[0].secfilt[i*Nsecfilt + zNsec].Nused > 1)); 201 valid &= ((catalog[0].secfilt[i*Nsecfilt + yNsec].dM < 0.2)||(catalog[0].secfilt[i*Nsecfilt + zNsec].dM < 0.2)); 202 203 /*if ((catalog[0].secfilt[i*Nsecfilt + zNsec].M < 1.0) || (catalog[0].secfilt[i*Nsecfilt + zNsec].Nused == 1)) { 204 valid &= TRUE; 205 } else { 206 valid &= ((catalog[0].secfilt[i*Nsecfilt + zNsec].M - catalog[0].secfilt[i*Nsecfilt + yNsec].M) > 0.2); 207 }*/ 208 209 // measure-based tests: 210 /*m = catalog[0].average[i].measureOffset; 211 for (j = 0; valid && (j < catalog[0].average[i].Nmeasure); j++, m++) { 212 if (catalog[0].measure[m].photcode == USNO_R) { 213 valid &= ((catalog[0].measure[m].M > 20.0) || isnan(catalog[0].measure[m].M)); 214 } 215 if (catalog[0].measure[m].photcode == USNO_N) { 216 valid &= ((catalog[0].measure[m].M > 18.5) || isnan(catalog[0].measure[m].M)); 217 } 218 }*/ 219 220 // (abs(glat)>15.0) && 221 // ((objflags & 65536) == 0) && 222 // ((objflags & 131072) == 131072) && 223 // (J<1.0) && 224 // (y:nphot>1) && 225 // (y:err<0.2) && 226 // ((USNO_RED>20.0)||(USNO_RED<1.0)) && 227 // ((USNO_N>18.5)||(USNO_N<1.0)) && 228 // ((z<1.0)||(z:nphot == 1)||((z:nphot>1)&&((z-y)>0.2))) 229 230 if (valid) { 231 groupB[i] = TRUE; 232 NgroupB ++; 233 continue; 234 } else { 235 NgroupBbad ++; 236 // fprintf (stderr, "skip "OFF_T_FMT" (group B)\n", i); 237 } 238 } 239 240 // this object does not have a detection from either groupA or groupB -- skip as if slow 108 if (applyConstraintsA(catalog, i)) { 109 groupA[i] = TRUE; 110 NgroupA++; 111 continue; 112 } else { 113 NgroupAbad ++; 114 // fprintf (stderr, "skip "OFF_T_FMT" (group A)\n", i); 115 } 116 117 } else if (foundB && !foundA) { 118 119 if (applyConstraintsB(catalog, i)) { 120 groupB[i] = TRUE; 121 NgroupB++; 122 continue; 123 } else { 124 NgroupBbad++; 125 } 126 } 127 // this object does not have a detection matching the contraints from either gorupA or groupB -- skip as if slow 241 128 slowMoving[i] = TRUE; 242 129 Ninvalid ++; 243 130 } 131 244 132 fprintf (stderr, OFF_T_FMT" slow, "OFF_T_FMT" invalid, ("OFF_T_FMT" group A, "OFF_T_FMT" group B), "OFF_T_FMT" total objects; "OFF_T_FMT" in group A, "OFF_T_FMT" in group B\n", Nslow, Ninvalid, NgroupAbad, NgroupBbad, catalog[0].Naverage, NgroupA, NgroupB); 245 133 … … 284 172 ni = N1[i]; 285 173 nj = N1[j]; 286 // if (ni == 131030) {287 // fprintf (stderr, "got 2mass\n");288 // }289 // if (nj == 53581) {290 // fprintf (stderr, "got ps1\n");291 // }292 174 293 175 if (slowMoving[ni]) NEXT_I; … … 319 201 dR = dX*dX + dY*dY; 320 202 if (dR > RADIUS2) continue; 321 322 // y_groupA - J_groupB323 324 /* yJ = catalog[0].secfilt[nj*Nsecfilt + yNsec].M - catalog[0].secfilt[ni*Nsecfilt + jNsec].M;325 if (yJ < 1.25) continue;326 if (yJ > 5.0) continue;*/327 203 328 204 /*** a match is found (just print it for the moment) ***/ … … 330 206 Nepoch=2; 331 207 FIT_MODE = FIT_PM_ONLY; 332 /*nv=(int *)malloc(Nepoch*sizeof(int));*/333 208 nv[0]=ni; /*THESE SHOULD BE CHANGED FOR MULTIPLE EPOCHS AS SHOULD nv*/ 334 209 nv[1]=nj; … … 363 238 REALLOCATE(catalog1.secfilt, SecFilt, NAVERAGE*Nsecfilt); 364 239 } 365 // for the moment, just write the matches to stdout:366 //float pmx = -dX; // proper-motion displacement in ra direction (B - A) [arcsec]367 //float pmy = -dY; // proper-motion displacement in dec direction (B - A) [arcsec]368 /* fprintf (stdout, "%11.7f %11.7f %11.7f %11.7f : %7.2f %7.2f %7.2f: %7.3f %6.3f %7.3f %6.3f %7.3f %6.3f %7.3f %6.3f %7.3f %6.3f\n",369 catalog[0].average[ni].R, catalog[0].average[ni].D,370 catalog[0].average[nj].R, catalog[0].average[nj].D,371 dX, dY, sqrt(dR),372 catalog[0].secfilt[nj*Nsecfilt + zNsec].M,373 catalog[0].secfilt[nj*Nsecfilt + zNsec].dM,374 catalog[0].secfilt[nj*Nsecfilt + yNsec].M,375 catalog[0].secfilt[nj*Nsecfilt + yNsec].dM,376 catalog[0].secfilt[ni*Nsecfilt + jNsec].M,377 catalog[0].secfilt[ni*Nsecfilt + jNsec].dM,378 catalog[0].secfilt[ni*Nsecfilt + hNsec].M,379 catalog[0].secfilt[ni*Nsecfilt + hNsec].dM,380 catalog[0].secfilt[ni*Nsecfilt + kNsec].M,381 catalog[0].secfilt[ni*Nsecfilt + kNsec].dM);*/382 240 } 383 241 i++; -
trunk/Ohana/src/relastro/src/initialize.c
r29001 r31635 63 63 64 64 /* parse the comma-separated list of photcodesGroupA */ 65 fprintf (stderr, "PHOTCODE_A_LIST: %s\n", PHOTCODE_A_LIST); 65 66 list = PHOTCODE_A_LIST; 66 67 while ((codename = strtok_r (list, ",", &ptr)) != NULL) { 67 68 list = NULL; // pass NULL on successive strtok_r calls 68 fprintf (stderr, "PHOTCODE_A_LIST: %s\n", PHOTCODE_A_LIST);69 69 fprintf (stderr, "codename: %s\n", codename); 70 70 if ((photcodesGroupA[NphotcodesGroupA] = GetPhotcodebyName (codename)) == NULL) { … … 83 83 ALLOCATE (photcodesGroupB, PhotCode *, NPHOTCODES); 84 84 85 fprintf (stderr, "PHOTCODE_B_LIST: %s\n", PHOTCODE_B_LIST); 85 86 /* parse the comma-separated list of photcodesGroupB */ 86 87 list = PHOTCODE_B_LIST; 87 88 while ((codename = strtok_r (list, ",", &ptr)) != NULL) { 88 89 list = NULL; // pass NULL on successive strtok_r calls 89 fprintf (stderr, "PHOTCODE_B_LIST: %s\n", PHOTCODE_B_LIST);90 90 fprintf (stderr, "codename: %s\n", codename); 91 91 if ((photcodesGroupB[NphotcodesGroupB] = GetPhotcodebyName (codename)) == NULL) { -
trunk/Ohana/src/relastro/src/relastroVisual.c
r30616 r31635 3 3 */ 4 4 5 #include "kapa.h"6 5 #include "relastro.h" 7 6
Note:
See TracChangeset
for help on using the changeset viewer.
