1 /*-------------------------------------------------------------------- 2 * 3 * Copyright (c) 1991-2021 by the GMT Team (https://www.generic-mapping-tools.org/team.html) 4 * See LICENSE.TXT file for copying and redistribution conditions. 5 * 6 * This program is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU Lesser General Public License as published by 8 * the Free Software Foundation; version 3 or any later version. 9 * 10 * This program is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU Lesser General Public License for more details. 14 * 15 * Contact info: www.generic-mapping-tools.org 16 *--------------------------------------------------------------------*/ 17 /* 18 * gmt_defaults.h contains definition of the structure with default settings. 19 * 20 * Author: Paul Wessel 21 * Date: 01-OCT-2009 22 * Version: 6 API 23 */ 24 25 /*! 26 * \file gmt_defaults.h 27 * \brief Definition of the structure with default settings. 28 */ 29 30 #ifndef GMT_DEFAULTS_H 31 #define GMT_DEFAULTS_H 32 33 /*-------------------------------------------------------------------- 34 * GMT DEFAULTS STRUCTURE DEFINITION 35 *--------------------------------------------------------------------*/ 36 37 /*! Information about a particular ellipsoid */ 38 struct ELLIPSOID { 39 /* Table taken from Snyder "Map projection - a working manual", p 12 Table 1 */ 40 char name[GMT_LEN64]; 41 int date; 42 double eq_radius; 43 double flattening; 44 }; 45 46 /*! Information about a particular datum */ 47 struct DATUM { 48 char name[GMT_LEN64]; /* Datum name */ 49 char ellipsoid[GMT_LEN64]; /* Ellipsoid GMT ID name */ 50 char region[GMT_LEN256]; /* Region of use */ 51 double xyz[3]; /* Coordinate shifts in meter for x, y, and z */ 52 }; 53 54 struct GMT_ENCODING { 55 char name[GMT_LEN64]; 56 int code[GMT_LEN8]; /* Codes for 7 symbols we plot but whose code depends on character set (ring, degree, colon, squote, dquote, minus, hyphen). */ 57 }; 58 59 /*! Holds all variables directly controlled by GMT Default parameters */ 60 struct GMT_DEFAULTS { 61 /* COLOR group [sorted by type to optimize storage] */ 62 unsigned int color_model; /* 1 = read RGB, 2 = use RGB, 4 = read HSV, 8 = use HSV, 16 = read CMYK, 32 = use CMYK [1+2] 63 * Add 128 to disallow output of color names */ 64 char cpt[GMT_LEN64]; /* Default CPT */ 65 char color_set[GMT_LEN256]; /* Default color list (or CPT) for automatic, sequential color choices */ 66 double color_patch[3][4]; /* Color of background, foreground, nan [black,white,127.5] */ 67 double color_hsv_min_s; /* For smallest or most negative intensity [1.0] */ 68 double color_hsv_max_s; /* For largest or most positive intensity [0.1] */ 69 double color_hsv_min_v; /* For smallest or most negative intensity [0.3] */ 70 double color_hsv_max_v; /* For largest or most positive intensity [1.0] */ 71 /* DIR group */ 72 /* FONT group */ 73 struct GMT_FONT font_annot[2]; /* Font for primary and secondary annotations [12p|14p,Helvetica,black] */ 74 struct GMT_FONT font_heading; /* Font for headings above subplots [32p,Helvetica,black] */ 75 struct GMT_FONT font_label; /* Font for labels [16p,Helvetica,black] */ 76 struct GMT_FONT font_logo; /* Font for GMT logo [8p,Helvetica,black] */ 77 struct GMT_FONT font_tag; /* Font for plot figure tags, e.g., a) [20p,Helvetica,black] */ 78 struct GMT_FONT font_subtitle; /* Font for plot titles [20p,Helvetica,black] */ 79 struct GMT_FONT font_title; /* Font for plot titles [24p,Helvetica,black] */ 80 /* FORMAT group */ 81 char format_clock_in[GMT_LEN64]; /* How to decode an incoming clock string [hh:mm:ss] */ 82 char format_clock_out[GMT_LEN64]; /* Controls how clocks are written on output [hh:mm:ss] */ 83 char format_clock_map[GMT_LEN64]; /* Controls how clocks are plotted on maps [hh:mm:ss] */ 84 char format_date_in[GMT_LEN64]; /* How to decode an incoming date string [yyyy-mm-dd] */ 85 char format_date_out[GMT_LEN64]; /* Controls how dates are written on output [yyyy-mm-dd] */ 86 char format_date_map[GMT_LEN64]; /* Controls how dates are plotted on maps [yyyy-mm-dd] */ 87 char format_geo_out[GMT_LEN64]; /* Controls how degrees are written on output [000 = dd.xxxx] */ 88 char format_geo_map[GMT_LEN64]; /* Controls how degrees are plotted on maps [020 = dd:mm:ss as in old DEGREE_FORMAT = 0] */ 89 char format_float_out[GMT_LEN64]; /* Default double output format [%g] */ 90 char format_float_out_orig[GMT_LEN256]; /* User-specified format for all columns */ 91 char format_float_map[GMT_LEN64]; /* Default double plot format [%g] */ 92 char format_time[2][GMT_LEN64]; /* Controls annotation format for Months/Weeks/Weekdays for primary and secondary axes */ 93 char format_time_stamp[GMT_LEN256]; /* Specify the format for writing time stamps (see strftime) */ 94 /* GMT group */ 95 size_t url_size_limit; 96 unsigned int refresh_time; /* Only refresh server catalog when the local copy is this old in days) */ 97 unsigned int compatibility; /* Choose between 4 (GMT4) and up to latest version (5 for now) */ 98 unsigned int auto_download; /* 0 (GMT_NO_DOWNLOAD) or 1 (GMT_YES_DOWNLOAD): For auto-download of known files */ 99 unsigned int interpolant; /* Choose between 0 (Linear), 1 (Akima), or 2 (Cubic spline) */ 100 unsigned int triangulate; /* 0 for Watson [Default], 1 for Shewchuk (if configured) */ 101 unsigned int verbose; /* Level of verbosity 0-4 [1] */ 102 unsigned int fft; /* Any of FFT_implementations: k_fft_auto, k_fft_accelerate, k_fft_fftw3, k_fft_kiss, k_fft_brenner */ 103 unsigned int fftw_plan; /* Only accessed if HAVE_FFTW3F is defined: Any of FFTW_planner_flags: FFTW_ESTIMATE, FFTW_MEASURE, FFTW_PATIENT, FFTW_EXHAUSTIVE */ 104 unsigned int run_mode; /* Either classic [0] or modern [1] */ 105 bool update_theme; /* Refresh defaults with contents of selected theme */ 106 bool use_modern_name; /* true if we should use the modern name in usage message */ 107 double extrapolate_val[2];/* Choose between [0] = 0, 1D extrapolated vals are NaN, = 1 -> extrapolate, = 2 -> set to const stored in [1] */ 108 bool fftwf_threads; /* Only accessed if HAVE_FFTW3F_THREADS is defined: Any of FFTW_planner_flags: FFTW_ESTIMATE, FFTW_MEASURE, FFTW_PATIENT, FFTW_EXHAUSTIVE */ 109 unsigned int history; /* mode to pass information via history file gmt.history (GMT_HISTORY_OFF, GMT_HISTORY_READ, GMT_HISTORY_WRITE) */ 110 unsigned int history_orig; /* Copy of history */ 111 unsigned int export_type; /* What data type to export to external APIs [GMT_DOUBLE] */ 112 double graphics_dpu; /* The default target image dpu when not specifying grid resolution [GMT_IMAGE_DPU_VALUE] */ 113 char graphics_dpu_unit; /* The unit we selected [GMT_IMAGE_DPU_UNIT] */ 114 unsigned graphics_format; /* The default graphics format in modern mode [GMT_SESSION_FORMAT] */ 115 int max_cores; /* The maximum number of cores for a multi-threaded module [GMT_MAX_CORES] */ 116 char theme[GMT_LEN64]; /* User-selected defaults theme */ 117 /* IO group */ 118 uint64_t n_bin_header_cols; /* Minimum number of columns in a binary file for which the all cols == NaN means segment header [2] */ 119 unsigned int io_n_header_items; /* Number of header records expected when -h is used [1]; else 0 */ 120 unsigned int io_nan_mode; /* -s: 1 means skip NaN (x,y) records on output, 2 = inverse (only output nan-records; -sr), 0 reports all records */ 121 size_t io_nc4_chunksize[2]; /* NetCDF chunk size (lat,lon) on output [0] */ 122 unsigned int io_nc4_deflation_level;/* NetCDF deflation level on output [0] */ 123 unsigned int io_first_header; /* 2 means never write single-segment header, 1 means we always write segment header, 0 means write if needed [0] */ 124 bool io_gridfile_shorthand; /* Use shorthand suffix notation for embedded grid file formats [false] */ 125 bool io_header[2]; /* Input & Output data has header records [false, false] */ 126 bool io_header_orig; /* Copy of Input io_header */ 127 bool io_nan_records; /* Determines what NaNs in input records should mean (beyond skipping the record) */ 128 bool io_lonlat_toggle[2]; /* true means read/write I/O as lat/lon instead of lon/lat [false,false] */ 129 bool io_blankline[2]; /* true means blank lines should be treated as segment breaks [false,false] */ 130 bool io_nanline[2]; /* true means lines with all NaNs should be treated as segment breaks [false,false] */ 131 char io_col_separator[GMT_LEN8]; /* Separator between output ASCII data columns [tab] */ 132 char io_gridfile_format[GMT_LEN64]; /* Default grid file format */ 133 char io_seg_marker[2]; /* Character used to recognize and write segment headers [>,>] */ 134 char io_head_marker_in[GMT_LEN32]; /* Characters used to recognize input header records [#%!;"'] */ 135 char io_head_marker_out; /* Character used to recognize and write header records [#,#] */ 136 /* MAP group */ 137 char map_annot_min_spacing_txt[GMT_LEN16]; /* Text version of this setting */ 138 double map_annot_offset[2]; /* Distance between primary or secondary annotation and tickmarks [5p/5p] */ 139 double map_annot_min_angle; /* If angle between map boundary and annotation is less, no annotation is drawn [20] */ 140 double map_annot_min_spacing; /* If an annotation is closer that this to an older annotation, the annotation is skipped [0.0] */ 141 double map_frame_percent; /* Percentage of fancy map frame width to actually draw [100] */ 142 double map_frame_width; /* Thickness of fancy map frame [5p] */ 143 double map_grid_cross_size[2]; /* Size of primary & secondary gridcrosses. 0 means draw continuous gridlines */ 144 double map_heading_offset; /* Distance between top of panel title and base of subplot heading [18p] */ 145 double map_label_offset[2]; /* Distance between lowermost annotation and top of label [8p/8p] */ 146 double map_line_step; /* Maximum straight linesegment length for arcuate lines [0.75p] */ 147 double map_logo_pos[2]; /* Where to plot timestamp relative to origin [BL/-54p/-54p] */ 148 double map_origin[2]; /* x- and y-origin of plot, i.e. where lower left corner plots on paper [1i/1i] */ 149 double map_polar_cap[2]; /* Latitude of polar cap and delta_lon for gridline spacing [85/90] */ 150 double map_scale_height; /* Height of map scale drawn on a map [0.075] */ 151 double map_tick_length[4]; /* Length of primary and secondary major and minor tickmarks [5p/2.5p/15p/3.75p] */ 152 double map_title_offset; /* Distance between lowermost annotation (or label) and base of plot title [14p] */ 153 double map_vector_shape; /* 0.0 = straight vectorhead, 1.0 = arrowshape, with continuous range in between */ 154 double map_graph_extension; /* If map_frame_type is graph, how must longer to make axis length. [7.5%] */ 155 unsigned int map_annot_oblique; /* Controls annotations and tick angles etc. [GMT_OBL_ANNOT_ANYWHERE] */ 156 unsigned int map_grid_cross_type[2]; /* 0 = normal cross, 1 = symmetric tick, 2 = asymmetric tick */ 157 unsigned int map_logo_justify; /* Justification of the GMT timestamp box [1 (BL)] */ 158 unsigned int map_frame_type; /* Fancy (0), plain (1), or graph (2) [0] */ 159 unsigned int map_graph_extension_unit; /* If map_frame_type is graph, the unit is GMT_CM, GMT_INCH, GMT_PT [%] */ 160 double map_label_mode[2]; /* If label is relative to annotation (0) or axis (1) for x/t [0/0] */ 161 bool map_annot_oblique_set; /* true if user changed map_annot_oblique via a gmt.conf or --par=val */ 162 bool map_logo; /* Plot time and map projection on map [false] */ 163 struct GMT_PEN map_default_pen; /* Default pen for most pens [0.25p] */ 164 struct GMT_PEN map_frame_pen; /* Pen attributes for map boundary [1.25p] */ 165 struct GMT_PEN map_grid_pen[2]; /* Pen attributes for primary and secondary gridlines [default,black/thinner,black] */ 166 struct GMT_PEN map_tick_pen[2]; /* Pen attributes for primary and secondary tickmarks [thinner,black] */ 167 char map_frame_axes[6]; /* Which axes to draw and annotate ["WESNZ"] */ 168 char map_annot_ortho[6]; /* Which axes have orthogonal annotations in linear projections ["we"] */ 169 enum GMT_enum_symbol { gmt_none = -1, gmt_ring, gmt_degree, gmt_colon, gmt_squote, gmt_dquote, gmt_minus, gmt_hyphen, gmt_lastsym } map_degree_symbol; 170 /* PROJ group */ 171 double proj_scale_factor; /* Central mapscale factor, typically 0.9996-1 (or -1 for default action) */ 172 unsigned int proj_ellipsoid; /* Which ellipsoid to use [0 = GRS 80] */ 173 unsigned int proj_length_unit; /* Choose 0 (cm), 1 (inch), 2 (m) or 3 (point) [1] */ 174 enum GMT_enum_radius proj_mean_radius; /* Choose 0 (mean), 1 (authalic), 2 (volumetric), 3 (meridional) or 4 (quadratic) [0] */ 175 enum GMT_enum_latswap proj_aux_latitude; /* Choose GMT_LATSWAP_NONE, GMT_LATSWAP_G2A, GMT_LATSWAP_G2C, GMT_LATSWAP_G2M, GMT_LATSWAP_G2O, GMT_LATSWAP_G2P [GMT_LATSWAP_NONE] */ 176 enum GMT_enum_geodesic proj_geodesic; /* Choose GMT_GEODESIC_EXACT, GMT_GEODESIC_APPROXIMATE, GMT_GEODESIC_VINCENTY, GMT_GEODESIC_RUDOE, GMT_GEODESIC_ANDOYER [GMT_GEODESIC_EXACT] */ 177 struct DATUM proj_datum[GMT_N_DATUMS]; /* Datum parameters */ 178 struct ELLIPSOID ref_ellipsoid[GMT_N_ELLIPSOIDS]; /* Ellipsoid parameters */ 179 /* PS group [These are arguments to pass to PSL_beginsession and PSL_setdefaults] */ 180 /* [All other internal PSL settings are set directly when parsing PSL settings ] */ 181 double ps_def_page_size[2]; /* Default Width and height of paper to plot on in points [Letter or A4] */ 182 double ps_page_size[2]; /* Width and height of paper to plot on in points [Letter or A4] */ 183 double ps_page_rgb[4]; /* Default paper color [white] */ 184 double ps_magnify[2]; /* Width and height of paper to plot on in points [Letter or A4] */ 185 double ps_transparency; /* Later transparency [0] */ 186 double ps_penwidth; /* Current pen width */ 187 unsigned int ps_color_mode; /* Postscript encoding of color [PSL_RGB | PSL_CMYK | PSL_HSV | PSL_GRAY] */ 188 unsigned int ps_copies; /* How man copies of each plot [>=1] [GMT4 COMPATIBILITY ONLY] */ 189 int ps_media; /* Default paper media [25(Letter)]; negative if custom size */ 190 unsigned int ps_orientation; /* Orientation of page [PSL_LANDSCAPE (0)] or PSL_PORTRAIT (1) */ 191 bool ps_comments; /* true if we write comments in the PS file */ 192 char ps_transpmode[GMT_LEN16]; /* Transparency mode for PDF only */ 193 char ps_convert[GMT_LEN256]; /* Arguments for implicit psconvert calls under modern mode [""] */ 194 struct GMT_ENCODING ps_encoding; 195 /* TIME group */ 196 enum GMT_enum_tictoc timer_mode; /* Choose GMT_NO_TIMER, GMT_ABS_TIMER, GMT_ELAPSED_TIMER [GMT_NO_TIMER] */ 197 double time_interval_fraction; /* How much of a partial interval is needed in order to annotate it */ 198 bool time_is_interval; /* Does a time given as a month (or year or day) mean the middle of the interval? */ 199 bool time_leap_seconds; /* Do we need to worry about leap seconds? */ 200 unsigned int time_week_start; /* Which day (Sun = 0, Sat = 7) is start of week */ 201 unsigned int time_Y2K_offset_year; /* Cutoff for making 4-digit years from 2-digit years (1900 vs 2000) */ 202 struct GMT_TIME_SYSTEM time_system; /* All the information about the selected time system */ 203 char language[GMT_LEN64]; /* Language file for localization support */ 204 /* Related parameters */ 205 char given_unit[GMT_N_KEYS]; /* Unit given or implied for each setting */ 206 }; 207 208 #endif /* GMT_DEFAULTS_H */ 209