aerosandbox.tools.webplotdigitizer_reader
#
A series of utilities for working with CSV data extracted from WebPlotDigitizer.
https://automeris.io/WebPlotDigitizer/ https://github.com/ankitrohatgi/WebPlotDigitizer
Module Contents#
Functions#
Converts a string input to a float. If not possible, returns NaN. |
|
Removes any rows in a 2D ndarray where any of the entries are NaN. |
|
|
Reads a CSV file produced by WebPlotDigitizer (https://automeris.io/WebPlotDigitizer/). |
- aerosandbox.tools.webplotdigitizer_reader.string_to_float(s)[source]#
Converts a string input to a float. If not possible, returns NaN.
- Parameters:
s (str) –
- Return type:
float
- aerosandbox.tools.webplotdigitizer_reader.remove_nan_rows(a)[source]#
Removes any rows in a 2D ndarray where any of the entries are NaN.
- Parameters:
a (numpy.ndarray) –
- Return type:
numpy.ndarray
- aerosandbox.tools.webplotdigitizer_reader.read_webplotdigitizer_csv(filename)[source]#
Reads a CSV file produced by WebPlotDigitizer (https://automeris.io/WebPlotDigitizer/).
If there’s only one data series, produces a Dict with key “data” and value 2D ndarray.
If there are multiple data series, produces a Dict with keys of the names and values of 2D ndarrays.
2D ndarrays are sorted by their X-values before being returned.
- Parameters:
filename (Union[pathlib.Path, str]) – Filename, as a string or pathlib Path, or equivalent.
- Return type:
Dict[str, numpy.ndarray]
Returns: A dictionary where keys are series names and values are data points.