From: Radu C. <rc...@us...> - 2011-12-03 21:48:09
|
Update of /cvsroot/gcx/gcx/src In directory vz-cvs-4.sog:/tmp/cvs-serv26126/src Modified Files: filegui.c gcx.c helpmsg.c obsdata.c Log Message: -w option, bz2 files, vesion 1.5 Index: helpmsg.c =================================================================== RCS file: /cvsroot/gcx/gcx/src/helpmsg.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** helpmsg.c 28 Sep 2011 06:05:47 -0000 1.9 --- helpmsg.c 3 Dec 2011 21:48:07 -0000 1.10 *************** *** 95,98 **** --- 95,99 ---- " --mag-limit Set a magnitude limit for the output of\n" " import and merge commands.\n" + "-w --wcs-fit Fit wcs of frame and update the fits header\n" "\n" " CCD Reduction Options\n" Index: gcx.c =================================================================== RCS file: /cvsroot/gcx/gcx/src/gcx.c,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** gcx.c 28 Sep 2011 06:05:47 -0000 1.37 --- gcx.c 3 Dec 2011 21:48:07 -0000 1.38 *************** *** 602,605 **** --- 602,606 ---- char starf[1024] = ""; /* star list */ int to_pnm = 0; + int fit_wcs = 0; int run_phot = 0; int convert_recipe = 0; *************** *** 631,635 **** GtkWidget *window; ! char *shortopts = "D:p:hP:V:vo:id:b:f:B:M:A:O:usa:T:S:nG:Nj:FcX:e:"; struct option longopts[] = { {"debug", required_argument, NULL, 'D'}, --- 632,636 ---- GtkWidget *window; ! char *shortopts = "D:p:hP:V:vo:id:b:f:B:M:A:O:usa:T:S:nG:Nj:FcX:e:w"; struct option longopts[] = { {"debug", required_argument, NULL, 'D'}, *************** *** 669,672 **** --- 670,674 ---- {"make-tycho-rcp", required_argument, NULL, ']'}, {"make-cat-rcp", required_argument, NULL, '>'}, + {"wcs-fit", no_argument, NULL, 'w'}, {"rep-to-table", required_argument, NULL, 'T'}, *************** *** 771,774 **** --- 773,780 ---- batch = 1; break; + case 'w': + fit_wcs = 1; + batch = 1; + break; case 'O': strncpy(of, optarg, 1023); *************** *** 1132,1135 **** --- 1138,1180 ---- exit(0); } + if (fit_wcs) { + struct image_channel *channel; + char *fn; + int rtn; + channel = g_object_get_data(G_OBJECT(window), "i_channel"); + if (channel == NULL) { + err_printf("oops - no channel\n"); + if (batch && !interactive) + exit(1); + } + if (match_field_in_window_quiet(window)) + exit(2); + wcs_to_fits_header(channel->fr); + fn = channel->fr->name; + if (file_is_zipped(fn)) { + for (i = strlen(fn); i > 0; i--) + if (fn[i] == '.') { + fn[i] = 0; + break; + } + rtn = write_gz_fits_frame(channel->fr, fn, P_STR(FILE_COMPRESS)); + } else { + rtn = write_fits_frame(channel->fr, fn); + } + + /* + if (outf[0] != 0) { + ret = channel_to_pnm_file(channel, NULL, outf, 0); + } else { + ret = channel_to_pnm_file(channel, NULL, NULL, 0); + } + */ + if (batch && !interactive) { + if (rtn == 0) + exit(0); + else + exit(3); + } + } if (rf[0] != 0) { FILE *output_file = NULL; Index: obsdata.c =================================================================== RCS file: /cvsroot/gcx/gcx/src/obsdata.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** obsdata.c 12 Sep 2009 16:30:54 -0000 1.8 --- obsdata.c 3 Dec 2011 21:48:07 -0000 1.9 *************** *** 362,365 **** --- 362,366 ---- double D; + d3_printf("scan_for_pc\n"); if (fits_get_double(fr, P_STR(FN_CROTA1), &fim->rot) <= 0) fim->rot = 0; *************** *** 391,394 **** --- 392,396 ---- } + D = pc[0][0] * pc[1][1] - pc[1][0] * pc[0][1]; *************** *** 407,411 **** fim->pc[0][1] = pc[0][1]; fim->pc[1][1] = pc[1][1]; ! fim->rot = raddeg(atan2(pc[0][1], pc[0][0])); return 1; --- 409,414 ---- fim->pc[0][1] = pc[0][1]; fim->pc[1][1] = pc[1][1]; ! if (ret) ! fim->rot = raddeg(atan2(pc[0][1], pc[0][0])); return 1; Index: filegui.c =================================================================== RCS file: /cvsroot/gcx/gcx/src/filegui.c,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** filegui.c 28 Sep 2011 06:05:47 -0000 1.20 --- filegui.c 3 Dec 2011 21:48:07 -0000 1.21 *************** *** 905,908 **** --- 905,911 ---- return 1; } + if ((len > 5) && (strcasecmp(fn + len - 4, ".bz2") == 0)) { + return 1; + } return 0; } |