Changeset 35604
- Timestamp:
- May 29, 2013, 9:03:05 AM (13 years ago)
- Location:
- branches/eam_branches/ipp-20130509/Ohana/src
- Files:
-
- 5 edited
-
libkapa/src/IOfuncs.c (modified) (6 diffs)
-
relphot/include/relphot.h (modified) (1 diff)
-
relphot/src/ImageOps.c (modified) (3 diffs)
-
relphot/src/MosaicOps.c (modified) (5 diffs)
-
relphot/src/plotstuff.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20130509/Ohana/src/libkapa/src/IOfuncs.c
r34582 r35604 30 30 sscanf (buffer, "%*s %d", &Nbytes); 31 31 ALLOCATE (data, char, Nbytes + 1); 32 memset (data, 0, Nbytes + 1); 33 32 34 status = read (device, data, Nbytes); 33 35 if (status != Nbytes) { … … 78 80 // XXX BUT: I need to think a bit more about hand-shaking. 79 81 } 80 if (DEBUG) fprintf (stderr, "recv buffer: %s \n", buffer);82 if (DEBUG) fprintf (stderr, "recv buffer: %s...\n", buffer); 81 83 82 84 /* find the message length, allocate space */ 83 85 sscanf (buffer, "%*s %d", &Nbytes); 84 86 ALLOCATE (message, char, Nbytes + 1); 87 memset (message, 0, Nbytes + 1); 85 88 86 89 /* read Nbytes from the device */ … … 92 95 /* make the string easy to parse */ 93 96 94 if (DEBUG) fprintf (stderr, "recv: %s \n", message);97 if (DEBUG) fprintf (stderr, "recv: %s...\n", message); 95 98 96 99 /* scan the incoming message */ … … 131 134 if (Nwrite != length) return (FALSE); 132 135 133 if (DEBUG) fprintf (stderr, "send: %s \n", string);136 if (DEBUG) fprintf (stderr, "send: %s...\n", string); 134 137 135 138 free (string); … … 145 148 146 149 ALLOCATE (message, char, length + 1); 150 memset (message, 0, length + 1); 147 151 148 152 /* read Nbytes from the device */ 149 153 status = read (device, message, length); 150 if (DEBUG) fprintf (stderr, "recv message: %s \n", message);154 if (DEBUG) fprintf (stderr, "recv message: %s...\n", message); 151 155 152 156 if (status != length) { … … 173 177 Nbytes = strlen (expect); 174 178 ALLOCATE (answer, char, Nbytes + 1); 179 memset (answer, 0, Nbytes + 1); 175 180 176 181 KiiScanCommand (device, Nbytes, "%s", answer); -
branches/eam_branches/ipp-20130509/Ohana/src/relphot/include/relphot.h
r35416 r35604 328 328 void plot_star_coords PROTO((Catalog *catalog, int Ncatalog)); 329 329 void plot_stars PROTO((Catalog *catalog, int Ncatalog)); 330 331 void plot_list_add PROTO((Graphdata *graphdata, double *xlist, double *ylist, int N)); 332 int get_graph PROTO((int N)); 333 int open_graph PROTO((int N)); 334 330 335 void reload_catalogs PROTO((SkyList *skylist, FlatCorrectionTable *flatcorr, int hostID, char *hostpath)); 331 336 int reload_catalogs_parallel PROTO((SkyList *sky)); -
branches/eam_branches/ipp-20130509/Ohana/src/relphot/src/ImageOps.c
r35600 r35604 595 595 image[i].Xm = 100.0*log10(stats.chisq); 596 596 597 plot_setMcal (list, N, &stats, CLOUD_TOLERANCE); 597 if (PLOTSTUFF) { 598 fprintf (stderr, "Mcal for : %s\n", image[i].name); 599 plot_setMcal (list, N, &stats, CLOUD_TOLERANCE); 600 } 598 601 599 602 // bright end scatter … … 683 686 } 684 687 688 static int setMcal_init_done = FALSE; 685 689 void plot_setMcal (double *list, int Npts, StatType *stats, float clouds) { 686 690 … … 692 696 693 697 if (Npts == 0) { 694 fprintf (stderr, "cannot set image Mcal values yet (nan Mave)\n");698 // fprintf (stderr, "cannot set image Mcal values yet (nan Mave)\n"); 695 699 return; 696 700 } 697 701 702 plot_defaults (&graphdata); 703 graphdata.xmin = -0.01; 704 graphdata.xmax = +1.01; 705 graphdata.ymin = -0.21; 706 graphdata.ymax = +0.21; 707 708 if (!setMcal_init_done) { 709 int kapa = get_graph(0); 710 if (kapa < 1) { 711 kapa = open_graph(0); 712 if (!kapa) return; 713 } 714 715 KapaClearSections (kapa); 716 KapaClearPlots (kapa); 717 KapaSetLimits (kapa, &graphdata); 718 KapaSetFont (kapa, "helvetica", 14); 719 KapaBox (kapa, &graphdata); 720 setMcal_init_done = TRUE; 721 } 722 698 723 ALLOCATE (xlist, double, Npts); 699 700 /**** Mcal vs seq ****/701 float minMcal = +100.0;702 float maxMcal = -100.0;703 724 for (i = 0; i < Npts; i++) { 704 xlist[i] = i; 705 minMcal = MIN (list[i], minMcal); 706 maxMcal = MAX (list[i], maxMcal); 707 } 708 709 float McalRange = MAX(1.2*(maxMcal - minMcal), 0.21); 710 float McalCenter = 0.5*(maxMcal + minMcal); 711 712 plot_defaults (&graphdata); 713 graphdata.xmin = -1; 714 graphdata.xmax = Npts + 1; 715 graphdata.ymin = McalCenter - 0.5*McalRange; 716 graphdata.ymax = McalCenter + 0.5*McalRange; 717 plot_list (&graphdata, xlist, list, Npts, "sequence vs Mcal", "%s.seq.png", OUTROOT); 725 xlist[i] = i / (float) Npts; 726 } 727 728 plot_list_add (&graphdata, xlist, list, Npts); 718 729 719 730 free (xlist); -
branches/eam_branches/ipp-20130509/Ohana/src/relphot/src/MosaicOps.c
r35416 r35604 711 711 if (FREEZE_MOSAICS) return (FALSE); 712 712 713 if (NTHREADS) { 713 // plots cannot be done in a threaded context (the plot commands collide) 714 // so do not run setMmos in threaded mode if PLOTSTUFF is set 715 if (NTHREADS && !PLOTSTUFF) { 714 716 int status = setMmos_threaded (catalog, PoorImages, flatcorr); 715 717 return status; … … 734 736 SetMmosInfoInit (&info, Nmax, TRUE, PoorImages); 735 737 738 // int savePlotDelay = PLOTDELAY; 739 // if (PLOTSTUFF) PLOTDELAY = 0.0; 740 736 741 for (i = 0; i < Nmosaic; i++) { 737 742 setMmos_mosaic (&mosaic[i], i, image, catalog, &info, flatcorr); 738 743 } 739 744 SetMmosInfoFree (&info); 745 746 if (PLOTSTUFF) { 747 fprintf (stdout, "press return\n"); 748 if (fscanf (stdin, "%*c") != 1) fprintf (stderr, "\n"); 749 } 740 750 741 751 npass_output ++; … … 757 767 758 768 StatType stats; 759 liststats_setmode (&stats, STATMODE); 769 // liststats_setmode (&stats, STATMODE); 770 liststats_setmode (&stats, "INNER_WTMEAN"); 760 771 761 772 double *list = info->list; … … 937 948 } 938 949 939 plot_setMcal (list, N, &stats, CLOUD_TOLERANCE); 950 if (PLOTSTUFF) { 951 fprintf (stderr, "Mmos: %6.3f %6.3f +/- %6.3f %5d %5d | %s\n", stats.mean, stats.median, stats.sigma, stats.Nmeas, N, image[MosaicToImage[Nmos][0]].name); 952 plot_setMcal (list, N, &stats, CLOUD_TOLERANCE); 953 } 940 954 941 955 // bright end scatter … … 961 975 // fprintf (stderr, "%d %d %d\n", (int) i, (int) im, image[im].ubercalDist); 962 976 } 977 963 978 return TRUE; 964 979 } -
branches/eam_branches/ipp-20130509/Ohana/src/relphot/src/plotstuff.c
r35600 r35604 17 17 fprintf (stderr, "kapa is dead, must restart\n"); 18 18 Xgraph[active] = -1; 19 } 20 21 int get_graph (int N) { 22 return Xgraph[N]; 19 23 } 20 24 … … 156 160 } 157 161 162 // plot the vector pair to a file with name defined by the varargs format 163 void plot_list_add (Graphdata *graphdata, double *xlist, double *ylist, int Npts) { 164 165 KapaPrepPlot (Xgraph[0], Npts, graphdata); 166 PlotVector (Npts, xlist, 0, 0, "x"); 167 PlotVector (Npts, ylist, 1, 0, "y"); 168 } 169 158 170 void plot_defaults (Graphdata *graphdata) { 159 171
Note:
See TracChangeset
for help on using the changeset viewer.
