Changeset 31440
- Timestamp:
- May 5, 2011, 10:07:46 AM (15 years ago)
- Location:
- branches/eam_branches/ipp-20110404/Ohana/src
- Files:
-
- 12 edited
-
addstar/include/skycells.h (modified) (1 diff)
-
addstar/src/GetFileMode.c (modified) (2 diffs)
-
addstar/src/ReadImageHeader.c (modified) (2 diffs)
-
addstar/src/args_skycells.c (modified) (3 diffs)
-
addstar/src/sky_tessalation.c (modified) (5 diffs)
-
dvomerge/src/dvomergeCreate.c (modified) (3 diffs)
-
getstar/include/dvoImagesAtCoords.h (modified) (2 diffs)
-
getstar/src/MatchCoords.c (modified) (1 diff)
-
getstar/src/args_coords.c (modified) (1 diff)
-
getstar/src/dvoImagesAtCoords.c (modified) (4 diffs)
-
libfits/table/F_get_column.c (modified) (5 diffs)
-
libfits/table/F_set_column.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20110404/Ohana/src/addstar/include/skycells.h
r31027 r31440 65 65 int NMAX; 66 66 int NX_SUB, NY_SUB; 67 int X_PARITY; 67 68 double SCALE; 68 69 double PADDING; -
branches/eam_branches/ipp-20110404/Ohana/src/addstar/src/GetFileMode.c
r27435 r31440 4 4 int GetFileMode (Header *header) { 5 5 6 char ctype[8 0], ctmp;6 char ctype[81], ctmp[80]; 7 7 int Naxis; 8 8 int simple, extend, haveNaxis, haveCTYPE; … … 17 17 // SDSS tsObj files have a version number for the PHOTO and 18 18 // TS (target selection) pipelines present as header keywords 19 havePHOT_VER = gfits_scan (header, "PHOT_VER", "%s", 1, &ctmp);20 haveTARG_VER = gfits_scan (header, "TARG_VER", "%s", 1, &ctmp);19 havePHOT_VER = gfits_scan (header, "PHOT_VER", "%s", 1, ctmp); 20 haveTARG_VER = gfits_scan (header, "TARG_VER", "%s", 1, ctmp); 21 21 if (havePHOT_VER && haveTARG_VER) return SDSS_OBJ; 22 22 -
branches/eam_branches/ipp-20110404/Ohana/src/addstar/src/ReadImageHeader.c
r29132 r31440 6 6 7 7 int Nastro, hour, min, Nx, Ny, haveNx, haveNy, sourceID; 8 double tmp, sec, Cerror, ZeroPt,FWHM_X, FWHM_Y;8 double tmp, sec, Cerror, FWHM_X, FWHM_Y; 9 9 char *c, photname[64], line[80], ccdnum[64]; 10 10 PhotCode *photcodeData = NULL; … … 205 205 } 206 206 207 #ifdef notdef 207 208 // XXX this is archaic: we used to set a fixed zero point of 25 to shift data into the range 208 209 // 0 - 32 so it would fit in an unsigned int. This is also needed because some programs like 209 210 // sextractor will put in an arbitrary zero point that we need to understand to get back to 210 211 // instrumental mags. 212 double ZeroPt; 211 213 gfits_scan (header, "ZERO_PT", "%lf", 1, &ZeroPt); 212 214 if (ZeroPt != GetZeroPoint()) { 213 215 fprintf (stderr, "WARNING: inconsistent zero point values: image: %f, config: %f\n", ZeroPt, GetZeroPoint()); 214 216 } 217 #endif 215 218 216 219 // in this case, lookup and apply the zero point measured for this chip -
branches/eam_branches/ipp-20110404/Ohana/src/addstar/src/args_skycells.c
r31027 r31440 85 85 fprintf (stderr, "missing -size dRA dDEC for LOCAL mode\n"); 86 86 help (); 87 }88 OVERLAP_RA = 0;89 OVERLAP_DEC = 0;90 if ((N = get_argument (argc, argv, "-overlap"))) {91 remove_argument (N, &argc, argv);92 OVERLAP_RA = atof (argv[N]);93 remove_argument (N, &argc, argv);94 OVERLAP_DEC = atof (argv[N]);95 remove_argument (N, &argc, argv);96 87 } 97 88 PROJECTION_NUMBER[0] = 0; … … 187 178 help (); 188 179 } 180 remove_argument (N, &argc, argv); 181 } 182 183 OVERLAP_RA = 0; 184 OVERLAP_DEC = 0; 185 if ((N = get_argument (argc, argv, "-overlap"))) { 186 remove_argument (N, &argc, argv); 187 OVERLAP_RA = atof (argv[N]); 188 remove_argument (N, &argc, argv); 189 OVERLAP_DEC = atof (argv[N]); 190 remove_argument (N, &argc, argv); 191 } 192 X_PARITY = 1; 193 if ((N = get_argument (argc, argv, "-skyparity"))) { 194 X_PARITY = -1; 189 195 remove_argument (N, &argc, argv); 190 196 } … … 223 229 fprintf (stderr, " -nx Nx : subdivide skycell projection in x by Nx\n"); 224 230 fprintf (stderr, " -ny Ny : subdivide skycell projection in y by Ny\n"); 231 fprintf (stderr, " -overlap Or Od : overlap between skycells (arcseconds)\n"); 225 232 fprintf (stderr, " -projection-number Np : set projection-number (local mode only)\n"); 233 fprintf (stderr, " -skyparity : set wcs for skycells so that east is to the left\n"); 226 234 fprintf (stderr, " -help : this list\n"); 227 235 fprintf (stderr, " -h : this list\n\n"); -
branches/eam_branches/ipp-20110404/Ohana/src/addstar/src/sky_tessalation.c
r31027 r31440 318 318 memset (image, 0, sizeof(Image)); 319 319 image[0].coords = *refcoords; 320 image[0].coords.pc1_1 = image[0].coords.pc2_2 = 1.0; 320 image[0].coords.pc1_1 = 1.0 * X_PARITY; 321 image[0].coords.pc2_2 = 1.0; 321 322 image[0].coords.pc1_2 = image[0].coords.pc2_1 = 0.0; 322 323 … … 468 469 469 470 if (FIX_NS) { 470 rectangle[0].coords.pc1_1 = +1.0 ;471 rectangle[0].coords.pc1_1 = +1.0 * X_PARITY; 471 472 rectangle[0].coords.pc1_2 = +0.0; 472 473 rectangle[0].coords.pc2_1 = -0.0; … … 475 476 ycr = yc*cos(angle) + xc*sin(angle); 476 477 } else { 477 rectangle[0].coords.pc1_1 = +cos(angle) ;478 rectangle[0].coords.pc1_1 = +cos(angle) * X_PARITY; 478 479 rectangle[0].coords.pc1_2 = +sin(angle); 479 rectangle[0].coords.pc2_1 = -sin(angle) ;480 rectangle[0].coords.pc2_1 = -sin(angle) * X_PARITY; 480 481 rectangle[0].coords.pc2_2 = +cos(angle); 481 482 xcr = xc; … … 514 515 angle = 0.0; 515 516 if (FIX_NS) { 516 rectangle[0].coords.pc1_1 = +1.0 ;517 rectangle[0].coords.pc1_1 = +1.0 * X_PARITY; 517 518 rectangle[0].coords.pc1_2 = +0.0; 518 519 rectangle[0].coords.pc2_1 = -0.0; 519 520 rectangle[0].coords.pc2_2 = +1.0; 520 521 } else { 521 rectangle[0].coords.pc1_1 = +cos(angle) ;522 rectangle[0].coords.pc1_1 = +cos(angle) * X_PARITY; 522 523 rectangle[0].coords.pc1_2 = +sin(angle); 523 rectangle[0].coords.pc2_1 = -sin(angle) ;524 rectangle[0].coords.pc2_1 = -sin(angle) * X_PARITY; 524 525 rectangle[0].coords.pc2_2 = +cos(angle); 525 526 } … … 626 627 ring[i].coords.crval2 = dec; 627 628 628 ring[i].coords.pc1_1 = +1.0 ;629 ring[i].coords.pc1_1 = +1.0 * X_PARITY; 629 630 ring[i].coords.pc1_2 = +0.0; 630 631 ring[i].coords.pc2_1 = -0.0; -
branches/eam_branches/ipp-20110404/Ohana/src/dvomerge/src/dvomergeCreate.c
r29938 r31440 93 93 94 94 // save the output photcodes in the output catdir 95 //SetPhotcodeTable(outputPhotcodes);95 SetPhotcodeTable(outputPhotcodes); 96 96 sprintf (filename, "%s/Photcodes.dat", output); 97 97 if (!check_file_access (filename, TRUE, TRUE, VERBOSE)) { … … 129 129 if (VERBOSE) fprintf (stderr, "output: %s\n", outsky[0].regions[i].name); 130 130 131 // if (outputPhotcodes) {132 // SetPhotcodeTable(outputPhotcodes);133 // }134 131 // load / create output catalog 135 132 LoadCatalog (&outcatalog, &outsky[0].regions[i], outsky[0].filename[i], "w", NsecfiltOutput); 136 133 137 // if (input1Photcodes) {138 // SetPhotcodeTable(input1Photcodes);139 // }140 134 // combine only tables at equal or larger depth 141 135 … … 161 155 SkyListFree (inlist); 162 156 163 // if (input2Photcodes) {164 // SetPhotcodeTable(input2Photcodes);165 // }166 167 157 // load in all of the tables from input2 for this region 168 158 inlist = SkyListByBounds (insky2, depth2, outsky[0].regions[i].Rmin, outsky[0].regions[i].Rmax, outsky[0].regions[i].Dmin, outsky[0].regions[i].Dmax); -
branches/eam_branches/ipp-20110404/Ohana/src/getstar/include/dvoImagesAtCoords.h
r27435 r31440 7 7 8 8 int VERBOSE; 9 int LISTCHIPCOORDS; 9 10 10 11 char OUTPUT[256]; … … 19 20 20 21 typedef struct { 22 int n; 23 double x; 24 double y; 25 } Match; 26 27 typedef struct { 21 28 int id; 22 29 double ra; 23 30 double dec; 24 31 int Nmatches; 25 int*matches;32 Match *matches; 26 33 int arrayLength; 27 34 } Point; -
branches/eam_branches/ipp-20110404/Ohana/src/getstar/src/MatchCoords.c
r30791 r31440 93 93 totalMatches++; 94 94 95 pt->matches[pt->Nmatches] = i; 95 pt->matches[pt->Nmatches].n = i; 96 pt->matches[pt->Nmatches].x = x; 97 pt->matches[pt->Nmatches].y = y; 96 98 pt->Nmatches ++; 97 99 98 100 if (pt->Nmatches == pt->arrayLength) { 99 101 pt->arrayLength += 20; 100 REALLOCATE (pt->matches, int, pt->arrayLength);102 REALLOCATE (pt->matches, Match, pt->arrayLength); 101 103 } 102 104 } -
branches/eam_branches/ipp-20110404/Ohana/src/getstar/src/args_coords.c
r26288 r31440 41 41 42 42 /* check for command line options */ 43 LISTCHIPCOORDS = FALSE; 44 if ((N = get_argument (argc, argv, "-listchipcoords"))) { 45 LISTCHIPCOORDS = TRUE; 46 remove_argument (N, &argc, argv); 47 } 43 48 WITH_PHU = FALSE; 44 49 if ((N = get_argument (argc, argv, "+phu"))) { -
branches/eam_branches/ipp-20110404/Ohana/src/getstar/src/dvoImagesAtCoords.c
r29001 r31440 91 91 while ((Nread = fscanf(f, "%d %lf %lf\n", &pts[Npoints].id, &pts[Npoints].ra, &pts[Npoints].dec)) == 3) { 92 92 pts[Npoints].Nmatches = 0; 93 ALLOCATE(pts[Npoints].matches, int, 20);93 ALLOCATE(pts[Npoints].matches, Match, 20); 94 94 pts[Npoints].arrayLength = 20; 95 95 … … 118 118 pts[0].dec = dec; 119 119 pts[0].Nmatches = 0; 120 ALLOCATE(pts[0].matches, int, 20);120 ALLOCATE(pts[0].matches, Match, 20); 121 121 pts[0].arrayLength = 20; 122 122 … … 133 133 Point *pt = points + j; 134 134 for (i = 0; i < pt->Nmatches; i++) { 135 int N = pt->matches[i]; 135 int N = pt->matches[i].n; 136 double x = pt->matches[i].x; 137 double y = pt->matches[i].y; 136 138 137 139 char *name; … … 150 152 name = dbImages[N].name; 151 153 } 152 fprintf (stdout, "%d %lf %lf %s\n", pt->id, pt->ra, pt->dec, name); 154 if (LISTCHIPCOORDS) { 155 fprintf (stdout, "%d %lf %lf %s %8.2lf %8.2lf\n", pt->id, pt->ra, pt->dec, name, x, y); 156 } else { 157 fprintf (stdout, "%d %lf %lf %s\n", pt->id, pt->ra, pt->dec, name); 158 } 153 159 if (copy) { 154 160 free(copy); -
branches/eam_branches/ipp-20110404/Ohana/src/libfits/table/F_get_column.c
r28241 r31440 30 30 tlabel[0] = 0; 31 31 if (!gfits_scan (header, "TFIELDS", "%d", 1, &Nfields)) return (NULL); 32 for (i = 1; strc mp (label, tlabel) && (i < Nfields + 1); i++) {32 for (i = 1; strcasecmp (label, tlabel) && (i < Nfields + 1); i++) { 33 33 sprintf (field, "TTYPE%d", i); 34 34 gfits_scan (header, field, "%s", 1, tlabel); 35 35 } 36 if (strc mp (label, tlabel)) return (NULL);36 if (strcasecmp (label, tlabel)) return (NULL); 37 37 N = i - 1; 38 38 … … 137 137 tlabel[0] = 0; 138 138 gfits_scan (header, "TFIELDS", "%d", 1, &Nfields); 139 for (i = 1; strc mp (label, tlabel) && (i < Nfields + 1); i++) {139 for (i = 1; strcasecmp (label, tlabel) && (i < Nfields + 1); i++) { 140 140 sprintf (field, "TTYPE%d", i); 141 141 gfits_scan (header, field, "%s", 1, tlabel); 142 142 } 143 if (strc mp (label, tlabel)) return (FALSE);143 if (strcasecmp (label, tlabel)) return (FALSE); 144 144 N = i - 1; 145 145 … … 166 166 tlabel[0] = 0; 167 167 gfits_scan (header, "TFIELDS", "%d", 1, &Nfields); 168 for (i = 1; strc mp (label, tlabel) && (i < Nfields + 1); i++) {168 for (i = 1; strcasecmp (label, tlabel) && (i < Nfields + 1); i++) { 169 169 sprintf (field, "TTYPE%d", i); 170 170 gfits_scan (header, field, "%s", 1, tlabel); 171 171 } 172 if (strc mp (label, tlabel)) return (FALSE);172 if (strcasecmp (label, tlabel)) return (FALSE); 173 173 N = i - 1; 174 174 … … 291 291 tlabel[0] = 0; 292 292 gfits_scan (header, "TFIELDS", "%d", 1, &Nfields); 293 for (i = 1; strc mp (label, tlabel) && (i < Nfields + 1); i++) {293 for (i = 1; strcasecmp (label, tlabel) && (i < Nfields + 1); i++) { 294 294 sprintf (field, "TTYPE%d", i); 295 295 gfits_scan (header, field, "%s", 1, tlabel); 296 296 } 297 if (strc mp (label, tlabel)) return (FALSE);297 if (strcasecmp (label, tlabel)) return (FALSE); 298 298 N = i - 1; 299 299 … … 321 321 tlabel[0] = 0; 322 322 gfits_scan (header, "TFIELDS", "%d", 1, &Nfields); 323 for (i = 1; strc mp (label, tlabel) && (i < Nfields + 1); i++) {323 for (i = 1; strcasecmp (label, tlabel) && (i < Nfields + 1); i++) { 324 324 sprintf (field, "TTYPE%d", i); 325 325 gfits_scan (header, field, "%s", 1, tlabel); 326 326 } 327 if (strc mp (label, tlabel)) return (FALSE);327 if (strcasecmp (label, tlabel)) return (FALSE); 328 328 N = i - 1; 329 329 -
branches/eam_branches/ipp-20110404/Ohana/src/libfits/table/F_set_column.c
r28241 r31440 31 31 tlabel[0] = 0; 32 32 gfits_scan (header, "TFIELDS", "%d", 1, &Nfields); 33 for (i = 1; strc mp (label, tlabel) && (i < Nfields + 1); i++) {33 for (i = 1; strcasecmp (label, tlabel) && (i < Nfields + 1); i++) { 34 34 sprintf (field, "TTYPE%d", i); 35 35 gfits_scan (header, field, "%s", 1, tlabel); 36 36 } 37 if (strc mp (label, tlabel)) return (FALSE);37 if (strcasecmp (label, tlabel)) return (FALSE); 38 38 N = i - 1; 39 39
Note:
See TracChangeset
for help on using the changeset viewer.
