Changeset 35108
- Timestamp:
- Feb 6, 2013, 3:28:06 PM (13 years ago)
- Location:
- trunk/Ohana/src/addstar/src
- Files:
-
- 2 edited
-
GetFileMode.c (modified) (1 diff)
-
mkcmf.c (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/addstar/src/GetFileMode.c
r34088 r35108 22 22 if (havePHOT_VER && haveTARG_VER) return SDSS_OBJ; 23 23 24 if (haveNaxis && ((Naxis == 2) || TEXTMODE || !simple)) { 24 if (haveNaxis && (Naxis == 2)) { 25 int Nx, Ny; 26 gfits_scan (header, "NAXIS1", "%d", 1, &Nx); 27 gfits_scan (header, "NAXIS2", "%d", 1, &Ny); 28 if ((Nx > 0) && (Ny > 0)) { 29 if (haveCTYPE && !strcmp (&ctype[4], "-WRP")) { 30 return MOSAIC_CMP; 31 } 32 return SIMPLE_CMP; 33 } 34 } 35 36 if (haveNaxis && (TEXTMODE || !simple)) { 25 37 if (haveCTYPE && !strcmp (&ctype[4], "-WRP")) { 26 38 return MOSAIC_CMP; -
trunk/Ohana/src/addstar/src/mkcmf.c
r34620 r35108 40 40 Coords coords; 41 41 42 int APPEND = FALSE; 43 if ((N = get_argument (argc, argv, "-append"))) { 44 remove_argument (N, &argc, argv); 45 APPEND = TRUE; 46 } 47 42 48 static char *photcode = "SIMTEST.r.Chip"; 43 49 if ((N = get_argument (argc, argv, "-photcode"))) { … … 69 75 } 70 76 77 char extname[80], exthead[80]; 78 strcpy (extname, "Chip.psf"); 79 strcpy (exthead, "Chip.hdr"); 80 if ((N = get_argument (argc, argv, "-extname"))) { 81 remove_argument (N, &argc, argv); 82 snprintf (extname, 80, "%s.psf", argv[N]); 83 snprintf (exthead, 80, "%s.hdr", argv[N]); 84 remove_argument (N, &argc, argv); 85 } 86 71 87 double RA = 10.0; 72 88 double DEC = 20.0; … … 101 117 remove_argument (N, &argc, argv); 102 118 airmass = atof (argv[N]); 119 remove_argument (N, &argc, argv); 120 } 121 122 int imageID = -1; 123 if ((N = get_argument (argc, argv, "-imageID"))) { 124 remove_argument (N, &argc, argv); 125 imageID = atof (argv[N]); 126 remove_argument (N, &argc, argv); 127 } 128 int sourceID = -1; 129 if ((N = get_argument (argc, argv, "-sourceID"))) { 130 remove_argument (N, &argc, argv); 131 sourceID = atof (argv[N]); 103 132 remove_argument (N, &argc, argv); 104 133 } … … 254 283 gfits_modify (&header, "EXPTIME", "%lf", 1, exptime); 255 284 gfits_modify (&header, "AIRMASS", "%lf", 1, airmass); 256 gfits_modify (&header, "NASTRO", "%d", 1, 10); 257 258 int imageID = 1000.0*drand48(); 259 int sourceID = 100.0*drand48(); 260 285 gfits_modify (&header, "NASTRO", "%d", 1, 100); 286 287 if (imageID == -1) imageID = 1000.0*drand48(); 288 if (sourceID == -1) sourceID = 100.0*drand48(); 261 289 gfits_modify (&header, "IMAGEID", "%d", 1, imageID); 262 290 gfits_modify (&header, "SOURCEID", "%d", 1, sourceID); 263 291 264 292 PutCoords (&coords, &header); 265 gfits_modify (&header, "EXTNAME", "%s", 1, "Chip.hdr");293 gfits_modify (&header, "EXTNAME", "%s", 1, exthead); 266 294 267 295 ftable.header = &theader; … … 298 326 } 299 327 300 gfits_modify (ftable.header, "EXTHEAD", "%s", 1, "Chip.hdr"); 301 gfits_modify (ftable.header, "EXTNAME", "%s", 1, "Chip.psf"); 302 303 fits = fopen (argv[2], "w"); 328 gfits_modify (ftable.header, "EXTHEAD", "%s", 1, exthead); 329 gfits_modify (ftable.header, "EXTNAME", "%s", 1, extname); 330 331 // open for append (if you want a new file, need to blow the old object) 332 if (APPEND) { 333 fits = fopen (argv[2], "a+"); 334 } else { 335 fits = fopen (argv[2], "w"); 336 } 304 337 if (fits == NULL) { 305 338 fprintf (stderr, "ERROR: can't open output file %s\n", argv[2]); 306 339 exit (1); 340 } 341 342 /* if we are appending, fix up header */ 343 if (APPEND) { 344 static char simple[] = "XTENSION= 'IMAGE ' / Image extension"; 345 int Ns, No; 346 Ns = strlen (simple); 347 No = 80 - Ns; 348 strncpy (header.buffer, simple, Ns); 349 memset (&header.buffer[Ns], ' ', No); 307 350 } 308 351 … … 516 559 stars[i].dSky = DSKY; 517 560 stars[i].psfChisq = PSFCHI; 561 stars[i].psfNdof = 1; 562 stars[i].psfNpix = 2; 518 563 stars[i].crNsigma = CRN; 519 564 stars[i].extNsigma = EXTN; … … 570 615 stars[i].dSky = DSKY; 571 616 stars[i].psfChisq = PSFCHI; 617 stars[i].psfNdof = 1; 618 stars[i].psfNpix = 2; 572 619 stars[i].crNsigma = CRN; 573 620 stars[i].extNsigma = EXTN; … … 624 671 stars[i].dSky = DSKY; 625 672 stars[i].psfChisq = PSFCHI; 673 stars[i].psfNdof = 1; 674 stars[i].psfNpix = 2; 626 675 stars[i].crNsigma = CRN; 627 676 stars[i].extNsigma = EXTN; … … 690 739 stars[i].dSky = DSKY; 691 740 stars[i].psfChisq = PSFCHI; 741 stars[i].psfNdof = 1; 742 stars[i].psfNpix = 2; 692 743 stars[i].crNsigma = CRN; 693 744 stars[i].extNsigma = EXTN;
Note:
See TracChangeset
for help on using the changeset viewer.
