Changeset 35005
- Timestamp:
- Jan 21, 2013, 1:32:12 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20121219/Ohana/src/addstar/src/mkcmf.c
r35002 r35005 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"))) { … … 66 72 remove_argument (N, &argc, argv); 67 73 time = strcreate (argv[N]); 74 remove_argument (N, &argc, argv); 75 } 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]); 68 84 remove_argument (N, &argc, argv); 69 85 } … … 275 291 276 292 PutCoords (&coords, &header); 277 gfits_modify (&header, "EXTNAME", "%s", 1, "Chip.hdr");293 gfits_modify (&header, "EXTNAME", "%s", 1, exthead); 278 294 279 295 ftable.header = &theader; … … 310 326 } 311 327 312 gfits_modify (ftable.header, "EXTHEAD", "%s", 1, "Chip.hdr");313 gfits_modify (ftable.header, "EXTNAME", "%s", 1, "Chip.psf");328 gfits_modify (ftable.header, "EXTHEAD", "%s", 1, exthead); 329 gfits_modify (ftable.header, "EXTNAME", "%s", 1, extname); 314 330 315 331 // open for append (if you want a new file, need to blow the old object) 316 fits = fopen (argv[2], "a+"); 332 if (APPEND) { 333 fits = fopen (argv[2], "a+"); 334 } else { 335 fits = fopen (argv[2], "w"); 336 } 317 337 if (fits == NULL) { 318 338 fprintf (stderr, "ERROR: can't open output file %s\n", argv[2]); … … 320 340 } 321 341 322 /* position to begining of file to write header */323 off_t Nend = ftello (f);324 325 342 /* if we are appending, fix up header */ 326 if ( Nend > 0) {343 if (APPEND) { 327 344 static char simple[] = "XTENSION= 'IMAGE ' / Image extension"; 328 345 int Ns, No; … … 542 559 stars[i].dSky = DSKY; 543 560 stars[i].psfChisq = PSFCHI; 561 stars[i].psfNdof = 1; 562 stars[i].psfNpix = 2; 544 563 stars[i].crNsigma = CRN; 545 564 stars[i].extNsigma = EXTN; … … 596 615 stars[i].dSky = DSKY; 597 616 stars[i].psfChisq = PSFCHI; 617 stars[i].psfNdof = 1; 618 stars[i].psfNpix = 2; 598 619 stars[i].crNsigma = CRN; 599 620 stars[i].extNsigma = EXTN; … … 650 671 stars[i].dSky = DSKY; 651 672 stars[i].psfChisq = PSFCHI; 673 stars[i].psfNdof = 1; 674 stars[i].psfNpix = 2; 652 675 stars[i].crNsigma = CRN; 653 676 stars[i].extNsigma = EXTN; … … 716 739 stars[i].dSky = DSKY; 717 740 stars[i].psfChisq = PSFCHI; 741 stars[i].psfNdof = 1; 742 stars[i].psfNpix = 2; 718 743 stars[i].crNsigma = CRN; 719 744 stars[i].extNsigma = EXTN;
Note:
See TracChangeset
for help on using the changeset viewer.
