readgssi.plot

readgssi.plot.fmts = {'eps': 'Encapsulated Postscript', 'jpeg': 'Joint Photographic Experts Group', 'jpg': 'Joint Photographic Experts Group', 'pdf': 'Portable Document Format', 'pgf': 'PGF code for LaTeX', 'png': 'Portable Network Graphics', 'ps': 'Postscript', 'raw': 'Raw RGBA bitmap', 'rgba': 'Raw RGBA bitmap', 'svg': 'Scalable Vector Graphics', 'svgz': 'Scalable Vector Graphics', 'tif': 'Tagged Image File Format', 'tiff': 'Tagged Image File Format'}

contains several plotting functions

readgssi.plot.fmtst = '    eps         |  Encapsulated Postscript\n    jpg         |  Joint Photographic Experts Group\n    jpeg        |  Joint Photographic Experts Group\n    pdf         |  Portable Document Format\n    pgf         |  PGF code for LaTeX\n    png         |  Portable Network Graphics\n    ps          |  Postscript\n    raw         |  Raw RGBA bitmap\n    rgba        |  Raw RGBA bitmap\n    svg         |  Scalable Vector Graphics\n    svgz        |  Scalable Vector Graphics\n    tif         |  Tagged Image File Format\n    tiff        |  Tagged Image File Format\n'

contains several plotting functions

readgssi.plot.histogram(ar, verbose=True)

Shows a y-log histogram of data value distribution.

Parameters
  • ar (numpy.ndarray) – The radar array

  • verbose (bool) – Verbose, defaults to False

readgssi.plot.radargram(ar, ant, header, freq, figsize='auto', gain=1, stack=1, x='seconds', z='nanoseconds', title=True, colormap='gray', colorbar=False, absval=False, noshow=False, win=None, outfile='readgssi_plot', fmt='png', zero=2, zoom=[0, 0, 0, 0], dpi=150, showmarks=False, verbose=False)

Function that creates, modifies, and saves matplotlib plots of radargram images. For usage information, see Plotting radargrams.

Parameters
  • ar (numpy.ndarray) – The radar array

  • ant (int) – Antenna channel number

  • header (dict) – Radar file header dictionary

  • freq (int) – Antenna frequency

  • plotsize (float) – The height of the output plot in inches

  • gain (float) – The gain applied to the image. Must be positive but can be between 0 and 1 to reduce gain.

  • stack (int) – Number of times the file was stacked horizontally. Used to calculate traces on the X axis.

  • x (str) – The units to display on the x-axis during plotting. Defaults to x='seconds'. Acceptable values are x='distance' (which sets to meters), 'km', 'm', 'cm', 'mm', 'kilometers', 'meters', etc., for distance; 'seconds', 's', 'temporal' or 'time' for seconds, and 'traces', 'samples', 'pulses', or 'columns' for traces.

  • z (str) – The units to display on the z-axis during plotting. Defaults to z='nanoseconds'. Acceptable values are z='depth' (which sets to meters), 'm', 'cm', 'mm', 'meters', etc., for depth; 'nanoseconds', 'ns', 'temporal' or 'time' for seconds, and 'samples' or 'rows' for samples.

  • title (bool) – Whether to add a title to the figure. Defaults to True.

  • colormap (matplotlib.colors.Colormap) – The matplotlib colormap to use, defaults to ‘gray’ which is to say: the same as the default RADAN colormap

  • colorbar (bool) – Whether to draw the colorbar. Defaults to False.

  • absval (bool) – Whether to draw the array with an absolute value scale. Defaults to False.

  • noshow (bool) – Whether to suppress the matplotlib figure GUI window. Defaults to False, meaning the dialog will be displayed.

  • win (int) – Window size for background removal filter readgssi.filtering.bgr() to display in plot title.

  • outfile (str) – The name of the output file. Defaults to fmt=readgssi_plot (a filename readgssi_plot, not including the extension which is determined by the fmt variable, in the current directory).

  • fmt (str) – The format of the output file. Defaults to fmt='png'. Acceptable values come from matplotlib.backend_bases.FigureCanvasBase.get_supported_filetypes().

  • zero (int) – The zero point. This represents the number of samples sliced off the top of the profile by the timezero option in readgssi.readgssi.readgssi().

  • zoom (list[int,int,int,int]) – Zoom extents for matplotlib plots. Must pass a list of four integers: [left, right, up, down]. Since the z-axis begins at the top, the “up” value is actually the one that displays lower on the page. All four values are axis units, so if you are working in nanoseconds, 10 will set a limit 10 nanoseconds down. If your x-axis is in seconds, 6 will set a limit 6 seconds from the start of the survey. It may be helpful to display the matplotlib interactive window at full extents first, to determine appropriate extents to set for this parameter. If extents are set outside the boundaries of the image, they will be set back to the boundaries. If two extents on the same axis are the same, the program will default to plotting full extents for that axis.

  • dpi (int) – The dots per inch value to use when creating images. Defaults to 150.

  • showmarks (bool) – Whether to plot user marks as vertical lines. Defaults to False.

  • verbose (bool) – Verbose, defaults to False

readgssi.plot.spectrogram(ar, header, freq, tr='auto', verbose=True)

Displays a spectrogram of the center trace of the array. This is for testing purposes and not accessible from the command prompt.

Parameters
  • ar (numpy.ndarray) – The radar array

  • header (dict) – The file header dictionary

  • tr (int or str) – The trace to display the spectrogram for. Defaults to “auto” but can be an integer representing the trace number to plot. “auto” will pick a trace roughly halfway through the array.

  • verbose (bool) – Verbose, defaults to False