HOPS
HOPS class reference
gnearch.h
Go to the documentation of this file.
1 /*
2  * Support for replacing the PGPLOT graphics with gnuplot.
3  * For the present, this is considered a second output path.
4  */
5 #ifndef __gnearch_h__
6 #define __gnearch_h__
7 
8 #if BIGGER
9 #include <math.h>
10 #define MAX_TXT 80
11 #endif /* BIGGER */
12 
13 /* captures command-line options and gnuplot configuration options */
14 typedef struct gpconf {
15 #if BIGGER
16  char *pdfile; /* [-d] pdf file if /pdf given */
17  char *devp; /* [-d] dev name for pgplot */
18  char *gcfile; /* gnuplot config filename */
19  char *gplatt; /* gnuplot filename pattern */
20  int patlen; /* strlen(gplatt) */
21  int nprv; /* previous nout */
22  int montage, density, npdfs; /* make a montage w/ density */
23  int gpdfs_alloc; /* size of allocated gnupdfs */
24  int nukegnu, nukedata; /* unlink intermediates */
25  char **gnupdfs; /* from npdfs output pdf files */
26 #endif /* BIGGER */
27  int ncols, nrows, asqr; /* [-g] cols x rows : asqr ; */
28  int pplt, gplt; /* pgplot and gnuplot */
29  /* if gcfile has any gsplot items, the next pointer is set to
30  * a copy of what was correctly scanned by is_gsplot_option() */
31  struct gsplot *gsp_gcfile; /* any parsed gsplot options */
33 
34 #if BIGGER
35 /* captures the items used in the gnuplot graphic */
36 typedef struct gsplot {
37  gpconf *gpcopy; /* convenience copy of ptr to gpconf */
38  /* these three are in the same malloc blob */
39  int fileno; /* counter for the filename */
40  char *pfile; /* data file name */
41  char *gfile; /* gnu cmd file name */
42  char *gnpdf; /* resulting gnuplot pdf file */
43  /* details for the gnu plot derived from search data */
44  char *frname; /* fringe name */
45  char label[MAX_TXT]; /* scan-time, timestamp, pol title */
46  char srcsnr[MAX_TXT]; /* source and peak SNR subtitle */
47  char *source; /* source */
48  double snr; /* SNR */
49  int numrates, numdelays; /* count of rates and delays */
50  char *rate_unit, *delay_unit; /* ps/s and us for scaling of 1.0 */
51  double rate_sf, delay_sf; /* scale factors 1.0 and 1e3 */
52  double ratesize, delaysize; /* multipliers on screen dimensions */
53  double min_rate, max_rate; /* min and max rates (ps/s) */
54  double min_delay, max_delay; /* min and max delays (us) */
55  double peak_rate, peak_delay; /* peak of rate and delay */
56  /* other details these two depend on data for peak snr */
57  int cntr_specified; /* if nonzero, these two were input */
58  double cntr_lowest; /* lowest value contour level */
59  double cntr_increment; /* increment on contour levels */
60  char *colorbar_label; /* label for the colorbar */
61  /* other details come from defaults or config file */
62  int isosamples; /* for smooth contours */
63  int bsplineorder; /* ditto */
64  int dgrid3dalgorder; /* algorithm order value */
65  char *dgrid3dalgorithm; /* dgrid3d algorithm name */
66  char *palette_type; /* rgbformulae, cubehelix, viridis */
67  char *palette_options; /* formulae or start/cycles/saturation */
68  char *bgfieldname; /* color name for snr<min background */
69  /* various details for pdfcairo setup, &c. */
70  double pdfsizeinch; /* sets pdfcairo plot size */
71  char *labelfont, *titlefont; /* names of fonts */
72  int labelfontsize; /* in points */
73  double titlefontscale; /* multiplier on basic font size */
74  double snrminfrac; /* where to cut cbar at low end */
75  double peakradius; /* fraction of grid size */
76  char *peakcolorname; /* what color for this object */
77  double peaktransparency; /* how transparent to make it */
78 } gsplot;
79 
80 /* functions in srch_montage.c */
81 extern void monty_runit(char *);
82 extern void search_montage(gpconf *);
83 
84 /* functions in gnusrchplot.c */
85 extern void gnu_plot_doit(char *);
86 extern void save_gpdf(gsplot *);
87 extern void make_gnu_splot(gsplot *);
88 extern char *setup_gnu_filenames(int, gsplot *, gpconf *);
89 extern FILE *open_gdata_file(srchsum *, gpconf *, gsplot *);
90 extern void write_gplot_label(FILE *, fringesum *, gsplot *);
91 extern void write_gplot_info(FILE *, srchsum *, gsplot *);
92 extern void gnusrchplot(int, srchsum *, gpconf *);
93 
94 /* functions in make_gnucmds.c, with templates in splotemp.h */
95 extern void set_contour_options(gsplot *);
96 extern void nuke_contour_options(gsplot *);
97 extern void show_gsplot_contours(FILE *);
98 extern void set_basic_contour_options(gsplot *);
99 extern void show_basic_contour_options(FILE *, gsplot *);
100 extern void set_colormap_palette(gsplot *);
101 extern void show_colormap_palette(FILE *, gsplot *);
102 extern void set_pdfcairo_options(gsplot *);
103 extern void show_pdfcairo_options(FILE *, gsplot *);
104 extern void set_rate_unit_sf(char *, gsplot *);
105 extern void set_delay_unit_sf(char *, gsplot *);
106 extern void set_gsplot_defaults(gsplot *);
107 extern void show_gsplot_defaults(FILE *);
108 extern int is_gsplot_option(char *, int, int, gpconf *);
109 extern void make_gnucmds(gsplot *);
110 
111 /* functions in gnedits.c */
112 extern int gnuexists(char *, int *);
113 extern int create_gnuconf(char *, gpconf *);
114 extern int puke(FILE *, int, char *, char *, int);
115 extern int gnuparse(char *, gpconf *);
116 extern int gnuedits(char *, gpconf *);
117 
118 /* functions in gnearch.c */
119 extern int gnuconfile(int, char *, gpconf *);
120 extern int gargparse(char *, gpconf *);
121 extern void gnufinish(gpconf *);
122 #endif /* BIGGER */
123 
124 #endif /* __gnearch_h__ */
125 /*
126  * eof vim:nospell
127  */
Definition: adata.h:70
#define MAX_TXT
Definition: cohfit.h:27
int asqr
Definition: gnearch.h:27
struct gsplot * gsp_gcfile
Definition: gnearch.h:31
int nrows
Definition: gnearch.h:27
int pplt
Definition: gnearch.h:28
struct gpconf gpconf
int gplt
Definition: gnearch.h:28
int ncols
Definition: gnearch.h:27
Definition: gnearch.h:14
Definition: search.h:41